From 13a153aff2d303c2f8e46073be77cb490ef605ec Mon Sep 17 00:00:00 2001 From: isaac <> Date: Fri, 15 May 2026 19:07:27 +0800 Subject: [PATCH] WIP --- .../BrowserUI/Sources/BrowserMarkdown.swift | 48 +- .../Sources/Node/ChatListItemStrings.swift | 175 +- .../Sources/InstantPageLayout.swift | 79 +- .../Sources/InstantPageLayoutSpacings.swift | 154 +- .../Sources/InstantPageTextItem.swift | 5 +- submodules/TelegramApi/Sources/Api0.swift | 62 +- submodules/TelegramApi/Sources/Api11.swift | 134 +- submodules/TelegramApi/Sources/Api12.swift | 330 +- submodules/TelegramApi/Sources/Api13.swift | 1005 +- submodules/TelegramApi/Sources/Api14.swift | 1731 +- submodules/TelegramApi/Sources/Api15.swift | 4658 ++--- submodules/TelegramApi/Sources/Api16.swift | 5227 ++++-- submodules/TelegramApi/Sources/Api17.swift | 3363 ++-- submodules/TelegramApi/Sources/Api18.swift | 2447 +-- submodules/TelegramApi/Sources/Api19.swift | 3696 ++-- submodules/TelegramApi/Sources/Api20.swift | 3626 ++-- submodules/TelegramApi/Sources/Api21.swift | 2280 ++- submodules/TelegramApi/Sources/Api22.swift | 2002 +- submodules/TelegramApi/Sources/Api23.swift | 2386 +-- submodules/TelegramApi/Sources/Api24.swift | 2654 +-- submodules/TelegramApi/Sources/Api25.swift | 2985 +-- submodules/TelegramApi/Sources/Api26.swift | 3092 ++- submodules/TelegramApi/Sources/Api27.swift | 3343 ++-- submodules/TelegramApi/Sources/Api28.swift | 8214 ++------ submodules/TelegramApi/Sources/Api29.swift | 9810 +++++++--- submodules/TelegramApi/Sources/Api30.swift | 3830 ++-- submodules/TelegramApi/Sources/Api31.swift | 2711 +-- submodules/TelegramApi/Sources/Api32.swift | 2467 +-- submodules/TelegramApi/Sources/Api33.swift | 2871 ++- submodules/TelegramApi/Sources/Api34.swift | 2877 +-- submodules/TelegramApi/Sources/Api35.swift | 3235 ++-- submodules/TelegramApi/Sources/Api36.swift | 2622 +-- submodules/TelegramApi/Sources/Api37.swift | 3731 ++-- submodules/TelegramApi/Sources/Api38.swift | 4023 ++-- submodules/TelegramApi/Sources/Api39.swift | 3569 ++-- submodules/TelegramApi/Sources/Api4.swift | 22 +- submodules/TelegramApi/Sources/Api40.swift | 15650 ++-------------- submodules/TelegramApi/Sources/Api41.swift | 1071 ++ submodules/TelegramApi/Sources/Api42.swift | 14093 ++++++++++++++ submodules/TelegramApi/Sources/Api5.swift | 42 +- .../Sources/Account/AccountManager.swift | 1 + .../Sources/ApiUtils/InstantPage.swift | 242 +- .../Sources/ApiUtils/RichText.swift | 143 +- .../ApiUtils/StoreMessage_Telegram.swift | 8 +- .../PendingMessages/EnqueueMessage.swift | 4 + .../PendingUpdateMessageManager.swift | 8 +- .../PendingMessages/RequestEditMessage.swift | 26 +- .../StandaloneSendMessage.swift | 12 +- .../Sources/State/PendingMessageManager.swift | 6 +- .../Sources/State/Serialization.swift | 2 +- .../Sources/State/UpdateMessageService.swift | 4 +- .../SyncCore_RichTextMessageAttribute.swift | 90 + .../TelegramEngine/Messages/Message.swift | 3 + .../TelegramEngine/Messages/Polls.swift | 2 +- .../Messages/TelegramEngineMessages.swift | 4 +- .../Peers/ChannelSendRestriction.swift | 2 +- .../TelegramEngine/Peers/JoinChannel.swift | 83 +- .../TelegramEngine/Peers/JoinLink.swift | 31 +- .../Sources/Utils/MessageUtils.swift | 11 + .../Sources/ChatMessageBubbleItemNode.swift | 27 +- ...ChatMessageRichDataBubbleContentNode.swift | 2 +- .../Chat/ChatControllerLoadDisplayNode.swift | 2 +- .../ChatControllerOpenTodoContextMenu.swift | 1 + .../TelegramUI/Sources/ChatController.swift | 6 +- .../Sources/ChatControllerAdminBanUsers.swift | 6 +- .../Sources/ChatControllerNode.swift | 72 +- .../ChatControllerOpenAttachmentMenu.swift | 1 + 67 files changed, 64681 insertions(+), 62438 deletions(-) create mode 100644 submodules/TelegramApi/Sources/Api41.swift create mode 100644 submodules/TelegramApi/Sources/Api42.swift create mode 100644 submodules/TelegramCore/Sources/SyncCore/SyncCore_RichTextMessageAttribute.swift diff --git a/submodules/BrowserUI/Sources/BrowserMarkdown.swift b/submodules/BrowserUI/Sources/BrowserMarkdown.swift index d5669a19c7..5b0a5ed65f 100644 --- a/submodules/BrowserUI/Sources/BrowserMarkdown.swift +++ b/submodules/BrowserUI/Sources/BrowserMarkdown.swift @@ -333,7 +333,7 @@ private enum MarkdownTaskListState { private final class MarkdownConversionContext { private let context: AccountContext - fileprivate let documentURL: URL + fileprivate let documentURL: URL? fileprivate let formulasByPlaceholder: [String: MarkdownFormulaDescriptor] fileprivate let budget: MarkdownConversionBudget private var nextRemoteMediaId: Int64 = 0 @@ -341,7 +341,7 @@ private final class MarkdownConversionContext { private(set) var media: [EngineMedia.Id: EngineRawMedia] = [:] - init(context: AccountContext, documentURL: URL, formulasByPlaceholder: [String: MarkdownFormulaDescriptor], budget: MarkdownConversionBudget) { + init(context: AccountContext, documentURL: URL?, formulasByPlaceholder: [String: MarkdownFormulaDescriptor], budget: MarkdownConversionBudget) { self.context = context self.documentURL = documentURL self.formulasByPlaceholder = formulasByPlaceholder @@ -977,14 +977,27 @@ func markdownWebpage(context: AccountContext, file: FileMediaReference) -> (webP guard let data = try? Data(contentsOf: fileURL) else { return nil } - guard let webPage = markdownWebpage(context: context, file: file, fileURL: fileURL, data: data) else { + guard let webPage = markdownWebpage(context: context, file: (file, fileURL), data: data) else { return nil } return (webPage, fileURL) } +public func inputRichTextAttributeFromText(context: AccountContext, text: String) -> RichTextMessageAttribute? { + guard #available(iOS 15.0, *) else { + return nil + } + guard let data = text.data(using: .utf8) else { + return nil + } + guard let webpage = markdownWebpage(context: context, file: nil, data: data), case let .Loaded(content) = webpage.content, let instantPage = content.instantPage else { + return nil + } + return RichTextMessageAttribute(instantPage: instantPage._parse()) +} + @available(iOS 15.0, *) -private func markdownWebpage(context: AccountContext, file: FileMediaReference, fileURL: URL, data: Data) -> TelegramMediaWebpage? { +private func markdownWebpage(context: AccountContext, file: (file: FileMediaReference, url: URL)?, data: Data) -> TelegramMediaWebpage? { let limits = markdownSafetyLimits guard markdownPassesPreflight(data: data, limits: limits) else { return nil @@ -996,17 +1009,23 @@ private func markdownWebpage(context: AccountContext, file: FileMediaReference, let attributedString: NSAttributedString do { + let baseURL: URL? + if let file { + baseURL = file.url.deletingLastPathComponent() + } else { + baseURL = nil + } attributedString = try NSAttributedString( markdown: Data(preparedSource.text.utf8), options: .init(), - baseURL: fileURL.deletingLastPathComponent() + baseURL: baseURL ) } catch { return nil } let budget = MarkdownConversionBudget(limits: limits) - let conversionContext = MarkdownConversionContext(context: context, documentURL: fileURL, formulasByPlaceholder: preparedSource.formulasByPlaceholder, budget: budget) + let conversionContext = MarkdownConversionContext(context: context, documentURL: file?.url, formulasByPlaceholder: preparedSource.formulasByPlaceholder, budget: budget) guard let pageResult = markdownPageResult(from: attributedString, context: conversionContext) else { return nil } @@ -1015,14 +1034,17 @@ private func markdownWebpage(context: AccountContext, file: FileMediaReference, return nil } - let title = markdownTitle(from: blocks, file: file, fileURL: fileURL) + var title: String? + if let file { + title = markdownTitle(from: blocks, file: file.file, fileURL: file.url) + } let text = markdownFirstParagraphText(from: blocks) let instantPage = InstantPage( blocks: blocks, media: pageResult.media, isComplete: true, rtl: false, - url: fileURL.absoluteString, + url: file?.url.absoluteString ?? "", views: nil ) @@ -1030,8 +1052,8 @@ private func markdownWebpage(context: AccountContext, file: FileMediaReference, webpageId: EngineMedia.Id(namespace: 0, id: 0), content: .Loaded( TelegramMediaWebpageLoadedContent( - url: fileURL.absoluteString, - displayUrl: fileURL.absoluteString, + url: file?.url.absoluteString ?? "", + displayUrl: file?.url.absoluteString ?? "", hash: 0, type: "article", websiteName: nil, @@ -1764,7 +1786,7 @@ private func markdownInlineImageDimensions(attributes: [NSAttributedString.Key: return PixelDimensions(width: side, height: side) } -private func markdownLink(attributes: [NSAttributedString.Key: Any], documentURL: URL) -> String? { +private func markdownLink(attributes: [NSAttributedString.Key: Any], documentURL: URL?) -> String? { if let value = attributes[markdownLinkAttribute] as? URL { return markdownNormalizedLink(value, documentURL: documentURL) } @@ -1783,14 +1805,14 @@ private func markdownLink(attributes: [NSAttributedString.Key: Any], documentURL return nil } -private func markdownNormalizedLink(_ url: URL, documentURL: URL) -> String { +private func markdownNormalizedLink(_ url: URL, documentURL: URL?) -> String { if url.baseURL != nil { let relative = url.relativeString if relative.hasPrefix("#") { return relative } } - if let fragment = url.fragment, markdownMatchesDocument(url, documentURL: documentURL) { + if let documentURL, let fragment = url.fragment, markdownMatchesDocument(url, documentURL: documentURL) { return "#\(fragment)" } return url.absoluteString diff --git a/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift b/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift index b3b24b0048..27bbea7777 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift @@ -77,6 +77,176 @@ private func paidContentGroupType(paidContent: TelegramMediaPaidContent) -> Mess return currentType } +extension RichText { + func previewText() -> String { + switch self { + case .empty: + return "" + case let .plain(value): + return value + case let .bold(value): + return value.previewText() + case let .italic(value): + return value.previewText() + case let .underline(value): + return value.previewText() + case let .strikethrough(value): + return value.previewText() + case let .fixed(value): + return value.previewText() + case let .url(value, _, _): + return value.previewText() + case let .email(value, _): + return value.previewText() + case let .concat(values): + var result = "" + for value in values { + result.append(value.previewText()) + } + return result + case let .`subscript`(value): + return value.previewText() + case let .superscript(value): + return value.previewText() + case let .marked(value): + return value.previewText() + case let .phone(value, _): + return value.previewText() + case .image: + //TODO:localize + return "Photo" + case let .anchor(value, _): + return value.previewText() + case let .formula(latex): + return latex + } + } +} + +extension InstantPageListItem { + func previewText() -> String { + switch self { + case .unknown: + return "" + case let .text(text, num): + if let num, !num.isEmpty { + return "\(num). \(text.previewText())" + } else { + return text.previewText() + } + case let .blocks(blocks, num): + var blocksText = "" + for block in blocks { + if !blocksText.isEmpty { + blocksText.append("\n") + } + blocksText.append(block.previewText()) + } + if let num { + return "\(num). \(blocksText)" + } else { + return blocksText + } + } + } +} + +extension InstantPageBlock { + func previewText() -> String { + switch self { + case .unsupported: + return "" + case let .title(text): + return text.previewText() + case let .subtitle(text): + return text.previewText() + case let .authorDate(author, _): + return author.previewText() + case let .header(text): + return text.previewText() + case let .subheader(text): + return text.previewText() + case let .heading(text, _): + return text.previewText() + case let .formula(latex): + return latex + case let .paragraph(text): + return text.previewText() + case let .preformatted(text, _): + return text.previewText() + case let .footer(text): + return text.previewText() + case .divider: + return "\n" + case .anchor: + return "" + case let .list(items, _): + var result = "" + for item in items { + if !result.isEmpty { + result.append("\n") + } + result.append(item.previewText()) + } + return result + case let .blockQuote(text, caption): + return text.previewText() + caption.previewText() + case let .pullQuote(text, caption): + return text.previewText() + caption.previewText() + case .image(_, _, _, _): + //TODO:localize + return "Photo" + case .video(_, _, _, _): + //TODO:localize + return "Video" + case .audio: + //TODO:localize + return "Audio" + case .cover: + return "" + case .webEmbed: + return "" + case .postEmbed: + return "" + case .collage: + return "" + case .slideshow: + return "" + case .channelBanner: + return "" + case .kicker: + return "" + case .table: + //TODO:localize + return "Table" + case .details: + return "" + case .relatedArticles: + return "" + case .map: + //TODO:localize + return "Map" + } + } +} + +extension InstantPage { + func previewText() -> String { + let maxLength: Int = 200 + var result = "" + for block in self.blocks { + if !result.isEmpty { + result.append("\n") + } + result.append(block.previewText()) + if result.count > maxLength { + break + } + } + return result + } +} + public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, dateTimeFormat: PresentationDateTimeFormat, contentSettings: ContentSettings, messages: [EngineMessage], chatPeer: EngineRenderedPeer, accountPeerId: EnginePeer.Id, enableMediaEmoji: Bool = true, isPeerGroup: Bool = false) -> (peer: EnginePeer?, hideAuthor: Bool, messageText: String, messageEntities: [MessageTextEntity], spoilers: [NSRange]?, customEmojiRanges: [(NSRange, ChatTextInputTextCustomEmojiAttribute)]?) { let peer: EnginePeer? @@ -103,7 +273,10 @@ public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder: messageText = "" for message in messages { - if !message.text.isEmpty { + if let richText = message.richText { + messageText = richText.instantPage.previewText() + messageEntities = [] + } else if !message.text.isEmpty { messageText = message.text messageEntities = message._asMessage().textEntitiesAttribute?.entities ?? [] for entity in messageEntities { diff --git a/submodules/InstantPageUI/Sources/InstantPageLayout.swift b/submodules/InstantPageUI/Sources/InstantPageLayout.swift index d511a57a4a..090dadfd43 100644 --- a/submodules/InstantPageUI/Sources/InstantPageLayout.swift +++ b/submodules/InstantPageUI/Sources/InstantPageLayout.swift @@ -165,7 +165,7 @@ private func instantPageFirstTextLineMidY(in items: [InstantPageItem]) -> CGFloa return nil } -public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: MediaResourceUserLocation, rtl: Bool, block: InstantPageBlock, boundingWidth: CGFloat, horizontalInset: CGFloat, safeInset: CGFloat, isCover: Bool, previousItems: [InstantPageItem], fillToSize: CGSize?, media: [EngineMedia.Id: EngineMedia], mediaIndexCounter: inout Int, embedIndexCounter: inout Int, detailsIndexCounter: inout Int, theme: InstantPageTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, webEmbedHeights: [Int : CGFloat] = [:], cachedMessageSyntaxHighlight: CachedMessageSyntaxHighlight? = nil, excludeCaptions: Bool, isLast: Bool) -> InstantPageLayout { +public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: MediaResourceUserLocation, rtl: Bool, block: InstantPageBlock, boundingWidth: CGFloat, horizontalInset: CGFloat, safeInset: CGFloat, isCover: Bool, previousItems: [InstantPageItem], fillToSize: CGSize?, media: [EngineMedia.Id: EngineMedia], mediaIndexCounter: inout Int, embedIndexCounter: inout Int, detailsIndexCounter: inout Int, theme: InstantPageTheme, strings: PresentationStrings, dateTimeFormat: PresentationDateTimeFormat, webEmbedHeights: [Int : CGFloat] = [:], cachedMessageSyntaxHighlight: CachedMessageSyntaxHighlight? = nil, excludeCaptions: Bool, isLast: Bool, fitToWidth: Bool) -> InstantPageLayout { let layoutCaption: (InstantPageCaption, CGSize) -> ([InstantPageItem], CGSize) = { caption, contentSize in var items: [InstantPageItem] = [] var offset = contentSize.height @@ -177,7 +177,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: offset += 14.0 let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .caption, link: false) - let (textItem, captionItems, captionContentSize) = layoutTextItemWithString(attributedStringForRichText(caption.text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: offset), media: media, webpage: webpage) + let (textItem, captionItems, captionContentSize) = layoutTextItemWithString(attributedStringForRichText(caption.text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: offset), media: media, webpage: webpage, fitToWidth: fitToWidth) contentSize.height += captionContentSize.height offset += captionContentSize.height items.append(contentsOf: captionItems) @@ -196,7 +196,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: } let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .credit, link: false) - let (_, captionItems, captionContentSize) = layoutTextItemWithString(attributedStringForRichText(caption.credit, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, alignment: rtl ? .right : .natural, offset: CGPoint(x: horizontalInset, y: offset), media: media, webpage: webpage) + let (_, captionItems, captionContentSize) = layoutTextItemWithString(attributedStringForRichText(caption.credit, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, alignment: rtl ? .right : .natural, offset: CGPoint(x: horizontalInset, y: offset), media: media, webpage: webpage, fitToWidth: fitToWidth) contentSize.height += captionContentSize.height offset += captionContentSize.height items.append(contentsOf: captionItems) @@ -217,16 +217,16 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: switch block { case let .cover(block): - return layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: block, boundingWidth: boundingWidth, horizontalInset: horizontalInset, safeInset: safeInset, isCover: true, previousItems:previousItems, fillToSize: fillToSize, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: true) + return layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: block, boundingWidth: boundingWidth, horizontalInset: horizontalInset, safeInset: safeInset, isCover: true, previousItems:previousItems, fillToSize: fillToSize, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: true, fitToWidth: fitToWidth) case let .title(text): let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .header, link: false) - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) case let .subtitle(text): let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .subheader, link: false) - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) case let .authorDate(author: author, date: date): let styleStack = InstantPageTextStyleStack() @@ -265,7 +265,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: if let previousItem = previousItems.last as? InstantPageTextItem, previousItem.containsRTL { previousItemHasRTL = true } - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, alignment: rtl || previousItemHasRTL ? .right : .natural, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, alignment: rtl || previousItemHasRTL ? .right : .natural, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) } else { return InstantPageLayout(origin: CGPoint(), contentSize: CGSize(), items: []) @@ -273,22 +273,22 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: case let .kicker(text): let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .kicker, link: false) - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) case let .header(text): let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .header, link: false) - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) case let .subheader(text): let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .subheader, link: false) - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) case let .heading(text, level): let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, attributes: theme.headingTextAttributes(level: level, link: false)) - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) case let .formula(latex): let styleStack = InstantPageTextStyleStack() @@ -298,7 +298,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: let fontSize = (attributes[NSAttributedString.Key.font] as? UIFont)?.pointSize ?? theme.textCategories.paragraph.font.size guard let attachment = instantPageMathAttachment(latex: latex, fontSize: fontSize, textColor: textColor, mode: .block) else { - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(.plain(latex), styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(.plain(latex), styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) } @@ -324,7 +324,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: case let .paragraph(text): let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .paragraph, link: false) - let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, horizontalInset: horizontalInset, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage) + let (_, items, contentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, horizontalInset: horizontalInset, offset: CGPoint(x: horizontalInset, y: 0.0), media: media, webpage: webpage, fitToWidth: fitToWidth) return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) case let .preformatted(text, language): let backgroundInset: CGFloat = 14.0 @@ -342,6 +342,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: offset: CGPoint(x: 17.0, y: backgroundInset), media: media, webpage: webpage, + fitToWidth: fitToWidth, opaqueBackground: true ) let backgroundItem = InstantPageShapeItem(frame: CGRect(origin: CGPoint(), size: CGSize(width: boundingWidth, height: contentSize.height + backgroundInset * 2.0)), shapeFrame: CGRect(origin: CGPoint(), size: CGSize(width: boundingWidth, height: contentSize.height + backgroundInset * 2.0)), shape: .rect, color: theme.codeBlockBackgroundColor) @@ -407,7 +408,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: } else { value = "\(i + 1)." } - let (textItem, _, _) = layoutTextItemWithString(attributedStringForRichText(.plain(value), styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint()) + let (textItem, _, _) = layoutTextItemWithString(attributedStringForRichText(.plain(value), styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, offset: CGPoint(), fitToWidth: fitToWidth) if let textItem = textItem, let line = textItem.lines.first { textItem.selectable = false maxIndexWidth = max(maxIndexWidth, line.frame.width) @@ -420,8 +421,12 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: } let indexSpacing: CGFloat = ordered ? (hasTaskMarkers ? 16.0 : 12.0) : (hasTaskMarkers ? 24.0 : 20.0) for (i, item) in contentItems.enumerated() { - if (i != 0) { - contentSize.height += 18.0 + if i != 0 { + if fitToWidth { + contentSize.height += 12.0 + } else { + contentSize.height += 18.0 + } } let styleStack = InstantPageTextStyleStack() setupStyleStack(styleStack, theme: theme, category: .paragraph, link: false) @@ -432,7 +437,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: } switch effectiveItem { case let .text(text, _): - let (textItem, textItems, textItemSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - indexSpacing - maxIndexWidth, offset: CGPoint(x: horizontalInset + indexSpacing + maxIndexWidth, y: contentSize.height), media: media, webpage: webpage) + let (textItem, textItems, textItemSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - indexSpacing - maxIndexWidth, offset: CGPoint(x: horizontalInset + indexSpacing + maxIndexWidth, y: contentSize.height), media: media, webpage: webpage, fitToWidth: fitToWidth) contentSize.height += textItemSize.height let indexItem = indexItems[i] @@ -467,9 +472,9 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: var firstBlockLineMidY: CGFloat? for i in 0 ..< blocks.count { let subBlock = blocks[i] - let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subBlock, boundingWidth: boundingWidth - horizontalInset * 2.0 - indexSpacing - maxIndexWidth, horizontalInset: 0.0, safeInset: 0.0, isCover: false, previousItems: listItems, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == blocks.count - 1) + let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subBlock, boundingWidth: boundingWidth - horizontalInset * 2.0 - indexSpacing - maxIndexWidth, horizontalInset: 0.0, safeInset: 0.0, isCover: false, previousItems: listItems, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == blocks.count - 1, fitToWidth: fitToWidth) - let spacing: CGFloat = previousBlock != nil && subLayout.contentSize.height > 0.0 ? spacingBetweenBlocks(upper: previousBlock, lower: subBlock) : 0.0 + let spacing: CGFloat = previousBlock != nil && subLayout.contentSize.height > 0.0 ? spacingBetweenBlocks(upper: previousBlock, lower: subBlock, fitToWidth: fitToWidth) : 0.0 let blockItems = subLayout.flattenedItemsWithOrigin(CGPoint(x: horizontalInset + indexSpacing + maxIndexWidth, y: contentSize.height + spacing)) if previousBlock == nil { originY += spacing @@ -520,7 +525,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: setupStyleStack(styleStack, theme: theme, category: .paragraph, link: false) styleStack.push(.italic) - let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - lineInset, offset: CGPoint(x: horizontalInset + lineInset, y: contentSize.height), media: media, webpage: webpage) + let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - lineInset, offset: CGPoint(x: horizontalInset + lineInset, y: contentSize.height), media: media, webpage: webpage, fitToWidth: fitToWidth) contentSize.height += textContentSize.height items.append(contentsOf: textItems) @@ -554,7 +559,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: setupStyleStack(styleStack, theme: theme, category: .paragraph, link: false) styleStack.push(.italic) - let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, alignment: .center, offset: CGPoint(x: 0.0, y: contentSize.height), media: media, webpage: webpage) + let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(text, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0, alignment: .center, offset: CGPoint(x: 0.0, y: contentSize.height), media: media, webpage: webpage, fitToWidth: fitToWidth) for var item in textItems { item.frame = item.frame.offsetBy(dx: horizontalInset, dy: 0.0) } @@ -684,7 +689,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: var i = 0 for subItem in innerItems { let frame = mosaicLayout[i].0 - let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subItem, boundingWidth: frame.width, horizontalInset: 0.0, safeInset: 0.0, isCover: false, previousItems: items, fillToSize: frame.size, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: true, isLast: false) + let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subItem, boundingWidth: frame.width, horizontalInset: 0.0, safeInset: 0.0, isCover: false, previousItems: items, fillToSize: frame.size, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: true, isLast: false, fitToWidth: false) items.append(contentsOf: subLayout.flattenedItemsWithOrigin(frame.origin)) i += 1 } @@ -731,7 +736,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: setupStyleStack(styleStack, theme: theme, category: .paragraph, link: false) styleStack.push(.bold) - let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(.plain(author), styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - lineInset - avatarInset, offset: CGPoint(x: horizontalInset + lineInset + avatarInset, y: contentSize.height + avatarVerticalInset), media: media, webpage: webpage) + let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(.plain(author), styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - lineInset - avatarInset, offset: CGPoint(x: horizontalInset + lineInset + avatarInset, y: contentSize.height + avatarVerticalInset), media: media, webpage: webpage, fitToWidth: fitToWidth) items.append(contentsOf: textItems) contentSize.height += textContentSize.height + avatarVerticalInset @@ -759,9 +764,9 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: var previousBlock: InstantPageBlock? for i in 0 ..< blocks.count { let subBlock = blocks[i] - let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subBlock, boundingWidth: boundingWidth - horizontalInset * 2.0 - lineInset, horizontalInset: 0.0, safeInset: 0.0, isCover: false, previousItems: items, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == blocks.count - 1) + let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subBlock, boundingWidth: boundingWidth - horizontalInset * 2.0 - lineInset, horizontalInset: 0.0, safeInset: 0.0, isCover: false, previousItems: items, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == blocks.count - 1, fitToWidth: fitToWidth) - let spacing = spacingBetweenBlocks(upper: previousBlock, lower: subBlock) + let spacing = spacingBetweenBlocks(upper: previousBlock, lower: subBlock, fitToWidth: false) let blockItems = subLayout.flattenedItemsWithOrigin(CGPoint(x: horizontalInset + lineInset, y: contentSize.height + spacing)) items.append(contentsOf: blockItems) contentSize.height += subLayout.contentSize.height + spacing @@ -943,9 +948,9 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: var previousBlock: InstantPageBlock? for i in 0 ..< blocks.count { let subBlock = blocks[i] - let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subBlock, boundingWidth: boundingWidth, horizontalInset: horizontalInset, safeInset: safeInset, isCover: false, previousItems: subitems, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &subDetailsIndex, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == blocks.count - 1) + let subLayout = layoutInstantPageBlock(webpage: webpage, userLocation: userLocation, rtl: rtl, block: subBlock, boundingWidth: boundingWidth, horizontalInset: horizontalInset, safeInset: safeInset, isCover: false, previousItems: subitems, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &subDetailsIndex, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == blocks.count - 1, fitToWidth: fitToWidth) - let spacing = spacingBetweenBlocks(upper: previousBlock, lower: subBlock) + let spacing = spacingBetweenBlocks(upper: previousBlock, lower: subBlock, fitToWidth: false) let blockItems = subLayout.flattenedItemsWithOrigin(CGPoint(x: 0.0, y: contentSize.height + spacing)) subitems.append(contentsOf: blockItems) contentSize.height += subLayout.contentSize.height + spacing @@ -953,7 +958,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: } if !blocks.isEmpty { - let closingSpacing = spacingBetweenBlocks(upper: previousBlock, lower: nil) + let closingSpacing = spacingBetweenBlocks(upper: previousBlock, lower: nil, fitToWidth: false) contentSize.height += closingSpacing } @@ -971,7 +976,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: setupStyleStack(styleStack, theme: theme, category: .paragraph, link: false) styleStack.push(.bold) let backgroundInset: CGFloat = 14.0 - let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(title, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - backgroundInset * 2.0, offset: CGPoint(x: horizontalInset, y: backgroundInset), media: media, webpage: webpage, opaqueBackground: true) + let (_, textItems, textContentSize) = layoutTextItemWithString(attributedStringForRichText(title, styleStack: styleStack), boundingWidth: boundingWidth - horizontalInset * 2.0 - backgroundInset * 2.0, offset: CGPoint(x: horizontalInset, y: backgroundInset), media: media, webpage: webpage, fitToWidth: fitToWidth, opaqueBackground: true) let backgroundItem = InstantPageShapeItem(frame: CGRect(origin: CGPoint(), size: CGSize(width: boundingWidth, height: textContentSize.height + backgroundInset * 2.0)), shapeFrame: CGRect(origin: CGPoint(), size: CGSize(width: boundingWidth, height: textContentSize.height + backgroundInset * 2.0)), shape: .rect, color: theme.panelBackgroundColor) items.append(backgroundItem) items.append(contentsOf: textItems) @@ -1054,7 +1059,7 @@ public func layoutInstantPageBlock(webpage: TelegramMediaWebpage, userLocation: } } -public func instantPageLayoutForWebPage(_ webPage: TelegramMediaWebpage, instantPage: InstantPage?, userLocation: MediaResourceUserLocation, boundingWidth: CGFloat, sideInset: CGFloat, safeInset: CGFloat, strings: PresentationStrings, theme: InstantPageTheme, dateTimeFormat: PresentationDateTimeFormat, webEmbedHeights: [Int : CGFloat] = [:], cachedMessageSyntaxHighlight: CachedMessageSyntaxHighlight? = nil, addFeedback: Bool = true) -> InstantPageLayout { +public func instantPageLayoutForWebPage(_ webPage: TelegramMediaWebpage, instantPage: InstantPage?, userLocation: MediaResourceUserLocation, boundingWidth: CGFloat, sideInset: CGFloat, safeInset: CGFloat, strings: PresentationStrings, theme: InstantPageTheme, dateTimeFormat: PresentationDateTimeFormat, webEmbedHeights: [Int : CGFloat] = [:], cachedMessageSyntaxHighlight: CachedMessageSyntaxHighlight? = nil, addFeedback: Bool = true, fitToWidth: Bool = false) -> InstantPageLayout { var maybeLoadedContent: TelegramMediaWebpageLoadedContent? if case let .Loaded(content) = webPage.content { maybeLoadedContent = content @@ -1084,8 +1089,8 @@ public func instantPageLayoutForWebPage(_ webPage: TelegramMediaWebpage, instant var previousBlock: InstantPageBlock? for i in 0 ..< pageBlocks.count { let block = pageBlocks[i] - let blockLayout = layoutInstantPageBlock(webpage: webPage, userLocation: userLocation, rtl: rtl, block: block, boundingWidth: boundingWidth, horizontalInset: sideInset + safeInset, safeInset: safeInset, isCover: false, previousItems: items, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == pageBlocks.count - 1) - let spacing = spacingBetweenBlocks(upper: previousBlock, lower: block) + let blockLayout = layoutInstantPageBlock(webpage: webPage, userLocation: userLocation, rtl: rtl, block: block, boundingWidth: boundingWidth, horizontalInset: sideInset + safeInset, safeInset: safeInset, isCover: false, previousItems: items, fillToSize: nil, media: media, mediaIndexCounter: &mediaIndexCounter, embedIndexCounter: &embedIndexCounter, detailsIndexCounter: &detailsIndexCounter, theme: theme, strings: strings, dateTimeFormat: dateTimeFormat, webEmbedHeights: webEmbedHeights, cachedMessageSyntaxHighlight: cachedMessageSyntaxHighlight, excludeCaptions: false, isLast: i == pageBlocks.count - 1, fitToWidth: fitToWidth) + let spacing = spacingBetweenBlocks(upper: previousBlock, lower: block, fitToWidth: fitToWidth) let blockItems = blockLayout.flattenedItemsWithOrigin(CGPoint(x: 0.0, y: contentSize.height + spacing)) items.append(contentsOf: blockItems) if CGFloat(0.0).isLess(than: blockLayout.contentSize.height) { @@ -1094,7 +1099,7 @@ public func instantPageLayoutForWebPage(_ webPage: TelegramMediaWebpage, instant } } - let closingSpacing = spacingBetweenBlocks(upper: previousBlock, lower: nil) + let closingSpacing = spacingBetweenBlocks(upper: previousBlock, lower: nil, fitToWidth: fitToWidth) contentSize.height += closingSpacing if webPage.webpageId.id != 0 && addFeedback { @@ -1103,5 +1108,13 @@ public func instantPageLayoutForWebPage(_ webPage: TelegramMediaWebpage, instant items.append(feedbackItem) } + if fitToWidth { + contentSize.width = 0.0 + for item in items { + contentSize.width = max(contentSize.width, ceil(item.frame.maxX) + sideInset) + } + contentSize.width = min(contentSize.width, boundingWidth) + } + return InstantPageLayout(origin: CGPoint(), contentSize: contentSize, items: items) } diff --git a/submodules/InstantPageUI/Sources/InstantPageLayoutSpacings.swift b/submodules/InstantPageUI/Sources/InstantPageLayoutSpacings.swift index 6536f2a200..aba31661e7 100644 --- a/submodules/InstantPageUI/Sources/InstantPageLayoutSpacings.swift +++ b/submodules/InstantPageUI/Sources/InstantPageLayoutSpacings.swift @@ -2,82 +2,114 @@ import Foundation import UIKit import TelegramCore -func spacingBetweenBlocks(upper: InstantPageBlock?, lower: InstantPageBlock?) -> CGFloat { - if let upper = upper, let lower = lower { +func spacingBetweenBlocks(upper: InstantPageBlock?, lower: InstantPageBlock?, fitToWidth: Bool) -> CGFloat { + if let upper, let lower { switch (upper, lower) { - case (_, .cover), (_, .channelBanner), (.details, .details), (.relatedArticles, _), (_, .anchor): - return 0.0 - case (.divider, _), (_, .divider): + case (_, .cover), (_, .channelBanner), (.details, .details), (.relatedArticles, _), (_, .anchor): + return 0.0 + case (.divider, _), (_, .divider): + if fitToWidth { + return 10.0 + } else { return 25.0 - case (_, .blockQuote), (.blockQuote, _), (_, .pullQuote), (.pullQuote, _): - return 27.0 - case (.kicker, .title), (.cover, .title): - return 16.0 - case (_, .title): - return 20.0 - case (.title, .authorDate), (.subtitle, .authorDate): - return 18.0 - case (_, .authorDate): - return 20.0 - case (.title, .paragraph), (.authorDate, .paragraph): - return 34.0 - case (.header, .paragraph), (.subheader, .paragraph), (.heading, .paragraph): + } + case (_, .blockQuote), (.blockQuote, _), (_, .pullQuote), (.pullQuote, _): + return 27.0 + case (.kicker, .title), (.cover, .title): + return 16.0 + case (_, .title): + return 20.0 + case (.title, .authorDate), (.subtitle, .authorDate): + return 18.0 + case (_, .authorDate): + return 20.0 + case (.title, .paragraph), (.authorDate, .paragraph): + return 34.0 + case (.header, .paragraph), (.subheader, .paragraph), (.heading, .paragraph): + if fitToWidth { + return 10.0 + } else { return 25.0 - case (.list, .paragraph): - return 31.0 - case (.preformatted, .paragraph): - return 19.0 - case (.formula, .paragraph): - return 19.0 - case (.paragraph, .paragraph): + } + case (.list, .paragraph): + return 31.0 + case (.preformatted, .paragraph): + return 19.0 + case (.formula, .paragraph): + return 19.0 + case (.paragraph, .paragraph): + if fitToWidth { + return 10.0 + } else { return 25.0 - case (_, .paragraph): - return 20.0 - case (.title, .formula), (.authorDate, .formula): - return 34.0 - case (.header, .formula), (.subheader, .formula), (.heading, .formula): + } + case (_, .paragraph): + return 20.0 + case (.title, .formula), (.authorDate, .formula): + return 34.0 + case (.header, .formula), (.subheader, .formula), (.heading, .formula): + if fitToWidth { + return 10.0 + } else { return 25.0 - case (.list, .formula): - return 31.0 - case (.preformatted, .formula): - return 19.0 - case (.paragraph, .formula): - return 19.0 - case (_, .formula): - return 20.0 - case (.title, .list), (.authorDate, .list): - return 34.0 - case (.header, .list), (.subheader, .list), (.heading, .list): - return 31.0 - case (.preformatted, .list): - return 19.0 - case (.formula, .list): + } + case (.list, .formula): + return 31.0 + case (.preformatted, .formula): + return 19.0 + case (.paragraph, .formula): + return 19.0 + case (_, .formula): + return 20.0 + case (.title, .list), (.authorDate, .list): + return 34.0 + case (.header, .list), (.subheader, .list), (.heading, .list): + return 31.0 + case (.preformatted, .list): + return 19.0 + case (.formula, .list): + if fitToWidth { + return 10.0 + } else { return 25.0 - case (_, .list): + } + case (_, .list): + if fitToWidth { + return 10.0 + } else { return 25.0 - case (.paragraph, .preformatted): - return 19.0 - case (.formula, .preformatted): - return 19.0 - case (_, .preformatted): - return 20.0 - case (_, .header), (_, .subheader), (_, .heading): - return 32.0 - default: - return 20.0 + } + case (.paragraph, .preformatted): + return 19.0 + case (.formula, .preformatted): + return 19.0 + case (_, .preformatted): + return 20.0 + case (_, .header), (_, .subheader), (_, .heading): + return 32.0 + default: + return 20.0 } - } else if let lower = lower { + } else if let lower { switch lower { - case .cover, .channelBanner, .details, .anchor: - return 0.0 - default: + case .cover, .channelBanner, .details, .anchor: + return 0.0 + default: + if fitToWidth { + return 10.0 + } else { return 25.0 + } } } else { if let upper = upper, case .relatedArticles = upper { return 0.0 } else { - return 25.0 + if fitToWidth { + return 10.0 + } else { + return 25.0 + } } } } diff --git a/submodules/InstantPageUI/Sources/InstantPageTextItem.swift b/submodules/InstantPageUI/Sources/InstantPageTextItem.swift index 10826a6c94..10c25b0b16 100644 --- a/submodules/InstantPageUI/Sources/InstantPageTextItem.swift +++ b/submodules/InstantPageUI/Sources/InstantPageTextItem.swift @@ -820,7 +820,7 @@ func attributedStringForRichText(_ text: RichText, styleStack: InstantPageTextSt } } -func layoutTextItemWithString(_ string: NSAttributedString, boundingWidth: CGFloat, horizontalInset: CGFloat = 0.0, alignment: NSTextAlignment = .natural, offset: CGPoint, media: [EngineMedia.Id: EngineMedia] = [:], webpage: TelegramMediaWebpage? = nil, minimizeWidth: Bool = false, maxNumberOfLines: Int = 0, opaqueBackground: Bool = false) -> (InstantPageTextItem?, [InstantPageItem], CGSize) { +func layoutTextItemWithString(_ string: NSAttributedString, boundingWidth: CGFloat, horizontalInset: CGFloat = 0.0, alignment: NSTextAlignment = .natural, offset: CGPoint, media: [EngineMedia.Id: EngineMedia] = [:], webpage: TelegramMediaWebpage? = nil, minimizeWidth: Bool = false, fitToWidth: Bool = false, maxNumberOfLines: Int = 0, opaqueBackground: Bool = false) -> (InstantPageTextItem?, [InstantPageItem], CGSize) { if string.length == 0 { return (nil, [], CGSize()) } @@ -1091,6 +1091,9 @@ func layoutTextItemWithString(_ string: NSAttributedString, boundingWidth: CGFlo } var textWidth = boundingWidth + if fitToWidth { + textWidth = maxLineWidth + } var requiresScroll = false if (!imageItems.isEmpty || !formulaItems.isEmpty) && maxLineWidth > boundingWidth + 10.0 { textWidth = maxLineWidth diff --git a/submodules/TelegramApi/Sources/Api0.swift b/submodules/TelegramApi/Sources/Api0.swift index fd0a5e29ee..8544a3fa01 100644 --- a/submodules/TelegramApi/Sources/Api0.swift +++ b/submodules/TelegramApi/Sources/Api0.swift @@ -211,7 +211,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1605510357] = { return Api.ChatAdminRights.parse_chatAdminRights($0) } dict[-219353309] = { return Api.ChatAdminWithInvites.parse_chatAdminWithInvites($0) } dict[-1626209256] = { return Api.ChatBannedRights.parse_chatBannedRights($0) } - dict[-455036259] = { return Api.ChatFull.parse_channelFull($0) } + dict[-1605464774] = { return Api.ChatFull.parse_channelFull($0) } dict[640893467] = { return Api.ChatFull.parse_chatFull($0) } dict[1553807106] = { return Api.ChatInvite.parse_chatInvite($0) } dict[1516793212] = { return Api.ChatInvite.parse_chatInviteAlready($0) } @@ -232,7 +232,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[878246344] = { return Api.ChatTheme.parse_chatThemeUniqueGift($0) } dict[-1390068360] = { return Api.CodeSettings.parse_codeSettings($0) } dict[-870702050] = { return Api.Config.parse_config($0) } - dict[-849058964] = { return Api.ConnectedBot.parse_connectedBot($0) } + dict[54448129] = { return Api.ConnectedBot.parse_connectedBot($0) } dict[429997937] = { return Api.ConnectedBotStarRef.parse_connectedBotStarRef($0) } dict[341499403] = { return Api.Contact.parse_contact($0) } dict[496600883] = { return Api.ContactBirthday.parse_contactBirthday($0) } @@ -443,6 +443,8 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1548122514] = { return Api.InputNotifyPeer.parse_inputNotifyForumTopic($0) } dict[-1195615476] = { return Api.InputNotifyPeer.parse_inputNotifyPeer($0) } dict[423314455] = { return Api.InputNotifyPeer.parse_inputNotifyUsers($0) } + dict[2105227266] = { return Api.InputPageListOrderedItem.parse_inputPageListOrderedItemBlocks($0) } + dict[-1682665696] = { return Api.InputPageListOrderedItem.parse_inputPageListOrderedItemText($0) } dict[1528613672] = { return Api.InputPasskeyCredential.parse_inputPasskeyCredentialFirebasePNV($0) } dict[1009235855] = { return Api.InputPasskeyCredential.parse_inputPasskeyCredentialPublicKey($0) } dict[-1021329078] = { return Api.InputPasskeyResponse.parse_inputPasskeyResponseLogin($0) } @@ -493,6 +495,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[1003796418] = { return Api.InputReplyTo.parse_inputReplyToMessage($0) } dict[1775660101] = { return Api.InputReplyTo.parse_inputReplyToMonoForum($0) } dict[1484862010] = { return Api.InputReplyTo.parse_inputReplyToStory($0) } + dict[-1865309654] = { return Api.InputRichMessage.parse_inputRichMessage($0) } dict[-251549057] = { return Api.InputSavedStarGift.parse_inputSavedStarGiftChat($0) } dict[545636920] = { return Api.InputSavedStarGift.parse_inputSavedStarGiftSlug($0) } dict[1764202389] = { return Api.InputSavedStarGift.parse_inputSavedStarGiftUser($0) } @@ -548,6 +551,10 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[736157604] = { return Api.JSONValue.parse_jsonNumber($0) } dict[-1715350371] = { return Api.JSONValue.parse_jsonObject($0) } dict[-1222740358] = { return Api.JSONValue.parse_jsonString($0) } + dict[-1374344599] = { return Api.JoinChatBotResult.parse_joinChatBotResultApproved($0) } + dict[251265428] = { return Api.JoinChatBotResult.parse_joinChatBotResultDeclined($0) } + dict[-1734105024] = { return Api.JoinChatBotResult.parse_joinChatBotResultQueued($0) } + dict[-689719277] = { return Api.JoinChatBotResult.parse_joinChatBotResultWebView($0) } dict[45580630] = { return Api.KeyboardButton.parse_inputKeyboardButtonRequestPeer($0) } dict[1744911986] = { return Api.KeyboardButton.parse_inputKeyboardButtonUrlAuth($0) } dict[2103314375] = { return Api.KeyboardButton.parse_inputKeyboardButtonUserProfile($0) } @@ -585,7 +592,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1098720356] = { return Api.MediaArea.parse_mediaAreaVenue($0) } dict[1235637404] = { return Api.MediaArea.parse_mediaAreaWeather($0) } dict[-808853502] = { return Api.MediaAreaCoordinates.parse_mediaAreaCoordinates($0) } - dict[-1779470549] = { return Api.Message.parse_message($0) } + dict[1979759059] = { return Api.Message.parse_message($0) } dict[-1868117372] = { return Api.Message.parse_messageEmpty($0) } dict[2055212554] = { return Api.Message.parse_messageService($0) } dict[-872240531] = { return Api.MessageAction.parse_messageActionBoostApply($0) } @@ -746,6 +753,11 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1261946036] = { return Api.NotifyPeer.parse_notifyUsers($0) } dict[1001931436] = { return Api.OutboxReadDate.parse_outboxReadDate($0) } dict[-1738178803] = { return Api.Page.parse_page($0) } + dict[-1715334046] = { return Api.PageBlock.parse_inputPageBlockAudio($0) } + dict[1464557951] = { return Api.PageBlock.parse_inputPageBlockMap($0) } + dict[-1186155733] = { return Api.PageBlock.parse_inputPageBlockOrderedList($0) } + dict[719646565] = { return Api.PageBlock.parse_inputPageBlockPhoto($0) } + dict[-249943466] = { return Api.PageBlock.parse_inputPageBlockVideo($0) } dict[-837994576] = { return Api.PageBlock.parse_pageBlockAnchor($0) } dict[-2143067670] = { return Api.PageBlock.parse_pageBlockAudio($0) } dict[-1162877472] = { return Api.PageBlock.parse_pageBlockAuthorDate($0) } @@ -759,9 +771,16 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-229005301] = { return Api.PageBlock.parse_pageBlockEmbedPost($0) } dict[1216809369] = { return Api.PageBlock.parse_pageBlockFooter($0) } dict[-1076861716] = { return Api.PageBlock.parse_pageBlockHeader($0) } + dict[-1157691601] = { return Api.PageBlock.parse_pageBlockHeading1($0) } + dict[158018284] = { return Api.PageBlock.parse_pageBlockHeading2($0) } + dict[1743204781] = { return Api.PageBlock.parse_pageBlockHeading3($0) } + dict[-1254983893] = { return Api.PageBlock.parse_pageBlockHeading4($0) } + dict[-608277398] = { return Api.PageBlock.parse_pageBlockHeading5($0) } + dict[1747599785] = { return Api.PageBlock.parse_pageBlockHeading6($0) } dict[504660880] = { return Api.PageBlock.parse_pageBlockKicker($0) } dict[-454524911] = { return Api.PageBlock.parse_pageBlockList($0) } dict[-1538310410] = { return Api.PageBlock.parse_pageBlockMap($0) } + dict[1493699616] = { return Api.PageBlock.parse_pageBlockMath($0) } dict[-1702174239] = { return Api.PageBlock.parse_pageBlockOrderedList($0) } dict[1182402406] = { return Api.PageBlock.parse_pageBlockParagraph($0) } dict[391759200] = { return Api.PageBlock.parse_pageBlockPhoto($0) } @@ -776,10 +795,10 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[324435594] = { return Api.PageBlock.parse_pageBlockUnsupported($0) } dict[2089805750] = { return Api.PageBlock.parse_pageBlockVideo($0) } dict[1869903447] = { return Api.PageCaption.parse_pageCaption($0) } - dict[635466748] = { return Api.PageListItem.parse_pageListItemBlocks($0) } - dict[-1188055347] = { return Api.PageListItem.parse_pageListItemText($0) } - dict[-1730311882] = { return Api.PageListOrderedItem.parse_pageListOrderedItemBlocks($0) } - dict[1577484359] = { return Api.PageListOrderedItem.parse_pageListOrderedItemText($0) } + dict[1674209194] = { return Api.PageListItem.parse_pageListItemBlocks($0) } + dict[794323004] = { return Api.PageListItem.parse_pageListItemText($0) } + dict[1109995988] = { return Api.PageListOrderedItem.parse_pageListOrderedItemBlocks($0) } + dict[-851533770] = { return Api.PageListOrderedItem.parse_pageListOrderedItemText($0) } dict[-1282352120] = { return Api.PageRelatedArticle.parse_pageRelatedArticle($0) } dict[878078826] = { return Api.PageTableCell.parse_pageTableCell($0) } dict[-524237339] = { return Api.PageTableRow.parse_pageTableRow($0) } @@ -922,15 +941,19 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1258914157] = { return Api.RequirementToContact.parse_requirementToContactPaidMessages($0) } dict[-444472087] = { return Api.RequirementToContact.parse_requirementToContactPremium($0) } dict[-797791052] = { return Api.RestrictionReason.parse_restrictionReason($0) } + dict[-1158439541] = { return Api.RichMessage.parse_richMessage($0) } + dict[764156522] = { return Api.RichText.parse_inputTextImage($0) } dict[894777186] = { return Api.RichText.parse_textAnchor($0) } dict[1730456516] = { return Api.RichText.parse_textBold($0) } dict[2120376535] = { return Api.RichText.parse_textConcat($0) } + dict[-1570679104] = { return Api.RichText.parse_textCustomEmoji($0) } dict[-564523562] = { return Api.RichText.parse_textEmail($0) } dict[-599948721] = { return Api.RichText.parse_textEmpty($0) } dict[1816074681] = { return Api.RichText.parse_textFixed($0) } dict[136105807] = { return Api.RichText.parse_textImage($0) } dict[-653089380] = { return Api.RichText.parse_textItalic($0) } dict[55281185] = { return Api.RichText.parse_textMarked($0) } + dict[-1657885545] = { return Api.RichText.parse_textMath($0) } dict[483104362] = { return Api.RichText.parse_textPhone($0) } dict[1950782688] = { return Api.RichText.parse_textPlain($0) } dict[-1678197867] = { return Api.RichText.parse_textStrike($0) } @@ -1109,7 +1132,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1964652166] = { return Api.Update.parse_updateBotBusinessConnect($0) } dict[-1177566067] = { return Api.Update.parse_updateBotCallbackQuery($0) } dict[-1873947492] = { return Api.Update.parse_updateBotChatBoost($0) } - dict[299870598] = { return Api.Update.parse_updateBotChatInviteRequester($0) } + dict[2092125561] = { return Api.Update.parse_updateBotChatInviteRequester($0) } dict[1299263278] = { return Api.Update.parse_updateBotCommands($0) } dict[-1607821266] = { return Api.Update.parse_updateBotDeleteBusinessMessage($0) } dict[132077692] = { return Api.Update.parse_updateBotEditBusinessMessage($0) } @@ -1177,6 +1200,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-667783411] = { return Api.Update.parse_updateGroupCallMessage($0) } dict[-219423922] = { return Api.Update.parse_updateGroupCallParticipants($0) } dict[1763610706] = { return Api.Update.parse_updateInlineBotCallbackQuery($0) } + dict[-1112768912] = { return Api.Update.parse_updateJoinChatWebViewDecision($0) } dict[1442983757] = { return Api.Update.parse_updateLangPack($0) } dict[1180041828] = { return Api.Update.parse_updateLangPackTooLong($0) } dict[1448076945] = { return Api.Update.parse_updateLoginToken($0) } @@ -1189,6 +1213,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1618924792] = { return Api.Update.parse_updateMonoForumNoPaidException($0) } dict[-2030252155] = { return Api.Update.parse_updateMoveStickerSetToTop($0) } dict[-1991136273] = { return Api.Update.parse_updateNewAuthorization($0) } + dict[-1306491994] = { return Api.Update.parse_updateNewBotConnection($0) } dict[1656358105] = { return Api.Update.parse_updateNewChannelMessage($0) } dict[314359194] = { return Api.Update.parse_updateNewEncryptedMessage($0) } dict[522914557] = { return Api.Update.parse_updateNewMessage($0) } @@ -1257,6 +1282,8 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[88680979] = { return Api.Update.parse_updateUserPhone($0) } dict[-440534818] = { return Api.Update.parse_updateUserStatus($0) } dict[706199388] = { return Api.Update.parse_updateUserTyping($0) } + dict[335872721] = { return Api.Update.parse_updateWebBrowserException($0) } + dict[-1013306658] = { return Api.Update.parse_updateWebBrowserSettings($0) } dict[2139689491] = { return Api.Update.parse_updateWebPage($0) } dict[361936797] = { return Api.Update.parse_updateWebViewResultSent($0) } dict[2027216577] = { return Api.Updates.parse_updateShort($0) } @@ -1290,6 +1317,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1493633966] = { return Api.WebAuthorization.parse_webAuthorization($0) } dict[475467473] = { return Api.WebDocument.parse_webDocument($0) } dict[-104284986] = { return Api.WebDocument.parse_webDocumentNoProxy($0) } + dict[-1824741993] = { return Api.WebDomainException.parse_webDomainException($0) } dict[-392411726] = { return Api.WebPage.parse_webPage($0) } dict[555358088] = { return Api.WebPage.parse_webPageEmpty($0) } dict[1930545681] = { return Api.WebPage.parse_webPageNotModified($0) } @@ -1341,6 +1369,8 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-842824308] = { return Api.account.WallPapers.parse_wallPapers($0) } dict[471437699] = { return Api.account.WallPapers.parse_wallPapersNotModified($0) } dict[-313079300] = { return Api.account.WebAuthorizations.parse_webAuthorizations($0) } + dict[2045480115] = { return Api.account.WebBrowserSettings.parse_webBrowserSettings($0) } + dict[-1021538482] = { return Api.account.WebBrowserSettings.parse_webBrowserSettingsNotModified($0) } dict[1822232318] = { return Api.aicompose.Tones.parse_tones($0) } dict[-1040948989] = { return Api.aicompose.Tones.parse_tonesNotModified($0) } dict[782418132] = { return Api.auth.Authorization.parse_authorization($0) } @@ -1452,6 +1482,8 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-1231326505] = { return Api.messages.ChatAdminsWithInvites.parse_chatAdminsWithInvites($0) } dict[-438840932] = { return Api.messages.ChatFull.parse_chatFull($0) } dict[-2118733814] = { return Api.messages.ChatInviteImporters.parse_chatInviteImporters($0) } + dict[1146512295] = { return Api.messages.ChatInviteJoinResult.parse_chatInviteJoinResultOk($0) } + dict[2001452532] = { return Api.messages.ChatInviteJoinResult.parse_chatInviteJoinResultWebView($0) } dict[1694474197] = { return Api.messages.Chats.parse_chats($0) } dict[-1663561404] = { return Api.messages.Chats.parse_chatsSlice($0) } dict[-1571952873] = { return Api.messages.CheckedHistoryImportPeer.parse_checkedHistoryImportPeer($0) } @@ -1998,6 +2030,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.InputNotifyPeer: _1.serialize(buffer, boxed) + case let _1 as Api.InputPageListOrderedItem: + _1.serialize(buffer, boxed) case let _1 as Api.InputPasskeyCredential: _1.serialize(buffer, boxed) case let _1 as Api.InputPasskeyResponse: @@ -2020,6 +2054,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.InputReplyTo: _1.serialize(buffer, boxed) + case let _1 as Api.InputRichMessage: + _1.serialize(buffer, boxed) case let _1 as Api.InputSavedStarGift: _1.serialize(buffer, boxed) case let _1 as Api.InputSecureFile: @@ -2058,6 +2094,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.JSONValue: _1.serialize(buffer, boxed) + case let _1 as Api.JoinChatBotResult: + _1.serialize(buffer, boxed) case let _1 as Api.KeyboardButton: _1.serialize(buffer, boxed) case let _1 as Api.KeyboardButtonRow: @@ -2240,6 +2278,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.RestrictionReason: _1.serialize(buffer, boxed) + case let _1 as Api.RichMessage: + _1.serialize(buffer, boxed) case let _1 as Api.RichText: _1.serialize(buffer, boxed) case let _1 as Api.SavedContact: @@ -2428,6 +2468,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.WebDocument: _1.serialize(buffer, boxed) + case let _1 as Api.WebDomainException: + _1.serialize(buffer, boxed) case let _1 as Api.WebPage: _1.serialize(buffer, boxed) case let _1 as Api.WebPageAttribute: @@ -2492,6 +2534,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.account.WebAuthorizations: _1.serialize(buffer, boxed) + case let _1 as Api.account.WebBrowserSettings: + _1.serialize(buffer, boxed) case let _1 as Api.aicompose.Tones: _1.serialize(buffer, boxed) case let _1 as Api.auth.Authorization: @@ -2628,6 +2672,8 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.messages.ChatInviteImporters: _1.serialize(buffer, boxed) + case let _1 as Api.messages.ChatInviteJoinResult: + _1.serialize(buffer, boxed) case let _1 as Api.messages.Chats: _1.serialize(buffer, boxed) case let _1 as Api.messages.CheckedHistoryImportPeer: diff --git a/submodules/TelegramApi/Sources/Api11.swift b/submodules/TelegramApi/Sources/Api11.swift index dc425a13f2..2d6b640d41 100644 --- a/submodules/TelegramApi/Sources/Api11.swift +++ b/submodules/TelegramApi/Sources/Api11.swift @@ -1451,85 +1451,131 @@ public extension Api { } } public extension Api { - enum InputPasskeyCredential: TypeConstructorDescription { - public class Cons_inputPasskeyCredentialFirebasePNV: TypeConstructorDescription { - public var pnvToken: String - public init(pnvToken: String) { - self.pnvToken = pnvToken + indirect enum InputPageListOrderedItem: TypeConstructorDescription { + public class Cons_inputPageListOrderedItemBlocks: TypeConstructorDescription { + public var flags: Int32 + public var blocks: [Api.PageBlock] + public var value: Int32? + public var type: String? + public init(flags: Int32, blocks: [Api.PageBlock], value: Int32?, type: String?) { + self.flags = flags + self.blocks = blocks + self.value = value + self.type = type } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", ConstructorParameterDescription(self.pnvToken))]) + return ("inputPageListOrderedItemBlocks", [("flags", ConstructorParameterDescription(self.flags)), ("blocks", ConstructorParameterDescription(self.blocks)), ("value", ConstructorParameterDescription(self.value)), ("type", ConstructorParameterDescription(self.type))]) } } - public class Cons_inputPasskeyCredentialPublicKey: TypeConstructorDescription { - 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 + public class Cons_inputPageListOrderedItemText: TypeConstructorDescription { + public var flags: Int32 + public var text: Api.RichText + public var value: Int32? + public var type: String? + public init(flags: Int32, text: Api.RichText, value: Int32?, type: String?) { + self.flags = flags + self.text = text + self.value = value + self.type = type } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPasskeyCredentialPublicKey", [("id", ConstructorParameterDescription(self.id)), ("rawId", ConstructorParameterDescription(self.rawId)), ("response", ConstructorParameterDescription(self.response))]) + return ("inputPageListOrderedItemText", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("value", ConstructorParameterDescription(self.value)), ("type", ConstructorParameterDescription(self.type))]) } } - case inputPasskeyCredentialFirebasePNV(Cons_inputPasskeyCredentialFirebasePNV) - case inputPasskeyCredentialPublicKey(Cons_inputPasskeyCredentialPublicKey) + case inputPageListOrderedItemBlocks(Cons_inputPageListOrderedItemBlocks) + case inputPageListOrderedItemText(Cons_inputPageListOrderedItemText) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .inputPasskeyCredentialFirebasePNV(let _data): + case .inputPageListOrderedItemBlocks(let _data): if boxed { - buffer.appendInt32(1528613672) + buffer.appendInt32(2105227266) + } + 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) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.value!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.type!, buffer: buffer, boxed: false) } - serializeString(_data.pnvToken, buffer: buffer, boxed: false) break - case .inputPasskeyCredentialPublicKey(let _data): + case .inputPageListOrderedItemText(let _data): if boxed { - buffer.appendInt32(1009235855) + buffer.appendInt32(-1682665696) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.value!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.type!, buffer: buffer, boxed: false) } - 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, ConstructorParameterDescription)]) { switch self { - case .inputPasskeyCredentialFirebasePNV(let _data): - return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", ConstructorParameterDescription(_data.pnvToken))]) - case .inputPasskeyCredentialPublicKey(let _data): - return ("inputPasskeyCredentialPublicKey", [("id", ConstructorParameterDescription(_data.id)), ("rawId", ConstructorParameterDescription(_data.rawId)), ("response", ConstructorParameterDescription(_data.response))]) + case .inputPageListOrderedItemBlocks(let _data): + return ("inputPageListOrderedItemBlocks", [("flags", ConstructorParameterDescription(_data.flags)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("value", ConstructorParameterDescription(_data.value)), ("type", ConstructorParameterDescription(_data.type))]) + case .inputPageListOrderedItemText(let _data): + return ("inputPageListOrderedItemText", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("value", ConstructorParameterDescription(_data.value)), ("type", ConstructorParameterDescription(_data.type))]) } } - public static func parse_inputPasskeyCredentialFirebasePNV(_ reader: BufferReader) -> InputPasskeyCredential? { - var _1: String? - _1 = parseString(reader) + public static func parse_inputPageListOrderedItemBlocks(_ reader: BufferReader) -> InputPageListOrderedItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.PageBlock]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _4 = parseString(reader) + } let _c1 = _1 != nil - if _c1 { - return Api.InputPasskeyCredential.inputPasskeyCredentialFirebasePNV(Cons_inputPasskeyCredentialFirebasePNV(pnvToken: _1!)) + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.InputPageListOrderedItem.inputPageListOrderedItemBlocks(Cons_inputPageListOrderedItemBlocks(flags: _1!, blocks: _2!, value: _3, type: _4)) } else { return nil } } - public static func parse_inputPasskeyCredentialPublicKey(_ reader: BufferReader) -> InputPasskeyCredential? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: Api.InputPasskeyResponse? + public static func parse_inputPageListOrderedItemText(_ reader: BufferReader) -> InputPageListOrderedItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.RichText? if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputPasskeyResponse + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _4 = parseString(reader) } let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.InputPasskeyCredential.inputPasskeyCredentialPublicKey(Cons_inputPasskeyCredentialPublicKey(id: _1!, rawId: _2!, response: _3!)) + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.InputPageListOrderedItem.inputPageListOrderedItemText(Cons_inputPageListOrderedItemText(flags: _1!, text: _2!, value: _3, type: _4)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api12.swift b/submodules/TelegramApi/Sources/Api12.swift index 89a9c99847..952b136e13 100644 --- a/submodules/TelegramApi/Sources/Api12.swift +++ b/submodules/TelegramApi/Sources/Api12.swift @@ -1,3 +1,90 @@ +public extension Api { + enum InputPasskeyCredential: TypeConstructorDescription { + public class Cons_inputPasskeyCredentialFirebasePNV: TypeConstructorDescription { + public var pnvToken: String + public init(pnvToken: String) { + self.pnvToken = pnvToken + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", ConstructorParameterDescription(self.pnvToken))]) + } + } + public class Cons_inputPasskeyCredentialPublicKey: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPasskeyCredentialPublicKey", [("id", ConstructorParameterDescription(self.id)), ("rawId", ConstructorParameterDescription(self.rawId)), ("response", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .inputPasskeyCredentialFirebasePNV(let _data): + return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", ConstructorParameterDescription(_data.pnvToken))]) + case .inputPasskeyCredentialPublicKey(let _data): + return ("inputPasskeyCredentialPublicKey", [("id", ConstructorParameterDescription(_data.id)), ("rawId", ConstructorParameterDescription(_data.rawId)), ("response", ConstructorParameterDescription(_data.response))]) + } + } + + public static func parse_inputPasskeyCredentialFirebasePNV(_ reader: BufferReader) -> InputPasskeyCredential? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.InputPasskeyCredential.inputPasskeyCredentialFirebasePNV(Cons_inputPasskeyCredentialFirebasePNV(pnvToken: _1!)) + } + else { + return nil + } + } + public static func parse_inputPasskeyCredentialPublicKey(_ reader: BufferReader) -> InputPasskeyCredential? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: Api.InputPasskeyResponse? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputPasskeyResponse + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.InputPasskeyCredential.inputPasskeyCredentialPublicKey(Cons_inputPasskeyCredentialPublicKey(id: _1!, rawId: _2!, response: _3!)) + } + else { + return nil + } + } + } +} public extension Api { enum InputPasskeyResponse: TypeConstructorDescription { public class Cons_inputPasskeyResponseLogin: TypeConstructorDescription { @@ -882,246 +969,3 @@ public extension Api { } } } -public extension Api { - enum InputPrivacyRule: TypeConstructorDescription { - public class Cons_inputPrivacyValueAllowChatParticipants: TypeConstructorDescription { - public var chats: [Int64] - public init(chats: [Int64]) { - self.chats = chats - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPrivacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) - } - } - public class Cons_inputPrivacyValueAllowUsers: TypeConstructorDescription { - public var users: [Api.InputUser] - public init(users: [Api.InputUser]) { - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPrivacyValueAllowUsers", [("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_inputPrivacyValueDisallowChatParticipants: TypeConstructorDescription { - public var chats: [Int64] - public init(chats: [Int64]) { - self.chats = chats - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPrivacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) - } - } - public class Cons_inputPrivacyValueDisallowUsers: TypeConstructorDescription { - public var users: [Api.InputUser] - public init(users: [Api.InputUser]) { - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPrivacyValueDisallowUsers", [("users", ConstructorParameterDescription(self.users))]) - } - } - case inputPrivacyValueAllowAll - case inputPrivacyValueAllowBots - case inputPrivacyValueAllowChatParticipants(Cons_inputPrivacyValueAllowChatParticipants) - case inputPrivacyValueAllowCloseFriends - case inputPrivacyValueAllowContacts - case inputPrivacyValueAllowPremium - case inputPrivacyValueAllowUsers(Cons_inputPrivacyValueAllowUsers) - case inputPrivacyValueDisallowAll - case inputPrivacyValueDisallowBots - case inputPrivacyValueDisallowChatParticipants(Cons_inputPrivacyValueDisallowChatParticipants) - case inputPrivacyValueDisallowContacts - 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, ConstructorParameterDescription)]) { - switch self { - case .inputPrivacyValueAllowAll: - return ("inputPrivacyValueAllowAll", []) - case .inputPrivacyValueAllowBots: - return ("inputPrivacyValueAllowBots", []) - case .inputPrivacyValueAllowChatParticipants(let _data): - return ("inputPrivacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) - case .inputPrivacyValueAllowCloseFriends: - return ("inputPrivacyValueAllowCloseFriends", []) - case .inputPrivacyValueAllowContacts: - return ("inputPrivacyValueAllowContacts", []) - case .inputPrivacyValueAllowPremium: - return ("inputPrivacyValueAllowPremium", []) - case .inputPrivacyValueAllowUsers(let _data): - return ("inputPrivacyValueAllowUsers", [("users", ConstructorParameterDescription(_data.users))]) - case .inputPrivacyValueDisallowAll: - return ("inputPrivacyValueDisallowAll", []) - case .inputPrivacyValueDisallowBots: - return ("inputPrivacyValueDisallowBots", []) - case .inputPrivacyValueDisallowChatParticipants(let _data): - return ("inputPrivacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) - case .inputPrivacyValueDisallowContacts: - return ("inputPrivacyValueDisallowContacts", []) - case .inputPrivacyValueDisallowUsers(let _data): - return ("inputPrivacyValueDisallowUsers", [("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_inputPrivacyValueAllowAll(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueAllowAll - } - public static func parse_inputPrivacyValueAllowBots(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueAllowBots - } - public static func parse_inputPrivacyValueAllowChatParticipants(_ reader: BufferReader) -> InputPrivacyRule? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.InputPrivacyRule.inputPrivacyValueAllowChatParticipants(Cons_inputPrivacyValueAllowChatParticipants(chats: _1!)) - } - else { - return nil - } - } - public static func parse_inputPrivacyValueAllowCloseFriends(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueAllowCloseFriends - } - public static func parse_inputPrivacyValueAllowContacts(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueAllowContacts - } - public static func parse_inputPrivacyValueAllowPremium(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueAllowPremium - } - public static func parse_inputPrivacyValueAllowUsers(_ reader: BufferReader) -> InputPrivacyRule? { - var _1: [Api.InputUser]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.InputPrivacyRule.inputPrivacyValueAllowUsers(Cons_inputPrivacyValueAllowUsers(users: _1!)) - } - else { - return nil - } - } - public static func parse_inputPrivacyValueDisallowAll(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueDisallowAll - } - public static func parse_inputPrivacyValueDisallowBots(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueDisallowBots - } - public static func parse_inputPrivacyValueDisallowChatParticipants(_ reader: BufferReader) -> InputPrivacyRule? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.InputPrivacyRule.inputPrivacyValueDisallowChatParticipants(Cons_inputPrivacyValueDisallowChatParticipants(chats: _1!)) - } - else { - return nil - } - } - public static func parse_inputPrivacyValueDisallowContacts(_ reader: BufferReader) -> InputPrivacyRule? { - return Api.InputPrivacyRule.inputPrivacyValueDisallowContacts - } - public static func parse_inputPrivacyValueDisallowUsers(_ reader: BufferReader) -> InputPrivacyRule? { - var _1: [Api.InputUser]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) - } - let _c1 = _1 != nil - if _c1 { - 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 cd4f464e19..6345891167 100644 --- a/submodules/TelegramApi/Sources/Api13.swift +++ b/submodules/TelegramApi/Sources/Api13.swift @@ -1,3 +1,246 @@ +public extension Api { + enum InputPrivacyRule: TypeConstructorDescription { + public class Cons_inputPrivacyValueAllowChatParticipants: TypeConstructorDescription { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) + } + } + public class Cons_inputPrivacyValueAllowUsers: TypeConstructorDescription { + public var users: [Api.InputUser] + public init(users: [Api.InputUser]) { + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueAllowUsers", [("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_inputPrivacyValueDisallowChatParticipants: TypeConstructorDescription { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) + } + } + public class Cons_inputPrivacyValueDisallowUsers: TypeConstructorDescription { + public var users: [Api.InputUser] + public init(users: [Api.InputUser]) { + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueDisallowUsers", [("users", ConstructorParameterDescription(self.users))]) + } + } + case inputPrivacyValueAllowAll + case inputPrivacyValueAllowBots + case inputPrivacyValueAllowChatParticipants(Cons_inputPrivacyValueAllowChatParticipants) + case inputPrivacyValueAllowCloseFriends + case inputPrivacyValueAllowContacts + case inputPrivacyValueAllowPremium + case inputPrivacyValueAllowUsers(Cons_inputPrivacyValueAllowUsers) + case inputPrivacyValueDisallowAll + case inputPrivacyValueDisallowBots + case inputPrivacyValueDisallowChatParticipants(Cons_inputPrivacyValueDisallowChatParticipants) + case inputPrivacyValueDisallowContacts + 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, ConstructorParameterDescription)]) { + switch self { + case .inputPrivacyValueAllowAll: + return ("inputPrivacyValueAllowAll", []) + case .inputPrivacyValueAllowBots: + return ("inputPrivacyValueAllowBots", []) + case .inputPrivacyValueAllowChatParticipants(let _data): + return ("inputPrivacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) + case .inputPrivacyValueAllowCloseFriends: + return ("inputPrivacyValueAllowCloseFriends", []) + case .inputPrivacyValueAllowContacts: + return ("inputPrivacyValueAllowContacts", []) + case .inputPrivacyValueAllowPremium: + return ("inputPrivacyValueAllowPremium", []) + case .inputPrivacyValueAllowUsers(let _data): + return ("inputPrivacyValueAllowUsers", [("users", ConstructorParameterDescription(_data.users))]) + case .inputPrivacyValueDisallowAll: + return ("inputPrivacyValueDisallowAll", []) + case .inputPrivacyValueDisallowBots: + return ("inputPrivacyValueDisallowBots", []) + case .inputPrivacyValueDisallowChatParticipants(let _data): + return ("inputPrivacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) + case .inputPrivacyValueDisallowContacts: + return ("inputPrivacyValueDisallowContacts", []) + case .inputPrivacyValueDisallowUsers(let _data): + return ("inputPrivacyValueDisallowUsers", [("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_inputPrivacyValueAllowAll(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueAllowAll + } + public static func parse_inputPrivacyValueAllowBots(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueAllowBots + } + public static func parse_inputPrivacyValueAllowChatParticipants(_ reader: BufferReader) -> InputPrivacyRule? { + var _1: [Int64]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.InputPrivacyRule.inputPrivacyValueAllowChatParticipants(Cons_inputPrivacyValueAllowChatParticipants(chats: _1!)) + } + else { + return nil + } + } + public static func parse_inputPrivacyValueAllowCloseFriends(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueAllowCloseFriends + } + public static func parse_inputPrivacyValueAllowContacts(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueAllowContacts + } + public static func parse_inputPrivacyValueAllowPremium(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueAllowPremium + } + public static func parse_inputPrivacyValueAllowUsers(_ reader: BufferReader) -> InputPrivacyRule? { + var _1: [Api.InputUser]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.InputPrivacyRule.inputPrivacyValueAllowUsers(Cons_inputPrivacyValueAllowUsers(users: _1!)) + } + else { + return nil + } + } + public static func parse_inputPrivacyValueDisallowAll(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueDisallowAll + } + public static func parse_inputPrivacyValueDisallowBots(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueDisallowBots + } + public static func parse_inputPrivacyValueDisallowChatParticipants(_ reader: BufferReader) -> InputPrivacyRule? { + var _1: [Int64]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.InputPrivacyRule.inputPrivacyValueDisallowChatParticipants(Cons_inputPrivacyValueDisallowChatParticipants(chats: _1!)) + } + else { + return nil + } + } + public static func parse_inputPrivacyValueDisallowContacts(_ reader: BufferReader) -> InputPrivacyRule? { + return Api.InputPrivacyRule.inputPrivacyValueDisallowContacts + } + public static func parse_inputPrivacyValueDisallowUsers(_ reader: BufferReader) -> InputPrivacyRule? { + var _1: [Api.InputUser]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.InputPrivacyRule.inputPrivacyValueDisallowUsers(Cons_inputPrivacyValueDisallowUsers(users: _1!)) + } + else { + return nil + } + } + } +} public extension Api { enum InputQuickReplyShortcut: TypeConstructorDescription { public class Cons_inputQuickReplyShortcut: TypeConstructorDescription { @@ -279,6 +522,62 @@ public extension Api { } } } +public extension Api { + enum InputRichMessage: TypeConstructorDescription { + public class Cons_inputRichMessage: TypeConstructorDescription { + public var flags: Int32 + public var blocks: [Api.PageBlock] + public init(flags: Int32, blocks: [Api.PageBlock]) { + self.flags = flags + self.blocks = blocks + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputRichMessage", [("flags", ConstructorParameterDescription(self.flags)), ("blocks", ConstructorParameterDescription(self.blocks))]) + } + } + case inputRichMessage(Cons_inputRichMessage) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .inputRichMessage(let _data): + if boxed { + buffer.appendInt32(-1865309654) + } + 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) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .inputRichMessage(let _data): + return ("inputRichMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("blocks", ConstructorParameterDescription(_data.blocks))]) + } + } + + public static func parse_inputRichMessage(_ reader: BufferReader) -> InputRichMessage? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.PageBlock]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.InputRichMessage.inputRichMessage(Cons_inputRichMessage(flags: _1!, blocks: _2!)) + } + else { + return nil + } + } + } +} public extension Api { indirect enum InputSavedStarGift: TypeConstructorDescription { public class Cons_inputSavedStarGiftChat: TypeConstructorDescription { @@ -1046,709 +1345,3 @@ public extension Api { } } } -public extension Api { - enum InputStickerSetItem: TypeConstructorDescription { - public class Cons_inputStickerSetItem: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStickerSetItem", [("flags", ConstructorParameterDescription(self.flags)), ("document", ConstructorParameterDescription(self.document)), ("emoji", ConstructorParameterDescription(self.emoji)), ("maskCoords", ConstructorParameterDescription(self.maskCoords)), ("keywords", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .inputStickerSetItem(let _data): - return ("inputStickerSetItem", [("flags", ConstructorParameterDescription(_data.flags)), ("document", ConstructorParameterDescription(_data.document)), ("emoji", ConstructorParameterDescription(_data.emoji)), ("maskCoords", ConstructorParameterDescription(_data.maskCoords)), ("keywords", ConstructorParameterDescription(_data.keywords))]) - } - } - - public static func parse_inputStickerSetItem(_ reader: BufferReader) -> InputStickerSetItem? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.InputDocument? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputDocument - } - var _3: String? - _3 = parseString(reader) - var _4: Api.MaskCoords? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.MaskCoords - } - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_inputStickeredMediaDocument: TypeConstructorDescription { - public var id: Api.InputDocument - public init(id: Api.InputDocument) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStickeredMediaDocument", [("id", ConstructorParameterDescription(self.id))]) - } - } - public class Cons_inputStickeredMediaPhoto: TypeConstructorDescription { - public var id: Api.InputPhoto - public init(id: Api.InputPhoto) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStickeredMediaPhoto", [("id", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .inputStickeredMediaDocument(let _data): - return ("inputStickeredMediaDocument", [("id", ConstructorParameterDescription(_data.id))]) - case .inputStickeredMediaPhoto(let _data): - return ("inputStickeredMediaPhoto", [("id", ConstructorParameterDescription(_data.id))]) - } - } - - public static func parse_inputStickeredMediaDocument(_ reader: BufferReader) -> InputStickeredMedia? { - var _1: Api.InputDocument? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputDocument - } - let _c1 = _1 != nil - if _c1 { - return Api.InputStickeredMedia.inputStickeredMediaDocument(Cons_inputStickeredMediaDocument(id: _1!)) - } - else { - return nil - } - } - public static func parse_inputStickeredMediaPhoto(_ reader: BufferReader) -> InputStickeredMedia? { - var _1: Api.InputPhoto? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputPhoto - } - let _c1 = _1 != nil - if _c1 { - return Api.InputStickeredMedia.inputStickeredMediaPhoto(Cons_inputStickeredMediaPhoto(id: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum InputStorePaymentPurpose: TypeConstructorDescription { - public class Cons_inputStorePaymentAuthCode: TypeConstructorDescription { - public var flags: Int32 - public var phoneNumber: String - public var phoneCodeHash: String - public var premiumDays: Int32 - public var currency: String - public var amount: Int64 - public init(flags: Int32, phoneNumber: String, phoneCodeHash: String, premiumDays: Int32, currency: String, amount: Int64) { - self.flags = flags - self.phoneNumber = phoneNumber - self.phoneCodeHash = phoneCodeHash - self.premiumDays = premiumDays - self.currency = currency - self.amount = amount - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentAuthCode", [("flags", ConstructorParameterDescription(self.flags)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("premiumDays", ConstructorParameterDescription(self.premiumDays)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) - } - } - public class Cons_inputStorePaymentGiftPremium: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentGiftPremium", [("userId", ConstructorParameterDescription(self.userId)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) - } - } - public class Cons_inputStorePaymentPremiumGiftCode: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentPremiumGiftCode", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_inputStorePaymentPremiumGiveaway: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentPremiumGiveaway", [("flags", ConstructorParameterDescription(self.flags)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("additionalPeers", ConstructorParameterDescription(self.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("randomId", ConstructorParameterDescription(self.randomId)), ("untilDate", ConstructorParameterDescription(self.untilDate)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) - } - } - public class Cons_inputStorePaymentPremiumSubscription: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentPremiumSubscription", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - public class Cons_inputStorePaymentStarsGift: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentStarsGift", [("userId", ConstructorParameterDescription(self.userId)), ("stars", ConstructorParameterDescription(self.stars)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) - } - } - public class Cons_inputStorePaymentStarsGiveaway: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentStarsGiveaway", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("additionalPeers", ConstructorParameterDescription(self.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("randomId", ConstructorParameterDescription(self.randomId)), ("untilDate", ConstructorParameterDescription(self.untilDate)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_inputStorePaymentStarsTopup: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputStorePaymentStarsTopup", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("spendPurposePeer", ConstructorParameterDescription(self.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(1069645911) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeString(_data.phoneNumber, buffer: buffer, boxed: false) - serializeString(_data.phoneCodeHash, buffer: buffer, boxed: false) - serializeInt32(_data.premiumDays, 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(_data.additionalPeers!.count)) - for item in _data.additionalPeers! { - item.serialize(buffer, true) - } - } - 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) - 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(_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, ConstructorParameterDescription)]) { - switch self { - case .inputStorePaymentAuthCode(let _data): - return ("inputStorePaymentAuthCode", [("flags", ConstructorParameterDescription(_data.flags)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("premiumDays", ConstructorParameterDescription(_data.premiumDays)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) - case .inputStorePaymentGiftPremium(let _data): - return ("inputStorePaymentGiftPremium", [("userId", ConstructorParameterDescription(_data.userId)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) - case .inputStorePaymentPremiumGiftCode(let _data): - return ("inputStorePaymentPremiumGiftCode", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("message", ConstructorParameterDescription(_data.message))]) - case .inputStorePaymentPremiumGiveaway(let _data): - return ("inputStorePaymentPremiumGiveaway", [("flags", ConstructorParameterDescription(_data.flags)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("additionalPeers", ConstructorParameterDescription(_data.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("untilDate", ConstructorParameterDescription(_data.untilDate)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) - case .inputStorePaymentPremiumSubscription(let _data): - return ("inputStorePaymentPremiumSubscription", [("flags", ConstructorParameterDescription(_data.flags))]) - case .inputStorePaymentStarsGift(let _data): - return ("inputStorePaymentStarsGift", [("userId", ConstructorParameterDescription(_data.userId)), ("stars", ConstructorParameterDescription(_data.stars)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) - case .inputStorePaymentStarsGiveaway(let _data): - return ("inputStorePaymentStarsGiveaway", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("additionalPeers", ConstructorParameterDescription(_data.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("untilDate", ConstructorParameterDescription(_data.untilDate)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("users", ConstructorParameterDescription(_data.users))]) - case .inputStorePaymentStarsTopup(let _data): - return ("inputStorePaymentStarsTopup", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("spendPurposePeer", ConstructorParameterDescription(_data.spendPurposePeer))]) - } - } - - public static func parse_inputStorePaymentAuthCode(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - var _5: String? - _5 = parseString(reader) - var _6: Int64? - _6 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputStorePaymentPurpose.inputStorePaymentAuthCode(Cons_inputStorePaymentAuthCode(flags: _1!, phoneNumber: _2!, phoneCodeHash: _3!, premiumDays: _4!, currency: _5!, amount: _6!)) - } - else { - return nil - } - } - public static func parse_inputStorePaymentGiftPremium(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Api.InputUser? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputUser - } - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.InputStorePaymentPurpose.inputStorePaymentGiftPremium(Cons_inputStorePaymentGiftPremium(userId: _1!, currency: _2!, amount: _3!)) - } - else { - return nil - } - } - public static func parse_inputStorePaymentPremiumGiftCode(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.InputUser]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) - } - var _3: Api.InputPeer? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.InputStorePaymentPurpose.inputStorePaymentPremiumGiftCode(Cons_inputStorePaymentPremiumGiftCode(flags: _1!, users: _2!, boostPeer: _3, currency: _4!, amount: _5!, message: _6)) - } - else { - return nil - } - } - public static func parse_inputStorePaymentPremiumGiveaway(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.InputPeer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputPeer - } - var _3: [Api.InputPeer]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) - } - } - var _4: [String]? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = parseString(reader) - } - var _6: Int64? - _6 = reader.readInt64() - var _7: Int32? - _7 = reader.readInt32() - var _8: String? - _8 = parseString(reader) - var _9: Int64? - _9 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 - } - } - public static func parse_inputStorePaymentPremiumSubscription(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.InputStorePaymentPurpose.inputStorePaymentPremiumSubscription(Cons_inputStorePaymentPremiumSubscription(flags: _1!)) - } - else { - return nil - } - } - public static func parse_inputStorePaymentStarsGift(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Api.InputUser? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputUser - } - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: Int64? - _4 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.InputStorePaymentPurpose.inputStorePaymentStarsGift(Cons_inputStorePaymentStarsGift(userId: _1!, stars: _2!, currency: _3!, amount: _4!)) - } - else { - return nil - } - } - public static func parse_inputStorePaymentStarsGiveaway(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.InputPeer? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputPeer - } - var _4: [Api.InputPeer]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) - } - } - var _5: [String]? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _6 = parseString(reader) - } - var _7: Int64? - _7 = reader.readInt64() - var _8: Int32? - _8 = reader.readInt32() - var _9: String? - _9 = parseString(reader) - var _10: Int64? - _10 = reader.readInt64() - var _11: Int32? - _11 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = _10 != nil - let _c11 = _11 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - 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 - } - } - public static func parse_inputStorePaymentStarsTopup(_ reader: BufferReader) -> InputStorePaymentPurpose? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: Int64? - _4 = reader.readInt64() - var _5: Api.InputPeer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 732969a330..547478f81f 100644 --- a/submodules/TelegramApi/Sources/Api14.swift +++ b/submodules/TelegramApi/Sources/Api14.swift @@ -1,3 +1,709 @@ +public extension Api { + enum InputStickerSetItem: TypeConstructorDescription { + public class Cons_inputStickerSetItem: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickerSetItem", [("flags", ConstructorParameterDescription(self.flags)), ("document", ConstructorParameterDescription(self.document)), ("emoji", ConstructorParameterDescription(self.emoji)), ("maskCoords", ConstructorParameterDescription(self.maskCoords)), ("keywords", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .inputStickerSetItem(let _data): + return ("inputStickerSetItem", [("flags", ConstructorParameterDescription(_data.flags)), ("document", ConstructorParameterDescription(_data.document)), ("emoji", ConstructorParameterDescription(_data.emoji)), ("maskCoords", ConstructorParameterDescription(_data.maskCoords)), ("keywords", ConstructorParameterDescription(_data.keywords))]) + } + } + + public static func parse_inputStickerSetItem(_ reader: BufferReader) -> InputStickerSetItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.InputDocument? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputDocument + } + var _3: String? + _3 = parseString(reader) + var _4: Api.MaskCoords? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.MaskCoords + } + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_inputStickeredMediaDocument: TypeConstructorDescription { + public var id: Api.InputDocument + public init(id: Api.InputDocument) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickeredMediaDocument", [("id", ConstructorParameterDescription(self.id))]) + } + } + public class Cons_inputStickeredMediaPhoto: TypeConstructorDescription { + public var id: Api.InputPhoto + public init(id: Api.InputPhoto) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickeredMediaPhoto", [("id", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .inputStickeredMediaDocument(let _data): + return ("inputStickeredMediaDocument", [("id", ConstructorParameterDescription(_data.id))]) + case .inputStickeredMediaPhoto(let _data): + return ("inputStickeredMediaPhoto", [("id", ConstructorParameterDescription(_data.id))]) + } + } + + public static func parse_inputStickeredMediaDocument(_ reader: BufferReader) -> InputStickeredMedia? { + var _1: Api.InputDocument? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputDocument + } + let _c1 = _1 != nil + if _c1 { + return Api.InputStickeredMedia.inputStickeredMediaDocument(Cons_inputStickeredMediaDocument(id: _1!)) + } + else { + return nil + } + } + public static func parse_inputStickeredMediaPhoto(_ reader: BufferReader) -> InputStickeredMedia? { + var _1: Api.InputPhoto? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputPhoto + } + let _c1 = _1 != nil + if _c1 { + return Api.InputStickeredMedia.inputStickeredMediaPhoto(Cons_inputStickeredMediaPhoto(id: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum InputStorePaymentPurpose: TypeConstructorDescription { + public class Cons_inputStorePaymentAuthCode: TypeConstructorDescription { + public var flags: Int32 + public var phoneNumber: String + public var phoneCodeHash: String + public var premiumDays: Int32 + public var currency: String + public var amount: Int64 + public init(flags: Int32, phoneNumber: String, phoneCodeHash: String, premiumDays: Int32, currency: String, amount: Int64) { + self.flags = flags + self.phoneNumber = phoneNumber + self.phoneCodeHash = phoneCodeHash + self.premiumDays = premiumDays + self.currency = currency + self.amount = amount + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentAuthCode", [("flags", ConstructorParameterDescription(self.flags)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("premiumDays", ConstructorParameterDescription(self.premiumDays)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) + } + } + public class Cons_inputStorePaymentGiftPremium: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentGiftPremium", [("userId", ConstructorParameterDescription(self.userId)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) + } + } + public class Cons_inputStorePaymentPremiumGiftCode: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentPremiumGiftCode", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_inputStorePaymentPremiumGiveaway: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentPremiumGiveaway", [("flags", ConstructorParameterDescription(self.flags)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("additionalPeers", ConstructorParameterDescription(self.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("randomId", ConstructorParameterDescription(self.randomId)), ("untilDate", ConstructorParameterDescription(self.untilDate)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) + } + } + public class Cons_inputStorePaymentPremiumSubscription: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentPremiumSubscription", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_inputStorePaymentStarsGift: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentStarsGift", [("userId", ConstructorParameterDescription(self.userId)), ("stars", ConstructorParameterDescription(self.stars)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) + } + } + public class Cons_inputStorePaymentStarsGiveaway: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentStarsGiveaway", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("additionalPeers", ConstructorParameterDescription(self.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("randomId", ConstructorParameterDescription(self.randomId)), ("untilDate", ConstructorParameterDescription(self.untilDate)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_inputStorePaymentStarsTopup: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentStarsTopup", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("spendPurposePeer", ConstructorParameterDescription(self.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(1069645911) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.phoneNumber, buffer: buffer, boxed: false) + serializeString(_data.phoneCodeHash, buffer: buffer, boxed: false) + serializeInt32(_data.premiumDays, 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(_data.additionalPeers!.count)) + for item in _data.additionalPeers! { + item.serialize(buffer, true) + } + } + 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) + 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(_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, ConstructorParameterDescription)]) { + switch self { + case .inputStorePaymentAuthCode(let _data): + return ("inputStorePaymentAuthCode", [("flags", ConstructorParameterDescription(_data.flags)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("premiumDays", ConstructorParameterDescription(_data.premiumDays)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + case .inputStorePaymentGiftPremium(let _data): + return ("inputStorePaymentGiftPremium", [("userId", ConstructorParameterDescription(_data.userId)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + case .inputStorePaymentPremiumGiftCode(let _data): + return ("inputStorePaymentPremiumGiftCode", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("message", ConstructorParameterDescription(_data.message))]) + case .inputStorePaymentPremiumGiveaway(let _data): + return ("inputStorePaymentPremiumGiveaway", [("flags", ConstructorParameterDescription(_data.flags)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("additionalPeers", ConstructorParameterDescription(_data.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("untilDate", ConstructorParameterDescription(_data.untilDate)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + case .inputStorePaymentPremiumSubscription(let _data): + return ("inputStorePaymentPremiumSubscription", [("flags", ConstructorParameterDescription(_data.flags))]) + case .inputStorePaymentStarsGift(let _data): + return ("inputStorePaymentStarsGift", [("userId", ConstructorParameterDescription(_data.userId)), ("stars", ConstructorParameterDescription(_data.stars)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + case .inputStorePaymentStarsGiveaway(let _data): + return ("inputStorePaymentStarsGiveaway", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("additionalPeers", ConstructorParameterDescription(_data.additionalPeers)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("untilDate", ConstructorParameterDescription(_data.untilDate)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("users", ConstructorParameterDescription(_data.users))]) + case .inputStorePaymentStarsTopup(let _data): + return ("inputStorePaymentStarsTopup", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("spendPurposePeer", ConstructorParameterDescription(_data.spendPurposePeer))]) + } + } + + public static func parse_inputStorePaymentAuthCode(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: Int32? + _4 = reader.readInt32() + var _5: String? + _5 = parseString(reader) + var _6: Int64? + _6 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.InputStorePaymentPurpose.inputStorePaymentAuthCode(Cons_inputStorePaymentAuthCode(flags: _1!, phoneNumber: _2!, phoneCodeHash: _3!, premiumDays: _4!, currency: _5!, amount: _6!)) + } + else { + return nil + } + } + public static func parse_inputStorePaymentGiftPremium(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Api.InputUser? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputUser + } + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.InputStorePaymentPurpose.inputStorePaymentGiftPremium(Cons_inputStorePaymentGiftPremium(userId: _1!, currency: _2!, amount: _3!)) + } + else { + return nil + } + } + public static func parse_inputStorePaymentPremiumGiftCode(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.InputUser]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self) + } + var _3: Api.InputPeer? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.InputStorePaymentPurpose.inputStorePaymentPremiumGiftCode(Cons_inputStorePaymentPremiumGiftCode(flags: _1!, users: _2!, boostPeer: _3, currency: _4!, amount: _5!, message: _6)) + } + else { + return nil + } + } + public static func parse_inputStorePaymentPremiumGiveaway(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.InputPeer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + var _3: [Api.InputPeer]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) + } + } + var _4: [String]? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _5 = parseString(reader) + } + var _6: Int64? + _6 = reader.readInt64() + var _7: Int32? + _7 = reader.readInt32() + var _8: String? + _8 = parseString(reader) + var _9: Int64? + _9 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 + } + } + public static func parse_inputStorePaymentPremiumSubscription(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.InputStorePaymentPurpose.inputStorePaymentPremiumSubscription(Cons_inputStorePaymentPremiumSubscription(flags: _1!)) + } + else { + return nil + } + } + public static func parse_inputStorePaymentStarsGift(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Api.InputUser? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputUser + } + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: Int64? + _4 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.InputStorePaymentPurpose.inputStorePaymentStarsGift(Cons_inputStorePaymentStarsGift(userId: _1!, stars: _2!, currency: _3!, amount: _4!)) + } + else { + return nil + } + } + public static func parse_inputStorePaymentStarsGiveaway(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.InputPeer? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + var _4: [Api.InputPeer]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPeer.self) + } + } + var _5: [String]? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _6 = parseString(reader) + } + var _7: Int64? + _7 = reader.readInt64() + var _8: Int32? + _8 = reader.readInt32() + var _9: String? + _9 = parseString(reader) + var _10: Int64? + _10 = reader.readInt64() + var _11: Int32? + _11 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = _10 != nil + let _c11 = _11 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { + 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 + } + } + public static func parse_inputStorePaymentStarsTopup(_ reader: BufferReader) -> InputStorePaymentPurpose? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: Int64? + _4 = reader.readInt64() + var _5: Api.InputPeer? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.InputStorePaymentPurpose.inputStorePaymentStarsTopup(Cons_inputStorePaymentStarsTopup(flags: _1!, stars: _2!, currency: _3!, amount: _4!, spendPurposePeer: _5)) + } + else { + return nil + } + } + } +} public extension Api { enum InputTheme: TypeConstructorDescription { public class Cons_inputTheme: TypeConstructorDescription { @@ -993,1028 +1699,3 @@ public extension Api { } } } -public extension Api { - indirect enum KeyboardButton: TypeConstructorDescription { - public class Cons_inputKeyboardButtonRequestPeer: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var buttonId: Int32 - public var peerType: Api.RequestPeerType - public var maxQuantity: Int32 - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) { - self.flags = flags - self.style = style - self.text = text - self.buttonId = buttonId - self.peerType = peerType - self.maxQuantity = maxQuantity - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputKeyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("buttonId", ConstructorParameterDescription(self.buttonId)), ("peerType", ConstructorParameterDescription(self.peerType)), ("maxQuantity", ConstructorParameterDescription(self.maxQuantity))]) - } - } - public class Cons_inputKeyboardButtonUrlAuth: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var fwdText: String? - public var url: String - public var bot: Api.InputUser - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, fwdText: String?, url: String, bot: Api.InputUser) { - self.flags = flags - self.style = style - self.text = text - self.fwdText = fwdText - self.url = url - self.bot = bot - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputKeyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("fwdText", ConstructorParameterDescription(self.fwdText)), ("url", ConstructorParameterDescription(self.url)), ("bot", ConstructorParameterDescription(self.bot))]) - } - } - public class Cons_inputKeyboardButtonUserProfile: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var userId: Api.InputUser - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, userId: Api.InputUser) { - self.flags = flags - self.style = style - self.text = text - self.userId = userId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputKeyboardButtonUserProfile", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("userId", ConstructorParameterDescription(self.userId))]) - } - } - public class Cons_keyboardButton: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { - self.flags = flags - self.style = style - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButton", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_keyboardButtonBuy: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { - self.flags = flags - self.style = style - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonBuy", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_keyboardButtonCallback: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var data: Buffer - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, data: Buffer) { - self.flags = flags - self.style = style - self.text = text - self.data = data - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonCallback", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("data", ConstructorParameterDescription(self.data))]) - } - } - public class Cons_keyboardButtonCopy: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var copyText: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, copyText: String) { - self.flags = flags - self.style = style - self.text = text - self.copyText = copyText - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonCopy", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("copyText", ConstructorParameterDescription(self.copyText))]) - } - } - public class Cons_keyboardButtonGame: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { - self.flags = flags - self.style = style - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonGame", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_keyboardButtonRequestGeoLocation: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { - self.flags = flags - self.style = style - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonRequestGeoLocation", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_keyboardButtonRequestPeer: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var buttonId: Int32 - public var peerType: Api.RequestPeerType - public var maxQuantity: Int32 - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) { - self.flags = flags - self.style = style - self.text = text - self.buttonId = buttonId - self.peerType = peerType - self.maxQuantity = maxQuantity - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("buttonId", ConstructorParameterDescription(self.buttonId)), ("peerType", ConstructorParameterDescription(self.peerType)), ("maxQuantity", ConstructorParameterDescription(self.maxQuantity))]) - } - } - public class Cons_keyboardButtonRequestPhone: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { - self.flags = flags - self.style = style - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonRequestPhone", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_keyboardButtonRequestPoll: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var quiz: Api.Bool? - public var text: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, quiz: Api.Bool?, text: String) { - self.flags = flags - self.style = style - self.quiz = quiz - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonRequestPoll", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("quiz", ConstructorParameterDescription(self.quiz)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_keyboardButtonSimpleWebView: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var url: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, url: String) { - self.flags = flags - self.style = style - self.text = text - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonSimpleWebView", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url))]) - } - } - public class Cons_keyboardButtonSwitchInline: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var query: String - public var peerTypes: [Api.InlineQueryPeerType]? - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, query: String, peerTypes: [Api.InlineQueryPeerType]?) { - self.flags = flags - self.style = style - self.text = text - self.query = query - self.peerTypes = peerTypes - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonSwitchInline", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("query", ConstructorParameterDescription(self.query)), ("peerTypes", ConstructorParameterDescription(self.peerTypes))]) - } - } - public class Cons_keyboardButtonUrl: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var url: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, url: String) { - self.flags = flags - self.style = style - self.text = text - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonUrl", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url))]) - } - } - public class Cons_keyboardButtonUrlAuth: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var fwdText: String? - public var url: String - public var buttonId: Int32 - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, fwdText: String?, url: String, buttonId: Int32) { - self.flags = flags - self.style = style - self.text = text - self.fwdText = fwdText - self.url = url - self.buttonId = buttonId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("fwdText", ConstructorParameterDescription(self.fwdText)), ("url", ConstructorParameterDescription(self.url)), ("buttonId", ConstructorParameterDescription(self.buttonId))]) - } - } - public class Cons_keyboardButtonUserProfile: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var userId: Int64 - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, userId: Int64) { - self.flags = flags - self.style = style - self.text = text - self.userId = userId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonUserProfile", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("userId", ConstructorParameterDescription(self.userId))]) - } - } - public class Cons_keyboardButtonWebView: TypeConstructorDescription { - public var flags: Int32 - public var style: Api.KeyboardButtonStyle? - public var text: String - public var url: String - public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, url: String) { - self.flags = flags - self.style = style - self.text = text - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("keyboardButtonWebView", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.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(45580630) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - 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(1744911986) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - 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(2103314375) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - _data.userId.serialize(buffer, true) - break - case .keyboardButton(let _data): - if boxed { - buffer.appendInt32(2098662655) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - break - case .keyboardButtonBuy(let _data): - if boxed { - buffer.appendInt32(1067792645) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - break - case .keyboardButtonCallback(let _data): - if boxed { - buffer.appendInt32(-433338016) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - serializeBytes(_data.data, buffer: buffer, boxed: false) - break - case .keyboardButtonCopy(let _data): - if boxed { - buffer.appendInt32(-1127960816) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - serializeString(_data.copyText, buffer: buffer, boxed: false) - break - case .keyboardButtonGame(let _data): - if boxed { - buffer.appendInt32(-1983540999) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - break - case .keyboardButtonRequestGeoLocation(let _data): - if boxed { - buffer.appendInt32(-1438582451) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - break - case .keyboardButtonRequestPeer(let _data): - if boxed { - buffer.appendInt32(1527715317) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - 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(1098841487) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - break - case .keyboardButtonRequestPoll(let _data): - if boxed { - buffer.appendInt32(2047989634) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - 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(-514047120) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - serializeString(_data.url, buffer: buffer, boxed: false) - break - case .keyboardButtonSwitchInline(let _data): - if boxed { - buffer.appendInt32(-1726768644) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - 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 _data): - if boxed { - buffer.appendInt32(-670292500) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - serializeString(_data.url, buffer: buffer, boxed: false) - break - case .keyboardButtonUrlAuth(let _data): - if boxed { - buffer.appendInt32(-183499015) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - 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(-1057137399) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - serializeInt64(_data.userId, buffer: buffer, boxed: false) - break - case .keyboardButtonWebView(let _data): - if boxed { - buffer.appendInt32(-398020192) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 10) != 0 { - _data.style!.serialize(buffer, true) - } - serializeString(_data.text, buffer: buffer, boxed: false) - serializeString(_data.url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .inputKeyboardButtonRequestPeer(let _data): - return ("inputKeyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peerType", ConstructorParameterDescription(_data.peerType)), ("maxQuantity", ConstructorParameterDescription(_data.maxQuantity))]) - case .inputKeyboardButtonUrlAuth(let _data): - return ("inputKeyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("fwdText", ConstructorParameterDescription(_data.fwdText)), ("url", ConstructorParameterDescription(_data.url)), ("bot", ConstructorParameterDescription(_data.bot))]) - case .inputKeyboardButtonUserProfile(let _data): - return ("inputKeyboardButtonUserProfile", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("userId", ConstructorParameterDescription(_data.userId))]) - case .keyboardButton(let _data): - return ("keyboardButton", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) - case .keyboardButtonBuy(let _data): - return ("keyboardButtonBuy", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) - case .keyboardButtonCallback(let _data): - return ("keyboardButtonCallback", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("data", ConstructorParameterDescription(_data.data))]) - case .keyboardButtonCopy(let _data): - return ("keyboardButtonCopy", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("copyText", ConstructorParameterDescription(_data.copyText))]) - case .keyboardButtonGame(let _data): - return ("keyboardButtonGame", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) - case .keyboardButtonRequestGeoLocation(let _data): - return ("keyboardButtonRequestGeoLocation", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) - case .keyboardButtonRequestPeer(let _data): - return ("keyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peerType", ConstructorParameterDescription(_data.peerType)), ("maxQuantity", ConstructorParameterDescription(_data.maxQuantity))]) - case .keyboardButtonRequestPhone(let _data): - return ("keyboardButtonRequestPhone", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) - case .keyboardButtonRequestPoll(let _data): - return ("keyboardButtonRequestPoll", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("quiz", ConstructorParameterDescription(_data.quiz)), ("text", ConstructorParameterDescription(_data.text))]) - case .keyboardButtonSimpleWebView(let _data): - return ("keyboardButtonSimpleWebView", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) - case .keyboardButtonSwitchInline(let _data): - return ("keyboardButtonSwitchInline", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("query", ConstructorParameterDescription(_data.query)), ("peerTypes", ConstructorParameterDescription(_data.peerTypes))]) - case .keyboardButtonUrl(let _data): - return ("keyboardButtonUrl", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) - case .keyboardButtonUrlAuth(let _data): - return ("keyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("fwdText", ConstructorParameterDescription(_data.fwdText)), ("url", ConstructorParameterDescription(_data.url)), ("buttonId", ConstructorParameterDescription(_data.buttonId))]) - case .keyboardButtonUserProfile(let _data): - return ("keyboardButtonUserProfile", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("userId", ConstructorParameterDescription(_data.userId))]) - case .keyboardButtonWebView(let _data): - return ("keyboardButtonWebView", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) - } - } - - public static func parse_inputKeyboardButtonRequestPeer(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - var _5: Api.RequestPeerType? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.RequestPeerType - } - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.KeyboardButton.inputKeyboardButtonRequestPeer(Cons_inputKeyboardButtonRequestPeer(flags: _1!, style: _2, text: _3!, buttonId: _4!, peerType: _5!, maxQuantity: _6!)) - } - else { - return nil - } - } - public static func parse_inputKeyboardButtonUrlAuth(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = parseString(reader) - } - var _5: String? - _5 = parseString(reader) - var _6: Api.InputUser? - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.InputUser - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.KeyboardButton.inputKeyboardButtonUrlAuth(Cons_inputKeyboardButtonUrlAuth(flags: _1!, style: _2, text: _3!, fwdText: _4, url: _5!, bot: _6!)) - } - else { - return nil - } - } - public static func parse_inputKeyboardButtonUserProfile(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: Api.InputUser? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputUser - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.inputKeyboardButtonUserProfile(Cons_inputKeyboardButtonUserProfile(flags: _1!, style: _2, text: _3!, userId: _4!)) - } - else { - return nil - } - } - public static func parse_keyboardButton(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.KeyboardButton.keyboardButton(Cons_keyboardButton(flags: _1!, style: _2, text: _3!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonBuy(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.KeyboardButton.keyboardButtonBuy(Cons_keyboardButtonBuy(flags: _1!, style: _2, text: _3!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonCallback(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: Buffer? - _4 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonCallback(Cons_keyboardButtonCallback(flags: _1!, style: _2, text: _3!, data: _4!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonCopy(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonCopy(Cons_keyboardButtonCopy(flags: _1!, style: _2, text: _3!, copyText: _4!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonGame(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.KeyboardButton.keyboardButtonGame(Cons_keyboardButtonGame(flags: _1!, style: _2, text: _3!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonRequestGeoLocation(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.KeyboardButton.keyboardButtonRequestGeoLocation(Cons_keyboardButtonRequestGeoLocation(flags: _1!, style: _2, text: _3!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonRequestPeer(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - var _5: Api.RequestPeerType? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.RequestPeerType - } - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.KeyboardButton.keyboardButtonRequestPeer(Cons_keyboardButtonRequestPeer(flags: _1!, style: _2, text: _3!, buttonId: _4!, peerType: _5!, maxQuantity: _6!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonRequestPhone(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.KeyboardButton.keyboardButtonRequestPhone(Cons_keyboardButtonRequestPhone(flags: _1!, style: _2, text: _3!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonRequestPoll(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: Api.Bool? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } - } - var _4: String? - _4 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonRequestPoll(Cons_keyboardButtonRequestPoll(flags: _1!, style: _2, quiz: _3, text: _4!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonSimpleWebView(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonSimpleWebView(Cons_keyboardButtonSimpleWebView(flags: _1!, style: _2, text: _3!, url: _4!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonSwitchInline(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: [Api.InlineQueryPeerType]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InlineQueryPeerType.self) - } - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.KeyboardButton.keyboardButtonSwitchInline(Cons_keyboardButtonSwitchInline(flags: _1!, style: _2, text: _3!, query: _4!, peerTypes: _5)) - } - else { - return nil - } - } - public static func parse_keyboardButtonUrl(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonUrl(Cons_keyboardButtonUrl(flags: _1!, style: _2, text: _3!, url: _4!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonUrlAuth(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: String? - _5 = parseString(reader) - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.KeyboardButton.keyboardButtonUrlAuth(Cons_keyboardButtonUrlAuth(flags: _1!, style: _2, text: _3!, fwdText: _4, url: _5!, buttonId: _6!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonUserProfile(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: Int64? - _4 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonUserProfile(Cons_keyboardButtonUserProfile(flags: _1!, style: _2, text: _3!, userId: _4!)) - } - else { - return nil - } - } - public static func parse_keyboardButtonWebView(_ reader: BufferReader) -> KeyboardButton? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.KeyboardButtonStyle? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle - } - } - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.KeyboardButton.keyboardButtonWebView(Cons_keyboardButtonWebView(flags: _1!, style: _2, text: _3!, url: _4!)) - } - else { - return nil - } - } - } -} diff --git a/submodules/TelegramApi/Sources/Api15.swift b/submodules/TelegramApi/Sources/Api15.swift index 6e05447f93..a7fab8381c 100644 --- a/submodules/TelegramApi/Sources/Api15.swift +++ b/submodules/TelegramApi/Sources/Api15.swift @@ -1,3 +1,1105 @@ +public extension Api { + enum JoinChatBotResult: TypeConstructorDescription { + public class Cons_joinChatBotResultWebView: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("joinChatBotResultWebView", [("url", ConstructorParameterDescription(self.url))]) + } + } + case joinChatBotResultApproved + case joinChatBotResultDeclined + case joinChatBotResultQueued + case joinChatBotResultWebView(Cons_joinChatBotResultWebView) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .joinChatBotResultApproved: + if boxed { + buffer.appendInt32(-1374344599) + } + break + case .joinChatBotResultDeclined: + if boxed { + buffer.appendInt32(251265428) + } + break + case .joinChatBotResultQueued: + if boxed { + buffer.appendInt32(-1734105024) + } + break + case .joinChatBotResultWebView(let _data): + if boxed { + buffer.appendInt32(-689719277) + } + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .joinChatBotResultApproved: + return ("joinChatBotResultApproved", []) + case .joinChatBotResultDeclined: + return ("joinChatBotResultDeclined", []) + case .joinChatBotResultQueued: + return ("joinChatBotResultQueued", []) + case .joinChatBotResultWebView(let _data): + return ("joinChatBotResultWebView", [("url", ConstructorParameterDescription(_data.url))]) + } + } + + public static func parse_joinChatBotResultApproved(_ reader: BufferReader) -> JoinChatBotResult? { + return Api.JoinChatBotResult.joinChatBotResultApproved + } + public static func parse_joinChatBotResultDeclined(_ reader: BufferReader) -> JoinChatBotResult? { + return Api.JoinChatBotResult.joinChatBotResultDeclined + } + public static func parse_joinChatBotResultQueued(_ reader: BufferReader) -> JoinChatBotResult? { + return Api.JoinChatBotResult.joinChatBotResultQueued + } + public static func parse_joinChatBotResultWebView(_ reader: BufferReader) -> JoinChatBotResult? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.JoinChatBotResult.joinChatBotResultWebView(Cons_joinChatBotResultWebView(url: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum KeyboardButton: TypeConstructorDescription { + public class Cons_inputKeyboardButtonRequestPeer: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var buttonId: Int32 + public var peerType: Api.RequestPeerType + public var maxQuantity: Int32 + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) { + self.flags = flags + self.style = style + self.text = text + self.buttonId = buttonId + self.peerType = peerType + self.maxQuantity = maxQuantity + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputKeyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("buttonId", ConstructorParameterDescription(self.buttonId)), ("peerType", ConstructorParameterDescription(self.peerType)), ("maxQuantity", ConstructorParameterDescription(self.maxQuantity))]) + } + } + public class Cons_inputKeyboardButtonUrlAuth: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var fwdText: String? + public var url: String + public var bot: Api.InputUser + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, fwdText: String?, url: String, bot: Api.InputUser) { + self.flags = flags + self.style = style + self.text = text + self.fwdText = fwdText + self.url = url + self.bot = bot + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputKeyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("fwdText", ConstructorParameterDescription(self.fwdText)), ("url", ConstructorParameterDescription(self.url)), ("bot", ConstructorParameterDescription(self.bot))]) + } + } + public class Cons_inputKeyboardButtonUserProfile: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var userId: Api.InputUser + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, userId: Api.InputUser) { + self.flags = flags + self.style = style + self.text = text + self.userId = userId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputKeyboardButtonUserProfile", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("userId", ConstructorParameterDescription(self.userId))]) + } + } + public class Cons_keyboardButton: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { + self.flags = flags + self.style = style + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButton", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_keyboardButtonBuy: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { + self.flags = flags + self.style = style + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonBuy", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_keyboardButtonCallback: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var data: Buffer + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, data: Buffer) { + self.flags = flags + self.style = style + self.text = text + self.data = data + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonCallback", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("data", ConstructorParameterDescription(self.data))]) + } + } + public class Cons_keyboardButtonCopy: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var copyText: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, copyText: String) { + self.flags = flags + self.style = style + self.text = text + self.copyText = copyText + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonCopy", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("copyText", ConstructorParameterDescription(self.copyText))]) + } + } + public class Cons_keyboardButtonGame: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { + self.flags = flags + self.style = style + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonGame", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_keyboardButtonRequestGeoLocation: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { + self.flags = flags + self.style = style + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonRequestGeoLocation", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_keyboardButtonRequestPeer: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var buttonId: Int32 + public var peerType: Api.RequestPeerType + public var maxQuantity: Int32 + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, buttonId: Int32, peerType: Api.RequestPeerType, maxQuantity: Int32) { + self.flags = flags + self.style = style + self.text = text + self.buttonId = buttonId + self.peerType = peerType + self.maxQuantity = maxQuantity + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("buttonId", ConstructorParameterDescription(self.buttonId)), ("peerType", ConstructorParameterDescription(self.peerType)), ("maxQuantity", ConstructorParameterDescription(self.maxQuantity))]) + } + } + public class Cons_keyboardButtonRequestPhone: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String) { + self.flags = flags + self.style = style + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonRequestPhone", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_keyboardButtonRequestPoll: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var quiz: Api.Bool? + public var text: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, quiz: Api.Bool?, text: String) { + self.flags = flags + self.style = style + self.quiz = quiz + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonRequestPoll", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("quiz", ConstructorParameterDescription(self.quiz)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_keyboardButtonSimpleWebView: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var url: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, url: String) { + self.flags = flags + self.style = style + self.text = text + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonSimpleWebView", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url))]) + } + } + public class Cons_keyboardButtonSwitchInline: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var query: String + public var peerTypes: [Api.InlineQueryPeerType]? + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, query: String, peerTypes: [Api.InlineQueryPeerType]?) { + self.flags = flags + self.style = style + self.text = text + self.query = query + self.peerTypes = peerTypes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonSwitchInline", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("query", ConstructorParameterDescription(self.query)), ("peerTypes", ConstructorParameterDescription(self.peerTypes))]) + } + } + public class Cons_keyboardButtonUrl: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var url: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, url: String) { + self.flags = flags + self.style = style + self.text = text + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonUrl", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url))]) + } + } + public class Cons_keyboardButtonUrlAuth: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var fwdText: String? + public var url: String + public var buttonId: Int32 + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, fwdText: String?, url: String, buttonId: Int32) { + self.flags = flags + self.style = style + self.text = text + self.fwdText = fwdText + self.url = url + self.buttonId = buttonId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("fwdText", ConstructorParameterDescription(self.fwdText)), ("url", ConstructorParameterDescription(self.url)), ("buttonId", ConstructorParameterDescription(self.buttonId))]) + } + } + public class Cons_keyboardButtonUserProfile: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var userId: Int64 + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, userId: Int64) { + self.flags = flags + self.style = style + self.text = text + self.userId = userId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonUserProfile", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("userId", ConstructorParameterDescription(self.userId))]) + } + } + public class Cons_keyboardButtonWebView: TypeConstructorDescription { + public var flags: Int32 + public var style: Api.KeyboardButtonStyle? + public var text: String + public var url: String + public init(flags: Int32, style: Api.KeyboardButtonStyle?, text: String, url: String) { + self.flags = flags + self.style = style + self.text = text + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonWebView", [("flags", ConstructorParameterDescription(self.flags)), ("style", ConstructorParameterDescription(self.style)), ("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.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(45580630) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + 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(1744911986) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + 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(2103314375) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + _data.userId.serialize(buffer, true) + break + case .keyboardButton(let _data): + if boxed { + buffer.appendInt32(2098662655) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonBuy(let _data): + if boxed { + buffer.appendInt32(1067792645) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonCallback(let _data): + if boxed { + buffer.appendInt32(-433338016) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeBytes(_data.data, buffer: buffer, boxed: false) + break + case .keyboardButtonCopy(let _data): + if boxed { + buffer.appendInt32(-1127960816) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.copyText, buffer: buffer, boxed: false) + break + case .keyboardButtonGame(let _data): + if boxed { + buffer.appendInt32(-1983540999) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonRequestGeoLocation(let _data): + if boxed { + buffer.appendInt32(-1438582451) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonRequestPeer(let _data): + if boxed { + buffer.appendInt32(1527715317) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + 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(1098841487) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + break + case .keyboardButtonRequestPoll(let _data): + if boxed { + buffer.appendInt32(2047989634) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + 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(-514047120) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .keyboardButtonSwitchInline(let _data): + if boxed { + buffer.appendInt32(-1726768644) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + 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 _data): + if boxed { + buffer.appendInt32(-670292500) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + case .keyboardButtonUrlAuth(let _data): + if boxed { + buffer.appendInt32(-183499015) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + 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(-1057137399) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + break + case .keyboardButtonWebView(let _data): + if boxed { + buffer.appendInt32(-398020192) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 10) != 0 { + _data.style!.serialize(buffer, true) + } + serializeString(_data.text, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .inputKeyboardButtonRequestPeer(let _data): + return ("inputKeyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peerType", ConstructorParameterDescription(_data.peerType)), ("maxQuantity", ConstructorParameterDescription(_data.maxQuantity))]) + case .inputKeyboardButtonUrlAuth(let _data): + return ("inputKeyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("fwdText", ConstructorParameterDescription(_data.fwdText)), ("url", ConstructorParameterDescription(_data.url)), ("bot", ConstructorParameterDescription(_data.bot))]) + case .inputKeyboardButtonUserProfile(let _data): + return ("inputKeyboardButtonUserProfile", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("userId", ConstructorParameterDescription(_data.userId))]) + case .keyboardButton(let _data): + return ("keyboardButton", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) + case .keyboardButtonBuy(let _data): + return ("keyboardButtonBuy", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) + case .keyboardButtonCallback(let _data): + return ("keyboardButtonCallback", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("data", ConstructorParameterDescription(_data.data))]) + case .keyboardButtonCopy(let _data): + return ("keyboardButtonCopy", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("copyText", ConstructorParameterDescription(_data.copyText))]) + case .keyboardButtonGame(let _data): + return ("keyboardButtonGame", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) + case .keyboardButtonRequestGeoLocation(let _data): + return ("keyboardButtonRequestGeoLocation", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) + case .keyboardButtonRequestPeer(let _data): + return ("keyboardButtonRequestPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peerType", ConstructorParameterDescription(_data.peerType)), ("maxQuantity", ConstructorParameterDescription(_data.maxQuantity))]) + case .keyboardButtonRequestPhone(let _data): + return ("keyboardButtonRequestPhone", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) + case .keyboardButtonRequestPoll(let _data): + return ("keyboardButtonRequestPoll", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("quiz", ConstructorParameterDescription(_data.quiz)), ("text", ConstructorParameterDescription(_data.text))]) + case .keyboardButtonSimpleWebView(let _data): + return ("keyboardButtonSimpleWebView", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) + case .keyboardButtonSwitchInline(let _data): + return ("keyboardButtonSwitchInline", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("query", ConstructorParameterDescription(_data.query)), ("peerTypes", ConstructorParameterDescription(_data.peerTypes))]) + case .keyboardButtonUrl(let _data): + return ("keyboardButtonUrl", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) + case .keyboardButtonUrlAuth(let _data): + return ("keyboardButtonUrlAuth", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("fwdText", ConstructorParameterDescription(_data.fwdText)), ("url", ConstructorParameterDescription(_data.url)), ("buttonId", ConstructorParameterDescription(_data.buttonId))]) + case .keyboardButtonUserProfile(let _data): + return ("keyboardButtonUserProfile", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("userId", ConstructorParameterDescription(_data.userId))]) + case .keyboardButtonWebView(let _data): + return ("keyboardButtonWebView", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) + } + } + + public static func parse_inputKeyboardButtonRequestPeer(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: Int32? + _4 = reader.readInt32() + var _5: Api.RequestPeerType? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.RequestPeerType + } + var _6: Int32? + _6 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.KeyboardButton.inputKeyboardButtonRequestPeer(Cons_inputKeyboardButtonRequestPeer(flags: _1!, style: _2, text: _3!, buttonId: _4!, peerType: _5!, maxQuantity: _6!)) + } + else { + return nil + } + } + public static func parse_inputKeyboardButtonUrlAuth(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } + var _5: String? + _5 = parseString(reader) + var _6: Api.InputUser? + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.InputUser + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.KeyboardButton.inputKeyboardButtonUrlAuth(Cons_inputKeyboardButtonUrlAuth(flags: _1!, style: _2, text: _3!, fwdText: _4, url: _5!, bot: _6!)) + } + else { + return nil + } + } + public static func parse_inputKeyboardButtonUserProfile(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: Api.InputUser? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputUser + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.inputKeyboardButtonUserProfile(Cons_inputKeyboardButtonUserProfile(flags: _1!, style: _2, text: _3!, userId: _4!)) + } + else { + return nil + } + } + public static func parse_keyboardButton(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.KeyboardButton.keyboardButton(Cons_keyboardButton(flags: _1!, style: _2, text: _3!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonBuy(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.KeyboardButton.keyboardButtonBuy(Cons_keyboardButtonBuy(flags: _1!, style: _2, text: _3!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonCallback(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: Buffer? + _4 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.keyboardButtonCallback(Cons_keyboardButtonCallback(flags: _1!, style: _2, text: _3!, data: _4!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonCopy(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.keyboardButtonCopy(Cons_keyboardButtonCopy(flags: _1!, style: _2, text: _3!, copyText: _4!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonGame(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.KeyboardButton.keyboardButtonGame(Cons_keyboardButtonGame(flags: _1!, style: _2, text: _3!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonRequestGeoLocation(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.KeyboardButton.keyboardButtonRequestGeoLocation(Cons_keyboardButtonRequestGeoLocation(flags: _1!, style: _2, text: _3!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonRequestPeer(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: Int32? + _4 = reader.readInt32() + var _5: Api.RequestPeerType? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.RequestPeerType + } + var _6: Int32? + _6 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.KeyboardButton.keyboardButtonRequestPeer(Cons_keyboardButtonRequestPeer(flags: _1!, style: _2, text: _3!, buttonId: _4!, peerType: _5!, maxQuantity: _6!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonRequestPhone(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.KeyboardButton.keyboardButtonRequestPhone(Cons_keyboardButtonRequestPhone(flags: _1!, style: _2, text: _3!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonRequestPoll(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: Api.Bool? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } + var _4: String? + _4 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.keyboardButtonRequestPoll(Cons_keyboardButtonRequestPoll(flags: _1!, style: _2, quiz: _3, text: _4!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonSimpleWebView(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.keyboardButtonSimpleWebView(Cons_keyboardButtonSimpleWebView(flags: _1!, style: _2, text: _3!, url: _4!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonSwitchInline(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: [Api.InlineQueryPeerType]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InlineQueryPeerType.self) + } + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.KeyboardButton.keyboardButtonSwitchInline(Cons_keyboardButtonSwitchInline(flags: _1!, style: _2, text: _3!, query: _4!, peerTypes: _5)) + } + else { + return nil + } + } + public static func parse_keyboardButtonUrl(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.keyboardButtonUrl(Cons_keyboardButtonUrl(flags: _1!, style: _2, text: _3!, url: _4!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonUrlAuth(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: String? + _5 = parseString(reader) + var _6: Int32? + _6 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.KeyboardButton.keyboardButtonUrlAuth(Cons_keyboardButtonUrlAuth(flags: _1!, style: _2, text: _3!, fwdText: _4, url: _5!, buttonId: _6!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonUserProfile(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: Int64? + _4 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.keyboardButtonUserProfile(Cons_keyboardButtonUserProfile(flags: _1!, style: _2, text: _3!, userId: _4!)) + } + else { + return nil + } + } + public static func parse_keyboardButtonWebView(_ reader: BufferReader) -> KeyboardButton? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.KeyboardButtonStyle? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.KeyboardButtonStyle + } + } + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.KeyboardButton.keyboardButtonWebView(Cons_keyboardButtonWebView(flags: _1!, style: _2, text: _3!, url: _4!)) + } + else { + return nil + } + } + } +} public extension Api { enum KeyboardButtonRow: TypeConstructorDescription { public class Cons_keyboardButtonRow: TypeConstructorDescription { @@ -988,3559 +2090,3 @@ public extension Api { } } } -public extension Api { - enum MediaAreaCoordinates: TypeConstructorDescription { - public class Cons_mediaAreaCoordinates: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("mediaAreaCoordinates", [("flags", ConstructorParameterDescription(self.flags)), ("x", ConstructorParameterDescription(self.x)), ("y", ConstructorParameterDescription(self.y)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("rotation", ConstructorParameterDescription(self.rotation)), ("radius", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .mediaAreaCoordinates(let _data): - return ("mediaAreaCoordinates", [("flags", ConstructorParameterDescription(_data.flags)), ("x", ConstructorParameterDescription(_data.x)), ("y", ConstructorParameterDescription(_data.y)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("rotation", ConstructorParameterDescription(_data.rotation)), ("radius", ConstructorParameterDescription(_data.radius))]) - } - } - - public static func parse_mediaAreaCoordinates(_ reader: BufferReader) -> MediaAreaCoordinates? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Double? - _2 = reader.readDouble() - var _3: Double? - _3 = reader.readDouble() - var _4: Double? - _4 = reader.readDouble() - var _5: Double? - _5 = reader.readDouble() - var _6: Double? - _6 = reader.readDouble() - var _7: Double? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _7 = reader.readDouble() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - 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 { - public class Cons_message: TypeConstructorDescription { - public var flags: Int32 - public var flags2: Int32 - public var id: Int32 - public var fromId: Api.Peer? - public var fromBoostsApplied: Int32? - public var fromRank: String? - 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 guestchatViaFrom: Api.Peer? - 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?, fromRank: String?, peerId: Api.Peer, savedPeerId: Api.Peer?, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, viaBusinessBotId: Int64?, guestchatViaFrom: Api.Peer?, 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.fromRank = fromRank - self.peerId = peerId - self.savedPeerId = savedPeerId - self.fwdFrom = fwdFrom - self.viaBotId = viaBotId - self.viaBusinessBotId = viaBusinessBotId - self.guestchatViaFrom = guestchatViaFrom - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("message", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("fromId", ConstructorParameterDescription(self.fromId)), ("fromBoostsApplied", ConstructorParameterDescription(self.fromBoostsApplied)), ("fromRank", ConstructorParameterDescription(self.fromRank)), ("peerId", ConstructorParameterDescription(self.peerId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("viaBotId", ConstructorParameterDescription(self.viaBotId)), ("viaBusinessBotId", ConstructorParameterDescription(self.viaBusinessBotId)), ("guestchatViaFrom", ConstructorParameterDescription(self.guestchatViaFrom)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("date", ConstructorParameterDescription(self.date)), ("message", ConstructorParameterDescription(self.message)), ("media", ConstructorParameterDescription(self.media)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup)), ("entities", ConstructorParameterDescription(self.entities)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("replies", ConstructorParameterDescription(self.replies)), ("editDate", ConstructorParameterDescription(self.editDate)), ("postAuthor", ConstructorParameterDescription(self.postAuthor)), ("groupedId", ConstructorParameterDescription(self.groupedId)), ("reactions", ConstructorParameterDescription(self.reactions)), ("restrictionReason", ConstructorParameterDescription(self.restrictionReason)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod)), ("quickReplyShortcutId", ConstructorParameterDescription(self.quickReplyShortcutId)), ("effect", ConstructorParameterDescription(self.effect)), ("factcheck", ConstructorParameterDescription(self.factcheck)), ("reportDeliveryUntilDate", ConstructorParameterDescription(self.reportDeliveryUntilDate)), ("paidMessageStars", ConstructorParameterDescription(self.paidMessageStars)), ("suggestedPost", ConstructorParameterDescription(self.suggestedPost)), ("scheduleRepeatPeriod", ConstructorParameterDescription(self.scheduleRepeatPeriod)), ("summaryFromLanguage", ConstructorParameterDescription(self.summaryFromLanguage))]) - } - } - public class Cons_messageEmpty: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEmpty", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("peerId", ConstructorParameterDescription(self.peerId))]) - } - } - public class Cons_messageService: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageService", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("fromId", ConstructorParameterDescription(self.fromId)), ("peerId", ConstructorParameterDescription(self.peerId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("date", ConstructorParameterDescription(self.date)), ("action", ConstructorParameterDescription(self.action)), ("reactions", ConstructorParameterDescription(self.reactions)), ("ttlPeriod", ConstructorParameterDescription(self.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(-1779470549) - } - 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) - } - if Int(_data.flags2) & Int(1 << 12) != 0 { - serializeString(_data.fromRank!, 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.flags2) & Int(1 << 19) != 0 { - _data.guestchatViaFrom!.serialize(buffer, true) - } - 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(_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(_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, ConstructorParameterDescription)]) { - switch self { - case .message(let _data): - return ("message", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("fromBoostsApplied", ConstructorParameterDescription(_data.fromBoostsApplied)), ("fromRank", ConstructorParameterDescription(_data.fromRank)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("viaBotId", ConstructorParameterDescription(_data.viaBotId)), ("viaBusinessBotId", ConstructorParameterDescription(_data.viaBusinessBotId)), ("guestchatViaFrom", ConstructorParameterDescription(_data.guestchatViaFrom)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("date", ConstructorParameterDescription(_data.date)), ("message", ConstructorParameterDescription(_data.message)), ("media", ConstructorParameterDescription(_data.media)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup)), ("entities", ConstructorParameterDescription(_data.entities)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("replies", ConstructorParameterDescription(_data.replies)), ("editDate", ConstructorParameterDescription(_data.editDate)), ("postAuthor", ConstructorParameterDescription(_data.postAuthor)), ("groupedId", ConstructorParameterDescription(_data.groupedId)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("restrictionReason", ConstructorParameterDescription(_data.restrictionReason)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod)), ("quickReplyShortcutId", ConstructorParameterDescription(_data.quickReplyShortcutId)), ("effect", ConstructorParameterDescription(_data.effect)), ("factcheck", ConstructorParameterDescription(_data.factcheck)), ("reportDeliveryUntilDate", ConstructorParameterDescription(_data.reportDeliveryUntilDate)), ("paidMessageStars", ConstructorParameterDescription(_data.paidMessageStars)), ("suggestedPost", ConstructorParameterDescription(_data.suggestedPost)), ("scheduleRepeatPeriod", ConstructorParameterDescription(_data.scheduleRepeatPeriod)), ("summaryFromLanguage", ConstructorParameterDescription(_data.summaryFromLanguage))]) - case .messageEmpty(let _data): - return ("messageEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("peerId", ConstructorParameterDescription(_data.peerId))]) - case .messageService(let _data): - return ("messageService", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("date", ConstructorParameterDescription(_data.date)), ("action", ConstructorParameterDescription(_data.action)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) - } - } - - public static func parse_message(_ reader: BufferReader) -> Message? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 29) != 0 { - _5 = reader.readInt32() - } - var _6: String? - if Int(_2 ?? 0) & Int(1 << 12) != 0 { - _6 = parseString(reader) - } - var _7: Api.Peer? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _8: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 28) != 0 { - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _9: Api.MessageFwdHeader? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader - } - } - var _10: Int64? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _10 = reader.readInt64() - } - var _11: Int64? - if Int(_2 ?? 0) & Int(1 << 0) != 0 { - _11 = reader.readInt64() - } - var _12: Api.Peer? - if Int(_2 ?? 0) & Int(1 << 19) != 0 { - if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _13: Api.MessageReplyHeader? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader - } - } - var _14: Int32? - _14 = reader.readInt32() - var _15: String? - _15 = parseString(reader) - var _16: Api.MessageMedia? - if Int(_1 ?? 0) & Int(1 << 9) != 0 { - if let signature = reader.readInt32() { - _16 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - } - var _17: Api.ReplyMarkup? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup - } - } - var _18: [Api.MessageEntity]? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - if let _ = reader.readInt32() { - _18 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - } - var _19: Int32? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - _19 = reader.readInt32() - } - var _20: Int32? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - _20 = reader.readInt32() - } - var _21: Api.MessageReplies? - if Int(_1 ?? 0) & Int(1 << 23) != 0 { - if let signature = reader.readInt32() { - _21 = Api.parse(reader, signature: signature) as? Api.MessageReplies - } - } - var _22: Int32? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - _22 = reader.readInt32() - } - var _23: String? - if Int(_1 ?? 0) & Int(1 << 16) != 0 { - _23 = parseString(reader) - } - var _24: Int64? - if Int(_1 ?? 0) & Int(1 << 17) != 0 { - _24 = reader.readInt64() - } - var _25: Api.MessageReactions? - if Int(_1 ?? 0) & Int(1 << 20) != 0 { - if let signature = reader.readInt32() { - _25 = Api.parse(reader, signature: signature) as? Api.MessageReactions - } - } - var _26: [Api.RestrictionReason]? - if Int(_1 ?? 0) & Int(1 << 22) != 0 { - if let _ = reader.readInt32() { - _26 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) - } - } - var _27: Int32? - if Int(_1 ?? 0) & Int(1 << 25) != 0 { - _27 = reader.readInt32() - } - var _28: Int32? - if Int(_1 ?? 0) & Int(1 << 30) != 0 { - _28 = reader.readInt32() - } - var _29: Int64? - if Int(_2 ?? 0) & Int(1 << 2) != 0 { - _29 = reader.readInt64() - } - var _30: Api.FactCheck? - if Int(_2 ?? 0) & Int(1 << 3) != 0 { - if let signature = reader.readInt32() { - _30 = Api.parse(reader, signature: signature) as? Api.FactCheck - } - } - var _31: Int32? - if Int(_2 ?? 0) & Int(1 << 5) != 0 { - _31 = reader.readInt32() - } - var _32: Int64? - if Int(_2 ?? 0) & Int(1 << 6) != 0 { - _32 = reader.readInt64() - } - var _33: Api.SuggestedPost? - if Int(_2 ?? 0) & Int(1 << 7) != 0 { - if let signature = reader.readInt32() { - _33 = Api.parse(reader, signature: signature) as? Api.SuggestedPost - } - } - var _34: Int32? - if Int(_2 ?? 0) & Int(1 << 10) != 0 { - _34 = reader.readInt32() - } - var _35: String? - if Int(_2 ?? 0) & Int(1 << 11) != 0 { - _35 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 29) == 0) || _5 != nil - let _c6 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 28) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _10 != nil - let _c11 = (Int(_2 ?? 0) & Int(1 << 0) == 0) || _11 != nil - let _c12 = (Int(_2 ?? 0) & Int(1 << 19) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _13 != nil - let _c14 = _14 != nil - let _c15 = _15 != nil - let _c16 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _16 != nil - let _c17 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _17 != nil - let _c18 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _18 != nil - let _c19 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _19 != nil - let _c20 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _20 != nil - let _c21 = (Int(_1 ?? 0) & Int(1 << 23) == 0) || _21 != nil - let _c22 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _22 != nil - let _c23 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _23 != nil - let _c24 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _24 != nil - let _c25 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _25 != nil - let _c26 = (Int(_1 ?? 0) & Int(1 << 22) == 0) || _26 != nil - let _c27 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _27 != nil - let _c28 = (Int(_1 ?? 0) & Int(1 << 30) == 0) || _28 != nil - let _c29 = (Int(_2 ?? 0) & Int(1 << 2) == 0) || _29 != nil - let _c30 = (Int(_2 ?? 0) & Int(1 << 3) == 0) || _30 != nil - let _c31 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _31 != nil - let _c32 = (Int(_2 ?? 0) & Int(1 << 6) == 0) || _32 != nil - let _c33 = (Int(_2 ?? 0) & Int(1 << 7) == 0) || _33 != nil - let _c34 = (Int(_2 ?? 0) & Int(1 << 10) == 0) || _34 != nil - let _c35 = (Int(_2 ?? 0) & Int(1 << 11) == 0) || _35 != 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 { - return Api.Message.message(Cons_message(flags: _1!, flags2: _2!, id: _3!, fromId: _4, fromBoostsApplied: _5, fromRank: _6, peerId: _7!, savedPeerId: _8, fwdFrom: _9, viaBotId: _10, viaBusinessBotId: _11, guestchatViaFrom: _12, replyTo: _13, date: _14!, message: _15!, media: _16, replyMarkup: _17, entities: _18, views: _19, forwards: _20, replies: _21, editDate: _22, postAuthor: _23, groupedId: _24, reactions: _25, restrictionReason: _26, ttlPeriod: _27, quickReplyShortcutId: _28, effect: _29, factcheck: _30, reportDeliveryUntilDate: _31, paidMessageStars: _32, suggestedPost: _33, scheduleRepeatPeriod: _34, summaryFromLanguage: _35)) - } - else { - return nil - } - } - public static func parse_messageEmpty(_ reader: BufferReader) -> Message? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Message.messageEmpty(Cons_messageEmpty(flags: _1!, id: _2!, peerId: _3)) - } - else { - return nil - } - } - public static func parse_messageService(_ reader: BufferReader) -> Message? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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? - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.MessageAction - } - var _9: Api.MessageReactions? - if Int(_1 ?? 0) & Int(1 << 20) != 0 { - if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.MessageReactions - } - } - var _10: Int32? - if Int(_1 ?? 0) & Int(1 << 25) != 0 { - _10 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 28) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _10 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - 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 { - indirect enum MessageAction: TypeConstructorDescription { - public class Cons_messageActionBoostApply: TypeConstructorDescription { - public var boosts: Int32 - public init(boosts: Int32) { - self.boosts = boosts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionBoostApply", [("boosts", ConstructorParameterDescription(self.boosts))]) - } - } - public class Cons_messageActionBotAllowed: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionBotAllowed", [("flags", ConstructorParameterDescription(self.flags)), ("domain", ConstructorParameterDescription(self.domain)), ("app", ConstructorParameterDescription(self.app))]) - } - } - public class Cons_messageActionChangeCreator: TypeConstructorDescription { - public var newCreatorId: Int64 - public init(newCreatorId: Int64) { - self.newCreatorId = newCreatorId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChangeCreator", [("newCreatorId", ConstructorParameterDescription(self.newCreatorId))]) - } - } - public class Cons_messageActionChannelCreate: TypeConstructorDescription { - public var title: String - public init(title: String) { - self.title = title - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChannelCreate", [("title", ConstructorParameterDescription(self.title))]) - } - } - public class Cons_messageActionChannelMigrateFrom: TypeConstructorDescription { - public var title: String - public var chatId: Int64 - public init(title: String, chatId: Int64) { - self.title = title - self.chatId = chatId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChannelMigrateFrom", [("title", ConstructorParameterDescription(self.title)), ("chatId", ConstructorParameterDescription(self.chatId))]) - } - } - public class Cons_messageActionChatAddUser: TypeConstructorDescription { - public var users: [Int64] - public init(users: [Int64]) { - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChatAddUser", [("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_messageActionChatCreate: TypeConstructorDescription { - public var title: String - public var users: [Int64] - public init(title: String, users: [Int64]) { - self.title = title - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChatCreate", [("title", ConstructorParameterDescription(self.title)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_messageActionChatDeleteUser: TypeConstructorDescription { - public var userId: Int64 - public init(userId: Int64) { - self.userId = userId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChatDeleteUser", [("userId", ConstructorParameterDescription(self.userId))]) - } - } - public class Cons_messageActionChatEditPhoto: TypeConstructorDescription { - public var photo: Api.Photo - public init(photo: Api.Photo) { - self.photo = photo - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChatEditPhoto", [("photo", ConstructorParameterDescription(self.photo))]) - } - } - public class Cons_messageActionChatEditTitle: TypeConstructorDescription { - public var title: String - public init(title: String) { - self.title = title - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChatEditTitle", [("title", ConstructorParameterDescription(self.title))]) - } - } - public class Cons_messageActionChatJoinedByLink: TypeConstructorDescription { - public var inviterId: Int64 - public init(inviterId: Int64) { - self.inviterId = inviterId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChatJoinedByLink", [("inviterId", ConstructorParameterDescription(self.inviterId))]) - } - } - public class Cons_messageActionChatMigrateTo: TypeConstructorDescription { - public var channelId: Int64 - public init(channelId: Int64) { - self.channelId = channelId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionChatMigrateTo", [("channelId", ConstructorParameterDescription(self.channelId))]) - } - } - public class Cons_messageActionConferenceCall: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionConferenceCall", [("flags", ConstructorParameterDescription(self.flags)), ("callId", ConstructorParameterDescription(self.callId)), ("duration", ConstructorParameterDescription(self.duration)), ("otherParticipants", ConstructorParameterDescription(self.otherParticipants))]) - } - } - public class Cons_messageActionCustomAction: TypeConstructorDescription { - public var message: String - public init(message: String) { - self.message = message - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionCustomAction", [("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_messageActionGameScore: TypeConstructorDescription { - public var gameId: Int64 - public var score: Int32 - public init(gameId: Int64, score: Int32) { - self.gameId = gameId - self.score = score - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGameScore", [("gameId", ConstructorParameterDescription(self.gameId)), ("score", ConstructorParameterDescription(self.score))]) - } - } - public class Cons_messageActionGeoProximityReached: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGeoProximityReached", [("fromId", ConstructorParameterDescription(self.fromId)), ("toId", ConstructorParameterDescription(self.toId)), ("distance", ConstructorParameterDescription(self.distance))]) - } - } - public class Cons_messageActionGiftCode: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGiftCode", [("flags", ConstructorParameterDescription(self.flags)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("days", ConstructorParameterDescription(self.days)), ("slug", ConstructorParameterDescription(self.slug)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_messageActionGiftPremium: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGiftPremium", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("days", ConstructorParameterDescription(self.days)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_messageActionGiftStars: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGiftStars", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("stars", ConstructorParameterDescription(self.stars)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("transactionId", ConstructorParameterDescription(self.transactionId))]) - } - } - public class Cons_messageActionGiftTon: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGiftTon", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("transactionId", ConstructorParameterDescription(self.transactionId))]) - } - } - public class Cons_messageActionGiveawayLaunch: TypeConstructorDescription { - public var flags: Int32 - public var stars: Int64? - public init(flags: Int32, stars: Int64?) { - self.flags = flags - self.stars = stars - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGiveawayLaunch", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars))]) - } - } - public class Cons_messageActionGiveawayResults: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGiveawayResults", [("flags", ConstructorParameterDescription(self.flags)), ("winnersCount", ConstructorParameterDescription(self.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(self.unclaimedCount))]) - } - } - public class Cons_messageActionGroupCall: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGroupCall", [("flags", ConstructorParameterDescription(self.flags)), ("call", ConstructorParameterDescription(self.call)), ("duration", ConstructorParameterDescription(self.duration))]) - } - } - public class Cons_messageActionGroupCallScheduled: TypeConstructorDescription { - public var call: Api.InputGroupCall - public var scheduleDate: Int32 - public init(call: Api.InputGroupCall, scheduleDate: Int32) { - self.call = call - self.scheduleDate = scheduleDate - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionGroupCallScheduled", [("call", ConstructorParameterDescription(self.call)), ("scheduleDate", ConstructorParameterDescription(self.scheduleDate))]) - } - } - public class Cons_messageActionInviteToGroupCall: TypeConstructorDescription { - public var call: Api.InputGroupCall - public var users: [Int64] - public init(call: Api.InputGroupCall, users: [Int64]) { - self.call = call - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionInviteToGroupCall", [("call", ConstructorParameterDescription(self.call)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_messageActionManagedBotCreated: TypeConstructorDescription { - public var botId: Int64 - public init(botId: Int64) { - self.botId = botId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionManagedBotCreated", [("botId", ConstructorParameterDescription(self.botId))]) - } - } - public class Cons_messageActionNewCreatorPending: TypeConstructorDescription { - public var newCreatorId: Int64 - public init(newCreatorId: Int64) { - self.newCreatorId = newCreatorId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionNewCreatorPending", [("newCreatorId", ConstructorParameterDescription(self.newCreatorId))]) - } - } - public class Cons_messageActionNoForwardsRequest: TypeConstructorDescription { - public var flags: Int32 - public var prevValue: Api.Bool - public var newValue: Api.Bool - public init(flags: Int32, prevValue: Api.Bool, newValue: Api.Bool) { - self.flags = flags - self.prevValue = prevValue - self.newValue = newValue - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionNoForwardsRequest", [("flags", ConstructorParameterDescription(self.flags)), ("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) - } - } - public class Cons_messageActionNoForwardsToggle: TypeConstructorDescription { - public var prevValue: Api.Bool - public var newValue: Api.Bool - public init(prevValue: Api.Bool, newValue: Api.Bool) { - self.prevValue = prevValue - self.newValue = newValue - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionNoForwardsToggle", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) - } - } - public class Cons_messageActionPaidMessagesPrice: TypeConstructorDescription { - public var flags: Int32 - public var stars: Int64 - public init(flags: Int32, stars: Int64) { - self.flags = flags - self.stars = stars - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPaidMessagesPrice", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars))]) - } - } - public class Cons_messageActionPaidMessagesRefunded: TypeConstructorDescription { - public var count: Int32 - public var stars: Int64 - public init(count: Int32, stars: Int64) { - self.count = count - self.stars = stars - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPaidMessagesRefunded", [("count", ConstructorParameterDescription(self.count)), ("stars", ConstructorParameterDescription(self.stars))]) - } - } - public class Cons_messageActionPaymentRefunded: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPaymentRefunded", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("payload", ConstructorParameterDescription(self.payload)), ("charge", ConstructorParameterDescription(self.charge))]) - } - } - public class Cons_messageActionPaymentSent: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPaymentSent", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("invoiceSlug", ConstructorParameterDescription(self.invoiceSlug)), ("subscriptionUntilDate", ConstructorParameterDescription(self.subscriptionUntilDate))]) - } - } - public class Cons_messageActionPaymentSentMe: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPaymentSentMe", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("payload", ConstructorParameterDescription(self.payload)), ("info", ConstructorParameterDescription(self.info)), ("shippingOptionId", ConstructorParameterDescription(self.shippingOptionId)), ("charge", ConstructorParameterDescription(self.charge)), ("subscriptionUntilDate", ConstructorParameterDescription(self.subscriptionUntilDate))]) - } - } - public class Cons_messageActionPhoneCall: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPhoneCall", [("flags", ConstructorParameterDescription(self.flags)), ("callId", ConstructorParameterDescription(self.callId)), ("reason", ConstructorParameterDescription(self.reason)), ("duration", ConstructorParameterDescription(self.duration))]) - } - } - public class Cons_messageActionPollAppendAnswer: TypeConstructorDescription { - public var answer: Api.PollAnswer - public init(answer: Api.PollAnswer) { - self.answer = answer - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPollAppendAnswer", [("answer", ConstructorParameterDescription(self.answer))]) - } - } - public class Cons_messageActionPollDeleteAnswer: TypeConstructorDescription { - public var answer: Api.PollAnswer - public init(answer: Api.PollAnswer) { - self.answer = answer - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPollDeleteAnswer", [("answer", ConstructorParameterDescription(self.answer))]) - } - } - public class Cons_messageActionPrizeStars: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionPrizeStars", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("transactionId", ConstructorParameterDescription(self.transactionId)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("giveawayMsgId", ConstructorParameterDescription(self.giveawayMsgId))]) - } - } - public class Cons_messageActionRequestedPeer: TypeConstructorDescription { - public var buttonId: Int32 - public var peers: [Api.Peer] - public init(buttonId: Int32, peers: [Api.Peer]) { - self.buttonId = buttonId - self.peers = peers - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionRequestedPeer", [("buttonId", ConstructorParameterDescription(self.buttonId)), ("peers", ConstructorParameterDescription(self.peers))]) - } - } - public class Cons_messageActionRequestedPeerSentMe: TypeConstructorDescription { - public var buttonId: Int32 - public var peers: [Api.RequestedPeer] - public init(buttonId: Int32, peers: [Api.RequestedPeer]) { - self.buttonId = buttonId - self.peers = peers - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionRequestedPeerSentMe", [("buttonId", ConstructorParameterDescription(self.buttonId)), ("peers", ConstructorParameterDescription(self.peers))]) - } - } - public class Cons_messageActionSecureValuesSent: TypeConstructorDescription { - public var types: [Api.SecureValueType] - public init(types: [Api.SecureValueType]) { - self.types = types - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSecureValuesSent", [("types", ConstructorParameterDescription(self.types))]) - } - } - public class Cons_messageActionSecureValuesSentMe: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSecureValuesSentMe", [("values", ConstructorParameterDescription(self.values)), ("credentials", ConstructorParameterDescription(self.credentials))]) - } - } - public class Cons_messageActionSetChatTheme: TypeConstructorDescription { - public var theme: Api.ChatTheme - public init(theme: Api.ChatTheme) { - self.theme = theme - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSetChatTheme", [("theme", ConstructorParameterDescription(self.theme))]) - } - } - public class Cons_messageActionSetChatWallPaper: TypeConstructorDescription { - public var flags: Int32 - public var wallpaper: Api.WallPaper - public init(flags: Int32, wallpaper: Api.WallPaper) { - self.flags = flags - self.wallpaper = wallpaper - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSetChatWallPaper", [("flags", ConstructorParameterDescription(self.flags)), ("wallpaper", ConstructorParameterDescription(self.wallpaper))]) - } - } - public class Cons_messageActionSetMessagesTTL: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSetMessagesTTL", [("flags", ConstructorParameterDescription(self.flags)), ("period", ConstructorParameterDescription(self.period)), ("autoSettingFrom", ConstructorParameterDescription(self.autoSettingFrom))]) - } - } - public class Cons_messageActionStarGift: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionStarGift", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("message", ConstructorParameterDescription(self.message)), ("convertStars", ConstructorParameterDescription(self.convertStars)), ("upgradeMsgId", ConstructorParameterDescription(self.upgradeMsgId)), ("upgradeStars", ConstructorParameterDescription(self.upgradeStars)), ("fromId", ConstructorParameterDescription(self.fromId)), ("peer", ConstructorParameterDescription(self.peer)), ("savedId", ConstructorParameterDescription(self.savedId)), ("prepaidUpgradeHash", ConstructorParameterDescription(self.prepaidUpgradeHash)), ("giftMsgId", ConstructorParameterDescription(self.giftMsgId)), ("toId", ConstructorParameterDescription(self.toId)), ("giftNum", ConstructorParameterDescription(self.giftNum))]) - } - } - public class Cons_messageActionStarGiftPurchaseOffer: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionStarGiftPurchaseOffer", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("price", ConstructorParameterDescription(self.price)), ("expiresAt", ConstructorParameterDescription(self.expiresAt))]) - } - } - public class Cons_messageActionStarGiftPurchaseOfferDeclined: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("price", ConstructorParameterDescription(self.price))]) - } - } - public class Cons_messageActionStarGiftUnique: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionStarGiftUnique", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("canExportAt", ConstructorParameterDescription(self.canExportAt)), ("transferStars", ConstructorParameterDescription(self.transferStars)), ("fromId", ConstructorParameterDescription(self.fromId)), ("peer", ConstructorParameterDescription(self.peer)), ("savedId", ConstructorParameterDescription(self.savedId)), ("resaleAmount", ConstructorParameterDescription(self.resaleAmount)), ("canTransferAt", ConstructorParameterDescription(self.canTransferAt)), ("canResellAt", ConstructorParameterDescription(self.canResellAt)), ("dropOriginalDetailsStars", ConstructorParameterDescription(self.dropOriginalDetailsStars)), ("canCraftAt", ConstructorParameterDescription(self.canCraftAt))]) - } - } - public class Cons_messageActionSuggestBirthday: TypeConstructorDescription { - public var birthday: Api.Birthday - public init(birthday: Api.Birthday) { - self.birthday = birthday - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSuggestBirthday", [("birthday", ConstructorParameterDescription(self.birthday))]) - } - } - public class Cons_messageActionSuggestProfilePhoto: TypeConstructorDescription { - public var photo: Api.Photo - public init(photo: Api.Photo) { - self.photo = photo - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSuggestProfilePhoto", [("photo", ConstructorParameterDescription(self.photo))]) - } - } - public class Cons_messageActionSuggestedPostApproval: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSuggestedPostApproval", [("flags", ConstructorParameterDescription(self.flags)), ("rejectComment", ConstructorParameterDescription(self.rejectComment)), ("scheduleDate", ConstructorParameterDescription(self.scheduleDate)), ("price", ConstructorParameterDescription(self.price))]) - } - } - public class Cons_messageActionSuggestedPostRefund: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSuggestedPostRefund", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - public class Cons_messageActionSuggestedPostSuccess: TypeConstructorDescription { - public var price: Api.StarsAmount - public init(price: Api.StarsAmount) { - self.price = price - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionSuggestedPostSuccess", [("price", ConstructorParameterDescription(self.price))]) - } - } - public class Cons_messageActionTodoAppendTasks: TypeConstructorDescription { - public var list: [Api.TodoItem] - public init(list: [Api.TodoItem]) { - self.list = list - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionTodoAppendTasks", [("list", ConstructorParameterDescription(self.list))]) - } - } - public class Cons_messageActionTodoCompletions: TypeConstructorDescription { - public var completed: [Int32] - public var incompleted: [Int32] - public init(completed: [Int32], incompleted: [Int32]) { - self.completed = completed - self.incompleted = incompleted - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionTodoCompletions", [("completed", ConstructorParameterDescription(self.completed)), ("incompleted", ConstructorParameterDescription(self.incompleted))]) - } - } - public class Cons_messageActionTopicCreate: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionTopicCreate", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("iconColor", ConstructorParameterDescription(self.iconColor)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId))]) - } - } - public class Cons_messageActionTopicEdit: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionTopicEdit", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId)), ("closed", ConstructorParameterDescription(self.closed)), ("hidden", ConstructorParameterDescription(self.hidden))]) - } - } - public class Cons_messageActionWebViewDataSent: TypeConstructorDescription { - public var text: String - public init(text: String) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionWebViewDataSent", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_messageActionWebViewDataSentMe: TypeConstructorDescription { - public var text: String - public var data: String - public init(text: String, data: String) { - self.text = text - self.data = data - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageActionWebViewDataSentMe", [("text", ConstructorParameterDescription(self.text)), ("data", ConstructorParameterDescription(self.data))]) - } - } - case messageActionBoostApply(Cons_messageActionBoostApply) - case messageActionBotAllowed(Cons_messageActionBotAllowed) - case messageActionChangeCreator(Cons_messageActionChangeCreator) - case messageActionChannelCreate(Cons_messageActionChannelCreate) - case messageActionChannelMigrateFrom(Cons_messageActionChannelMigrateFrom) - case messageActionChatAddUser(Cons_messageActionChatAddUser) - case messageActionChatCreate(Cons_messageActionChatCreate) - case messageActionChatDeletePhoto - case messageActionChatDeleteUser(Cons_messageActionChatDeleteUser) - case messageActionChatEditPhoto(Cons_messageActionChatEditPhoto) - case messageActionChatEditTitle(Cons_messageActionChatEditTitle) - case messageActionChatJoinedByLink(Cons_messageActionChatJoinedByLink) - case messageActionChatJoinedByRequest - case messageActionChatMigrateTo(Cons_messageActionChatMigrateTo) - case messageActionConferenceCall(Cons_messageActionConferenceCall) - case messageActionContactSignUp - case messageActionCustomAction(Cons_messageActionCustomAction) - case messageActionEmpty - 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(Cons_messageActionInviteToGroupCall) - case messageActionManagedBotCreated(Cons_messageActionManagedBotCreated) - case messageActionNewCreatorPending(Cons_messageActionNewCreatorPending) - case messageActionNoForwardsRequest(Cons_messageActionNoForwardsRequest) - case messageActionNoForwardsToggle(Cons_messageActionNoForwardsToggle) - 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 messageActionPollAppendAnswer(Cons_messageActionPollAppendAnswer) - case messageActionPollDeleteAnswer(Cons_messageActionPollDeleteAnswer) - case messageActionPrizeStars(Cons_messageActionPrizeStars) - case messageActionRequestedPeer(Cons_messageActionRequestedPeer) - case messageActionRequestedPeerSentMe(Cons_messageActionRequestedPeerSentMe) - case messageActionScreenshotTaken - 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 .messageActionChangeCreator(let _data): - if boxed { - buffer.appendInt32(-511160261) - } - serializeInt64(_data.newCreatorId, buffer: buffer, boxed: false) - 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(_data.otherParticipants!.count)) - for item in _data.otherParticipants! { - item.serialize(buffer, true) - } - } - 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 .messageActionManagedBotCreated(let _data): - if boxed { - buffer.appendInt32(375414334) - } - serializeInt64(_data.botId, buffer: buffer, boxed: false) - break - case .messageActionNewCreatorPending(let _data): - if boxed { - buffer.appendInt32(-1333866363) - } - serializeInt64(_data.newCreatorId, buffer: buffer, boxed: false) - break - case .messageActionNoForwardsRequest(let _data): - if boxed { - buffer.appendInt32(1042781114) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.prevValue.serialize(buffer, true) - _data.newValue.serialize(buffer, true) - break - case .messageActionNoForwardsToggle(let _data): - if boxed { - buffer.appendInt32(-1082301070) - } - _data.prevValue.serialize(buffer, true) - _data.newValue.serialize(buffer, true) - 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 .messageActionPollAppendAnswer(let _data): - if boxed { - buffer.appendInt32(-1650340500) - } - _data.answer.serialize(buffer, true) - break - case .messageActionPollDeleteAnswer(let _data): - if boxed { - buffer.appendInt32(966161628) - } - _data.answer.serialize(buffer, true) - 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, ConstructorParameterDescription)]) { - switch self { - case .messageActionBoostApply(let _data): - return ("messageActionBoostApply", [("boosts", ConstructorParameterDescription(_data.boosts))]) - case .messageActionBotAllowed(let _data): - return ("messageActionBotAllowed", [("flags", ConstructorParameterDescription(_data.flags)), ("domain", ConstructorParameterDescription(_data.domain)), ("app", ConstructorParameterDescription(_data.app))]) - case .messageActionChangeCreator(let _data): - return ("messageActionChangeCreator", [("newCreatorId", ConstructorParameterDescription(_data.newCreatorId))]) - case .messageActionChannelCreate(let _data): - return ("messageActionChannelCreate", [("title", ConstructorParameterDescription(_data.title))]) - case .messageActionChannelMigrateFrom(let _data): - return ("messageActionChannelMigrateFrom", [("title", ConstructorParameterDescription(_data.title)), ("chatId", ConstructorParameterDescription(_data.chatId))]) - case .messageActionChatAddUser(let _data): - return ("messageActionChatAddUser", [("users", ConstructorParameterDescription(_data.users))]) - case .messageActionChatCreate(let _data): - return ("messageActionChatCreate", [("title", ConstructorParameterDescription(_data.title)), ("users", ConstructorParameterDescription(_data.users))]) - case .messageActionChatDeletePhoto: - return ("messageActionChatDeletePhoto", []) - case .messageActionChatDeleteUser(let _data): - return ("messageActionChatDeleteUser", [("userId", ConstructorParameterDescription(_data.userId))]) - case .messageActionChatEditPhoto(let _data): - return ("messageActionChatEditPhoto", [("photo", ConstructorParameterDescription(_data.photo))]) - case .messageActionChatEditTitle(let _data): - return ("messageActionChatEditTitle", [("title", ConstructorParameterDescription(_data.title))]) - case .messageActionChatJoinedByLink(let _data): - return ("messageActionChatJoinedByLink", [("inviterId", ConstructorParameterDescription(_data.inviterId))]) - case .messageActionChatJoinedByRequest: - return ("messageActionChatJoinedByRequest", []) - case .messageActionChatMigrateTo(let _data): - return ("messageActionChatMigrateTo", [("channelId", ConstructorParameterDescription(_data.channelId))]) - case .messageActionConferenceCall(let _data): - return ("messageActionConferenceCall", [("flags", ConstructorParameterDescription(_data.flags)), ("callId", ConstructorParameterDescription(_data.callId)), ("duration", ConstructorParameterDescription(_data.duration)), ("otherParticipants", ConstructorParameterDescription(_data.otherParticipants))]) - case .messageActionContactSignUp: - return ("messageActionContactSignUp", []) - case .messageActionCustomAction(let _data): - return ("messageActionCustomAction", [("message", ConstructorParameterDescription(_data.message))]) - case .messageActionEmpty: - return ("messageActionEmpty", []) - case .messageActionGameScore(let _data): - return ("messageActionGameScore", [("gameId", ConstructorParameterDescription(_data.gameId)), ("score", ConstructorParameterDescription(_data.score))]) - case .messageActionGeoProximityReached(let _data): - return ("messageActionGeoProximityReached", [("fromId", ConstructorParameterDescription(_data.fromId)), ("toId", ConstructorParameterDescription(_data.toId)), ("distance", ConstructorParameterDescription(_data.distance))]) - case .messageActionGiftCode(let _data): - return ("messageActionGiftCode", [("flags", ConstructorParameterDescription(_data.flags)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("days", ConstructorParameterDescription(_data.days)), ("slug", ConstructorParameterDescription(_data.slug)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("message", ConstructorParameterDescription(_data.message))]) - case .messageActionGiftPremium(let _data): - return ("messageActionGiftPremium", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("days", ConstructorParameterDescription(_data.days)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("message", ConstructorParameterDescription(_data.message))]) - case .messageActionGiftStars(let _data): - return ("messageActionGiftStars", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("stars", ConstructorParameterDescription(_data.stars)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("transactionId", ConstructorParameterDescription(_data.transactionId))]) - case .messageActionGiftTon(let _data): - return ("messageActionGiftTon", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("transactionId", ConstructorParameterDescription(_data.transactionId))]) - case .messageActionGiveawayLaunch(let _data): - return ("messageActionGiveawayLaunch", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars))]) - case .messageActionGiveawayResults(let _data): - return ("messageActionGiveawayResults", [("flags", ConstructorParameterDescription(_data.flags)), ("winnersCount", ConstructorParameterDescription(_data.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(_data.unclaimedCount))]) - case .messageActionGroupCall(let _data): - return ("messageActionGroupCall", [("flags", ConstructorParameterDescription(_data.flags)), ("call", ConstructorParameterDescription(_data.call)), ("duration", ConstructorParameterDescription(_data.duration))]) - case .messageActionGroupCallScheduled(let _data): - return ("messageActionGroupCallScheduled", [("call", ConstructorParameterDescription(_data.call)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate))]) - case .messageActionHistoryClear: - return ("messageActionHistoryClear", []) - case .messageActionInviteToGroupCall(let _data): - return ("messageActionInviteToGroupCall", [("call", ConstructorParameterDescription(_data.call)), ("users", ConstructorParameterDescription(_data.users))]) - case .messageActionManagedBotCreated(let _data): - return ("messageActionManagedBotCreated", [("botId", ConstructorParameterDescription(_data.botId))]) - case .messageActionNewCreatorPending(let _data): - return ("messageActionNewCreatorPending", [("newCreatorId", ConstructorParameterDescription(_data.newCreatorId))]) - case .messageActionNoForwardsRequest(let _data): - return ("messageActionNoForwardsRequest", [("flags", ConstructorParameterDescription(_data.flags)), ("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) - case .messageActionNoForwardsToggle(let _data): - return ("messageActionNoForwardsToggle", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) - case .messageActionPaidMessagesPrice(let _data): - return ("messageActionPaidMessagesPrice", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars))]) - case .messageActionPaidMessagesRefunded(let _data): - return ("messageActionPaidMessagesRefunded", [("count", ConstructorParameterDescription(_data.count)), ("stars", ConstructorParameterDescription(_data.stars))]) - case .messageActionPaymentRefunded(let _data): - return ("messageActionPaymentRefunded", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("payload", ConstructorParameterDescription(_data.payload)), ("charge", ConstructorParameterDescription(_data.charge))]) - case .messageActionPaymentSent(let _data): - return ("messageActionPaymentSent", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("invoiceSlug", ConstructorParameterDescription(_data.invoiceSlug)), ("subscriptionUntilDate", ConstructorParameterDescription(_data.subscriptionUntilDate))]) - case .messageActionPaymentSentMe(let _data): - return ("messageActionPaymentSentMe", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("payload", ConstructorParameterDescription(_data.payload)), ("info", ConstructorParameterDescription(_data.info)), ("shippingOptionId", ConstructorParameterDescription(_data.shippingOptionId)), ("charge", ConstructorParameterDescription(_data.charge)), ("subscriptionUntilDate", ConstructorParameterDescription(_data.subscriptionUntilDate))]) - case .messageActionPhoneCall(let _data): - return ("messageActionPhoneCall", [("flags", ConstructorParameterDescription(_data.flags)), ("callId", ConstructorParameterDescription(_data.callId)), ("reason", ConstructorParameterDescription(_data.reason)), ("duration", ConstructorParameterDescription(_data.duration))]) - case .messageActionPinMessage: - return ("messageActionPinMessage", []) - case .messageActionPollAppendAnswer(let _data): - return ("messageActionPollAppendAnswer", [("answer", ConstructorParameterDescription(_data.answer))]) - case .messageActionPollDeleteAnswer(let _data): - return ("messageActionPollDeleteAnswer", [("answer", ConstructorParameterDescription(_data.answer))]) - case .messageActionPrizeStars(let _data): - return ("messageActionPrizeStars", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("transactionId", ConstructorParameterDescription(_data.transactionId)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("giveawayMsgId", ConstructorParameterDescription(_data.giveawayMsgId))]) - case .messageActionRequestedPeer(let _data): - return ("messageActionRequestedPeer", [("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peers", ConstructorParameterDescription(_data.peers))]) - case .messageActionRequestedPeerSentMe(let _data): - return ("messageActionRequestedPeerSentMe", [("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peers", ConstructorParameterDescription(_data.peers))]) - case .messageActionScreenshotTaken: - return ("messageActionScreenshotTaken", []) - case .messageActionSecureValuesSent(let _data): - return ("messageActionSecureValuesSent", [("types", ConstructorParameterDescription(_data.types))]) - case .messageActionSecureValuesSentMe(let _data): - return ("messageActionSecureValuesSentMe", [("values", ConstructorParameterDescription(_data.values)), ("credentials", ConstructorParameterDescription(_data.credentials))]) - case .messageActionSetChatTheme(let _data): - return ("messageActionSetChatTheme", [("theme", ConstructorParameterDescription(_data.theme))]) - case .messageActionSetChatWallPaper(let _data): - return ("messageActionSetChatWallPaper", [("flags", ConstructorParameterDescription(_data.flags)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) - case .messageActionSetMessagesTTL(let _data): - return ("messageActionSetMessagesTTL", [("flags", ConstructorParameterDescription(_data.flags)), ("period", ConstructorParameterDescription(_data.period)), ("autoSettingFrom", ConstructorParameterDescription(_data.autoSettingFrom))]) - case .messageActionStarGift(let _data): - return ("messageActionStarGift", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("message", ConstructorParameterDescription(_data.message)), ("convertStars", ConstructorParameterDescription(_data.convertStars)), ("upgradeMsgId", ConstructorParameterDescription(_data.upgradeMsgId)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("peer", ConstructorParameterDescription(_data.peer)), ("savedId", ConstructorParameterDescription(_data.savedId)), ("prepaidUpgradeHash", ConstructorParameterDescription(_data.prepaidUpgradeHash)), ("giftMsgId", ConstructorParameterDescription(_data.giftMsgId)), ("toId", ConstructorParameterDescription(_data.toId)), ("giftNum", ConstructorParameterDescription(_data.giftNum))]) - case .messageActionStarGiftPurchaseOffer(let _data): - return ("messageActionStarGiftPurchaseOffer", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("price", ConstructorParameterDescription(_data.price)), ("expiresAt", ConstructorParameterDescription(_data.expiresAt))]) - case .messageActionStarGiftPurchaseOfferDeclined(let _data): - return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("price", ConstructorParameterDescription(_data.price))]) - case .messageActionStarGiftUnique(let _data): - return ("messageActionStarGiftUnique", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("canExportAt", ConstructorParameterDescription(_data.canExportAt)), ("transferStars", ConstructorParameterDescription(_data.transferStars)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("peer", ConstructorParameterDescription(_data.peer)), ("savedId", ConstructorParameterDescription(_data.savedId)), ("resaleAmount", ConstructorParameterDescription(_data.resaleAmount)), ("canTransferAt", ConstructorParameterDescription(_data.canTransferAt)), ("canResellAt", ConstructorParameterDescription(_data.canResellAt)), ("dropOriginalDetailsStars", ConstructorParameterDescription(_data.dropOriginalDetailsStars)), ("canCraftAt", ConstructorParameterDescription(_data.canCraftAt))]) - case .messageActionSuggestBirthday(let _data): - return ("messageActionSuggestBirthday", [("birthday", ConstructorParameterDescription(_data.birthday))]) - case .messageActionSuggestProfilePhoto(let _data): - return ("messageActionSuggestProfilePhoto", [("photo", ConstructorParameterDescription(_data.photo))]) - case .messageActionSuggestedPostApproval(let _data): - return ("messageActionSuggestedPostApproval", [("flags", ConstructorParameterDescription(_data.flags)), ("rejectComment", ConstructorParameterDescription(_data.rejectComment)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate)), ("price", ConstructorParameterDescription(_data.price))]) - case .messageActionSuggestedPostRefund(let _data): - return ("messageActionSuggestedPostRefund", [("flags", ConstructorParameterDescription(_data.flags))]) - case .messageActionSuggestedPostSuccess(let _data): - return ("messageActionSuggestedPostSuccess", [("price", ConstructorParameterDescription(_data.price))]) - case .messageActionTodoAppendTasks(let _data): - return ("messageActionTodoAppendTasks", [("list", ConstructorParameterDescription(_data.list))]) - case .messageActionTodoCompletions(let _data): - return ("messageActionTodoCompletions", [("completed", ConstructorParameterDescription(_data.completed)), ("incompleted", ConstructorParameterDescription(_data.incompleted))]) - case .messageActionTopicCreate(let _data): - return ("messageActionTopicCreate", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("iconColor", ConstructorParameterDescription(_data.iconColor)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId))]) - case .messageActionTopicEdit(let _data): - return ("messageActionTopicEdit", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId)), ("closed", ConstructorParameterDescription(_data.closed)), ("hidden", ConstructorParameterDescription(_data.hidden))]) - case .messageActionWebViewDataSent(let _data): - return ("messageActionWebViewDataSent", [("text", ConstructorParameterDescription(_data.text))]) - case .messageActionWebViewDataSentMe(let _data): - return ("messageActionWebViewDataSentMe", [("text", ConstructorParameterDescription(_data.text)), ("data", ConstructorParameterDescription(_data.data))]) - } - } - - public static func parse_messageActionBoostApply(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionBoostApply(Cons_messageActionBoostApply(boosts: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionBotAllowed(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - var _3: Api.BotApp? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionBotAllowed(Cons_messageActionBotAllowed(flags: _1!, domain: _2, app: _3)) - } - else { - return nil - } - } - public static func parse_messageActionChangeCreator(_ reader: BufferReader) -> MessageAction? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChangeCreator(Cons_messageActionChangeCreator(newCreatorId: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionChannelCreate(_ reader: BufferReader) -> MessageAction? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChannelCreate(Cons_messageActionChannelCreate(title: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionChannelMigrateFrom(_ reader: BufferReader) -> MessageAction? { - var _1: String? - _1 = parseString(reader) - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionChannelMigrateFrom(Cons_messageActionChannelMigrateFrom(title: _1!, chatId: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionChatAddUser(_ reader: BufferReader) -> MessageAction? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChatAddUser(Cons_messageActionChatAddUser(users: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionChatCreate(_ reader: BufferReader) -> MessageAction? { - var _1: String? - _1 = parseString(reader) - var _2: [Int64]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionChatCreate(Cons_messageActionChatCreate(title: _1!, users: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionChatDeletePhoto(_ reader: BufferReader) -> MessageAction? { - return Api.MessageAction.messageActionChatDeletePhoto - } - public static func parse_messageActionChatDeleteUser(_ reader: BufferReader) -> MessageAction? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChatDeleteUser(Cons_messageActionChatDeleteUser(userId: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionChatEditPhoto(_ reader: BufferReader) -> MessageAction? { - var _1: Api.Photo? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Photo - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChatEditPhoto(Cons_messageActionChatEditPhoto(photo: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionChatEditTitle(_ reader: BufferReader) -> MessageAction? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChatEditTitle(Cons_messageActionChatEditTitle(title: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionChatJoinedByLink(_ reader: BufferReader) -> MessageAction? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChatJoinedByLink(Cons_messageActionChatJoinedByLink(inviterId: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionChatJoinedByRequest(_ reader: BufferReader) -> MessageAction? { - return Api.MessageAction.messageActionChatJoinedByRequest - } - public static func parse_messageActionChatMigrateTo(_ reader: BufferReader) -> MessageAction? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionChatMigrateTo(Cons_messageActionChatMigrateTo(channelId: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionConferenceCall(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = reader.readInt32() - } - var _4: [Api.Peer]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionConferenceCall(Cons_messageActionConferenceCall(flags: _1!, callId: _2!, duration: _3, otherParticipants: _4)) - } - else { - return nil - } - } - public static func parse_messageActionContactSignUp(_ reader: BufferReader) -> MessageAction? { - return Api.MessageAction.messageActionContactSignUp - } - public static func parse_messageActionCustomAction(_ reader: BufferReader) -> MessageAction? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionCustomAction(Cons_messageActionCustomAction(message: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionEmpty(_ reader: BufferReader) -> MessageAction? { - return Api.MessageAction.messageActionEmpty - } - public static func parse_messageActionGameScore(_ reader: BufferReader) -> MessageAction? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionGameScore(Cons_messageActionGameScore(gameId: _1!, score: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionGeoProximityReached(_ reader: BufferReader) -> MessageAction? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Api.Peer? - 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 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionGeoProximityReached(Cons_messageActionGeoProximityReached(fromId: _1!, toId: _2!, distance: _3!)) - } - else { - return nil - } - } - public static func parse_messageActionGiftCode(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) != 0 { - _5 = parseString(reader) - } - var _6: Int64? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _6 = reader.readInt64() - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _7 = parseString(reader) - } - var _8: Int64? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _8 = reader.readInt64() - } - var _9: Api.TextWithEntities? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 - } - } - public static func parse_messageActionGiftPremium(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = parseString(reader) - } - var _6: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = reader.readInt64() - } - var _7: Api.TextWithEntities? - if Int(_1 ?? 0) & 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 - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.MessageAction.messageActionGiftPremium(Cons_messageActionGiftPremium(flags: _1!, currency: _2!, amount: _3!, days: _4!, cryptoCurrency: _5, cryptoAmount: _6, message: _7)) - } - else { - return nil - } - } - public static func parse_messageActionGiftStars(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: Int64? - _4 = reader.readInt64() - var _5: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = parseString(reader) - } - var _6: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = reader.readInt64() - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _7 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.MessageAction.messageActionGiftStars(Cons_messageActionGiftStars(flags: _1!, currency: _2!, amount: _3!, stars: _4!, cryptoCurrency: _5, cryptoAmount: _6, transactionId: _7)) - } - else { - return nil - } - } - public static func parse_messageActionGiftTon(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: Int64? - _5 = reader.readInt64() - var _6: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageAction.messageActionGiftTon(Cons_messageActionGiftTon(flags: _1!, currency: _2!, amount: _3!, cryptoCurrency: _4!, cryptoAmount: _5!, transactionId: _6)) - } - else { - return nil - } - } - public static func parse_messageActionGiveawayLaunch(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt64() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionGiveawayLaunch(Cons_messageActionGiveawayLaunch(flags: _1!, stars: _2)) - } - else { - return nil - } - } - public static func parse_messageActionGiveawayResults(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionGiveawayResults(Cons_messageActionGiveawayResults(flags: _1!, winnersCount: _2!, unclaimedCount: _3!)) - } - else { - return nil - } - } - public static func parse_messageActionGroupCall(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.InputGroupCall? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionGroupCall(Cons_messageActionGroupCall(flags: _1!, call: _2!, duration: _3)) - } - else { - return nil - } - } - public static func parse_messageActionGroupCallScheduled(_ reader: BufferReader) -> MessageAction? { - var _1: Api.InputGroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionGroupCallScheduled(Cons_messageActionGroupCallScheduled(call: _1!, scheduleDate: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionHistoryClear(_ reader: BufferReader) -> MessageAction? { - return Api.MessageAction.messageActionHistoryClear - } - public static func parse_messageActionInviteToGroupCall(_ reader: BufferReader) -> MessageAction? { - var _1: Api.InputGroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _2: [Int64]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionInviteToGroupCall(Cons_messageActionInviteToGroupCall(call: _1!, users: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionManagedBotCreated(_ reader: BufferReader) -> MessageAction? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionManagedBotCreated(Cons_messageActionManagedBotCreated(botId: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionNewCreatorPending(_ reader: BufferReader) -> MessageAction? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionNewCreatorPending(Cons_messageActionNewCreatorPending(newCreatorId: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionNoForwardsRequest(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Bool? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } - var _3: Api.Bool? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionNoForwardsRequest(Cons_messageActionNoForwardsRequest(flags: _1!, prevValue: _2!, newValue: _3!)) - } - else { - return nil - } - } - public static func parse_messageActionNoForwardsToggle(_ reader: BufferReader) -> MessageAction? { - var _1: Api.Bool? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Bool - } - var _2: Api.Bool? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionNoForwardsToggle(Cons_messageActionNoForwardsToggle(prevValue: _1!, newValue: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionPaidMessagesPrice(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionPaidMessagesPrice(Cons_messageActionPaidMessagesPrice(flags: _1!, stars: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionPaidMessagesRefunded(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionPaidMessagesRefunded(Cons_messageActionPaidMessagesRefunded(count: _1!, stars: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionPaymentRefunded(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: String? - _3 = parseString(reader) - var _4: Int64? - _4 = reader.readInt64() - var _5: Buffer? - if Int(_1 ?? 0) & 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 - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageAction.messageActionPaymentRefunded(Cons_messageActionPaymentRefunded(flags: _1!, peer: _2!, currency: _3!, totalAmount: _4!, payload: _5, charge: _6!)) - } - else { - return nil - } - } - public static func parse_messageActionPaymentSent(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageAction.messageActionPaymentSent(Cons_messageActionPaymentSent(flags: _1!, currency: _2!, totalAmount: _3!, invoiceSlug: _4, subscriptionUntilDate: _5)) - } - else { - return nil - } - } - public static func parse_messageActionPaymentSentMe(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: Buffer? - _4 = parseBytes(reader) - var _5: Api.PaymentRequestedInfo? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } - } - var _6: String? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 4) != 0 { - _8 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_messageActionPhoneCall(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.PhoneCallDiscardReason? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason - } - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionPhoneCall(Cons_messageActionPhoneCall(flags: _1!, callId: _2!, reason: _3, duration: _4)) - } - else { - return nil - } - } - public static func parse_messageActionPinMessage(_ reader: BufferReader) -> MessageAction? { - return Api.MessageAction.messageActionPinMessage - } - public static func parse_messageActionPollAppendAnswer(_ reader: BufferReader) -> MessageAction? { - var _1: Api.PollAnswer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PollAnswer - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionPollAppendAnswer(Cons_messageActionPollAppendAnswer(answer: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionPollDeleteAnswer(_ reader: BufferReader) -> MessageAction? { - var _1: Api.PollAnswer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PollAnswer - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionPollDeleteAnswer(Cons_messageActionPollDeleteAnswer(answer: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionPrizeStars(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: Api.Peer? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageAction.messageActionPrizeStars(Cons_messageActionPrizeStars(flags: _1!, stars: _2!, transactionId: _3!, boostPeer: _4!, giveawayMsgId: _5!)) - } - else { - return nil - } - } - public static func parse_messageActionRequestedPeer(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Peer]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionRequestedPeer(Cons_messageActionRequestedPeer(buttonId: _1!, peers: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionRequestedPeerSentMe(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.RequestedPeer]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RequestedPeer.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionRequestedPeerSentMe(Cons_messageActionRequestedPeerSentMe(buttonId: _1!, peers: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionScreenshotTaken(_ reader: BufferReader) -> MessageAction? { - return Api.MessageAction.messageActionScreenshotTaken - } - public static func parse_messageActionSecureValuesSent(_ reader: BufferReader) -> MessageAction? { - var _1: [Api.SecureValueType]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValueType.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionSecureValuesSent(Cons_messageActionSecureValuesSent(types: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionSecureValuesSentMe(_ reader: BufferReader) -> MessageAction? { - var _1: [Api.SecureValue]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) - } - var _2: Api.SecureCredentialsEncrypted? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.SecureCredentialsEncrypted - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionSecureValuesSentMe(Cons_messageActionSecureValuesSentMe(values: _1!, credentials: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionSetChatTheme(_ reader: BufferReader) -> MessageAction? { - var _1: Api.ChatTheme? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.ChatTheme - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionSetChatTheme(Cons_messageActionSetChatTheme(theme: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionSetChatWallPaper(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.WallPaper? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.WallPaper - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionSetChatWallPaper(Cons_messageActionSetChatWallPaper(flags: _1!, wallpaper: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionSetMessagesTTL(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt64() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionSetMessagesTTL(Cons_messageActionSetMessagesTTL(flags: _1!, period: _2!, autoSettingFrom: _3)) - } - else { - return nil - } - } - public static func parse_messageActionStarGift(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.StarGift? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _3: Api.TextWithEntities? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - } - var _4: Int64? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _4 = reader.readInt64() - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _5 = reader.readInt32() - } - var _6: Int64? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _6 = reader.readInt64() - } - var _7: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 12) != 0 { - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _9: Int64? - if Int(_1 ?? 0) & Int(1 << 12) != 0 { - _9 = reader.readInt64() - } - var _10: String? - if Int(_1 ?? 0) & Int(1 << 14) != 0 { - _10 = parseString(reader) - } - var _11: Int32? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - _11 = reader.readInt32() - } - var _12: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 18) != 0 { - if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _13: Int32? - if Int(_1 ?? 0) & Int(1 << 19) != 0 { - _13 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _13 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - 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 - } - } - public static func parse_messageActionStarGiftPurchaseOffer(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.StarGift? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _3: Api.StarsAmount? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionStarGiftPurchaseOffer(Cons_messageActionStarGiftPurchaseOffer(flags: _1!, gift: _2!, price: _3!, expiresAt: _4!)) - } - else { - return nil - } - } - public static func parse_messageActionStarGiftPurchaseOfferDeclined(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.StarGift? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _3: Api.StarsAmount? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageAction.messageActionStarGiftPurchaseOfferDeclined(Cons_messageActionStarGiftPurchaseOfferDeclined(flags: _1!, gift: _2!, price: _3!)) - } - else { - return nil - } - } - public static func parse_messageActionStarGiftUnique(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.StarGift? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _3 = reader.readInt32() - } - var _4: Int64? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _4 = reader.readInt64() - } - var _5: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _7: Int64? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - _7 = reader.readInt64() - } - var _8: Api.StarsAmount? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - } - var _9: Int32? - if Int(_1 ?? 0) & Int(1 << 9) != 0 { - _9 = reader.readInt32() - } - var _10: Int32? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - _10 = reader.readInt32() - } - var _11: Int64? - if Int(_1 ?? 0) & Int(1 << 12) != 0 { - _11 = reader.readInt64() - } - var _12: Int32? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - _12 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _12 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - 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 - } - } - public static func parse_messageActionSuggestBirthday(_ reader: BufferReader) -> MessageAction? { - var _1: Api.Birthday? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Birthday - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionSuggestBirthday(Cons_messageActionSuggestBirthday(birthday: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionSuggestProfilePhoto(_ reader: BufferReader) -> MessageAction? { - var _1: Api.Photo? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Photo - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionSuggestProfilePhoto(Cons_messageActionSuggestProfilePhoto(photo: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionSuggestedPostApproval(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _2 = parseString(reader) - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _3 = reader.readInt32() - } - var _4: Api.StarsAmount? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionSuggestedPostApproval(Cons_messageActionSuggestedPostApproval(flags: _1!, rejectComment: _2, scheduleDate: _3, price: _4)) - } - else { - return nil - } - } - public static func parse_messageActionSuggestedPostRefund(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionSuggestedPostRefund(Cons_messageActionSuggestedPostRefund(flags: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionSuggestedPostSuccess(_ reader: BufferReader) -> MessageAction? { - var _1: Api.StarsAmount? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionSuggestedPostSuccess(Cons_messageActionSuggestedPostSuccess(price: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionTodoAppendTasks(_ reader: BufferReader) -> MessageAction? { - var _1: [Api.TodoItem]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoItem.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionTodoAppendTasks(Cons_messageActionTodoAppendTasks(list: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionTodoCompletions(_ reader: BufferReader) -> MessageAction? { - var _1: [Int32]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageAction.messageActionTodoCompletions(Cons_messageActionTodoCompletions(completed: _1!, incompleted: _2!)) - } - else { - return nil - } - } - public static func parse_messageActionTopicCreate(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = reader.readInt64() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageAction.messageActionTopicCreate(Cons_messageActionTopicCreate(flags: _1!, title: _2!, iconColor: _3!, iconEmojiId: _4)) - } - else { - return nil - } - } - public static func parse_messageActionTopicEdit(_ reader: BufferReader) -> MessageAction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - var _3: Int64? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt64() - } - var _4: Api.Bool? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageAction.messageActionTopicEdit(Cons_messageActionTopicEdit(flags: _1!, title: _2, iconEmojiId: _3, closed: _4, hidden: _5)) - } - else { - return nil - } - } - public static func parse_messageActionWebViewDataSent(_ reader: BufferReader) -> MessageAction? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.MessageAction.messageActionWebViewDataSent(Cons_messageActionWebViewDataSent(text: _1!)) - } - else { - return nil - } - } - public static func parse_messageActionWebViewDataSentMe(_ reader: BufferReader) -> MessageAction? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - 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 bf75b3d074..f1b7b7f6e2 100644 --- a/submodules/TelegramApi/Sources/Api16.swift +++ b/submodules/TelegramApi/Sources/Api16.swift @@ -1,942 +1,80 @@ public extension Api { - indirect enum MessageEntity: TypeConstructorDescription { - public class Cons_inputMessageEntityMentionName: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputMessageEntityMentionName", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("userId", ConstructorParameterDescription(self.userId))]) - } - } - public class Cons_messageEntityBankCard: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityBankCard", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityBlockquote: TypeConstructorDescription { + enum MediaAreaCoordinates: TypeConstructorDescription { + public class Cons_mediaAreaCoordinates: TypeConstructorDescription { public var flags: Int32 - public var offset: Int32 - public var length: Int32 - public init(flags: Int32, offset: Int32, length: 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.offset = offset - self.length = length + self.x = x + self.y = y + self.w = w + self.h = h + self.rotation = rotation + self.radius = radius } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityBlockquote", [("flags", ConstructorParameterDescription(self.flags)), ("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + return ("mediaAreaCoordinates", [("flags", ConstructorParameterDescription(self.flags)), ("x", ConstructorParameterDescription(self.x)), ("y", ConstructorParameterDescription(self.y)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("rotation", ConstructorParameterDescription(self.rotation)), ("radius", ConstructorParameterDescription(self.radius))]) } } - public class Cons_messageEntityBold: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityBold", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityBotCommand: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityBotCommand", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityCashtag: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityCashtag", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityCode: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityCode", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityCustomEmoji: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityCustomEmoji", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("documentId", ConstructorParameterDescription(self.documentId))]) - } - } - public class Cons_messageEntityDiffDelete: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityDiffDelete", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityDiffInsert: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityDiffInsert", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityDiffReplace: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public var oldText: String - public init(offset: Int32, length: Int32, oldText: String) { - self.offset = offset - self.length = length - self.oldText = oldText - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityDiffReplace", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("oldText", ConstructorParameterDescription(self.oldText))]) - } - } - public class Cons_messageEntityEmail: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityEmail", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityFormattedDate: TypeConstructorDescription { - public var flags: Int32 - public var offset: Int32 - public var length: Int32 - public var date: Int32 - public init(flags: Int32, offset: Int32, length: Int32, date: Int32) { - self.flags = flags - self.offset = offset - self.length = length - self.date = date - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityFormattedDate", [("flags", ConstructorParameterDescription(self.flags)), ("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("date", ConstructorParameterDescription(self.date))]) - } - } - public class Cons_messageEntityHashtag: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityHashtag", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityItalic: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityItalic", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityMention: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityMention", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityMentionName: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityMentionName", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("userId", ConstructorParameterDescription(self.userId))]) - } - } - public class Cons_messageEntityPhone: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityPhone", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityPre: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityPre", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("language", ConstructorParameterDescription(self.language))]) - } - } - public class Cons_messageEntitySpoiler: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntitySpoiler", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityStrike: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityStrike", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityTextUrl: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityTextUrl", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("url", ConstructorParameterDescription(self.url))]) - } - } - public class Cons_messageEntityUnderline: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityUnderline", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityUnknown: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityUnknown", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_messageEntityUrl: TypeConstructorDescription { - public var offset: Int32 - public var length: Int32 - public init(offset: Int32, length: Int32) { - self.offset = offset - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEntityUrl", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.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 messageEntityDiffDelete(Cons_messageEntityDiffDelete) - case messageEntityDiffInsert(Cons_messageEntityDiffInsert) - case messageEntityDiffReplace(Cons_messageEntityDiffReplace) - case messageEntityEmail(Cons_messageEntityEmail) - case messageEntityFormattedDate(Cons_messageEntityFormattedDate) - 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) + case mediaAreaCoordinates(Cons_mediaAreaCoordinates) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .inputMessageEntityMentionName(let _data): + case .mediaAreaCoordinates(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) + buffer.appendInt32(-808853502) } 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) + 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) } - 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 .messageEntityDiffDelete(let _data): - if boxed { - buffer.appendInt32(106086853) - } - serializeInt32(_data.offset, buffer: buffer, boxed: false) - serializeInt32(_data.length, buffer: buffer, boxed: false) - break - case .messageEntityDiffInsert(let _data): - if boxed { - buffer.appendInt32(1903653142) - } - serializeInt32(_data.offset, buffer: buffer, boxed: false) - serializeInt32(_data.length, buffer: buffer, boxed: false) - break - case .messageEntityDiffReplace(let _data): - if boxed { - buffer.appendInt32(-960371289) - } - serializeInt32(_data.offset, buffer: buffer, boxed: false) - serializeInt32(_data.length, buffer: buffer, boxed: false) - serializeString(_data.oldText, 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 .messageEntityFormattedDate(let _data): - if boxed { - buffer.appendInt32(-1874147385) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt32(_data.offset, buffer: buffer, boxed: false) - serializeInt32(_data.length, buffer: buffer, boxed: false) - serializeInt32(_data.date, 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, ConstructorParameterDescription)]) { switch self { - case .inputMessageEntityMentionName(let _data): - return ("inputMessageEntityMentionName", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("userId", ConstructorParameterDescription(_data.userId))]) - case .messageEntityBankCard(let _data): - return ("messageEntityBankCard", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityBlockquote(let _data): - return ("messageEntityBlockquote", [("flags", ConstructorParameterDescription(_data.flags)), ("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityBold(let _data): - return ("messageEntityBold", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityBotCommand(let _data): - return ("messageEntityBotCommand", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityCashtag(let _data): - return ("messageEntityCashtag", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityCode(let _data): - return ("messageEntityCode", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityCustomEmoji(let _data): - return ("messageEntityCustomEmoji", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("documentId", ConstructorParameterDescription(_data.documentId))]) - case .messageEntityDiffDelete(let _data): - return ("messageEntityDiffDelete", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityDiffInsert(let _data): - return ("messageEntityDiffInsert", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityDiffReplace(let _data): - return ("messageEntityDiffReplace", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("oldText", ConstructorParameterDescription(_data.oldText))]) - case .messageEntityEmail(let _data): - return ("messageEntityEmail", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityFormattedDate(let _data): - return ("messageEntityFormattedDate", [("flags", ConstructorParameterDescription(_data.flags)), ("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("date", ConstructorParameterDescription(_data.date))]) - case .messageEntityHashtag(let _data): - return ("messageEntityHashtag", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityItalic(let _data): - return ("messageEntityItalic", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityMention(let _data): - return ("messageEntityMention", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityMentionName(let _data): - return ("messageEntityMentionName", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("userId", ConstructorParameterDescription(_data.userId))]) - case .messageEntityPhone(let _data): - return ("messageEntityPhone", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityPre(let _data): - return ("messageEntityPre", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("language", ConstructorParameterDescription(_data.language))]) - case .messageEntitySpoiler(let _data): - return ("messageEntitySpoiler", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityStrike(let _data): - return ("messageEntityStrike", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityTextUrl(let _data): - return ("messageEntityTextUrl", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("url", ConstructorParameterDescription(_data.url))]) - case .messageEntityUnderline(let _data): - return ("messageEntityUnderline", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityUnknown(let _data): - return ("messageEntityUnknown", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) - case .messageEntityUrl(let _data): - return ("messageEntityUrl", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .mediaAreaCoordinates(let _data): + return ("mediaAreaCoordinates", [("flags", ConstructorParameterDescription(_data.flags)), ("x", ConstructorParameterDescription(_data.x)), ("y", ConstructorParameterDescription(_data.y)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("rotation", ConstructorParameterDescription(_data.rotation)), ("radius", ConstructorParameterDescription(_data.radius))]) } } - public static func parse_inputMessageEntityMentionName(_ reader: BufferReader) -> MessageEntity? { + public static func parse_mediaAreaCoordinates(_ reader: BufferReader) -> MediaAreaCoordinates? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.InputUser? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputUser + var _2: Double? + _2 = reader.readDouble() + var _3: Double? + _3 = reader.readDouble() + var _4: Double? + _4 = reader.readDouble() + var _5: Double? + _5 = reader.readDouble() + var _6: Double? + _6 = reader.readDouble() + var _7: Double? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _7 = reader.readDouble() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageEntity.inputMessageEntityMentionName(Cons_inputMessageEntityMentionName(offset: _1!, length: _2!, userId: _3!)) - } - else { - return nil - } - } - public static func parse_messageEntityBankCard(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityBankCard(Cons_messageEntityBankCard(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityBlockquote(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityBlockquote(Cons_messageEntityBlockquote(flags: _1!, offset: _2!, length: _3!)) - } - else { - return nil - } - } - public static func parse_messageEntityBold(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityBold(Cons_messageEntityBold(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityBotCommand(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityBotCommand(Cons_messageEntityBotCommand(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityCashtag(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityCashtag(Cons_messageEntityCashtag(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityCode(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityCode(Cons_messageEntityCode(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityCustomEmoji(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityCustomEmoji(Cons_messageEntityCustomEmoji(offset: _1!, length: _2!, documentId: _3!)) - } - else { - return nil - } - } - public static func parse_messageEntityDiffDelete(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityDiffDelete(Cons_messageEntityDiffDelete(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityDiffInsert(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityDiffInsert(Cons_messageEntityDiffInsert(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityDiffReplace(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityDiffReplace(Cons_messageEntityDiffReplace(offset: _1!, length: _2!, oldText: _3!)) - } - else { - return nil - } - } - public static func parse_messageEntityEmail(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityEmail(Cons_messageEntityEmail(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityFormattedDate(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageEntity.messageEntityFormattedDate(Cons_messageEntityFormattedDate(flags: _1!, offset: _2!, length: _3!, date: _4!)) - } - else { - return nil - } - } - public static func parse_messageEntityHashtag(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityHashtag(Cons_messageEntityHashtag(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityItalic(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityItalic(Cons_messageEntityItalic(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityMention(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityMention(Cons_messageEntityMention(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityMentionName(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityMentionName(Cons_messageEntityMentionName(offset: _1!, length: _2!, userId: _3!)) - } - else { - return nil - } - } - public static func parse_messageEntityPhone(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityPhone(Cons_messageEntityPhone(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityPre(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityPre(Cons_messageEntityPre(offset: _1!, length: _2!, language: _3!)) - } - else { - return nil - } - } - public static func parse_messageEntitySpoiler(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntitySpoiler(Cons_messageEntitySpoiler(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityStrike(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityStrike(Cons_messageEntityStrike(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityTextUrl(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageEntity.messageEntityTextUrl(Cons_messageEntityTextUrl(offset: _1!, length: _2!, url: _3!)) - } - else { - return nil - } - } - public static func parse_messageEntityUnderline(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityUnderline(Cons_messageEntityUnderline(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityUnknown(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityUnknown(Cons_messageEntityUnknown(offset: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_messageEntityUrl(_ reader: BufferReader) -> MessageEntity? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageEntity.messageEntityUrl(Cons_messageEntityUrl(offset: _1!, length: _2!)) + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.MediaAreaCoordinates.mediaAreaCoordinates(Cons_mediaAreaCoordinates(flags: _1!, x: _2!, y: _3!, w: _4!, h: _5!, rotation: _6!, radius: _7)) } else { return nil @@ -945,194 +83,274 @@ public extension Api { } } public extension Api { - indirect enum MessageExtendedMedia: TypeConstructorDescription { - public class Cons_messageExtendedMedia: TypeConstructorDescription { - public var media: Api.MessageMedia - public init(media: Api.MessageMedia) { - self.media = media - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageExtendedMedia", [("media", ConstructorParameterDescription(self.media))]) - } - } - public class Cons_messageExtendedMediaPreview: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageExtendedMediaPreview", [("flags", ConstructorParameterDescription(self.flags)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("thumb", ConstructorParameterDescription(self.thumb)), ("videoDuration", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messageExtendedMedia(let _data): - return ("messageExtendedMedia", [("media", ConstructorParameterDescription(_data.media))]) - case .messageExtendedMediaPreview(let _data): - return ("messageExtendedMediaPreview", [("flags", ConstructorParameterDescription(_data.flags)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("thumb", ConstructorParameterDescription(_data.thumb)), ("videoDuration", ConstructorParameterDescription(_data.videoDuration))]) - } - } - - public static func parse_messageExtendedMedia(_ reader: BufferReader) -> MessageExtendedMedia? { - var _1: Api.MessageMedia? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageExtendedMedia.messageExtendedMedia(Cons_messageExtendedMedia(media: _1!)) - } - else { - return nil - } - } - public static func parse_messageExtendedMediaPreview(_ reader: BufferReader) -> MessageExtendedMedia? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Api.PhotoSize? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.PhotoSize - } - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _5 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_messageFwdHeader: TypeConstructorDescription { + indirect enum Message: TypeConstructorDescription { + public class Cons_message: TypeConstructorDescription { public var flags: Int32 + public var flags2: Int32 + public var id: Int32 public var fromId: Api.Peer? - public var fromName: String? + public var fromBoostsApplied: Int32? + public var fromRank: String? + 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 guestchatViaFrom: Api.Peer? + public var replyTo: Api.MessageReplyHeader? public var date: Int32 - public var channelPost: 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 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?) { + 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 var richMessage: Api.RichMessage? + public init(flags: Int32, flags2: Int32, id: Int32, fromId: Api.Peer?, fromBoostsApplied: Int32?, fromRank: String?, peerId: Api.Peer, savedPeerId: Api.Peer?, fwdFrom: Api.MessageFwdHeader?, viaBotId: Int64?, viaBusinessBotId: Int64?, guestchatViaFrom: Api.Peer?, 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?, richMessage: Api.RichMessage?) { self.flags = flags + self.flags2 = flags2 + self.id = id self.fromId = fromId - self.fromName = fromName + self.fromBoostsApplied = fromBoostsApplied + self.fromRank = fromRank + self.peerId = peerId + self.savedPeerId = savedPeerId + self.fwdFrom = fwdFrom + self.viaBotId = viaBotId + self.viaBusinessBotId = viaBusinessBotId + self.guestchatViaFrom = guestchatViaFrom + self.replyTo = replyTo self.date = date - self.channelPost = channelPost + 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.savedFromPeer = savedFromPeer - self.savedFromMsgId = savedFromMsgId - self.savedFromId = savedFromId - self.savedFromName = savedFromName - self.savedDate = savedDate - self.psaType = psaType + 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 + self.richMessage = richMessage } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageFwdHeader", [("flags", ConstructorParameterDescription(self.flags)), ("fromId", ConstructorParameterDescription(self.fromId)), ("fromName", ConstructorParameterDescription(self.fromName)), ("date", ConstructorParameterDescription(self.date)), ("channelPost", ConstructorParameterDescription(self.channelPost)), ("postAuthor", ConstructorParameterDescription(self.postAuthor)), ("savedFromPeer", ConstructorParameterDescription(self.savedFromPeer)), ("savedFromMsgId", ConstructorParameterDescription(self.savedFromMsgId)), ("savedFromId", ConstructorParameterDescription(self.savedFromId)), ("savedFromName", ConstructorParameterDescription(self.savedFromName)), ("savedDate", ConstructorParameterDescription(self.savedDate)), ("psaType", ConstructorParameterDescription(self.psaType))]) + return ("message", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("fromId", ConstructorParameterDescription(self.fromId)), ("fromBoostsApplied", ConstructorParameterDescription(self.fromBoostsApplied)), ("fromRank", ConstructorParameterDescription(self.fromRank)), ("peerId", ConstructorParameterDescription(self.peerId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("viaBotId", ConstructorParameterDescription(self.viaBotId)), ("viaBusinessBotId", ConstructorParameterDescription(self.viaBusinessBotId)), ("guestchatViaFrom", ConstructorParameterDescription(self.guestchatViaFrom)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("date", ConstructorParameterDescription(self.date)), ("message", ConstructorParameterDescription(self.message)), ("media", ConstructorParameterDescription(self.media)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup)), ("entities", ConstructorParameterDescription(self.entities)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("replies", ConstructorParameterDescription(self.replies)), ("editDate", ConstructorParameterDescription(self.editDate)), ("postAuthor", ConstructorParameterDescription(self.postAuthor)), ("groupedId", ConstructorParameterDescription(self.groupedId)), ("reactions", ConstructorParameterDescription(self.reactions)), ("restrictionReason", ConstructorParameterDescription(self.restrictionReason)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod)), ("quickReplyShortcutId", ConstructorParameterDescription(self.quickReplyShortcutId)), ("effect", ConstructorParameterDescription(self.effect)), ("factcheck", ConstructorParameterDescription(self.factcheck)), ("reportDeliveryUntilDate", ConstructorParameterDescription(self.reportDeliveryUntilDate)), ("paidMessageStars", ConstructorParameterDescription(self.paidMessageStars)), ("suggestedPost", ConstructorParameterDescription(self.suggestedPost)), ("scheduleRepeatPeriod", ConstructorParameterDescription(self.scheduleRepeatPeriod)), ("summaryFromLanguage", ConstructorParameterDescription(self.summaryFromLanguage)), ("richMessage", ConstructorParameterDescription(self.richMessage))]) } } - case messageFwdHeader(Cons_messageFwdHeader) + public class Cons_messageEmpty: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEmpty", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("peerId", ConstructorParameterDescription(self.peerId))]) + } + } + public class Cons_messageService: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageService", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("fromId", ConstructorParameterDescription(self.fromId)), ("peerId", ConstructorParameterDescription(self.peerId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("date", ConstructorParameterDescription(self.date)), ("action", ConstructorParameterDescription(self.action)), ("reactions", ConstructorParameterDescription(self.reactions)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) + } + } + case message(Cons_message) + case messageEmpty(Cons_messageEmpty) + case messageService(Cons_messageService) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .messageFwdHeader(let _data): + case .message(let _data): if boxed { - buffer.appendInt32(1313731771) + buffer.appendInt32(1979759059) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { + 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 << 5) != 0 { - serializeString(_data.fromName!, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 29) != 0 { + serializeInt32(_data.fromBoostsApplied!, buffer: buffer, boxed: false) + } + if Int(_data.flags2) & Int(1 << 12) != 0 { + serializeString(_data.fromRank!, buffer: buffer, boxed: false) + } + _data.peerId.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 28) != 0 { + _data.savedPeerId!.serialize(buffer, true) } - serializeInt32(_data.date, buffer: buffer, boxed: false) if Int(_data.flags) & Int(1 << 2) != 0 { - serializeInt32(_data.channelPost!, buffer: buffer, boxed: false) + _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.flags2) & Int(1 << 19) != 0 { + _data.guestchatViaFrom!.serialize(buffer, true) } 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) + _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 { - serializeString(_data.savedFromName!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 10) != 0 { - serializeInt32(_data.savedDate!, buffer: buffer, boxed: false) + _data.media!.serialize(buffer, true) } if Int(_data.flags) & Int(1 << 6) != 0 { - serializeString(_data.psaType!, buffer: buffer, boxed: false) + _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(_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(_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) + } + if Int(_data.flags2) & Int(1 << 13) != 0 { + _data.richMessage!.serialize(buffer, true) + } + 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 } @@ -1140,76 +358,297 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .messageFwdHeader(let _data): - return ("messageFwdHeader", [("flags", ConstructorParameterDescription(_data.flags)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("fromName", ConstructorParameterDescription(_data.fromName)), ("date", ConstructorParameterDescription(_data.date)), ("channelPost", ConstructorParameterDescription(_data.channelPost)), ("postAuthor", ConstructorParameterDescription(_data.postAuthor)), ("savedFromPeer", ConstructorParameterDescription(_data.savedFromPeer)), ("savedFromMsgId", ConstructorParameterDescription(_data.savedFromMsgId)), ("savedFromId", ConstructorParameterDescription(_data.savedFromId)), ("savedFromName", ConstructorParameterDescription(_data.savedFromName)), ("savedDate", ConstructorParameterDescription(_data.savedDate)), ("psaType", ConstructorParameterDescription(_data.psaType))]) + case .message(let _data): + return ("message", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("fromBoostsApplied", ConstructorParameterDescription(_data.fromBoostsApplied)), ("fromRank", ConstructorParameterDescription(_data.fromRank)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("viaBotId", ConstructorParameterDescription(_data.viaBotId)), ("viaBusinessBotId", ConstructorParameterDescription(_data.viaBusinessBotId)), ("guestchatViaFrom", ConstructorParameterDescription(_data.guestchatViaFrom)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("date", ConstructorParameterDescription(_data.date)), ("message", ConstructorParameterDescription(_data.message)), ("media", ConstructorParameterDescription(_data.media)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup)), ("entities", ConstructorParameterDescription(_data.entities)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("replies", ConstructorParameterDescription(_data.replies)), ("editDate", ConstructorParameterDescription(_data.editDate)), ("postAuthor", ConstructorParameterDescription(_data.postAuthor)), ("groupedId", ConstructorParameterDescription(_data.groupedId)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("restrictionReason", ConstructorParameterDescription(_data.restrictionReason)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod)), ("quickReplyShortcutId", ConstructorParameterDescription(_data.quickReplyShortcutId)), ("effect", ConstructorParameterDescription(_data.effect)), ("factcheck", ConstructorParameterDescription(_data.factcheck)), ("reportDeliveryUntilDate", ConstructorParameterDescription(_data.reportDeliveryUntilDate)), ("paidMessageStars", ConstructorParameterDescription(_data.paidMessageStars)), ("suggestedPost", ConstructorParameterDescription(_data.suggestedPost)), ("scheduleRepeatPeriod", ConstructorParameterDescription(_data.scheduleRepeatPeriod)), ("summaryFromLanguage", ConstructorParameterDescription(_data.summaryFromLanguage)), ("richMessage", ConstructorParameterDescription(_data.richMessage))]) + case .messageEmpty(let _data): + return ("messageEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("peerId", ConstructorParameterDescription(_data.peerId))]) + case .messageService(let _data): + return ("messageService", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("date", ConstructorParameterDescription(_data.date)), ("action", ConstructorParameterDescription(_data.action)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) } } - public static func parse_messageFwdHeader(_ reader: BufferReader) -> MessageFwdHeader? { + public static func parse_message(_ reader: BufferReader) -> Message? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer + _4 = Api.parse(reader, signature: signature) as? Api.Peer } } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _3 = parseString(reader) - } - var _4: Int32? - _4 = reader.readInt32() var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if Int(_1 ?? 0) & Int(1 << 29) != 0 { _5 = reader.readInt32() } var _6: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if Int(_2 ?? 0) & Int(1 << 12) != 0 { _6 = parseString(reader) } var _7: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _8: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 28) != 0 { if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Peer + _8 = Api.parse(reader, signature: signature) as? Api.Peer } } - var _8: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _8 = reader.readInt32() - } - var _9: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { + var _9: Api.MessageFwdHeader? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.Peer + _9 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader } } - var _10: String? + var _10: Int64? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _10 = reader.readInt64() + } + var _11: Int64? + if Int(_2 ?? 0) & Int(1 << 0) != 0 { + _11 = reader.readInt64() + } + var _12: Api.Peer? + if Int(_2 ?? 0) & Int(1 << 19) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _13: Api.MessageReplyHeader? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader + } + } + var _14: Int32? + _14 = reader.readInt32() + var _15: String? + _15 = parseString(reader) + var _16: Api.MessageMedia? if Int(_1 ?? 0) & Int(1 << 9) != 0 { - _10 = parseString(reader) + if let signature = reader.readInt32() { + _16 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } } - var _11: Int32? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - _11 = reader.readInt32() - } - var _12: String? + var _17: Api.ReplyMarkup? if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _12 = parseString(reader) + if let signature = reader.readInt32() { + _17 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup + } + } + var _18: [Api.MessageEntity]? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _18 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } + var _19: Int32? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + _19 = reader.readInt32() + } + var _20: Int32? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + _20 = reader.readInt32() + } + var _21: Api.MessageReplies? + if Int(_1 ?? 0) & Int(1 << 23) != 0 { + if let signature = reader.readInt32() { + _21 = Api.parse(reader, signature: signature) as? Api.MessageReplies + } + } + var _22: Int32? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + _22 = reader.readInt32() + } + var _23: String? + if Int(_1 ?? 0) & Int(1 << 16) != 0 { + _23 = parseString(reader) + } + var _24: Int64? + if Int(_1 ?? 0) & Int(1 << 17) != 0 { + _24 = reader.readInt64() + } + var _25: Api.MessageReactions? + if Int(_1 ?? 0) & Int(1 << 20) != 0 { + if let signature = reader.readInt32() { + _25 = Api.parse(reader, signature: signature) as? Api.MessageReactions + } + } + var _26: [Api.RestrictionReason]? + if Int(_1 ?? 0) & Int(1 << 22) != 0 { + if let _ = reader.readInt32() { + _26 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) + } + } + var _27: Int32? + if Int(_1 ?? 0) & Int(1 << 25) != 0 { + _27 = reader.readInt32() + } + var _28: Int32? + if Int(_1 ?? 0) & Int(1 << 30) != 0 { + _28 = reader.readInt32() + } + var _29: Int64? + if Int(_2 ?? 0) & Int(1 << 2) != 0 { + _29 = reader.readInt64() + } + var _30: Api.FactCheck? + if Int(_2 ?? 0) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _30 = Api.parse(reader, signature: signature) as? Api.FactCheck + } + } + var _31: Int32? + if Int(_2 ?? 0) & Int(1 << 5) != 0 { + _31 = reader.readInt32() + } + var _32: Int64? + if Int(_2 ?? 0) & Int(1 << 6) != 0 { + _32 = reader.readInt64() + } + var _33: Api.SuggestedPost? + if Int(_2 ?? 0) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _33 = Api.parse(reader, signature: signature) as? Api.SuggestedPost + } + } + var _34: Int32? + if Int(_2 ?? 0) & Int(1 << 10) != 0 { + _34 = reader.readInt32() + } + var _35: String? + if Int(_2 ?? 0) & Int(1 << 11) != 0 { + _35 = parseString(reader) + } + var _36: Api.RichMessage? + if Int(_2 ?? 0) & Int(1 << 13) != 0 { + if let signature = reader.readInt32() { + _36 = Api.parse(reader, signature: signature) as? Api.RichMessage + } } let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _3 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 29) == 0) || _5 != nil + let _c6 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 28) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _10 != nil + let _c11 = (Int(_2 ?? 0) & Int(1 << 0) == 0) || _11 != nil + let _c12 = (Int(_2 ?? 0) & Int(1 << 19) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _13 != nil + let _c14 = _14 != nil + let _c15 = _15 != nil + let _c16 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _16 != nil + let _c17 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _17 != nil + let _c18 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _18 != nil + let _c19 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _19 != nil + let _c20 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _20 != nil + let _c21 = (Int(_1 ?? 0) & Int(1 << 23) == 0) || _21 != nil + let _c22 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _22 != nil + let _c23 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _23 != nil + let _c24 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _24 != nil + let _c25 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _25 != nil + let _c26 = (Int(_1 ?? 0) & Int(1 << 22) == 0) || _26 != nil + let _c27 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _27 != nil + let _c28 = (Int(_1 ?? 0) & Int(1 << 30) == 0) || _28 != nil + let _c29 = (Int(_2 ?? 0) & Int(1 << 2) == 0) || _29 != nil + let _c30 = (Int(_2 ?? 0) & Int(1 << 3) == 0) || _30 != nil + let _c31 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _31 != nil + let _c32 = (Int(_2 ?? 0) & Int(1 << 6) == 0) || _32 != nil + let _c33 = (Int(_2 ?? 0) & Int(1 << 7) == 0) || _33 != nil + let _c34 = (Int(_2 ?? 0) & Int(1 << 10) == 0) || _34 != nil + let _c35 = (Int(_2 ?? 0) & Int(1 << 11) == 0) || _35 != nil + let _c36 = (Int(_2 ?? 0) & Int(1 << 13) == 0) || _36 != 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 { + return Api.Message.message(Cons_message(flags: _1!, flags2: _2!, id: _3!, fromId: _4, fromBoostsApplied: _5, fromRank: _6, peerId: _7!, savedPeerId: _8, fwdFrom: _9, viaBotId: _10, viaBusinessBotId: _11, guestchatViaFrom: _12, replyTo: _13, date: _14!, message: _15!, media: _16, replyMarkup: _17, entities: _18, views: _19, forwards: _20, replies: _21, editDate: _22, postAuthor: _23, groupedId: _24, reactions: _25, restrictionReason: _26, ttlPeriod: _27, quickReplyShortcutId: _28, effect: _29, factcheck: _30, reportDeliveryUntilDate: _31, paidMessageStars: _32, suggestedPost: _33, scheduleRepeatPeriod: _34, summaryFromLanguage: _35, richMessage: _36)) + } + else { + return nil + } + } + public static func parse_messageEmpty(_ reader: BufferReader) -> Message? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.Message.messageEmpty(Cons_messageEmpty(flags: _1!, id: _2!, peerId: _3)) + } + else { + return nil + } + } + public static func parse_messageService(_ reader: BufferReader) -> Message? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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? + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.MessageAction + } + var _9: Api.MessageReactions? + if Int(_1 ?? 0) & Int(1 << 20) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.MessageReactions + } + } + var _10: Int32? + if Int(_1 ?? 0) & Int(1 << 25) != 0 { + _10 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _3 != nil let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 28) == 0) || _5 != nil let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _12 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - 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)) + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _10 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { + 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 @@ -1218,1062 +657,2908 @@ public extension Api { } } public extension Api { - indirect enum MessageMedia: TypeConstructorDescription { - public class Cons_messageMediaContact: TypeConstructorDescription { - public var phoneNumber: String - public var firstName: String - public var lastName: String - public var vcard: String + indirect enum MessageAction: TypeConstructorDescription { + public class Cons_messageActionBoostApply: TypeConstructorDescription { + public var boosts: Int32 + public init(boosts: Int32) { + self.boosts = boosts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionBoostApply", [("boosts", ConstructorParameterDescription(self.boosts))]) + } + } + public class Cons_messageActionBotAllowed: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionBotAllowed", [("flags", ConstructorParameterDescription(self.flags)), ("domain", ConstructorParameterDescription(self.domain)), ("app", ConstructorParameterDescription(self.app))]) + } + } + public class Cons_messageActionChangeCreator: TypeConstructorDescription { + public var newCreatorId: Int64 + public init(newCreatorId: Int64) { + self.newCreatorId = newCreatorId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChangeCreator", [("newCreatorId", ConstructorParameterDescription(self.newCreatorId))]) + } + } + public class Cons_messageActionChannelCreate: TypeConstructorDescription { + public var title: String + public init(title: String) { + self.title = title + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChannelCreate", [("title", ConstructorParameterDescription(self.title))]) + } + } + public class Cons_messageActionChannelMigrateFrom: TypeConstructorDescription { + public var title: String + public var chatId: Int64 + public init(title: String, chatId: Int64) { + self.title = title + self.chatId = chatId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChannelMigrateFrom", [("title", ConstructorParameterDescription(self.title)), ("chatId", ConstructorParameterDescription(self.chatId))]) + } + } + public class Cons_messageActionChatAddUser: TypeConstructorDescription { + public var users: [Int64] + public init(users: [Int64]) { + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatAddUser", [("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_messageActionChatCreate: TypeConstructorDescription { + public var title: String + public var users: [Int64] + public init(title: String, users: [Int64]) { + self.title = title + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatCreate", [("title", ConstructorParameterDescription(self.title)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_messageActionChatDeleteUser: TypeConstructorDescription { 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 + public init(userId: Int64) { self.userId = userId } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaContact", [("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("vcard", ConstructorParameterDescription(self.vcard)), ("userId", ConstructorParameterDescription(self.userId))]) + return ("messageActionChatDeleteUser", [("userId", ConstructorParameterDescription(self.userId))]) } } - public class Cons_messageMediaDice: TypeConstructorDescription { - 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_messageActionChatEditPhoto: TypeConstructorDescription { + public var photo: Api.Photo + public init(photo: Api.Photo) { + self.photo = photo } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaDice", [("flags", ConstructorParameterDescription(self.flags)), ("value", ConstructorParameterDescription(self.value)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("gameOutcome", ConstructorParameterDescription(self.gameOutcome))]) + return ("messageActionChatEditPhoto", [("photo", ConstructorParameterDescription(self.photo))]) } } - public class Cons_messageMediaDocument: TypeConstructorDescription { - 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_messageActionChatEditTitle: TypeConstructorDescription { + public var title: String + public init(title: String) { + self.title = title } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaDocument", [("flags", ConstructorParameterDescription(self.flags)), ("document", ConstructorParameterDescription(self.document)), ("altDocuments", ConstructorParameterDescription(self.altDocuments)), ("videoCover", ConstructorParameterDescription(self.videoCover)), ("videoTimestamp", ConstructorParameterDescription(self.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds))]) + return ("messageActionChatEditTitle", [("title", ConstructorParameterDescription(self.title))]) } } - public class Cons_messageMediaGame: TypeConstructorDescription { - public var game: Api.Game - public init(game: Api.Game) { - self.game = game + public class Cons_messageActionChatJoinedByLink: TypeConstructorDescription { + public var inviterId: Int64 + public init(inviterId: Int64) { + self.inviterId = inviterId } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaGame", [("game", ConstructorParameterDescription(self.game))]) + return ("messageActionChatJoinedByLink", [("inviterId", ConstructorParameterDescription(self.inviterId))]) } } - public class Cons_messageMediaGeo: TypeConstructorDescription { - public var geo: Api.GeoPoint - public init(geo: Api.GeoPoint) { - self.geo = geo - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaGeo", [("geo", ConstructorParameterDescription(self.geo))]) - } - } - public class Cons_messageMediaGeoLive: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaGeoLive", [("flags", ConstructorParameterDescription(self.flags)), ("geo", ConstructorParameterDescription(self.geo)), ("heading", ConstructorParameterDescription(self.heading)), ("period", ConstructorParameterDescription(self.period)), ("proximityNotificationRadius", ConstructorParameterDescription(self.proximityNotificationRadius))]) - } - } - public class Cons_messageMediaGiveaway: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaGiveaway", [("flags", ConstructorParameterDescription(self.flags)), ("channels", ConstructorParameterDescription(self.channels)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("quantity", ConstructorParameterDescription(self.quantity)), ("months", ConstructorParameterDescription(self.months)), ("stars", ConstructorParameterDescription(self.stars)), ("untilDate", ConstructorParameterDescription(self.untilDate))]) - } - } - public class Cons_messageMediaGiveawayResults: TypeConstructorDescription { - public var flags: Int32 + public class Cons_messageActionChatMigrateTo: TypeConstructorDescription { public var channelId: Int64 - public var additionalPeersCount: Int32? - public var launchMsgId: Int32 + public init(channelId: Int64) { + self.channelId = channelId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatMigrateTo", [("channelId", ConstructorParameterDescription(self.channelId))]) + } + } + public class Cons_messageActionConferenceCall: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionConferenceCall", [("flags", ConstructorParameterDescription(self.flags)), ("callId", ConstructorParameterDescription(self.callId)), ("duration", ConstructorParameterDescription(self.duration)), ("otherParticipants", ConstructorParameterDescription(self.otherParticipants))]) + } + } + public class Cons_messageActionCustomAction: TypeConstructorDescription { + public var message: String + public init(message: String) { + self.message = message + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionCustomAction", [("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_messageActionGameScore: TypeConstructorDescription { + public var gameId: Int64 + public var score: Int32 + public init(gameId: Int64, score: Int32) { + self.gameId = gameId + self.score = score + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGameScore", [("gameId", ConstructorParameterDescription(self.gameId)), ("score", ConstructorParameterDescription(self.score))]) + } + } + public class Cons_messageActionGeoProximityReached: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGeoProximityReached", [("fromId", ConstructorParameterDescription(self.fromId)), ("toId", ConstructorParameterDescription(self.toId)), ("distance", ConstructorParameterDescription(self.distance))]) + } + } + public class Cons_messageActionGiftCode: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGiftCode", [("flags", ConstructorParameterDescription(self.flags)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("days", ConstructorParameterDescription(self.days)), ("slug", ConstructorParameterDescription(self.slug)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_messageActionGiftPremium: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGiftPremium", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("days", ConstructorParameterDescription(self.days)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_messageActionGiftStars: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGiftStars", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("stars", ConstructorParameterDescription(self.stars)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("transactionId", ConstructorParameterDescription(self.transactionId))]) + } + } + public class Cons_messageActionGiftTon: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGiftTon", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("transactionId", ConstructorParameterDescription(self.transactionId))]) + } + } + public class Cons_messageActionGiveawayLaunch: TypeConstructorDescription { + public var flags: Int32 + public var stars: Int64? + public init(flags: Int32, stars: Int64?) { + self.flags = flags + self.stars = stars + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGiveawayLaunch", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars))]) + } + } + public class Cons_messageActionGiveawayResults: TypeConstructorDescription { + public var flags: 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) { + public init(flags: Int32, winnersCount: Int32, unclaimedCount: 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaGiveawayResults", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("additionalPeersCount", ConstructorParameterDescription(self.additionalPeersCount)), ("launchMsgId", ConstructorParameterDescription(self.launchMsgId)), ("winnersCount", ConstructorParameterDescription(self.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(self.unclaimedCount)), ("winners", ConstructorParameterDescription(self.winners)), ("months", ConstructorParameterDescription(self.months)), ("stars", ConstructorParameterDescription(self.stars)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("untilDate", ConstructorParameterDescription(self.untilDate))]) + return ("messageActionGiveawayResults", [("flags", ConstructorParameterDescription(self.flags)), ("winnersCount", ConstructorParameterDescription(self.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(self.unclaimedCount))]) } } - public class Cons_messageMediaInvoice: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaInvoice", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("receiptMsgId", ConstructorParameterDescription(self.receiptMsgId)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("startParam", ConstructorParameterDescription(self.startParam)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) - } - } - public class Cons_messageMediaPaidMedia: TypeConstructorDescription { - public var starsAmount: Int64 - public var extendedMedia: [Api.MessageExtendedMedia] - public init(starsAmount: Int64, extendedMedia: [Api.MessageExtendedMedia]) { - self.starsAmount = starsAmount - self.extendedMedia = extendedMedia - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaPaidMedia", [("starsAmount", ConstructorParameterDescription(self.starsAmount)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) - } - } - public class Cons_messageMediaPhoto: TypeConstructorDescription { - public var flags: Int32 - public var photo: Api.Photo? - public var ttlSeconds: Int32? - public var video: Api.Document? - public init(flags: Int32, photo: Api.Photo?, ttlSeconds: Int32?, video: Api.Document?) { - self.flags = flags - self.photo = photo - self.ttlSeconds = ttlSeconds - self.video = video - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photo", ConstructorParameterDescription(self.photo)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds)), ("video", ConstructorParameterDescription(self.video))]) - } - } - public class Cons_messageMediaPoll: TypeConstructorDescription { - public var flags: Int32 - public var poll: Api.Poll - public var results: Api.PollResults - public var attachedMedia: Api.MessageMedia? - public init(flags: Int32, poll: Api.Poll, results: Api.PollResults, attachedMedia: Api.MessageMedia?) { - self.flags = flags - self.poll = poll - self.results = results - self.attachedMedia = attachedMedia - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaPoll", [("flags", ConstructorParameterDescription(self.flags)), ("poll", ConstructorParameterDescription(self.poll)), ("results", ConstructorParameterDescription(self.results)), ("attachedMedia", ConstructorParameterDescription(self.attachedMedia))]) - } - } - public class Cons_messageMediaStory: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaStory", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("id", ConstructorParameterDescription(self.id)), ("story", ConstructorParameterDescription(self.story))]) - } - } - public class Cons_messageMediaToDo: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaToDo", [("flags", ConstructorParameterDescription(self.flags)), ("todo", ConstructorParameterDescription(self.todo)), ("completions", ConstructorParameterDescription(self.completions))]) - } - } - public class Cons_messageMediaVenue: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaVenue", [("geo", ConstructorParameterDescription(self.geo)), ("title", ConstructorParameterDescription(self.title)), ("address", ConstructorParameterDescription(self.address)), ("provider", ConstructorParameterDescription(self.provider)), ("venueId", ConstructorParameterDescription(self.venueId)), ("venueType", ConstructorParameterDescription(self.venueType))]) - } - } - public class Cons_messageMediaVideoStream: TypeConstructorDescription { + public class Cons_messageActionGroupCall: TypeConstructorDescription { public var flags: Int32 public var call: Api.InputGroupCall - public init(flags: Int32, 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaVideoStream", [("flags", ConstructorParameterDescription(self.flags)), ("call", ConstructorParameterDescription(self.call))]) + return ("messageActionGroupCall", [("flags", ConstructorParameterDescription(self.flags)), ("call", ConstructorParameterDescription(self.call)), ("duration", ConstructorParameterDescription(self.duration))]) } } - public class Cons_messageMediaWebPage: TypeConstructorDescription { + public class Cons_messageActionGroupCallScheduled: TypeConstructorDescription { + public var call: Api.InputGroupCall + public var scheduleDate: Int32 + public init(call: Api.InputGroupCall, scheduleDate: Int32) { + self.call = call + self.scheduleDate = scheduleDate + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGroupCallScheduled", [("call", ConstructorParameterDescription(self.call)), ("scheduleDate", ConstructorParameterDescription(self.scheduleDate))]) + } + } + public class Cons_messageActionInviteToGroupCall: TypeConstructorDescription { + public var call: Api.InputGroupCall + public var users: [Int64] + public init(call: Api.InputGroupCall, users: [Int64]) { + self.call = call + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionInviteToGroupCall", [("call", ConstructorParameterDescription(self.call)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_messageActionManagedBotCreated: TypeConstructorDescription { + public var botId: Int64 + public init(botId: Int64) { + self.botId = botId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionManagedBotCreated", [("botId", ConstructorParameterDescription(self.botId))]) + } + } + public class Cons_messageActionNewCreatorPending: TypeConstructorDescription { + public var newCreatorId: Int64 + public init(newCreatorId: Int64) { + self.newCreatorId = newCreatorId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionNewCreatorPending", [("newCreatorId", ConstructorParameterDescription(self.newCreatorId))]) + } + } + public class Cons_messageActionNoForwardsRequest: TypeConstructorDescription { public var flags: Int32 - public var webpage: Api.WebPage - public init(flags: Int32, webpage: Api.WebPage) { + public var prevValue: Api.Bool + public var newValue: Api.Bool + public init(flags: Int32, prevValue: Api.Bool, newValue: Api.Bool) { self.flags = flags - self.webpage = webpage + self.prevValue = prevValue + self.newValue = newValue } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageMediaWebPage", [("flags", ConstructorParameterDescription(self.flags)), ("webpage", ConstructorParameterDescription(self.webpage))]) + return ("messageActionNoForwardsRequest", [("flags", ConstructorParameterDescription(self.flags)), ("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } - case messageMediaContact(Cons_messageMediaContact) - case messageMediaDice(Cons_messageMediaDice) - case messageMediaDocument(Cons_messageMediaDocument) - case messageMediaEmpty - 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(Cons_messageMediaVenue) - case messageMediaVideoStream(Cons_messageMediaVideoStream) - case messageMediaWebPage(Cons_messageMediaWebPage) + public class Cons_messageActionNoForwardsToggle: TypeConstructorDescription { + public var prevValue: Api.Bool + public var newValue: Api.Bool + public init(prevValue: Api.Bool, newValue: Api.Bool) { + self.prevValue = prevValue + self.newValue = newValue + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionNoForwardsToggle", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) + } + } + public class Cons_messageActionPaidMessagesPrice: TypeConstructorDescription { + public var flags: Int32 + public var stars: Int64 + public init(flags: Int32, stars: Int64) { + self.flags = flags + self.stars = stars + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPaidMessagesPrice", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars))]) + } + } + public class Cons_messageActionPaidMessagesRefunded: TypeConstructorDescription { + public var count: Int32 + public var stars: Int64 + public init(count: Int32, stars: Int64) { + self.count = count + self.stars = stars + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPaidMessagesRefunded", [("count", ConstructorParameterDescription(self.count)), ("stars", ConstructorParameterDescription(self.stars))]) + } + } + public class Cons_messageActionPaymentRefunded: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPaymentRefunded", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("payload", ConstructorParameterDescription(self.payload)), ("charge", ConstructorParameterDescription(self.charge))]) + } + } + public class Cons_messageActionPaymentSent: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPaymentSent", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("invoiceSlug", ConstructorParameterDescription(self.invoiceSlug)), ("subscriptionUntilDate", ConstructorParameterDescription(self.subscriptionUntilDate))]) + } + } + public class Cons_messageActionPaymentSentMe: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPaymentSentMe", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("payload", ConstructorParameterDescription(self.payload)), ("info", ConstructorParameterDescription(self.info)), ("shippingOptionId", ConstructorParameterDescription(self.shippingOptionId)), ("charge", ConstructorParameterDescription(self.charge)), ("subscriptionUntilDate", ConstructorParameterDescription(self.subscriptionUntilDate))]) + } + } + public class Cons_messageActionPhoneCall: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPhoneCall", [("flags", ConstructorParameterDescription(self.flags)), ("callId", ConstructorParameterDescription(self.callId)), ("reason", ConstructorParameterDescription(self.reason)), ("duration", ConstructorParameterDescription(self.duration))]) + } + } + public class Cons_messageActionPollAppendAnswer: TypeConstructorDescription { + public var answer: Api.PollAnswer + public init(answer: Api.PollAnswer) { + self.answer = answer + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPollAppendAnswer", [("answer", ConstructorParameterDescription(self.answer))]) + } + } + public class Cons_messageActionPollDeleteAnswer: TypeConstructorDescription { + public var answer: Api.PollAnswer + public init(answer: Api.PollAnswer) { + self.answer = answer + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPollDeleteAnswer", [("answer", ConstructorParameterDescription(self.answer))]) + } + } + public class Cons_messageActionPrizeStars: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPrizeStars", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("transactionId", ConstructorParameterDescription(self.transactionId)), ("boostPeer", ConstructorParameterDescription(self.boostPeer)), ("giveawayMsgId", ConstructorParameterDescription(self.giveawayMsgId))]) + } + } + public class Cons_messageActionRequestedPeer: TypeConstructorDescription { + public var buttonId: Int32 + public var peers: [Api.Peer] + public init(buttonId: Int32, peers: [Api.Peer]) { + self.buttonId = buttonId + self.peers = peers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionRequestedPeer", [("buttonId", ConstructorParameterDescription(self.buttonId)), ("peers", ConstructorParameterDescription(self.peers))]) + } + } + public class Cons_messageActionRequestedPeerSentMe: TypeConstructorDescription { + public var buttonId: Int32 + public var peers: [Api.RequestedPeer] + public init(buttonId: Int32, peers: [Api.RequestedPeer]) { + self.buttonId = buttonId + self.peers = peers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionRequestedPeerSentMe", [("buttonId", ConstructorParameterDescription(self.buttonId)), ("peers", ConstructorParameterDescription(self.peers))]) + } + } + public class Cons_messageActionSecureValuesSent: TypeConstructorDescription { + public var types: [Api.SecureValueType] + public init(types: [Api.SecureValueType]) { + self.types = types + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSecureValuesSent", [("types", ConstructorParameterDescription(self.types))]) + } + } + public class Cons_messageActionSecureValuesSentMe: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSecureValuesSentMe", [("values", ConstructorParameterDescription(self.values)), ("credentials", ConstructorParameterDescription(self.credentials))]) + } + } + public class Cons_messageActionSetChatTheme: TypeConstructorDescription { + public var theme: Api.ChatTheme + public init(theme: Api.ChatTheme) { + self.theme = theme + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSetChatTheme", [("theme", ConstructorParameterDescription(self.theme))]) + } + } + public class Cons_messageActionSetChatWallPaper: TypeConstructorDescription { + public var flags: Int32 + public var wallpaper: Api.WallPaper + public init(flags: Int32, wallpaper: Api.WallPaper) { + self.flags = flags + self.wallpaper = wallpaper + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSetChatWallPaper", [("flags", ConstructorParameterDescription(self.flags)), ("wallpaper", ConstructorParameterDescription(self.wallpaper))]) + } + } + public class Cons_messageActionSetMessagesTTL: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSetMessagesTTL", [("flags", ConstructorParameterDescription(self.flags)), ("period", ConstructorParameterDescription(self.period)), ("autoSettingFrom", ConstructorParameterDescription(self.autoSettingFrom))]) + } + } + public class Cons_messageActionStarGift: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionStarGift", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("message", ConstructorParameterDescription(self.message)), ("convertStars", ConstructorParameterDescription(self.convertStars)), ("upgradeMsgId", ConstructorParameterDescription(self.upgradeMsgId)), ("upgradeStars", ConstructorParameterDescription(self.upgradeStars)), ("fromId", ConstructorParameterDescription(self.fromId)), ("peer", ConstructorParameterDescription(self.peer)), ("savedId", ConstructorParameterDescription(self.savedId)), ("prepaidUpgradeHash", ConstructorParameterDescription(self.prepaidUpgradeHash)), ("giftMsgId", ConstructorParameterDescription(self.giftMsgId)), ("toId", ConstructorParameterDescription(self.toId)), ("giftNum", ConstructorParameterDescription(self.giftNum))]) + } + } + public class Cons_messageActionStarGiftPurchaseOffer: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionStarGiftPurchaseOffer", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("price", ConstructorParameterDescription(self.price)), ("expiresAt", ConstructorParameterDescription(self.expiresAt))]) + } + } + public class Cons_messageActionStarGiftPurchaseOfferDeclined: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("price", ConstructorParameterDescription(self.price))]) + } + } + public class Cons_messageActionStarGiftUnique: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionStarGiftUnique", [("flags", ConstructorParameterDescription(self.flags)), ("gift", ConstructorParameterDescription(self.gift)), ("canExportAt", ConstructorParameterDescription(self.canExportAt)), ("transferStars", ConstructorParameterDescription(self.transferStars)), ("fromId", ConstructorParameterDescription(self.fromId)), ("peer", ConstructorParameterDescription(self.peer)), ("savedId", ConstructorParameterDescription(self.savedId)), ("resaleAmount", ConstructorParameterDescription(self.resaleAmount)), ("canTransferAt", ConstructorParameterDescription(self.canTransferAt)), ("canResellAt", ConstructorParameterDescription(self.canResellAt)), ("dropOriginalDetailsStars", ConstructorParameterDescription(self.dropOriginalDetailsStars)), ("canCraftAt", ConstructorParameterDescription(self.canCraftAt))]) + } + } + public class Cons_messageActionSuggestBirthday: TypeConstructorDescription { + public var birthday: Api.Birthday + public init(birthday: Api.Birthday) { + self.birthday = birthday + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestBirthday", [("birthday", ConstructorParameterDescription(self.birthday))]) + } + } + public class Cons_messageActionSuggestProfilePhoto: TypeConstructorDescription { + public var photo: Api.Photo + public init(photo: Api.Photo) { + self.photo = photo + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestProfilePhoto", [("photo", ConstructorParameterDescription(self.photo))]) + } + } + public class Cons_messageActionSuggestedPostApproval: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestedPostApproval", [("flags", ConstructorParameterDescription(self.flags)), ("rejectComment", ConstructorParameterDescription(self.rejectComment)), ("scheduleDate", ConstructorParameterDescription(self.scheduleDate)), ("price", ConstructorParameterDescription(self.price))]) + } + } + public class Cons_messageActionSuggestedPostRefund: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestedPostRefund", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_messageActionSuggestedPostSuccess: TypeConstructorDescription { + public var price: Api.StarsAmount + public init(price: Api.StarsAmount) { + self.price = price + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestedPostSuccess", [("price", ConstructorParameterDescription(self.price))]) + } + } + public class Cons_messageActionTodoAppendTasks: TypeConstructorDescription { + public var list: [Api.TodoItem] + public init(list: [Api.TodoItem]) { + self.list = list + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionTodoAppendTasks", [("list", ConstructorParameterDescription(self.list))]) + } + } + public class Cons_messageActionTodoCompletions: TypeConstructorDescription { + public var completed: [Int32] + public var incompleted: [Int32] + public init(completed: [Int32], incompleted: [Int32]) { + self.completed = completed + self.incompleted = incompleted + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionTodoCompletions", [("completed", ConstructorParameterDescription(self.completed)), ("incompleted", ConstructorParameterDescription(self.incompleted))]) + } + } + public class Cons_messageActionTopicCreate: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionTopicCreate", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("iconColor", ConstructorParameterDescription(self.iconColor)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId))]) + } + } + public class Cons_messageActionTopicEdit: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionTopicEdit", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId)), ("closed", ConstructorParameterDescription(self.closed)), ("hidden", ConstructorParameterDescription(self.hidden))]) + } + } + public class Cons_messageActionWebViewDataSent: TypeConstructorDescription { + public var text: String + public init(text: String) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionWebViewDataSent", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_messageActionWebViewDataSentMe: TypeConstructorDescription { + public var text: String + public var data: String + public init(text: String, data: String) { + self.text = text + self.data = data + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionWebViewDataSentMe", [("text", ConstructorParameterDescription(self.text)), ("data", ConstructorParameterDescription(self.data))]) + } + } + case messageActionBoostApply(Cons_messageActionBoostApply) + case messageActionBotAllowed(Cons_messageActionBotAllowed) + case messageActionChangeCreator(Cons_messageActionChangeCreator) + case messageActionChannelCreate(Cons_messageActionChannelCreate) + case messageActionChannelMigrateFrom(Cons_messageActionChannelMigrateFrom) + case messageActionChatAddUser(Cons_messageActionChatAddUser) + case messageActionChatCreate(Cons_messageActionChatCreate) + case messageActionChatDeletePhoto + case messageActionChatDeleteUser(Cons_messageActionChatDeleteUser) + case messageActionChatEditPhoto(Cons_messageActionChatEditPhoto) + case messageActionChatEditTitle(Cons_messageActionChatEditTitle) + case messageActionChatJoinedByLink(Cons_messageActionChatJoinedByLink) + case messageActionChatJoinedByRequest + case messageActionChatMigrateTo(Cons_messageActionChatMigrateTo) + case messageActionConferenceCall(Cons_messageActionConferenceCall) + case messageActionContactSignUp + case messageActionCustomAction(Cons_messageActionCustomAction) + case messageActionEmpty + 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(Cons_messageActionInviteToGroupCall) + case messageActionManagedBotCreated(Cons_messageActionManagedBotCreated) + case messageActionNewCreatorPending(Cons_messageActionNewCreatorPending) + case messageActionNoForwardsRequest(Cons_messageActionNoForwardsRequest) + case messageActionNoForwardsToggle(Cons_messageActionNoForwardsToggle) + 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 messageActionPollAppendAnswer(Cons_messageActionPollAppendAnswer) + case messageActionPollDeleteAnswer(Cons_messageActionPollDeleteAnswer) + case messageActionPrizeStars(Cons_messageActionPrizeStars) + case messageActionRequestedPeer(Cons_messageActionRequestedPeer) + case messageActionRequestedPeerSentMe(Cons_messageActionRequestedPeerSentMe) + case messageActionScreenshotTaken + 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 .messageMediaContact(let _data): + case .messageActionBoostApply(let _data): if boxed { - buffer.appendInt32(1882335561) + 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 .messageActionChangeCreator(let _data): + if boxed { + buffer.appendInt32(-511160261) + } + serializeInt64(_data.newCreatorId, buffer: buffer, boxed: false) + 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) } - 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): + case .messageActionChatEditPhoto(let _data): if boxed { - buffer.appendInt32(147581959) + buffer.appendInt32(2144015272) } - 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) + _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 .messageMediaDocument(let _data): + case .messageActionChatMigrateTo(let _data): if boxed { - buffer.appendInt32(1389939929) + 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) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.document!.serialize(buffer, true) + 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 << 5) != 0 { + if Int(_data.flags) & Int(1 << 3) != 0 { buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.altDocuments!.count)) - for item in _data.altDocuments! { + buffer.appendInt32(Int32(_data.otherParticipants!.count)) + for item in _data.otherParticipants! { item.serialize(buffer, true) } } - if Int(_data.flags) & Int(1 << 9) != 0 { - _data.videoCover!.serialize(buffer, true) + break + case .messageActionContactSignUp: + if boxed { + buffer.appendInt32(-202219658) } - if Int(_data.flags) & Int(1 << 10) != 0 { - serializeInt32(_data.videoTimestamp!, buffer: buffer, boxed: false) + 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 { - 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) - } + serializeInt64(_data.amount!, buffer: buffer, boxed: false) } if Int(_data.flags) & Int(1 << 3) != 0 { - serializeString(_data.prizeDescription!, buffer: buffer, boxed: false) + serializeString(_data.cryptoCurrency!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt64(_data.cryptoAmount!, 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) + _data.message!.serialize(buffer, true) } - if Int(_data.flags) & Int(1 << 5) != 0 { + 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) } - serializeInt32(_data.untilDate, buffer: buffer, boxed: false) break - case .messageMediaGiveawayResults(let _data): + case .messageActionGiveawayResults(let _data): if boxed { - buffer.appendInt32(-827703647) + buffer.appendInt32(-2015170219) } 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): + case .messageActionGroupCall(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(-501814429) - } - 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) - } - if Int(_data.flags) & Int(1 << 4) != 0 { - _data.video!.serialize(buffer, true) - } - break - case .messageMediaPoll(let _data): - if boxed { - buffer.appendInt32(2000637542) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.poll.serialize(buffer, true) - _data.results.serialize(buffer, true) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.attachedMedia!.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(_data.completions!.count)) - for item in _data.completions! { - item.serialize(buffer, true) - } - } - 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) + 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 .messageMediaWebPage(let _data): + case .messageActionGroupCallScheduled(let _data): if boxed { - buffer.appendInt32(-571405253) + 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 .messageActionManagedBotCreated(let _data): + if boxed { + buffer.appendInt32(375414334) + } + serializeInt64(_data.botId, buffer: buffer, boxed: false) + break + case .messageActionNewCreatorPending(let _data): + if boxed { + buffer.appendInt32(-1333866363) + } + serializeInt64(_data.newCreatorId, buffer: buffer, boxed: false) + break + case .messageActionNoForwardsRequest(let _data): + if boxed { + buffer.appendInt32(1042781114) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.webpage.serialize(buffer, true) + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + break + case .messageActionNoForwardsToggle(let _data): + if boxed { + buffer.appendInt32(-1082301070) + } + _data.prevValue.serialize(buffer, true) + _data.newValue.serialize(buffer, true) + 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 .messageActionPollAppendAnswer(let _data): + if boxed { + buffer.appendInt32(-1650340500) + } + _data.answer.serialize(buffer, true) + break + case .messageActionPollDeleteAnswer(let _data): + if boxed { + buffer.appendInt32(966161628) + } + _data.answer.serialize(buffer, true) + 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, ConstructorParameterDescription)]) { switch self { - case .messageMediaContact(let _data): - return ("messageMediaContact", [("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("vcard", ConstructorParameterDescription(_data.vcard)), ("userId", ConstructorParameterDescription(_data.userId))]) - case .messageMediaDice(let _data): - return ("messageMediaDice", [("flags", ConstructorParameterDescription(_data.flags)), ("value", ConstructorParameterDescription(_data.value)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("gameOutcome", ConstructorParameterDescription(_data.gameOutcome))]) - case .messageMediaDocument(let _data): - return ("messageMediaDocument", [("flags", ConstructorParameterDescription(_data.flags)), ("document", ConstructorParameterDescription(_data.document)), ("altDocuments", ConstructorParameterDescription(_data.altDocuments)), ("videoCover", ConstructorParameterDescription(_data.videoCover)), ("videoTimestamp", ConstructorParameterDescription(_data.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds))]) - case .messageMediaEmpty: - return ("messageMediaEmpty", []) - case .messageMediaGame(let _data): - return ("messageMediaGame", [("game", ConstructorParameterDescription(_data.game))]) - case .messageMediaGeo(let _data): - return ("messageMediaGeo", [("geo", ConstructorParameterDescription(_data.geo))]) - case .messageMediaGeoLive(let _data): - return ("messageMediaGeoLive", [("flags", ConstructorParameterDescription(_data.flags)), ("geo", ConstructorParameterDescription(_data.geo)), ("heading", ConstructorParameterDescription(_data.heading)), ("period", ConstructorParameterDescription(_data.period)), ("proximityNotificationRadius", ConstructorParameterDescription(_data.proximityNotificationRadius))]) - case .messageMediaGiveaway(let _data): - return ("messageMediaGiveaway", [("flags", ConstructorParameterDescription(_data.flags)), ("channels", ConstructorParameterDescription(_data.channels)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("quantity", ConstructorParameterDescription(_data.quantity)), ("months", ConstructorParameterDescription(_data.months)), ("stars", ConstructorParameterDescription(_data.stars)), ("untilDate", ConstructorParameterDescription(_data.untilDate))]) - case .messageMediaGiveawayResults(let _data): - return ("messageMediaGiveawayResults", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("additionalPeersCount", ConstructorParameterDescription(_data.additionalPeersCount)), ("launchMsgId", ConstructorParameterDescription(_data.launchMsgId)), ("winnersCount", ConstructorParameterDescription(_data.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(_data.unclaimedCount)), ("winners", ConstructorParameterDescription(_data.winners)), ("months", ConstructorParameterDescription(_data.months)), ("stars", ConstructorParameterDescription(_data.stars)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("untilDate", ConstructorParameterDescription(_data.untilDate))]) - case .messageMediaInvoice(let _data): - return ("messageMediaInvoice", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("receiptMsgId", ConstructorParameterDescription(_data.receiptMsgId)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("startParam", ConstructorParameterDescription(_data.startParam)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) - case .messageMediaPaidMedia(let _data): - return ("messageMediaPaidMedia", [("starsAmount", ConstructorParameterDescription(_data.starsAmount)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) - case .messageMediaPhoto(let _data): - return ("messageMediaPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photo", ConstructorParameterDescription(_data.photo)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds)), ("video", ConstructorParameterDescription(_data.video))]) - case .messageMediaPoll(let _data): - return ("messageMediaPoll", [("flags", ConstructorParameterDescription(_data.flags)), ("poll", ConstructorParameterDescription(_data.poll)), ("results", ConstructorParameterDescription(_data.results)), ("attachedMedia", ConstructorParameterDescription(_data.attachedMedia))]) - case .messageMediaStory(let _data): - return ("messageMediaStory", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("id", ConstructorParameterDescription(_data.id)), ("story", ConstructorParameterDescription(_data.story))]) - case .messageMediaToDo(let _data): - return ("messageMediaToDo", [("flags", ConstructorParameterDescription(_data.flags)), ("todo", ConstructorParameterDescription(_data.todo)), ("completions", ConstructorParameterDescription(_data.completions))]) - case .messageMediaUnsupported: - return ("messageMediaUnsupported", []) - case .messageMediaVenue(let _data): - return ("messageMediaVenue", [("geo", ConstructorParameterDescription(_data.geo)), ("title", ConstructorParameterDescription(_data.title)), ("address", ConstructorParameterDescription(_data.address)), ("provider", ConstructorParameterDescription(_data.provider)), ("venueId", ConstructorParameterDescription(_data.venueId)), ("venueType", ConstructorParameterDescription(_data.venueType))]) - case .messageMediaVideoStream(let _data): - return ("messageMediaVideoStream", [("flags", ConstructorParameterDescription(_data.flags)), ("call", ConstructorParameterDescription(_data.call))]) - case .messageMediaWebPage(let _data): - return ("messageMediaWebPage", [("flags", ConstructorParameterDescription(_data.flags)), ("webpage", ConstructorParameterDescription(_data.webpage))]) + case .messageActionBoostApply(let _data): + return ("messageActionBoostApply", [("boosts", ConstructorParameterDescription(_data.boosts))]) + case .messageActionBotAllowed(let _data): + return ("messageActionBotAllowed", [("flags", ConstructorParameterDescription(_data.flags)), ("domain", ConstructorParameterDescription(_data.domain)), ("app", ConstructorParameterDescription(_data.app))]) + case .messageActionChangeCreator(let _data): + return ("messageActionChangeCreator", [("newCreatorId", ConstructorParameterDescription(_data.newCreatorId))]) + case .messageActionChannelCreate(let _data): + return ("messageActionChannelCreate", [("title", ConstructorParameterDescription(_data.title))]) + case .messageActionChannelMigrateFrom(let _data): + return ("messageActionChannelMigrateFrom", [("title", ConstructorParameterDescription(_data.title)), ("chatId", ConstructorParameterDescription(_data.chatId))]) + case .messageActionChatAddUser(let _data): + return ("messageActionChatAddUser", [("users", ConstructorParameterDescription(_data.users))]) + case .messageActionChatCreate(let _data): + return ("messageActionChatCreate", [("title", ConstructorParameterDescription(_data.title)), ("users", ConstructorParameterDescription(_data.users))]) + case .messageActionChatDeletePhoto: + return ("messageActionChatDeletePhoto", []) + case .messageActionChatDeleteUser(let _data): + return ("messageActionChatDeleteUser", [("userId", ConstructorParameterDescription(_data.userId))]) + case .messageActionChatEditPhoto(let _data): + return ("messageActionChatEditPhoto", [("photo", ConstructorParameterDescription(_data.photo))]) + case .messageActionChatEditTitle(let _data): + return ("messageActionChatEditTitle", [("title", ConstructorParameterDescription(_data.title))]) + case .messageActionChatJoinedByLink(let _data): + return ("messageActionChatJoinedByLink", [("inviterId", ConstructorParameterDescription(_data.inviterId))]) + case .messageActionChatJoinedByRequest: + return ("messageActionChatJoinedByRequest", []) + case .messageActionChatMigrateTo(let _data): + return ("messageActionChatMigrateTo", [("channelId", ConstructorParameterDescription(_data.channelId))]) + case .messageActionConferenceCall(let _data): + return ("messageActionConferenceCall", [("flags", ConstructorParameterDescription(_data.flags)), ("callId", ConstructorParameterDescription(_data.callId)), ("duration", ConstructorParameterDescription(_data.duration)), ("otherParticipants", ConstructorParameterDescription(_data.otherParticipants))]) + case .messageActionContactSignUp: + return ("messageActionContactSignUp", []) + case .messageActionCustomAction(let _data): + return ("messageActionCustomAction", [("message", ConstructorParameterDescription(_data.message))]) + case .messageActionEmpty: + return ("messageActionEmpty", []) + case .messageActionGameScore(let _data): + return ("messageActionGameScore", [("gameId", ConstructorParameterDescription(_data.gameId)), ("score", ConstructorParameterDescription(_data.score))]) + case .messageActionGeoProximityReached(let _data): + return ("messageActionGeoProximityReached", [("fromId", ConstructorParameterDescription(_data.fromId)), ("toId", ConstructorParameterDescription(_data.toId)), ("distance", ConstructorParameterDescription(_data.distance))]) + case .messageActionGiftCode(let _data): + return ("messageActionGiftCode", [("flags", ConstructorParameterDescription(_data.flags)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("days", ConstructorParameterDescription(_data.days)), ("slug", ConstructorParameterDescription(_data.slug)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("message", ConstructorParameterDescription(_data.message))]) + case .messageActionGiftPremium(let _data): + return ("messageActionGiftPremium", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("days", ConstructorParameterDescription(_data.days)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("message", ConstructorParameterDescription(_data.message))]) + case .messageActionGiftStars(let _data): + return ("messageActionGiftStars", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("stars", ConstructorParameterDescription(_data.stars)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("transactionId", ConstructorParameterDescription(_data.transactionId))]) + case .messageActionGiftTon(let _data): + return ("messageActionGiftTon", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("transactionId", ConstructorParameterDescription(_data.transactionId))]) + case .messageActionGiveawayLaunch(let _data): + return ("messageActionGiveawayLaunch", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars))]) + case .messageActionGiveawayResults(let _data): + return ("messageActionGiveawayResults", [("flags", ConstructorParameterDescription(_data.flags)), ("winnersCount", ConstructorParameterDescription(_data.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(_data.unclaimedCount))]) + case .messageActionGroupCall(let _data): + return ("messageActionGroupCall", [("flags", ConstructorParameterDescription(_data.flags)), ("call", ConstructorParameterDescription(_data.call)), ("duration", ConstructorParameterDescription(_data.duration))]) + case .messageActionGroupCallScheduled(let _data): + return ("messageActionGroupCallScheduled", [("call", ConstructorParameterDescription(_data.call)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate))]) + case .messageActionHistoryClear: + return ("messageActionHistoryClear", []) + case .messageActionInviteToGroupCall(let _data): + return ("messageActionInviteToGroupCall", [("call", ConstructorParameterDescription(_data.call)), ("users", ConstructorParameterDescription(_data.users))]) + case .messageActionManagedBotCreated(let _data): + return ("messageActionManagedBotCreated", [("botId", ConstructorParameterDescription(_data.botId))]) + case .messageActionNewCreatorPending(let _data): + return ("messageActionNewCreatorPending", [("newCreatorId", ConstructorParameterDescription(_data.newCreatorId))]) + case .messageActionNoForwardsRequest(let _data): + return ("messageActionNoForwardsRequest", [("flags", ConstructorParameterDescription(_data.flags)), ("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) + case .messageActionNoForwardsToggle(let _data): + return ("messageActionNoForwardsToggle", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) + case .messageActionPaidMessagesPrice(let _data): + return ("messageActionPaidMessagesPrice", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars))]) + case .messageActionPaidMessagesRefunded(let _data): + return ("messageActionPaidMessagesRefunded", [("count", ConstructorParameterDescription(_data.count)), ("stars", ConstructorParameterDescription(_data.stars))]) + case .messageActionPaymentRefunded(let _data): + return ("messageActionPaymentRefunded", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("payload", ConstructorParameterDescription(_data.payload)), ("charge", ConstructorParameterDescription(_data.charge))]) + case .messageActionPaymentSent(let _data): + return ("messageActionPaymentSent", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("invoiceSlug", ConstructorParameterDescription(_data.invoiceSlug)), ("subscriptionUntilDate", ConstructorParameterDescription(_data.subscriptionUntilDate))]) + case .messageActionPaymentSentMe(let _data): + return ("messageActionPaymentSentMe", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("payload", ConstructorParameterDescription(_data.payload)), ("info", ConstructorParameterDescription(_data.info)), ("shippingOptionId", ConstructorParameterDescription(_data.shippingOptionId)), ("charge", ConstructorParameterDescription(_data.charge)), ("subscriptionUntilDate", ConstructorParameterDescription(_data.subscriptionUntilDate))]) + case .messageActionPhoneCall(let _data): + return ("messageActionPhoneCall", [("flags", ConstructorParameterDescription(_data.flags)), ("callId", ConstructorParameterDescription(_data.callId)), ("reason", ConstructorParameterDescription(_data.reason)), ("duration", ConstructorParameterDescription(_data.duration))]) + case .messageActionPinMessage: + return ("messageActionPinMessage", []) + case .messageActionPollAppendAnswer(let _data): + return ("messageActionPollAppendAnswer", [("answer", ConstructorParameterDescription(_data.answer))]) + case .messageActionPollDeleteAnswer(let _data): + return ("messageActionPollDeleteAnswer", [("answer", ConstructorParameterDescription(_data.answer))]) + case .messageActionPrizeStars(let _data): + return ("messageActionPrizeStars", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("transactionId", ConstructorParameterDescription(_data.transactionId)), ("boostPeer", ConstructorParameterDescription(_data.boostPeer)), ("giveawayMsgId", ConstructorParameterDescription(_data.giveawayMsgId))]) + case .messageActionRequestedPeer(let _data): + return ("messageActionRequestedPeer", [("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peers", ConstructorParameterDescription(_data.peers))]) + case .messageActionRequestedPeerSentMe(let _data): + return ("messageActionRequestedPeerSentMe", [("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peers", ConstructorParameterDescription(_data.peers))]) + case .messageActionScreenshotTaken: + return ("messageActionScreenshotTaken", []) + case .messageActionSecureValuesSent(let _data): + return ("messageActionSecureValuesSent", [("types", ConstructorParameterDescription(_data.types))]) + case .messageActionSecureValuesSentMe(let _data): + return ("messageActionSecureValuesSentMe", [("values", ConstructorParameterDescription(_data.values)), ("credentials", ConstructorParameterDescription(_data.credentials))]) + case .messageActionSetChatTheme(let _data): + return ("messageActionSetChatTheme", [("theme", ConstructorParameterDescription(_data.theme))]) + case .messageActionSetChatWallPaper(let _data): + return ("messageActionSetChatWallPaper", [("flags", ConstructorParameterDescription(_data.flags)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) + case .messageActionSetMessagesTTL(let _data): + return ("messageActionSetMessagesTTL", [("flags", ConstructorParameterDescription(_data.flags)), ("period", ConstructorParameterDescription(_data.period)), ("autoSettingFrom", ConstructorParameterDescription(_data.autoSettingFrom))]) + case .messageActionStarGift(let _data): + return ("messageActionStarGift", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("message", ConstructorParameterDescription(_data.message)), ("convertStars", ConstructorParameterDescription(_data.convertStars)), ("upgradeMsgId", ConstructorParameterDescription(_data.upgradeMsgId)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("peer", ConstructorParameterDescription(_data.peer)), ("savedId", ConstructorParameterDescription(_data.savedId)), ("prepaidUpgradeHash", ConstructorParameterDescription(_data.prepaidUpgradeHash)), ("giftMsgId", ConstructorParameterDescription(_data.giftMsgId)), ("toId", ConstructorParameterDescription(_data.toId)), ("giftNum", ConstructorParameterDescription(_data.giftNum))]) + case .messageActionStarGiftPurchaseOffer(let _data): + return ("messageActionStarGiftPurchaseOffer", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("price", ConstructorParameterDescription(_data.price)), ("expiresAt", ConstructorParameterDescription(_data.expiresAt))]) + case .messageActionStarGiftPurchaseOfferDeclined(let _data): + return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("price", ConstructorParameterDescription(_data.price))]) + case .messageActionStarGiftUnique(let _data): + return ("messageActionStarGiftUnique", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("canExportAt", ConstructorParameterDescription(_data.canExportAt)), ("transferStars", ConstructorParameterDescription(_data.transferStars)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("peer", ConstructorParameterDescription(_data.peer)), ("savedId", ConstructorParameterDescription(_data.savedId)), ("resaleAmount", ConstructorParameterDescription(_data.resaleAmount)), ("canTransferAt", ConstructorParameterDescription(_data.canTransferAt)), ("canResellAt", ConstructorParameterDescription(_data.canResellAt)), ("dropOriginalDetailsStars", ConstructorParameterDescription(_data.dropOriginalDetailsStars)), ("canCraftAt", ConstructorParameterDescription(_data.canCraftAt))]) + case .messageActionSuggestBirthday(let _data): + return ("messageActionSuggestBirthday", [("birthday", ConstructorParameterDescription(_data.birthday))]) + case .messageActionSuggestProfilePhoto(let _data): + return ("messageActionSuggestProfilePhoto", [("photo", ConstructorParameterDescription(_data.photo))]) + case .messageActionSuggestedPostApproval(let _data): + return ("messageActionSuggestedPostApproval", [("flags", ConstructorParameterDescription(_data.flags)), ("rejectComment", ConstructorParameterDescription(_data.rejectComment)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate)), ("price", ConstructorParameterDescription(_data.price))]) + case .messageActionSuggestedPostRefund(let _data): + return ("messageActionSuggestedPostRefund", [("flags", ConstructorParameterDescription(_data.flags))]) + case .messageActionSuggestedPostSuccess(let _data): + return ("messageActionSuggestedPostSuccess", [("price", ConstructorParameterDescription(_data.price))]) + case .messageActionTodoAppendTasks(let _data): + return ("messageActionTodoAppendTasks", [("list", ConstructorParameterDescription(_data.list))]) + case .messageActionTodoCompletions(let _data): + return ("messageActionTodoCompletions", [("completed", ConstructorParameterDescription(_data.completed)), ("incompleted", ConstructorParameterDescription(_data.incompleted))]) + case .messageActionTopicCreate(let _data): + return ("messageActionTopicCreate", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("iconColor", ConstructorParameterDescription(_data.iconColor)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId))]) + case .messageActionTopicEdit(let _data): + return ("messageActionTopicEdit", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId)), ("closed", ConstructorParameterDescription(_data.closed)), ("hidden", ConstructorParameterDescription(_data.hidden))]) + case .messageActionWebViewDataSent(let _data): + return ("messageActionWebViewDataSent", [("text", ConstructorParameterDescription(_data.text))]) + case .messageActionWebViewDataSentMe(let _data): + return ("messageActionWebViewDataSentMe", [("text", ConstructorParameterDescription(_data.text)), ("data", ConstructorParameterDescription(_data.data))]) } } - public static func parse_messageMediaContact(_ reader: BufferReader) -> MessageMedia? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: Int64? - _5 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageMedia.messageMediaContact(Cons_messageMediaContact(phoneNumber: _1!, firstName: _2!, lastName: _3!, vcard: _4!, userId: _5!)) - } - else { - return nil - } - } - public static func parse_messageMediaDice(_ reader: BufferReader) -> MessageMedia? { + public static func parse_messageActionBoostApply(_ reader: BufferReader) -> MessageAction? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - var _4: Api.messages.EmojiGameOutcome? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageMedia.messageMediaDice(Cons_messageMediaDice(flags: _1!, value: _2!, emoticon: _3!, gameOutcome: _4)) - } - else { - return nil - } - } - public static func parse_messageMediaDocument(_ reader: BufferReader) -> MessageMedia? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Document? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 9) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Photo - } - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _6 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageMedia.messageMediaDocument(Cons_messageMediaDocument(flags: _1!, document: _2, altDocuments: _3, videoCover: _4, videoTimestamp: _5, ttlSeconds: _6)) - } - else { - return nil - } - } - public static func parse_messageMediaEmpty(_ reader: BufferReader) -> MessageMedia? { - return Api.MessageMedia.messageMediaEmpty - } - public static func parse_messageMediaGame(_ reader: BufferReader) -> MessageMedia? { - var _1: Api.Game? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Game - } let _c1 = _1 != nil if _c1 { - return Api.MessageMedia.messageMediaGame(Cons_messageMediaGame(game: _1!)) + return Api.MessageAction.messageActionBoostApply(Cons_messageActionBoostApply(boosts: _1!)) } else { return nil } } - public static func parse_messageMediaGeo(_ reader: BufferReader) -> MessageMedia? { - var _1: Api.GeoPoint? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.GeoPoint - } - let _c1 = _1 != nil - if _c1 { - return Api.MessageMedia.messageMediaGeo(Cons_messageMediaGeo(geo: _1!)) - } - else { - return nil - } - } - public static func parse_messageMediaGeoLive(_ reader: BufferReader) -> MessageMedia? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.GeoPoint? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.GeoPoint - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.MessageMedia.messageMediaGeoLive(Cons_messageMediaGeoLive(flags: _1!, geo: _2!, heading: _3, period: _4!, proximityNotificationRadius: _5)) - } - else { - return nil - } - } - public static func parse_messageMediaGiveaway(_ reader: BufferReader) -> MessageMedia? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Int64]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - var _3: [String]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _4 = parseString(reader) - } - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _6 = reader.readInt32() - } - var _7: Int64? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _7 = reader.readInt64() - } - var _8: Int32? - _8 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_messageMediaGiveawayResults(_ reader: BufferReader) -> MessageMedia? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - var _7: [Int64]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - var _8: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _8 = reader.readInt32() - } - var _9: Int64? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _9 = reader.readInt64() - } - var _10: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _10 = parseString(reader) - } - var _11: Int32? - _11 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & 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(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 - } - } - public static func parse_messageMediaInvoice(_ reader: BufferReader) -> MessageMedia? { + public static func parse_messageActionBotAllowed(_ reader: BufferReader) -> MessageAction? { var _1: Int32? _1 = reader.readInt32() var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: Api.WebDocument? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.WebDocument - } + _2 = parseString(reader) } - var _5: Int32? + var _3: Api.BotApp? if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _5 = reader.readInt32() - } - var _6: String? - _6 = parseString(reader) - var _7: Int64? - _7 = reader.readInt64() - var _8: String? - _8 = parseString(reader) - var _9: Api.MessageExtendedMedia? - if Int(_1 ?? 0) & 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 - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 - } - } - public static func parse_messageMediaPaidMedia(_ reader: BufferReader) -> MessageMedia? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.MessageExtendedMedia]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageExtendedMedia.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageMedia.messageMediaPaidMedia(Cons_messageMediaPaidMedia(starsAmount: _1!, extendedMedia: _2!)) - } - else { - return nil - } - } - public static func parse_messageMediaPhoto(_ reader: BufferReader) -> MessageMedia? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Photo? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Photo - } - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = reader.readInt32() - } - var _4: Api.Document? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Document + _3 = Api.parse(reader, signature: signature) as? Api.BotApp } } let _c1 = _1 != nil let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageMedia.messageMediaPhoto(Cons_messageMediaPhoto(flags: _1!, photo: _2, ttlSeconds: _3, video: _4)) + if _c1 && _c2 && _c3 { + return Api.MessageAction.messageActionBotAllowed(Cons_messageActionBotAllowed(flags: _1!, domain: _2, app: _3)) } else { return nil } } - public static func parse_messageMediaPoll(_ reader: BufferReader) -> MessageMedia? { + public static func parse_messageActionChangeCreator(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChangeCreator(Cons_messageActionChangeCreator(newCreatorId: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionChannelCreate(_ reader: BufferReader) -> MessageAction? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChannelCreate(Cons_messageActionChannelCreate(title: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionChannelMigrateFrom(_ reader: BufferReader) -> MessageAction? { + var _1: String? + _1 = parseString(reader) + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionChannelMigrateFrom(Cons_messageActionChannelMigrateFrom(title: _1!, chatId: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionChatAddUser(_ reader: BufferReader) -> MessageAction? { + var _1: [Int64]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChatAddUser(Cons_messageActionChatAddUser(users: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionChatCreate(_ reader: BufferReader) -> MessageAction? { + var _1: String? + _1 = parseString(reader) + var _2: [Int64]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionChatCreate(Cons_messageActionChatCreate(title: _1!, users: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionChatDeletePhoto(_ reader: BufferReader) -> MessageAction? { + return Api.MessageAction.messageActionChatDeletePhoto + } + public static func parse_messageActionChatDeleteUser(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChatDeleteUser(Cons_messageActionChatDeleteUser(userId: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionChatEditPhoto(_ reader: BufferReader) -> MessageAction? { + var _1: Api.Photo? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Photo + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChatEditPhoto(Cons_messageActionChatEditPhoto(photo: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionChatEditTitle(_ reader: BufferReader) -> MessageAction? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChatEditTitle(Cons_messageActionChatEditTitle(title: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionChatJoinedByLink(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChatJoinedByLink(Cons_messageActionChatJoinedByLink(inviterId: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionChatJoinedByRequest(_ reader: BufferReader) -> MessageAction? { + return Api.MessageAction.messageActionChatJoinedByRequest + } + public static func parse_messageActionChatMigrateTo(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionChatMigrateTo(Cons_messageActionChatMigrateTo(channelId: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionConferenceCall(_ reader: BufferReader) -> MessageAction? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.Poll? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Poll + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt32() } - var _3: Api.PollResults? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PollResults - } - var _4: Api.MessageMedia? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.MessageMedia + var _4: [Api.Peer]? + if Int(_1 ?? 0) & 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 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessageMedia.messageMediaPoll(Cons_messageMediaPoll(flags: _1!, poll: _2!, results: _3!, attachedMedia: _4)) + return Api.MessageAction.messageActionConferenceCall(Cons_messageActionConferenceCall(flags: _1!, callId: _2!, duration: _3, otherParticipants: _4)) } else { return nil } } - public static func parse_messageMediaStory(_ reader: BufferReader) -> MessageMedia? { - var _1: Int32? - _1 = reader.readInt32() + public static func parse_messageActionContactSignUp(_ reader: BufferReader) -> MessageAction? { + return Api.MessageAction.messageActionContactSignUp + } + public static func parse_messageActionCustomAction(_ reader: BufferReader) -> MessageAction? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionCustomAction(Cons_messageActionCustomAction(message: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionEmpty(_ reader: BufferReader) -> MessageAction? { + return Api.MessageAction.messageActionEmpty + } + public static func parse_messageActionGameScore(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionGameScore(Cons_messageActionGameScore(gameId: _1!, score: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionGeoProximityReached(_ reader: BufferReader) -> MessageAction? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } var _2: Api.Peer? if let signature = reader.readInt32() { _2 = Api.parse(reader, signature: signature) as? Api.Peer } var _3: Int32? _3 = reader.readInt32() - var _4: Api.StoryItem? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageAction.messageActionGeoProximityReached(Cons_messageActionGeoProximityReached(fromId: _1!, toId: _2!, distance: _3!)) + } + else { + return nil + } + } + public static func parse_messageActionGiftCode(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StoryItem + _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 ?? 0) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } + var _6: Int64? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _6 = reader.readInt64() + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } + var _8: Int64? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _8 = reader.readInt64() + } + var _9: Api.TextWithEntities? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 + } + } + public static func parse_messageActionGiftPremium(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } + var _6: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = reader.readInt64() + } + var _7: Api.TextWithEntities? + if Int(_1 ?? 0) & 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 - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageMedia.messageMediaStory(Cons_messageMediaStory(flags: _1!, peer: _2!, id: _3!, story: _4)) + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.MessageAction.messageActionGiftPremium(Cons_messageActionGiftPremium(flags: _1!, currency: _2!, amount: _3!, days: _4!, cryptoCurrency: _5, cryptoAmount: _6, message: _7)) } else { return nil } } - public static func parse_messageMediaToDo(_ reader: BufferReader) -> MessageMedia? { + public static func parse_messageActionGiftStars(_ reader: BufferReader) -> MessageAction? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.TodoList? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TodoList - } - var _3: [Api.TodoCompletion]? + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: Int64? + _4 = reader.readInt64() + var _5: String? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoCompletion.self) - } + _5 = parseString(reader) + } + var _6: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = reader.readInt64() + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _7 = parseString(reader) } let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageMedia.messageMediaToDo(Cons_messageMediaToDo(flags: _1!, todo: _2!, completions: _3)) + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.MessageAction.messageActionGiftStars(Cons_messageActionGiftStars(flags: _1!, currency: _2!, amount: _3!, stars: _4!, cryptoCurrency: _5, cryptoAmount: _6, transactionId: _7)) } else { return nil } } - public static func parse_messageMediaUnsupported(_ reader: BufferReader) -> MessageMedia? { - return Api.MessageMedia.messageMediaUnsupported - } - public static func parse_messageMediaVenue(_ reader: BufferReader) -> MessageMedia? { - var _1: Api.GeoPoint? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.GeoPoint - } + public static func parse_messageActionGiftTon(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() var _2: String? _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() var _4: String? _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) + var _5: Int64? + _5 = reader.readInt64() var _6: String? - _6 = parseString(reader) + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = _5 != nil - let _c6 = _6 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MessageMedia.messageMediaVenue(Cons_messageMediaVenue(geo: _1!, title: _2!, address: _3!, provider: _4!, venueId: _5!, venueType: _6!)) + return Api.MessageAction.messageActionGiftTon(Cons_messageActionGiftTon(flags: _1!, currency: _2!, amount: _3!, cryptoCurrency: _4!, cryptoAmount: _5!, transactionId: _6)) } else { return nil } } - public static func parse_messageMediaVideoStream(_ reader: BufferReader) -> MessageMedia? { + public static func parse_messageActionGiveawayLaunch(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionGiveawayLaunch(Cons_messageActionGiveawayLaunch(flags: _1!, stars: _2)) + } + else { + return nil + } + } + public static func parse_messageActionGiveawayResults(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageAction.messageActionGiveawayResults(Cons_messageActionGiveawayResults(flags: _1!, winnersCount: _2!, unclaimedCount: _3!)) + } + else { + return nil + } + } + public static func parse_messageActionGroupCall(_ reader: BufferReader) -> MessageAction? { var _1: Int32? _1 = reader.readInt32() var _2: Api.InputGroupCall? if let signature = reader.readInt32() { _2 = Api.parse(reader, signature: signature) as? Api.InputGroupCall } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageMedia.messageMediaVideoStream(Cons_messageMediaVideoStream(flags: _1!, call: _2!)) + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageAction.messageActionGroupCall(Cons_messageActionGroupCall(flags: _1!, call: _2!, duration: _3)) } else { return nil } } - public static func parse_messageMediaWebPage(_ reader: BufferReader) -> MessageMedia? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.WebPage? + public static func parse_messageActionGroupCallScheduled(_ reader: BufferReader) -> MessageAction? { + var _1: Api.InputGroupCall? if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.WebPage + _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionGroupCallScheduled(Cons_messageActionGroupCallScheduled(call: _1!, scheduleDate: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionHistoryClear(_ reader: BufferReader) -> MessageAction? { + return Api.MessageAction.messageActionHistoryClear + } + public static func parse_messageActionInviteToGroupCall(_ reader: BufferReader) -> MessageAction? { + var _1: Api.InputGroupCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + var _2: [Int64]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.MessageMedia.messageMediaWebPage(Cons_messageMediaWebPage(flags: _1!, webpage: _2!)) + return Api.MessageAction.messageActionInviteToGroupCall(Cons_messageActionInviteToGroupCall(call: _1!, users: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionManagedBotCreated(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionManagedBotCreated(Cons_messageActionManagedBotCreated(botId: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionNewCreatorPending(_ reader: BufferReader) -> MessageAction? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionNewCreatorPending(Cons_messageActionNewCreatorPending(newCreatorId: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionNoForwardsRequest(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Bool? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + var _3: Api.Bool? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageAction.messageActionNoForwardsRequest(Cons_messageActionNoForwardsRequest(flags: _1!, prevValue: _2!, newValue: _3!)) + } + else { + return nil + } + } + public static func parse_messageActionNoForwardsToggle(_ reader: BufferReader) -> MessageAction? { + var _1: Api.Bool? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Bool + } + var _2: Api.Bool? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionNoForwardsToggle(Cons_messageActionNoForwardsToggle(prevValue: _1!, newValue: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionPaidMessagesPrice(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionPaidMessagesPrice(Cons_messageActionPaidMessagesPrice(flags: _1!, stars: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionPaidMessagesRefunded(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionPaidMessagesRefunded(Cons_messageActionPaidMessagesRefunded(count: _1!, stars: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionPaymentRefunded(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: String? + _3 = parseString(reader) + var _4: Int64? + _4 = reader.readInt64() + var _5: Buffer? + if Int(_1 ?? 0) & 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 + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.MessageAction.messageActionPaymentRefunded(Cons_messageActionPaymentRefunded(flags: _1!, peer: _2!, currency: _3!, totalAmount: _4!, payload: _5, charge: _6!)) + } + else { + return nil + } + } + public static func parse_messageActionPaymentSent(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.MessageAction.messageActionPaymentSent(Cons_messageActionPaymentSent(flags: _1!, currency: _2!, totalAmount: _3!, invoiceSlug: _4, subscriptionUntilDate: _5)) + } + else { + return nil + } + } + public static func parse_messageActionPaymentSentMe(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: Buffer? + _4 = parseBytes(reader) + var _5: Api.PaymentRequestedInfo? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } + var _6: String? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_messageActionPhoneCall(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.PhoneCallDiscardReason? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason + } + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageAction.messageActionPhoneCall(Cons_messageActionPhoneCall(flags: _1!, callId: _2!, reason: _3, duration: _4)) + } + else { + return nil + } + } + public static func parse_messageActionPinMessage(_ reader: BufferReader) -> MessageAction? { + return Api.MessageAction.messageActionPinMessage + } + public static func parse_messageActionPollAppendAnswer(_ reader: BufferReader) -> MessageAction? { + var _1: Api.PollAnswer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PollAnswer + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionPollAppendAnswer(Cons_messageActionPollAppendAnswer(answer: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionPollDeleteAnswer(_ reader: BufferReader) -> MessageAction? { + var _1: Api.PollAnswer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PollAnswer + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionPollDeleteAnswer(Cons_messageActionPollDeleteAnswer(answer: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionPrizeStars(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: Api.Peer? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.MessageAction.messageActionPrizeStars(Cons_messageActionPrizeStars(flags: _1!, stars: _2!, transactionId: _3!, boostPeer: _4!, giveawayMsgId: _5!)) + } + else { + return nil + } + } + public static func parse_messageActionRequestedPeer(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Peer]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionRequestedPeer(Cons_messageActionRequestedPeer(buttonId: _1!, peers: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionRequestedPeerSentMe(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.RequestedPeer]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RequestedPeer.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionRequestedPeerSentMe(Cons_messageActionRequestedPeerSentMe(buttonId: _1!, peers: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionScreenshotTaken(_ reader: BufferReader) -> MessageAction? { + return Api.MessageAction.messageActionScreenshotTaken + } + public static func parse_messageActionSecureValuesSent(_ reader: BufferReader) -> MessageAction? { + var _1: [Api.SecureValueType]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValueType.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionSecureValuesSent(Cons_messageActionSecureValuesSent(types: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionSecureValuesSentMe(_ reader: BufferReader) -> MessageAction? { + var _1: [Api.SecureValue]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) + } + var _2: Api.SecureCredentialsEncrypted? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.SecureCredentialsEncrypted + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionSecureValuesSentMe(Cons_messageActionSecureValuesSentMe(values: _1!, credentials: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionSetChatTheme(_ reader: BufferReader) -> MessageAction? { + var _1: Api.ChatTheme? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.ChatTheme + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionSetChatTheme(Cons_messageActionSetChatTheme(theme: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionSetChatWallPaper(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.WallPaper? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.WallPaper + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionSetChatWallPaper(Cons_messageActionSetChatWallPaper(flags: _1!, wallpaper: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionSetMessagesTTL(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt64() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageAction.messageActionSetMessagesTTL(Cons_messageActionSetMessagesTTL(flags: _1!, period: _2!, autoSettingFrom: _3)) + } + else { + return nil + } + } + public static func parse_messageActionStarGift(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StarGift? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _3: Api.TextWithEntities? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _5 = reader.readInt32() + } + var _6: Int64? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _6 = reader.readInt64() + } + var _7: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 12) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _9: Int64? + if Int(_1 ?? 0) & Int(1 << 12) != 0 { + _9 = reader.readInt64() + } + var _10: String? + if Int(_1 ?? 0) & Int(1 << 14) != 0 { + _10 = parseString(reader) + } + var _11: Int32? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + _11 = reader.readInt32() + } + var _12: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _13: Int32? + if Int(_1 ?? 0) & Int(1 << 19) != 0 { + _13 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _13 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { + 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 + } + } + public static func parse_messageActionStarGiftPurchaseOffer(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StarGift? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _3: Api.StarsAmount? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageAction.messageActionStarGiftPurchaseOffer(Cons_messageActionStarGiftPurchaseOffer(flags: _1!, gift: _2!, price: _3!, expiresAt: _4!)) + } + else { + return nil + } + } + public static func parse_messageActionStarGiftPurchaseOfferDeclined(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StarGift? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _3: Api.StarsAmount? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageAction.messageActionStarGiftPurchaseOfferDeclined(Cons_messageActionStarGiftPurchaseOfferDeclined(flags: _1!, gift: _2!, price: _3!)) + } + else { + return nil + } + } + public static func parse_messageActionStarGiftUnique(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StarGift? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } + var _5: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _7: Int64? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + _7 = reader.readInt64() + } + var _8: Api.StarsAmount? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } + var _9: Int32? + if Int(_1 ?? 0) & Int(1 << 9) != 0 { + _9 = reader.readInt32() + } + var _10: Int32? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + _10 = reader.readInt32() + } + var _11: Int64? + if Int(_1 ?? 0) & Int(1 << 12) != 0 { + _11 = reader.readInt64() + } + var _12: Int32? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + _12 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _12 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { + 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 + } + } + public static func parse_messageActionSuggestBirthday(_ reader: BufferReader) -> MessageAction? { + var _1: Api.Birthday? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Birthday + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionSuggestBirthday(Cons_messageActionSuggestBirthday(birthday: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionSuggestProfilePhoto(_ reader: BufferReader) -> MessageAction? { + var _1: Api.Photo? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Photo + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionSuggestProfilePhoto(Cons_messageActionSuggestProfilePhoto(photo: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionSuggestedPostApproval(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _2 = parseString(reader) + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } + var _4: Api.StarsAmount? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageAction.messageActionSuggestedPostApproval(Cons_messageActionSuggestedPostApproval(flags: _1!, rejectComment: _2, scheduleDate: _3, price: _4)) + } + else { + return nil + } + } + public static func parse_messageActionSuggestedPostRefund(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionSuggestedPostRefund(Cons_messageActionSuggestedPostRefund(flags: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionSuggestedPostSuccess(_ reader: BufferReader) -> MessageAction? { + var _1: Api.StarsAmount? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionSuggestedPostSuccess(Cons_messageActionSuggestedPostSuccess(price: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionTodoAppendTasks(_ reader: BufferReader) -> MessageAction? { + var _1: [Api.TodoItem]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoItem.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionTodoAppendTasks(Cons_messageActionTodoAppendTasks(list: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionTodoCompletions(_ reader: BufferReader) -> MessageAction? { + var _1: [Int32]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _2: [Int32]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionTodoCompletions(Cons_messageActionTodoCompletions(completed: _1!, incompleted: _2!)) + } + else { + return nil + } + } + public static func parse_messageActionTopicCreate(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int32? + _3 = reader.readInt32() + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageAction.messageActionTopicCreate(Cons_messageActionTopicCreate(flags: _1!, title: _2!, iconColor: _3!, iconEmojiId: _4)) + } + else { + return nil + } + } + public static func parse_messageActionTopicEdit(_ reader: BufferReader) -> MessageAction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + var _3: Int64? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt64() + } + var _4: Api.Bool? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.MessageAction.messageActionTopicEdit(Cons_messageActionTopicEdit(flags: _1!, title: _2, iconEmojiId: _3, closed: _4, hidden: _5)) + } + else { + return nil + } + } + public static func parse_messageActionWebViewDataSent(_ reader: BufferReader) -> MessageAction? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.MessageAction.messageActionWebViewDataSent(Cons_messageActionWebViewDataSent(text: _1!)) + } + else { + return nil + } + } + public static func parse_messageActionWebViewDataSentMe(_ reader: BufferReader) -> MessageAction? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageAction.messageActionWebViewDataSentMe(Cons_messageActionWebViewDataSentMe(text: _1!, data: _2!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api17.swift b/submodules/TelegramApi/Sources/Api17.swift index f371ca3819..bf75b3d074 100644 --- a/submodules/TelegramApi/Sources/Api17.swift +++ b/submodules/TelegramApi/Sources/Api17.swift @@ -1,44 +1,2173 @@ public extension Api { - enum MessagePeerReaction: TypeConstructorDescription { - public class Cons_messagePeerReaction: TypeConstructorDescription { - 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 + indirect enum MessageEntity: TypeConstructorDescription { + public class Cons_inputMessageEntityMentionName: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messagePeerReaction", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.date)), ("reaction", ConstructorParameterDescription(self.reaction))]) + return ("inputMessageEntityMentionName", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("userId", ConstructorParameterDescription(self.userId))]) } } - case messagePeerReaction(Cons_messagePeerReaction) + public class Cons_messageEntityBankCard: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityBankCard", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityBlockquote: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityBlockquote", [("flags", ConstructorParameterDescription(self.flags)), ("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityBold: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityBold", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityBotCommand: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityBotCommand", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityCashtag: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityCashtag", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityCode: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityCode", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityCustomEmoji: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityCustomEmoji", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("documentId", ConstructorParameterDescription(self.documentId))]) + } + } + public class Cons_messageEntityDiffDelete: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityDiffDelete", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityDiffInsert: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityDiffInsert", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityDiffReplace: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public var oldText: String + public init(offset: Int32, length: Int32, oldText: String) { + self.offset = offset + self.length = length + self.oldText = oldText + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityDiffReplace", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("oldText", ConstructorParameterDescription(self.oldText))]) + } + } + public class Cons_messageEntityEmail: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityEmail", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityFormattedDate: TypeConstructorDescription { + public var flags: Int32 + public var offset: Int32 + public var length: Int32 + public var date: Int32 + public init(flags: Int32, offset: Int32, length: Int32, date: Int32) { + self.flags = flags + self.offset = offset + self.length = length + self.date = date + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityFormattedDate", [("flags", ConstructorParameterDescription(self.flags)), ("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("date", ConstructorParameterDescription(self.date))]) + } + } + public class Cons_messageEntityHashtag: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityHashtag", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityItalic: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityItalic", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityMention: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityMention", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityMentionName: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityMentionName", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("userId", ConstructorParameterDescription(self.userId))]) + } + } + public class Cons_messageEntityPhone: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityPhone", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityPre: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityPre", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("language", ConstructorParameterDescription(self.language))]) + } + } + public class Cons_messageEntitySpoiler: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntitySpoiler", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityStrike: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityStrike", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityTextUrl: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityTextUrl", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length)), ("url", ConstructorParameterDescription(self.url))]) + } + } + public class Cons_messageEntityUnderline: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityUnderline", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityUnknown: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityUnknown", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_messageEntityUrl: TypeConstructorDescription { + public var offset: Int32 + public var length: Int32 + public init(offset: Int32, length: Int32) { + self.offset = offset + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityUrl", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.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 messageEntityDiffDelete(Cons_messageEntityDiffDelete) + case messageEntityDiffInsert(Cons_messageEntityDiffInsert) + case messageEntityDiffReplace(Cons_messageEntityDiffReplace) + case messageEntityEmail(Cons_messageEntityEmail) + case messageEntityFormattedDate(Cons_messageEntityFormattedDate) + 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 .messagePeerReaction(let _data): + case .inputMessageEntityMentionName(let _data): if boxed { - buffer.appendInt32(-1938180548) + 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) - _data.peerId.serialize(buffer, true) + 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 .messageEntityDiffDelete(let _data): + if boxed { + buffer.appendInt32(106086853) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityDiffInsert(let _data): + if boxed { + buffer.appendInt32(1903653142) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + break + case .messageEntityDiffReplace(let _data): + if boxed { + buffer.appendInt32(-960371289) + } + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) + serializeString(_data.oldText, 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 .messageEntityFormattedDate(let _data): + if boxed { + buffer.appendInt32(-1874147385) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.offset, buffer: buffer, boxed: false) + serializeInt32(_data.length, buffer: buffer, boxed: false) serializeInt32(_data.date, buffer: buffer, boxed: false) - _data.reaction.serialize(buffer, true) + 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, ConstructorParameterDescription)]) { switch self { - case .messagePeerReaction(let _data): - return ("messagePeerReaction", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) + case .inputMessageEntityMentionName(let _data): + return ("inputMessageEntityMentionName", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("userId", ConstructorParameterDescription(_data.userId))]) + case .messageEntityBankCard(let _data): + return ("messageEntityBankCard", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityBlockquote(let _data): + return ("messageEntityBlockquote", [("flags", ConstructorParameterDescription(_data.flags)), ("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityBold(let _data): + return ("messageEntityBold", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityBotCommand(let _data): + return ("messageEntityBotCommand", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityCashtag(let _data): + return ("messageEntityCashtag", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityCode(let _data): + return ("messageEntityCode", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityCustomEmoji(let _data): + return ("messageEntityCustomEmoji", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("documentId", ConstructorParameterDescription(_data.documentId))]) + case .messageEntityDiffDelete(let _data): + return ("messageEntityDiffDelete", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityDiffInsert(let _data): + return ("messageEntityDiffInsert", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityDiffReplace(let _data): + return ("messageEntityDiffReplace", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("oldText", ConstructorParameterDescription(_data.oldText))]) + case .messageEntityEmail(let _data): + return ("messageEntityEmail", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityFormattedDate(let _data): + return ("messageEntityFormattedDate", [("flags", ConstructorParameterDescription(_data.flags)), ("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("date", ConstructorParameterDescription(_data.date))]) + case .messageEntityHashtag(let _data): + return ("messageEntityHashtag", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityItalic(let _data): + return ("messageEntityItalic", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityMention(let _data): + return ("messageEntityMention", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityMentionName(let _data): + return ("messageEntityMentionName", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("userId", ConstructorParameterDescription(_data.userId))]) + case .messageEntityPhone(let _data): + return ("messageEntityPhone", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityPre(let _data): + return ("messageEntityPre", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("language", ConstructorParameterDescription(_data.language))]) + case .messageEntitySpoiler(let _data): + return ("messageEntitySpoiler", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityStrike(let _data): + return ("messageEntityStrike", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityTextUrl(let _data): + return ("messageEntityTextUrl", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("url", ConstructorParameterDescription(_data.url))]) + case .messageEntityUnderline(let _data): + return ("messageEntityUnderline", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityUnknown(let _data): + return ("messageEntityUnknown", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) + case .messageEntityUrl(let _data): + return ("messageEntityUrl", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) } } - public static func parse_messagePeerReaction(_ reader: BufferReader) -> MessagePeerReaction? { + public static func parse_inputMessageEntityMentionName(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.InputUser? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputUser + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageEntity.inputMessageEntityMentionName(Cons_inputMessageEntityMentionName(offset: _1!, length: _2!, userId: _3!)) + } + else { + return nil + } + } + public static func parse_messageEntityBankCard(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityBankCard(Cons_messageEntityBankCard(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityBlockquote(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageEntity.messageEntityBlockquote(Cons_messageEntityBlockquote(flags: _1!, offset: _2!, length: _3!)) + } + else { + return nil + } + } + public static func parse_messageEntityBold(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityBold(Cons_messageEntityBold(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityBotCommand(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityBotCommand(Cons_messageEntityBotCommand(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityCashtag(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityCashtag(Cons_messageEntityCashtag(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityCode(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityCode(Cons_messageEntityCode(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityCustomEmoji(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageEntity.messageEntityCustomEmoji(Cons_messageEntityCustomEmoji(offset: _1!, length: _2!, documentId: _3!)) + } + else { + return nil + } + } + public static func parse_messageEntityDiffDelete(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityDiffDelete(Cons_messageEntityDiffDelete(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityDiffInsert(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityDiffInsert(Cons_messageEntityDiffInsert(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityDiffReplace(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageEntity.messageEntityDiffReplace(Cons_messageEntityDiffReplace(offset: _1!, length: _2!, oldText: _3!)) + } + else { + return nil + } + } + public static func parse_messageEntityEmail(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityEmail(Cons_messageEntityEmail(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityFormattedDate(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageEntity.messageEntityFormattedDate(Cons_messageEntityFormattedDate(flags: _1!, offset: _2!, length: _3!, date: _4!)) + } + else { + return nil + } + } + public static func parse_messageEntityHashtag(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityHashtag(Cons_messageEntityHashtag(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityItalic(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityItalic(Cons_messageEntityItalic(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityMention(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityMention(Cons_messageEntityMention(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityMentionName(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageEntity.messageEntityMentionName(Cons_messageEntityMentionName(offset: _1!, length: _2!, userId: _3!)) + } + else { + return nil + } + } + public static func parse_messageEntityPhone(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityPhone(Cons_messageEntityPhone(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityPre(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageEntity.messageEntityPre(Cons_messageEntityPre(offset: _1!, length: _2!, language: _3!)) + } + else { + return nil + } + } + public static func parse_messageEntitySpoiler(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntitySpoiler(Cons_messageEntitySpoiler(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityStrike(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityStrike(Cons_messageEntityStrike(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityTextUrl(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageEntity.messageEntityTextUrl(Cons_messageEntityTextUrl(offset: _1!, length: _2!, url: _3!)) + } + else { + return nil + } + } + public static func parse_messageEntityUnderline(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityUnderline(Cons_messageEntityUnderline(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityUnknown(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityUnknown(Cons_messageEntityUnknown(offset: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_messageEntityUrl(_ reader: BufferReader) -> MessageEntity? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageEntity.messageEntityUrl(Cons_messageEntityUrl(offset: _1!, length: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum MessageExtendedMedia: TypeConstructorDescription { + public class Cons_messageExtendedMedia: TypeConstructorDescription { + public var media: Api.MessageMedia + public init(media: Api.MessageMedia) { + self.media = media + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageExtendedMedia", [("media", ConstructorParameterDescription(self.media))]) + } + } + public class Cons_messageExtendedMediaPreview: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageExtendedMediaPreview", [("flags", ConstructorParameterDescription(self.flags)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("thumb", ConstructorParameterDescription(self.thumb)), ("videoDuration", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .messageExtendedMedia(let _data): + return ("messageExtendedMedia", [("media", ConstructorParameterDescription(_data.media))]) + case .messageExtendedMediaPreview(let _data): + return ("messageExtendedMediaPreview", [("flags", ConstructorParameterDescription(_data.flags)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("thumb", ConstructorParameterDescription(_data.thumb)), ("videoDuration", ConstructorParameterDescription(_data.videoDuration))]) + } + } + + public static func parse_messageExtendedMedia(_ reader: BufferReader) -> MessageExtendedMedia? { + var _1: Api.MessageMedia? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageExtendedMedia.messageExtendedMedia(Cons_messageExtendedMedia(media: _1!)) + } + else { + return nil + } + } + public static func parse_messageExtendedMediaPreview(_ reader: BufferReader) -> MessageExtendedMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: Api.PhotoSize? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.PhotoSize + } + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_messageFwdHeader: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageFwdHeader", [("flags", ConstructorParameterDescription(self.flags)), ("fromId", ConstructorParameterDescription(self.fromId)), ("fromName", ConstructorParameterDescription(self.fromName)), ("date", ConstructorParameterDescription(self.date)), ("channelPost", ConstructorParameterDescription(self.channelPost)), ("postAuthor", ConstructorParameterDescription(self.postAuthor)), ("savedFromPeer", ConstructorParameterDescription(self.savedFromPeer)), ("savedFromMsgId", ConstructorParameterDescription(self.savedFromMsgId)), ("savedFromId", ConstructorParameterDescription(self.savedFromId)), ("savedFromName", ConstructorParameterDescription(self.savedFromName)), ("savedDate", ConstructorParameterDescription(self.savedDate)), ("psaType", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .messageFwdHeader(let _data): + return ("messageFwdHeader", [("flags", ConstructorParameterDescription(_data.flags)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("fromName", ConstructorParameterDescription(_data.fromName)), ("date", ConstructorParameterDescription(_data.date)), ("channelPost", ConstructorParameterDescription(_data.channelPost)), ("postAuthor", ConstructorParameterDescription(_data.postAuthor)), ("savedFromPeer", ConstructorParameterDescription(_data.savedFromPeer)), ("savedFromMsgId", ConstructorParameterDescription(_data.savedFromMsgId)), ("savedFromId", ConstructorParameterDescription(_data.savedFromId)), ("savedFromName", ConstructorParameterDescription(_data.savedFromName)), ("savedDate", ConstructorParameterDescription(_data.savedDate)), ("psaType", ConstructorParameterDescription(_data.psaType))]) + } + } + + public static func parse_messageFwdHeader(_ reader: BufferReader) -> MessageFwdHeader? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _3 = parseString(reader) + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _6 = parseString(reader) + } + var _7: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _8: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } + var _9: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _10: String? + if Int(_1 ?? 0) & Int(1 << 9) != 0 { + _10 = parseString(reader) + } + var _11: Int32? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + _11 = reader.readInt32() + } + var _12: String? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _12 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _12 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { + 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 { + public class Cons_messageMediaContact: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaContact", [("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("vcard", ConstructorParameterDescription(self.vcard)), ("userId", ConstructorParameterDescription(self.userId))]) + } + } + public class Cons_messageMediaDice: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaDice", [("flags", ConstructorParameterDescription(self.flags)), ("value", ConstructorParameterDescription(self.value)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("gameOutcome", ConstructorParameterDescription(self.gameOutcome))]) + } + } + public class Cons_messageMediaDocument: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaDocument", [("flags", ConstructorParameterDescription(self.flags)), ("document", ConstructorParameterDescription(self.document)), ("altDocuments", ConstructorParameterDescription(self.altDocuments)), ("videoCover", ConstructorParameterDescription(self.videoCover)), ("videoTimestamp", ConstructorParameterDescription(self.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds))]) + } + } + public class Cons_messageMediaGame: TypeConstructorDescription { + public var game: Api.Game + public init(game: Api.Game) { + self.game = game + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaGame", [("game", ConstructorParameterDescription(self.game))]) + } + } + public class Cons_messageMediaGeo: TypeConstructorDescription { + public var geo: Api.GeoPoint + public init(geo: Api.GeoPoint) { + self.geo = geo + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaGeo", [("geo", ConstructorParameterDescription(self.geo))]) + } + } + public class Cons_messageMediaGeoLive: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaGeoLive", [("flags", ConstructorParameterDescription(self.flags)), ("geo", ConstructorParameterDescription(self.geo)), ("heading", ConstructorParameterDescription(self.heading)), ("period", ConstructorParameterDescription(self.period)), ("proximityNotificationRadius", ConstructorParameterDescription(self.proximityNotificationRadius))]) + } + } + public class Cons_messageMediaGiveaway: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaGiveaway", [("flags", ConstructorParameterDescription(self.flags)), ("channels", ConstructorParameterDescription(self.channels)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("quantity", ConstructorParameterDescription(self.quantity)), ("months", ConstructorParameterDescription(self.months)), ("stars", ConstructorParameterDescription(self.stars)), ("untilDate", ConstructorParameterDescription(self.untilDate))]) + } + } + public class Cons_messageMediaGiveawayResults: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaGiveawayResults", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("additionalPeersCount", ConstructorParameterDescription(self.additionalPeersCount)), ("launchMsgId", ConstructorParameterDescription(self.launchMsgId)), ("winnersCount", ConstructorParameterDescription(self.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(self.unclaimedCount)), ("winners", ConstructorParameterDescription(self.winners)), ("months", ConstructorParameterDescription(self.months)), ("stars", ConstructorParameterDescription(self.stars)), ("prizeDescription", ConstructorParameterDescription(self.prizeDescription)), ("untilDate", ConstructorParameterDescription(self.untilDate))]) + } + } + public class Cons_messageMediaInvoice: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaInvoice", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("receiptMsgId", ConstructorParameterDescription(self.receiptMsgId)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("startParam", ConstructorParameterDescription(self.startParam)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) + } + } + public class Cons_messageMediaPaidMedia: TypeConstructorDescription { + public var starsAmount: Int64 + public var extendedMedia: [Api.MessageExtendedMedia] + public init(starsAmount: Int64, extendedMedia: [Api.MessageExtendedMedia]) { + self.starsAmount = starsAmount + self.extendedMedia = extendedMedia + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaPaidMedia", [("starsAmount", ConstructorParameterDescription(self.starsAmount)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) + } + } + public class Cons_messageMediaPhoto: TypeConstructorDescription { + public var flags: Int32 + public var photo: Api.Photo? + public var ttlSeconds: Int32? + public var video: Api.Document? + public init(flags: Int32, photo: Api.Photo?, ttlSeconds: Int32?, video: Api.Document?) { + self.flags = flags + self.photo = photo + self.ttlSeconds = ttlSeconds + self.video = video + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photo", ConstructorParameterDescription(self.photo)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds)), ("video", ConstructorParameterDescription(self.video))]) + } + } + public class Cons_messageMediaPoll: TypeConstructorDescription { + public var flags: Int32 + public var poll: Api.Poll + public var results: Api.PollResults + public var attachedMedia: Api.MessageMedia? + public init(flags: Int32, poll: Api.Poll, results: Api.PollResults, attachedMedia: Api.MessageMedia?) { + self.flags = flags + self.poll = poll + self.results = results + self.attachedMedia = attachedMedia + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaPoll", [("flags", ConstructorParameterDescription(self.flags)), ("poll", ConstructorParameterDescription(self.poll)), ("results", ConstructorParameterDescription(self.results)), ("attachedMedia", ConstructorParameterDescription(self.attachedMedia))]) + } + } + public class Cons_messageMediaStory: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaStory", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("id", ConstructorParameterDescription(self.id)), ("story", ConstructorParameterDescription(self.story))]) + } + } + public class Cons_messageMediaToDo: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaToDo", [("flags", ConstructorParameterDescription(self.flags)), ("todo", ConstructorParameterDescription(self.todo)), ("completions", ConstructorParameterDescription(self.completions))]) + } + } + public class Cons_messageMediaVenue: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaVenue", [("geo", ConstructorParameterDescription(self.geo)), ("title", ConstructorParameterDescription(self.title)), ("address", ConstructorParameterDescription(self.address)), ("provider", ConstructorParameterDescription(self.provider)), ("venueId", ConstructorParameterDescription(self.venueId)), ("venueType", ConstructorParameterDescription(self.venueType))]) + } + } + public class Cons_messageMediaVideoStream: TypeConstructorDescription { + public var flags: Int32 + public var call: Api.InputGroupCall + public init(flags: Int32, call: Api.InputGroupCall) { + self.flags = flags + self.call = call + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaVideoStream", [("flags", ConstructorParameterDescription(self.flags)), ("call", ConstructorParameterDescription(self.call))]) + } + } + public class Cons_messageMediaWebPage: TypeConstructorDescription { + public var flags: Int32 + public var webpage: Api.WebPage + public init(flags: Int32, webpage: Api.WebPage) { + self.flags = flags + self.webpage = webpage + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaWebPage", [("flags", ConstructorParameterDescription(self.flags)), ("webpage", ConstructorParameterDescription(self.webpage))]) + } + } + case messageMediaContact(Cons_messageMediaContact) + case messageMediaDice(Cons_messageMediaDice) + case messageMediaDocument(Cons_messageMediaDocument) + case messageMediaEmpty + 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(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(_data.altDocuments!.count)) + for item in _data.altDocuments! { + item.serialize(buffer, true) + } + } + 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(_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(-501814429) + } + 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) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + _data.video!.serialize(buffer, true) + } + break + case .messageMediaPoll(let _data): + if boxed { + buffer.appendInt32(2000637542) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.poll.serialize(buffer, true) + _data.results.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.attachedMedia!.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(_data.completions!.count)) + for item in _data.completions! { + item.serialize(buffer, true) + } + } + 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, ConstructorParameterDescription)]) { + switch self { + case .messageMediaContact(let _data): + return ("messageMediaContact", [("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("vcard", ConstructorParameterDescription(_data.vcard)), ("userId", ConstructorParameterDescription(_data.userId))]) + case .messageMediaDice(let _data): + return ("messageMediaDice", [("flags", ConstructorParameterDescription(_data.flags)), ("value", ConstructorParameterDescription(_data.value)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("gameOutcome", ConstructorParameterDescription(_data.gameOutcome))]) + case .messageMediaDocument(let _data): + return ("messageMediaDocument", [("flags", ConstructorParameterDescription(_data.flags)), ("document", ConstructorParameterDescription(_data.document)), ("altDocuments", ConstructorParameterDescription(_data.altDocuments)), ("videoCover", ConstructorParameterDescription(_data.videoCover)), ("videoTimestamp", ConstructorParameterDescription(_data.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds))]) + case .messageMediaEmpty: + return ("messageMediaEmpty", []) + case .messageMediaGame(let _data): + return ("messageMediaGame", [("game", ConstructorParameterDescription(_data.game))]) + case .messageMediaGeo(let _data): + return ("messageMediaGeo", [("geo", ConstructorParameterDescription(_data.geo))]) + case .messageMediaGeoLive(let _data): + return ("messageMediaGeoLive", [("flags", ConstructorParameterDescription(_data.flags)), ("geo", ConstructorParameterDescription(_data.geo)), ("heading", ConstructorParameterDescription(_data.heading)), ("period", ConstructorParameterDescription(_data.period)), ("proximityNotificationRadius", ConstructorParameterDescription(_data.proximityNotificationRadius))]) + case .messageMediaGiveaway(let _data): + return ("messageMediaGiveaway", [("flags", ConstructorParameterDescription(_data.flags)), ("channels", ConstructorParameterDescription(_data.channels)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("quantity", ConstructorParameterDescription(_data.quantity)), ("months", ConstructorParameterDescription(_data.months)), ("stars", ConstructorParameterDescription(_data.stars)), ("untilDate", ConstructorParameterDescription(_data.untilDate))]) + case .messageMediaGiveawayResults(let _data): + return ("messageMediaGiveawayResults", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("additionalPeersCount", ConstructorParameterDescription(_data.additionalPeersCount)), ("launchMsgId", ConstructorParameterDescription(_data.launchMsgId)), ("winnersCount", ConstructorParameterDescription(_data.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(_data.unclaimedCount)), ("winners", ConstructorParameterDescription(_data.winners)), ("months", ConstructorParameterDescription(_data.months)), ("stars", ConstructorParameterDescription(_data.stars)), ("prizeDescription", ConstructorParameterDescription(_data.prizeDescription)), ("untilDate", ConstructorParameterDescription(_data.untilDate))]) + case .messageMediaInvoice(let _data): + return ("messageMediaInvoice", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("receiptMsgId", ConstructorParameterDescription(_data.receiptMsgId)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("startParam", ConstructorParameterDescription(_data.startParam)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) + case .messageMediaPaidMedia(let _data): + return ("messageMediaPaidMedia", [("starsAmount", ConstructorParameterDescription(_data.starsAmount)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) + case .messageMediaPhoto(let _data): + return ("messageMediaPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photo", ConstructorParameterDescription(_data.photo)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds)), ("video", ConstructorParameterDescription(_data.video))]) + case .messageMediaPoll(let _data): + return ("messageMediaPoll", [("flags", ConstructorParameterDescription(_data.flags)), ("poll", ConstructorParameterDescription(_data.poll)), ("results", ConstructorParameterDescription(_data.results)), ("attachedMedia", ConstructorParameterDescription(_data.attachedMedia))]) + case .messageMediaStory(let _data): + return ("messageMediaStory", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("id", ConstructorParameterDescription(_data.id)), ("story", ConstructorParameterDescription(_data.story))]) + case .messageMediaToDo(let _data): + return ("messageMediaToDo", [("flags", ConstructorParameterDescription(_data.flags)), ("todo", ConstructorParameterDescription(_data.todo)), ("completions", ConstructorParameterDescription(_data.completions))]) + case .messageMediaUnsupported: + return ("messageMediaUnsupported", []) + case .messageMediaVenue(let _data): + return ("messageMediaVenue", [("geo", ConstructorParameterDescription(_data.geo)), ("title", ConstructorParameterDescription(_data.title)), ("address", ConstructorParameterDescription(_data.address)), ("provider", ConstructorParameterDescription(_data.provider)), ("venueId", ConstructorParameterDescription(_data.venueId)), ("venueType", ConstructorParameterDescription(_data.venueType))]) + case .messageMediaVideoStream(let _data): + return ("messageMediaVideoStream", [("flags", ConstructorParameterDescription(_data.flags)), ("call", ConstructorParameterDescription(_data.call))]) + case .messageMediaWebPage(let _data): + return ("messageMediaWebPage", [("flags", ConstructorParameterDescription(_data.flags)), ("webpage", ConstructorParameterDescription(_data.webpage))]) + } + } + + public static func parse_messageMediaContact(_ reader: BufferReader) -> MessageMedia? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: Int64? + _5 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.MessageMedia.messageMediaContact(Cons_messageMediaContact(phoneNumber: _1!, firstName: _2!, lastName: _3!, vcard: _4!, userId: _5!)) + } + else { + return nil + } + } + public static func parse_messageMediaDice(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + var _4: Api.messages.EmojiGameOutcome? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageMedia.messageMediaDice(Cons_messageMediaDice(flags: _1!, value: _2!, emoticon: _3!, gameOutcome: _4)) + } + else { + return nil + } + } + public static func parse_messageMediaDocument(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Document? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Photo + } + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + _5 = reader.readInt32() + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _6 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.MessageMedia.messageMediaDocument(Cons_messageMediaDocument(flags: _1!, document: _2, altDocuments: _3, videoCover: _4, videoTimestamp: _5, ttlSeconds: _6)) + } + else { + return nil + } + } + public static func parse_messageMediaEmpty(_ reader: BufferReader) -> MessageMedia? { + return Api.MessageMedia.messageMediaEmpty + } + public static func parse_messageMediaGame(_ reader: BufferReader) -> MessageMedia? { + var _1: Api.Game? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Game + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageMedia.messageMediaGame(Cons_messageMediaGame(game: _1!)) + } + else { + return nil + } + } + public static func parse_messageMediaGeo(_ reader: BufferReader) -> MessageMedia? { + var _1: Api.GeoPoint? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } + let _c1 = _1 != nil + if _c1 { + return Api.MessageMedia.messageMediaGeo(Cons_messageMediaGeo(geo: _1!)) + } + else { + return nil + } + } + public static func parse_messageMediaGeoLive(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.GeoPoint? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.MessageMedia.messageMediaGeoLive(Cons_messageMediaGeoLive(flags: _1!, geo: _2!, heading: _3, period: _4!, proximityNotificationRadius: _5)) + } + else { + return nil + } + } + public static func parse_messageMediaGiveaway(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Int64]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + var _3: [String]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _4 = parseString(reader) + } + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _6 = reader.readInt32() + } + var _7: Int64? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _7 = reader.readInt64() + } + var _8: Int32? + _8 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_messageMediaGiveawayResults(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: [Int64]? + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + var _8: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } + var _9: Int64? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _9 = reader.readInt64() + } + var _10: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _10 = parseString(reader) + } + var _11: Int32? + _11 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & 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(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 + } + } + public static func parse_messageMediaInvoice(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: Api.WebDocument? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } + var _6: String? + _6 = parseString(reader) + var _7: Int64? + _7 = reader.readInt64() + var _8: String? + _8 = parseString(reader) + var _9: Api.MessageExtendedMedia? + if Int(_1 ?? 0) & 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 + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 + } + } + public static func parse_messageMediaPaidMedia(_ reader: BufferReader) -> MessageMedia? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.MessageExtendedMedia]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageExtendedMedia.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageMedia.messageMediaPaidMedia(Cons_messageMediaPaidMedia(starsAmount: _1!, extendedMedia: _2!)) + } + else { + return nil + } + } + public static func parse_messageMediaPhoto(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Photo? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Photo + } + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } + var _4: Api.Document? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Document + } + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageMedia.messageMediaPhoto(Cons_messageMediaPhoto(flags: _1!, photo: _2, ttlSeconds: _3, video: _4)) + } + else { + return nil + } + } + public static func parse_messageMediaPoll(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Poll? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Poll + } + var _3: Api.PollResults? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PollResults + } + var _4: Api.MessageMedia? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageMedia.messageMediaPoll(Cons_messageMediaPoll(flags: _1!, poll: _2!, results: _3!, attachedMedia: _4)) + } + else { + return nil + } + } + public static func parse_messageMediaStory(_ reader: BufferReader) -> MessageMedia? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? @@ -47,1146 +2176,104 @@ public extension Api { } var _3: Int32? _3 = reader.readInt32() - var _4: Api.Reaction? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Reaction + var _4: Api.StoryItem? + if Int(_1 ?? 0) & 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 = _4 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.MessagePeerReaction.messagePeerReaction(Cons_messagePeerReaction(flags: _1!, peerId: _2!, date: _3!, reaction: _4!)) + return Api.MessageMedia.messageMediaStory(Cons_messageMediaStory(flags: _1!, peer: _2!, id: _3!, story: _4)) } else { return nil } } - } -} -public extension Api { - enum MessagePeerVote: TypeConstructorDescription { - public class Cons_messagePeerVote: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messagePeerVote", [("peer", ConstructorParameterDescription(self.peer)), ("option", ConstructorParameterDescription(self.option)), ("date", ConstructorParameterDescription(self.date))]) - } - } - public class Cons_messagePeerVoteInputOption: TypeConstructorDescription { - public var peer: Api.Peer - public var date: Int32 - public init(peer: Api.Peer, date: Int32) { - self.peer = peer - self.date = date - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messagePeerVoteInputOption", [("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date))]) - } - } - public class Cons_messagePeerVoteMultiple: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messagePeerVoteMultiple", [("peer", ConstructorParameterDescription(self.peer)), ("options", ConstructorParameterDescription(self.options)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messagePeerVote(let _data): - return ("messagePeerVote", [("peer", ConstructorParameterDescription(_data.peer)), ("option", ConstructorParameterDescription(_data.option)), ("date", ConstructorParameterDescription(_data.date))]) - case .messagePeerVoteInputOption(let _data): - return ("messagePeerVoteInputOption", [("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date))]) - case .messagePeerVoteMultiple(let _data): - return ("messagePeerVoteMultiple", [("peer", ConstructorParameterDescription(_data.peer)), ("options", ConstructorParameterDescription(_data.options)), ("date", ConstructorParameterDescription(_data.date))]) - } - } - - public static func parse_messagePeerVote(_ reader: BufferReader) -> MessagePeerVote? { - var _1: Api.Peer? + public static func parse_messageMediaToDo(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.TodoList? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer + _2 = Api.parse(reader, signature: signature) as? Api.TodoList } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessagePeerVote.messagePeerVote(Cons_messagePeerVote(peer: _1!, option: _2!, date: _3!)) - } - else { - return nil - } - } - public static func parse_messagePeerVoteInputOption(_ reader: BufferReader) -> MessagePeerVote? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessagePeerVote.messagePeerVoteInputOption(Cons_messagePeerVoteInputOption(peer: _1!, date: _2!)) - } - else { - return nil - } - } - public static func parse_messagePeerVoteMultiple(_ reader: BufferReader) -> MessagePeerVote? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: [Buffer]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) - } - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessagePeerVote.messagePeerVoteMultiple(Cons_messagePeerVoteMultiple(peer: _1!, options: _2!, date: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum MessageRange: TypeConstructorDescription { - public class Cons_messageRange: TypeConstructorDescription { - public var minId: Int32 - public var maxId: Int32 - public init(minId: Int32, maxId: Int32) { - self.minId = minId - self.maxId = maxId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageRange", [("minId", ConstructorParameterDescription(self.minId)), ("maxId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messageRange(let _data): - return ("messageRange", [("minId", ConstructorParameterDescription(_data.minId)), ("maxId", ConstructorParameterDescription(_data.maxId))]) - } - } - - public static func parse_messageRange(_ reader: BufferReader) -> MessageRange? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageRange.messageRange(Cons_messageRange(minId: _1!, maxId: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum MessageReactions: TypeConstructorDescription { - public class Cons_messageReactions: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageReactions", [("flags", ConstructorParameterDescription(self.flags)), ("results", ConstructorParameterDescription(self.results)), ("recentReactions", ConstructorParameterDescription(self.recentReactions)), ("topReactors", ConstructorParameterDescription(self.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(_data.recentReactions!.count)) - for item in _data.recentReactions! { - item.serialize(buffer, true) - } - } - 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) - } - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .messageReactions(let _data): - return ("messageReactions", [("flags", ConstructorParameterDescription(_data.flags)), ("results", ConstructorParameterDescription(_data.results)), ("recentReactions", ConstructorParameterDescription(_data.recentReactions)), ("topReactors", ConstructorParameterDescription(_data.topReactors))]) - } - } - - public static func parse_messageReactions(_ reader: BufferReader) -> MessageReactions? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.ReactionCount]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) - } - var _3: [Api.MessagePeerReaction]? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.MessageReactions.messageReactions(Cons_messageReactions(flags: _1!, results: _2!, recentReactions: _3, topReactors: _4)) - } - else { - return nil - } - } - } -} -public extension Api { - enum MessageReactor: TypeConstructorDescription { - public class Cons_messageReactor: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageReactor", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messageReactor(let _data): - return ("messageReactor", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("count", ConstructorParameterDescription(_data.count))]) - } - } - - public static func parse_messageReactor(_ reader: BufferReader) -> MessageReactor? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 3) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.MessageReactor.messageReactor(Cons_messageReactor(flags: _1!, peerId: _2, count: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum MessageReplies: TypeConstructorDescription { - public class Cons_messageReplies: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageReplies", [("flags", ConstructorParameterDescription(self.flags)), ("replies", ConstructorParameterDescription(self.replies)), ("repliesPts", ConstructorParameterDescription(self.repliesPts)), ("recentRepliers", ConstructorParameterDescription(self.recentRepliers)), ("channelId", ConstructorParameterDescription(self.channelId)), ("maxId", ConstructorParameterDescription(self.maxId)), ("readMaxId", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .messageReplies(let _data): - return ("messageReplies", [("flags", ConstructorParameterDescription(_data.flags)), ("replies", ConstructorParameterDescription(_data.replies)), ("repliesPts", ConstructorParameterDescription(_data.repliesPts)), ("recentRepliers", ConstructorParameterDescription(_data.recentRepliers)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) - } - } - - public static func parse_messageReplies(_ reader: BufferReader) -> MessageReplies? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: [Api.Peer]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - } - var _5: Int64? + var _3: [Api.TodoCompletion]? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = reader.readInt64() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _6 = reader.readInt32() - } - var _7: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _7 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - 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 { - public class Cons_messageReplyHeader: TypeConstructorDescription { - 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 var pollOption: Buffer? - 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?, pollOption: Buffer?) { - 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 - self.pollOption = pollOption - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageReplyHeader", [("flags", ConstructorParameterDescription(self.flags)), ("replyToMsgId", ConstructorParameterDescription(self.replyToMsgId)), ("replyToPeerId", ConstructorParameterDescription(self.replyToPeerId)), ("replyFrom", ConstructorParameterDescription(self.replyFrom)), ("replyMedia", ConstructorParameterDescription(self.replyMedia)), ("replyToTopId", ConstructorParameterDescription(self.replyToTopId)), ("quoteText", ConstructorParameterDescription(self.quoteText)), ("quoteEntities", ConstructorParameterDescription(self.quoteEntities)), ("quoteOffset", ConstructorParameterDescription(self.quoteOffset)), ("todoItemId", ConstructorParameterDescription(self.todoItemId)), ("pollOption", ConstructorParameterDescription(self.pollOption))]) - } - } - public class Cons_messageReplyStoryHeader: TypeConstructorDescription { - public var peer: Api.Peer - public var storyId: Int32 - public init(peer: Api.Peer, storyId: Int32) { - self.peer = peer - self.storyId = storyId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageReplyStoryHeader", [("peer", ConstructorParameterDescription(self.peer)), ("storyId", ConstructorParameterDescription(self.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(462937446) - } - 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(_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) - } - if Int(_data.flags) & Int(1 << 12) != 0 { - serializeBytes(_data.pollOption!, 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, ConstructorParameterDescription)]) { - switch self { - case .messageReplyHeader(let _data): - return ("messageReplyHeader", [("flags", ConstructorParameterDescription(_data.flags)), ("replyToMsgId", ConstructorParameterDescription(_data.replyToMsgId)), ("replyToPeerId", ConstructorParameterDescription(_data.replyToPeerId)), ("replyFrom", ConstructorParameterDescription(_data.replyFrom)), ("replyMedia", ConstructorParameterDescription(_data.replyMedia)), ("replyToTopId", ConstructorParameterDescription(_data.replyToTopId)), ("quoteText", ConstructorParameterDescription(_data.quoteText)), ("quoteEntities", ConstructorParameterDescription(_data.quoteEntities)), ("quoteOffset", ConstructorParameterDescription(_data.quoteOffset)), ("todoItemId", ConstructorParameterDescription(_data.todoItemId)), ("pollOption", ConstructorParameterDescription(_data.pollOption))]) - case .messageReplyStoryHeader(let _data): - return ("messageReplyStoryHeader", [("peer", ConstructorParameterDescription(_data.peer)), ("storyId", ConstructorParameterDescription(_data.storyId))]) - } - } - - public static func parse_messageReplyHeader(_ reader: BufferReader) -> MessageReplyHeader? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _2 = reader.readInt32() - } - var _3: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 8) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _6 = reader.readInt32() - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _7 = parseString(reader) - } - var _8: [Api.MessageEntity]? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoCompletion.self) } } - var _9: Int32? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { - _9 = reader.readInt32() - } - var _10: Int32? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _10 = reader.readInt32() - } - var _11: Buffer? - if Int(_1 ?? 0) & Int(1 << 12) != 0 { - _11 = parseBytes(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _11 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - 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, pollOption: _11)) - } - else { - return nil - } - } - public static func parse_messageReplyStoryHeader(_ reader: BufferReader) -> MessageReplyHeader? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageReplyHeader.messageReplyStoryHeader(Cons_messageReplyStoryHeader(peer: _1!, storyId: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum MessageReportOption: TypeConstructorDescription { - public class Cons_messageReportOption: TypeConstructorDescription { - public var text: String - public var option: Buffer - public init(text: String, option: Buffer) { - self.text = text - self.option = option - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageReportOption", [("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messageReportOption(let _data): - return ("messageReportOption", [("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option))]) - } - } - - public static func parse_messageReportOption(_ reader: BufferReader) -> MessageReportOption? { - var _1: String? - _1 = parseString(reader) - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MessageReportOption.messageReportOption(Cons_messageReportOption(text: _1!, option: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum MessageViews: TypeConstructorDescription { - public class Cons_messageViews: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageViews", [("flags", ConstructorParameterDescription(self.flags)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("replies", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messageViews(let _data): - return ("messageViews", [("flags", ConstructorParameterDescription(_data.flags)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("replies", ConstructorParameterDescription(_data.replies))]) - } - } - - public static func parse_messageViews(_ reader: BufferReader) -> MessageViews? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() - } - var _4: Api.MessageReplies? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - 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: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputMessagesFilterPhoneCalls", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - case inputMessagesFilterChatPhotos - case inputMessagesFilterContacts - case inputMessagesFilterDocument - case inputMessagesFilterEmpty - case inputMessagesFilterGeo - case inputMessagesFilterGif - case inputMessagesFilterMusic - case inputMessagesFilterMyMentions - case inputMessagesFilterPhoneCalls(Cons_inputMessagesFilterPhoneCalls) - case inputMessagesFilterPhotoVideo - case inputMessagesFilterPhotos - case inputMessagesFilterPinned - case inputMessagesFilterPoll - case inputMessagesFilterRoundVideo - case inputMessagesFilterRoundVoice - 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 _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 .inputMessagesFilterPoll: - if boxed { - buffer.appendInt32(-97793782) - } - 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, ConstructorParameterDescription)]) { - switch self { - case .inputMessagesFilterChatPhotos: - return ("inputMessagesFilterChatPhotos", []) - case .inputMessagesFilterContacts: - return ("inputMessagesFilterContacts", []) - case .inputMessagesFilterDocument: - return ("inputMessagesFilterDocument", []) - case .inputMessagesFilterEmpty: - return ("inputMessagesFilterEmpty", []) - case .inputMessagesFilterGeo: - return ("inputMessagesFilterGeo", []) - case .inputMessagesFilterGif: - return ("inputMessagesFilterGif", []) - case .inputMessagesFilterMusic: - return ("inputMessagesFilterMusic", []) - case .inputMessagesFilterMyMentions: - return ("inputMessagesFilterMyMentions", []) - case .inputMessagesFilterPhoneCalls(let _data): - return ("inputMessagesFilterPhoneCalls", [("flags", ConstructorParameterDescription(_data.flags))]) - case .inputMessagesFilterPhotoVideo: - return ("inputMessagesFilterPhotoVideo", []) - case .inputMessagesFilterPhotos: - return ("inputMessagesFilterPhotos", []) - case .inputMessagesFilterPinned: - return ("inputMessagesFilterPinned", []) - case .inputMessagesFilterPoll: - return ("inputMessagesFilterPoll", []) - case .inputMessagesFilterRoundVideo: - return ("inputMessagesFilterRoundVideo", []) - case .inputMessagesFilterRoundVoice: - return ("inputMessagesFilterRoundVoice", []) - case .inputMessagesFilterUrl: - return ("inputMessagesFilterUrl", []) - case .inputMessagesFilterVideo: - return ("inputMessagesFilterVideo", []) - case .inputMessagesFilterVoice: - return ("inputMessagesFilterVoice", []) - } - } - - public static func parse_inputMessagesFilterChatPhotos(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterChatPhotos - } - public static func parse_inputMessagesFilterContacts(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterContacts - } - public static func parse_inputMessagesFilterDocument(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterDocument - } - public static func parse_inputMessagesFilterEmpty(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterEmpty - } - public static func parse_inputMessagesFilterGeo(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterGeo - } - public static func parse_inputMessagesFilterGif(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterGif - } - public static func parse_inputMessagesFilterMusic(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterMusic - } - public static func parse_inputMessagesFilterMyMentions(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterMyMentions - } - public static func parse_inputMessagesFilterPhoneCalls(_ reader: BufferReader) -> MessagesFilter? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.MessagesFilter.inputMessagesFilterPhoneCalls(Cons_inputMessagesFilterPhoneCalls(flags: _1!)) - } - else { - return nil - } - } - public static func parse_inputMessagesFilterPhotoVideo(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterPhotoVideo - } - public static func parse_inputMessagesFilterPhotos(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterPhotos - } - public static func parse_inputMessagesFilterPinned(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterPinned - } - public static func parse_inputMessagesFilterPoll(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterPoll - } - public static func parse_inputMessagesFilterRoundVideo(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterRoundVideo - } - public static func parse_inputMessagesFilterRoundVoice(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterRoundVoice - } - public static func parse_inputMessagesFilterUrl(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterUrl - } - public static func parse_inputMessagesFilterVideo(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterVideo - } - public static func parse_inputMessagesFilterVoice(_ reader: BufferReader) -> MessagesFilter? { - return Api.MessagesFilter.inputMessagesFilterVoice - } - } -} -public extension Api { - enum MissingInvitee: TypeConstructorDescription { - public class Cons_missingInvitee: TypeConstructorDescription { - public var flags: Int32 - public var userId: Int64 - public init(flags: Int32, userId: Int64) { - self.flags = flags - self.userId = userId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("missingInvitee", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .missingInvitee(let _data): - return ("missingInvitee", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId))]) - } - } - - public static func parse_missingInvitee(_ reader: BufferReader) -> MissingInvitee? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.MissingInvitee.missingInvitee(Cons_missingInvitee(flags: _1!, userId: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum MyBoost: TypeConstructorDescription { - public class Cons_myBoost: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("myBoost", [("flags", ConstructorParameterDescription(self.flags)), ("slot", ConstructorParameterDescription(self.slot)), ("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date)), ("expires", ConstructorParameterDescription(self.expires)), ("cooldownUntilDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .myBoost(let _data): - return ("myBoost", [("flags", ConstructorParameterDescription(_data.flags)), ("slot", ConstructorParameterDescription(_data.slot)), ("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date)), ("expires", ConstructorParameterDescription(_data.expires)), ("cooldownUntilDate", ConstructorParameterDescription(_data.cooldownUntilDate))]) - } - } - - 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 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { - _6 = reader.readInt32() - } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessageMedia.messageMediaToDo(Cons_messageMediaToDo(flags: _1!, todo: _2!, completions: _3)) + } + else { + return nil + } + } + public static func parse_messageMediaUnsupported(_ reader: BufferReader) -> MessageMedia? { + return Api.MessageMedia.messageMediaUnsupported + } + public static func parse_messageMediaVenue(_ reader: BufferReader) -> MessageMedia? { + var _1: Api.GeoPoint? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: String? + _6 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.MyBoost.myBoost(Cons_myBoost(flags: _1!, slot: _2!, peer: _3, date: _4!, expires: _5!, cooldownUntilDate: _6)) + return Api.MessageMedia.messageMediaVenue(Cons_messageMediaVenue(geo: _1!, title: _2!, address: _3!, provider: _4!, venueId: _5!, venueType: _6!)) + } + else { + return nil + } + } + public static func parse_messageMediaVideoStream(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.InputGroupCall? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageMedia.messageMediaVideoStream(Cons_messageMediaVideoStream(flags: _1!, call: _2!)) + } + else { + return nil + } + } + public static func parse_messageMediaWebPage(_ reader: BufferReader) -> MessageMedia? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.WebPage? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.WebPage + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageMedia.messageMediaWebPage(Cons_messageMediaWebPage(flags: _1!, webpage: _2!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api18.swift b/submodules/TelegramApi/Sources/Api18.swift index c4b43cfef0..f371ca3819 100644 --- a/submodules/TelegramApi/Sources/Api18.swift +++ b/submodules/TelegramApi/Sources/Api18.swift @@ -1,52 +1,62 @@ public extension Api { - enum NearestDc: TypeConstructorDescription { - public class Cons_nearestDc: TypeConstructorDescription { - 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 + enum MessagePeerReaction: TypeConstructorDescription { + public class Cons_messagePeerReaction: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("nearestDc", [("country", ConstructorParameterDescription(self.country)), ("thisDc", ConstructorParameterDescription(self.thisDc)), ("nearestDc", ConstructorParameterDescription(self.nearestDc))]) + return ("messagePeerReaction", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.date)), ("reaction", ConstructorParameterDescription(self.reaction))]) } } - case nearestDc(Cons_nearestDc) + case messagePeerReaction(Cons_messagePeerReaction) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .nearestDc(let _data): + case .messagePeerReaction(let _data): if boxed { - buffer.appendInt32(-1910892683) + buffer.appendInt32(-1938180548) } - serializeString(_data.country, buffer: buffer, boxed: false) - serializeInt32(_data.thisDc, buffer: buffer, boxed: false) - serializeInt32(_data.nearestDc, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { switch self { - case .nearestDc(let _data): - return ("nearestDc", [("country", ConstructorParameterDescription(_data.country)), ("thisDc", ConstructorParameterDescription(_data.thisDc)), ("nearestDc", ConstructorParameterDescription(_data.nearestDc))]) + case .messagePeerReaction(let _data): + return ("messagePeerReaction", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) } } - public static func parse_nearestDc(_ reader: BufferReader) -> NearestDc? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() + public static func parse_messagePeerReaction(_ reader: BufferReader) -> MessagePeerReaction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } var _3: Int32? _3 = reader.readInt32() + var _4: Api.Reaction? + 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 - if _c1 && _c2 && _c3 { - return Api.NearestDc.nearestDc(Cons_nearestDc(country: _1!, thisDc: _2!, nearestDc: _3!)) + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessagePeerReaction.messagePeerReaction(Cons_messagePeerReaction(flags: _1!, peerId: _2!, date: _3!, reaction: _4!)) } else { return nil @@ -55,240 +65,74 @@ public extension Api { } } public extension Api { - enum NotificationSound: TypeConstructorDescription { - public class Cons_notificationSoundLocal: TypeConstructorDescription { - public var title: String - public var data: String - public init(title: String, data: String) { - self.title = title - self.data = data - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("notificationSoundLocal", [("title", ConstructorParameterDescription(self.title)), ("data", ConstructorParameterDescription(self.data))]) - } - } - public class Cons_notificationSoundRingtone: TypeConstructorDescription { - public var id: Int64 - public init(id: Int64) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("notificationSoundRingtone", [("id", ConstructorParameterDescription(self.id))]) - } - } - case notificationSoundDefault - case notificationSoundLocal(Cons_notificationSoundLocal) - case notificationSoundNone - 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, ConstructorParameterDescription)]) { - switch self { - case .notificationSoundDefault: - return ("notificationSoundDefault", []) - case .notificationSoundLocal(let _data): - return ("notificationSoundLocal", [("title", ConstructorParameterDescription(_data.title)), ("data", ConstructorParameterDescription(_data.data))]) - case .notificationSoundNone: - return ("notificationSoundNone", []) - case .notificationSoundRingtone(let _data): - return ("notificationSoundRingtone", [("id", ConstructorParameterDescription(_data.id))]) - } - } - - public static func parse_notificationSoundDefault(_ reader: BufferReader) -> NotificationSound? { - return Api.NotificationSound.notificationSoundDefault - } - public static func parse_notificationSoundLocal(_ reader: BufferReader) -> NotificationSound? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.NotificationSound.notificationSoundLocal(Cons_notificationSoundLocal(title: _1!, data: _2!)) - } - else { - return nil - } - } - public static func parse_notificationSoundNone(_ reader: BufferReader) -> NotificationSound? { - return Api.NotificationSound.notificationSoundNone - } - public static func parse_notificationSoundRingtone(_ reader: BufferReader) -> NotificationSound? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.NotificationSound.notificationSoundRingtone(Cons_notificationSoundRingtone(id: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum NotifyPeer: TypeConstructorDescription { - public class Cons_notifyForumTopic: TypeConstructorDescription { + enum MessagePeerVote: TypeConstructorDescription { + public class Cons_messagePeerVote: TypeConstructorDescription { public var peer: Api.Peer - public var topMsgId: Int32 - public init(peer: Api.Peer, topMsgId: Int32) { - self.peer = peer - self.topMsgId = topMsgId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("notifyForumTopic", [("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId))]) - } - } - public class Cons_notifyPeer: TypeConstructorDescription { - public var peer: Api.Peer - public init(peer: Api.Peer) { - self.peer = peer - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("notifyPeer", [("peer", ConstructorParameterDescription(self.peer))]) - } - } - case notifyBroadcasts - case notifyChats - 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 _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, ConstructorParameterDescription)]) { - switch self { - case .notifyBroadcasts: - return ("notifyBroadcasts", []) - case .notifyChats: - return ("notifyChats", []) - case .notifyForumTopic(let _data): - return ("notifyForumTopic", [("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId))]) - case .notifyPeer(let _data): - return ("notifyPeer", [("peer", ConstructorParameterDescription(_data.peer))]) - case .notifyUsers: - return ("notifyUsers", []) - } - } - - public static func parse_notifyBroadcasts(_ reader: BufferReader) -> NotifyPeer? { - return Api.NotifyPeer.notifyBroadcasts - } - public static func parse_notifyChats(_ reader: BufferReader) -> NotifyPeer? { - return Api.NotifyPeer.notifyChats - } - public static func parse_notifyForumTopic(_ reader: BufferReader) -> NotifyPeer? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.NotifyPeer.notifyForumTopic(Cons_notifyForumTopic(peer: _1!, topMsgId: _2!)) - } - else { - return nil - } - } - public static func parse_notifyPeer(_ reader: BufferReader) -> NotifyPeer? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - let _c1 = _1 != nil - if _c1 { - return Api.NotifyPeer.notifyPeer(Cons_notifyPeer(peer: _1!)) - } - else { - return nil - } - } - public static func parse_notifyUsers(_ reader: BufferReader) -> NotifyPeer? { - return Api.NotifyPeer.notifyUsers - } - } -} -public extension Api { - enum OutboxReadDate: TypeConstructorDescription { - public class Cons_outboxReadDate: TypeConstructorDescription { + public var option: Buffer public var date: Int32 - public init(date: Int32) { + public init(peer: Api.Peer, option: Buffer, date: Int32) { + self.peer = peer + self.option = option self.date = date } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("outboxReadDate", [("date", ConstructorParameterDescription(self.date))]) + return ("messagePeerVote", [("peer", ConstructorParameterDescription(self.peer)), ("option", ConstructorParameterDescription(self.option)), ("date", ConstructorParameterDescription(self.date))]) } } - case outboxReadDate(Cons_outboxReadDate) + public class Cons_messagePeerVoteInputOption: TypeConstructorDescription { + public var peer: Api.Peer + public var date: Int32 + public init(peer: Api.Peer, date: Int32) { + self.peer = peer + self.date = date + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagePeerVoteInputOption", [("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date))]) + } + } + public class Cons_messagePeerVoteMultiple: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagePeerVoteMultiple", [("peer", ConstructorParameterDescription(self.peer)), ("options", ConstructorParameterDescription(self.options)), ("date", ConstructorParameterDescription(self.date))]) + } + } + case messagePeerVote(Cons_messagePeerVote) + case messagePeerVoteInputOption(Cons_messagePeerVoteInputOption) + case messagePeerVoteMultiple(Cons_messagePeerVoteMultiple) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .outboxReadDate(let _data): + case .messagePeerVote(let _data): if boxed { - buffer.appendInt32(1001931436) + 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 @@ -297,17 +141,66 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .outboxReadDate(let _data): - return ("outboxReadDate", [("date", ConstructorParameterDescription(_data.date))]) + case .messagePeerVote(let _data): + return ("messagePeerVote", [("peer", ConstructorParameterDescription(_data.peer)), ("option", ConstructorParameterDescription(_data.option)), ("date", ConstructorParameterDescription(_data.date))]) + case .messagePeerVoteInputOption(let _data): + return ("messagePeerVoteInputOption", [("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date))]) + case .messagePeerVoteMultiple(let _data): + return ("messagePeerVoteMultiple", [("peer", ConstructorParameterDescription(_data.peer)), ("options", ConstructorParameterDescription(_data.options)), ("date", ConstructorParameterDescription(_data.date))]) } } - public static func parse_outboxReadDate(_ reader: BufferReader) -> OutboxReadDate? { - var _1: Int32? - _1 = reader.readInt32() + public static func parse_messagePeerVote(_ reader: BufferReader) -> MessagePeerVote? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Int32? + _3 = reader.readInt32() let _c1 = _1 != nil - if _c1 { - return Api.OutboxReadDate.outboxReadDate(Cons_outboxReadDate(date: _1!)) + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessagePeerVote.messagePeerVote(Cons_messagePeerVote(peer: _1!, option: _2!, date: _3!)) + } + else { + return nil + } + } + public static func parse_messagePeerVoteInputOption(_ reader: BufferReader) -> MessagePeerVote? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessagePeerVote.messagePeerVoteInputOption(Cons_messagePeerVoteInputOption(peer: _1!, date: _2!)) + } + else { + return nil + } + } + public static func parse_messagePeerVoteMultiple(_ reader: BufferReader) -> MessagePeerVote? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: [Buffer]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) + } + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.MessagePeerVote.messagePeerVoteMultiple(Cons_messagePeerVoteMultiple(peer: _1!, options: _2!, date: _3!)) } else { return nil @@ -316,94 +209,48 @@ public extension Api { } } public extension Api { - enum Page: TypeConstructorDescription { - public class Cons_page: TypeConstructorDescription { - 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 + enum MessageRange: TypeConstructorDescription { + public class Cons_messageRange: TypeConstructorDescription { + public var minId: Int32 + public var maxId: Int32 + public init(minId: Int32, maxId: Int32) { + self.minId = minId + self.maxId = maxId } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("page", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("blocks", ConstructorParameterDescription(self.blocks)), ("photos", ConstructorParameterDescription(self.photos)), ("documents", ConstructorParameterDescription(self.documents)), ("views", ConstructorParameterDescription(self.views))]) + return ("messageRange", [("minId", ConstructorParameterDescription(self.minId)), ("maxId", ConstructorParameterDescription(self.maxId))]) } } - case page(Cons_page) + case messageRange(Cons_messageRange) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .page(let _data): + case .messageRange(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) + buffer.appendInt32(182649427) } + serializeInt32(_data.minId, buffer: buffer, boxed: false) + serializeInt32(_data.maxId, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .page(let _data): - return ("page", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("photos", ConstructorParameterDescription(_data.photos)), ("documents", ConstructorParameterDescription(_data.documents)), ("views", ConstructorParameterDescription(_data.views))]) + case .messageRange(let _data): + return ("messageRange", [("minId", ConstructorParameterDescription(_data.minId)), ("maxId", ConstructorParameterDescription(_data.maxId))]) } } - public static func parse_page(_ reader: BufferReader) -> Page? { + public static func parse_messageRange(_ reader: BufferReader) -> MessageRange? { var _1: Int32? _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: [Api.PageBlock]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) - } - var _4: [Api.Photo]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self) - } - var _5: [Api.Document]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _6 = reader.readInt32() - } + var _2: Int32? + _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Page.page(Cons_page(flags: _1!, url: _2!, blocks: _3!, photos: _4!, documents: _5!, views: _6)) + if _c1 && _c2 { + return Api.MessageRange.messageRange(Cons_messageRange(minId: _1!, maxId: _2!)) } else { return nil @@ -412,1152 +259,934 @@ public extension Api { } } public extension Api { - indirect enum PageBlock: TypeConstructorDescription { - public class Cons_pageBlockAnchor: TypeConstructorDescription { - public var name: String - public init(name: String) { - self.name = name - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockAnchor", [("name", ConstructorParameterDescription(self.name))]) - } - } - public class Cons_pageBlockAudio: TypeConstructorDescription { - public var audioId: Int64 - public var caption: Api.PageCaption - public init(audioId: Int64, caption: Api.PageCaption) { - self.audioId = audioId - self.caption = caption - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockAudio", [("audioId", ConstructorParameterDescription(self.audioId)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockAuthorDate: TypeConstructorDescription { - public var author: Api.RichText - public var publishedDate: Int32 - public init(author: Api.RichText, publishedDate: Int32) { - self.author = author - self.publishedDate = publishedDate - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockAuthorDate", [("author", ConstructorParameterDescription(self.author)), ("publishedDate", ConstructorParameterDescription(self.publishedDate))]) - } - } - public class Cons_pageBlockBlockquote: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockBlockquote", [("text", ConstructorParameterDescription(self.text)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockChannel: TypeConstructorDescription { - public var channel: Api.Chat - public init(channel: Api.Chat) { - self.channel = channel - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockChannel", [("channel", ConstructorParameterDescription(self.channel))]) - } - } - public class Cons_pageBlockCollage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockCollage", [("items", ConstructorParameterDescription(self.items)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockCover: TypeConstructorDescription { - public var cover: Api.PageBlock - public init(cover: Api.PageBlock) { - self.cover = cover - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockCover", [("cover", ConstructorParameterDescription(self.cover))]) - } - } - public class Cons_pageBlockDetails: TypeConstructorDescription { + enum MessageReactions: TypeConstructorDescription { + public class Cons_messageReactions: TypeConstructorDescription { public var flags: Int32 - public var blocks: [Api.PageBlock] - public var title: Api.RichText - public init(flags: Int32, blocks: [Api.PageBlock], title: Api.RichText) { + 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.blocks = blocks - self.title = title + self.results = results + self.recentReactions = recentReactions + self.topReactors = topReactors } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockDetails", [("flags", ConstructorParameterDescription(self.flags)), ("blocks", ConstructorParameterDescription(self.blocks)), ("title", ConstructorParameterDescription(self.title))]) + return ("messageReactions", [("flags", ConstructorParameterDescription(self.flags)), ("results", ConstructorParameterDescription(self.results)), ("recentReactions", ConstructorParameterDescription(self.recentReactions)), ("topReactors", ConstructorParameterDescription(self.topReactors))]) } } - public class Cons_pageBlockEmbed: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockEmbed", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("html", ConstructorParameterDescription(self.html)), ("posterPhotoId", ConstructorParameterDescription(self.posterPhotoId)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockEmbedPost: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockEmbedPost", [("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId)), ("authorPhotoId", ConstructorParameterDescription(self.authorPhotoId)), ("author", ConstructorParameterDescription(self.author)), ("date", ConstructorParameterDescription(self.date)), ("blocks", ConstructorParameterDescription(self.blocks)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockFooter: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockFooter", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_pageBlockHeader: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockHeader", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_pageBlockKicker: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockKicker", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_pageBlockList: TypeConstructorDescription { - public var items: [Api.PageListItem] - public init(items: [Api.PageListItem]) { - self.items = items - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockList", [("items", ConstructorParameterDescription(self.items))]) - } - } - public class Cons_pageBlockMap: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockMap", [("geo", ConstructorParameterDescription(self.geo)), ("zoom", ConstructorParameterDescription(self.zoom)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockOrderedList: TypeConstructorDescription { - public var items: [Api.PageListOrderedItem] - public init(items: [Api.PageListOrderedItem]) { - self.items = items - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockOrderedList", [("items", ConstructorParameterDescription(self.items))]) - } - } - public class Cons_pageBlockParagraph: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockParagraph", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_pageBlockPhoto: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photoId", ConstructorParameterDescription(self.photoId)), ("caption", ConstructorParameterDescription(self.caption)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId))]) - } - } - public class Cons_pageBlockPreformatted: TypeConstructorDescription { - public var text: Api.RichText - public var language: String - public init(text: Api.RichText, language: String) { - self.text = text - self.language = language - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockPreformatted", [("text", ConstructorParameterDescription(self.text)), ("language", ConstructorParameterDescription(self.language))]) - } - } - public class Cons_pageBlockPullquote: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockPullquote", [("text", ConstructorParameterDescription(self.text)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockRelatedArticles: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockRelatedArticles", [("title", ConstructorParameterDescription(self.title)), ("articles", ConstructorParameterDescription(self.articles))]) - } - } - public class Cons_pageBlockSlideshow: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockSlideshow", [("items", ConstructorParameterDescription(self.items)), ("caption", ConstructorParameterDescription(self.caption))]) - } - } - public class Cons_pageBlockSubheader: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockSubheader", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_pageBlockSubtitle: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockSubtitle", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_pageBlockTable: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockTable", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("rows", ConstructorParameterDescription(self.rows))]) - } - } - public class Cons_pageBlockTitle: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockTitle", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_pageBlockVideo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageBlockVideo", [("flags", ConstructorParameterDescription(self.flags)), ("videoId", ConstructorParameterDescription(self.videoId)), ("caption", ConstructorParameterDescription(self.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(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(Cons_pageBlockVideo) + case messageReactions(Cons_messageReactions) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .pageBlockAnchor(let _data): + case .messageReactions(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) + buffer.appendInt32(171155211) } serializeInt32(_data.flags, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.blocks.count)) - for item in _data.blocks { + buffer.appendInt32(Int32(_data.results.count)) + for item in _data.results { 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) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentReactions!.count)) + for item in _data.recentReactions! { + item.serialize(buffer, true) + } } if Int(_data.flags) & Int(1 << 4) != 0 { - serializeInt64(_data.posterPhotoId!, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.topReactors!.count)) + for item in _data.topReactors! { + item.serialize(buffer, true) + } } - 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, ConstructorParameterDescription)]) { switch self { - case .pageBlockAnchor(let _data): - return ("pageBlockAnchor", [("name", ConstructorParameterDescription(_data.name))]) - case .pageBlockAudio(let _data): - return ("pageBlockAudio", [("audioId", ConstructorParameterDescription(_data.audioId)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockAuthorDate(let _data): - return ("pageBlockAuthorDate", [("author", ConstructorParameterDescription(_data.author)), ("publishedDate", ConstructorParameterDescription(_data.publishedDate))]) - case .pageBlockBlockquote(let _data): - return ("pageBlockBlockquote", [("text", ConstructorParameterDescription(_data.text)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockChannel(let _data): - return ("pageBlockChannel", [("channel", ConstructorParameterDescription(_data.channel))]) - case .pageBlockCollage(let _data): - return ("pageBlockCollage", [("items", ConstructorParameterDescription(_data.items)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockCover(let _data): - return ("pageBlockCover", [("cover", ConstructorParameterDescription(_data.cover))]) - case .pageBlockDetails(let _data): - return ("pageBlockDetails", [("flags", ConstructorParameterDescription(_data.flags)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("title", ConstructorParameterDescription(_data.title))]) - case .pageBlockDivider: - return ("pageBlockDivider", []) - case .pageBlockEmbed(let _data): - return ("pageBlockEmbed", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("html", ConstructorParameterDescription(_data.html)), ("posterPhotoId", ConstructorParameterDescription(_data.posterPhotoId)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockEmbedPost(let _data): - return ("pageBlockEmbedPost", [("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId)), ("authorPhotoId", ConstructorParameterDescription(_data.authorPhotoId)), ("author", ConstructorParameterDescription(_data.author)), ("date", ConstructorParameterDescription(_data.date)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockFooter(let _data): - return ("pageBlockFooter", [("text", ConstructorParameterDescription(_data.text))]) - case .pageBlockHeader(let _data): - return ("pageBlockHeader", [("text", ConstructorParameterDescription(_data.text))]) - case .pageBlockKicker(let _data): - return ("pageBlockKicker", [("text", ConstructorParameterDescription(_data.text))]) - case .pageBlockList(let _data): - return ("pageBlockList", [("items", ConstructorParameterDescription(_data.items))]) - case .pageBlockMap(let _data): - return ("pageBlockMap", [("geo", ConstructorParameterDescription(_data.geo)), ("zoom", ConstructorParameterDescription(_data.zoom)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockOrderedList(let _data): - return ("pageBlockOrderedList", [("items", ConstructorParameterDescription(_data.items))]) - case .pageBlockParagraph(let _data): - return ("pageBlockParagraph", [("text", ConstructorParameterDescription(_data.text))]) - case .pageBlockPhoto(let _data): - return ("pageBlockPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("caption", ConstructorParameterDescription(_data.caption)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId))]) - case .pageBlockPreformatted(let _data): - return ("pageBlockPreformatted", [("text", ConstructorParameterDescription(_data.text)), ("language", ConstructorParameterDescription(_data.language))]) - case .pageBlockPullquote(let _data): - return ("pageBlockPullquote", [("text", ConstructorParameterDescription(_data.text)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockRelatedArticles(let _data): - return ("pageBlockRelatedArticles", [("title", ConstructorParameterDescription(_data.title)), ("articles", ConstructorParameterDescription(_data.articles))]) - case .pageBlockSlideshow(let _data): - return ("pageBlockSlideshow", [("items", ConstructorParameterDescription(_data.items)), ("caption", ConstructorParameterDescription(_data.caption))]) - case .pageBlockSubheader(let _data): - return ("pageBlockSubheader", [("text", ConstructorParameterDescription(_data.text))]) - case .pageBlockSubtitle(let _data): - return ("pageBlockSubtitle", [("text", ConstructorParameterDescription(_data.text))]) - case .pageBlockTable(let _data): - return ("pageBlockTable", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("rows", ConstructorParameterDescription(_data.rows))]) - case .pageBlockTitle(let _data): - return ("pageBlockTitle", [("text", ConstructorParameterDescription(_data.text))]) - case .pageBlockUnsupported: - return ("pageBlockUnsupported", []) - case .pageBlockVideo(let _data): - return ("pageBlockVideo", [("flags", ConstructorParameterDescription(_data.flags)), ("videoId", ConstructorParameterDescription(_data.videoId)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .messageReactions(let _data): + return ("messageReactions", [("flags", ConstructorParameterDescription(_data.flags)), ("results", ConstructorParameterDescription(_data.results)), ("recentReactions", ConstructorParameterDescription(_data.recentReactions)), ("topReactors", ConstructorParameterDescription(_data.topReactors))]) } } - public static func parse_pageBlockAnchor(_ reader: BufferReader) -> PageBlock? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockAnchor(Cons_pageBlockAnchor(name: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockAudio(_ reader: BufferReader) -> PageBlock? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.PageCaption? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PageCaption - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockAudio(Cons_pageBlockAudio(audioId: _1!, caption: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockAuthorDate(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockAuthorDate(Cons_pageBlockAuthorDate(author: _1!, publishedDate: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockBlockquote(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: Api.RichText? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockBlockquote(Cons_pageBlockBlockquote(text: _1!, caption: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockChannel(_ reader: BufferReader) -> PageBlock? { - var _1: Api.Chat? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Chat - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockChannel(Cons_pageBlockChannel(channel: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockCollage(_ reader: BufferReader) -> PageBlock? { - var _1: [Api.PageBlock]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) - } - var _2: Api.PageCaption? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PageCaption - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockCollage(Cons_pageBlockCollage(items: _1!, caption: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockCover(_ reader: BufferReader) -> PageBlock? { - var _1: Api.PageBlock? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PageBlock - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockCover(Cons_pageBlockCover(cover: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockDetails(_ reader: BufferReader) -> PageBlock? { + public static func parse_messageReactions(_ reader: BufferReader) -> MessageReactions? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.PageBlock]? + var _2: [Api.ReactionCount]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) } - var _3: Api.RichText? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.RichText + var _3: [Api.MessagePeerReaction]? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.MessageReactions.messageReactions(Cons_messageReactions(flags: _1!, results: _2!, recentReactions: _3, topReactors: _4)) + } + else { + return nil + } + } + } +} +public extension Api { + enum MessageReactor: TypeConstructorDescription { + public class Cons_messageReactor: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReactor", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .messageReactor(let _data): + return ("messageReactor", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_messageReactor(_ reader: BufferReader) -> MessageReactor? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 3) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.PageBlock.pageBlockDetails(Cons_pageBlockDetails(flags: _1!, blocks: _2!, title: _3!)) + return Api.MessageReactor.messageReactor(Cons_messageReactor(flags: _1!, peerId: _2, count: _3!)) } else { return nil } } - public static func parse_pageBlockDivider(_ reader: BufferReader) -> PageBlock? { - return Api.PageBlock.pageBlockDivider + } +} +public extension Api { + enum MessageReplies: TypeConstructorDescription { + public class Cons_messageReplies: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReplies", [("flags", ConstructorParameterDescription(self.flags)), ("replies", ConstructorParameterDescription(self.replies)), ("repliesPts", ConstructorParameterDescription(self.repliesPts)), ("recentRepliers", ConstructorParameterDescription(self.recentRepliers)), ("channelId", ConstructorParameterDescription(self.channelId)), ("maxId", ConstructorParameterDescription(self.maxId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId))]) + } } - public static func parse_pageBlockEmbed(_ reader: BufferReader) -> PageBlock? { + 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(_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, ConstructorParameterDescription)]) { + switch self { + case .messageReplies(let _data): + return ("messageReplies", [("flags", ConstructorParameterDescription(_data.flags)), ("replies", ConstructorParameterDescription(_data.replies)), ("repliesPts", ConstructorParameterDescription(_data.repliesPts)), ("recentRepliers", ConstructorParameterDescription(_data.recentRepliers)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) + } + } + + public static func parse_messageReplies(_ reader: BufferReader) -> MessageReplies? { var _1: Int32? _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _2 = parseString(reader) - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = parseString(reader) - } - var _4: Int64? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _4 = reader.readInt64() - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1 ?? 0) & 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 - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PageBlock.pageBlockEmbed(Cons_pageBlockEmbed(flags: _1!, url: _2, html: _3, posterPhotoId: _4, w: _5, h: _6, caption: _7!)) - } - else { - return nil - } - } - public static func parse_pageBlockEmbedPost(_ reader: BufferReader) -> PageBlock? { - var _1: String? - _1 = parseString(reader) - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() - var _6: [Api.PageBlock]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) - } - var _7: Api.PageCaption? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.PageCaption - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PageBlock.pageBlockEmbedPost(Cons_pageBlockEmbedPost(url: _1!, webpageId: _2!, authorPhotoId: _3!, author: _4!, date: _5!, blocks: _6!, caption: _7!)) - } - else { - return nil - } - } - public static func parse_pageBlockFooter(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockFooter(Cons_pageBlockFooter(text: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockHeader(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockHeader(Cons_pageBlockHeader(text: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockKicker(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockKicker(Cons_pageBlockKicker(text: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockList(_ reader: BufferReader) -> PageBlock? { - var _1: [Api.PageListItem]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageListItem.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockList(Cons_pageBlockList(items: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockMap(_ reader: BufferReader) -> PageBlock? { - var _1: Api.GeoPoint? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.GeoPoint - } var _2: Int32? _2 = reader.readInt32() var _3: Int32? _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Api.PageCaption? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.PageCaption - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.PageBlock.pageBlockMap(Cons_pageBlockMap(geo: _1!, zoom: _2!, w: _3!, h: _4!, caption: _5!)) - } - else { - return nil - } - } - public static func parse_pageBlockOrderedList(_ reader: BufferReader) -> PageBlock? { - var _1: [Api.PageListOrderedItem]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageListOrderedItem.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockOrderedList(Cons_pageBlockOrderedList(items: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockParagraph(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockParagraph(Cons_pageBlockParagraph(text: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockPhoto(_ reader: BufferReader) -> PageBlock? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.PageCaption? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PageCaption - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) + var _4: [Api.Peer]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } } var _5: Int64? if Int(_1 ?? 0) & Int(1 << 0) != 0 { _5 = reader.readInt64() } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _6 = reader.readInt32() + } + var _7: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _7 = reader.readInt32() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.PageBlock.pageBlockPhoto(Cons_pageBlockPhoto(flags: _1!, photoId: _2!, caption: _3!, url: _4, webpageId: _5)) - } - else { - return nil - } - } - public static func parse_pageBlockPreformatted(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockPreformatted(Cons_pageBlockPreformatted(text: _1!, language: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockPullquote(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: Api.RichText? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockPullquote(Cons_pageBlockPullquote(text: _1!, caption: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockRelatedArticles(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: [Api.PageRelatedArticle]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageRelatedArticle.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockRelatedArticles(Cons_pageBlockRelatedArticles(title: _1!, articles: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockSlideshow(_ reader: BufferReader) -> PageBlock? { - var _1: [Api.PageBlock]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) - } - var _2: Api.PageCaption? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PageCaption - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageBlock.pageBlockSlideshow(Cons_pageBlockSlideshow(items: _1!, caption: _2!)) - } - else { - return nil - } - } - public static func parse_pageBlockSubheader(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockSubheader(Cons_pageBlockSubheader(text: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockSubtitle(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockSubtitle(Cons_pageBlockSubtitle(text: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockTable(_ reader: BufferReader) -> PageBlock? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.RichText? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _3: [Api.PageTableRow]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageTableRow.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.PageBlock.pageBlockTable(Cons_pageBlockTable(flags: _1!, title: _2!, rows: _3!)) - } - else { - return nil - } - } - public static func parse_pageBlockTitle(_ reader: BufferReader) -> PageBlock? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageBlock.pageBlockTitle(Cons_pageBlockTitle(text: _1!)) - } - else { - return nil - } - } - public static func parse_pageBlockUnsupported(_ reader: BufferReader) -> PageBlock? { - return Api.PageBlock.pageBlockUnsupported - } - public static func parse_pageBlockVideo(_ reader: BufferReader) -> PageBlock? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.PageCaption? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PageCaption - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.PageBlock.pageBlockVideo(Cons_pageBlockVideo(flags: _1!, videoId: _2!, caption: _3!)) + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + 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 { + public class Cons_messageReplyHeader: TypeConstructorDescription { + 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 var pollOption: Buffer? + 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?, pollOption: Buffer?) { + 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 + self.pollOption = pollOption + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReplyHeader", [("flags", ConstructorParameterDescription(self.flags)), ("replyToMsgId", ConstructorParameterDescription(self.replyToMsgId)), ("replyToPeerId", ConstructorParameterDescription(self.replyToPeerId)), ("replyFrom", ConstructorParameterDescription(self.replyFrom)), ("replyMedia", ConstructorParameterDescription(self.replyMedia)), ("replyToTopId", ConstructorParameterDescription(self.replyToTopId)), ("quoteText", ConstructorParameterDescription(self.quoteText)), ("quoteEntities", ConstructorParameterDescription(self.quoteEntities)), ("quoteOffset", ConstructorParameterDescription(self.quoteOffset)), ("todoItemId", ConstructorParameterDescription(self.todoItemId)), ("pollOption", ConstructorParameterDescription(self.pollOption))]) + } + } + public class Cons_messageReplyStoryHeader: TypeConstructorDescription { + public var peer: Api.Peer + public var storyId: Int32 + public init(peer: Api.Peer, storyId: Int32) { + self.peer = peer + self.storyId = storyId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReplyStoryHeader", [("peer", ConstructorParameterDescription(self.peer)), ("storyId", ConstructorParameterDescription(self.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(462937446) + } + 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(_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) + } + if Int(_data.flags) & Int(1 << 12) != 0 { + serializeBytes(_data.pollOption!, 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, ConstructorParameterDescription)]) { + switch self { + case .messageReplyHeader(let _data): + return ("messageReplyHeader", [("flags", ConstructorParameterDescription(_data.flags)), ("replyToMsgId", ConstructorParameterDescription(_data.replyToMsgId)), ("replyToPeerId", ConstructorParameterDescription(_data.replyToPeerId)), ("replyFrom", ConstructorParameterDescription(_data.replyFrom)), ("replyMedia", ConstructorParameterDescription(_data.replyMedia)), ("replyToTopId", ConstructorParameterDescription(_data.replyToTopId)), ("quoteText", ConstructorParameterDescription(_data.quoteText)), ("quoteEntities", ConstructorParameterDescription(_data.quoteEntities)), ("quoteOffset", ConstructorParameterDescription(_data.quoteOffset)), ("todoItemId", ConstructorParameterDescription(_data.todoItemId)), ("pollOption", ConstructorParameterDescription(_data.pollOption))]) + case .messageReplyStoryHeader(let _data): + return ("messageReplyStoryHeader", [("peer", ConstructorParameterDescription(_data.peer)), ("storyId", ConstructorParameterDescription(_data.storyId))]) + } + } + + public static func parse_messageReplyHeader(_ reader: BufferReader) -> MessageReplyHeader? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _2 = reader.readInt32() + } + var _3: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 8) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _7 = parseString(reader) + } + var _8: [Api.MessageEntity]? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } + var _9: Int32? + if Int(_1 ?? 0) & Int(1 << 10) != 0 { + _9 = reader.readInt32() + } + var _10: Int32? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _10 = reader.readInt32() + } + var _11: Buffer? + if Int(_1 ?? 0) & Int(1 << 12) != 0 { + _11 = parseBytes(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _11 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { + 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, pollOption: _11)) + } + else { + return nil + } + } + public static func parse_messageReplyStoryHeader(_ reader: BufferReader) -> MessageReplyHeader? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageReplyHeader.messageReplyStoryHeader(Cons_messageReplyStoryHeader(peer: _1!, storyId: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum MessageReportOption: TypeConstructorDescription { + public class Cons_messageReportOption: TypeConstructorDescription { + public var text: String + public var option: Buffer + public init(text: String, option: Buffer) { + self.text = text + self.option = option + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReportOption", [("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .messageReportOption(let _data): + return ("messageReportOption", [("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option))]) + } + } + + public static func parse_messageReportOption(_ reader: BufferReader) -> MessageReportOption? { + var _1: String? + _1 = parseString(reader) + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MessageReportOption.messageReportOption(Cons_messageReportOption(text: _1!, option: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum MessageViews: TypeConstructorDescription { + public class Cons_messageViews: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageViews", [("flags", ConstructorParameterDescription(self.flags)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("replies", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .messageViews(let _data): + return ("messageViews", [("flags", ConstructorParameterDescription(_data.flags)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("replies", ConstructorParameterDescription(_data.replies))]) + } + } + + public static func parse_messageViews(_ reader: BufferReader) -> MessageViews? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + var _4: Api.MessageReplies? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + 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: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMessagesFilterPhoneCalls", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + case inputMessagesFilterChatPhotos + case inputMessagesFilterContacts + case inputMessagesFilterDocument + case inputMessagesFilterEmpty + case inputMessagesFilterGeo + case inputMessagesFilterGif + case inputMessagesFilterMusic + case inputMessagesFilterMyMentions + case inputMessagesFilterPhoneCalls(Cons_inputMessagesFilterPhoneCalls) + case inputMessagesFilterPhotoVideo + case inputMessagesFilterPhotos + case inputMessagesFilterPinned + case inputMessagesFilterPoll + case inputMessagesFilterRoundVideo + case inputMessagesFilterRoundVoice + 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 _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 .inputMessagesFilterPoll: + if boxed { + buffer.appendInt32(-97793782) + } + 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, ConstructorParameterDescription)]) { + switch self { + case .inputMessagesFilterChatPhotos: + return ("inputMessagesFilterChatPhotos", []) + case .inputMessagesFilterContacts: + return ("inputMessagesFilterContacts", []) + case .inputMessagesFilterDocument: + return ("inputMessagesFilterDocument", []) + case .inputMessagesFilterEmpty: + return ("inputMessagesFilterEmpty", []) + case .inputMessagesFilterGeo: + return ("inputMessagesFilterGeo", []) + case .inputMessagesFilterGif: + return ("inputMessagesFilterGif", []) + case .inputMessagesFilterMusic: + return ("inputMessagesFilterMusic", []) + case .inputMessagesFilterMyMentions: + return ("inputMessagesFilterMyMentions", []) + case .inputMessagesFilterPhoneCalls(let _data): + return ("inputMessagesFilterPhoneCalls", [("flags", ConstructorParameterDescription(_data.flags))]) + case .inputMessagesFilterPhotoVideo: + return ("inputMessagesFilterPhotoVideo", []) + case .inputMessagesFilterPhotos: + return ("inputMessagesFilterPhotos", []) + case .inputMessagesFilterPinned: + return ("inputMessagesFilterPinned", []) + case .inputMessagesFilterPoll: + return ("inputMessagesFilterPoll", []) + case .inputMessagesFilterRoundVideo: + return ("inputMessagesFilterRoundVideo", []) + case .inputMessagesFilterRoundVoice: + return ("inputMessagesFilterRoundVoice", []) + case .inputMessagesFilterUrl: + return ("inputMessagesFilterUrl", []) + case .inputMessagesFilterVideo: + return ("inputMessagesFilterVideo", []) + case .inputMessagesFilterVoice: + return ("inputMessagesFilterVoice", []) + } + } + + public static func parse_inputMessagesFilterChatPhotos(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterChatPhotos + } + public static func parse_inputMessagesFilterContacts(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterContacts + } + public static func parse_inputMessagesFilterDocument(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterDocument + } + public static func parse_inputMessagesFilterEmpty(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterEmpty + } + public static func parse_inputMessagesFilterGeo(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterGeo + } + public static func parse_inputMessagesFilterGif(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterGif + } + public static func parse_inputMessagesFilterMusic(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterMusic + } + public static func parse_inputMessagesFilterMyMentions(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterMyMentions + } + public static func parse_inputMessagesFilterPhoneCalls(_ reader: BufferReader) -> MessagesFilter? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.MessagesFilter.inputMessagesFilterPhoneCalls(Cons_inputMessagesFilterPhoneCalls(flags: _1!)) + } + else { + return nil + } + } + public static func parse_inputMessagesFilterPhotoVideo(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterPhotoVideo + } + public static func parse_inputMessagesFilterPhotos(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterPhotos + } + public static func parse_inputMessagesFilterPinned(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterPinned + } + public static func parse_inputMessagesFilterPoll(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterPoll + } + public static func parse_inputMessagesFilterRoundVideo(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterRoundVideo + } + public static func parse_inputMessagesFilterRoundVoice(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterRoundVoice + } + public static func parse_inputMessagesFilterUrl(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterUrl + } + public static func parse_inputMessagesFilterVideo(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterVideo + } + public static func parse_inputMessagesFilterVoice(_ reader: BufferReader) -> MessagesFilter? { + return Api.MessagesFilter.inputMessagesFilterVoice + } + } +} +public extension Api { + enum MissingInvitee: TypeConstructorDescription { + public class Cons_missingInvitee: TypeConstructorDescription { + public var flags: Int32 + public var userId: Int64 + public init(flags: Int32, userId: Int64) { + self.flags = flags + self.userId = userId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("missingInvitee", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .missingInvitee(let _data): + return ("missingInvitee", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId))]) + } + } + + public static func parse_missingInvitee(_ reader: BufferReader) -> MissingInvitee? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.MissingInvitee.missingInvitee(Cons_missingInvitee(flags: _1!, userId: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum MyBoost: TypeConstructorDescription { + public class Cons_myBoost: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("myBoost", [("flags", ConstructorParameterDescription(self.flags)), ("slot", ConstructorParameterDescription(self.slot)), ("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date)), ("expires", ConstructorParameterDescription(self.expires)), ("cooldownUntilDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .myBoost(let _data): + return ("myBoost", [("flags", ConstructorParameterDescription(_data.flags)), ("slot", ConstructorParameterDescription(_data.slot)), ("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date)), ("expires", ConstructorParameterDescription(_data.expires)), ("cooldownUntilDate", ConstructorParameterDescription(_data.cooldownUntilDate))]) + } + } + + 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 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.MyBoost.myBoost(Cons_myBoost(flags: _1!, slot: _2!, peer: _3, date: _4!, expires: _5!, cooldownUntilDate: _6)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api19.swift b/submodules/TelegramApi/Sources/Api19.swift index 586573d025..f344c4c207 100644 --- a/submodules/TelegramApi/Sources/Api19.swift +++ b/submodules/TelegramApi/Sources/Api19.swift @@ -1,330 +1,52 @@ public extension Api { - indirect enum PageCaption: TypeConstructorDescription { - public class Cons_pageCaption: TypeConstructorDescription { - public var text: Api.RichText - public var credit: Api.RichText - public init(text: Api.RichText, credit: Api.RichText) { - self.text = text - self.credit = credit + enum NearestDc: TypeConstructorDescription { + public class Cons_nearestDc: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageCaption", [("text", ConstructorParameterDescription(self.text)), ("credit", ConstructorParameterDescription(self.credit))]) + return ("nearestDc", [("country", ConstructorParameterDescription(self.country)), ("thisDc", ConstructorParameterDescription(self.thisDc)), ("nearestDc", ConstructorParameterDescription(self.nearestDc))]) } } - case pageCaption(Cons_pageCaption) + case nearestDc(Cons_nearestDc) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .pageCaption(let _data): + case .nearestDc(let _data): if boxed { - buffer.appendInt32(1869903447) + buffer.appendInt32(-1910892683) } - _data.text.serialize(buffer, true) - _data.credit.serialize(buffer, true) + 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, ConstructorParameterDescription)]) { switch self { - case .pageCaption(let _data): - return ("pageCaption", [("text", ConstructorParameterDescription(_data.text)), ("credit", ConstructorParameterDescription(_data.credit))]) + case .nearestDc(let _data): + return ("nearestDc", [("country", ConstructorParameterDescription(_data.country)), ("thisDc", ConstructorParameterDescription(_data.thisDc)), ("nearestDc", ConstructorParameterDescription(_data.nearestDc))]) } } - public static func parse_pageCaption(_ reader: BufferReader) -> PageCaption? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: Api.RichText? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageCaption.pageCaption(Cons_pageCaption(text: _1!, credit: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum PageListItem: TypeConstructorDescription { - public class Cons_pageListItemBlocks: TypeConstructorDescription { - public var blocks: [Api.PageBlock] - public init(blocks: [Api.PageBlock]) { - self.blocks = blocks - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageListItemBlocks", [("blocks", ConstructorParameterDescription(self.blocks))]) - } - } - public class Cons_pageListItemText: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageListItemText", [("text", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .pageListItemBlocks(let _data): - return ("pageListItemBlocks", [("blocks", ConstructorParameterDescription(_data.blocks))]) - case .pageListItemText(let _data): - return ("pageListItemText", [("text", ConstructorParameterDescription(_data.text))]) - } - } - - public static func parse_pageListItemBlocks(_ reader: BufferReader) -> PageListItem? { - var _1: [Api.PageBlock]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.PageListItem.pageListItemBlocks(Cons_pageListItemBlocks(blocks: _1!)) - } - else { - return nil - } - } - public static func parse_pageListItemText(_ reader: BufferReader) -> PageListItem? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.PageListItem.pageListItemText(Cons_pageListItemText(text: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum PageListOrderedItem: TypeConstructorDescription { - public class Cons_pageListOrderedItemBlocks: TypeConstructorDescription { - public var num: String - public var blocks: [Api.PageBlock] - public init(num: String, blocks: [Api.PageBlock]) { - self.num = num - self.blocks = blocks - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageListOrderedItemBlocks", [("num", ConstructorParameterDescription(self.num)), ("blocks", ConstructorParameterDescription(self.blocks))]) - } - } - public class Cons_pageListOrderedItemText: TypeConstructorDescription { - public var num: String - public var text: Api.RichText - public init(num: String, text: Api.RichText) { - self.num = num - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageListOrderedItemText", [("num", ConstructorParameterDescription(self.num)), ("text", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .pageListOrderedItemBlocks(let _data): - return ("pageListOrderedItemBlocks", [("num", ConstructorParameterDescription(_data.num)), ("blocks", ConstructorParameterDescription(_data.blocks))]) - case .pageListOrderedItemText(let _data): - return ("pageListOrderedItemText", [("num", ConstructorParameterDescription(_data.num)), ("text", ConstructorParameterDescription(_data.text))]) - } - } - - public static func parse_pageListOrderedItemBlocks(_ reader: BufferReader) -> PageListOrderedItem? { + public static func parse_nearestDc(_ reader: BufferReader) -> NearestDc? { var _1: String? _1 = parseString(reader) - var _2: [Api.PageBlock]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageListOrderedItem.pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks(num: _1!, blocks: _2!)) - } - else { - return nil - } - } - public static func parse_pageListOrderedItemText(_ reader: BufferReader) -> PageListOrderedItem? { - var _1: String? - _1 = parseString(reader) - var _2: Api.RichText? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PageListOrderedItem.pageListOrderedItemText(Cons_pageListOrderedItemText(num: _1!, text: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PageRelatedArticle: TypeConstructorDescription { - public class Cons_pageRelatedArticle: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageRelatedArticle", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photoId", ConstructorParameterDescription(self.photoId)), ("author", ConstructorParameterDescription(self.author)), ("publishedDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .pageRelatedArticle(let _data): - return ("pageRelatedArticle", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("author", ConstructorParameterDescription(_data.author)), ("publishedDate", ConstructorParameterDescription(_data.publishedDate))]) - } - } - - public static func parse_pageRelatedArticle(_ reader: BufferReader) -> PageRelatedArticle? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - var _6: Int64? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _6 = reader.readInt64() - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _7 = parseString(reader) - } - var _8: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _8 = reader.readInt32() - } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PageRelatedArticle.pageRelatedArticle(Cons_pageRelatedArticle(flags: _1!, url: _2!, webpageId: _3!, title: _4, description: _5, photoId: _6, author: _7, publishedDate: _8)) + if _c1 && _c2 && _c3 { + return Api.NearestDc.nearestDc(Cons_nearestDc(country: _1!, thisDc: _2!, nearestDc: _3!)) } else { return nil @@ -333,124 +55,99 @@ public extension Api { } } public extension Api { - indirect enum PageTableCell: TypeConstructorDescription { - public class Cons_pageTableCell: TypeConstructorDescription { - 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 + enum NotificationSound: TypeConstructorDescription { + public class Cons_notificationSoundLocal: TypeConstructorDescription { + public var title: String + public var data: String + public init(title: String, data: String) { + self.title = title + self.data = data } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageTableCell", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("colspan", ConstructorParameterDescription(self.colspan)), ("rowspan", ConstructorParameterDescription(self.rowspan))]) + return ("notificationSoundLocal", [("title", ConstructorParameterDescription(self.title)), ("data", ConstructorParameterDescription(self.data))]) } } - case pageTableCell(Cons_pageTableCell) + public class Cons_notificationSoundRingtone: TypeConstructorDescription { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("notificationSoundRingtone", [("id", ConstructorParameterDescription(self.id))]) + } + } + case notificationSoundDefault + case notificationSoundLocal(Cons_notificationSoundLocal) + case notificationSoundNone + case notificationSoundRingtone(Cons_notificationSoundRingtone) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .pageTableCell(let _data): + case .notificationSoundDefault: if boxed { - buffer.appendInt32(878078826) + buffer.appendInt32(-1746354498) } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 7) != 0 { - _data.text!.serialize(buffer, true) + break + case .notificationSoundLocal(let _data): + if boxed { + buffer.appendInt32(-2096391452) } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.colspan!, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + serializeString(_data.data, buffer: buffer, boxed: false) + break + case .notificationSoundNone: + if boxed { + buffer.appendInt32(1863070943) } - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeInt32(_data.rowspan!, buffer: buffer, boxed: false) + break + case .notificationSoundRingtone(let _data): + if boxed { + buffer.appendInt32(-9666487) } + serializeInt64(_data.id, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .pageTableCell(let _data): - return ("pageTableCell", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("colspan", ConstructorParameterDescription(_data.colspan)), ("rowspan", ConstructorParameterDescription(_data.rowspan))]) + case .notificationSoundDefault: + return ("notificationSoundDefault", []) + case .notificationSoundLocal(let _data): + return ("notificationSoundLocal", [("title", ConstructorParameterDescription(_data.title)), ("data", ConstructorParameterDescription(_data.data))]) + case .notificationSoundNone: + return ("notificationSoundNone", []) + case .notificationSoundRingtone(let _data): + return ("notificationSoundRingtone", [("id", ConstructorParameterDescription(_data.id))]) } } - public static func parse_pageTableCell(_ reader: BufferReader) -> PageTableCell? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.RichText? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.RichText - } - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt32() - } + public static func parse_notificationSoundDefault(_ reader: BufferReader) -> NotificationSound? { + return Api.NotificationSound.notificationSoundDefault + } + public static func parse_notificationSoundLocal(_ reader: BufferReader) -> NotificationSound? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PageTableCell.pageTableCell(Cons_pageTableCell(flags: _1!, text: _2, colspan: _3, rowspan: _4)) + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.NotificationSound.notificationSoundLocal(Cons_notificationSoundLocal(title: _1!, data: _2!)) } else { return nil } } - } -} -public extension Api { - enum PageTableRow: TypeConstructorDescription { - public class Cons_pageTableRow: TypeConstructorDescription { - public var cells: [Api.PageTableCell] - public init(cells: [Api.PageTableCell]) { - self.cells = cells - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pageTableRow", [("cells", ConstructorParameterDescription(self.cells))]) - } + public static func parse_notificationSoundNone(_ reader: BufferReader) -> NotificationSound? { + return Api.NotificationSound.notificationSoundNone } - 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, ConstructorParameterDescription)]) { - switch self { - case .pageTableRow(let _data): - return ("pageTableRow", [("cells", ConstructorParameterDescription(_data.cells))]) - } - } - - public static func parse_pageTableRow(_ reader: BufferReader) -> PageTableRow? { - var _1: [Api.PageTableCell]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageTableCell.self) - } + public static func parse_notificationSoundRingtone(_ reader: BufferReader) -> NotificationSound? { + var _1: Int64? + _1 = reader.readInt64() let _c1 = _1 != nil if _c1 { - return Api.PageTableRow.pageTableRow(Cons_pageTableRow(cells: _1!)) + return Api.NotificationSound.notificationSoundRingtone(Cons_notificationSoundRingtone(id: _1!)) } else { return nil @@ -459,66 +156,158 @@ public extension Api { } } public extension Api { - indirect enum PaidReactionPrivacy: TypeConstructorDescription { - public class Cons_paidReactionPrivacyPeer: TypeConstructorDescription { - public var peer: Api.InputPeer - public init(peer: Api.InputPeer) { + enum NotifyPeer: TypeConstructorDescription { + public class Cons_notifyForumTopic: TypeConstructorDescription { + public var peer: Api.Peer + public var topMsgId: Int32 + public init(peer: Api.Peer, topMsgId: Int32) { + self.peer = peer + self.topMsgId = topMsgId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("notifyForumTopic", [("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId))]) + } + } + public class Cons_notifyPeer: TypeConstructorDescription { + public var peer: Api.Peer + public init(peer: Api.Peer) { self.peer = peer } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(self.peer))]) + return ("notifyPeer", [("peer", ConstructorParameterDescription(self.peer))]) } } - case paidReactionPrivacyAnonymous - case paidReactionPrivacyDefault - case paidReactionPrivacyPeer(Cons_paidReactionPrivacyPeer) + case notifyBroadcasts + case notifyChats + case notifyForumTopic(Cons_notifyForumTopic) + case notifyPeer(Cons_notifyPeer) + case notifyUsers public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .paidReactionPrivacyAnonymous: + case .notifyBroadcasts: if boxed { - buffer.appendInt32(520887001) + buffer.appendInt32(-703403793) } break - case .paidReactionPrivacyDefault: + case .notifyChats: if boxed { - buffer.appendInt32(543872158) + buffer.appendInt32(-1073230141) } break - case .paidReactionPrivacyPeer(let _data): + case .notifyForumTopic(let _data): if boxed { - buffer.appendInt32(-596837136) + 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, ConstructorParameterDescription)]) { switch self { - case .paidReactionPrivacyAnonymous: - return ("paidReactionPrivacyAnonymous", []) - case .paidReactionPrivacyDefault: - return ("paidReactionPrivacyDefault", []) - case .paidReactionPrivacyPeer(let _data): - return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(_data.peer))]) + case .notifyBroadcasts: + return ("notifyBroadcasts", []) + case .notifyChats: + return ("notifyChats", []) + case .notifyForumTopic(let _data): + return ("notifyForumTopic", [("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId))]) + case .notifyPeer(let _data): + return ("notifyPeer", [("peer", ConstructorParameterDescription(_data.peer))]) + case .notifyUsers: + return ("notifyUsers", []) } } - public static func parse_paidReactionPrivacyAnonymous(_ reader: BufferReader) -> PaidReactionPrivacy? { - return Api.PaidReactionPrivacy.paidReactionPrivacyAnonymous + public static func parse_notifyBroadcasts(_ reader: BufferReader) -> NotifyPeer? { + return Api.NotifyPeer.notifyBroadcasts } - public static func parse_paidReactionPrivacyDefault(_ reader: BufferReader) -> PaidReactionPrivacy? { - return Api.PaidReactionPrivacy.paidReactionPrivacyDefault + public static func parse_notifyChats(_ reader: BufferReader) -> NotifyPeer? { + return Api.NotifyPeer.notifyChats } - public static func parse_paidReactionPrivacyPeer(_ reader: BufferReader) -> PaidReactionPrivacy? { - var _1: Api.InputPeer? + public static func parse_notifyForumTopic(_ reader: BufferReader) -> NotifyPeer? { + var _1: Api.Peer? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputPeer + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.NotifyPeer.notifyForumTopic(Cons_notifyForumTopic(peer: _1!, topMsgId: _2!)) + } + else { + return nil + } + } + public static func parse_notifyPeer(_ reader: BufferReader) -> NotifyPeer? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer } let _c1 = _1 != nil if _c1 { - return Api.PaidReactionPrivacy.paidReactionPrivacyPeer(Cons_paidReactionPrivacyPeer(peer: _1!)) + return Api.NotifyPeer.notifyPeer(Cons_notifyPeer(peer: _1!)) + } + else { + return nil + } + } + public static func parse_notifyUsers(_ reader: BufferReader) -> NotifyPeer? { + return Api.NotifyPeer.notifyUsers + } + } +} +public extension Api { + enum OutboxReadDate: TypeConstructorDescription { + public class Cons_outboxReadDate: TypeConstructorDescription { + public var date: Int32 + public init(date: Int32) { + self.date = date + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("outboxReadDate", [("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .outboxReadDate(let _data): + return ("outboxReadDate", [("date", ConstructorParameterDescription(_data.date))]) + } + } + + public static func parse_outboxReadDate(_ reader: BufferReader) -> OutboxReadDate? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.OutboxReadDate.outboxReadDate(Cons_outboxReadDate(date: _1!)) } else { return nil @@ -527,43 +316,53 @@ public extension Api { } } public extension Api { - enum Passkey: TypeConstructorDescription { - public class Cons_passkey: TypeConstructorDescription { + enum Page: TypeConstructorDescription { + public class Cons_page: TypeConstructorDescription { 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?) { + 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.id = id - self.name = name - self.date = date - self.softwareEmojiId = softwareEmojiId - self.lastUsageDate = lastUsageDate + self.url = url + self.blocks = blocks + self.photos = photos + self.documents = documents + self.views = views } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passkey", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("name", ConstructorParameterDescription(self.name)), ("date", ConstructorParameterDescription(self.date)), ("softwareEmojiId", ConstructorParameterDescription(self.softwareEmojiId)), ("lastUsageDate", ConstructorParameterDescription(self.lastUsageDate))]) + return ("page", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("blocks", ConstructorParameterDescription(self.blocks)), ("photos", ConstructorParameterDescription(self.photos)), ("documents", ConstructorParameterDescription(self.documents)), ("views", ConstructorParameterDescription(self.views))]) } } - case passkey(Cons_passkey) + case page(Cons_page) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .passkey(let _data): + case .page(let _data): if boxed { - buffer.appendInt32(-1738457409) + buffer.appendInt32(-1738178803) } 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) + 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) } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.lastUsageDate!, 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.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 } @@ -571,36 +370,40 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .passkey(let _data): - return ("passkey", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("name", ConstructorParameterDescription(_data.name)), ("date", ConstructorParameterDescription(_data.date)), ("softwareEmojiId", ConstructorParameterDescription(_data.softwareEmojiId)), ("lastUsageDate", ConstructorParameterDescription(_data.lastUsageDate))]) + case .page(let _data): + return ("page", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("photos", ConstructorParameterDescription(_data.photos)), ("documents", ConstructorParameterDescription(_data.documents)), ("views", ConstructorParameterDescription(_data.views))]) } } - public static func parse_passkey(_ reader: BufferReader) -> Passkey? { + public static func parse_page(_ reader: BufferReader) -> Page? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - var _5: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = reader.readInt64() + var _3: [Api.PageBlock]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + var _4: [Api.Photo]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self) + } + var _5: [Api.Document]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) } var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if Int(_1 ?? 0) & Int(1 << 3) != 0 { _6 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Passkey.passkey(Cons_passkey(flags: _1!, id: _2!, name: _3!, date: _4!, softwareEmojiId: _5, lastUsageDate: _6)) + return Api.Page.page(Cons_page(flags: _1!, url: _2!, blocks: _3!, photos: _4!, documents: _5!, views: _6)) } else { return nil @@ -609,1576 +412,1239 @@ public extension Api { } } public extension Api { - enum PasswordKdfAlgo: TypeConstructorDescription { - public class Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow: TypeConstructorDescription { - 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 + indirect enum PageBlock: TypeConstructorDescription { + public class Cons_inputPageBlockAudio: TypeConstructorDescription { + public var audio: Api.InputDocument + public var caption: Api.PageCaption + public init(audio: Api.InputDocument, caption: Api.PageCaption) { + self.audio = audio + self.caption = caption } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", ConstructorParameterDescription(self.salt1)), ("salt2", ConstructorParameterDescription(self.salt2)), ("g", ConstructorParameterDescription(self.g)), ("p", ConstructorParameterDescription(self.p))]) + return ("inputPageBlockAudio", [("audio", ConstructorParameterDescription(self.audio)), ("caption", ConstructorParameterDescription(self.caption))]) } } - case passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) - 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, ConstructorParameterDescription)]) { - switch self { - case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let _data): - return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", ConstructorParameterDescription(_data.salt1)), ("salt2", ConstructorParameterDescription(_data.salt2)), ("g", ConstructorParameterDescription(_data.g)), ("p", ConstructorParameterDescription(_data.p))]) - case .passwordKdfAlgoUnknown: - return ("passwordKdfAlgoUnknown", []) - } - } - - public static func parse_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(_ reader: BufferReader) -> PasswordKdfAlgo? { - var _1: Buffer? - _1 = parseBytes(reader) - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Int32? - _3 = reader.readInt32() - var _4: Buffer? - _4 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(salt1: _1!, salt2: _2!, g: _3!, p: _4!)) - } - else { - return nil - } - } - public static func parse_passwordKdfAlgoUnknown(_ reader: BufferReader) -> PasswordKdfAlgo? { - return Api.PasswordKdfAlgo.passwordKdfAlgoUnknown - } - } -} -public extension Api { - enum PaymentCharge: TypeConstructorDescription { - public class Cons_paymentCharge: TypeConstructorDescription { - public var id: String - public var providerChargeId: String - public init(id: String, providerChargeId: String) { - self.id = id - self.providerChargeId = providerChargeId + public class Cons_inputPageBlockMap: TypeConstructorDescription { + public var geo: Api.InputGeoPoint + public var zoom: Int32 + public var w: Int32 + public var h: Int32 + public var caption: Api.PageCaption + public init(geo: Api.InputGeoPoint, 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentCharge", [("id", ConstructorParameterDescription(self.id)), ("providerChargeId", ConstructorParameterDescription(self.providerChargeId))]) + return ("inputPageBlockMap", [("geo", ConstructorParameterDescription(self.geo)), ("zoom", ConstructorParameterDescription(self.zoom)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("caption", ConstructorParameterDescription(self.caption))]) } } - 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 class Cons_inputPageBlockOrderedList: TypeConstructorDescription { + public var flags: Int32 + public var items: [Api.InputPageListOrderedItem] + public var start: Int32? + public var type: String? + public init(flags: Int32, items: [Api.InputPageListOrderedItem], start: Int32?, type: String?) { + self.flags = flags + self.items = items + self.start = start + self.type = type + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPageBlockOrderedList", [("flags", ConstructorParameterDescription(self.flags)), ("items", ConstructorParameterDescription(self.items)), ("start", ConstructorParameterDescription(self.start)), ("type", ConstructorParameterDescription(self.type))]) } } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .paymentCharge(let _data): - return ("paymentCharge", [("id", ConstructorParameterDescription(_data.id)), ("providerChargeId", ConstructorParameterDescription(_data.providerChargeId))]) - } - } - - public static func parse_paymentCharge(_ reader: BufferReader) -> PaymentCharge? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PaymentCharge.paymentCharge(Cons_paymentCharge(id: _1!, providerChargeId: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PaymentFormMethod: TypeConstructorDescription { - public class Cons_paymentFormMethod: TypeConstructorDescription { - public var url: String - public var title: String - public init(url: String, title: String) { + public class Cons_inputPageBlockPhoto: TypeConstructorDescription { + public var flags: Int32 + public var photo: Api.InputPhoto + public var caption: Api.PageCaption + public var url: String? + public init(flags: Int32, photo: Api.InputPhoto, caption: Api.PageCaption, url: String?) { + self.flags = flags + self.photo = photo + self.caption = caption self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPageBlockPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photo", ConstructorParameterDescription(self.photo)), ("caption", ConstructorParameterDescription(self.caption)), ("url", ConstructorParameterDescription(self.url))]) + } + } + public class Cons_inputPageBlockVideo: TypeConstructorDescription { + public var flags: Int32 + public var video: Api.InputDocument + public var caption: Api.PageCaption + public init(flags: Int32, video: Api.InputDocument, caption: Api.PageCaption) { + self.flags = flags + self.video = video + self.caption = caption + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPageBlockVideo", [("flags", ConstructorParameterDescription(self.flags)), ("video", ConstructorParameterDescription(self.video)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockAnchor: TypeConstructorDescription { + public var name: String + public init(name: String) { + self.name = name + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockAnchor", [("name", ConstructorParameterDescription(self.name))]) + } + } + public class Cons_pageBlockAudio: TypeConstructorDescription { + public var audioId: Int64 + public var caption: Api.PageCaption + public init(audioId: Int64, caption: Api.PageCaption) { + self.audioId = audioId + self.caption = caption + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockAudio", [("audioId", ConstructorParameterDescription(self.audioId)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockAuthorDate: TypeConstructorDescription { + public var author: Api.RichText + public var publishedDate: Int32 + public init(author: Api.RichText, publishedDate: Int32) { + self.author = author + self.publishedDate = publishedDate + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockAuthorDate", [("author", ConstructorParameterDescription(self.author)), ("publishedDate", ConstructorParameterDescription(self.publishedDate))]) + } + } + public class Cons_pageBlockBlockquote: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockBlockquote", [("text", ConstructorParameterDescription(self.text)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockChannel: TypeConstructorDescription { + public var channel: Api.Chat + public init(channel: Api.Chat) { + self.channel = channel + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockChannel", [("channel", ConstructorParameterDescription(self.channel))]) + } + } + public class Cons_pageBlockCollage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockCollage", [("items", ConstructorParameterDescription(self.items)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockCover: TypeConstructorDescription { + public var cover: Api.PageBlock + public init(cover: Api.PageBlock) { + self.cover = cover + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockCover", [("cover", ConstructorParameterDescription(self.cover))]) + } + } + public class Cons_pageBlockDetails: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentFormMethod", [("url", ConstructorParameterDescription(self.url)), ("title", ConstructorParameterDescription(self.title))]) + return ("pageBlockDetails", [("flags", ConstructorParameterDescription(self.flags)), ("blocks", ConstructorParameterDescription(self.blocks)), ("title", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .paymentFormMethod(let _data): - return ("paymentFormMethod", [("url", ConstructorParameterDescription(_data.url)), ("title", ConstructorParameterDescription(_data.title))]) - } - } - - public static func parse_paymentFormMethod(_ reader: BufferReader) -> PaymentFormMethod? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PaymentFormMethod.paymentFormMethod(Cons_paymentFormMethod(url: _1!, title: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PaymentRequestedInfo: TypeConstructorDescription { - public class Cons_paymentRequestedInfo: TypeConstructorDescription { + public class Cons_pageBlockEmbed: TypeConstructorDescription { 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?) { + 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.name = name - self.phone = phone - self.email = email - self.shippingAddress = shippingAddress + self.url = url + self.html = html + self.posterPhotoId = posterPhotoId + self.w = w + self.h = h + self.caption = caption } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentRequestedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("name", ConstructorParameterDescription(self.name)), ("phone", ConstructorParameterDescription(self.phone)), ("email", ConstructorParameterDescription(self.email)), ("shippingAddress", ConstructorParameterDescription(self.shippingAddress))]) + return ("pageBlockEmbed", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("html", ConstructorParameterDescription(self.html)), ("posterPhotoId", ConstructorParameterDescription(self.posterPhotoId)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("caption", ConstructorParameterDescription(self.caption))]) } } - case paymentRequestedInfo(Cons_paymentRequestedInfo) + public class Cons_pageBlockEmbedPost: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockEmbedPost", [("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId)), ("authorPhotoId", ConstructorParameterDescription(self.authorPhotoId)), ("author", ConstructorParameterDescription(self.author)), ("date", ConstructorParameterDescription(self.date)), ("blocks", ConstructorParameterDescription(self.blocks)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockFooter: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockFooter", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockHeader: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeader", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockHeading1: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeading1", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockHeading2: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeading2", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockHeading3: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeading3", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockHeading4: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeading4", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockHeading5: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeading5", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockHeading6: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeading6", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockKicker: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockKicker", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockList: TypeConstructorDescription { + public var items: [Api.PageListItem] + public init(items: [Api.PageListItem]) { + self.items = items + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockList", [("items", ConstructorParameterDescription(self.items))]) + } + } + public class Cons_pageBlockMap: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockMap", [("geo", ConstructorParameterDescription(self.geo)), ("zoom", ConstructorParameterDescription(self.zoom)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockMath: TypeConstructorDescription { + public var source: String + public init(source: String) { + self.source = source + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockMath", [("source", ConstructorParameterDescription(self.source))]) + } + } + public class Cons_pageBlockOrderedList: TypeConstructorDescription { + public var items: [Api.PageListOrderedItem] + public init(items: [Api.PageListOrderedItem]) { + self.items = items + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockOrderedList", [("items", ConstructorParameterDescription(self.items))]) + } + } + public class Cons_pageBlockParagraph: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockParagraph", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockPhoto: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photoId", ConstructorParameterDescription(self.photoId)), ("caption", ConstructorParameterDescription(self.caption)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId))]) + } + } + public class Cons_pageBlockPreformatted: TypeConstructorDescription { + public var text: Api.RichText + public var language: String + public init(text: Api.RichText, language: String) { + self.text = text + self.language = language + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockPreformatted", [("text", ConstructorParameterDescription(self.text)), ("language", ConstructorParameterDescription(self.language))]) + } + } + public class Cons_pageBlockPullquote: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockPullquote", [("text", ConstructorParameterDescription(self.text)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockRelatedArticles: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockRelatedArticles", [("title", ConstructorParameterDescription(self.title)), ("articles", ConstructorParameterDescription(self.articles))]) + } + } + public class Cons_pageBlockSlideshow: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockSlideshow", [("items", ConstructorParameterDescription(self.items)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + public class Cons_pageBlockSubheader: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockSubheader", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockSubtitle: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockSubtitle", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockTable: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockTable", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("rows", ConstructorParameterDescription(self.rows))]) + } + } + public class Cons_pageBlockTitle: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockTitle", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_pageBlockVideo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockVideo", [("flags", ConstructorParameterDescription(self.flags)), ("videoId", ConstructorParameterDescription(self.videoId)), ("caption", ConstructorParameterDescription(self.caption))]) + } + } + case inputPageBlockAudio(Cons_inputPageBlockAudio) + case inputPageBlockMap(Cons_inputPageBlockMap) + case inputPageBlockOrderedList(Cons_inputPageBlockOrderedList) + case inputPageBlockPhoto(Cons_inputPageBlockPhoto) + case inputPageBlockVideo(Cons_inputPageBlockVideo) + 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(Cons_pageBlockEmbed) + case pageBlockEmbedPost(Cons_pageBlockEmbedPost) + case pageBlockFooter(Cons_pageBlockFooter) + case pageBlockHeader(Cons_pageBlockHeader) + case pageBlockHeading1(Cons_pageBlockHeading1) + case pageBlockHeading2(Cons_pageBlockHeading2) + case pageBlockHeading3(Cons_pageBlockHeading3) + case pageBlockHeading4(Cons_pageBlockHeading4) + case pageBlockHeading5(Cons_pageBlockHeading5) + case pageBlockHeading6(Cons_pageBlockHeading6) + case pageBlockKicker(Cons_pageBlockKicker) + case pageBlockList(Cons_pageBlockList) + case pageBlockMap(Cons_pageBlockMap) + case pageBlockMath(Cons_pageBlockMath) + 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(Cons_pageBlockVideo) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .paymentRequestedInfo(let _data): + case .inputPageBlockAudio(let _data): if boxed { - buffer.appendInt32(-1868808300) + buffer.appendInt32(-1715334046) + } + _data.audio.serialize(buffer, true) + _data.caption.serialize(buffer, true) + break + case .inputPageBlockMap(let _data): + if boxed { + buffer.appendInt32(1464557951) + } + _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 .inputPageBlockOrderedList(let _data): + if boxed { + buffer.appendInt32(-1186155733) } serializeInt32(_data.flags, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.items.count)) + for item in _data.items { + item.serialize(buffer, true) + } if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.name!, buffer: buffer, boxed: false) + serializeInt32(_data.start!, buffer: buffer, boxed: false) } if Int(_data.flags) & Int(1 << 1) != 0 { - serializeString(_data.phone!, buffer: buffer, boxed: false) + serializeString(_data.type!, buffer: buffer, boxed: false) + } + break + case .inputPageBlockPhoto(let _data): + if boxed { + buffer.appendInt32(719646565) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.photo.serialize(buffer, true) + _data.caption.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.url!, buffer: buffer, boxed: false) + } + break + case .inputPageBlockVideo(let _data): + if boxed { + buffer.appendInt32(-249943466) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.video.serialize(buffer, true) + _data.caption.serialize(buffer, true) + break + 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.email!, buffer: buffer, boxed: false) + serializeString(_data.html!, buffer: buffer, boxed: false) } - if Int(_data.flags) & Int(1 << 3) != 0 { - _data.shippingAddress!.serialize(buffer, true) + 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 - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .paymentRequestedInfo(let _data): - return ("paymentRequestedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("phone", ConstructorParameterDescription(_data.phone)), ("email", ConstructorParameterDescription(_data.email)), ("shippingAddress", ConstructorParameterDescription(_data.shippingAddress))]) - } - } - - public static func parse_paymentRequestedInfo(_ reader: BufferReader) -> PaymentRequestedInfo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = parseString(reader) - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = parseString(reader) - } - var _5: Api.PostAddress? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_paymentSavedCredentialsCard: TypeConstructorDescription { - public var id: String - public var title: String - public init(id: String, title: String) { - self.id = id - self.title = title - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title))]) - } - } - case paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .paymentSavedCredentialsCard(let _data): + case .pageBlockEmbedPost(let _data): if boxed { - buffer.appendInt32(-842892769) + buffer.appendInt32(-229005301) } - serializeString(_data.id, buffer: buffer, boxed: false) - serializeString(_data.title, buffer: buffer, boxed: false) + 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 .pageBlockHeading1(let _data): + if boxed { + buffer.appendInt32(-1157691601) + } + _data.text.serialize(buffer, true) + break + case .pageBlockHeading2(let _data): + if boxed { + buffer.appendInt32(158018284) + } + _data.text.serialize(buffer, true) + break + case .pageBlockHeading3(let _data): + if boxed { + buffer.appendInt32(1743204781) + } + _data.text.serialize(buffer, true) + break + case .pageBlockHeading4(let _data): + if boxed { + buffer.appendInt32(-1254983893) + } + _data.text.serialize(buffer, true) + break + case .pageBlockHeading5(let _data): + if boxed { + buffer.appendInt32(-608277398) + } + _data.text.serialize(buffer, true) + break + case .pageBlockHeading6(let _data): + if boxed { + buffer.appendInt32(1747599785) + } + _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 .pageBlockMath(let _data): + if boxed { + buffer.appendInt32(1493699616) + } + serializeString(_data.source, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { switch self { - case .paymentSavedCredentialsCard(let _data): - return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title))]) + case .inputPageBlockAudio(let _data): + return ("inputPageBlockAudio", [("audio", ConstructorParameterDescription(_data.audio)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .inputPageBlockMap(let _data): + return ("inputPageBlockMap", [("geo", ConstructorParameterDescription(_data.geo)), ("zoom", ConstructorParameterDescription(_data.zoom)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .inputPageBlockOrderedList(let _data): + return ("inputPageBlockOrderedList", [("flags", ConstructorParameterDescription(_data.flags)), ("items", ConstructorParameterDescription(_data.items)), ("start", ConstructorParameterDescription(_data.start)), ("type", ConstructorParameterDescription(_data.type))]) + case .inputPageBlockPhoto(let _data): + return ("inputPageBlockPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photo", ConstructorParameterDescription(_data.photo)), ("caption", ConstructorParameterDescription(_data.caption)), ("url", ConstructorParameterDescription(_data.url))]) + case .inputPageBlockVideo(let _data): + return ("inputPageBlockVideo", [("flags", ConstructorParameterDescription(_data.flags)), ("video", ConstructorParameterDescription(_data.video)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockAnchor(let _data): + return ("pageBlockAnchor", [("name", ConstructorParameterDescription(_data.name))]) + case .pageBlockAudio(let _data): + return ("pageBlockAudio", [("audioId", ConstructorParameterDescription(_data.audioId)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockAuthorDate(let _data): + return ("pageBlockAuthorDate", [("author", ConstructorParameterDescription(_data.author)), ("publishedDate", ConstructorParameterDescription(_data.publishedDate))]) + case .pageBlockBlockquote(let _data): + return ("pageBlockBlockquote", [("text", ConstructorParameterDescription(_data.text)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockChannel(let _data): + return ("pageBlockChannel", [("channel", ConstructorParameterDescription(_data.channel))]) + case .pageBlockCollage(let _data): + return ("pageBlockCollage", [("items", ConstructorParameterDescription(_data.items)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockCover(let _data): + return ("pageBlockCover", [("cover", ConstructorParameterDescription(_data.cover))]) + case .pageBlockDetails(let _data): + return ("pageBlockDetails", [("flags", ConstructorParameterDescription(_data.flags)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("title", ConstructorParameterDescription(_data.title))]) + case .pageBlockDivider: + return ("pageBlockDivider", []) + case .pageBlockEmbed(let _data): + return ("pageBlockEmbed", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("html", ConstructorParameterDescription(_data.html)), ("posterPhotoId", ConstructorParameterDescription(_data.posterPhotoId)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockEmbedPost(let _data): + return ("pageBlockEmbedPost", [("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId)), ("authorPhotoId", ConstructorParameterDescription(_data.authorPhotoId)), ("author", ConstructorParameterDescription(_data.author)), ("date", ConstructorParameterDescription(_data.date)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockFooter(let _data): + return ("pageBlockFooter", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockHeader(let _data): + return ("pageBlockHeader", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockHeading1(let _data): + return ("pageBlockHeading1", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockHeading2(let _data): + return ("pageBlockHeading2", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockHeading3(let _data): + return ("pageBlockHeading3", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockHeading4(let _data): + return ("pageBlockHeading4", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockHeading5(let _data): + return ("pageBlockHeading5", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockHeading6(let _data): + return ("pageBlockHeading6", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockKicker(let _data): + return ("pageBlockKicker", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockList(let _data): + return ("pageBlockList", [("items", ConstructorParameterDescription(_data.items))]) + case .pageBlockMap(let _data): + return ("pageBlockMap", [("geo", ConstructorParameterDescription(_data.geo)), ("zoom", ConstructorParameterDescription(_data.zoom)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockMath(let _data): + return ("pageBlockMath", [("source", ConstructorParameterDescription(_data.source))]) + case .pageBlockOrderedList(let _data): + return ("pageBlockOrderedList", [("items", ConstructorParameterDescription(_data.items))]) + case .pageBlockParagraph(let _data): + return ("pageBlockParagraph", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockPhoto(let _data): + return ("pageBlockPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("caption", ConstructorParameterDescription(_data.caption)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId))]) + case .pageBlockPreformatted(let _data): + return ("pageBlockPreformatted", [("text", ConstructorParameterDescription(_data.text)), ("language", ConstructorParameterDescription(_data.language))]) + case .pageBlockPullquote(let _data): + return ("pageBlockPullquote", [("text", ConstructorParameterDescription(_data.text)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockRelatedArticles(let _data): + return ("pageBlockRelatedArticles", [("title", ConstructorParameterDescription(_data.title)), ("articles", ConstructorParameterDescription(_data.articles))]) + case .pageBlockSlideshow(let _data): + return ("pageBlockSlideshow", [("items", ConstructorParameterDescription(_data.items)), ("caption", ConstructorParameterDescription(_data.caption))]) + case .pageBlockSubheader(let _data): + return ("pageBlockSubheader", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockSubtitle(let _data): + return ("pageBlockSubtitle", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockTable(let _data): + return ("pageBlockTable", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("rows", ConstructorParameterDescription(_data.rows))]) + case .pageBlockTitle(let _data): + return ("pageBlockTitle", [("text", ConstructorParameterDescription(_data.text))]) + case .pageBlockUnsupported: + return ("pageBlockUnsupported", []) + case .pageBlockVideo(let _data): + return ("pageBlockVideo", [("flags", ConstructorParameterDescription(_data.flags)), ("videoId", ConstructorParameterDescription(_data.videoId)), ("caption", ConstructorParameterDescription(_data.caption))]) } } - public static func parse_paymentSavedCredentialsCard(_ reader: BufferReader) -> PaymentSavedCredentials? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) + public static func parse_inputPageBlockAudio(_ reader: BufferReader) -> PageBlock? { + var _1: Api.InputDocument? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputDocument + } + var _2: Api.PageCaption? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PageCaption + } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.PaymentSavedCredentials.paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard(id: _1!, title: _2!)) + return Api.PageBlock.inputPageBlockAudio(Cons_inputPageBlockAudio(audio: _1!, caption: _2!)) } else { return nil } } - } -} -public extension Api { - enum Peer: TypeConstructorDescription { - public class Cons_peerChannel: TypeConstructorDescription { - public var channelId: Int64 - public init(channelId: Int64) { - self.channelId = channelId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerChannel", [("channelId", ConstructorParameterDescription(self.channelId))]) - } - } - public class Cons_peerChat: TypeConstructorDescription { - public var chatId: Int64 - public init(chatId: Int64) { - self.chatId = chatId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerChat", [("chatId", ConstructorParameterDescription(self.chatId))]) - } - } - public class Cons_peerUser: TypeConstructorDescription { - public var userId: Int64 - public init(userId: Int64) { - self.userId = userId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerUser", [("userId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerChannel(let _data): - return ("peerChannel", [("channelId", ConstructorParameterDescription(_data.channelId))]) - case .peerChat(let _data): - return ("peerChat", [("chatId", ConstructorParameterDescription(_data.chatId))]) - case .peerUser(let _data): - return ("peerUser", [("userId", ConstructorParameterDescription(_data.userId))]) - } - } - - public static func parse_peerChannel(_ reader: BufferReader) -> Peer? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Peer.peerChannel(Cons_peerChannel(channelId: _1!)) - } - else { - return nil - } - } - public static func parse_peerChat(_ reader: BufferReader) -> Peer? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Peer.peerChat(Cons_peerChat(chatId: _1!)) - } - else { - return nil - } - } - public static func parse_peerUser(_ reader: BufferReader) -> Peer? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Peer.peerUser(Cons_peerUser(userId: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PeerBlocked: TypeConstructorDescription { - public class Cons_peerBlocked: TypeConstructorDescription { - public var peerId: Api.Peer - public var date: Int32 - public init(peerId: Api.Peer, date: Int32) { - self.peerId = peerId - self.date = date - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerBlocked", [("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerBlocked(let _data): - return ("peerBlocked", [("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date))]) - } - } - - public static func parse_peerBlocked(_ reader: BufferReader) -> PeerBlocked? { - var _1: Api.Peer? + public static func parse_inputPageBlockMap(_ reader: BufferReader) -> PageBlock? { + var _1: Api.InputGeoPoint? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer + _1 = Api.parse(reader, signature: signature) as? Api.InputGeoPoint } var _2: Int32? _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PeerBlocked.peerBlocked(Cons_peerBlocked(peerId: _1!, date: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PeerColor: TypeConstructorDescription { - public class Cons_inputPeerColorCollectible: TypeConstructorDescription { - public var collectibleId: Int64 - public init(collectibleId: Int64) { - self.collectibleId = collectibleId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(self.collectibleId))]) - } - } - public class Cons_peerColor: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerColor", [("flags", ConstructorParameterDescription(self.flags)), ("color", ConstructorParameterDescription(self.color)), ("backgroundEmojiId", ConstructorParameterDescription(self.backgroundEmojiId))]) - } - } - public class Cons_peerColorCollectible: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerColorCollectible", [("flags", ConstructorParameterDescription(self.flags)), ("collectibleId", ConstructorParameterDescription(self.collectibleId)), ("giftEmojiId", ConstructorParameterDescription(self.giftEmojiId)), ("backgroundEmojiId", ConstructorParameterDescription(self.backgroundEmojiId)), ("accentColor", ConstructorParameterDescription(self.accentColor)), ("colors", ConstructorParameterDescription(self.colors)), ("darkAccentColor", ConstructorParameterDescription(self.darkAccentColor)), ("darkColors", ConstructorParameterDescription(self.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(_data.darkColors!.count)) - for item in _data.darkColors! { - serializeInt32(item, buffer: buffer, boxed: false) - } - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .inputPeerColorCollectible(let _data): - return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(_data.collectibleId))]) - case .peerColor(let _data): - return ("peerColor", [("flags", ConstructorParameterDescription(_data.flags)), ("color", ConstructorParameterDescription(_data.color)), ("backgroundEmojiId", ConstructorParameterDescription(_data.backgroundEmojiId))]) - case .peerColorCollectible(let _data): - return ("peerColorCollectible", [("flags", ConstructorParameterDescription(_data.flags)), ("collectibleId", ConstructorParameterDescription(_data.collectibleId)), ("giftEmojiId", ConstructorParameterDescription(_data.giftEmojiId)), ("backgroundEmojiId", ConstructorParameterDescription(_data.backgroundEmojiId)), ("accentColor", ConstructorParameterDescription(_data.accentColor)), ("colors", ConstructorParameterDescription(_data.colors)), ("darkAccentColor", ConstructorParameterDescription(_data.darkAccentColor)), ("darkColors", ConstructorParameterDescription(_data.darkColors))]) - } - } - - public static func parse_inputPeerColorCollectible(_ reader: BufferReader) -> PeerColor? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.PeerColor.inputPeerColorCollectible(Cons_inputPeerColorCollectible(collectibleId: _1!)) - } - else { - return nil - } - } - public static func parse_peerColor(_ reader: BufferReader) -> PeerColor? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int64? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt64() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.PeerColor.peerColor(Cons_peerColor(flags: _1!, color: _2, backgroundEmojiId: _3)) - } - else { - return nil - } - } - public static func parse_peerColorCollectible(_ reader: BufferReader) -> PeerColor? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int64? - _4 = reader.readInt64() - var _5: Int32? - _5 = reader.readInt32() - var _6: [Int32]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _7: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _7 = reader.readInt32() - } - var _8: [Int32]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Api.PageCaption? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.PageCaption } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PeerColor.peerColorCollectible(Cons_peerColorCollectible(flags: _1!, collectibleId: _2!, giftEmojiId: _3!, backgroundEmojiId: _4!, accentColor: _5!, colors: _6!, darkAccentColor: _7, darkColors: _8)) + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.PageBlock.inputPageBlockMap(Cons_inputPageBlockMap(geo: _1!, zoom: _2!, w: _3!, h: _4!, caption: _5!)) } else { return nil } } - } -} -public extension Api { - enum PeerLocated: TypeConstructorDescription { - public class Cons_peerLocated: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerLocated", [("peer", ConstructorParameterDescription(self.peer)), ("expires", ConstructorParameterDescription(self.expires)), ("distance", ConstructorParameterDescription(self.distance))]) - } - } - public class Cons_peerSelfLocated: TypeConstructorDescription { - public var expires: Int32 - public init(expires: Int32) { - self.expires = expires - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerSelfLocated", [("expires", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerLocated(let _data): - return ("peerLocated", [("peer", ConstructorParameterDescription(_data.peer)), ("expires", ConstructorParameterDescription(_data.expires)), ("distance", ConstructorParameterDescription(_data.distance))]) - case .peerSelfLocated(let _data): - return ("peerSelfLocated", [("expires", ConstructorParameterDescription(_data.expires))]) - } - } - - public static func parse_peerLocated(_ reader: BufferReader) -> PeerLocated? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.PeerLocated.peerLocated(Cons_peerLocated(peer: _1!, expires: _2!, distance: _3!)) - } - else { - return nil - } - } - public static func parse_peerSelfLocated(_ reader: BufferReader) -> PeerLocated? { + public static func parse_inputPageBlockOrderedList(_ reader: BufferReader) -> PageBlock? { var _1: Int32? _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.PeerLocated.peerSelfLocated(Cons_peerSelfLocated(expires: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PeerNotifySettings: TypeConstructorDescription { - public class Cons_peerNotifySettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerNotifySettings", [("flags", ConstructorParameterDescription(self.flags)), ("showPreviews", ConstructorParameterDescription(self.showPreviews)), ("silent", ConstructorParameterDescription(self.silent)), ("muteUntil", ConstructorParameterDescription(self.muteUntil)), ("iosSound", ConstructorParameterDescription(self.iosSound)), ("androidSound", ConstructorParameterDescription(self.androidSound)), ("otherSound", ConstructorParameterDescription(self.otherSound)), ("storiesMuted", ConstructorParameterDescription(self.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(self.storiesHideSender)), ("storiesIosSound", ConstructorParameterDescription(self.storiesIosSound)), ("storiesAndroidSound", ConstructorParameterDescription(self.storiesAndroidSound)), ("storiesOtherSound", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerNotifySettings(let _data): - return ("peerNotifySettings", [("flags", ConstructorParameterDescription(_data.flags)), ("showPreviews", ConstructorParameterDescription(_data.showPreviews)), ("silent", ConstructorParameterDescription(_data.silent)), ("muteUntil", ConstructorParameterDescription(_data.muteUntil)), ("iosSound", ConstructorParameterDescription(_data.iosSound)), ("androidSound", ConstructorParameterDescription(_data.androidSound)), ("otherSound", ConstructorParameterDescription(_data.otherSound)), ("storiesMuted", ConstructorParameterDescription(_data.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(_data.storiesHideSender)), ("storiesIosSound", ConstructorParameterDescription(_data.storiesIosSound)), ("storiesAndroidSound", ConstructorParameterDescription(_data.storiesAndroidSound)), ("storiesOtherSound", ConstructorParameterDescription(_data.storiesOtherSound))]) - } - } - - public static func parse_peerNotifySettings(_ reader: BufferReader) -> PeerNotifySettings? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Bool? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt32() - } - var _5: Api.NotificationSound? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _12 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - 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 { - public class Cons_peerSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerSettings", [("flags", ConstructorParameterDescription(self.flags)), ("geoDistance", ConstructorParameterDescription(self.geoDistance)), ("requestChatTitle", ConstructorParameterDescription(self.requestChatTitle)), ("requestChatDate", ConstructorParameterDescription(self.requestChatDate)), ("businessBotId", ConstructorParameterDescription(self.businessBotId)), ("businessBotManageUrl", ConstructorParameterDescription(self.businessBotManageUrl)), ("chargePaidMessageStars", ConstructorParameterDescription(self.chargePaidMessageStars)), ("registrationMonth", ConstructorParameterDescription(self.registrationMonth)), ("phoneCountry", ConstructorParameterDescription(self.phoneCountry)), ("nameChangeDate", ConstructorParameterDescription(self.nameChangeDate)), ("photoChangeDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerSettings(let _data): - return ("peerSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("geoDistance", ConstructorParameterDescription(_data.geoDistance)), ("requestChatTitle", ConstructorParameterDescription(_data.requestChatTitle)), ("requestChatDate", ConstructorParameterDescription(_data.requestChatDate)), ("businessBotId", ConstructorParameterDescription(_data.businessBotId)), ("businessBotManageUrl", ConstructorParameterDescription(_data.businessBotManageUrl)), ("chargePaidMessageStars", ConstructorParameterDescription(_data.chargePaidMessageStars)), ("registrationMonth", ConstructorParameterDescription(_data.registrationMonth)), ("phoneCountry", ConstructorParameterDescription(_data.phoneCountry)), ("nameChangeDate", ConstructorParameterDescription(_data.nameChangeDate)), ("photoChangeDate", ConstructorParameterDescription(_data.photoChangeDate))]) - } - } - - public static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _2 = reader.readInt32() - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 9) != 0 { - _3 = parseString(reader) - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 9) != 0 { - _4 = reader.readInt32() - } - var _5: Int64? - if Int(_1 ?? 0) & Int(1 << 13) != 0 { - _5 = reader.readInt64() - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 13) != 0 { - _6 = parseString(reader) - } - var _7: Int64? - if Int(_1 ?? 0) & Int(1 << 14) != 0 { - _7 = reader.readInt64() - } - var _8: String? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - _8 = parseString(reader) - } - var _9: String? - if Int(_1 ?? 0) & Int(1 << 16) != 0 { - _9 = parseString(reader) - } - var _10: Int32? - if Int(_1 ?? 0) & Int(1 << 17) != 0 { - _10 = reader.readInt32() - } - var _11: Int32? - if Int(_1 ?? 0) & Int(1 << 18) != 0 { - _11 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _11 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - 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 { - public class Cons_peerStories: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerStories", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("maxReadId", ConstructorParameterDescription(self.maxReadId)), ("stories", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerStories(let _data): - return ("peerStories", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("maxReadId", ConstructorParameterDescription(_data.maxReadId)), ("stories", ConstructorParameterDescription(_data.stories))]) - } - } - - public static func parse_peerStories(_ reader: BufferReader) -> PeerStories? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer + var _2: [Api.InputPageListOrderedItem]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputPageListOrderedItem.self) } var _3: Int32? if Int(_1 ?? 0) & 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) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PeerStories.peerStories(Cons_peerStories(flags: _1!, peer: _2!, maxReadId: _3, stories: _4!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PendingSuggestion: TypeConstructorDescription { - public class Cons_pendingSuggestion: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pendingSuggestion", [("suggestion", ConstructorParameterDescription(self.suggestion)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .pendingSuggestion(let _data): - return ("pendingSuggestion", [("suggestion", ConstructorParameterDescription(_data.suggestion)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("url", ConstructorParameterDescription(_data.url))]) - } - } - - public static func parse_pendingSuggestion(_ reader: BufferReader) -> PendingSuggestion? { - var _1: String? - _1 = parseString(reader) - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - var _3: Api.TextWithEntities? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } var _4: String? - _4 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PendingSuggestion.pendingSuggestion(Cons_pendingSuggestion(suggestion: _1!, title: _2!, description: _3!, url: _4!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PhoneCall: TypeConstructorDescription { - public class Cons_phoneCall: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCall", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("gAOrB", ConstructorParameterDescription(self.gAOrB)), ("keyFingerprint", ConstructorParameterDescription(self.keyFingerprint)), ("`protocol`", ConstructorParameterDescription(self.`protocol`)), ("connections", ConstructorParameterDescription(self.connections)), ("startDate", ConstructorParameterDescription(self.startDate)), ("customParameters", ConstructorParameterDescription(self.customParameters))]) - } - } - public class Cons_phoneCallAccepted: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCallAccepted", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("gB", ConstructorParameterDescription(self.gB)), ("`protocol`", ConstructorParameterDescription(self.`protocol`))]) - } - } - public class Cons_phoneCallDiscarded: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCallDiscarded", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("reason", ConstructorParameterDescription(self.reason)), ("duration", ConstructorParameterDescription(self.duration))]) - } - } - public class Cons_phoneCallEmpty: TypeConstructorDescription { - public var id: Int64 - public init(id: Int64) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCallEmpty", [("id", ConstructorParameterDescription(self.id))]) - } - } - public class Cons_phoneCallRequested: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCallRequested", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("gAHash", ConstructorParameterDescription(self.gAHash)), ("`protocol`", ConstructorParameterDescription(self.`protocol`))]) - } - } - public class Cons_phoneCallWaiting: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCallWaiting", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("`protocol`", ConstructorParameterDescription(self.`protocol`)), ("receiveDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .phoneCall(let _data): - return ("phoneCall", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("gAOrB", ConstructorParameterDescription(_data.gAOrB)), ("keyFingerprint", ConstructorParameterDescription(_data.keyFingerprint)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`)), ("connections", ConstructorParameterDescription(_data.connections)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("customParameters", ConstructorParameterDescription(_data.customParameters))]) - case .phoneCallAccepted(let _data): - return ("phoneCallAccepted", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("gB", ConstructorParameterDescription(_data.gB)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`))]) - case .phoneCallDiscarded(let _data): - return ("phoneCallDiscarded", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("reason", ConstructorParameterDescription(_data.reason)), ("duration", ConstructorParameterDescription(_data.duration))]) - case .phoneCallEmpty(let _data): - return ("phoneCallEmpty", [("id", ConstructorParameterDescription(_data.id))]) - case .phoneCallRequested(let _data): - return ("phoneCallRequested", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("gAHash", ConstructorParameterDescription(_data.gAHash)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`))]) - case .phoneCallWaiting(let _data): - return ("phoneCallWaiting", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`)), ("receiveDate", ConstructorParameterDescription(_data.receiveDate))]) - } - } - - public static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int64? - _5 = reader.readInt64() - var _6: Int64? - _6 = reader.readInt64() - var _7: Buffer? - _7 = parseBytes(reader) - var _8: Int64? - _8 = reader.readInt64() - var _9: Api.PhoneCallProtocol? - if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol - } - var _10: [Api.PhoneConnection]? - if let _ = reader.readInt32() { - _10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhoneConnection.self) - } - var _11: Int32? - _11 = reader.readInt32() - var _12: Api.DataJSON? - if Int(_1 ?? 0) & 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 - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = _10 != nil - let _c11 = _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _12 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - 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 - } - } - public static func parse_phoneCallAccepted(_ reader: BufferReader) -> PhoneCall? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int64? - _5 = reader.readInt64() - var _6: Int64? - _6 = reader.readInt64() - var _7: Buffer? - _7 = parseBytes(reader) - var _8: Api.PhoneCallProtocol? - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_phoneCallDiscarded(_ reader: BufferReader) -> PhoneCall? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.PhoneCallDiscardReason? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason - } - } - var _4: Int32? if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = reader.readInt32() + _4 = parseString(reader) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PhoneCall.phoneCallDiscarded(Cons_phoneCallDiscarded(flags: _1!, id: _2!, reason: _3, duration: _4)) + return Api.PageBlock.inputPageBlockOrderedList(Cons_inputPageBlockOrderedList(flags: _1!, items: _2!, start: _3, type: _4)) } else { return nil } } - public static func parse_phoneCallEmpty(_ reader: BufferReader) -> PhoneCall? { - var _1: Int64? - _1 = reader.readInt64() + public static func parse_inputPageBlockPhoto(_ reader: BufferReader) -> PageBlock? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.InputPhoto? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputPhoto + } + var _3: Api.PageCaption? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PageCaption + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PageBlock.inputPageBlockPhoto(Cons_inputPageBlockPhoto(flags: _1!, photo: _2!, caption: _3!, url: _4)) + } + else { + return nil + } + } + public static func parse_inputPageBlockVideo(_ reader: BufferReader) -> PageBlock? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.InputDocument? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.InputDocument + } + var _3: Api.PageCaption? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PageCaption + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.PageBlock.inputPageBlockVideo(Cons_inputPageBlockVideo(flags: _1!, video: _2!, caption: _3!)) + } + else { + return nil + } + } + public static func parse_pageBlockAnchor(_ reader: BufferReader) -> PageBlock? { + var _1: String? + _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.PhoneCall.phoneCallEmpty(Cons_phoneCallEmpty(id: _1!)) + return Api.PageBlock.pageBlockAnchor(Cons_pageBlockAnchor(name: _1!)) } else { return nil } } - public static func parse_phoneCallRequested(_ reader: BufferReader) -> PhoneCall? { + public static func parse_pageBlockAudio(_ reader: BufferReader) -> PageBlock? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.PageCaption? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PageCaption + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockAudio(Cons_pageBlockAudio(audioId: _1!, caption: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockAuthorDate(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockAuthorDate(Cons_pageBlockAuthorDate(author: _1!, publishedDate: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockBlockquote(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: Api.RichText? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockBlockquote(Cons_pageBlockBlockquote(text: _1!, caption: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockChannel(_ reader: BufferReader) -> PageBlock? { + var _1: Api.Chat? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Chat + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockChannel(Cons_pageBlockChannel(channel: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockCollage(_ reader: BufferReader) -> PageBlock? { + var _1: [Api.PageBlock]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + var _2: Api.PageCaption? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PageCaption + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockCollage(Cons_pageBlockCollage(items: _1!, caption: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockCover(_ reader: BufferReader) -> PageBlock? { + var _1: Api.PageBlock? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PageBlock + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockCover(Cons_pageBlockCover(cover: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockDetails(_ reader: BufferReader) -> PageBlock? { var _1: Int32? _1 = reader.readInt32() + var _2: [Api.PageBlock]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + var _3: Api.RichText? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.PageBlock.pageBlockDetails(Cons_pageBlockDetails(flags: _1!, blocks: _2!, title: _3!)) + } + else { + return nil + } + } + public static func parse_pageBlockDivider(_ reader: BufferReader) -> PageBlock? { + return Api.PageBlock.pageBlockDivider + } + public static func parse_pageBlockEmbed(_ reader: BufferReader) -> PageBlock? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _2 = parseString(reader) + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = parseString(reader) + } + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _5 = reader.readInt32() + } + var _6: Int32? + if Int(_1 ?? 0) & 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 + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.PageBlock.pageBlockEmbed(Cons_pageBlockEmbed(flags: _1!, url: _2, html: _3, posterPhotoId: _4, w: _5, h: _6, caption: _7!)) + } + else { + return nil + } + } + public static func parse_pageBlockEmbedPost(_ reader: BufferReader) -> PageBlock? { + var _1: String? + _1 = parseString(reader) var _2: Int64? _2 = reader.readInt64() var _3: Int64? _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int64? - _5 = reader.readInt64() - var _6: Int64? - _6 = reader.readInt64() - var _7: Buffer? - _7 = parseBytes(reader) - var _8: Api.PhoneCallProtocol? + var _4: String? + _4 = parseString(reader) + var _5: Int32? + _5 = reader.readInt32() + var _6: [Api.PageBlock]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + var _7: Api.PageCaption? if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol + _7 = Api.parse(reader, signature: signature) as? Api.PageCaption } let _c1 = _1 != nil let _c2 = _2 != nil @@ -2187,45 +1653,383 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PhoneCall.phoneCallRequested(Cons_phoneCallRequested(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, gAHash: _7!, protocol: _8!)) + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.PageBlock.pageBlockEmbedPost(Cons_pageBlockEmbedPost(url: _1!, webpageId: _2!, authorPhotoId: _3!, author: _4!, date: _5!, blocks: _6!, caption: _7!)) } else { return nil } } - public static func parse_phoneCallWaiting(_ reader: BufferReader) -> PhoneCall? { + public static func parse_pageBlockFooter(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockFooter(Cons_pageBlockFooter(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockHeader(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockHeader(Cons_pageBlockHeader(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockHeading1(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockHeading1(Cons_pageBlockHeading1(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockHeading2(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockHeading2(Cons_pageBlockHeading2(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockHeading3(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockHeading3(Cons_pageBlockHeading3(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockHeading4(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockHeading4(Cons_pageBlockHeading4(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockHeading5(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockHeading5(Cons_pageBlockHeading5(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockHeading6(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockHeading6(Cons_pageBlockHeading6(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockKicker(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockKicker(Cons_pageBlockKicker(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockList(_ reader: BufferReader) -> PageBlock? { + var _1: [Api.PageListItem]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageListItem.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockList(Cons_pageBlockList(items: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockMap(_ reader: BufferReader) -> PageBlock? { + var _1: Api.GeoPoint? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Api.PageCaption? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.PageCaption + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.PageBlock.pageBlockMap(Cons_pageBlockMap(geo: _1!, zoom: _2!, w: _3!, h: _4!, caption: _5!)) + } + else { + return nil + } + } + public static func parse_pageBlockMath(_ reader: BufferReader) -> PageBlock? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockMath(Cons_pageBlockMath(source: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockOrderedList(_ reader: BufferReader) -> PageBlock? { + var _1: [Api.PageListOrderedItem]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageListOrderedItem.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockOrderedList(Cons_pageBlockOrderedList(items: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockParagraph(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockParagraph(Cons_pageBlockParagraph(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockPhoto(_ reader: BufferReader) -> PageBlock? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int64? - _5 = reader.readInt64() - var _6: Int64? - _6 = reader.readInt64() - var _7: Api.PhoneCallProtocol? + var _3: Api.PageCaption? if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol + _3 = Api.parse(reader, signature: signature) as? Api.PageCaption } - var _8: Int32? + var _4: String? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _8 = reader.readInt32() + _4 = parseString(reader) + } + var _5: Int64? + if Int(_1 ?? 0) & 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 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.PhoneCall.phoneCallWaiting(Cons_phoneCallWaiting(flags: _1!, id: _2!, accessHash: _3!, date: _4!, adminId: _5!, participantId: _6!, protocol: _7!, receiveDate: _8)) + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.PageBlock.pageBlockPhoto(Cons_pageBlockPhoto(flags: _1!, photoId: _2!, caption: _3!, url: _4, webpageId: _5)) + } + else { + return nil + } + } + public static func parse_pageBlockPreformatted(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockPreformatted(Cons_pageBlockPreformatted(text: _1!, language: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockPullquote(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: Api.RichText? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockPullquote(Cons_pageBlockPullquote(text: _1!, caption: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockRelatedArticles(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: [Api.PageRelatedArticle]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageRelatedArticle.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockRelatedArticles(Cons_pageBlockRelatedArticles(title: _1!, articles: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockSlideshow(_ reader: BufferReader) -> PageBlock? { + var _1: [Api.PageBlock]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + var _2: Api.PageCaption? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PageCaption + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageBlock.pageBlockSlideshow(Cons_pageBlockSlideshow(items: _1!, caption: _2!)) + } + else { + return nil + } + } + public static func parse_pageBlockSubheader(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockSubheader(Cons_pageBlockSubheader(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockSubtitle(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockSubtitle(Cons_pageBlockSubtitle(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockTable(_ reader: BufferReader) -> PageBlock? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.RichText? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _3: [Api.PageTableRow]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageTableRow.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.PageBlock.pageBlockTable(Cons_pageBlockTable(flags: _1!, title: _2!, rows: _3!)) + } + else { + return nil + } + } + public static func parse_pageBlockTitle(_ reader: BufferReader) -> PageBlock? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.PageBlock.pageBlockTitle(Cons_pageBlockTitle(text: _1!)) + } + else { + return nil + } + } + public static func parse_pageBlockUnsupported(_ reader: BufferReader) -> PageBlock? { + return Api.PageBlock.pageBlockUnsupported + } + public static func parse_pageBlockVideo(_ reader: BufferReader) -> PageBlock? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.PageCaption? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PageCaption + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.PageBlock.pageBlockVideo(Cons_pageBlockVideo(flags: _1!, videoId: _2!, caption: _3!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api20.swift b/submodules/TelegramApi/Sources/Api20.swift index a630173cb1..d47874f004 100644 --- a/submodules/TelegramApi/Sources/Api20.swift +++ b/submodules/TelegramApi/Sources/Api20.swift @@ -1,123 +1,305 @@ public extension Api { - enum PhoneCallDiscardReason: TypeConstructorDescription { - public class Cons_phoneCallDiscardReasonMigrateConferenceCall: TypeConstructorDescription { - public var slug: String - public init(slug: String) { - self.slug = slug + indirect enum PageCaption: TypeConstructorDescription { + public class Cons_pageCaption: TypeConstructorDescription { + public var text: Api.RichText + public var credit: Api.RichText + public init(text: Api.RichText, credit: Api.RichText) { + self.text = text + self.credit = credit } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", ConstructorParameterDescription(self.slug))]) + return ("pageCaption", [("text", ConstructorParameterDescription(self.text)), ("credit", ConstructorParameterDescription(self.credit))]) } } - case phoneCallDiscardReasonBusy - case phoneCallDiscardReasonDisconnect - case phoneCallDiscardReasonHangup - case phoneCallDiscardReasonMigrateConferenceCall(Cons_phoneCallDiscardReasonMigrateConferenceCall) - case phoneCallDiscardReasonMissed + case pageCaption(Cons_pageCaption) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .phoneCallDiscardReasonBusy: + case .pageCaption(let _data): 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) + buffer.appendInt32(1869903447) } + _data.text.serialize(buffer, true) + _data.credit.serialize(buffer, true) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .phoneCallDiscardReasonBusy: - return ("phoneCallDiscardReasonBusy", []) - case .phoneCallDiscardReasonDisconnect: - return ("phoneCallDiscardReasonDisconnect", []) - case .phoneCallDiscardReasonHangup: - return ("phoneCallDiscardReasonHangup", []) - case .phoneCallDiscardReasonMigrateConferenceCall(let _data): - return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", ConstructorParameterDescription(_data.slug))]) - case .phoneCallDiscardReasonMissed: - return ("phoneCallDiscardReasonMissed", []) + case .pageCaption(let _data): + return ("pageCaption", [("text", ConstructorParameterDescription(_data.text)), ("credit", ConstructorParameterDescription(_data.credit))]) } } - public static func parse_phoneCallDiscardReasonBusy(_ reader: BufferReader) -> PhoneCallDiscardReason? { - return Api.PhoneCallDiscardReason.phoneCallDiscardReasonBusy - } - public static func parse_phoneCallDiscardReasonDisconnect(_ reader: BufferReader) -> PhoneCallDiscardReason? { - return Api.PhoneCallDiscardReason.phoneCallDiscardReasonDisconnect - } - public static func parse_phoneCallDiscardReasonHangup(_ reader: BufferReader) -> PhoneCallDiscardReason? { - return Api.PhoneCallDiscardReason.phoneCallDiscardReasonHangup - } - public static func parse_phoneCallDiscardReasonMigrateConferenceCall(_ reader: BufferReader) -> PhoneCallDiscardReason? { - var _1: String? - _1 = parseString(reader) + public static func parse_pageCaption(_ reader: BufferReader) -> PageCaption? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: Api.RichText? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } let _c1 = _1 != nil - if _c1 { - return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMigrateConferenceCall(Cons_phoneCallDiscardReasonMigrateConferenceCall(slug: _1!)) + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageCaption.pageCaption(Cons_pageCaption(text: _1!, credit: _2!)) } else { return nil } } - public static func parse_phoneCallDiscardReasonMissed(_ reader: BufferReader) -> PhoneCallDiscardReason? { - return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMissed + } +} +public extension Api { + indirect enum PageListItem: TypeConstructorDescription { + public class Cons_pageListItemBlocks: TypeConstructorDescription { + public var flags: Int32 + public var blocks: [Api.PageBlock] + public init(flags: Int32, blocks: [Api.PageBlock]) { + self.flags = flags + self.blocks = blocks + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageListItemBlocks", [("flags", ConstructorParameterDescription(self.flags)), ("blocks", ConstructorParameterDescription(self.blocks))]) + } + } + public class Cons_pageListItemText: TypeConstructorDescription { + public var flags: Int32 + public var text: Api.RichText + public init(flags: Int32, text: Api.RichText) { + self.flags = flags + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageListItemText", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.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(1674209194) + } + 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) + } + break + case .pageListItemText(let _data): + if boxed { + buffer.appendInt32(794323004) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .pageListItemBlocks(let _data): + return ("pageListItemBlocks", [("flags", ConstructorParameterDescription(_data.flags)), ("blocks", ConstructorParameterDescription(_data.blocks))]) + case .pageListItemText(let _data): + return ("pageListItemText", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text))]) + } + } + + public static func parse_pageListItemBlocks(_ reader: BufferReader) -> PageListItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.PageBlock]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageListItem.pageListItemBlocks(Cons_pageListItemBlocks(flags: _1!, blocks: _2!)) + } + else { + return nil + } + } + public static func parse_pageListItemText(_ reader: BufferReader) -> PageListItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.RichText? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PageListItem.pageListItemText(Cons_pageListItemText(flags: _1!, text: _2!)) + } + else { + return nil + } } } } public extension Api { - enum PhoneCallProtocol: TypeConstructorDescription { - public class Cons_phoneCallProtocol: TypeConstructorDescription { + indirect enum PageListOrderedItem: TypeConstructorDescription { + public class Cons_pageListOrderedItemBlocks: TypeConstructorDescription { 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]) { + public var num: String + public var blocks: [Api.PageBlock] + public init(flags: Int32, num: String, blocks: [Api.PageBlock]) { self.flags = flags - self.minLayer = minLayer - self.maxLayer = maxLayer - self.libraryVersions = libraryVersions + self.num = num + self.blocks = blocks } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCallProtocol", [("flags", ConstructorParameterDescription(self.flags)), ("minLayer", ConstructorParameterDescription(self.minLayer)), ("maxLayer", ConstructorParameterDescription(self.maxLayer)), ("libraryVersions", ConstructorParameterDescription(self.libraryVersions))]) + return ("pageListOrderedItemBlocks", [("flags", ConstructorParameterDescription(self.flags)), ("num", ConstructorParameterDescription(self.num)), ("blocks", ConstructorParameterDescription(self.blocks))]) } } - case phoneCallProtocol(Cons_phoneCallProtocol) + public class Cons_pageListOrderedItemText: TypeConstructorDescription { + public var flags: Int32 + public var num: String + public var text: Api.RichText + public init(flags: Int32, num: String, text: Api.RichText) { + self.flags = flags + self.num = num + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageListOrderedItemText", [("flags", ConstructorParameterDescription(self.flags)), ("num", ConstructorParameterDescription(self.num)), ("text", ConstructorParameterDescription(self.text))]) + } + } + case pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks) + case pageListOrderedItemText(Cons_pageListOrderedItemText) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .phoneCallProtocol(let _data): + case .pageListOrderedItemBlocks(let _data): if boxed { - buffer.appendInt32(-58224696) + buffer.appendInt32(1109995988) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt32(_data.minLayer, buffer: buffer, boxed: false) - serializeInt32(_data.maxLayer, buffer: buffer, boxed: false) + serializeString(_data.num, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.libraryVersions.count)) - for item in _data.libraryVersions { - serializeString(item, buffer: buffer, boxed: false) + buffer.appendInt32(Int32(_data.blocks.count)) + for item in _data.blocks { + item.serialize(buffer, true) + } + break + case .pageListOrderedItemText(let _data): + if boxed { + buffer.appendInt32(-851533770) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.num, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .pageListOrderedItemBlocks(let _data): + return ("pageListOrderedItemBlocks", [("flags", ConstructorParameterDescription(_data.flags)), ("num", ConstructorParameterDescription(_data.num)), ("blocks", ConstructorParameterDescription(_data.blocks))]) + case .pageListOrderedItemText(let _data): + return ("pageListOrderedItemText", [("flags", ConstructorParameterDescription(_data.flags)), ("num", ConstructorParameterDescription(_data.num)), ("text", ConstructorParameterDescription(_data.text))]) + } + } + + public static func parse_pageListOrderedItemBlocks(_ reader: BufferReader) -> PageListOrderedItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: [Api.PageBlock]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.PageListOrderedItem.pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks(flags: _1!, num: _2!, blocks: _3!)) + } + else { + return nil + } + } + public static func parse_pageListOrderedItemText(_ reader: BufferReader) -> PageListOrderedItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Api.RichText? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.PageListOrderedItem.pageListOrderedItemText(Cons_pageListOrderedItemText(flags: _1!, num: _2!, text: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PageRelatedArticle: TypeConstructorDescription { + public class Cons_pageRelatedArticle: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageRelatedArticle", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photoId", ConstructorParameterDescription(self.photoId)), ("author", ConstructorParameterDescription(self.author)), ("publishedDate", ConstructorParameterDescription(self.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 } @@ -125,167 +307,447 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .phoneCallProtocol(let _data): - return ("phoneCallProtocol", [("flags", ConstructorParameterDescription(_data.flags)), ("minLayer", ConstructorParameterDescription(_data.minLayer)), ("maxLayer", ConstructorParameterDescription(_data.maxLayer)), ("libraryVersions", ConstructorParameterDescription(_data.libraryVersions))]) + case .pageRelatedArticle(let _data): + return ("pageRelatedArticle", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("author", ConstructorParameterDescription(_data.author)), ("publishedDate", ConstructorParameterDescription(_data.publishedDate))]) } } - public static func parse_phoneCallProtocol(_ reader: BufferReader) -> PhoneCallProtocol? { + public static func parse_pageRelatedArticle(_ reader: BufferReader) -> PageRelatedArticle? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + var _6: Int64? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _6 = reader.readInt64() + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } + var _8: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 { + public class Cons_pageTableCell: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageTableCell", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("colspan", ConstructorParameterDescription(self.colspan)), ("rowspan", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .pageTableCell(let _data): + return ("pageTableCell", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("colspan", ConstructorParameterDescription(_data.colspan)), ("rowspan", ConstructorParameterDescription(_data.rowspan))]) + } + } + + public static func parse_pageTableCell(_ reader: BufferReader) -> PageTableCell? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.RichText? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.RichText + } + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PageTableCell.pageTableCell(Cons_pageTableCell(flags: _1!, text: _2, colspan: _3, rowspan: _4)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PageTableRow: TypeConstructorDescription { + public class Cons_pageTableRow: TypeConstructorDescription { + public var cells: [Api.PageTableCell] + public init(cells: [Api.PageTableCell]) { + self.cells = cells + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageTableRow", [("cells", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .pageTableRow(let _data): + return ("pageTableRow", [("cells", ConstructorParameterDescription(_data.cells))]) + } + } + + public static func parse_pageTableRow(_ reader: BufferReader) -> PageTableRow? { + var _1: [Api.PageTableCell]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageTableCell.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.PageTableRow.pageTableRow(Cons_pageTableRow(cells: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum PaidReactionPrivacy: TypeConstructorDescription { + public class Cons_paidReactionPrivacyPeer: TypeConstructorDescription { + public var peer: Api.InputPeer + public init(peer: Api.InputPeer) { + self.peer = peer + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(self.peer))]) + } + } + case paidReactionPrivacyAnonymous + case paidReactionPrivacyDefault + 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, ConstructorParameterDescription)]) { + switch self { + case .paidReactionPrivacyAnonymous: + return ("paidReactionPrivacyAnonymous", []) + case .paidReactionPrivacyDefault: + return ("paidReactionPrivacyDefault", []) + case .paidReactionPrivacyPeer(let _data): + return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(_data.peer))]) + } + } + + public static func parse_paidReactionPrivacyAnonymous(_ reader: BufferReader) -> PaidReactionPrivacy? { + return Api.PaidReactionPrivacy.paidReactionPrivacyAnonymous + } + public static func parse_paidReactionPrivacyDefault(_ reader: BufferReader) -> PaidReactionPrivacy? { + return Api.PaidReactionPrivacy.paidReactionPrivacyDefault + } + public static func parse_paidReactionPrivacyPeer(_ reader: BufferReader) -> PaidReactionPrivacy? { + var _1: Api.InputPeer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputPeer + } + let _c1 = _1 != nil + if _c1 { + return Api.PaidReactionPrivacy.paidReactionPrivacyPeer(Cons_paidReactionPrivacyPeer(peer: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum Passkey: TypeConstructorDescription { + public class Cons_passkey: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passkey", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("name", ConstructorParameterDescription(self.name)), ("date", ConstructorParameterDescription(self.date)), ("softwareEmojiId", ConstructorParameterDescription(self.softwareEmojiId)), ("lastUsageDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .passkey(let _data): + return ("passkey", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("name", ConstructorParameterDescription(_data.name)), ("date", ConstructorParameterDescription(_data.date)), ("softwareEmojiId", ConstructorParameterDescription(_data.softwareEmojiId)), ("lastUsageDate", ConstructorParameterDescription(_data.lastUsageDate))]) + } + } + + public static func parse_passkey(_ reader: BufferReader) -> Passkey? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: Int32? + _4 = reader.readInt32() + var _5: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _5 = reader.readInt64() + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", ConstructorParameterDescription(self.salt1)), ("salt2", ConstructorParameterDescription(self.salt2)), ("g", ConstructorParameterDescription(self.g)), ("p", ConstructorParameterDescription(self.p))]) + } + } + case passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow) + 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, ConstructorParameterDescription)]) { + switch self { + case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let _data): + return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", ConstructorParameterDescription(_data.salt1)), ("salt2", ConstructorParameterDescription(_data.salt2)), ("g", ConstructorParameterDescription(_data.g)), ("p", ConstructorParameterDescription(_data.p))]) + case .passwordKdfAlgoUnknown: + return ("passwordKdfAlgoUnknown", []) + } + } + + public static func parse_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(_ reader: BufferReader) -> PasswordKdfAlgo? { + var _1: Buffer? + _1 = parseBytes(reader) + var _2: Buffer? + _2 = parseBytes(reader) var _3: Int32? _3 = reader.readInt32() - var _4: [String]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } + var _4: Buffer? + _4 = parseBytes(reader) let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PhoneCallProtocol.phoneCallProtocol(Cons_phoneCallProtocol(flags: _1!, minLayer: _2!, maxLayer: _3!, libraryVersions: _4!)) + return Api.PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(salt1: _1!, salt2: _2!, g: _3!, p: _4!)) } else { return nil } } + public static func parse_passwordKdfAlgoUnknown(_ reader: BufferReader) -> PasswordKdfAlgo? { + return Api.PasswordKdfAlgo.passwordKdfAlgoUnknown + } } } public extension Api { - enum PhoneConnection: TypeConstructorDescription { - public class Cons_phoneConnection: TypeConstructorDescription { - 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 + enum PaymentCharge: TypeConstructorDescription { + public class Cons_paymentCharge: TypeConstructorDescription { + public var id: String + public var providerChargeId: String + public init(id: String, providerChargeId: String) { self.id = id - self.ip = ip - self.ipv6 = ipv6 - self.port = port - self.peerTag = peerTag + self.providerChargeId = providerChargeId } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneConnection", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("ip", ConstructorParameterDescription(self.ip)), ("ipv6", ConstructorParameterDescription(self.ipv6)), ("port", ConstructorParameterDescription(self.port)), ("peerTag", ConstructorParameterDescription(self.peerTag))]) + return ("paymentCharge", [("id", ConstructorParameterDescription(self.id)), ("providerChargeId", ConstructorParameterDescription(self.providerChargeId))]) } } - public class Cons_phoneConnectionWebrtc: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneConnectionWebrtc", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("ip", ConstructorParameterDescription(self.ip)), ("ipv6", ConstructorParameterDescription(self.ipv6)), ("port", ConstructorParameterDescription(self.port)), ("username", ConstructorParameterDescription(self.username)), ("password", ConstructorParameterDescription(self.password))]) - } - } - case phoneConnection(Cons_phoneConnection) - case phoneConnectionWebrtc(Cons_phoneConnectionWebrtc) + case paymentCharge(Cons_paymentCharge) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .phoneConnection(let _data): + case .paymentCharge(let _data): if boxed { - buffer.appendInt32(-1665063993) + buffer.appendInt32(-368917890) } - 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) + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.providerChargeId, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .phoneConnection(let _data): - return ("phoneConnection", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("ip", ConstructorParameterDescription(_data.ip)), ("ipv6", ConstructorParameterDescription(_data.ipv6)), ("port", ConstructorParameterDescription(_data.port)), ("peerTag", ConstructorParameterDescription(_data.peerTag))]) - case .phoneConnectionWebrtc(let _data): - return ("phoneConnectionWebrtc", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("ip", ConstructorParameterDescription(_data.ip)), ("ipv6", ConstructorParameterDescription(_data.ipv6)), ("port", ConstructorParameterDescription(_data.port)), ("username", ConstructorParameterDescription(_data.username)), ("password", ConstructorParameterDescription(_data.password))]) + case .paymentCharge(let _data): + return ("paymentCharge", [("id", ConstructorParameterDescription(_data.id)), ("providerChargeId", ConstructorParameterDescription(_data.providerChargeId))]) } } - public static func parse_phoneConnection(_ reader: BufferReader) -> PhoneConnection? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() - var _6: Buffer? - _6 = parseBytes(reader) + public static func parse_paymentCharge(_ reader: BufferReader) -> PaymentCharge? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.PhoneConnection.phoneConnection(Cons_phoneConnection(flags: _1!, id: _2!, ip: _3!, ipv6: _4!, port: _5!, peerTag: _6!)) - } - else { - return nil - } - } - public static func parse_phoneConnectionWebrtc(_ reader: BufferReader) -> PhoneConnection? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() - var _6: String? - _6 = parseString(reader) - var _7: String? - _7 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PhoneConnection.phoneConnectionWebrtc(Cons_phoneConnectionWebrtc(flags: _1!, id: _2!, ip: _3!, ipv6: _4!, port: _5!, username: _6!, password: _7!)) + if _c1 && _c2 { + return Api.PaymentCharge.paymentCharge(Cons_paymentCharge(id: _1!, providerChargeId: _2!)) } else { return nil @@ -294,1252 +756,522 @@ public extension Api { } } public extension Api { - enum Photo: TypeConstructorDescription { - public class Cons_photo: TypeConstructorDescription { - 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 + enum PaymentFormMethod: TypeConstructorDescription { + public class Cons_paymentFormMethod: TypeConstructorDescription { + public var url: String + public var title: String + public init(url: String, title: String) { + self.url = url + self.title = title } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photo", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference)), ("date", ConstructorParameterDescription(self.date)), ("sizes", ConstructorParameterDescription(self.sizes)), ("videoSizes", ConstructorParameterDescription(self.videoSizes)), ("dcId", ConstructorParameterDescription(self.dcId))]) + return ("paymentFormMethod", [("url", ConstructorParameterDescription(self.url)), ("title", ConstructorParameterDescription(self.title))]) } } - public class Cons_photoEmpty: TypeConstructorDescription { - public var id: Int64 - public init(id: Int64) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photoEmpty", [("id", ConstructorParameterDescription(self.id))]) - } - } - case photo(Cons_photo) - case photoEmpty(Cons_photoEmpty) + case paymentFormMethod(Cons_paymentFormMethod) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .photo(let _data): + case .paymentFormMethod(let _data): if boxed { - buffer.appendInt32(-82216347) + buffer.appendInt32(-1996951013) + } + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .paymentFormMethod(let _data): + return ("paymentFormMethod", [("url", ConstructorParameterDescription(_data.url)), ("title", ConstructorParameterDescription(_data.title))]) + } + } + + public static func parse_paymentFormMethod(_ reader: BufferReader) -> PaymentFormMethod? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PaymentFormMethod.paymentFormMethod(Cons_paymentFormMethod(url: _1!, title: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PaymentRequestedInfo: TypeConstructorDescription { + public class Cons_paymentRequestedInfo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentRequestedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("name", ConstructorParameterDescription(self.name)), ("phone", ConstructorParameterDescription(self.phone)), ("email", ConstructorParameterDescription(self.email)), ("shippingAddress", ConstructorParameterDescription(self.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) - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt64(_data.accessHash, buffer: buffer, boxed: false) - serializeBytes(_data.fileReference, 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, ConstructorParameterDescription)]) { + switch self { + case .paymentRequestedInfo(let _data): + return ("paymentRequestedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("phone", ConstructorParameterDescription(_data.phone)), ("email", ConstructorParameterDescription(_data.email)), ("shippingAddress", ConstructorParameterDescription(_data.shippingAddress))]) + } + } + + public static func parse_paymentRequestedInfo(_ reader: BufferReader) -> PaymentRequestedInfo? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = parseString(reader) + } + var _5: Api.PostAddress? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_paymentSavedCredentialsCard: TypeConstructorDescription { + public var id: String + public var title: String + public init(id: String, title: String) { + self.id = id + self.title = title + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .paymentSavedCredentialsCard(let _data): + return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title))]) + } + } + + public static func parse_paymentSavedCredentialsCard(_ reader: BufferReader) -> PaymentSavedCredentials? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PaymentSavedCredentials.paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard(id: _1!, title: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum Peer: TypeConstructorDescription { + public class Cons_peerChannel: TypeConstructorDescription { + public var channelId: Int64 + public init(channelId: Int64) { + self.channelId = channelId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerChannel", [("channelId", ConstructorParameterDescription(self.channelId))]) + } + } + public class Cons_peerChat: TypeConstructorDescription { + public var chatId: Int64 + public init(chatId: Int64) { + self.chatId = chatId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerChat", [("chatId", ConstructorParameterDescription(self.chatId))]) + } + } + public class Cons_peerUser: TypeConstructorDescription { + public var userId: Int64 + public init(userId: Int64) { + self.userId = userId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerUser", [("userId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .peerChannel(let _data): + return ("peerChannel", [("channelId", ConstructorParameterDescription(_data.channelId))]) + case .peerChat(let _data): + return ("peerChat", [("chatId", ConstructorParameterDescription(_data.chatId))]) + case .peerUser(let _data): + return ("peerUser", [("userId", ConstructorParameterDescription(_data.userId))]) + } + } + + public static func parse_peerChannel(_ reader: BufferReader) -> Peer? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Peer.peerChannel(Cons_peerChannel(channelId: _1!)) + } + else { + return nil + } + } + public static func parse_peerChat(_ reader: BufferReader) -> Peer? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Peer.peerChat(Cons_peerChat(chatId: _1!)) + } + else { + return nil + } + } + public static func parse_peerUser(_ reader: BufferReader) -> Peer? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Peer.peerUser(Cons_peerUser(userId: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PeerBlocked: TypeConstructorDescription { + public class Cons_peerBlocked: TypeConstructorDescription { + public var peerId: Api.Peer + public var date: Int32 + public init(peerId: Api.Peer, date: Int32) { + self.peerId = peerId + self.date = date + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerBlocked", [("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .peerBlocked(let _data): + return ("peerBlocked", [("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date))]) + } + } + + public static func parse_peerBlocked(_ reader: BufferReader) -> PeerBlocked? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PeerBlocked.peerBlocked(Cons_peerBlocked(peerId: _1!, date: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PeerColor: TypeConstructorDescription { + public class Cons_inputPeerColorCollectible: TypeConstructorDescription { + public var collectibleId: Int64 + public init(collectibleId: Int64) { + self.collectibleId = collectibleId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(self.collectibleId))]) + } + } + public class Cons_peerColor: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerColor", [("flags", ConstructorParameterDescription(self.flags)), ("color", ConstructorParameterDescription(self.color)), ("backgroundEmojiId", ConstructorParameterDescription(self.backgroundEmojiId))]) + } + } + public class Cons_peerColorCollectible: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerColorCollectible", [("flags", ConstructorParameterDescription(self.flags)), ("collectibleId", ConstructorParameterDescription(self.collectibleId)), ("giftEmojiId", ConstructorParameterDescription(self.giftEmojiId)), ("backgroundEmojiId", ConstructorParameterDescription(self.backgroundEmojiId)), ("accentColor", ConstructorParameterDescription(self.accentColor)), ("colors", ConstructorParameterDescription(self.colors)), ("darkAccentColor", ConstructorParameterDescription(self.darkAccentColor)), ("darkColors", ConstructorParameterDescription(self.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.sizes.count)) - for item in _data.sizes { - item.serialize(buffer, true) + 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(_data.videoSizes!.count)) - for item in _data.videoSizes! { - item.serialize(buffer, true) + buffer.appendInt32(Int32(_data.darkColors!.count)) + for item in _data.darkColors! { + serializeInt32(item, buffer: buffer, boxed: false) } } - 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, ConstructorParameterDescription)]) { switch self { - case .photo(let _data): - return ("photo", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference)), ("date", ConstructorParameterDescription(_data.date)), ("sizes", ConstructorParameterDescription(_data.sizes)), ("videoSizes", ConstructorParameterDescription(_data.videoSizes)), ("dcId", ConstructorParameterDescription(_data.dcId))]) - case .photoEmpty(let _data): - return ("photoEmpty", [("id", ConstructorParameterDescription(_data.id))]) + case .inputPeerColorCollectible(let _data): + return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(_data.collectibleId))]) + case .peerColor(let _data): + return ("peerColor", [("flags", ConstructorParameterDescription(_data.flags)), ("color", ConstructorParameterDescription(_data.color)), ("backgroundEmojiId", ConstructorParameterDescription(_data.backgroundEmojiId))]) + case .peerColorCollectible(let _data): + return ("peerColorCollectible", [("flags", ConstructorParameterDescription(_data.flags)), ("collectibleId", ConstructorParameterDescription(_data.collectibleId)), ("giftEmojiId", ConstructorParameterDescription(_data.giftEmojiId)), ("backgroundEmojiId", ConstructorParameterDescription(_data.backgroundEmojiId)), ("accentColor", ConstructorParameterDescription(_data.accentColor)), ("colors", ConstructorParameterDescription(_data.colors)), ("darkAccentColor", ConstructorParameterDescription(_data.darkAccentColor)), ("darkColors", ConstructorParameterDescription(_data.darkColors))]) } } - public static func parse_photo(_ reader: BufferReader) -> Photo? { + public static func parse_inputPeerColorCollectible(_ reader: BufferReader) -> PeerColor? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.PeerColor.inputPeerColorCollectible(Cons_inputPeerColorCollectible(collectibleId: _1!)) + } + else { + return nil + } + } + public static func parse_peerColor(_ reader: BufferReader) -> PeerColor? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + var _3: Int64? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt64() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.PeerColor.peerColor(Cons_peerColor(flags: _1!, color: _2, backgroundEmojiId: _3)) + } + else { + return nil + } + } + public static func parse_peerColorCollectible(_ reader: BufferReader) -> PeerColor? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() var _3: Int64? _3 = reader.readInt64() - var _4: Buffer? - _4 = parseBytes(reader) + var _4: Int64? + _4 = reader.readInt64() var _5: Int32? _5 = reader.readInt32() - var _6: [Api.PhotoSize]? + var _6: [Int32]? if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) + _6 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } - var _7: [Api.VideoSize]? - if Int(_1 ?? 0) & 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 - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_photoEmpty(_ reader: BufferReader) -> Photo? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Photo.photoEmpty(Cons_photoEmpty(id: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PhotoSize: TypeConstructorDescription { - public class Cons_photoCachedSize: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photoCachedSize", [("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("bytes", ConstructorParameterDescription(self.bytes))]) - } - } - public class Cons_photoPathSize: TypeConstructorDescription { - public var type: String - public var bytes: Buffer - public init(type: String, bytes: Buffer) { - self.type = type - self.bytes = bytes - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photoPathSize", [("type", ConstructorParameterDescription(self.type)), ("bytes", ConstructorParameterDescription(self.bytes))]) - } - } - public class Cons_photoSize: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photoSize", [("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("size", ConstructorParameterDescription(self.size))]) - } - } - public class Cons_photoSizeEmpty: TypeConstructorDescription { - public var type: String - public init(type: String) { - self.type = type - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photoSizeEmpty", [("type", ConstructorParameterDescription(self.type))]) - } - } - public class Cons_photoSizeProgressive: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photoSizeProgressive", [("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("sizes", ConstructorParameterDescription(self.sizes))]) - } - } - public class Cons_photoStrippedSize: TypeConstructorDescription { - public var type: String - public var bytes: Buffer - public init(type: String, bytes: Buffer) { - self.type = type - self.bytes = bytes - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photoStrippedSize", [("type", ConstructorParameterDescription(self.type)), ("bytes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .photoCachedSize(let _data): - return ("photoCachedSize", [("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("bytes", ConstructorParameterDescription(_data.bytes))]) - case .photoPathSize(let _data): - return ("photoPathSize", [("type", ConstructorParameterDescription(_data.type)), ("bytes", ConstructorParameterDescription(_data.bytes))]) - case .photoSize(let _data): - return ("photoSize", [("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("size", ConstructorParameterDescription(_data.size))]) - case .photoSizeEmpty(let _data): - return ("photoSizeEmpty", [("type", ConstructorParameterDescription(_data.type))]) - case .photoSizeProgressive(let _data): - return ("photoSizeProgressive", [("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("sizes", ConstructorParameterDescription(_data.sizes))]) - case .photoStrippedSize(let _data): - return ("photoStrippedSize", [("type", ConstructorParameterDescription(_data.type)), ("bytes", ConstructorParameterDescription(_data.bytes))]) - } - } - - public static func parse_photoCachedSize(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Buffer? - _4 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PhotoSize.photoCachedSize(Cons_photoCachedSize(type: _1!, w: _2!, h: _3!, bytes: _4!)) - } - else { - return nil - } - } - public static func parse_photoPathSize(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PhotoSize.photoPathSize(Cons_photoPathSize(type: _1!, bytes: _2!)) - } - else { - return nil - } - } - public static func parse_photoSize(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PhotoSize.photoSize(Cons_photoSize(type: _1!, w: _2!, h: _3!, size: _4!)) - } - else { - return nil - } - } - public static func parse_photoSizeEmpty(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.PhotoSize.photoSizeEmpty(Cons_photoSizeEmpty(type: _1!)) - } - else { - return nil - } - } - public static func parse_photoSizeProgressive(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: [Int32]? - 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 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PhotoSize.photoSizeProgressive(Cons_photoSizeProgressive(type: _1!, w: _2!, h: _3!, sizes: _4!)) - } - else { - return nil - } - } - public static func parse_photoStrippedSize(_ reader: BufferReader) -> PhotoSize? { - var _1: String? - _1 = parseString(reader) - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PhotoSize.photoStrippedSize(Cons_photoStrippedSize(type: _1!, bytes: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum Poll: TypeConstructorDescription { - public class Cons_poll: TypeConstructorDescription { - 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 var countriesIso2: [String]? - public var hash: Int64 - public init(id: Int64, flags: Int32, question: Api.TextWithEntities, answers: [Api.PollAnswer], closePeriod: Int32?, closeDate: Int32?, countriesIso2: [String]?, hash: Int64) { - self.id = id - self.flags = flags - self.question = question - self.answers = answers - self.closePeriod = closePeriod - self.closeDate = closeDate - self.countriesIso2 = countriesIso2 - self.hash = hash - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("poll", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags)), ("question", ConstructorParameterDescription(self.question)), ("answers", ConstructorParameterDescription(self.answers)), ("closePeriod", ConstructorParameterDescription(self.closePeriod)), ("closeDate", ConstructorParameterDescription(self.closeDate)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("hash", ConstructorParameterDescription(self.hash))]) - } - } - case poll(Cons_poll) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .poll(let _data): - if boxed { - buffer.appendInt32(-1771164225) - } - 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) - } - if Int(_data.flags) & Int(1 << 12) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.countriesIso2!.count)) - for item in _data.countriesIso2! { - serializeString(item, buffer: buffer, boxed: false) - } - } - serializeInt64(_data.hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .poll(let _data): - return ("poll", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags)), ("question", ConstructorParameterDescription(_data.question)), ("answers", ConstructorParameterDescription(_data.answers)), ("closePeriod", ConstructorParameterDescription(_data.closePeriod)), ("closeDate", ConstructorParameterDescription(_data.closeDate)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("hash", ConstructorParameterDescription(_data.hash))]) - } - } - - public static func parse_poll(_ reader: BufferReader) -> Poll? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.TextWithEntities? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - var _4: [Api.PollAnswer]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PollAnswer.self) - } - var _5: Int32? - if Int(_2 ?? 0) & Int(1 << 4) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_2 ?? 0) & Int(1 << 5) != 0 { - _6 = reader.readInt32() - } - var _7: [String]? - if Int(_2 ?? 0) & Int(1 << 12) != 0 { - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - } - var _8: Int64? - _8 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_2 ?? 0) & Int(1 << 4) == 0) || _5 != nil - let _c6 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _6 != nil - let _c7 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Poll.poll(Cons_poll(id: _1!, flags: _2!, question: _3!, answers: _4!, closePeriod: _5, closeDate: _6, countriesIso2: _7, hash: _8!)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum PollAnswer: TypeConstructorDescription { - public class Cons_inputPollAnswer: TypeConstructorDescription { - public var flags: Int32 - public var text: Api.TextWithEntities - public var media: Api.InputMedia? - public init(flags: Int32, text: Api.TextWithEntities, media: Api.InputMedia?) { - self.flags = flags - self.text = text - self.media = media - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inputPollAnswer", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("media", ConstructorParameterDescription(self.media))]) - } - } - public class Cons_pollAnswer: TypeConstructorDescription { - public var flags: Int32 - public var text: Api.TextWithEntities - public var option: Buffer - public var media: Api.MessageMedia? - public var addedBy: Api.Peer? - public var date: Int32? - public init(flags: Int32, text: Api.TextWithEntities, option: Buffer, media: Api.MessageMedia?, addedBy: Api.Peer?, date: Int32?) { - self.flags = flags - self.text = text - self.option = option - self.media = media - self.addedBy = addedBy - self.date = date - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pollAnswer", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.option)), ("media", ConstructorParameterDescription(self.media)), ("addedBy", ConstructorParameterDescription(self.addedBy)), ("date", ConstructorParameterDescription(self.date))]) - } - } - case inputPollAnswer(Cons_inputPollAnswer) - case pollAnswer(Cons_pollAnswer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .inputPollAnswer(let _data): - if boxed { - buffer.appendInt32(429911446) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.text.serialize(buffer, true) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.media!.serialize(buffer, true) - } - break - case .pollAnswer(let _data): - if boxed { - buffer.appendInt32(1266514026) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.text.serialize(buffer, true) - serializeBytes(_data.option, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.media!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - _data.addedBy!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.date!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .inputPollAnswer(let _data): - return ("inputPollAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("media", ConstructorParameterDescription(_data.media))]) - case .pollAnswer(let _data): - return ("pollAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option)), ("media", ConstructorParameterDescription(_data.media)), ("addedBy", ConstructorParameterDescription(_data.addedBy)), ("date", ConstructorParameterDescription(_data.date))]) - } - } - - public static func parse_inputPollAnswer(_ reader: BufferReader) -> PollAnswer? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - var _3: Api.InputMedia? + var _7: Int32? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.InputMedia - } + _7 = reader.readInt32() } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.PollAnswer.inputPollAnswer(Cons_inputPollAnswer(flags: _1!, text: _2!, media: _3)) - } - else { - return nil - } - } - public static func parse_pollAnswer(_ reader: BufferReader) -> PollAnswer? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - var _3: Buffer? - _3 = parseBytes(reader) - var _4: Api.MessageMedia? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - } - var _5: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _6 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.PollAnswer.pollAnswer(Cons_pollAnswer(flags: _1!, text: _2!, option: _3!, media: _4, addedBy: _5, date: _6)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PollAnswerVoters: TypeConstructorDescription { - public class Cons_pollAnswerVoters: TypeConstructorDescription { - public var flags: Int32 - public var option: Buffer - public var voters: Int32? - public var recentVoters: [Api.Peer]? - public init(flags: Int32, option: Buffer, voters: Int32?, recentVoters: [Api.Peer]?) { - self.flags = flags - self.option = option - self.voters = voters - self.recentVoters = recentVoters - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pollAnswerVoters", [("flags", ConstructorParameterDescription(self.flags)), ("option", ConstructorParameterDescription(self.option)), ("voters", ConstructorParameterDescription(self.voters)), ("recentVoters", ConstructorParameterDescription(self.recentVoters))]) - } - } - case pollAnswerVoters(Cons_pollAnswerVoters) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pollAnswerVoters(let _data): - if boxed { - buffer.appendInt32(910500618) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeBytes(_data.option, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeInt32(_data.voters!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.recentVoters!.count)) - for item in _data.recentVoters! { - item.serialize(buffer, true) - } - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .pollAnswerVoters(let _data): - return ("pollAnswerVoters", [("flags", ConstructorParameterDescription(_data.flags)), ("option", ConstructorParameterDescription(_data.option)), ("voters", ConstructorParameterDescription(_data.voters)), ("recentVoters", ConstructorParameterDescription(_data.recentVoters))]) - } - } - - public static func parse_pollAnswerVoters(_ reader: BufferReader) -> PollAnswerVoters? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = reader.readInt32() - } - var _4: [Api.Peer]? - if Int(_1 ?? 0) & Int(1 << 2) != 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 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PollAnswerVoters.pollAnswerVoters(Cons_pollAnswerVoters(flags: _1!, option: _2!, voters: _3, recentVoters: _4)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum PollResults: TypeConstructorDescription { - public class Cons_pollResults: TypeConstructorDescription { - 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 var solutionMedia: Api.MessageMedia? - public init(flags: Int32, results: [Api.PollAnswerVoters]?, totalVoters: Int32?, recentVoters: [Api.Peer]?, solution: String?, solutionEntities: [Api.MessageEntity]?, solutionMedia: Api.MessageMedia?) { - self.flags = flags - self.results = results - self.totalVoters = totalVoters - self.recentVoters = recentVoters - self.solution = solution - self.solutionEntities = solutionEntities - self.solutionMedia = solutionMedia - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pollResults", [("flags", ConstructorParameterDescription(self.flags)), ("results", ConstructorParameterDescription(self.results)), ("totalVoters", ConstructorParameterDescription(self.totalVoters)), ("recentVoters", ConstructorParameterDescription(self.recentVoters)), ("solution", ConstructorParameterDescription(self.solution)), ("solutionEntities", ConstructorParameterDescription(self.solutionEntities)), ("solutionMedia", ConstructorParameterDescription(self.solutionMedia))]) - } - } - case pollResults(Cons_pollResults) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pollResults(let _data): - if boxed { - buffer.appendInt32(-1166298786) - } - 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) - } - } - 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(_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(_data.flags) & Int(1 << 5) != 0 { - _data.solutionMedia!.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .pollResults(let _data): - return ("pollResults", [("flags", ConstructorParameterDescription(_data.flags)), ("results", ConstructorParameterDescription(_data.results)), ("totalVoters", ConstructorParameterDescription(_data.totalVoters)), ("recentVoters", ConstructorParameterDescription(_data.recentVoters)), ("solution", ConstructorParameterDescription(_data.solution)), ("solutionEntities", ConstructorParameterDescription(_data.solutionEntities)), ("solutionMedia", ConstructorParameterDescription(_data.solutionMedia))]) - } - } - - public static func parse_pollResults(_ reader: BufferReader) -> PollResults? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.PollAnswerVoters]? + var _8: [Int32]? if Int(_1 ?? 0) & Int(1 << 1) != 0 { if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PollAnswerVoters.self) + _8 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = reader.readInt32() - } - var _4: [Api.Peer]? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = parseString(reader) - } - var _6: [Api.MessageEntity]? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - } - var _7: Api.MessageMedia? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PollResults.pollResults(Cons_pollResults(flags: _1!, results: _2, totalVoters: _3, recentVoters: _4, solution: _5, solutionEntities: _6, solutionMedia: _7)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PopularContact: TypeConstructorDescription { - public class Cons_popularContact: TypeConstructorDescription { - public var clientId: Int64 - public var importers: Int32 - public init(clientId: Int64, importers: Int32) { - self.clientId = clientId - self.importers = importers - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("popularContact", [("clientId", ConstructorParameterDescription(self.clientId)), ("importers", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .popularContact(let _data): - return ("popularContact", [("clientId", ConstructorParameterDescription(_data.clientId)), ("importers", ConstructorParameterDescription(_data.importers))]) - } - } - - public static func parse_popularContact(_ reader: BufferReader) -> PopularContact? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PopularContact.popularContact(Cons_popularContact(clientId: _1!, importers: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PostAddress: TypeConstructorDescription { - public class Cons_postAddress: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("postAddress", [("streetLine1", ConstructorParameterDescription(self.streetLine1)), ("streetLine2", ConstructorParameterDescription(self.streetLine2)), ("city", ConstructorParameterDescription(self.city)), ("state", ConstructorParameterDescription(self.state)), ("countryIso2", ConstructorParameterDescription(self.countryIso2)), ("postCode", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .postAddress(let _data): - return ("postAddress", [("streetLine1", ConstructorParameterDescription(_data.streetLine1)), ("streetLine2", ConstructorParameterDescription(_data.streetLine2)), ("city", ConstructorParameterDescription(_data.city)), ("state", ConstructorParameterDescription(_data.state)), ("countryIso2", ConstructorParameterDescription(_data.countryIso2)), ("postCode", ConstructorParameterDescription(_data.postCode))]) - } - } - - public static func parse_postAddress(_ reader: BufferReader) -> PostAddress? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: String? - _6 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_postInteractionCountersMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("postInteractionCountersMessage", [("msgId", ConstructorParameterDescription(self.msgId)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("reactions", ConstructorParameterDescription(self.reactions))]) - } - } - public class Cons_postInteractionCountersStory: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("postInteractionCountersStory", [("storyId", ConstructorParameterDescription(self.storyId)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("reactions", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .postInteractionCountersMessage(let _data): - return ("postInteractionCountersMessage", [("msgId", ConstructorParameterDescription(_data.msgId)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("reactions", ConstructorParameterDescription(_data.reactions))]) - case .postInteractionCountersStory(let _data): - return ("postInteractionCountersStory", [("storyId", ConstructorParameterDescription(_data.storyId)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("reactions", ConstructorParameterDescription(_data.reactions))]) - } - } - - public static func parse_postInteractionCountersMessage(_ reader: BufferReader) -> PostInteractionCounters? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PostInteractionCounters.postInteractionCountersMessage(Cons_postInteractionCountersMessage(msgId: _1!, views: _2!, forwards: _3!, reactions: _4!)) - } - else { - return nil - } - } - public static func parse_postInteractionCountersStory(_ reader: BufferReader) -> PostInteractionCounters? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PostInteractionCounters.postInteractionCountersStory(Cons_postInteractionCountersStory(storyId: _1!, views: _2!, forwards: _3!, reactions: _4!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum PremiumGiftCodeOption: TypeConstructorDescription { - public class Cons_premiumGiftCodeOption: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("premiumGiftCodeOption", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("months", ConstructorParameterDescription(self.months)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("storeQuantity", ConstructorParameterDescription(self.storeQuantity)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .premiumGiftCodeOption(let _data): - return ("premiumGiftCodeOption", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("months", ConstructorParameterDescription(_data.months)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("storeQuantity", ConstructorParameterDescription(_data.storeQuantity)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) - } - } - - public static func parse_premiumGiftCodeOption(_ reader: BufferReader) -> PremiumGiftCodeOption? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = reader.readInt32() - } - var _6: String? - _6 = parseString(reader) - var _7: Int64? - _7 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - 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 { - public class Cons_premiumSubscriptionOption: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("premiumSubscriptionOption", [("flags", ConstructorParameterDescription(self.flags)), ("transaction", ConstructorParameterDescription(self.transaction)), ("months", ConstructorParameterDescription(self.months)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("botUrl", ConstructorParameterDescription(self.botUrl)), ("storeProduct", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .premiumSubscriptionOption(let _data): - return ("premiumSubscriptionOption", [("flags", ConstructorParameterDescription(_data.flags)), ("transaction", ConstructorParameterDescription(_data.transaction)), ("months", ConstructorParameterDescription(_data.months)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("botUrl", ConstructorParameterDescription(_data.botUrl)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct))]) - } - } - - public static func parse_premiumSubscriptionOption(_ reader: BufferReader) -> PremiumSubscriptionOption? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _2 = parseString(reader) - } - var _3: Int32? - _3 = reader.readInt32() - var _4: String? - _4 = parseString(reader) - var _5: Int64? - _5 = reader.readInt64() - var _6: String? - _6 = parseString(reader) - var _7: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _7 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = _5 != nil let _c6 = _6 != nil let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PremiumSubscriptionOption.premiumSubscriptionOption(Cons_premiumSubscriptionOption(flags: _1!, transaction: _2, months: _3!, currency: _4!, amount: _5!, botUrl: _6!, storeProduct: _7)) + let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 @@ -1548,113 +1280,543 @@ public extension Api { } } public extension Api { - enum PrepaidGiveaway: TypeConstructorDescription { - public class Cons_prepaidGiveaway: TypeConstructorDescription { - 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 + enum PeerLocated: TypeConstructorDescription { + public class Cons_peerLocated: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("prepaidGiveaway", [("id", ConstructorParameterDescription(self.id)), ("months", ConstructorParameterDescription(self.months)), ("quantity", ConstructorParameterDescription(self.quantity)), ("date", ConstructorParameterDescription(self.date))]) + return ("peerLocated", [("peer", ConstructorParameterDescription(self.peer)), ("expires", ConstructorParameterDescription(self.expires)), ("distance", ConstructorParameterDescription(self.distance))]) } } - public class Cons_prepaidStarsGiveaway: TypeConstructorDescription { - 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 + public class Cons_peerSelfLocated: TypeConstructorDescription { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("prepaidStarsGiveaway", [("id", ConstructorParameterDescription(self.id)), ("stars", ConstructorParameterDescription(self.stars)), ("quantity", ConstructorParameterDescription(self.quantity)), ("boosts", ConstructorParameterDescription(self.boosts)), ("date", ConstructorParameterDescription(self.date))]) + return ("peerSelfLocated", [("expires", ConstructorParameterDescription(self.expires))]) } } - case prepaidGiveaway(Cons_prepaidGiveaway) - case prepaidStarsGiveaway(Cons_prepaidStarsGiveaway) + case peerLocated(Cons_peerLocated) + case peerSelfLocated(Cons_peerSelfLocated) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .prepaidGiveaway(let _data): + case .peerLocated(let _data): if boxed { - buffer.appendInt32(-1303143084) + buffer.appendInt32(-901375139) } - 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) + _data.peer.serialize(buffer, true) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + serializeInt32(_data.distance, buffer: buffer, boxed: false) break - case .prepaidStarsGiveaway(let _data): + case .peerSelfLocated(let _data): if boxed { - buffer.appendInt32(-1700956192) + buffer.appendInt32(-118740917) } - 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) + serializeInt32(_data.expires, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .prepaidGiveaway(let _data): - return ("prepaidGiveaway", [("id", ConstructorParameterDescription(_data.id)), ("months", ConstructorParameterDescription(_data.months)), ("quantity", ConstructorParameterDescription(_data.quantity)), ("date", ConstructorParameterDescription(_data.date))]) - case .prepaidStarsGiveaway(let _data): - return ("prepaidStarsGiveaway", [("id", ConstructorParameterDescription(_data.id)), ("stars", ConstructorParameterDescription(_data.stars)), ("quantity", ConstructorParameterDescription(_data.quantity)), ("boosts", ConstructorParameterDescription(_data.boosts)), ("date", ConstructorParameterDescription(_data.date))]) + case .peerLocated(let _data): + return ("peerLocated", [("peer", ConstructorParameterDescription(_data.peer)), ("expires", ConstructorParameterDescription(_data.expires)), ("distance", ConstructorParameterDescription(_data.distance))]) + case .peerSelfLocated(let _data): + return ("peerSelfLocated", [("expires", ConstructorParameterDescription(_data.expires))]) } } - public static func parse_prepaidGiveaway(_ reader: BufferReader) -> PrepaidGiveaway? { - var _1: Int64? - _1 = reader.readInt64() + public static func parse_peerLocated(_ reader: BufferReader) -> PeerLocated? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } var _2: Int32? _2 = reader.readInt32() var _3: Int32? _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.PeerLocated.peerLocated(Cons_peerLocated(peer: _1!, expires: _2!, distance: _3!)) + } + else { + return nil + } + } + public static func parse_peerSelfLocated(_ reader: BufferReader) -> PeerLocated? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.PeerLocated.peerSelfLocated(Cons_peerSelfLocated(expires: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PeerNotifySettings: TypeConstructorDescription { + public class Cons_peerNotifySettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerNotifySettings", [("flags", ConstructorParameterDescription(self.flags)), ("showPreviews", ConstructorParameterDescription(self.showPreviews)), ("silent", ConstructorParameterDescription(self.silent)), ("muteUntil", ConstructorParameterDescription(self.muteUntil)), ("iosSound", ConstructorParameterDescription(self.iosSound)), ("androidSound", ConstructorParameterDescription(self.androidSound)), ("otherSound", ConstructorParameterDescription(self.otherSound)), ("storiesMuted", ConstructorParameterDescription(self.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(self.storiesHideSender)), ("storiesIosSound", ConstructorParameterDescription(self.storiesIosSound)), ("storiesAndroidSound", ConstructorParameterDescription(self.storiesAndroidSound)), ("storiesOtherSound", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .peerNotifySettings(let _data): + return ("peerNotifySettings", [("flags", ConstructorParameterDescription(_data.flags)), ("showPreviews", ConstructorParameterDescription(_data.showPreviews)), ("silent", ConstructorParameterDescription(_data.silent)), ("muteUntil", ConstructorParameterDescription(_data.muteUntil)), ("iosSound", ConstructorParameterDescription(_data.iosSound)), ("androidSound", ConstructorParameterDescription(_data.androidSound)), ("otherSound", ConstructorParameterDescription(_data.otherSound)), ("storiesMuted", ConstructorParameterDescription(_data.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(_data.storiesHideSender)), ("storiesIosSound", ConstructorParameterDescription(_data.storiesIosSound)), ("storiesAndroidSound", ConstructorParameterDescription(_data.storiesAndroidSound)), ("storiesOtherSound", ConstructorParameterDescription(_data.storiesOtherSound))]) + } + } + + public static func parse_peerNotifySettings(_ reader: BufferReader) -> PeerNotifySettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Bool? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } var _4: Int32? - _4 = reader.readInt32() + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } + var _5: Api.NotificationSound? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _12 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { + 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 { + public class Cons_peerSettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerSettings", [("flags", ConstructorParameterDescription(self.flags)), ("geoDistance", ConstructorParameterDescription(self.geoDistance)), ("requestChatTitle", ConstructorParameterDescription(self.requestChatTitle)), ("requestChatDate", ConstructorParameterDescription(self.requestChatDate)), ("businessBotId", ConstructorParameterDescription(self.businessBotId)), ("businessBotManageUrl", ConstructorParameterDescription(self.businessBotManageUrl)), ("chargePaidMessageStars", ConstructorParameterDescription(self.chargePaidMessageStars)), ("registrationMonth", ConstructorParameterDescription(self.registrationMonth)), ("phoneCountry", ConstructorParameterDescription(self.phoneCountry)), ("nameChangeDate", ConstructorParameterDescription(self.nameChangeDate)), ("photoChangeDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .peerSettings(let _data): + return ("peerSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("geoDistance", ConstructorParameterDescription(_data.geoDistance)), ("requestChatTitle", ConstructorParameterDescription(_data.requestChatTitle)), ("requestChatDate", ConstructorParameterDescription(_data.requestChatDate)), ("businessBotId", ConstructorParameterDescription(_data.businessBotId)), ("businessBotManageUrl", ConstructorParameterDescription(_data.businessBotManageUrl)), ("chargePaidMessageStars", ConstructorParameterDescription(_data.chargePaidMessageStars)), ("registrationMonth", ConstructorParameterDescription(_data.registrationMonth)), ("phoneCountry", ConstructorParameterDescription(_data.phoneCountry)), ("nameChangeDate", ConstructorParameterDescription(_data.nameChangeDate)), ("photoChangeDate", ConstructorParameterDescription(_data.photoChangeDate))]) + } + } + + public static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _2 = reader.readInt32() + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 9) != 0 { + _3 = parseString(reader) + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 9) != 0 { + _4 = reader.readInt32() + } + var _5: Int64? + if Int(_1 ?? 0) & Int(1 << 13) != 0 { + _5 = reader.readInt64() + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 13) != 0 { + _6 = parseString(reader) + } + var _7: Int64? + if Int(_1 ?? 0) & Int(1 << 14) != 0 { + _7 = reader.readInt64() + } + var _8: String? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + _8 = parseString(reader) + } + var _9: String? + if Int(_1 ?? 0) & Int(1 << 16) != 0 { + _9 = parseString(reader) + } + var _10: Int32? + if Int(_1 ?? 0) & Int(1 << 17) != 0 { + _10 = reader.readInt32() + } + var _11: Int32? + if Int(_1 ?? 0) & Int(1 << 18) != 0 { + _11 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _11 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { + 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 { + public class Cons_peerStories: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerStories", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("maxReadId", ConstructorParameterDescription(self.maxReadId)), ("stories", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .peerStories(let _data): + return ("peerStories", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("maxReadId", ConstructorParameterDescription(_data.maxReadId)), ("stories", ConstructorParameterDescription(_data.stories))]) + } + } + + public static func parse_peerStories(_ reader: BufferReader) -> PeerStories? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Int32? + if Int(_1 ?? 0) & 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) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PeerStories.peerStories(Cons_peerStories(flags: _1!, peer: _2!, maxReadId: _3, stories: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PendingSuggestion: TypeConstructorDescription { + public class Cons_pendingSuggestion: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pendingSuggestion", [("suggestion", ConstructorParameterDescription(self.suggestion)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .pendingSuggestion(let _data): + return ("pendingSuggestion", [("suggestion", ConstructorParameterDescription(_data.suggestion)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("url", ConstructorParameterDescription(_data.url))]) + } + } + + public static func parse_pendingSuggestion(_ reader: BufferReader) -> PendingSuggestion? { + var _1: String? + _1 = parseString(reader) + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + var _3: Api.TextWithEntities? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + var _4: String? + _4 = parseString(reader) let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.PrepaidGiveaway.prepaidGiveaway(Cons_prepaidGiveaway(id: _1!, months: _2!, quantity: _3!, date: _4!)) - } - else { - return nil - } - } - public static func parse_prepaidStarsGiveaway(_ reader: BufferReader) -> PrepaidGiveaway? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.PrepaidGiveaway.prepaidStarsGiveaway(Cons_prepaidStarsGiveaway(id: _1!, stars: _2!, quantity: _3!, boosts: _4!, date: _5!)) + return Api.PendingSuggestion.pendingSuggestion(Cons_pendingSuggestion(suggestion: _1!, title: _2!, description: _3!, url: _4!)) } else { return nil @@ -1663,92 +1825,221 @@ public extension Api { } } public extension Api { - enum PrivacyKey: TypeConstructorDescription { - case privacyKeyAbout - case privacyKeyAddedByPhone - case privacyKeyBirthday - case privacyKeyChatInvite - case privacyKeyForwards - case privacyKeyNoPaidMessages - case privacyKeyPhoneCall - case privacyKeyPhoneNumber - case privacyKeyPhoneP2P - case privacyKeyProfilePhoto - case privacyKeySavedMusic - case privacyKeyStarGiftsAutoSave - case privacyKeyStatusTimestamp - case privacyKeyVoiceMessages + enum PhoneCall: TypeConstructorDescription { + public class Cons_phoneCall: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCall", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("gAOrB", ConstructorParameterDescription(self.gAOrB)), ("keyFingerprint", ConstructorParameterDescription(self.keyFingerprint)), ("`protocol`", ConstructorParameterDescription(self.`protocol`)), ("connections", ConstructorParameterDescription(self.connections)), ("startDate", ConstructorParameterDescription(self.startDate)), ("customParameters", ConstructorParameterDescription(self.customParameters))]) + } + } + public class Cons_phoneCallAccepted: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCallAccepted", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("gB", ConstructorParameterDescription(self.gB)), ("`protocol`", ConstructorParameterDescription(self.`protocol`))]) + } + } + public class Cons_phoneCallDiscarded: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCallDiscarded", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("reason", ConstructorParameterDescription(self.reason)), ("duration", ConstructorParameterDescription(self.duration))]) + } + } + public class Cons_phoneCallEmpty: TypeConstructorDescription { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCallEmpty", [("id", ConstructorParameterDescription(self.id))]) + } + } + public class Cons_phoneCallRequested: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCallRequested", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("gAHash", ConstructorParameterDescription(self.gAHash)), ("`protocol`", ConstructorParameterDescription(self.`protocol`))]) + } + } + public class Cons_phoneCallWaiting: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCallWaiting", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("`protocol`", ConstructorParameterDescription(self.`protocol`)), ("receiveDate", ConstructorParameterDescription(self.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 .privacyKeyAbout: + case .phoneCall(let _data): if boxed { - buffer.appendInt32(-1534675103) + 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 .privacyKeyAddedByPhone: + case .phoneCallAccepted(let _data): if boxed { - buffer.appendInt32(1124062251) + 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 .privacyKeyBirthday: + case .phoneCallEmpty(let _data): if boxed { - buffer.appendInt32(536913176) + buffer.appendInt32(1399245077) } + serializeInt64(_data.id, buffer: buffer, boxed: false) break - case .privacyKeyChatInvite: + case .phoneCallRequested(let _data): if boxed { - buffer.appendInt32(1343122938) + 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 .privacyKeyForwards: + case .phoneCallWaiting(let _data): if boxed { - buffer.appendInt32(1777096355) + buffer.appendInt32(-987599081) } - 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) + 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 } @@ -1756,78 +2047,213 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .privacyKeyAbout: - return ("privacyKeyAbout", []) - case .privacyKeyAddedByPhone: - return ("privacyKeyAddedByPhone", []) - case .privacyKeyBirthday: - return ("privacyKeyBirthday", []) - case .privacyKeyChatInvite: - return ("privacyKeyChatInvite", []) - case .privacyKeyForwards: - return ("privacyKeyForwards", []) - case .privacyKeyNoPaidMessages: - return ("privacyKeyNoPaidMessages", []) - case .privacyKeyPhoneCall: - return ("privacyKeyPhoneCall", []) - case .privacyKeyPhoneNumber: - return ("privacyKeyPhoneNumber", []) - case .privacyKeyPhoneP2P: - return ("privacyKeyPhoneP2P", []) - case .privacyKeyProfilePhoto: - return ("privacyKeyProfilePhoto", []) - case .privacyKeySavedMusic: - return ("privacyKeySavedMusic", []) - case .privacyKeyStarGiftsAutoSave: - return ("privacyKeyStarGiftsAutoSave", []) - case .privacyKeyStatusTimestamp: - return ("privacyKeyStatusTimestamp", []) - case .privacyKeyVoiceMessages: - return ("privacyKeyVoiceMessages", []) + case .phoneCall(let _data): + return ("phoneCall", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("gAOrB", ConstructorParameterDescription(_data.gAOrB)), ("keyFingerprint", ConstructorParameterDescription(_data.keyFingerprint)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`)), ("connections", ConstructorParameterDescription(_data.connections)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("customParameters", ConstructorParameterDescription(_data.customParameters))]) + case .phoneCallAccepted(let _data): + return ("phoneCallAccepted", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("gB", ConstructorParameterDescription(_data.gB)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`))]) + case .phoneCallDiscarded(let _data): + return ("phoneCallDiscarded", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("reason", ConstructorParameterDescription(_data.reason)), ("duration", ConstructorParameterDescription(_data.duration))]) + case .phoneCallEmpty(let _data): + return ("phoneCallEmpty", [("id", ConstructorParameterDescription(_data.id))]) + case .phoneCallRequested(let _data): + return ("phoneCallRequested", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("gAHash", ConstructorParameterDescription(_data.gAHash)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`))]) + case .phoneCallWaiting(let _data): + return ("phoneCallWaiting", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("`protocol`", ConstructorParameterDescription(_data.`protocol`)), ("receiveDate", ConstructorParameterDescription(_data.receiveDate))]) } } - public static func parse_privacyKeyAbout(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyAbout + public static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int64? + _5 = reader.readInt64() + var _6: Int64? + _6 = reader.readInt64() + var _7: Buffer? + _7 = parseBytes(reader) + var _8: Int64? + _8 = reader.readInt64() + var _9: Api.PhoneCallProtocol? + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol + } + var _10: [Api.PhoneConnection]? + if let _ = reader.readInt32() { + _10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhoneConnection.self) + } + var _11: Int32? + _11 = reader.readInt32() + var _12: Api.DataJSON? + if Int(_1 ?? 0) & 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 + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = _10 != nil + let _c11 = _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _12 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { + 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 + } } - public static func parse_privacyKeyAddedByPhone(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyAddedByPhone + public static func parse_phoneCallAccepted(_ reader: BufferReader) -> PhoneCall? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int64? + _5 = reader.readInt64() + var _6: Int64? + _6 = reader.readInt64() + var _7: Buffer? + _7 = parseBytes(reader) + var _8: Api.PhoneCallProtocol? + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } } - public static func parse_privacyKeyBirthday(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyBirthday + public static func parse_phoneCallDiscarded(_ reader: BufferReader) -> PhoneCall? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.PhoneCallDiscardReason? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason + } + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PhoneCall.phoneCallDiscarded(Cons_phoneCallDiscarded(flags: _1!, id: _2!, reason: _3, duration: _4)) + } + else { + return nil + } } - public static func parse_privacyKeyChatInvite(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyChatInvite + public static func parse_phoneCallEmpty(_ reader: BufferReader) -> PhoneCall? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.PhoneCall.phoneCallEmpty(Cons_phoneCallEmpty(id: _1!)) + } + else { + return nil + } } - public static func parse_privacyKeyForwards(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyForwards + public static func parse_phoneCallRequested(_ reader: BufferReader) -> PhoneCall? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int64? + _5 = reader.readInt64() + var _6: Int64? + _6 = reader.readInt64() + var _7: Buffer? + _7 = parseBytes(reader) + var _8: Api.PhoneCallProtocol? + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } } - public static func parse_privacyKeyNoPaidMessages(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyNoPaidMessages - } - public static func parse_privacyKeyPhoneCall(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyPhoneCall - } - public static func parse_privacyKeyPhoneNumber(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyPhoneNumber - } - public static func parse_privacyKeyPhoneP2P(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyPhoneP2P - } - public static func parse_privacyKeyProfilePhoto(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyProfilePhoto - } - public static func parse_privacyKeySavedMusic(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeySavedMusic - } - public static func parse_privacyKeyStarGiftsAutoSave(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyStarGiftsAutoSave - } - public static func parse_privacyKeyStatusTimestamp(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyStatusTimestamp - } - public static func parse_privacyKeyVoiceMessages(_ reader: BufferReader) -> PrivacyKey? { - return Api.PrivacyKey.privacyKeyVoiceMessages + public static func parse_phoneCallWaiting(_ reader: BufferReader) -> PhoneCall? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int64? + _5 = reader.readInt64() + var _6: Int64? + _6 = reader.readInt64() + var _7: Api.PhoneCallProtocol? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.PhoneCallProtocol + } + var _8: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _8 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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/Api21.swift b/submodules/TelegramApi/Sources/Api21.swift index 102550071d..a630173cb1 100644 --- a/submodules/TelegramApi/Sources/Api21.swift +++ b/submodules/TelegramApi/Sources/Api21.swift @@ -1,134 +1,46 @@ public extension Api { - enum PrivacyRule: TypeConstructorDescription { - public class Cons_privacyValueAllowChatParticipants: TypeConstructorDescription { - public var chats: [Int64] - public init(chats: [Int64]) { - self.chats = chats + enum PhoneCallDiscardReason: TypeConstructorDescription { + public class Cons_phoneCallDiscardReasonMigrateConferenceCall: TypeConstructorDescription { + public var slug: String + public init(slug: String) { + self.slug = slug } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("privacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) + return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", ConstructorParameterDescription(self.slug))]) } } - public class Cons_privacyValueAllowUsers: TypeConstructorDescription { - public var users: [Int64] - public init(users: [Int64]) { - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("privacyValueAllowUsers", [("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_privacyValueDisallowChatParticipants: TypeConstructorDescription { - public var chats: [Int64] - public init(chats: [Int64]) { - self.chats = chats - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("privacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) - } - } - public class Cons_privacyValueDisallowUsers: TypeConstructorDescription { - public var users: [Int64] - public init(users: [Int64]) { - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("privacyValueDisallowUsers", [("users", ConstructorParameterDescription(self.users))]) - } - } - case privacyValueAllowAll - case privacyValueAllowBots - case privacyValueAllowChatParticipants(Cons_privacyValueAllowChatParticipants) - case privacyValueAllowCloseFriends - case privacyValueAllowContacts - case privacyValueAllowPremium - case privacyValueAllowUsers(Cons_privacyValueAllowUsers) - case privacyValueDisallowAll - case privacyValueDisallowBots - case privacyValueDisallowChatParticipants(Cons_privacyValueDisallowChatParticipants) - case privacyValueDisallowContacts - case privacyValueDisallowUsers(Cons_privacyValueDisallowUsers) + case phoneCallDiscardReasonBusy + case phoneCallDiscardReasonDisconnect + case phoneCallDiscardReasonHangup + case phoneCallDiscardReasonMigrateConferenceCall(Cons_phoneCallDiscardReasonMigrateConferenceCall) + case phoneCallDiscardReasonMissed public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .privacyValueAllowAll: + case .phoneCallDiscardReasonBusy: if boxed { - buffer.appendInt32(1698855810) + buffer.appendInt32(-84416311) } break - case .privacyValueAllowBots: + case .phoneCallDiscardReasonDisconnect: if boxed { - buffer.appendInt32(558242653) + buffer.appendInt32(-527056480) } break - case .privacyValueAllowChatParticipants(let _data): + case .phoneCallDiscardReasonHangup: 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) + buffer.appendInt32(1471006352) } break - case .privacyValueAllowCloseFriends: + case .phoneCallDiscardReasonMigrateConferenceCall(let _data): if boxed { - buffer.appendInt32(-135735141) + buffer.appendInt32(-1615072777) } + serializeString(_data.slug, buffer: buffer, boxed: false) break - case .privacyValueAllowContacts: + case .phoneCallDiscardReasonMissed: 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) + buffer.appendInt32(-2048646399) } break } @@ -136,162 +48,76 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .privacyValueAllowAll: - return ("privacyValueAllowAll", []) - case .privacyValueAllowBots: - return ("privacyValueAllowBots", []) - case .privacyValueAllowChatParticipants(let _data): - return ("privacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) - case .privacyValueAllowCloseFriends: - return ("privacyValueAllowCloseFriends", []) - case .privacyValueAllowContacts: - return ("privacyValueAllowContacts", []) - case .privacyValueAllowPremium: - return ("privacyValueAllowPremium", []) - case .privacyValueAllowUsers(let _data): - return ("privacyValueAllowUsers", [("users", ConstructorParameterDescription(_data.users))]) - case .privacyValueDisallowAll: - return ("privacyValueDisallowAll", []) - case .privacyValueDisallowBots: - return ("privacyValueDisallowBots", []) - case .privacyValueDisallowChatParticipants(let _data): - return ("privacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) - case .privacyValueDisallowContacts: - return ("privacyValueDisallowContacts", []) - case .privacyValueDisallowUsers(let _data): - return ("privacyValueDisallowUsers", [("users", ConstructorParameterDescription(_data.users))]) + case .phoneCallDiscardReasonBusy: + return ("phoneCallDiscardReasonBusy", []) + case .phoneCallDiscardReasonDisconnect: + return ("phoneCallDiscardReasonDisconnect", []) + case .phoneCallDiscardReasonHangup: + return ("phoneCallDiscardReasonHangup", []) + case .phoneCallDiscardReasonMigrateConferenceCall(let _data): + return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", ConstructorParameterDescription(_data.slug))]) + case .phoneCallDiscardReasonMissed: + return ("phoneCallDiscardReasonMissed", []) } } - public static func parse_privacyValueAllowAll(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueAllowAll + public static func parse_phoneCallDiscardReasonBusy(_ reader: BufferReader) -> PhoneCallDiscardReason? { + return Api.PhoneCallDiscardReason.phoneCallDiscardReasonBusy } - public static func parse_privacyValueAllowBots(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueAllowBots + public static func parse_phoneCallDiscardReasonDisconnect(_ reader: BufferReader) -> PhoneCallDiscardReason? { + return Api.PhoneCallDiscardReason.phoneCallDiscardReasonDisconnect } - public static func parse_privacyValueAllowChatParticipants(_ reader: BufferReader) -> PrivacyRule? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } + public static func parse_phoneCallDiscardReasonHangup(_ reader: BufferReader) -> PhoneCallDiscardReason? { + return Api.PhoneCallDiscardReason.phoneCallDiscardReasonHangup + } + public static func parse_phoneCallDiscardReasonMigrateConferenceCall(_ reader: BufferReader) -> PhoneCallDiscardReason? { + var _1: String? + _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.PrivacyRule.privacyValueAllowChatParticipants(Cons_privacyValueAllowChatParticipants(chats: _1!)) + return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMigrateConferenceCall(Cons_phoneCallDiscardReasonMigrateConferenceCall(slug: _1!)) } else { return nil } } - public static func parse_privacyValueAllowCloseFriends(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueAllowCloseFriends - } - public static func parse_privacyValueAllowContacts(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueAllowContacts - } - public static func parse_privacyValueAllowPremium(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueAllowPremium - } - public static func parse_privacyValueAllowUsers(_ reader: BufferReader) -> PrivacyRule? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.PrivacyRule.privacyValueAllowUsers(Cons_privacyValueAllowUsers(users: _1!)) - } - else { - return nil - } - } - public static func parse_privacyValueDisallowAll(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueDisallowAll - } - public static func parse_privacyValueDisallowBots(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueDisallowBots - } - public static func parse_privacyValueDisallowChatParticipants(_ reader: BufferReader) -> PrivacyRule? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.PrivacyRule.privacyValueDisallowChatParticipants(Cons_privacyValueDisallowChatParticipants(chats: _1!)) - } - else { - return nil - } - } - public static func parse_privacyValueDisallowContacts(_ reader: BufferReader) -> PrivacyRule? { - return Api.PrivacyRule.privacyValueDisallowContacts - } - public static func parse_privacyValueDisallowUsers(_ reader: BufferReader) -> PrivacyRule? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.PrivacyRule.privacyValueDisallowUsers(Cons_privacyValueDisallowUsers(users: _1!)) - } - else { - return nil - } + public static func parse_phoneCallDiscardReasonMissed(_ reader: BufferReader) -> PhoneCallDiscardReason? { + return Api.PhoneCallDiscardReason.phoneCallDiscardReasonMissed } } } public extension Api { - enum ProfileTab: TypeConstructorDescription { - case profileTabFiles - case profileTabGifs - case profileTabGifts - case profileTabLinks - case profileTabMedia - case profileTabMusic - case profileTabPosts - case profileTabVoice + enum PhoneCallProtocol: TypeConstructorDescription { + public class Cons_phoneCallProtocol: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCallProtocol", [("flags", ConstructorParameterDescription(self.flags)), ("minLayer", ConstructorParameterDescription(self.minLayer)), ("maxLayer", ConstructorParameterDescription(self.maxLayer)), ("libraryVersions", ConstructorParameterDescription(self.libraryVersions))]) + } + } + case phoneCallProtocol(Cons_phoneCallProtocol) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .profileTabFiles: + case .phoneCallProtocol(let _data): if boxed { - buffer.appendInt32(-1422681088) + buffer.appendInt32(-58224696) } - 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) + 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 } @@ -299,129 +125,28 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .profileTabFiles: - return ("profileTabFiles", []) - case .profileTabGifs: - return ("profileTabGifs", []) - case .profileTabGifts: - return ("profileTabGifts", []) - case .profileTabLinks: - return ("profileTabLinks", []) - case .profileTabMedia: - return ("profileTabMedia", []) - case .profileTabMusic: - return ("profileTabMusic", []) - case .profileTabPosts: - return ("profileTabPosts", []) - case .profileTabVoice: - return ("profileTabVoice", []) + case .phoneCallProtocol(let _data): + return ("phoneCallProtocol", [("flags", ConstructorParameterDescription(_data.flags)), ("minLayer", ConstructorParameterDescription(_data.minLayer)), ("maxLayer", ConstructorParameterDescription(_data.maxLayer)), ("libraryVersions", ConstructorParameterDescription(_data.libraryVersions))]) } } - public static func parse_profileTabFiles(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabFiles - } - public static func parse_profileTabGifs(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabGifs - } - public static func parse_profileTabGifts(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabGifts - } - public static func parse_profileTabLinks(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabLinks - } - public static func parse_profileTabMedia(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabMedia - } - public static func parse_profileTabMusic(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabMusic - } - public static func parse_profileTabPosts(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabPosts - } - public static func parse_profileTabVoice(_ reader: BufferReader) -> ProfileTab? { - return Api.ProfileTab.profileTabVoice - } - } -} -public extension Api { - indirect enum PublicForward: TypeConstructorDescription { - public class Cons_publicForwardMessage: TypeConstructorDescription { - public var message: Api.Message - public init(message: Api.Message) { - self.message = message - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("publicForwardMessage", [("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_publicForwardStory: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("publicForwardStory", [("peer", ConstructorParameterDescription(self.peer)), ("story", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .publicForwardMessage(let _data): - return ("publicForwardMessage", [("message", ConstructorParameterDescription(_data.message))]) - case .publicForwardStory(let _data): - return ("publicForwardStory", [("peer", ConstructorParameterDescription(_data.peer)), ("story", ConstructorParameterDescription(_data.story))]) - } - } - - public static func parse_publicForwardMessage(_ reader: BufferReader) -> PublicForward? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - let _c1 = _1 != nil - if _c1 { - return Api.PublicForward.publicForwardMessage(Cons_publicForwardMessage(message: _1!)) - } - else { - return nil - } - } - public static func parse_publicForwardStory(_ reader: BufferReader) -> PublicForward? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Api.StoryItem? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StoryItem + public static func parse_phoneCallProtocol(_ reader: BufferReader) -> PhoneCallProtocol? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: [String]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) } let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.PublicForward.publicForwardStory(Cons_publicForwardStory(peer: _1!, story: _2!)) + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PhoneCallProtocol.phoneCallProtocol(Cons_phoneCallProtocol(flags: _1!, minLayer: _2!, maxLayer: _3!, libraryVersions: _4!)) } else { return nil @@ -430,50 +155,472 @@ public extension Api { } } public extension Api { - enum QuickReply: TypeConstructorDescription { - public class Cons_quickReply: TypeConstructorDescription { - 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 + enum PhoneConnection: TypeConstructorDescription { + public class Cons_phoneConnection: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("quickReply", [("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("shortcut", ConstructorParameterDescription(self.shortcut)), ("topMessage", ConstructorParameterDescription(self.topMessage)), ("count", ConstructorParameterDescription(self.count))]) + return ("phoneConnection", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("ip", ConstructorParameterDescription(self.ip)), ("ipv6", ConstructorParameterDescription(self.ipv6)), ("port", ConstructorParameterDescription(self.port)), ("peerTag", ConstructorParameterDescription(self.peerTag))]) } } - case quickReply(Cons_quickReply) + public class Cons_phoneConnectionWebrtc: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneConnectionWebrtc", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("ip", ConstructorParameterDescription(self.ip)), ("ipv6", ConstructorParameterDescription(self.ipv6)), ("port", ConstructorParameterDescription(self.port)), ("username", ConstructorParameterDescription(self.username)), ("password", ConstructorParameterDescription(self.password))]) + } + } + case phoneConnection(Cons_phoneConnection) + case phoneConnectionWebrtc(Cons_phoneConnectionWebrtc) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .quickReply(let _data): + case .phoneConnection(let _data): if boxed { - buffer.appendInt32(110563371) + buffer.appendInt32(-1665063993) } - 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) + 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, ConstructorParameterDescription)]) { switch self { - case .quickReply(let _data): - return ("quickReply", [("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("shortcut", ConstructorParameterDescription(_data.shortcut)), ("topMessage", ConstructorParameterDescription(_data.topMessage)), ("count", ConstructorParameterDescription(_data.count))]) + case .phoneConnection(let _data): + return ("phoneConnection", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("ip", ConstructorParameterDescription(_data.ip)), ("ipv6", ConstructorParameterDescription(_data.ipv6)), ("port", ConstructorParameterDescription(_data.port)), ("peerTag", ConstructorParameterDescription(_data.peerTag))]) + case .phoneConnectionWebrtc(let _data): + return ("phoneConnectionWebrtc", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("ip", ConstructorParameterDescription(_data.ip)), ("ipv6", ConstructorParameterDescription(_data.ipv6)), ("port", ConstructorParameterDescription(_data.port)), ("username", ConstructorParameterDescription(_data.username)), ("password", ConstructorParameterDescription(_data.password))]) } } - public static func parse_quickReply(_ reader: BufferReader) -> QuickReply? { + public static func parse_phoneConnection(_ reader: BufferReader) -> PhoneConnection? { var _1: Int32? _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: Int32? + _5 = reader.readInt32() + var _6: Buffer? + _6 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.PhoneConnection.phoneConnection(Cons_phoneConnection(flags: _1!, id: _2!, ip: _3!, ipv6: _4!, port: _5!, peerTag: _6!)) + } + else { + return nil + } + } + public static func parse_phoneConnectionWebrtc(_ reader: BufferReader) -> PhoneConnection? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: Int32? + _5 = reader.readInt32() + var _6: String? + _6 = parseString(reader) + var _7: String? + _7 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + 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 { + public class Cons_photo: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photo", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference)), ("date", ConstructorParameterDescription(self.date)), ("sizes", ConstructorParameterDescription(self.sizes)), ("videoSizes", ConstructorParameterDescription(self.videoSizes)), ("dcId", ConstructorParameterDescription(self.dcId))]) + } + } + public class Cons_photoEmpty: TypeConstructorDescription { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoEmpty", [("id", ConstructorParameterDescription(self.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(_data.videoSizes!.count)) + for item in _data.videoSizes! { + item.serialize(buffer, true) + } + } + 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, ConstructorParameterDescription)]) { + switch self { + case .photo(let _data): + return ("photo", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference)), ("date", ConstructorParameterDescription(_data.date)), ("sizes", ConstructorParameterDescription(_data.sizes)), ("videoSizes", ConstructorParameterDescription(_data.videoSizes)), ("dcId", ConstructorParameterDescription(_data.dcId))]) + case .photoEmpty(let _data): + return ("photoEmpty", [("id", ConstructorParameterDescription(_data.id))]) + } + } + + public static func parse_photo(_ reader: BufferReader) -> Photo? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Buffer? + _4 = parseBytes(reader) + var _5: Int32? + _5 = reader.readInt32() + var _6: [Api.PhotoSize]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) + } + var _7: [Api.VideoSize]? + if Int(_1 ?? 0) & 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 + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_photoEmpty(_ reader: BufferReader) -> Photo? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Photo.photoEmpty(Cons_photoEmpty(id: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PhotoSize: TypeConstructorDescription { + public class Cons_photoCachedSize: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoCachedSize", [("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("bytes", ConstructorParameterDescription(self.bytes))]) + } + } + public class Cons_photoPathSize: TypeConstructorDescription { + public var type: String + public var bytes: Buffer + public init(type: String, bytes: Buffer) { + self.type = type + self.bytes = bytes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoPathSize", [("type", ConstructorParameterDescription(self.type)), ("bytes", ConstructorParameterDescription(self.bytes))]) + } + } + public class Cons_photoSize: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoSize", [("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("size", ConstructorParameterDescription(self.size))]) + } + } + public class Cons_photoSizeEmpty: TypeConstructorDescription { + public var type: String + public init(type: String) { + self.type = type + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoSizeEmpty", [("type", ConstructorParameterDescription(self.type))]) + } + } + public class Cons_photoSizeProgressive: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoSizeProgressive", [("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("sizes", ConstructorParameterDescription(self.sizes))]) + } + } + public class Cons_photoStrippedSize: TypeConstructorDescription { + public var type: String + public var bytes: Buffer + public init(type: String, bytes: Buffer) { + self.type = type + self.bytes = bytes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoStrippedSize", [("type", ConstructorParameterDescription(self.type)), ("bytes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .photoCachedSize(let _data): + return ("photoCachedSize", [("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("bytes", ConstructorParameterDescription(_data.bytes))]) + case .photoPathSize(let _data): + return ("photoPathSize", [("type", ConstructorParameterDescription(_data.type)), ("bytes", ConstructorParameterDescription(_data.bytes))]) + case .photoSize(let _data): + return ("photoSize", [("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("size", ConstructorParameterDescription(_data.size))]) + case .photoSizeEmpty(let _data): + return ("photoSizeEmpty", [("type", ConstructorParameterDescription(_data.type))]) + case .photoSizeProgressive(let _data): + return ("photoSizeProgressive", [("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("sizes", ConstructorParameterDescription(_data.sizes))]) + case .photoStrippedSize(let _data): + return ("photoStrippedSize", [("type", ConstructorParameterDescription(_data.type)), ("bytes", ConstructorParameterDescription(_data.bytes))]) + } + } + + public static func parse_photoCachedSize(_ reader: BufferReader) -> PhotoSize? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Buffer? + _4 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PhotoSize.photoCachedSize(Cons_photoCachedSize(type: _1!, w: _2!, h: _3!, bytes: _4!)) + } + else { + return nil + } + } + public static func parse_photoPathSize(_ reader: BufferReader) -> PhotoSize? { + var _1: String? + _1 = parseString(reader) + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PhotoSize.photoPathSize(Cons_photoPathSize(type: _1!, bytes: _2!)) + } + else { + return nil + } + } + public static func parse_photoSize(_ reader: BufferReader) -> PhotoSize? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() var _3: Int32? _3 = reader.readInt32() var _4: Int32? @@ -483,170 +630,54 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.QuickReply.quickReply(Cons_quickReply(shortcutId: _1!, shortcut: _2!, topMessage: _3!, count: _4!)) + return Api.PhotoSize.photoSize(Cons_photoSize(type: _1!, w: _2!, h: _3!, size: _4!)) } else { return nil } } - } -} -public extension Api { - enum Reaction: TypeConstructorDescription { - public class Cons_reactionCustomEmoji: TypeConstructorDescription { - public var documentId: Int64 - public init(documentId: Int64) { - self.documentId = documentId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("reactionCustomEmoji", [("documentId", ConstructorParameterDescription(self.documentId))]) - } - } - public class Cons_reactionEmoji: TypeConstructorDescription { - public var emoticon: String - public init(emoticon: String) { - self.emoticon = emoticon - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("reactionEmoji", [("emoticon", ConstructorParameterDescription(self.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 _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, ConstructorParameterDescription)]) { - switch self { - case .reactionCustomEmoji(let _data): - return ("reactionCustomEmoji", [("documentId", ConstructorParameterDescription(_data.documentId))]) - case .reactionEmoji(let _data): - return ("reactionEmoji", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) - case .reactionEmpty: - return ("reactionEmpty", []) - 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(Cons_reactionCustomEmoji(documentId: _1!)) - } - else { - return nil - } - } - public static func parse_reactionEmoji(_ reader: BufferReader) -> Reaction? { + public static func parse_photoSizeEmpty(_ reader: BufferReader) -> PhotoSize? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.Reaction.reactionEmoji(Cons_reactionEmoji(emoticon: _1!)) + return Api.PhotoSize.photoSizeEmpty(Cons_photoSizeEmpty(type: _1!)) } else { return nil } } - public static func parse_reactionEmpty(_ reader: BufferReader) -> Reaction? { - return Api.Reaction.reactionEmpty - } - public static func parse_reactionPaid(_ reader: BufferReader) -> Reaction? { - return Api.Reaction.reactionPaid - } - } -} -public extension Api { - enum ReactionCount: TypeConstructorDescription { - public class Cons_reactionCount: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("reactionCount", [("flags", ConstructorParameterDescription(self.flags)), ("chosenOrder", ConstructorParameterDescription(self.chosenOrder)), ("reaction", ConstructorParameterDescription(self.reaction)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .reactionCount(let _data): - return ("reactionCount", [("flags", ConstructorParameterDescription(_data.flags)), ("chosenOrder", ConstructorParameterDescription(_data.chosenOrder)), ("reaction", ConstructorParameterDescription(_data.reaction)), ("count", ConstructorParameterDescription(_data.count))]) - } - } - - public static func parse_reactionCount(_ reader: BufferReader) -> ReactionCount? { - var _1: Int32? - _1 = reader.readInt32() + public static func parse_photoSizeProgressive(_ reader: BufferReader) -> PhotoSize? { + var _1: String? + _1 = parseString(reader) var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: [Int32]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } - var _3: Api.Reaction? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Reaction - } - var _4: Int32? - _4 = reader.readInt32() let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.ReactionCount.reactionCount(Cons_reactionCount(flags: _1!, chosenOrder: _2, reaction: _3!, count: _4!)) + return Api.PhotoSize.photoSizeProgressive(Cons_photoSizeProgressive(type: _1!, w: _2!, h: _3!, sizes: _4!)) + } + else { + return nil + } + } + public static func parse_photoStrippedSize(_ reader: BufferReader) -> PhotoSize? { + var _1: String? + _1 = parseString(reader) + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PhotoSize.photoStrippedSize(Cons_photoStrippedSize(type: _1!, bytes: _2!)) } else { return nil @@ -655,131 +686,110 @@ public extension Api { } } 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, ConstructorParameterDescription)]) { - switch self { - case .reactionNotificationsFromAll: - return ("reactionNotificationsFromAll", []) - 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 { - public class Cons_reactionsNotifySettings: TypeConstructorDescription { + enum Poll: TypeConstructorDescription { + public class Cons_poll: TypeConstructorDescription { + public var id: Int64 public var flags: Int32 - public var messagesNotifyFrom: Api.ReactionNotificationsFrom? - public var storiesNotifyFrom: Api.ReactionNotificationsFrom? - public var pollVotesNotifyFrom: Api.ReactionNotificationsFrom? - public var sound: Api.NotificationSound - public var showPreviews: Api.Bool - public init(flags: Int32, messagesNotifyFrom: Api.ReactionNotificationsFrom?, storiesNotifyFrom: Api.ReactionNotificationsFrom?, pollVotesNotifyFrom: Api.ReactionNotificationsFrom?, sound: Api.NotificationSound, showPreviews: Api.Bool) { + public var question: Api.TextWithEntities + public var answers: [Api.PollAnswer] + public var closePeriod: Int32? + public var closeDate: Int32? + public var countriesIso2: [String]? + public var hash: Int64 + public init(id: Int64, flags: Int32, question: Api.TextWithEntities, answers: [Api.PollAnswer], closePeriod: Int32?, closeDate: Int32?, countriesIso2: [String]?, hash: Int64) { + self.id = id self.flags = flags - self.messagesNotifyFrom = messagesNotifyFrom - self.storiesNotifyFrom = storiesNotifyFrom - self.pollVotesNotifyFrom = pollVotesNotifyFrom - self.sound = sound - self.showPreviews = showPreviews + self.question = question + self.answers = answers + self.closePeriod = closePeriod + self.closeDate = closeDate + self.countriesIso2 = countriesIso2 + self.hash = hash } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("reactionsNotifySettings", [("flags", ConstructorParameterDescription(self.flags)), ("messagesNotifyFrom", ConstructorParameterDescription(self.messagesNotifyFrom)), ("storiesNotifyFrom", ConstructorParameterDescription(self.storiesNotifyFrom)), ("pollVotesNotifyFrom", ConstructorParameterDescription(self.pollVotesNotifyFrom)), ("sound", ConstructorParameterDescription(self.sound)), ("showPreviews", ConstructorParameterDescription(self.showPreviews))]) + return ("poll", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags)), ("question", ConstructorParameterDescription(self.question)), ("answers", ConstructorParameterDescription(self.answers)), ("closePeriod", ConstructorParameterDescription(self.closePeriod)), ("closeDate", ConstructorParameterDescription(self.closeDate)), ("countriesIso2", ConstructorParameterDescription(self.countriesIso2)), ("hash", ConstructorParameterDescription(self.hash))]) } } - case reactionsNotifySettings(Cons_reactionsNotifySettings) + case poll(Cons_poll) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .reactionsNotifySettings(let _data): + case .poll(let _data): if boxed { - buffer.appendInt32(1910827608) + buffer.appendInt32(-1771164225) } + serializeInt64(_data.id, buffer: buffer, boxed: false) serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.messagesNotifyFrom!.serialize(buffer, true) + _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 << 1) != 0 { - _data.storiesNotifyFrom!.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.closePeriod!, buffer: buffer, boxed: false) } - if Int(_data.flags) & Int(1 << 2) != 0 { - _data.pollVotesNotifyFrom!.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 5) != 0 { + serializeInt32(_data.closeDate!, buffer: buffer, boxed: false) } - _data.sound.serialize(buffer, true) - _data.showPreviews.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 12) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.countriesIso2!.count)) + for item in _data.countriesIso2! { + serializeString(item, buffer: buffer, boxed: false) + } + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .reactionsNotifySettings(let _data): - return ("reactionsNotifySettings", [("flags", ConstructorParameterDescription(_data.flags)), ("messagesNotifyFrom", ConstructorParameterDescription(_data.messagesNotifyFrom)), ("storiesNotifyFrom", ConstructorParameterDescription(_data.storiesNotifyFrom)), ("pollVotesNotifyFrom", ConstructorParameterDescription(_data.pollVotesNotifyFrom)), ("sound", ConstructorParameterDescription(_data.sound)), ("showPreviews", ConstructorParameterDescription(_data.showPreviews))]) + case .poll(let _data): + return ("poll", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags)), ("question", ConstructorParameterDescription(_data.question)), ("answers", ConstructorParameterDescription(_data.answers)), ("closePeriod", ConstructorParameterDescription(_data.closePeriod)), ("closeDate", ConstructorParameterDescription(_data.closeDate)), ("countriesIso2", ConstructorParameterDescription(_data.countriesIso2)), ("hash", ConstructorParameterDescription(_data.hash))]) } } - public static func parse_reactionsNotifySettings(_ reader: BufferReader) -> ReactionsNotifySettings? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.ReactionNotificationsFrom? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom - } - } - var _4: Api.ReactionNotificationsFrom? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom - } - } - var _5: Api.NotificationSound? + public static func parse_poll(_ reader: BufferReader) -> Poll? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.TextWithEntities? if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.NotificationSound + _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities } - var _6: Api.Bool? - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Bool + var _4: [Api.PollAnswer]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PollAnswer.self) } + var _5: Int32? + if Int(_2 ?? 0) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } + var _6: Int32? + if Int(_2 ?? 0) & Int(1 << 5) != 0 { + _6 = reader.readInt32() + } + var _7: [String]? + if Int(_2 ?? 0) & Int(1 << 12) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } + var _8: Int64? + _8 = reader.readInt64() let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.ReactionsNotifySettings.reactionsNotifySettings(Cons_reactionsNotifySettings(flags: _1!, messagesNotifyFrom: _2, storiesNotifyFrom: _3, pollVotesNotifyFrom: _4, sound: _5!, showPreviews: _6!)) + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_2 ?? 0) & Int(1 << 4) == 0) || _5 != nil + let _c6 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _6 != nil + let _c7 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + return Api.Poll.poll(Cons_poll(id: _1!, flags: _2!, question: _3!, answers: _4!, closePeriod: _5, closeDate: _6, countriesIso2: _7, hash: _8!)) } else { return nil @@ -788,40 +798,381 @@ public extension Api { } } public extension Api { - enum ReadParticipantDate: TypeConstructorDescription { - public class Cons_readParticipantDate: TypeConstructorDescription { - public var userId: Int64 - public var date: Int32 - public init(userId: Int64, date: Int32) { - self.userId = userId + indirect enum PollAnswer: TypeConstructorDescription { + public class Cons_inputPollAnswer: TypeConstructorDescription { + public var flags: Int32 + public var text: Api.TextWithEntities + public var media: Api.InputMedia? + public init(flags: Int32, text: Api.TextWithEntities, media: Api.InputMedia?) { + self.flags = flags + self.text = text + self.media = media + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPollAnswer", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("media", ConstructorParameterDescription(self.media))]) + } + } + public class Cons_pollAnswer: TypeConstructorDescription { + public var flags: Int32 + public var text: Api.TextWithEntities + public var option: Buffer + public var media: Api.MessageMedia? + public var addedBy: Api.Peer? + public var date: Int32? + public init(flags: Int32, text: Api.TextWithEntities, option: Buffer, media: Api.MessageMedia?, addedBy: Api.Peer?, date: Int32?) { + self.flags = flags + self.text = text + self.option = option + self.media = media + self.addedBy = addedBy self.date = date } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("readParticipantDate", [("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.date))]) + return ("pollAnswer", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.option)), ("media", ConstructorParameterDescription(self.media)), ("addedBy", ConstructorParameterDescription(self.addedBy)), ("date", ConstructorParameterDescription(self.date))]) } } - case readParticipantDate(Cons_readParticipantDate) + case inputPollAnswer(Cons_inputPollAnswer) + case pollAnswer(Cons_pollAnswer) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .readParticipantDate(let _data): + case .inputPollAnswer(let _data): if boxed { - buffer.appendInt32(1246753138) + buffer.appendInt32(429911446) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.media!.serialize(buffer, true) + } + break + case .pollAnswer(let _data): + if boxed { + buffer.appendInt32(1266514026) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + serializeBytes(_data.option, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.media!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.addedBy!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.date!, buffer: buffer, boxed: false) } - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .readParticipantDate(let _data): - return ("readParticipantDate", [("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date))]) + case .inputPollAnswer(let _data): + return ("inputPollAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("media", ConstructorParameterDescription(_data.media))]) + case .pollAnswer(let _data): + return ("pollAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option)), ("media", ConstructorParameterDescription(_data.media)), ("addedBy", ConstructorParameterDescription(_data.addedBy)), ("date", ConstructorParameterDescription(_data.date))]) } } - public static func parse_readParticipantDate(_ reader: BufferReader) -> ReadParticipantDate? { + public static func parse_inputPollAnswer(_ reader: BufferReader) -> PollAnswer? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + var _3: Api.InputMedia? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.InputMedia + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.PollAnswer.inputPollAnswer(Cons_inputPollAnswer(flags: _1!, text: _2!, media: _3)) + } + else { + return nil + } + } + public static func parse_pollAnswer(_ reader: BufferReader) -> PollAnswer? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + var _3: Buffer? + _3 = parseBytes(reader) + var _4: Api.MessageMedia? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } + var _5: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.PollAnswer.pollAnswer(Cons_pollAnswer(flags: _1!, text: _2!, option: _3!, media: _4, addedBy: _5, date: _6)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PollAnswerVoters: TypeConstructorDescription { + public class Cons_pollAnswerVoters: TypeConstructorDescription { + public var flags: Int32 + public var option: Buffer + public var voters: Int32? + public var recentVoters: [Api.Peer]? + public init(flags: Int32, option: Buffer, voters: Int32?, recentVoters: [Api.Peer]?) { + self.flags = flags + self.option = option + self.voters = voters + self.recentVoters = recentVoters + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pollAnswerVoters", [("flags", ConstructorParameterDescription(self.flags)), ("option", ConstructorParameterDescription(self.option)), ("voters", ConstructorParameterDescription(self.voters)), ("recentVoters", ConstructorParameterDescription(self.recentVoters))]) + } + } + case pollAnswerVoters(Cons_pollAnswerVoters) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pollAnswerVoters(let _data): + if boxed { + buffer.appendInt32(910500618) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeBytes(_data.option, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.voters!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.recentVoters!.count)) + for item in _data.recentVoters! { + item.serialize(buffer, true) + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .pollAnswerVoters(let _data): + return ("pollAnswerVoters", [("flags", ConstructorParameterDescription(_data.flags)), ("option", ConstructorParameterDescription(_data.option)), ("voters", ConstructorParameterDescription(_data.voters)), ("recentVoters", ConstructorParameterDescription(_data.recentVoters))]) + } + } + + public static func parse_pollAnswerVoters(_ reader: BufferReader) -> PollAnswerVoters? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } + var _4: [Api.Peer]? + if Int(_1 ?? 0) & Int(1 << 2) != 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 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PollAnswerVoters.pollAnswerVoters(Cons_pollAnswerVoters(flags: _1!, option: _2!, voters: _3, recentVoters: _4)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum PollResults: TypeConstructorDescription { + public class Cons_pollResults: TypeConstructorDescription { + 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 var solutionMedia: Api.MessageMedia? + public init(flags: Int32, results: [Api.PollAnswerVoters]?, totalVoters: Int32?, recentVoters: [Api.Peer]?, solution: String?, solutionEntities: [Api.MessageEntity]?, solutionMedia: Api.MessageMedia?) { + self.flags = flags + self.results = results + self.totalVoters = totalVoters + self.recentVoters = recentVoters + self.solution = solution + self.solutionEntities = solutionEntities + self.solutionMedia = solutionMedia + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pollResults", [("flags", ConstructorParameterDescription(self.flags)), ("results", ConstructorParameterDescription(self.results)), ("totalVoters", ConstructorParameterDescription(self.totalVoters)), ("recentVoters", ConstructorParameterDescription(self.recentVoters)), ("solution", ConstructorParameterDescription(self.solution)), ("solutionEntities", ConstructorParameterDescription(self.solutionEntities)), ("solutionMedia", ConstructorParameterDescription(self.solutionMedia))]) + } + } + case pollResults(Cons_pollResults) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pollResults(let _data): + if boxed { + buffer.appendInt32(-1166298786) + } + 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) + } + } + 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(_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(_data.flags) & Int(1 << 5) != 0 { + _data.solutionMedia!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .pollResults(let _data): + return ("pollResults", [("flags", ConstructorParameterDescription(_data.flags)), ("results", ConstructorParameterDescription(_data.results)), ("totalVoters", ConstructorParameterDescription(_data.totalVoters)), ("recentVoters", ConstructorParameterDescription(_data.recentVoters)), ("solution", ConstructorParameterDescription(_data.solution)), ("solutionEntities", ConstructorParameterDescription(_data.solutionEntities)), ("solutionMedia", ConstructorParameterDescription(_data.solutionMedia))]) + } + } + + public static func parse_pollResults(_ reader: BufferReader) -> PollResults? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.PollAnswerVoters]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PollAnswerVoters.self) + } + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } + var _4: [Api.Peer]? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _5 = parseString(reader) + } + var _6: [Api.MessageEntity]? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } + var _7: Api.MessageMedia? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.PollResults.pollResults(Cons_pollResults(flags: _1!, results: _2, totalVoters: _3, recentVoters: _4, solution: _5, solutionEntities: _6, solutionMedia: _7)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PopularContact: TypeConstructorDescription { + public class Cons_popularContact: TypeConstructorDescription { + public var clientId: Int64 + public var importers: Int32 + public init(clientId: Int64, importers: Int32) { + self.clientId = clientId + self.importers = importers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("popularContact", [("clientId", ConstructorParameterDescription(self.clientId)), ("importers", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .popularContact(let _data): + return ("popularContact", [("clientId", ConstructorParameterDescription(_data.clientId)), ("importers", ConstructorParameterDescription(_data.importers))]) + } + } + + public static func parse_popularContact(_ reader: BufferReader) -> PopularContact? { var _1: Int64? _1 = reader.readInt64() var _2: Int32? @@ -829,7 +1180,7 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ReadParticipantDate.readParticipantDate(Cons_readParticipantDate(userId: _1!, date: _2!)) + return Api.PopularContact.popularContact(Cons_popularContact(clientId: _1!, importers: _2!)) } else { return nil @@ -837,3 +1188,646 @@ public extension Api { } } } +public extension Api { + enum PostAddress: TypeConstructorDescription { + public class Cons_postAddress: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("postAddress", [("streetLine1", ConstructorParameterDescription(self.streetLine1)), ("streetLine2", ConstructorParameterDescription(self.streetLine2)), ("city", ConstructorParameterDescription(self.city)), ("state", ConstructorParameterDescription(self.state)), ("countryIso2", ConstructorParameterDescription(self.countryIso2)), ("postCode", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .postAddress(let _data): + return ("postAddress", [("streetLine1", ConstructorParameterDescription(_data.streetLine1)), ("streetLine2", ConstructorParameterDescription(_data.streetLine2)), ("city", ConstructorParameterDescription(_data.city)), ("state", ConstructorParameterDescription(_data.state)), ("countryIso2", ConstructorParameterDescription(_data.countryIso2)), ("postCode", ConstructorParameterDescription(_data.postCode))]) + } + } + + public static func parse_postAddress(_ reader: BufferReader) -> PostAddress? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: String? + _6 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_postInteractionCountersMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("postInteractionCountersMessage", [("msgId", ConstructorParameterDescription(self.msgId)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("reactions", ConstructorParameterDescription(self.reactions))]) + } + } + public class Cons_postInteractionCountersStory: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("postInteractionCountersStory", [("storyId", ConstructorParameterDescription(self.storyId)), ("views", ConstructorParameterDescription(self.views)), ("forwards", ConstructorParameterDescription(self.forwards)), ("reactions", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .postInteractionCountersMessage(let _data): + return ("postInteractionCountersMessage", [("msgId", ConstructorParameterDescription(_data.msgId)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("reactions", ConstructorParameterDescription(_data.reactions))]) + case .postInteractionCountersStory(let _data): + return ("postInteractionCountersStory", [("storyId", ConstructorParameterDescription(_data.storyId)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("reactions", ConstructorParameterDescription(_data.reactions))]) + } + } + + public static func parse_postInteractionCountersMessage(_ reader: BufferReader) -> PostInteractionCounters? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PostInteractionCounters.postInteractionCountersMessage(Cons_postInteractionCountersMessage(msgId: _1!, views: _2!, forwards: _3!, reactions: _4!)) + } + else { + return nil + } + } + public static func parse_postInteractionCountersStory(_ reader: BufferReader) -> PostInteractionCounters? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PostInteractionCounters.postInteractionCountersStory(Cons_postInteractionCountersStory(storyId: _1!, views: _2!, forwards: _3!, reactions: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PremiumGiftCodeOption: TypeConstructorDescription { + public class Cons_premiumGiftCodeOption: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("premiumGiftCodeOption", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("months", ConstructorParameterDescription(self.months)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("storeQuantity", ConstructorParameterDescription(self.storeQuantity)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .premiumGiftCodeOption(let _data): + return ("premiumGiftCodeOption", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("months", ConstructorParameterDescription(_data.months)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("storeQuantity", ConstructorParameterDescription(_data.storeQuantity)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + } + } + + public static func parse_premiumGiftCodeOption(_ reader: BufferReader) -> PremiumGiftCodeOption? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } + var _6: String? + _6 = parseString(reader) + var _7: Int64? + _7 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + 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 { + public class Cons_premiumSubscriptionOption: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("premiumSubscriptionOption", [("flags", ConstructorParameterDescription(self.flags)), ("transaction", ConstructorParameterDescription(self.transaction)), ("months", ConstructorParameterDescription(self.months)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("botUrl", ConstructorParameterDescription(self.botUrl)), ("storeProduct", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .premiumSubscriptionOption(let _data): + return ("premiumSubscriptionOption", [("flags", ConstructorParameterDescription(_data.flags)), ("transaction", ConstructorParameterDescription(_data.transaction)), ("months", ConstructorParameterDescription(_data.months)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("botUrl", ConstructorParameterDescription(_data.botUrl)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct))]) + } + } + + public static func parse_premiumSubscriptionOption(_ reader: BufferReader) -> PremiumSubscriptionOption? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _2 = parseString(reader) + } + var _3: Int32? + _3 = reader.readInt32() + var _4: String? + _4 = parseString(reader) + var _5: Int64? + _5 = reader.readInt64() + var _6: String? + _6 = parseString(reader) + var _7: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _7 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + 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 { + public class Cons_prepaidGiveaway: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("prepaidGiveaway", [("id", ConstructorParameterDescription(self.id)), ("months", ConstructorParameterDescription(self.months)), ("quantity", ConstructorParameterDescription(self.quantity)), ("date", ConstructorParameterDescription(self.date))]) + } + } + public class Cons_prepaidStarsGiveaway: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("prepaidStarsGiveaway", [("id", ConstructorParameterDescription(self.id)), ("stars", ConstructorParameterDescription(self.stars)), ("quantity", ConstructorParameterDescription(self.quantity)), ("boosts", ConstructorParameterDescription(self.boosts)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .prepaidGiveaway(let _data): + return ("prepaidGiveaway", [("id", ConstructorParameterDescription(_data.id)), ("months", ConstructorParameterDescription(_data.months)), ("quantity", ConstructorParameterDescription(_data.quantity)), ("date", ConstructorParameterDescription(_data.date))]) + case .prepaidStarsGiveaway(let _data): + return ("prepaidStarsGiveaway", [("id", ConstructorParameterDescription(_data.id)), ("stars", ConstructorParameterDescription(_data.stars)), ("quantity", ConstructorParameterDescription(_data.quantity)), ("boosts", ConstructorParameterDescription(_data.boosts)), ("date", ConstructorParameterDescription(_data.date))]) + } + } + + public static func parse_prepaidGiveaway(_ reader: BufferReader) -> PrepaidGiveaway? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PrepaidGiveaway.prepaidGiveaway(Cons_prepaidGiveaway(id: _1!, months: _2!, quantity: _3!, date: _4!)) + } + else { + return nil + } + } + public static func parse_prepaidStarsGiveaway(_ reader: BufferReader) -> PrepaidGiveaway? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.PrepaidGiveaway.prepaidStarsGiveaway(Cons_prepaidStarsGiveaway(id: _1!, stars: _2!, quantity: _3!, boosts: _4!, date: _5!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum PrivacyKey: TypeConstructorDescription { + case privacyKeyAbout + case privacyKeyAddedByPhone + case privacyKeyBirthday + case privacyKeyChatInvite + case privacyKeyForwards + case privacyKeyNoPaidMessages + case privacyKeyPhoneCall + case privacyKeyPhoneNumber + case privacyKeyPhoneP2P + case privacyKeyProfilePhoto + case privacyKeySavedMusic + 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, ConstructorParameterDescription)]) { + switch self { + case .privacyKeyAbout: + return ("privacyKeyAbout", []) + case .privacyKeyAddedByPhone: + return ("privacyKeyAddedByPhone", []) + case .privacyKeyBirthday: + return ("privacyKeyBirthday", []) + case .privacyKeyChatInvite: + return ("privacyKeyChatInvite", []) + case .privacyKeyForwards: + return ("privacyKeyForwards", []) + case .privacyKeyNoPaidMessages: + return ("privacyKeyNoPaidMessages", []) + case .privacyKeyPhoneCall: + return ("privacyKeyPhoneCall", []) + case .privacyKeyPhoneNumber: + return ("privacyKeyPhoneNumber", []) + case .privacyKeyPhoneP2P: + return ("privacyKeyPhoneP2P", []) + case .privacyKeyProfilePhoto: + return ("privacyKeyProfilePhoto", []) + case .privacyKeySavedMusic: + return ("privacyKeySavedMusic", []) + case .privacyKeyStarGiftsAutoSave: + return ("privacyKeyStarGiftsAutoSave", []) + case .privacyKeyStatusTimestamp: + return ("privacyKeyStatusTimestamp", []) + case .privacyKeyVoiceMessages: + return ("privacyKeyVoiceMessages", []) + } + } + + public static func parse_privacyKeyAbout(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyAbout + } + public static func parse_privacyKeyAddedByPhone(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyAddedByPhone + } + public static func parse_privacyKeyBirthday(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyBirthday + } + public static func parse_privacyKeyChatInvite(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyChatInvite + } + public static func parse_privacyKeyForwards(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyForwards + } + public static func parse_privacyKeyNoPaidMessages(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyNoPaidMessages + } + public static func parse_privacyKeyPhoneCall(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyPhoneCall + } + public static func parse_privacyKeyPhoneNumber(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyPhoneNumber + } + public static func parse_privacyKeyPhoneP2P(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyPhoneP2P + } + public static func parse_privacyKeyProfilePhoto(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyProfilePhoto + } + public static func parse_privacyKeySavedMusic(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeySavedMusic + } + public static func parse_privacyKeyStarGiftsAutoSave(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyStarGiftsAutoSave + } + public static func parse_privacyKeyStatusTimestamp(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyStatusTimestamp + } + public static func parse_privacyKeyVoiceMessages(_ reader: BufferReader) -> PrivacyKey? { + return Api.PrivacyKey.privacyKeyVoiceMessages + } + } +} diff --git a/submodules/TelegramApi/Sources/Api22.swift b/submodules/TelegramApi/Sources/Api22.swift index 798549678a..102550071d 100644 --- a/submodules/TelegramApi/Sources/Api22.swift +++ b/submodules/TelegramApi/Sources/Api22.swift @@ -1,46 +1,835 @@ public extension Api { - enum ReceivedNotifyMessage: TypeConstructorDescription { - public class Cons_receivedNotifyMessage: TypeConstructorDescription { - public var id: Int32 - public var flags: Int32 - public init(id: Int32, flags: Int32) { - self.id = id - self.flags = flags + enum PrivacyRule: TypeConstructorDescription { + public class Cons_privacyValueAllowChatParticipants: TypeConstructorDescription { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("receivedNotifyMessage", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags))]) + return ("privacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) } } - case receivedNotifyMessage(Cons_receivedNotifyMessage) + public class Cons_privacyValueAllowUsers: TypeConstructorDescription { + public var users: [Int64] + public init(users: [Int64]) { + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyValueAllowUsers", [("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_privacyValueDisallowChatParticipants: TypeConstructorDescription { + public var chats: [Int64] + public init(chats: [Int64]) { + self.chats = chats + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) + } + } + public class Cons_privacyValueDisallowUsers: TypeConstructorDescription { + public var users: [Int64] + public init(users: [Int64]) { + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyValueDisallowUsers", [("users", ConstructorParameterDescription(self.users))]) + } + } + case privacyValueAllowAll + case privacyValueAllowBots + case privacyValueAllowChatParticipants(Cons_privacyValueAllowChatParticipants) + case privacyValueAllowCloseFriends + case privacyValueAllowContacts + case privacyValueAllowPremium + case privacyValueAllowUsers(Cons_privacyValueAllowUsers) + case privacyValueDisallowAll + case privacyValueDisallowBots + case privacyValueDisallowChatParticipants(Cons_privacyValueDisallowChatParticipants) + case privacyValueDisallowContacts + case privacyValueDisallowUsers(Cons_privacyValueDisallowUsers) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .receivedNotifyMessage(let _data): + case .privacyValueAllowAll: if boxed { - buffer.appendInt32(-1551583367) + 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) } - serializeInt32(_data.id, buffer: buffer, boxed: false) - serializeInt32(_data.flags, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .receivedNotifyMessage(let _data): - return ("receivedNotifyMessage", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags))]) + case .privacyValueAllowAll: + return ("privacyValueAllowAll", []) + case .privacyValueAllowBots: + return ("privacyValueAllowBots", []) + case .privacyValueAllowChatParticipants(let _data): + return ("privacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) + case .privacyValueAllowCloseFriends: + return ("privacyValueAllowCloseFriends", []) + case .privacyValueAllowContacts: + return ("privacyValueAllowContacts", []) + case .privacyValueAllowPremium: + return ("privacyValueAllowPremium", []) + case .privacyValueAllowUsers(let _data): + return ("privacyValueAllowUsers", [("users", ConstructorParameterDescription(_data.users))]) + case .privacyValueDisallowAll: + return ("privacyValueDisallowAll", []) + case .privacyValueDisallowBots: + return ("privacyValueDisallowBots", []) + case .privacyValueDisallowChatParticipants(let _data): + return ("privacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) + case .privacyValueDisallowContacts: + return ("privacyValueDisallowContacts", []) + case .privacyValueDisallowUsers(let _data): + return ("privacyValueDisallowUsers", [("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_receivedNotifyMessage(_ reader: BufferReader) -> ReceivedNotifyMessage? { + public static func parse_privacyValueAllowAll(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueAllowAll + } + public static func parse_privacyValueAllowBots(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueAllowBots + } + public static func parse_privacyValueAllowChatParticipants(_ reader: BufferReader) -> PrivacyRule? { + var _1: [Int64]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.PrivacyRule.privacyValueAllowChatParticipants(Cons_privacyValueAllowChatParticipants(chats: _1!)) + } + else { + return nil + } + } + public static func parse_privacyValueAllowCloseFriends(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueAllowCloseFriends + } + public static func parse_privacyValueAllowContacts(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueAllowContacts + } + public static func parse_privacyValueAllowPremium(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueAllowPremium + } + public static func parse_privacyValueAllowUsers(_ reader: BufferReader) -> PrivacyRule? { + var _1: [Int64]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.PrivacyRule.privacyValueAllowUsers(Cons_privacyValueAllowUsers(users: _1!)) + } + else { + return nil + } + } + public static func parse_privacyValueDisallowAll(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueDisallowAll + } + public static func parse_privacyValueDisallowBots(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueDisallowBots + } + public static func parse_privacyValueDisallowChatParticipants(_ reader: BufferReader) -> PrivacyRule? { + var _1: [Int64]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.PrivacyRule.privacyValueDisallowChatParticipants(Cons_privacyValueDisallowChatParticipants(chats: _1!)) + } + else { + return nil + } + } + public static func parse_privacyValueDisallowContacts(_ reader: BufferReader) -> PrivacyRule? { + return Api.PrivacyRule.privacyValueDisallowContacts + } + public static func parse_privacyValueDisallowUsers(_ reader: BufferReader) -> PrivacyRule? { + var _1: [Int64]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.PrivacyRule.privacyValueDisallowUsers(Cons_privacyValueDisallowUsers(users: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum ProfileTab: TypeConstructorDescription { + case profileTabFiles + case profileTabGifs + case profileTabGifts + case profileTabLinks + case profileTabMedia + 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, ConstructorParameterDescription)]) { + switch self { + case .profileTabFiles: + return ("profileTabFiles", []) + case .profileTabGifs: + return ("profileTabGifs", []) + case .profileTabGifts: + return ("profileTabGifts", []) + case .profileTabLinks: + return ("profileTabLinks", []) + case .profileTabMedia: + return ("profileTabMedia", []) + case .profileTabMusic: + return ("profileTabMusic", []) + case .profileTabPosts: + return ("profileTabPosts", []) + case .profileTabVoice: + return ("profileTabVoice", []) + } + } + + public static func parse_profileTabFiles(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabFiles + } + public static func parse_profileTabGifs(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabGifs + } + public static func parse_profileTabGifts(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabGifts + } + public static func parse_profileTabLinks(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabLinks + } + public static func parse_profileTabMedia(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabMedia + } + public static func parse_profileTabMusic(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabMusic + } + public static func parse_profileTabPosts(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabPosts + } + public static func parse_profileTabVoice(_ reader: BufferReader) -> ProfileTab? { + return Api.ProfileTab.profileTabVoice + } + } +} +public extension Api { + indirect enum PublicForward: TypeConstructorDescription { + public class Cons_publicForwardMessage: TypeConstructorDescription { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("publicForwardMessage", [("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_publicForwardStory: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("publicForwardStory", [("peer", ConstructorParameterDescription(self.peer)), ("story", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .publicForwardMessage(let _data): + return ("publicForwardMessage", [("message", ConstructorParameterDescription(_data.message))]) + case .publicForwardStory(let _data): + return ("publicForwardStory", [("peer", ConstructorParameterDescription(_data.peer)), ("story", ConstructorParameterDescription(_data.story))]) + } + } + + public static func parse_publicForwardMessage(_ reader: BufferReader) -> PublicForward? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + let _c1 = _1 != nil + if _c1 { + return Api.PublicForward.publicForwardMessage(Cons_publicForwardMessage(message: _1!)) + } + else { + return nil + } + } + public static func parse_publicForwardStory(_ reader: BufferReader) -> PublicForward? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Api.StoryItem? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StoryItem + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.PublicForward.publicForwardStory(Cons_publicForwardStory(peer: _1!, story: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum QuickReply: TypeConstructorDescription { + public class Cons_quickReply: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("quickReply", [("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("shortcut", ConstructorParameterDescription(self.shortcut)), ("topMessage", ConstructorParameterDescription(self.topMessage)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .quickReply(let _data): + return ("quickReply", [("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("shortcut", ConstructorParameterDescription(_data.shortcut)), ("topMessage", ConstructorParameterDescription(_data.topMessage)), ("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_quickReply(_ reader: BufferReader) -> QuickReply? { var _1: Int32? _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.QuickReply.quickReply(Cons_quickReply(shortcutId: _1!, shortcut: _2!, topMessage: _3!, count: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum Reaction: TypeConstructorDescription { + public class Cons_reactionCustomEmoji: TypeConstructorDescription { + public var documentId: Int64 + public init(documentId: Int64) { + self.documentId = documentId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reactionCustomEmoji", [("documentId", ConstructorParameterDescription(self.documentId))]) + } + } + public class Cons_reactionEmoji: TypeConstructorDescription { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reactionEmoji", [("emoticon", ConstructorParameterDescription(self.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 _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, ConstructorParameterDescription)]) { + switch self { + case .reactionCustomEmoji(let _data): + return ("reactionCustomEmoji", [("documentId", ConstructorParameterDescription(_data.documentId))]) + case .reactionEmoji(let _data): + return ("reactionEmoji", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) + case .reactionEmpty: + return ("reactionEmpty", []) + 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(Cons_reactionCustomEmoji(documentId: _1!)) + } + else { + return nil + } + } + public static func parse_reactionEmoji(_ reader: BufferReader) -> Reaction? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.Reaction.reactionEmoji(Cons_reactionEmoji(emoticon: _1!)) + } + else { + return nil + } + } + public static func parse_reactionEmpty(_ reader: BufferReader) -> Reaction? { + return Api.Reaction.reactionEmpty + } + public static func parse_reactionPaid(_ reader: BufferReader) -> Reaction? { + return Api.Reaction.reactionPaid + } + } +} +public extension Api { + enum ReactionCount: TypeConstructorDescription { + public class Cons_reactionCount: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reactionCount", [("flags", ConstructorParameterDescription(self.flags)), ("chosenOrder", ConstructorParameterDescription(self.chosenOrder)), ("reaction", ConstructorParameterDescription(self.reaction)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .reactionCount(let _data): + return ("reactionCount", [("flags", ConstructorParameterDescription(_data.flags)), ("chosenOrder", ConstructorParameterDescription(_data.chosenOrder)), ("reaction", ConstructorParameterDescription(_data.reaction)), ("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_reactionCount(_ reader: BufferReader) -> ReactionCount? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & 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 + } + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + 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, ConstructorParameterDescription)]) { + switch self { + case .reactionNotificationsFromAll: + return ("reactionNotificationsFromAll", []) + 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 { + public class Cons_reactionsNotifySettings: TypeConstructorDescription { + public var flags: Int32 + public var messagesNotifyFrom: Api.ReactionNotificationsFrom? + public var storiesNotifyFrom: Api.ReactionNotificationsFrom? + public var pollVotesNotifyFrom: Api.ReactionNotificationsFrom? + public var sound: Api.NotificationSound + public var showPreviews: Api.Bool + public init(flags: Int32, messagesNotifyFrom: Api.ReactionNotificationsFrom?, storiesNotifyFrom: Api.ReactionNotificationsFrom?, pollVotesNotifyFrom: Api.ReactionNotificationsFrom?, sound: Api.NotificationSound, showPreviews: Api.Bool) { + self.flags = flags + self.messagesNotifyFrom = messagesNotifyFrom + self.storiesNotifyFrom = storiesNotifyFrom + self.pollVotesNotifyFrom = pollVotesNotifyFrom + self.sound = sound + self.showPreviews = showPreviews + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reactionsNotifySettings", [("flags", ConstructorParameterDescription(self.flags)), ("messagesNotifyFrom", ConstructorParameterDescription(self.messagesNotifyFrom)), ("storiesNotifyFrom", ConstructorParameterDescription(self.storiesNotifyFrom)), ("pollVotesNotifyFrom", ConstructorParameterDescription(self.pollVotesNotifyFrom)), ("sound", ConstructorParameterDescription(self.sound)), ("showPreviews", ConstructorParameterDescription(self.showPreviews))]) + } + } + case reactionsNotifySettings(Cons_reactionsNotifySettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .reactionsNotifySettings(let _data): + if boxed { + buffer.appendInt32(1910827608) + } + 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) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.pollVotesNotifyFrom!.serialize(buffer, true) + } + _data.sound.serialize(buffer, true) + _data.showPreviews.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .reactionsNotifySettings(let _data): + return ("reactionsNotifySettings", [("flags", ConstructorParameterDescription(_data.flags)), ("messagesNotifyFrom", ConstructorParameterDescription(_data.messagesNotifyFrom)), ("storiesNotifyFrom", ConstructorParameterDescription(_data.storiesNotifyFrom)), ("pollVotesNotifyFrom", ConstructorParameterDescription(_data.pollVotesNotifyFrom)), ("sound", ConstructorParameterDescription(_data.sound)), ("showPreviews", ConstructorParameterDescription(_data.showPreviews))]) + } + } + + public static func parse_reactionsNotifySettings(_ reader: BufferReader) -> ReactionsNotifySettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.ReactionNotificationsFrom? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom + } + } + var _4: Api.ReactionNotificationsFrom? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom + } + } + var _5: Api.NotificationSound? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.NotificationSound + } + var _6: Api.Bool? + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Bool + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.ReactionsNotifySettings.reactionsNotifySettings(Cons_reactionsNotifySettings(flags: _1!, messagesNotifyFrom: _2, storiesNotifyFrom: _3, pollVotesNotifyFrom: _4, sound: _5!, showPreviews: _6!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum ReadParticipantDate: TypeConstructorDescription { + public class Cons_readParticipantDate: TypeConstructorDescription { + public var userId: Int64 + public var date: Int32 + public init(userId: Int64, date: Int32) { + self.userId = userId + self.date = date + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("readParticipantDate", [("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .readParticipantDate(let _data): + return ("readParticipantDate", [("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date))]) + } + } + + public static func parse_readParticipantDate(_ reader: BufferReader) -> ReadParticipantDate? { + var _1: Int64? + _1 = reader.readInt64() var _2: Int32? _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.ReceivedNotifyMessage.receivedNotifyMessage(Cons_receivedNotifyMessage(id: _1!, flags: _2!)) + return Api.ReadParticipantDate.readParticipantDate(Cons_readParticipantDate(userId: _1!, date: _2!)) } else { return nil @@ -48,1182 +837,3 @@ public extension Api { } } } -public extension Api { - indirect enum RecentMeUrl: TypeConstructorDescription { - public class Cons_recentMeUrlChat: TypeConstructorDescription { - public var url: String - public var chatId: Int64 - public init(url: String, chatId: Int64) { - self.url = url - self.chatId = chatId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentMeUrlChat", [("url", ConstructorParameterDescription(self.url)), ("chatId", ConstructorParameterDescription(self.chatId))]) - } - } - public class Cons_recentMeUrlChatInvite: TypeConstructorDescription { - public var url: String - public var chatInvite: Api.ChatInvite - public init(url: String, chatInvite: Api.ChatInvite) { - self.url = url - self.chatInvite = chatInvite - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentMeUrlChatInvite", [("url", ConstructorParameterDescription(self.url)), ("chatInvite", ConstructorParameterDescription(self.chatInvite))]) - } - } - public class Cons_recentMeUrlStickerSet: TypeConstructorDescription { - public var url: String - public var set: Api.StickerSetCovered - public init(url: String, set: Api.StickerSetCovered) { - self.url = url - self.set = set - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentMeUrlStickerSet", [("url", ConstructorParameterDescription(self.url)), ("set", ConstructorParameterDescription(self.set))]) - } - } - public class Cons_recentMeUrlUnknown: TypeConstructorDescription { - public var url: String - public init(url: String) { - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentMeUrlUnknown", [("url", ConstructorParameterDescription(self.url))]) - } - } - public class Cons_recentMeUrlUser: TypeConstructorDescription { - public var url: String - public var userId: Int64 - public init(url: String, userId: Int64) { - self.url = url - self.userId = userId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentMeUrlUser", [("url", ConstructorParameterDescription(self.url)), ("userId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .recentMeUrlChat(let _data): - return ("recentMeUrlChat", [("url", ConstructorParameterDescription(_data.url)), ("chatId", ConstructorParameterDescription(_data.chatId))]) - case .recentMeUrlChatInvite(let _data): - return ("recentMeUrlChatInvite", [("url", ConstructorParameterDescription(_data.url)), ("chatInvite", ConstructorParameterDescription(_data.chatInvite))]) - case .recentMeUrlStickerSet(let _data): - return ("recentMeUrlStickerSet", [("url", ConstructorParameterDescription(_data.url)), ("set", ConstructorParameterDescription(_data.set))]) - case .recentMeUrlUnknown(let _data): - return ("recentMeUrlUnknown", [("url", ConstructorParameterDescription(_data.url))]) - case .recentMeUrlUser(let _data): - return ("recentMeUrlUser", [("url", ConstructorParameterDescription(_data.url)), ("userId", ConstructorParameterDescription(_data.userId))]) - } - } - - public static func parse_recentMeUrlChat(_ reader: BufferReader) -> RecentMeUrl? { - var _1: String? - _1 = parseString(reader) - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlChat(Cons_recentMeUrlChat(url: _1!, chatId: _2!)) - } - else { - return nil - } - } - public static func parse_recentMeUrlChatInvite(_ reader: BufferReader) -> RecentMeUrl? { - var _1: String? - _1 = parseString(reader) - var _2: Api.ChatInvite? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ChatInvite - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlChatInvite(Cons_recentMeUrlChatInvite(url: _1!, chatInvite: _2!)) - } - else { - return nil - } - } - public static func parse_recentMeUrlStickerSet(_ reader: BufferReader) -> RecentMeUrl? { - var _1: String? - _1 = parseString(reader) - var _2: Api.StickerSetCovered? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StickerSetCovered - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlStickerSet(Cons_recentMeUrlStickerSet(url: _1!, set: _2!)) - } - else { - return nil - } - } - public static func parse_recentMeUrlUnknown(_ reader: BufferReader) -> RecentMeUrl? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.RecentMeUrl.recentMeUrlUnknown(Cons_recentMeUrlUnknown(url: _1!)) - } - else { - return nil - } - } - public static func parse_recentMeUrlUser(_ reader: BufferReader) -> RecentMeUrl? { - var _1: String? - _1 = parseString(reader) - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.RecentMeUrl.recentMeUrlUser(Cons_recentMeUrlUser(url: _1!, userId: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum RecentStory: TypeConstructorDescription { - public class Cons_recentStory: TypeConstructorDescription { - public var flags: Int32 - public var maxId: Int32? - public init(flags: Int32, maxId: Int32?) { - self.flags = flags - self.maxId = maxId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentStory", [("flags", ConstructorParameterDescription(self.flags)), ("maxId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .recentStory(let _data): - return ("recentStory", [("flags", ConstructorParameterDescription(_data.flags)), ("maxId", ConstructorParameterDescription(_data.maxId))]) - } - } - - public static func parse_recentStory(_ reader: BufferReader) -> RecentStory? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _2 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - if _c1 && _c2 { - return Api.RecentStory.recentStory(Cons_recentStory(flags: _1!, maxId: _2)) - } - else { - return nil - } - } - } -} -public extension Api { - enum ReplyMarkup: TypeConstructorDescription { - public class Cons_replyInlineMarkup: TypeConstructorDescription { - public var rows: [Api.KeyboardButtonRow] - public init(rows: [Api.KeyboardButtonRow]) { - self.rows = rows - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("replyInlineMarkup", [("rows", ConstructorParameterDescription(self.rows))]) - } - } - public class Cons_replyKeyboardForceReply: TypeConstructorDescription { - public var flags: Int32 - public var placeholder: String? - public init(flags: Int32, placeholder: String?) { - self.flags = flags - self.placeholder = placeholder - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("replyKeyboardForceReply", [("flags", ConstructorParameterDescription(self.flags)), ("placeholder", ConstructorParameterDescription(self.placeholder))]) - } - } - public class Cons_replyKeyboardHide: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("replyKeyboardHide", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - public class Cons_replyKeyboardMarkup: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("replyKeyboardMarkup", [("flags", ConstructorParameterDescription(self.flags)), ("rows", ConstructorParameterDescription(self.rows)), ("placeholder", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .replyInlineMarkup(let _data): - return ("replyInlineMarkup", [("rows", ConstructorParameterDescription(_data.rows))]) - case .replyKeyboardForceReply(let _data): - return ("replyKeyboardForceReply", [("flags", ConstructorParameterDescription(_data.flags)), ("placeholder", ConstructorParameterDescription(_data.placeholder))]) - case .replyKeyboardHide(let _data): - return ("replyKeyboardHide", [("flags", ConstructorParameterDescription(_data.flags))]) - case .replyKeyboardMarkup(let _data): - return ("replyKeyboardMarkup", [("flags", ConstructorParameterDescription(_data.flags)), ("rows", ConstructorParameterDescription(_data.rows)), ("placeholder", ConstructorParameterDescription(_data.placeholder))]) - } - } - - public static func parse_replyInlineMarkup(_ reader: BufferReader) -> ReplyMarkup? { - var _1: [Api.KeyboardButtonRow]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.KeyboardButtonRow.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.ReplyMarkup.replyInlineMarkup(Cons_replyInlineMarkup(rows: _1!)) - } - else { - return nil - } - } - public static func parse_replyKeyboardForceReply(_ reader: BufferReader) -> ReplyMarkup? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _2 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil - if _c1 && _c2 { - return Api.ReplyMarkup.replyKeyboardForceReply(Cons_replyKeyboardForceReply(flags: _1!, placeholder: _2)) - } - else { - return nil - } - } - public static func parse_replyKeyboardHide(_ reader: BufferReader) -> ReplyMarkup? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.ReplyMarkup.replyKeyboardHide(Cons_replyKeyboardHide(flags: _1!)) - } - else { - return nil - } - } - public static func parse_replyKeyboardMarkup(_ reader: BufferReader) -> ReplyMarkup? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.KeyboardButtonRow]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.KeyboardButtonRow.self) - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _3 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.ReplyMarkup.replyKeyboardMarkup(Cons_replyKeyboardMarkup(flags: _1!, rows: _2!, placeholder: _3)) - } - else { - return nil - } - } - } -} -public extension Api { - enum ReportReason: TypeConstructorDescription { - case inputReportReasonChildAbuse - case inputReportReasonCopyright - case inputReportReasonFake - case inputReportReasonGeoIrrelevant - case inputReportReasonIllegalDrugs - case inputReportReasonOther - case inputReportReasonPersonalDetails - 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, ConstructorParameterDescription)]) { - switch self { - case .inputReportReasonChildAbuse: - return ("inputReportReasonChildAbuse", []) - case .inputReportReasonCopyright: - return ("inputReportReasonCopyright", []) - case .inputReportReasonFake: - return ("inputReportReasonFake", []) - case .inputReportReasonGeoIrrelevant: - return ("inputReportReasonGeoIrrelevant", []) - case .inputReportReasonIllegalDrugs: - return ("inputReportReasonIllegalDrugs", []) - case .inputReportReasonOther: - return ("inputReportReasonOther", []) - case .inputReportReasonPersonalDetails: - return ("inputReportReasonPersonalDetails", []) - case .inputReportReasonPornography: - return ("inputReportReasonPornography", []) - case .inputReportReasonSpam: - return ("inputReportReasonSpam", []) - case .inputReportReasonViolence: - return ("inputReportReasonViolence", []) - } - } - - public static func parse_inputReportReasonChildAbuse(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonChildAbuse - } - public static func parse_inputReportReasonCopyright(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonCopyright - } - public static func parse_inputReportReasonFake(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonFake - } - public static func parse_inputReportReasonGeoIrrelevant(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonGeoIrrelevant - } - public static func parse_inputReportReasonIllegalDrugs(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonIllegalDrugs - } - public static func parse_inputReportReasonOther(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonOther - } - public static func parse_inputReportReasonPersonalDetails(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonPersonalDetails - } - public static func parse_inputReportReasonPornography(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonPornography - } - public static func parse_inputReportReasonSpam(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonSpam - } - public static func parse_inputReportReasonViolence(_ reader: BufferReader) -> ReportReason? { - return Api.ReportReason.inputReportReasonViolence - } - } -} -public extension Api { - enum ReportResult: TypeConstructorDescription { - public class Cons_reportResultAddComment: TypeConstructorDescription { - public var flags: Int32 - public var option: Buffer - public init(flags: Int32, option: Buffer) { - self.flags = flags - self.option = option - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("reportResultAddComment", [("flags", ConstructorParameterDescription(self.flags)), ("option", ConstructorParameterDescription(self.option))]) - } - } - public class Cons_reportResultChooseOption: TypeConstructorDescription { - public var title: String - public var options: [Api.MessageReportOption] - public init(title: String, options: [Api.MessageReportOption]) { - self.title = title - self.options = options - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("reportResultChooseOption", [("title", ConstructorParameterDescription(self.title)), ("options", ConstructorParameterDescription(self.options))]) - } - } - case reportResultAddComment(Cons_reportResultAddComment) - case reportResultChooseOption(Cons_reportResultChooseOption) - 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, ConstructorParameterDescription)]) { - switch self { - case .reportResultAddComment(let _data): - return ("reportResultAddComment", [("flags", ConstructorParameterDescription(_data.flags)), ("option", ConstructorParameterDescription(_data.option))]) - case .reportResultChooseOption(let _data): - return ("reportResultChooseOption", [("title", ConstructorParameterDescription(_data.title)), ("options", ConstructorParameterDescription(_data.options))]) - case .reportResultReported: - return ("reportResultReported", []) - } - } - - public static func parse_reportResultAddComment(_ reader: BufferReader) -> ReportResult? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.ReportResult.reportResultAddComment(Cons_reportResultAddComment(flags: _1!, option: _2!)) - } - else { - return nil - } - } - public static func parse_reportResultChooseOption(_ reader: BufferReader) -> ReportResult? { - var _1: String? - _1 = parseString(reader) - var _2: [Api.MessageReportOption]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageReportOption.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.ReportResult.reportResultChooseOption(Cons_reportResultChooseOption(title: _1!, options: _2!)) - } - else { - return nil - } - } - public static func parse_reportResultReported(_ reader: BufferReader) -> ReportResult? { - return Api.ReportResult.reportResultReported - } - } -} -public extension Api { - enum RequestPeerType: TypeConstructorDescription { - public class Cons_requestPeerTypeBroadcast: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestPeerTypeBroadcast", [("flags", ConstructorParameterDescription(self.flags)), ("hasUsername", ConstructorParameterDescription(self.hasUsername)), ("userAdminRights", ConstructorParameterDescription(self.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(self.botAdminRights))]) - } - } - public class Cons_requestPeerTypeChat: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestPeerTypeChat", [("flags", ConstructorParameterDescription(self.flags)), ("hasUsername", ConstructorParameterDescription(self.hasUsername)), ("forum", ConstructorParameterDescription(self.forum)), ("userAdminRights", ConstructorParameterDescription(self.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(self.botAdminRights))]) - } - } - public class Cons_requestPeerTypeCreateBot: TypeConstructorDescription { - public var flags: Int32 - public var suggestedName: String? - public var suggestedUsername: String? - public init(flags: Int32, suggestedName: String?, suggestedUsername: String?) { - self.flags = flags - self.suggestedName = suggestedName - self.suggestedUsername = suggestedUsername - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestPeerTypeCreateBot", [("flags", ConstructorParameterDescription(self.flags)), ("suggestedName", ConstructorParameterDescription(self.suggestedName)), ("suggestedUsername", ConstructorParameterDescription(self.suggestedUsername))]) - } - } - public class Cons_requestPeerTypeUser: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestPeerTypeUser", [("flags", ConstructorParameterDescription(self.flags)), ("bot", ConstructorParameterDescription(self.bot)), ("premium", ConstructorParameterDescription(self.premium))]) - } - } - case requestPeerTypeBroadcast(Cons_requestPeerTypeBroadcast) - case requestPeerTypeChat(Cons_requestPeerTypeChat) - case requestPeerTypeCreateBot(Cons_requestPeerTypeCreateBot) - 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 .requestPeerTypeCreateBot(let _data): - if boxed { - buffer.appendInt32(1048699000) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeString(_data.suggestedName!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeString(_data.suggestedUsername!, buffer: buffer, boxed: false) - } - 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, ConstructorParameterDescription)]) { - switch self { - case .requestPeerTypeBroadcast(let _data): - return ("requestPeerTypeBroadcast", [("flags", ConstructorParameterDescription(_data.flags)), ("hasUsername", ConstructorParameterDescription(_data.hasUsername)), ("userAdminRights", ConstructorParameterDescription(_data.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(_data.botAdminRights))]) - case .requestPeerTypeChat(let _data): - return ("requestPeerTypeChat", [("flags", ConstructorParameterDescription(_data.flags)), ("hasUsername", ConstructorParameterDescription(_data.hasUsername)), ("forum", ConstructorParameterDescription(_data.forum)), ("userAdminRights", ConstructorParameterDescription(_data.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(_data.botAdminRights))]) - case .requestPeerTypeCreateBot(let _data): - return ("requestPeerTypeCreateBot", [("flags", ConstructorParameterDescription(_data.flags)), ("suggestedName", ConstructorParameterDescription(_data.suggestedName)), ("suggestedUsername", ConstructorParameterDescription(_data.suggestedUsername))]) - case .requestPeerTypeUser(let _data): - return ("requestPeerTypeUser", [("flags", ConstructorParameterDescription(_data.flags)), ("bot", ConstructorParameterDescription(_data.bot)), ("premium", ConstructorParameterDescription(_data.premium))]) - } - } - - public static func parse_requestPeerTypeBroadcast(_ reader: BufferReader) -> RequestPeerType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Bool? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 3) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.RequestPeerType.requestPeerTypeBroadcast(Cons_requestPeerTypeBroadcast(flags: _1!, hasUsername: _2, userAdminRights: _3, botAdminRights: _4)) - } - else { - return nil - } - } - public static func parse_requestPeerTypeChat(_ reader: BufferReader) -> RequestPeerType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Bool? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 3) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.RequestPeerType.requestPeerTypeChat(Cons_requestPeerTypeChat(flags: _1!, hasUsername: _2, forum: _3, userAdminRights: _4, botAdminRights: _5)) - } - else { - return nil - } - } - public static func parse_requestPeerTypeCreateBot(_ reader: BufferReader) -> RequestPeerType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _2 = parseString(reader) - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.RequestPeerType.requestPeerTypeCreateBot(Cons_requestPeerTypeCreateBot(flags: _1!, suggestedName: _2, suggestedUsername: _3)) - } - else { - return nil - } - } - public static func parse_requestPeerTypeUser(_ reader: BufferReader) -> RequestPeerType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Bool? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.RequestPeerType.requestPeerTypeUser(Cons_requestPeerTypeUser(flags: _1!, bot: _2, premium: _3)) - } - else { - return nil - } - } - } -} -public extension Api { - enum RequestedPeer: TypeConstructorDescription { - public class Cons_requestedPeerChannel: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestedPeerChannel", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("title", ConstructorParameterDescription(self.title)), ("username", ConstructorParameterDescription(self.username)), ("photo", ConstructorParameterDescription(self.photo))]) - } - } - public class Cons_requestedPeerChat: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestedPeerChat", [("flags", ConstructorParameterDescription(self.flags)), ("chatId", ConstructorParameterDescription(self.chatId)), ("title", ConstructorParameterDescription(self.title)), ("photo", ConstructorParameterDescription(self.photo))]) - } - } - public class Cons_requestedPeerUser: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestedPeerUser", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("username", ConstructorParameterDescription(self.username)), ("photo", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .requestedPeerChannel(let _data): - return ("requestedPeerChannel", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("title", ConstructorParameterDescription(_data.title)), ("username", ConstructorParameterDescription(_data.username)), ("photo", ConstructorParameterDescription(_data.photo))]) - case .requestedPeerChat(let _data): - return ("requestedPeerChat", [("flags", ConstructorParameterDescription(_data.flags)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("title", ConstructorParameterDescription(_data.title)), ("photo", ConstructorParameterDescription(_data.photo))]) - case .requestedPeerUser(let _data): - return ("requestedPeerUser", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("username", ConstructorParameterDescription(_data.username)), ("photo", ConstructorParameterDescription(_data.photo))]) - } - } - - 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 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = parseString(reader) - } - var _5: Api.Photo? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.RequestedPeer.requestedPeerChannel(Cons_requestedPeerChannel(flags: _1!, channelId: _2!, title: _3, username: _4, photo: _5)) - } - else { - return nil - } - } - public static func parse_requestedPeerChat(_ reader: BufferReader) -> RequestedPeer? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - var _4: Api.Photo? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.RequestedPeer.requestedPeerChat(Cons_requestedPeerChat(flags: _1!, chatId: _2!, title: _3, photo: _4)) - } - else { - return nil - } - } - public static func parse_requestedPeerUser(_ reader: BufferReader) -> RequestedPeer? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - var _6: Api.Photo? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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: TypeConstructorDescription { - public var starsAmount: Int64 - public init(starsAmount: Int64) { - self.starsAmount = starsAmount - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requirementToContactPaidMessages", [("starsAmount", ConstructorParameterDescription(self.starsAmount))]) - } - } - case requirementToContactEmpty - 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 _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, ConstructorParameterDescription)]) { - switch self { - case .requirementToContactEmpty: - return ("requirementToContactEmpty", []) - case .requirementToContactPaidMessages(let _data): - return ("requirementToContactPaidMessages", [("starsAmount", ConstructorParameterDescription(_data.starsAmount))]) - case .requirementToContactPremium: - return ("requirementToContactPremium", []) - } - } - - public static func parse_requirementToContactEmpty(_ reader: BufferReader) -> RequirementToContact? { - return Api.RequirementToContact.requirementToContactEmpty - } - public static func parse_requirementToContactPaidMessages(_ reader: BufferReader) -> RequirementToContact? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.RequirementToContact.requirementToContactPaidMessages(Cons_requirementToContactPaidMessages(starsAmount: _1!)) - } - else { - return nil - } - } - 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 7d816e2222..798549678a 100644 --- a/submodules/TelegramApi/Sources/Api23.swift +++ b/submodules/TelegramApi/Sources/Api23.swift @@ -1,52 +1,46 @@ public extension Api { - enum RestrictionReason: TypeConstructorDescription { - public class Cons_restrictionReason: TypeConstructorDescription { - 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 + enum ReceivedNotifyMessage: TypeConstructorDescription { + public class Cons_receivedNotifyMessage: TypeConstructorDescription { + public var id: Int32 + public var flags: Int32 + public init(id: Int32, flags: Int32) { + self.id = id + self.flags = flags } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("restrictionReason", [("platform", ConstructorParameterDescription(self.platform)), ("reason", ConstructorParameterDescription(self.reason)), ("text", ConstructorParameterDescription(self.text))]) + return ("receivedNotifyMessage", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags))]) } } - case restrictionReason(Cons_restrictionReason) + case receivedNotifyMessage(Cons_receivedNotifyMessage) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .restrictionReason(let _data): + case .receivedNotifyMessage(let _data): if boxed { - buffer.appendInt32(-797791052) + buffer.appendInt32(-1551583367) } - serializeString(_data.platform, buffer: buffer, boxed: false) - serializeString(_data.reason, buffer: buffer, boxed: false) - serializeString(_data.text, buffer: buffer, boxed: false) + serializeInt32(_data.id, buffer: buffer, boxed: false) + serializeInt32(_data.flags, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .restrictionReason(let _data): - return ("restrictionReason", [("platform", ConstructorParameterDescription(_data.platform)), ("reason", ConstructorParameterDescription(_data.reason)), ("text", ConstructorParameterDescription(_data.text))]) + case .receivedNotifyMessage(let _data): + return ("receivedNotifyMessage", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags))]) } } - public static func parse_restrictionReason(_ reader: BufferReader) -> RestrictionReason? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) + public static func parse_receivedNotifyMessage(_ reader: BufferReader) -> ReceivedNotifyMessage? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.RestrictionReason.restrictionReason(Cons_restrictionReason(platform: _1!, reason: _2!, text: _3!)) + if _c1 && _c2 { + return Api.ReceivedNotifyMessage.receivedNotifyMessage(Cons_receivedNotifyMessage(id: _1!, flags: _2!)) } else { return nil @@ -55,730 +49,895 @@ public extension Api { } } public extension Api { - indirect enum RichText: TypeConstructorDescription { - public class Cons_textAnchor: TypeConstructorDescription { - public var text: Api.RichText - public var name: String - public init(text: Api.RichText, name: String) { - self.text = text - self.name = name - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textAnchor", [("text", ConstructorParameterDescription(self.text)), ("name", ConstructorParameterDescription(self.name))]) - } - } - public class Cons_textBold: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textBold", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textConcat: TypeConstructorDescription { - public var texts: [Api.RichText] - public init(texts: [Api.RichText]) { - self.texts = texts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textConcat", [("texts", ConstructorParameterDescription(self.texts))]) - } - } - public class Cons_textEmail: TypeConstructorDescription { - public var text: Api.RichText - public var email: String - public init(text: Api.RichText, email: String) { - self.text = text - self.email = email - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textEmail", [("text", ConstructorParameterDescription(self.text)), ("email", ConstructorParameterDescription(self.email))]) - } - } - public class Cons_textFixed: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textFixed", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textImage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textImage", [("documentId", ConstructorParameterDescription(self.documentId)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h))]) - } - } - public class Cons_textItalic: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textItalic", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textMarked: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textMarked", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textPhone: TypeConstructorDescription { - public var text: Api.RichText - public var phone: String - public init(text: Api.RichText, phone: String) { - self.text = text - self.phone = phone - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textPhone", [("text", ConstructorParameterDescription(self.text)), ("phone", ConstructorParameterDescription(self.phone))]) - } - } - public class Cons_textPlain: TypeConstructorDescription { - public var text: String - public init(text: String) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textPlain", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textStrike: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textStrike", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textSubscript: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textSubscript", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textSuperscript: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textSuperscript", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textUnderline: TypeConstructorDescription { - public var text: Api.RichText - public init(text: Api.RichText) { - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textUnderline", [("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_textUrl: TypeConstructorDescription { - public var text: Api.RichText + indirect enum RecentMeUrl: TypeConstructorDescription { + public class Cons_recentMeUrlChat: TypeConstructorDescription { public var url: String - public var webpageId: Int64 - public init(text: Api.RichText, url: String, webpageId: Int64) { - self.text = text + public var chatId: Int64 + public init(url: String, chatId: Int64) { self.url = url - self.webpageId = webpageId + self.chatId = chatId } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textUrl", [("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId))]) + return ("recentMeUrlChat", [("url", ConstructorParameterDescription(self.url)), ("chatId", ConstructorParameterDescription(self.chatId))]) } } - case textAnchor(Cons_textAnchor) - case textBold(Cons_textBold) - case textConcat(Cons_textConcat) - case textEmail(Cons_textEmail) - 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 class Cons_recentMeUrlChatInvite: TypeConstructorDescription { + public var url: String + public var chatInvite: Api.ChatInvite + public init(url: String, chatInvite: Api.ChatInvite) { + self.url = url + self.chatInvite = chatInvite + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlChatInvite", [("url", ConstructorParameterDescription(self.url)), ("chatInvite", ConstructorParameterDescription(self.chatInvite))]) + } + } + public class Cons_recentMeUrlStickerSet: TypeConstructorDescription { + public var url: String + public var set: Api.StickerSetCovered + public init(url: String, set: Api.StickerSetCovered) { + self.url = url + self.set = set + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlStickerSet", [("url", ConstructorParameterDescription(self.url)), ("set", ConstructorParameterDescription(self.set))]) + } + } + public class Cons_recentMeUrlUnknown: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlUnknown", [("url", ConstructorParameterDescription(self.url))]) + } + } + public class Cons_recentMeUrlUser: TypeConstructorDescription { + public var url: String + public var userId: Int64 + public init(url: String, userId: Int64) { + self.url = url + self.userId = userId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlUser", [("url", ConstructorParameterDescription(self.url)), ("userId", ConstructorParameterDescription(self.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 .textAnchor(let _data): + case .recentMeUrlChat(let _data): if boxed { - buffer.appendInt32(894777186) + buffer.appendInt32(-1294306862) } - _data.text.serialize(buffer, true) - serializeString(_data.name, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.chatId, buffer: buffer, boxed: false) break - case .textBold(let _data): + case .recentMeUrlChatInvite(let _data): if boxed { - buffer.appendInt32(1730456516) + buffer.appendInt32(-347535331) } - _data.text.serialize(buffer, true) + serializeString(_data.url, buffer: buffer, boxed: false) + _data.chatInvite.serialize(buffer, true) break - case .textConcat(let _data): + case .recentMeUrlStickerSet(let _data): if boxed { - buffer.appendInt32(2120376535) + 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, ConstructorParameterDescription)]) { + switch self { + case .recentMeUrlChat(let _data): + return ("recentMeUrlChat", [("url", ConstructorParameterDescription(_data.url)), ("chatId", ConstructorParameterDescription(_data.chatId))]) + case .recentMeUrlChatInvite(let _data): + return ("recentMeUrlChatInvite", [("url", ConstructorParameterDescription(_data.url)), ("chatInvite", ConstructorParameterDescription(_data.chatInvite))]) + case .recentMeUrlStickerSet(let _data): + return ("recentMeUrlStickerSet", [("url", ConstructorParameterDescription(_data.url)), ("set", ConstructorParameterDescription(_data.set))]) + case .recentMeUrlUnknown(let _data): + return ("recentMeUrlUnknown", [("url", ConstructorParameterDescription(_data.url))]) + case .recentMeUrlUser(let _data): + return ("recentMeUrlUser", [("url", ConstructorParameterDescription(_data.url)), ("userId", ConstructorParameterDescription(_data.userId))]) + } + } + + public static func parse_recentMeUrlChat(_ reader: BufferReader) -> RecentMeUrl? { + var _1: String? + _1 = parseString(reader) + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RecentMeUrl.recentMeUrlChat(Cons_recentMeUrlChat(url: _1!, chatId: _2!)) + } + else { + return nil + } + } + public static func parse_recentMeUrlChatInvite(_ reader: BufferReader) -> RecentMeUrl? { + var _1: String? + _1 = parseString(reader) + var _2: Api.ChatInvite? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ChatInvite + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RecentMeUrl.recentMeUrlChatInvite(Cons_recentMeUrlChatInvite(url: _1!, chatInvite: _2!)) + } + else { + return nil + } + } + public static func parse_recentMeUrlStickerSet(_ reader: BufferReader) -> RecentMeUrl? { + var _1: String? + _1 = parseString(reader) + var _2: Api.StickerSetCovered? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StickerSetCovered + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RecentMeUrl.recentMeUrlStickerSet(Cons_recentMeUrlStickerSet(url: _1!, set: _2!)) + } + else { + return nil + } + } + public static func parse_recentMeUrlUnknown(_ reader: BufferReader) -> RecentMeUrl? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.RecentMeUrl.recentMeUrlUnknown(Cons_recentMeUrlUnknown(url: _1!)) + } + else { + return nil + } + } + public static func parse_recentMeUrlUser(_ reader: BufferReader) -> RecentMeUrl? { + var _1: String? + _1 = parseString(reader) + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RecentMeUrl.recentMeUrlUser(Cons_recentMeUrlUser(url: _1!, userId: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum RecentStory: TypeConstructorDescription { + public class Cons_recentStory: TypeConstructorDescription { + public var flags: Int32 + public var maxId: Int32? + public init(flags: Int32, maxId: Int32?) { + self.flags = flags + self.maxId = maxId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentStory", [("flags", ConstructorParameterDescription(self.flags)), ("maxId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .recentStory(let _data): + return ("recentStory", [("flags", ConstructorParameterDescription(_data.flags)), ("maxId", ConstructorParameterDescription(_data.maxId))]) + } + } + + public static func parse_recentStory(_ reader: BufferReader) -> RecentStory? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + if _c1 && _c2 { + return Api.RecentStory.recentStory(Cons_recentStory(flags: _1!, maxId: _2)) + } + else { + return nil + } + } + } +} +public extension Api { + enum ReplyMarkup: TypeConstructorDescription { + public class Cons_replyInlineMarkup: TypeConstructorDescription { + public var rows: [Api.KeyboardButtonRow] + public init(rows: [Api.KeyboardButtonRow]) { + self.rows = rows + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyInlineMarkup", [("rows", ConstructorParameterDescription(self.rows))]) + } + } + public class Cons_replyKeyboardForceReply: TypeConstructorDescription { + public var flags: Int32 + public var placeholder: String? + public init(flags: Int32, placeholder: String?) { + self.flags = flags + self.placeholder = placeholder + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyKeyboardForceReply", [("flags", ConstructorParameterDescription(self.flags)), ("placeholder", ConstructorParameterDescription(self.placeholder))]) + } + } + public class Cons_replyKeyboardHide: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyKeyboardHide", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_replyKeyboardMarkup: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyKeyboardMarkup", [("flags", ConstructorParameterDescription(self.flags)), ("rows", ConstructorParameterDescription(self.rows)), ("placeholder", ConstructorParameterDescription(self.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.texts.count)) - for item in _data.texts { + buffer.appendInt32(Int32(_data.rows.count)) + for item in _data.rows { item.serialize(buffer, true) } break - case .textEmail(let _data): + case .replyKeyboardForceReply(let _data): if boxed { - buffer.appendInt32(-564523562) + buffer.appendInt32(-2035021048) } - _data.text.serialize(buffer, true) - serializeString(_data.email, buffer: buffer, boxed: false) - break - case .textEmpty: - if boxed { - buffer.appendInt32(-599948721) + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.placeholder!, buffer: buffer, boxed: false) } break - case .textFixed(let _data): + case .replyKeyboardHide(let _data): if boxed { - buffer.appendInt32(1816074681) + buffer.appendInt32(-1606526075) } - _data.text.serialize(buffer, true) + serializeInt32(_data.flags, buffer: buffer, boxed: false) break - case .textImage(let _data): + case .replyKeyboardMarkup(let _data): if boxed { - buffer.appendInt32(136105807) + buffer.appendInt32(-2049074735) } - 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) + 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) } - _data.text.serialize(buffer, true) - break - case .textMarked(let _data): - if boxed { - buffer.appendInt32(55281185) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeString(_data.placeholder!, buffer: buffer, boxed: false) } - _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, ConstructorParameterDescription)]) { switch self { - case .textAnchor(let _data): - return ("textAnchor", [("text", ConstructorParameterDescription(_data.text)), ("name", ConstructorParameterDescription(_data.name))]) - case .textBold(let _data): - return ("textBold", [("text", ConstructorParameterDescription(_data.text))]) - case .textConcat(let _data): - return ("textConcat", [("texts", ConstructorParameterDescription(_data.texts))]) - case .textEmail(let _data): - return ("textEmail", [("text", ConstructorParameterDescription(_data.text)), ("email", ConstructorParameterDescription(_data.email))]) - case .textEmpty: - return ("textEmpty", []) - case .textFixed(let _data): - return ("textFixed", [("text", ConstructorParameterDescription(_data.text))]) - case .textImage(let _data): - return ("textImage", [("documentId", ConstructorParameterDescription(_data.documentId)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h))]) - case .textItalic(let _data): - return ("textItalic", [("text", ConstructorParameterDescription(_data.text))]) - case .textMarked(let _data): - return ("textMarked", [("text", ConstructorParameterDescription(_data.text))]) - case .textPhone(let _data): - return ("textPhone", [("text", ConstructorParameterDescription(_data.text)), ("phone", ConstructorParameterDescription(_data.phone))]) - case .textPlain(let _data): - return ("textPlain", [("text", ConstructorParameterDescription(_data.text))]) - case .textStrike(let _data): - return ("textStrike", [("text", ConstructorParameterDescription(_data.text))]) - case .textSubscript(let _data): - return ("textSubscript", [("text", ConstructorParameterDescription(_data.text))]) - case .textSuperscript(let _data): - return ("textSuperscript", [("text", ConstructorParameterDescription(_data.text))]) - case .textUnderline(let _data): - return ("textUnderline", [("text", ConstructorParameterDescription(_data.text))]) - case .textUrl(let _data): - return ("textUrl", [("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId))]) + case .replyInlineMarkup(let _data): + return ("replyInlineMarkup", [("rows", ConstructorParameterDescription(_data.rows))]) + case .replyKeyboardForceReply(let _data): + return ("replyKeyboardForceReply", [("flags", ConstructorParameterDescription(_data.flags)), ("placeholder", ConstructorParameterDescription(_data.placeholder))]) + case .replyKeyboardHide(let _data): + return ("replyKeyboardHide", [("flags", ConstructorParameterDescription(_data.flags))]) + case .replyKeyboardMarkup(let _data): + return ("replyKeyboardMarkup", [("flags", ConstructorParameterDescription(_data.flags)), ("rows", ConstructorParameterDescription(_data.rows)), ("placeholder", ConstructorParameterDescription(_data.placeholder))]) } } - public static func parse_textAnchor(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.RichText.textAnchor(Cons_textAnchor(text: _1!, name: _2!)) - } - else { - return nil - } - } - public static func parse_textBold(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textBold(Cons_textBold(text: _1!)) - } - else { - return nil - } - } - public static func parse_textConcat(_ reader: BufferReader) -> RichText? { - var _1: [Api.RichText]? + public static func parse_replyInlineMarkup(_ reader: BufferReader) -> ReplyMarkup? { + var _1: [Api.KeyboardButtonRow]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RichText.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.KeyboardButtonRow.self) } let _c1 = _1 != nil if _c1 { - return Api.RichText.textConcat(Cons_textConcat(texts: _1!)) + return Api.ReplyMarkup.replyInlineMarkup(Cons_replyInlineMarkup(rows: _1!)) } else { return nil } } - public static func parse_textEmail(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.RichText.textEmail(Cons_textEmail(text: _1!, email: _2!)) - } - else { - return nil - } - } - public static func parse_textEmpty(_ reader: BufferReader) -> RichText? { - return Api.RichText.textEmpty - } - public static func parse_textFixed(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textFixed(Cons_textFixed(text: _1!)) - } - else { - return nil - } - } - public static func parse_textImage(_ reader: BufferReader) -> RichText? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.RichText.textImage(Cons_textImage(documentId: _1!, w: _2!, h: _3!)) - } - else { - return nil - } - } - public static func parse_textItalic(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textItalic(Cons_textItalic(text: _1!)) - } - else { - return nil - } - } - public static func parse_textMarked(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textMarked(Cons_textMarked(text: _1!)) - } - else { - return nil - } - } - public static func parse_textPhone(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.RichText.textPhone(Cons_textPhone(text: _1!, phone: _2!)) - } - else { - return nil - } - } - public static func parse_textPlain(_ reader: BufferReader) -> RichText? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textPlain(Cons_textPlain(text: _1!)) - } - else { - return nil - } - } - public static func parse_textStrike(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textStrike(Cons_textStrike(text: _1!)) - } - else { - return nil - } - } - public static func parse_textSubscript(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textSubscript(Cons_textSubscript(text: _1!)) - } - else { - return nil - } - } - public static func parse_textSuperscript(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textSuperscript(Cons_textSuperscript(text: _1!)) - } - else { - return nil - } - } - public static func parse_textUnderline(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - let _c1 = _1 != nil - if _c1 { - return Api.RichText.textUnderline(Cons_textUnderline(text: _1!)) - } - else { - return nil - } - } - public static func parse_textUrl(_ reader: BufferReader) -> RichText? { - var _1: Api.RichText? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.RichText - } - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.RichText.textUrl(Cons_textUrl(text: _1!, url: _2!, webpageId: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SavedContact: TypeConstructorDescription { - public class Cons_savedPhoneContact: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedPhoneContact", [("phone", ConstructorParameterDescription(self.phone)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .savedPhoneContact(let _data): - return ("savedPhoneContact", [("phone", ConstructorParameterDescription(_data.phone)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("date", ConstructorParameterDescription(_data.date))]) - } - } - - public static func parse_savedPhoneContact(_ reader: BufferReader) -> SavedContact? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.SavedContact.savedPhoneContact(Cons_savedPhoneContact(phone: _1!, firstName: _2!, lastName: _3!, date: _4!)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum SavedDialog: TypeConstructorDescription { - public class Cons_monoForumDialog: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("monoForumDialog", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMessage", ConstructorParameterDescription(self.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("unreadReactionsCount", ConstructorParameterDescription(self.unreadReactionsCount)), ("draft", ConstructorParameterDescription(self.draft))]) - } - } - public class Cons_savedDialog: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedDialog", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMessage", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .monoForumDialog(let _data): - return ("monoForumDialog", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMessage", ConstructorParameterDescription(_data.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("unreadReactionsCount", ConstructorParameterDescription(_data.unreadReactionsCount)), ("draft", ConstructorParameterDescription(_data.draft))]) - case .savedDialog(let _data): - return ("savedDialog", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMessage", ConstructorParameterDescription(_data.topMessage))]) - } - } - - public static func parse_monoForumDialog(_ reader: BufferReader) -> SavedDialog? { + public static func parse_replyKeyboardForceReply(_ reader: BufferReader) -> ReplyMarkup? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer + var _2: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _2 = parseString(reader) } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - var _7: Int32? - _7 = reader.readInt32() - var _8: Api.DraftMessage? + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil + if _c1 && _c2 { + return Api.ReplyMarkup.replyKeyboardForceReply(Cons_replyKeyboardForceReply(flags: _1!, placeholder: _2)) + } + else { + return nil + } + } + public static func parse_replyKeyboardHide(_ reader: BufferReader) -> ReplyMarkup? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.ReplyMarkup.replyKeyboardHide(Cons_replyKeyboardHide(flags: _1!)) + } + else { + return nil + } + } + public static func parse_replyKeyboardMarkup(_ reader: BufferReader) -> ReplyMarkup? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.KeyboardButtonRow]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.KeyboardButtonRow.self) + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _3 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.ReplyMarkup.replyKeyboardMarkup(Cons_replyKeyboardMarkup(flags: _1!, rows: _2!, placeholder: _3)) + } + else { + return nil + } + } + } +} +public extension Api { + enum ReportReason: TypeConstructorDescription { + case inputReportReasonChildAbuse + case inputReportReasonCopyright + case inputReportReasonFake + case inputReportReasonGeoIrrelevant + case inputReportReasonIllegalDrugs + case inputReportReasonOther + case inputReportReasonPersonalDetails + 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, ConstructorParameterDescription)]) { + switch self { + case .inputReportReasonChildAbuse: + return ("inputReportReasonChildAbuse", []) + case .inputReportReasonCopyright: + return ("inputReportReasonCopyright", []) + case .inputReportReasonFake: + return ("inputReportReasonFake", []) + case .inputReportReasonGeoIrrelevant: + return ("inputReportReasonGeoIrrelevant", []) + case .inputReportReasonIllegalDrugs: + return ("inputReportReasonIllegalDrugs", []) + case .inputReportReasonOther: + return ("inputReportReasonOther", []) + case .inputReportReasonPersonalDetails: + return ("inputReportReasonPersonalDetails", []) + case .inputReportReasonPornography: + return ("inputReportReasonPornography", []) + case .inputReportReasonSpam: + return ("inputReportReasonSpam", []) + case .inputReportReasonViolence: + return ("inputReportReasonViolence", []) + } + } + + public static func parse_inputReportReasonChildAbuse(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonChildAbuse + } + public static func parse_inputReportReasonCopyright(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonCopyright + } + public static func parse_inputReportReasonFake(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonFake + } + public static func parse_inputReportReasonGeoIrrelevant(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonGeoIrrelevant + } + public static func parse_inputReportReasonIllegalDrugs(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonIllegalDrugs + } + public static func parse_inputReportReasonOther(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonOther + } + public static func parse_inputReportReasonPersonalDetails(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonPersonalDetails + } + public static func parse_inputReportReasonPornography(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonPornography + } + public static func parse_inputReportReasonSpam(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonSpam + } + public static func parse_inputReportReasonViolence(_ reader: BufferReader) -> ReportReason? { + return Api.ReportReason.inputReportReasonViolence + } + } +} +public extension Api { + enum ReportResult: TypeConstructorDescription { + public class Cons_reportResultAddComment: TypeConstructorDescription { + public var flags: Int32 + public var option: Buffer + public init(flags: Int32, option: Buffer) { + self.flags = flags + self.option = option + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reportResultAddComment", [("flags", ConstructorParameterDescription(self.flags)), ("option", ConstructorParameterDescription(self.option))]) + } + } + public class Cons_reportResultChooseOption: TypeConstructorDescription { + public var title: String + public var options: [Api.MessageReportOption] + public init(title: String, options: [Api.MessageReportOption]) { + self.title = title + self.options = options + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reportResultChooseOption", [("title", ConstructorParameterDescription(self.title)), ("options", ConstructorParameterDescription(self.options))]) + } + } + case reportResultAddComment(Cons_reportResultAddComment) + case reportResultChooseOption(Cons_reportResultChooseOption) + 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, ConstructorParameterDescription)]) { + switch self { + case .reportResultAddComment(let _data): + return ("reportResultAddComment", [("flags", ConstructorParameterDescription(_data.flags)), ("option", ConstructorParameterDescription(_data.option))]) + case .reportResultChooseOption(let _data): + return ("reportResultChooseOption", [("title", ConstructorParameterDescription(_data.title)), ("options", ConstructorParameterDescription(_data.options))]) + case .reportResultReported: + return ("reportResultReported", []) + } + } + + public static func parse_reportResultAddComment(_ reader: BufferReader) -> ReportResult? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.ReportResult.reportResultAddComment(Cons_reportResultAddComment(flags: _1!, option: _2!)) + } + else { + return nil + } + } + public static func parse_reportResultChooseOption(_ reader: BufferReader) -> ReportResult? { + var _1: String? + _1 = parseString(reader) + var _2: [Api.MessageReportOption]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageReportOption.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.ReportResult.reportResultChooseOption(Cons_reportResultChooseOption(title: _1!, options: _2!)) + } + else { + return nil + } + } + public static func parse_reportResultReported(_ reader: BufferReader) -> ReportResult? { + return Api.ReportResult.reportResultReported + } + } +} +public extension Api { + enum RequestPeerType: TypeConstructorDescription { + public class Cons_requestPeerTypeBroadcast: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestPeerTypeBroadcast", [("flags", ConstructorParameterDescription(self.flags)), ("hasUsername", ConstructorParameterDescription(self.hasUsername)), ("userAdminRights", ConstructorParameterDescription(self.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(self.botAdminRights))]) + } + } + public class Cons_requestPeerTypeChat: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestPeerTypeChat", [("flags", ConstructorParameterDescription(self.flags)), ("hasUsername", ConstructorParameterDescription(self.hasUsername)), ("forum", ConstructorParameterDescription(self.forum)), ("userAdminRights", ConstructorParameterDescription(self.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(self.botAdminRights))]) + } + } + public class Cons_requestPeerTypeCreateBot: TypeConstructorDescription { + public var flags: Int32 + public var suggestedName: String? + public var suggestedUsername: String? + public init(flags: Int32, suggestedName: String?, suggestedUsername: String?) { + self.flags = flags + self.suggestedName = suggestedName + self.suggestedUsername = suggestedUsername + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestPeerTypeCreateBot", [("flags", ConstructorParameterDescription(self.flags)), ("suggestedName", ConstructorParameterDescription(self.suggestedName)), ("suggestedUsername", ConstructorParameterDescription(self.suggestedUsername))]) + } + } + public class Cons_requestPeerTypeUser: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestPeerTypeUser", [("flags", ConstructorParameterDescription(self.flags)), ("bot", ConstructorParameterDescription(self.bot)), ("premium", ConstructorParameterDescription(self.premium))]) + } + } + case requestPeerTypeBroadcast(Cons_requestPeerTypeBroadcast) + case requestPeerTypeChat(Cons_requestPeerTypeChat) + case requestPeerTypeCreateBot(Cons_requestPeerTypeCreateBot) + 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 .requestPeerTypeCreateBot(let _data): + if boxed { + buffer.appendInt32(1048699000) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.suggestedName!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.suggestedUsername!, buffer: buffer, boxed: false) + } + 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, ConstructorParameterDescription)]) { + switch self { + case .requestPeerTypeBroadcast(let _data): + return ("requestPeerTypeBroadcast", [("flags", ConstructorParameterDescription(_data.flags)), ("hasUsername", ConstructorParameterDescription(_data.hasUsername)), ("userAdminRights", ConstructorParameterDescription(_data.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(_data.botAdminRights))]) + case .requestPeerTypeChat(let _data): + return ("requestPeerTypeChat", [("flags", ConstructorParameterDescription(_data.flags)), ("hasUsername", ConstructorParameterDescription(_data.hasUsername)), ("forum", ConstructorParameterDescription(_data.forum)), ("userAdminRights", ConstructorParameterDescription(_data.userAdminRights)), ("botAdminRights", ConstructorParameterDescription(_data.botAdminRights))]) + case .requestPeerTypeCreateBot(let _data): + return ("requestPeerTypeCreateBot", [("flags", ConstructorParameterDescription(_data.flags)), ("suggestedName", ConstructorParameterDescription(_data.suggestedName)), ("suggestedUsername", ConstructorParameterDescription(_data.suggestedUsername))]) + case .requestPeerTypeUser(let _data): + return ("requestPeerTypeUser", [("flags", ConstructorParameterDescription(_data.flags)), ("bot", ConstructorParameterDescription(_data.bot)), ("premium", ConstructorParameterDescription(_data.premium))]) + } + } + + public static func parse_requestPeerTypeBroadcast(_ reader: BufferReader) -> RequestPeerType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Bool? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.DraftMessage + _3 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } + var _4: Api.ChatAdminRights? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights } } let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.SavedDialog.monoForumDialog(Cons_monoForumDialog(flags: _1!, peer: _2!, topMessage: _3!, readInboxMaxId: _4!, readOutboxMaxId: _5!, unreadCount: _6!, unreadReactionsCount: _7!, draft: _8)) + let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.RequestPeerType.requestPeerTypeBroadcast(Cons_requestPeerTypeBroadcast(flags: _1!, hasUsername: _2, userAdminRights: _3, botAdminRights: _4)) } else { return nil } } - public static func parse_savedDialog(_ reader: BufferReader) -> SavedDialog? { + public static func parse_requestPeerTypeChat(_ reader: BufferReader) -> RequestPeerType? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer + var _2: Api.Bool? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } } - var _3: Int32? - _3 = reader.readInt32() let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.RequestPeerType.requestPeerTypeChat(Cons_requestPeerTypeChat(flags: _1!, hasUsername: _2, forum: _3, userAdminRights: _4, botAdminRights: _5)) + } + else { + return nil + } + } + public static func parse_requestPeerTypeCreateBot(_ reader: BufferReader) -> RequestPeerType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _2 = parseString(reader) + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.SavedDialog.savedDialog(Cons_savedDialog(flags: _1!, peer: _2!, topMessage: _3!)) + return Api.RequestPeerType.requestPeerTypeCreateBot(Cons_requestPeerTypeCreateBot(flags: _1!, suggestedName: _2, suggestedUsername: _3)) + } + else { + return nil + } + } + public static func parse_requestPeerTypeUser(_ reader: BufferReader) -> RequestPeerType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Bool? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.RequestPeerType.requestPeerTypeUser(Cons_requestPeerTypeUser(flags: _1!, bot: _2, premium: _3)) } else { return nil @@ -787,284 +946,214 @@ public extension Api { } } public extension Api { - enum SavedReactionTag: TypeConstructorDescription { - public class Cons_savedReactionTag: TypeConstructorDescription { + enum RequestedPeer: TypeConstructorDescription { + public class Cons_requestedPeerChannel: TypeConstructorDescription { public var flags: Int32 - public var reaction: Api.Reaction + public var channelId: Int64 public var title: String? - public var count: Int32 - public init(flags: Int32, reaction: Api.Reaction, title: String?, count: Int32) { + 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.reaction = reaction + self.channelId = channelId self.title = title - self.count = count + self.username = username + self.photo = photo } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedReactionTag", [("flags", ConstructorParameterDescription(self.flags)), ("reaction", ConstructorParameterDescription(self.reaction)), ("title", ConstructorParameterDescription(self.title)), ("count", ConstructorParameterDescription(self.count))]) + return ("requestedPeerChannel", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("title", ConstructorParameterDescription(self.title)), ("username", ConstructorParameterDescription(self.username)), ("photo", ConstructorParameterDescription(self.photo))]) } } - case savedReactionTag(Cons_savedReactionTag) + public class Cons_requestedPeerChat: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestedPeerChat", [("flags", ConstructorParameterDescription(self.flags)), ("chatId", ConstructorParameterDescription(self.chatId)), ("title", ConstructorParameterDescription(self.title)), ("photo", ConstructorParameterDescription(self.photo))]) + } + } + public class Cons_requestedPeerUser: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestedPeerUser", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("username", ConstructorParameterDescription(self.username)), ("photo", ConstructorParameterDescription(self.photo))]) + } + } + case requestedPeerChannel(Cons_requestedPeerChannel) + case requestedPeerChat(Cons_requestedPeerChat) + case requestedPeerUser(Cons_requestedPeerUser) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .savedReactionTag(let _data): + case .requestedPeerChannel(let _data): if boxed { - buffer.appendInt32(-881854424) + buffer.appendInt32(-1952185372) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.reaction.serialize(buffer, true) + serializeInt64(_data.channelId, buffer: buffer, boxed: false) if Int(_data.flags) & Int(1 << 0) != 0 { serializeString(_data.title!, buffer: buffer, boxed: false) } - serializeInt32(_data.count, 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, ConstructorParameterDescription)]) { switch self { - case .savedReactionTag(let _data): - return ("savedReactionTag", [("flags", ConstructorParameterDescription(_data.flags)), ("reaction", ConstructorParameterDescription(_data.reaction)), ("title", ConstructorParameterDescription(_data.title)), ("count", ConstructorParameterDescription(_data.count))]) + case .requestedPeerChannel(let _data): + return ("requestedPeerChannel", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("title", ConstructorParameterDescription(_data.title)), ("username", ConstructorParameterDescription(_data.username)), ("photo", ConstructorParameterDescription(_data.photo))]) + case .requestedPeerChat(let _data): + return ("requestedPeerChat", [("flags", ConstructorParameterDescription(_data.flags)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("title", ConstructorParameterDescription(_data.title)), ("photo", ConstructorParameterDescription(_data.photo))]) + case .requestedPeerUser(let _data): + return ("requestedPeerUser", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("username", ConstructorParameterDescription(_data.username)), ("photo", ConstructorParameterDescription(_data.photo))]) } } - public static func parse_savedReactionTag(_ reader: BufferReader) -> SavedReactionTag? { + public static func parse_requestedPeerChannel(_ reader: BufferReader) -> RequestedPeer? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.Reaction? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Reaction - } + var _2: Int64? + _2 = reader.readInt64() var _3: String? if Int(_1 ?? 0) & Int(1 << 0) != 0 { _3 = parseString(reader) } - var _4: Int32? - _4 = reader.readInt32() + var _4: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } + var _5: Api.Photo? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.SavedReactionTag.savedReactionTag(Cons_savedReactionTag(flags: _1!, reaction: _2!, title: _3, count: _4!)) + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.RequestedPeer.requestedPeerChannel(Cons_requestedPeerChannel(flags: _1!, channelId: _2!, title: _3, username: _4, photo: _5)) } else { return nil } } - } -} -public extension Api { - enum SavedStarGift: TypeConstructorDescription { - public class Cons_savedStarGift: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedStarGift", [("flags", ConstructorParameterDescription(self.flags)), ("fromId", ConstructorParameterDescription(self.fromId)), ("date", ConstructorParameterDescription(self.date)), ("gift", ConstructorParameterDescription(self.gift)), ("message", ConstructorParameterDescription(self.message)), ("msgId", ConstructorParameterDescription(self.msgId)), ("savedId", ConstructorParameterDescription(self.savedId)), ("convertStars", ConstructorParameterDescription(self.convertStars)), ("upgradeStars", ConstructorParameterDescription(self.upgradeStars)), ("canExportAt", ConstructorParameterDescription(self.canExportAt)), ("transferStars", ConstructorParameterDescription(self.transferStars)), ("canTransferAt", ConstructorParameterDescription(self.canTransferAt)), ("canResellAt", ConstructorParameterDescription(self.canResellAt)), ("collectionId", ConstructorParameterDescription(self.collectionId)), ("prepaidUpgradeHash", ConstructorParameterDescription(self.prepaidUpgradeHash)), ("dropOriginalDetailsStars", ConstructorParameterDescription(self.dropOriginalDetailsStars)), ("giftNum", ConstructorParameterDescription(self.giftNum)), ("canCraftAt", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .savedStarGift(let _data): - return ("savedStarGift", [("flags", ConstructorParameterDescription(_data.flags)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("date", ConstructorParameterDescription(_data.date)), ("gift", ConstructorParameterDescription(_data.gift)), ("message", ConstructorParameterDescription(_data.message)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("savedId", ConstructorParameterDescription(_data.savedId)), ("convertStars", ConstructorParameterDescription(_data.convertStars)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars)), ("canExportAt", ConstructorParameterDescription(_data.canExportAt)), ("transferStars", ConstructorParameterDescription(_data.transferStars)), ("canTransferAt", ConstructorParameterDescription(_data.canTransferAt)), ("canResellAt", ConstructorParameterDescription(_data.canResellAt)), ("collectionId", ConstructorParameterDescription(_data.collectionId)), ("prepaidUpgradeHash", ConstructorParameterDescription(_data.prepaidUpgradeHash)), ("dropOriginalDetailsStars", ConstructorParameterDescription(_data.dropOriginalDetailsStars)), ("giftNum", ConstructorParameterDescription(_data.giftNum)), ("canCraftAt", ConstructorParameterDescription(_data.canCraftAt))]) - } - } - - public static func parse_savedStarGift(_ reader: BufferReader) -> SavedStarGift? { + public static func parse_requestedPeerChat(_ reader: BufferReader) -> RequestedPeer? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) } - var _3: Int32? - _3 = reader.readInt32() - var _4: Api.StarGift? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _5: Api.TextWithEntities? + var _4: Api.Photo? if Int(_1 ?? 0) & Int(1 << 2) != 0 { if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + _4 = Api.parse(reader, signature: signature) as? Api.Photo } } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _6 = reader.readInt32() - } - var _7: Int64? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _7 = reader.readInt64() - } - var _8: Int64? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _8 = reader.readInt64() - } - var _9: Int64? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _9 = reader.readInt64() - } - var _10: Int32? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - _10 = reader.readInt32() - } - var _11: Int64? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _11 = reader.readInt64() - } - var _12: Int32? - if Int(_1 ?? 0) & Int(1 << 13) != 0 { - _12 = reader.readInt32() - } - var _13: Int32? - if Int(_1 ?? 0) & Int(1 << 14) != 0 { - _13 = reader.readInt32() - } - var _14: [Int32]? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - } - var _15: String? - if Int(_1 ?? 0) & Int(1 << 16) != 0 { - _15 = parseString(reader) - } - var _16: Int64? - if Int(_1 ?? 0) & Int(1 << 18) != 0 { - _16 = reader.readInt64() - } - var _17: Int32? - if Int(_1 ?? 0) & Int(1 << 19) != 0 { - _17 = reader.readInt32() - } - var _18: Int32? - if Int(_1 ?? 0) & Int(1 << 20) != 0 { - _18 = reader.readInt32() - } let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _15 != nil - let _c16 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _16 != nil - let _c17 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _17 != nil - let _c18 = (Int(_1 ?? 0) & 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(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)) + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.RequestedPeer.requestedPeerChat(Cons_requestedPeerChat(flags: _1!, chatId: _2!, title: _3, photo: _4)) + } + else { + return nil + } + } + public static func parse_requestedPeerUser(_ reader: BufferReader) -> RequestedPeer? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + var _6: Api.Photo? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.RequestedPeer.requestedPeerUser(Cons_requestedPeerUser(flags: _1!, userId: _2!, firstName: _3, lastName: _4, username: _5, photo: _6)) } else { return nil @@ -1073,350 +1162,36 @@ public extension Api { } } public extension Api { - enum SearchPostsFlood: TypeConstructorDescription { - public class Cons_searchPostsFlood: TypeConstructorDescription { - public var flags: Int32 - public var totalDaily: Int32 - public var remains: Int32 - public var waitTill: Int32? + enum RequirementToContact: TypeConstructorDescription { + public class Cons_requirementToContactPaidMessages: TypeConstructorDescription { 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 + public init(starsAmount: Int64) { self.starsAmount = starsAmount } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("searchPostsFlood", [("flags", ConstructorParameterDescription(self.flags)), ("totalDaily", ConstructorParameterDescription(self.totalDaily)), ("remains", ConstructorParameterDescription(self.remains)), ("waitTill", ConstructorParameterDescription(self.waitTill)), ("starsAmount", ConstructorParameterDescription(self.starsAmount))]) + return ("requirementToContactPaidMessages", [("starsAmount", ConstructorParameterDescription(self.starsAmount))]) } } - case searchPostsFlood(Cons_searchPostsFlood) + case requirementToContactEmpty + case requirementToContactPaidMessages(Cons_requirementToContactPaidMessages) + case requirementToContactPremium public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .searchPostsFlood(let _data): + case .requirementToContactEmpty: if boxed { - buffer.appendInt32(1040931690) + buffer.appendInt32(84580409) } - 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) + break + case .requirementToContactPaidMessages(let _data): + if boxed { + buffer.appendInt32(-1258914157) } serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .searchPostsFlood(let _data): - return ("searchPostsFlood", [("flags", ConstructorParameterDescription(_data.flags)), ("totalDaily", ConstructorParameterDescription(_data.totalDaily)), ("remains", ConstructorParameterDescription(_data.remains)), ("waitTill", ConstructorParameterDescription(_data.waitTill)), ("starsAmount", ConstructorParameterDescription(_data.starsAmount))]) - } - } - - public static func parse_searchPostsFlood(_ reader: BufferReader) -> SearchPostsFlood? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = reader.readInt32() - } - var _5: Int64? - _5 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_searchResultsCalendarPeriod: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("searchResultsCalendarPeriod", [("date", ConstructorParameterDescription(self.date)), ("minMsgId", ConstructorParameterDescription(self.minMsgId)), ("maxMsgId", ConstructorParameterDescription(self.maxMsgId)), ("count", ConstructorParameterDescription(self.count))]) - } - } - case searchResultsCalendarPeriod(Cons_searchResultsCalendarPeriod) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchResultsCalendarPeriod(let _data): + case .requirementToContactPremium: 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, ConstructorParameterDescription)]) { - switch self { - case .searchResultsCalendarPeriod(let _data): - return ("searchResultsCalendarPeriod", [("date", ConstructorParameterDescription(_data.date)), ("minMsgId", ConstructorParameterDescription(_data.minMsgId)), ("maxMsgId", ConstructorParameterDescription(_data.maxMsgId)), ("count", ConstructorParameterDescription(_data.count))]) - } - } - - public static func parse_searchResultsCalendarPeriod(_ reader: BufferReader) -> SearchResultsCalendarPeriod? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.SearchResultsCalendarPeriod.searchResultsCalendarPeriod(Cons_searchResultsCalendarPeriod(date: _1!, minMsgId: _2!, maxMsgId: _3!, count: _4!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SearchResultsPosition: TypeConstructorDescription { - public class Cons_searchResultPosition: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("searchResultPosition", [("msgId", ConstructorParameterDescription(self.msgId)), ("date", ConstructorParameterDescription(self.date)), ("offset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .searchResultPosition(let _data): - return ("searchResultPosition", [("msgId", ConstructorParameterDescription(_data.msgId)), ("date", ConstructorParameterDescription(_data.date)), ("offset", ConstructorParameterDescription(_data.offset))]) - } - } - - public static func parse_searchResultPosition(_ reader: BufferReader) -> SearchResultsPosition? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SearchResultsPosition.searchResultPosition(Cons_searchResultPosition(msgId: _1!, date: _2!, offset: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SecureCredentialsEncrypted: TypeConstructorDescription { - public class Cons_secureCredentialsEncrypted: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureCredentialsEncrypted", [("data", ConstructorParameterDescription(self.data)), ("hash", ConstructorParameterDescription(self.hash)), ("secret", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .secureCredentialsEncrypted(let _data): - return ("secureCredentialsEncrypted", [("data", ConstructorParameterDescription(_data.data)), ("hash", ConstructorParameterDescription(_data.hash)), ("secret", ConstructorParameterDescription(_data.secret))]) - } - } - - public static func parse_secureCredentialsEncrypted(_ reader: BufferReader) -> SecureCredentialsEncrypted? { - var _1: Buffer? - _1 = parseBytes(reader) - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Buffer? - _3 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureCredentialsEncrypted.secureCredentialsEncrypted(Cons_secureCredentialsEncrypted(data: _1!, hash: _2!, secret: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SecureData: TypeConstructorDescription { - public class Cons_secureData: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureData", [("data", ConstructorParameterDescription(self.data)), ("dataHash", ConstructorParameterDescription(self.dataHash)), ("secret", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .secureData(let _data): - return ("secureData", [("data", ConstructorParameterDescription(_data.data)), ("dataHash", ConstructorParameterDescription(_data.dataHash)), ("secret", ConstructorParameterDescription(_data.secret))]) - } - } - - public static func parse_secureData(_ reader: BufferReader) -> SecureData? { - var _1: Buffer? - _1 = parseBytes(reader) - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Buffer? - _3 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureData.secureData(Cons_secureData(data: _1!, dataHash: _2!, secret: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SecureFile: TypeConstructorDescription { - public class Cons_secureFile: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureFile", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("size", ConstructorParameterDescription(self.size)), ("dcId", ConstructorParameterDescription(self.dcId)), ("date", ConstructorParameterDescription(self.date)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("secret", ConstructorParameterDescription(self.secret))]) - } - } - case secureFile(Cons_secureFile) - 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) + buffer.appendInt32(-444472087) } break } @@ -1424,128 +1199,31 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .secureFile(let _data): - return ("secureFile", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("size", ConstructorParameterDescription(_data.size)), ("dcId", ConstructorParameterDescription(_data.dcId)), ("date", ConstructorParameterDescription(_data.date)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("secret", ConstructorParameterDescription(_data.secret))]) - case .secureFileEmpty: - return ("secureFileEmpty", []) + case .requirementToContactEmpty: + return ("requirementToContactEmpty", []) + case .requirementToContactPaidMessages(let _data): + return ("requirementToContactPaidMessages", [("starsAmount", ConstructorParameterDescription(_data.starsAmount))]) + case .requirementToContactPremium: + return ("requirementToContactPremium", []) } } - public static func parse_secureFile(_ reader: BufferReader) -> SecureFile? { + public static func parse_requirementToContactEmpty(_ reader: BufferReader) -> RequirementToContact? { + return Api.RequirementToContact.requirementToContactEmpty + } + public static func parse_requirementToContactPaidMessages(_ reader: BufferReader) -> RequirementToContact? { var _1: Int64? _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Buffer? - _6 = parseBytes(reader) - var _7: Buffer? - _7 = parseBytes(reader) let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.SecureFile.secureFile(Cons_secureFile(id: _1!, accessHash: _2!, size: _3!, dcId: _4!, date: _5!, fileHash: _6!, secret: _7!)) + if _c1 { + return Api.RequirementToContact.requirementToContactPaidMessages(Cons_requirementToContactPaidMessages(starsAmount: _1!)) } else { return nil } } - public static func parse_secureFileEmpty(_ reader: BufferReader) -> SecureFile? { - return Api.SecureFile.secureFileEmpty - } - } -} -public extension Api { - enum SecurePasswordKdfAlgo: TypeConstructorDescription { - public class Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000: TypeConstructorDescription { - public var salt: Buffer - public init(salt: Buffer) { - self.salt = salt - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", ConstructorParameterDescription(self.salt))]) - } - } - public class Cons_securePasswordKdfAlgoSHA512: TypeConstructorDescription { - public var salt: Buffer - public init(salt: Buffer) { - self.salt = salt - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("securePasswordKdfAlgoSHA512", [("salt", ConstructorParameterDescription(self.salt))]) - } - } - case securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000) - case securePasswordKdfAlgoSHA512(Cons_securePasswordKdfAlgoSHA512) - 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, ConstructorParameterDescription)]) { - switch self { - case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let _data): - return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", ConstructorParameterDescription(_data.salt))]) - case .securePasswordKdfAlgoSHA512(let _data): - return ("securePasswordKdfAlgoSHA512", [("salt", ConstructorParameterDescription(_data.salt))]) - 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(Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: _1!)) - } - else { - return nil - } - } - public static func parse_securePasswordKdfAlgoSHA512(_ reader: BufferReader) -> SecurePasswordKdfAlgo? { - var _1: Buffer? - _1 = parseBytes(reader) - let _c1 = _1 != nil - if _c1 { - return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoSHA512(Cons_securePasswordKdfAlgoSHA512(salt: _1!)) - } - else { - return nil - } - } - public static func parse_securePasswordKdfAlgoUnknown(_ reader: BufferReader) -> SecurePasswordKdfAlgo? { - return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoUnknown + public static func parse_requirementToContactPremium(_ reader: BufferReader) -> RequirementToContact? { + return Api.RequirementToContact.requirementToContactPremium } } } diff --git a/submodules/TelegramApi/Sources/Api24.swift b/submodules/TelegramApi/Sources/Api24.swift index cf8473ccd7..f653b467db 100644 --- a/submodules/TelegramApi/Sources/Api24.swift +++ b/submodules/TelegramApi/Sources/Api24.swift @@ -1,69 +1,52 @@ public extension Api { - enum SecurePlainData: TypeConstructorDescription { - public class Cons_securePlainEmail: TypeConstructorDescription { - public var email: String - public init(email: String) { - self.email = email + enum RestrictionReason: TypeConstructorDescription { + public class Cons_restrictionReason: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("securePlainEmail", [("email", ConstructorParameterDescription(self.email))]) + return ("restrictionReason", [("platform", ConstructorParameterDescription(self.platform)), ("reason", ConstructorParameterDescription(self.reason)), ("text", ConstructorParameterDescription(self.text))]) } } - public class Cons_securePlainPhone: TypeConstructorDescription { - public var phone: String - public init(phone: String) { - self.phone = phone - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("securePlainPhone", [("phone", ConstructorParameterDescription(self.phone))]) - } - } - case securePlainEmail(Cons_securePlainEmail) - case securePlainPhone(Cons_securePlainPhone) + case restrictionReason(Cons_restrictionReason) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .securePlainEmail(let _data): + case .restrictionReason(let _data): if boxed { - buffer.appendInt32(569137759) + buffer.appendInt32(-797791052) } - serializeString(_data.email, buffer: buffer, boxed: false) - break - case .securePlainPhone(let _data): - if boxed { - buffer.appendInt32(2103482845) - } - serializeString(_data.phone, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { switch self { - case .securePlainEmail(let _data): - return ("securePlainEmail", [("email", ConstructorParameterDescription(_data.email))]) - case .securePlainPhone(let _data): - return ("securePlainPhone", [("phone", ConstructorParameterDescription(_data.phone))]) + case .restrictionReason(let _data): + return ("restrictionReason", [("platform", ConstructorParameterDescription(_data.platform)), ("reason", ConstructorParameterDescription(_data.reason)), ("text", ConstructorParameterDescription(_data.text))]) } } - public static func parse_securePlainEmail(_ reader: BufferReader) -> SecurePlainData? { + public static func parse_restrictionReason(_ reader: BufferReader) -> RestrictionReason? { var _1: String? _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) let _c1 = _1 != nil - if _c1 { - return Api.SecurePlainData.securePlainEmail(Cons_securePlainEmail(email: _1!)) - } - else { - return nil - } - } - public static func parse_securePlainPhone(_ reader: BufferReader) -> SecurePlainData? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.SecurePlainData.securePlainPhone(Cons_securePlainPhone(phone: _1!)) + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.RestrictionReason.restrictionReason(Cons_restrictionReason(platform: _1!, reason: _2!, text: _3!)) } else { return nil @@ -72,46 +55,44 @@ public extension Api { } } public extension Api { - enum SecureRequiredType: TypeConstructorDescription { - public class Cons_secureRequiredType: TypeConstructorDescription { + enum RichMessage: TypeConstructorDescription { + public class Cons_richMessage: TypeConstructorDescription { public var flags: Int32 - public var type: Api.SecureValueType - public init(flags: Int32, type: Api.SecureValueType) { + public var blocks: [Api.PageBlock] + public var photos: [Api.Photo] + public var documents: [Api.Document] + public init(flags: Int32, blocks: [Api.PageBlock], photos: [Api.Photo], documents: [Api.Document]) { self.flags = flags - self.type = type + self.blocks = blocks + self.photos = photos + self.documents = documents } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureRequiredType", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type))]) + return ("richMessage", [("flags", ConstructorParameterDescription(self.flags)), ("blocks", ConstructorParameterDescription(self.blocks)), ("photos", ConstructorParameterDescription(self.photos)), ("documents", ConstructorParameterDescription(self.documents))]) } } - public class Cons_secureRequiredTypeOneOf: TypeConstructorDescription { - public var types: [Api.SecureRequiredType] - public init(types: [Api.SecureRequiredType]) { - self.types = types - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureRequiredTypeOneOf", [("types", ConstructorParameterDescription(self.types))]) - } - } - case secureRequiredType(Cons_secureRequiredType) - case secureRequiredTypeOneOf(Cons_secureRequiredTypeOneOf) + case richMessage(Cons_richMessage) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .secureRequiredType(let _data): + case .richMessage(let _data): if boxed { - buffer.appendInt32(-2103600678) + buffer.appendInt32(-1158439541) } 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.blocks.count)) + for item in _data.blocks { + item.serialize(buffer, true) } buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.types.count)) - for item in _data.types { + 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) } break @@ -120,37 +101,32 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .secureRequiredType(let _data): - return ("secureRequiredType", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type))]) - case .secureRequiredTypeOneOf(let _data): - return ("secureRequiredTypeOneOf", [("types", ConstructorParameterDescription(_data.types))]) + case .richMessage(let _data): + return ("richMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("photos", ConstructorParameterDescription(_data.photos)), ("documents", ConstructorParameterDescription(_data.documents))]) } } - public static func parse_secureRequiredType(_ reader: BufferReader) -> SecureRequiredType? { + public static func parse_richMessage(_ reader: BufferReader) -> RichMessage? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.SecureValueType? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.SecureValueType + var _2: [Api.PageBlock]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self) + } + var _3: [Api.Photo]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self) + } + var _4: [Api.Document]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) } let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.SecureRequiredType.secureRequiredType(Cons_secureRequiredType(flags: _1!, type: _2!)) - } - else { - return nil - } - } - public static func parse_secureRequiredTypeOneOf(_ reader: BufferReader) -> SecureRequiredType? { - var _1: [Api.SecureRequiredType]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureRequiredType.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.SecureRequiredType.secureRequiredTypeOneOf(Cons_secureRequiredTypeOneOf(types: _1!)) + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.RichMessage.richMessage(Cons_richMessage(flags: _1!, blocks: _2!, photos: _3!, documents: _4!)) } else { return nil @@ -159,56 +135,638 @@ public extension Api { } } public extension Api { - enum SecureSecretSettings: TypeConstructorDescription { - public class Cons_secureSecretSettings: TypeConstructorDescription { - 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 + indirect enum RichText: TypeConstructorDescription { + public class Cons_inputTextImage: TypeConstructorDescription { + public var document: Api.InputDocument + public var w: Int32 + public var h: Int32 + public init(document: Api.InputDocument, w: Int32, h: Int32) { + self.document = document + self.w = w + self.h = h } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureSecretSettings", [("secureAlgo", ConstructorParameterDescription(self.secureAlgo)), ("secureSecret", ConstructorParameterDescription(self.secureSecret)), ("secureSecretId", ConstructorParameterDescription(self.secureSecretId))]) + return ("inputTextImage", [("document", ConstructorParameterDescription(self.document)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h))]) } } - case secureSecretSettings(Cons_secureSecretSettings) + public class Cons_textAnchor: TypeConstructorDescription { + public var text: Api.RichText + public var name: String + public init(text: Api.RichText, name: String) { + self.text = text + self.name = name + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textAnchor", [("text", ConstructorParameterDescription(self.text)), ("name", ConstructorParameterDescription(self.name))]) + } + } + public class Cons_textBold: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textBold", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textConcat: TypeConstructorDescription { + public var texts: [Api.RichText] + public init(texts: [Api.RichText]) { + self.texts = texts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textConcat", [("texts", ConstructorParameterDescription(self.texts))]) + } + } + public class Cons_textCustomEmoji: TypeConstructorDescription { + public var documentId: Int64 + public var alt: String + public init(documentId: Int64, alt: String) { + self.documentId = documentId + self.alt = alt + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textCustomEmoji", [("documentId", ConstructorParameterDescription(self.documentId)), ("alt", ConstructorParameterDescription(self.alt))]) + } + } + public class Cons_textEmail: TypeConstructorDescription { + public var text: Api.RichText + public var email: String + public init(text: Api.RichText, email: String) { + self.text = text + self.email = email + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textEmail", [("text", ConstructorParameterDescription(self.text)), ("email", ConstructorParameterDescription(self.email))]) + } + } + public class Cons_textFixed: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textFixed", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textImage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textImage", [("documentId", ConstructorParameterDescription(self.documentId)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h))]) + } + } + public class Cons_textItalic: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textItalic", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textMarked: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textMarked", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textMath: TypeConstructorDescription { + public var source: String + public init(source: String) { + self.source = source + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textMath", [("source", ConstructorParameterDescription(self.source))]) + } + } + public class Cons_textPhone: TypeConstructorDescription { + public var text: Api.RichText + public var phone: String + public init(text: Api.RichText, phone: String) { + self.text = text + self.phone = phone + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textPhone", [("text", ConstructorParameterDescription(self.text)), ("phone", ConstructorParameterDescription(self.phone))]) + } + } + public class Cons_textPlain: TypeConstructorDescription { + public var text: String + public init(text: String) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textPlain", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textStrike: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textStrike", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textSubscript: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textSubscript", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textSuperscript: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textSuperscript", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textUnderline: TypeConstructorDescription { + public var text: Api.RichText + public init(text: Api.RichText) { + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textUnderline", [("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_textUrl: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textUrl", [("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId))]) + } + } + case inputTextImage(Cons_inputTextImage) + case textAnchor(Cons_textAnchor) + case textBold(Cons_textBold) + case textConcat(Cons_textConcat) + case textCustomEmoji(Cons_textCustomEmoji) + case textEmail(Cons_textEmail) + case textEmpty + case textFixed(Cons_textFixed) + case textImage(Cons_textImage) + case textItalic(Cons_textItalic) + case textMarked(Cons_textMarked) + case textMath(Cons_textMath) + 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 .secureSecretSettings(let _data): + case .inputTextImage(let _data): if boxed { - buffer.appendInt32(354925740) + buffer.appendInt32(764156522) } - _data.secureAlgo.serialize(buffer, true) - serializeBytes(_data.secureSecret, buffer: buffer, boxed: false) - serializeInt64(_data.secureSecretId, buffer: buffer, boxed: false) + _data.document.serialize(buffer, true) + serializeInt32(_data.w, buffer: buffer, boxed: false) + serializeInt32(_data.h, buffer: buffer, boxed: false) + break + 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 .textCustomEmoji(let _data): + if boxed { + buffer.appendInt32(-1570679104) + } + serializeInt64(_data.documentId, buffer: buffer, boxed: false) + serializeString(_data.alt, buffer: buffer, boxed: false) + 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 .textMath(let _data): + if boxed { + buffer.appendInt32(-1657885545) + } + serializeString(_data.source, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { switch self { - case .secureSecretSettings(let _data): - return ("secureSecretSettings", [("secureAlgo", ConstructorParameterDescription(_data.secureAlgo)), ("secureSecret", ConstructorParameterDescription(_data.secureSecret)), ("secureSecretId", ConstructorParameterDescription(_data.secureSecretId))]) + case .inputTextImage(let _data): + return ("inputTextImage", [("document", ConstructorParameterDescription(_data.document)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h))]) + case .textAnchor(let _data): + return ("textAnchor", [("text", ConstructorParameterDescription(_data.text)), ("name", ConstructorParameterDescription(_data.name))]) + case .textBold(let _data): + return ("textBold", [("text", ConstructorParameterDescription(_data.text))]) + case .textConcat(let _data): + return ("textConcat", [("texts", ConstructorParameterDescription(_data.texts))]) + case .textCustomEmoji(let _data): + return ("textCustomEmoji", [("documentId", ConstructorParameterDescription(_data.documentId)), ("alt", ConstructorParameterDescription(_data.alt))]) + case .textEmail(let _data): + return ("textEmail", [("text", ConstructorParameterDescription(_data.text)), ("email", ConstructorParameterDescription(_data.email))]) + case .textEmpty: + return ("textEmpty", []) + case .textFixed(let _data): + return ("textFixed", [("text", ConstructorParameterDescription(_data.text))]) + case .textImage(let _data): + return ("textImage", [("documentId", ConstructorParameterDescription(_data.documentId)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h))]) + case .textItalic(let _data): + return ("textItalic", [("text", ConstructorParameterDescription(_data.text))]) + case .textMarked(let _data): + return ("textMarked", [("text", ConstructorParameterDescription(_data.text))]) + case .textMath(let _data): + return ("textMath", [("source", ConstructorParameterDescription(_data.source))]) + case .textPhone(let _data): + return ("textPhone", [("text", ConstructorParameterDescription(_data.text)), ("phone", ConstructorParameterDescription(_data.phone))]) + case .textPlain(let _data): + return ("textPlain", [("text", ConstructorParameterDescription(_data.text))]) + case .textStrike(let _data): + return ("textStrike", [("text", ConstructorParameterDescription(_data.text))]) + case .textSubscript(let _data): + return ("textSubscript", [("text", ConstructorParameterDescription(_data.text))]) + case .textSuperscript(let _data): + return ("textSuperscript", [("text", ConstructorParameterDescription(_data.text))]) + case .textUnderline(let _data): + return ("textUnderline", [("text", ConstructorParameterDescription(_data.text))]) + case .textUrl(let _data): + return ("textUrl", [("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId))]) } } - public static func parse_secureSecretSettings(_ reader: BufferReader) -> SecureSecretSettings? { - var _1: Api.SecurePasswordKdfAlgo? + public static func parse_inputTextImage(_ reader: BufferReader) -> RichText? { + var _1: Api.InputDocument? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecurePasswordKdfAlgo + _1 = Api.parse(reader, signature: signature) as? Api.InputDocument } - var _2: Buffer? - _2 = parseBytes(reader) + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.RichText.inputTextImage(Cons_inputTextImage(document: _1!, w: _2!, h: _3!)) + } + else { + return nil + } + } + public static func parse_textAnchor(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RichText.textAnchor(Cons_textAnchor(text: _1!, name: _2!)) + } + else { + return nil + } + } + public static func parse_textBold(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textBold(Cons_textBold(text: _1!)) + } + else { + return nil + } + } + public static func parse_textConcat(_ reader: BufferReader) -> RichText? { + var _1: [Api.RichText]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RichText.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textConcat(Cons_textConcat(texts: _1!)) + } + else { + return nil + } + } + public static func parse_textCustomEmoji(_ reader: BufferReader) -> RichText? { + var _1: Int64? + _1 = reader.readInt64() + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RichText.textCustomEmoji(Cons_textCustomEmoji(documentId: _1!, alt: _2!)) + } + else { + return nil + } + } + public static func parse_textEmail(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RichText.textEmail(Cons_textEmail(text: _1!, email: _2!)) + } + else { + return nil + } + } + public static func parse_textEmpty(_ reader: BufferReader) -> RichText? { + return Api.RichText.textEmpty + } + public static func parse_textFixed(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textFixed(Cons_textFixed(text: _1!)) + } + else { + return nil + } + } + public static func parse_textImage(_ reader: BufferReader) -> RichText? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.RichText.textImage(Cons_textImage(documentId: _1!, w: _2!, h: _3!)) + } + else { + return nil + } + } + public static func parse_textItalic(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textItalic(Cons_textItalic(text: _1!)) + } + else { + return nil + } + } + public static func parse_textMarked(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textMarked(Cons_textMarked(text: _1!)) + } + else { + return nil + } + } + public static func parse_textMath(_ reader: BufferReader) -> RichText? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textMath(Cons_textMath(source: _1!)) + } + else { + return nil + } + } + public static func parse_textPhone(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.RichText.textPhone(Cons_textPhone(text: _1!, phone: _2!)) + } + else { + return nil + } + } + public static func parse_textPlain(_ reader: BufferReader) -> RichText? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textPlain(Cons_textPlain(text: _1!)) + } + else { + return nil + } + } + public static func parse_textStrike(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textStrike(Cons_textStrike(text: _1!)) + } + else { + return nil + } + } + public static func parse_textSubscript(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textSubscript(Cons_textSubscript(text: _1!)) + } + else { + return nil + } + } + public static func parse_textSuperscript(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textSuperscript(Cons_textSuperscript(text: _1!)) + } + else { + return nil + } + } + public static func parse_textUnderline(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + let _c1 = _1 != nil + if _c1 { + return Api.RichText.textUnderline(Cons_textUnderline(text: _1!)) + } + else { + return nil + } + } + public static func parse_textUrl(_ reader: BufferReader) -> RichText? { + var _1: Api.RichText? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.RichText + } + var _2: String? + _2 = parseString(reader) var _3: Int64? _3 = reader.readInt64() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SecureSecretSettings.secureSecretSettings(Cons_secureSecretSettings(secureAlgo: _1!, secureSecret: _2!, secureSecretId: _3!)) + return Api.RichText.textUrl(Cons_textUrl(text: _1!, url: _2!, webpageId: _3!)) } else { return nil @@ -217,568 +775,60 @@ public extension Api { } } public extension Api { - enum SecureValue: TypeConstructorDescription { - public class Cons_secureValue: TypeConstructorDescription { - 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 + enum SavedContact: TypeConstructorDescription { + public class Cons_savedPhoneContact: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValue", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type)), ("data", ConstructorParameterDescription(self.data)), ("frontSide", ConstructorParameterDescription(self.frontSide)), ("reverseSide", ConstructorParameterDescription(self.reverseSide)), ("selfie", ConstructorParameterDescription(self.selfie)), ("translation", ConstructorParameterDescription(self.translation)), ("files", ConstructorParameterDescription(self.files)), ("plainData", ConstructorParameterDescription(self.plainData)), ("hash", ConstructorParameterDescription(self.hash))]) + return ("savedPhoneContact", [("phone", ConstructorParameterDescription(self.phone)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("date", ConstructorParameterDescription(self.date))]) } } - case secureValue(Cons_secureValue) + case savedPhoneContact(Cons_savedPhoneContact) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .secureValue(let _data): + case .savedPhoneContact(let _data): if boxed { - buffer.appendInt32(411017418) + buffer.appendInt32(289586518) } - 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) - } - } - 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(_data.flags) & Int(1 << 5) != 0 { - _data.plainData!.serialize(buffer, true) - } - serializeBytes(_data.hash, 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) + serializeInt32(_data.date, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .secureValue(let _data): - return ("secureValue", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type)), ("data", ConstructorParameterDescription(_data.data)), ("frontSide", ConstructorParameterDescription(_data.frontSide)), ("reverseSide", ConstructorParameterDescription(_data.reverseSide)), ("selfie", ConstructorParameterDescription(_data.selfie)), ("translation", ConstructorParameterDescription(_data.translation)), ("files", ConstructorParameterDescription(_data.files)), ("plainData", ConstructorParameterDescription(_data.plainData)), ("hash", ConstructorParameterDescription(_data.hash))]) + case .savedPhoneContact(let _data): + return ("savedPhoneContact", [("phone", ConstructorParameterDescription(_data.phone)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("date", ConstructorParameterDescription(_data.date))]) } } - public static func parse_secureValue(_ reader: BufferReader) -> SecureValue? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.SecureValueType? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _3: Api.SecureData? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & 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(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 { - public class Cons_secureValueError: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueError", [("type", ConstructorParameterDescription(self.type)), ("hash", ConstructorParameterDescription(self.hash)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorData: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorData", [("type", ConstructorParameterDescription(self.type)), ("dataHash", ConstructorParameterDescription(self.dataHash)), ("field", ConstructorParameterDescription(self.field)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorFile: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorFile", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorFiles: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorFiles", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorFrontSide: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorFrontSide", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorReverseSide: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorReverseSide", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorSelfie: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorSelfie", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorTranslationFile: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorTranslationFile", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_secureValueErrorTranslationFiles: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueErrorTranslationFiles", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .secureValueError(let _data): - return ("secureValueError", [("type", ConstructorParameterDescription(_data.type)), ("hash", ConstructorParameterDescription(_data.hash)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorData(let _data): - return ("secureValueErrorData", [("type", ConstructorParameterDescription(_data.type)), ("dataHash", ConstructorParameterDescription(_data.dataHash)), ("field", ConstructorParameterDescription(_data.field)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorFile(let _data): - return ("secureValueErrorFile", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorFiles(let _data): - return ("secureValueErrorFiles", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorFrontSide(let _data): - return ("secureValueErrorFrontSide", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorReverseSide(let _data): - return ("secureValueErrorReverseSide", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorSelfie(let _data): - return ("secureValueErrorSelfie", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorTranslationFile(let _data): - return ("secureValueErrorTranslationFile", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) - case .secureValueErrorTranslationFiles(let _data): - return ("secureValueErrorTranslationFiles", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) - } - } - - public static func parse_secureValueError(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) + public static func parse_savedPhoneContact(_ reader: BufferReader) -> SavedContact? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) var _3: String? _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueError(Cons_secureValueError(type: _1!, hash: _2!, text: _3!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorData(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) + var _4: Int32? + _4 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.SecureValueError.secureValueErrorData(Cons_secureValueErrorData(type: _1!, dataHash: _2!, field: _3!, text: _4!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorFile(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorFile(Cons_secureValueErrorFile(type: _1!, fileHash: _2!, text: _3!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorFiles(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: [Buffer]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorFiles(Cons_secureValueErrorFiles(type: _1!, fileHash: _2!, text: _3!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorFrontSide(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorFrontSide(Cons_secureValueErrorFrontSide(type: _1!, fileHash: _2!, text: _3!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorReverseSide(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorReverseSide(Cons_secureValueErrorReverseSide(type: _1!, fileHash: _2!, text: _3!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorSelfie(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorSelfie(Cons_secureValueErrorSelfie(type: _1!, fileHash: _2!, text: _3!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorTranslationFile(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorTranslationFile(Cons_secureValueErrorTranslationFile(type: _1!, fileHash: _2!, text: _3!)) - } - else { - return nil - } - } - public static func parse_secureValueErrorTranslationFiles(_ reader: BufferReader) -> SecureValueError? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: [Buffer]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SecureValueError.secureValueErrorTranslationFiles(Cons_secureValueErrorTranslationFiles(type: _1!, fileHash: _2!, text: _3!)) + return Api.SavedContact.savedPhoneContact(Cons_savedPhoneContact(phone: _1!, firstName: _2!, lastName: _3!, date: _4!)) } else { return nil @@ -787,260 +837,135 @@ public extension Api { } } public extension Api { - enum SecureValueHash: TypeConstructorDescription { - public class Cons_secureValueHash: TypeConstructorDescription { - public var type: Api.SecureValueType - public var hash: Buffer - public init(type: Api.SecureValueType, hash: Buffer) { - self.type = type - self.hash = hash - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("secureValueHash", [("type", ConstructorParameterDescription(self.type)), ("hash", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .secureValueHash(let _data): - return ("secureValueHash", [("type", ConstructorParameterDescription(_data.type)), ("hash", ConstructorParameterDescription(_data.hash))]) - } - } - - public static func parse_secureValueHash(_ reader: BufferReader) -> SecureValueHash? { - var _1: Api.SecureValueType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType - } - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.SecureValueHash.secureValueHash(Cons_secureValueHash(type: _1!, hash: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SecureValueType: TypeConstructorDescription { - case secureValueTypeAddress - case secureValueTypeBankStatement - case secureValueTypeDriverLicense - case secureValueTypeEmail - case secureValueTypeIdentityCard - case secureValueTypeInternalPassport - case secureValueTypePassport - case secureValueTypePassportRegistration - case secureValueTypePersonalDetails - case secureValueTypePhone - 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, ConstructorParameterDescription)]) { - switch self { - case .secureValueTypeAddress: - return ("secureValueTypeAddress", []) - case .secureValueTypeBankStatement: - return ("secureValueTypeBankStatement", []) - case .secureValueTypeDriverLicense: - return ("secureValueTypeDriverLicense", []) - case .secureValueTypeEmail: - return ("secureValueTypeEmail", []) - case .secureValueTypeIdentityCard: - return ("secureValueTypeIdentityCard", []) - case .secureValueTypeInternalPassport: - return ("secureValueTypeInternalPassport", []) - case .secureValueTypePassport: - return ("secureValueTypePassport", []) - case .secureValueTypePassportRegistration: - return ("secureValueTypePassportRegistration", []) - case .secureValueTypePersonalDetails: - return ("secureValueTypePersonalDetails", []) - case .secureValueTypePhone: - return ("secureValueTypePhone", []) - case .secureValueTypeRentalAgreement: - return ("secureValueTypeRentalAgreement", []) - case .secureValueTypeTemporaryRegistration: - return ("secureValueTypeTemporaryRegistration", []) - case .secureValueTypeUtilityBill: - return ("secureValueTypeUtilityBill", []) - } - } - - public static func parse_secureValueTypeAddress(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeAddress - } - public static func parse_secureValueTypeBankStatement(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeBankStatement - } - public static func parse_secureValueTypeDriverLicense(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeDriverLicense - } - public static func parse_secureValueTypeEmail(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeEmail - } - public static func parse_secureValueTypeIdentityCard(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeIdentityCard - } - public static func parse_secureValueTypeInternalPassport(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeInternalPassport - } - public static func parse_secureValueTypePassport(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypePassport - } - public static func parse_secureValueTypePassportRegistration(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypePassportRegistration - } - public static func parse_secureValueTypePersonalDetails(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypePersonalDetails - } - public static func parse_secureValueTypePhone(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypePhone - } - public static func parse_secureValueTypeRentalAgreement(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeRentalAgreement - } - public static func parse_secureValueTypeTemporaryRegistration(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeTemporaryRegistration - } - public static func parse_secureValueTypeUtilityBill(_ reader: BufferReader) -> SecureValueType? { - return Api.SecureValueType.secureValueTypeUtilityBill - } - } -} -public extension Api { - enum SendAsPeer: TypeConstructorDescription { - public class Cons_sendAsPeer: TypeConstructorDescription { + indirect enum SavedDialog: TypeConstructorDescription { + public class Cons_monoForumDialog: TypeConstructorDescription { public var flags: Int32 public var peer: Api.Peer - public init(flags: Int32, 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendAsPeer", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer))]) + return ("monoForumDialog", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMessage", ConstructorParameterDescription(self.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("unreadReactionsCount", ConstructorParameterDescription(self.unreadReactionsCount)), ("draft", ConstructorParameterDescription(self.draft))]) } } - case sendAsPeer(Cons_sendAsPeer) + public class Cons_savedDialog: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedDialog", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMessage", ConstructorParameterDescription(self.topMessage))]) + } + } + case monoForumDialog(Cons_monoForumDialog) + case savedDialog(Cons_savedDialog) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .sendAsPeer(let _data): + case .monoForumDialog(let _data): if boxed { - buffer.appendInt32(-1206095820) + 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, ConstructorParameterDescription)]) { switch self { - case .sendAsPeer(let _data): - return ("sendAsPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer))]) + case .monoForumDialog(let _data): + return ("monoForumDialog", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMessage", ConstructorParameterDescription(_data.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("unreadReactionsCount", ConstructorParameterDescription(_data.unreadReactionsCount)), ("draft", ConstructorParameterDescription(_data.draft))]) + case .savedDialog(let _data): + return ("savedDialog", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMessage", ConstructorParameterDescription(_data.topMessage))]) } } - public static func parse_sendAsPeer(_ reader: BufferReader) -> SendAsPeer? { + public static func parse_monoForumDialog(_ reader: BufferReader) -> SavedDialog? { var _1: Int32? _1 = reader.readInt32() var _2: Api.Peer? if let signature = reader.readInt32() { _2 = Api.parse(reader, signature: signature) as? Api.Peer } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: Int32? + _7 = reader.readInt32() + var _8: Api.DraftMessage? + if Int(_1 ?? 0) & 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 - if _c1 && _c2 { - return Api.SendAsPeer.sendAsPeer(Cons_sendAsPeer(flags: _1!, peer: _2!)) + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_savedDialog(_ reader: BufferReader) -> SavedDialog? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + 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 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SavedDialog.savedDialog(Cons_savedDialog(flags: _1!, peer: _2!, topMessage: _3!)) } else { return nil @@ -1049,221 +974,177 @@ public extension Api { } } public extension Api { - enum SendMessageAction: TypeConstructorDescription { - public class Cons_sendMessageEmojiInteraction: TypeConstructorDescription { - 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 + enum SavedReactionTag: TypeConstructorDescription { + public class Cons_savedReactionTag: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageEmojiInteraction", [("emoticon", ConstructorParameterDescription(self.emoticon)), ("msgId", ConstructorParameterDescription(self.msgId)), ("interaction", ConstructorParameterDescription(self.interaction))]) + return ("savedReactionTag", [("flags", ConstructorParameterDescription(self.flags)), ("reaction", ConstructorParameterDescription(self.reaction)), ("title", ConstructorParameterDescription(self.title)), ("count", ConstructorParameterDescription(self.count))]) } } - public class Cons_sendMessageEmojiInteractionSeen: TypeConstructorDescription { - public var emoticon: String - public init(emoticon: String) { - self.emoticon = emoticon - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageEmojiInteractionSeen", [("emoticon", ConstructorParameterDescription(self.emoticon))]) - } - } - public class Cons_sendMessageHistoryImportAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageHistoryImportAction", [("progress", ConstructorParameterDescription(self.progress))]) - } - } - public class Cons_sendMessageTextDraftAction: TypeConstructorDescription { - public var randomId: Int64 - public var text: Api.TextWithEntities - public init(randomId: Int64, text: Api.TextWithEntities) { - self.randomId = randomId - self.text = text - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageTextDraftAction", [("randomId", ConstructorParameterDescription(self.randomId)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_sendMessageUploadAudioAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageUploadAudioAction", [("progress", ConstructorParameterDescription(self.progress))]) - } - } - public class Cons_sendMessageUploadDocumentAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageUploadDocumentAction", [("progress", ConstructorParameterDescription(self.progress))]) - } - } - public class Cons_sendMessageUploadPhotoAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageUploadPhotoAction", [("progress", ConstructorParameterDescription(self.progress))]) - } - } - public class Cons_sendMessageUploadRoundAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageUploadRoundAction", [("progress", ConstructorParameterDescription(self.progress))]) - } - } - public class Cons_sendMessageUploadVideoAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendMessageUploadVideoAction", [("progress", ConstructorParameterDescription(self.progress))]) - } - } - case sendMessageCancelAction - case sendMessageChooseContactAction - case sendMessageChooseStickerAction - case sendMessageEmojiInteraction(Cons_sendMessageEmojiInteraction) - case sendMessageEmojiInteractionSeen(Cons_sendMessageEmojiInteractionSeen) - case sendMessageGamePlayAction - case sendMessageGeoLocationAction - case sendMessageHistoryImportAction(Cons_sendMessageHistoryImportAction) - case sendMessageRecordAudioAction - case sendMessageRecordRoundAction - case sendMessageRecordVideoAction - case sendMessageTextDraftAction(Cons_sendMessageTextDraftAction) - case sendMessageTypingAction - case sendMessageUploadAudioAction(Cons_sendMessageUploadAudioAction) - case sendMessageUploadDocumentAction(Cons_sendMessageUploadDocumentAction) - case sendMessageUploadPhotoAction(Cons_sendMessageUploadPhotoAction) - case sendMessageUploadRoundAction(Cons_sendMessageUploadRoundAction) - case sendMessageUploadVideoAction(Cons_sendMessageUploadVideoAction) - case speakingInGroupCallAction + case savedReactionTag(Cons_savedReactionTag) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .sendMessageCancelAction: + case .savedReactionTag(let _data): if boxed { - buffer.appendInt32(-44119819) + buffer.appendInt32(-881854424) } - break - case .sendMessageChooseContactAction: - if boxed { - buffer.appendInt32(1653390447) + 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 - case .sendMessageChooseStickerAction: + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .savedReactionTag(let _data): + return ("savedReactionTag", [("flags", ConstructorParameterDescription(_data.flags)), ("reaction", ConstructorParameterDescription(_data.reaction)), ("title", ConstructorParameterDescription(_data.title)), ("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_savedReactionTag(_ reader: BufferReader) -> SavedReactionTag? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Reaction? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Reaction + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.SavedReactionTag.savedReactionTag(Cons_savedReactionTag(flags: _1!, reaction: _2!, title: _3, count: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SavedStarGift: TypeConstructorDescription { + public class Cons_savedStarGift: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedStarGift", [("flags", ConstructorParameterDescription(self.flags)), ("fromId", ConstructorParameterDescription(self.fromId)), ("date", ConstructorParameterDescription(self.date)), ("gift", ConstructorParameterDescription(self.gift)), ("message", ConstructorParameterDescription(self.message)), ("msgId", ConstructorParameterDescription(self.msgId)), ("savedId", ConstructorParameterDescription(self.savedId)), ("convertStars", ConstructorParameterDescription(self.convertStars)), ("upgradeStars", ConstructorParameterDescription(self.upgradeStars)), ("canExportAt", ConstructorParameterDescription(self.canExportAt)), ("transferStars", ConstructorParameterDescription(self.transferStars)), ("canTransferAt", ConstructorParameterDescription(self.canTransferAt)), ("canResellAt", ConstructorParameterDescription(self.canResellAt)), ("collectionId", ConstructorParameterDescription(self.collectionId)), ("prepaidUpgradeHash", ConstructorParameterDescription(self.prepaidUpgradeHash)), ("dropOriginalDetailsStars", ConstructorParameterDescription(self.dropOriginalDetailsStars)), ("giftNum", ConstructorParameterDescription(self.giftNum)), ("canCraftAt", ConstructorParameterDescription(self.canCraftAt))]) + } + } + case savedStarGift(Cons_savedStarGift) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedStarGift(let _data): if boxed { - buffer.appendInt32(-1336228175) + buffer.appendInt32(1105150972) } - break - case .sendMessageEmojiInteraction(let _data): - if boxed { - buffer.appendInt32(630664139) + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.fromId!.serialize(buffer, true) } - 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) + 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) } - serializeString(_data.emoticon, buffer: buffer, boxed: false) - break - case .sendMessageGamePlayAction: - if boxed { - buffer.appendInt32(-580219064) + if Int(_data.flags) & Int(1 << 3) != 0 { + serializeInt32(_data.msgId!, buffer: buffer, boxed: false) } - break - case .sendMessageGeoLocationAction: - if boxed { - buffer.appendInt32(393186209) + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt64(_data.savedId!, buffer: buffer, boxed: false) } - break - case .sendMessageHistoryImportAction(let _data): - if boxed { - buffer.appendInt32(-606432698) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.convertStars!, buffer: buffer, boxed: false) } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageRecordAudioAction: - if boxed { - buffer.appendInt32(-718310409) + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeInt64(_data.upgradeStars!, buffer: buffer, boxed: false) } - break - case .sendMessageRecordRoundAction: - if boxed { - buffer.appendInt32(-1997373508) + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeInt32(_data.canExportAt!, buffer: buffer, boxed: false) } - break - case .sendMessageRecordVideoAction: - if boxed { - buffer.appendInt32(-1584933265) + if Int(_data.flags) & Int(1 << 8) != 0 { + serializeInt64(_data.transferStars!, buffer: buffer, boxed: false) } - break - case .sendMessageTextDraftAction(let _data): - if boxed { - buffer.appendInt32(929929052) + if Int(_data.flags) & Int(1 << 13) != 0 { + serializeInt32(_data.canTransferAt!, buffer: buffer, boxed: false) } - serializeInt64(_data.randomId, buffer: buffer, boxed: false) - _data.text.serialize(buffer, true) - break - case .sendMessageTypingAction: - if boxed { - buffer.appendInt32(381645902) + if Int(_data.flags) & Int(1 << 14) != 0 { + serializeInt32(_data.canResellAt!, buffer: buffer, boxed: false) } - break - case .sendMessageUploadAudioAction(let _data): - if boxed { - buffer.appendInt32(-212740181) + 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) + } } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadDocumentAction(let _data): - if boxed { - buffer.appendInt32(-1441998364) + if Int(_data.flags) & Int(1 << 16) != 0 { + serializeString(_data.prepaidUpgradeHash!, buffer: buffer, boxed: false) } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadPhotoAction(let _data): - if boxed { - buffer.appendInt32(-774682074) + if Int(_data.flags) & Int(1 << 18) != 0 { + serializeInt64(_data.dropOriginalDetailsStars!, buffer: buffer, boxed: false) } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadRoundAction(let _data): - if boxed { - buffer.appendInt32(608050278) + if Int(_data.flags) & Int(1 << 19) != 0 { + serializeInt32(_data.giftNum!, buffer: buffer, boxed: false) } - 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) + if Int(_data.flags) & Int(1 << 20) != 0 { + serializeInt32(_data.canCraftAt!, buffer: buffer, boxed: false) } break } @@ -1271,188 +1152,503 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .sendMessageCancelAction: - return ("sendMessageCancelAction", []) - case .sendMessageChooseContactAction: - return ("sendMessageChooseContactAction", []) - case .sendMessageChooseStickerAction: - return ("sendMessageChooseStickerAction", []) - case .sendMessageEmojiInteraction(let _data): - return ("sendMessageEmojiInteraction", [("emoticon", ConstructorParameterDescription(_data.emoticon)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("interaction", ConstructorParameterDescription(_data.interaction))]) - case .sendMessageEmojiInteractionSeen(let _data): - return ("sendMessageEmojiInteractionSeen", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) - case .sendMessageGamePlayAction: - return ("sendMessageGamePlayAction", []) - case .sendMessageGeoLocationAction: - return ("sendMessageGeoLocationAction", []) - case .sendMessageHistoryImportAction(let _data): - return ("sendMessageHistoryImportAction", [("progress", ConstructorParameterDescription(_data.progress))]) - case .sendMessageRecordAudioAction: - return ("sendMessageRecordAudioAction", []) - case .sendMessageRecordRoundAction: - return ("sendMessageRecordRoundAction", []) - case .sendMessageRecordVideoAction: - return ("sendMessageRecordVideoAction", []) - case .sendMessageTextDraftAction(let _data): - return ("sendMessageTextDraftAction", [("randomId", ConstructorParameterDescription(_data.randomId)), ("text", ConstructorParameterDescription(_data.text))]) - case .sendMessageTypingAction: - return ("sendMessageTypingAction", []) - case .sendMessageUploadAudioAction(let _data): - return ("sendMessageUploadAudioAction", [("progress", ConstructorParameterDescription(_data.progress))]) - case .sendMessageUploadDocumentAction(let _data): - return ("sendMessageUploadDocumentAction", [("progress", ConstructorParameterDescription(_data.progress))]) - case .sendMessageUploadPhotoAction(let _data): - return ("sendMessageUploadPhotoAction", [("progress", ConstructorParameterDescription(_data.progress))]) - case .sendMessageUploadRoundAction(let _data): - return ("sendMessageUploadRoundAction", [("progress", ConstructorParameterDescription(_data.progress))]) - case .sendMessageUploadVideoAction(let _data): - return ("sendMessageUploadVideoAction", [("progress", ConstructorParameterDescription(_data.progress))]) - case .speakingInGroupCallAction: - return ("speakingInGroupCallAction", []) + case .savedStarGift(let _data): + return ("savedStarGift", [("flags", ConstructorParameterDescription(_data.flags)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("date", ConstructorParameterDescription(_data.date)), ("gift", ConstructorParameterDescription(_data.gift)), ("message", ConstructorParameterDescription(_data.message)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("savedId", ConstructorParameterDescription(_data.savedId)), ("convertStars", ConstructorParameterDescription(_data.convertStars)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars)), ("canExportAt", ConstructorParameterDescription(_data.canExportAt)), ("transferStars", ConstructorParameterDescription(_data.transferStars)), ("canTransferAt", ConstructorParameterDescription(_data.canTransferAt)), ("canResellAt", ConstructorParameterDescription(_data.canResellAt)), ("collectionId", ConstructorParameterDescription(_data.collectionId)), ("prepaidUpgradeHash", ConstructorParameterDescription(_data.prepaidUpgradeHash)), ("dropOriginalDetailsStars", ConstructorParameterDescription(_data.dropOriginalDetailsStars)), ("giftNum", ConstructorParameterDescription(_data.giftNum)), ("canCraftAt", ConstructorParameterDescription(_data.canCraftAt))]) } } - public static func parse_sendMessageCancelAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageCancelAction + public static func parse_savedStarGift(_ reader: BufferReader) -> SavedStarGift? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & 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? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _5: Api.TextWithEntities? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _6 = reader.readInt32() + } + var _7: Int64? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _7 = reader.readInt64() + } + var _8: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _8 = reader.readInt64() + } + var _9: Int64? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _9 = reader.readInt64() + } + var _10: Int32? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + _10 = reader.readInt32() + } + var _11: Int64? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _11 = reader.readInt64() + } + var _12: Int32? + if Int(_1 ?? 0) & Int(1 << 13) != 0 { + _12 = reader.readInt32() + } + var _13: Int32? + if Int(_1 ?? 0) & Int(1 << 14) != 0 { + _13 = reader.readInt32() + } + var _14: [Int32]? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } + var _15: String? + if Int(_1 ?? 0) & Int(1 << 16) != 0 { + _15 = parseString(reader) + } + var _16: Int64? + if Int(_1 ?? 0) & Int(1 << 18) != 0 { + _16 = reader.readInt64() + } + var _17: Int32? + if Int(_1 ?? 0) & Int(1 << 19) != 0 { + _17 = reader.readInt32() + } + var _18: Int32? + if Int(_1 ?? 0) & Int(1 << 20) != 0 { + _18 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _15 != nil + let _c16 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _16 != nil + let _c17 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _17 != nil + let _c18 = (Int(_1 ?? 0) & 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(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 static func parse_sendMessageChooseContactAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageChooseContactAction + } +} +public extension Api { + enum SearchPostsFlood: TypeConstructorDescription { + public class Cons_searchPostsFlood: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchPostsFlood", [("flags", ConstructorParameterDescription(self.flags)), ("totalDaily", ConstructorParameterDescription(self.totalDaily)), ("remains", ConstructorParameterDescription(self.remains)), ("waitTill", ConstructorParameterDescription(self.waitTill)), ("starsAmount", ConstructorParameterDescription(self.starsAmount))]) + } } - public static func parse_sendMessageChooseStickerAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageChooseStickerAction + 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 static func parse_sendMessageEmojiInteraction(_ reader: BufferReader) -> SendMessageAction? { - var _1: String? - _1 = parseString(reader) + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .searchPostsFlood(let _data): + return ("searchPostsFlood", [("flags", ConstructorParameterDescription(_data.flags)), ("totalDaily", ConstructorParameterDescription(_data.totalDaily)), ("remains", ConstructorParameterDescription(_data.remains)), ("waitTill", ConstructorParameterDescription(_data.waitTill)), ("starsAmount", ConstructorParameterDescription(_data.starsAmount))]) + } + } + + public static func parse_searchPostsFlood(_ reader: BufferReader) -> SearchPostsFlood? { + var _1: Int32? + _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() - var _3: Api.DataJSON? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.DataJSON + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = reader.readInt32() } + var _5: Int64? + _5 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_searchResultsCalendarPeriod: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchResultsCalendarPeriod", [("date", ConstructorParameterDescription(self.date)), ("minMsgId", ConstructorParameterDescription(self.minMsgId)), ("maxMsgId", ConstructorParameterDescription(self.maxMsgId)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .searchResultsCalendarPeriod(let _data): + return ("searchResultsCalendarPeriod", [("date", ConstructorParameterDescription(_data.date)), ("minMsgId", ConstructorParameterDescription(_data.minMsgId)), ("maxMsgId", ConstructorParameterDescription(_data.maxMsgId)), ("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_searchResultsCalendarPeriod(_ reader: BufferReader) -> SearchResultsCalendarPeriod? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.SearchResultsCalendarPeriod.searchResultsCalendarPeriod(Cons_searchResultsCalendarPeriod(date: _1!, minMsgId: _2!, maxMsgId: _3!, count: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SearchResultsPosition: TypeConstructorDescription { + public class Cons_searchResultPosition: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchResultPosition", [("msgId", ConstructorParameterDescription(self.msgId)), ("date", ConstructorParameterDescription(self.date)), ("offset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .searchResultPosition(let _data): + return ("searchResultPosition", [("msgId", ConstructorParameterDescription(_data.msgId)), ("date", ConstructorParameterDescription(_data.date)), ("offset", ConstructorParameterDescription(_data.offset))]) + } + } + + public static func parse_searchResultPosition(_ reader: BufferReader) -> SearchResultsPosition? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.SendMessageAction.sendMessageEmojiInteraction(Cons_sendMessageEmojiInteraction(emoticon: _1!, msgId: _2!, interaction: _3!)) + return Api.SearchResultsPosition.searchResultPosition(Cons_searchResultPosition(msgId: _1!, date: _2!, offset: _3!)) } else { return nil } } - public static func parse_sendMessageEmojiInteractionSeen(_ reader: BufferReader) -> SendMessageAction? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.SendMessageAction.sendMessageEmojiInteractionSeen(Cons_sendMessageEmojiInteractionSeen(emoticon: _1!)) - } - else { - return nil - } - } - public static func parse_sendMessageGamePlayAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageGamePlayAction - } - public static func parse_sendMessageGeoLocationAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageGeoLocationAction - } - public static func parse_sendMessageHistoryImportAction(_ reader: BufferReader) -> SendMessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.SendMessageAction.sendMessageHistoryImportAction(Cons_sendMessageHistoryImportAction(progress: _1!)) - } - else { - return nil - } - } - public static func parse_sendMessageRecordAudioAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageRecordAudioAction - } - public static func parse_sendMessageRecordRoundAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageRecordRoundAction - } - public static func parse_sendMessageRecordVideoAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageRecordVideoAction - } - public static func parse_sendMessageTextDraftAction(_ reader: BufferReader) -> SendMessageAction? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.SendMessageAction.sendMessageTextDraftAction(Cons_sendMessageTextDraftAction(randomId: _1!, text: _2!)) - } - else { - return nil - } - } - public static func parse_sendMessageTypingAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageTypingAction - } - public static func parse_sendMessageUploadAudioAction(_ reader: BufferReader) -> SendMessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.SendMessageAction.sendMessageUploadAudioAction(Cons_sendMessageUploadAudioAction(progress: _1!)) - } - else { - return nil - } - } - public static func parse_sendMessageUploadDocumentAction(_ reader: BufferReader) -> SendMessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.SendMessageAction.sendMessageUploadDocumentAction(Cons_sendMessageUploadDocumentAction(progress: _1!)) - } - else { - return nil - } - } - public static func parse_sendMessageUploadPhotoAction(_ reader: BufferReader) -> SendMessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.SendMessageAction.sendMessageUploadPhotoAction(Cons_sendMessageUploadPhotoAction(progress: _1!)) - } - else { - return nil - } - } - public static func parse_sendMessageUploadRoundAction(_ reader: BufferReader) -> SendMessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.SendMessageAction.sendMessageUploadRoundAction(Cons_sendMessageUploadRoundAction(progress: _1!)) - } - else { - return nil - } - } - public static func parse_sendMessageUploadVideoAction(_ reader: BufferReader) -> SendMessageAction? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.SendMessageAction.sendMessageUploadVideoAction(Cons_sendMessageUploadVideoAction(progress: _1!)) - } - else { - return nil - } - } - public static func parse_speakingInGroupCallAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.speakingInGroupCallAction - } + } +} +public extension Api { + enum SecureCredentialsEncrypted: TypeConstructorDescription { + public class Cons_secureCredentialsEncrypted: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureCredentialsEncrypted", [("data", ConstructorParameterDescription(self.data)), ("hash", ConstructorParameterDescription(self.hash)), ("secret", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .secureCredentialsEncrypted(let _data): + return ("secureCredentialsEncrypted", [("data", ConstructorParameterDescription(_data.data)), ("hash", ConstructorParameterDescription(_data.hash)), ("secret", ConstructorParameterDescription(_data.secret))]) + } + } + + public static func parse_secureCredentialsEncrypted(_ reader: BufferReader) -> SecureCredentialsEncrypted? { + var _1: Buffer? + _1 = parseBytes(reader) + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Buffer? + _3 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureCredentialsEncrypted.secureCredentialsEncrypted(Cons_secureCredentialsEncrypted(data: _1!, hash: _2!, secret: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SecureData: TypeConstructorDescription { + public class Cons_secureData: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureData", [("data", ConstructorParameterDescription(self.data)), ("dataHash", ConstructorParameterDescription(self.dataHash)), ("secret", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .secureData(let _data): + return ("secureData", [("data", ConstructorParameterDescription(_data.data)), ("dataHash", ConstructorParameterDescription(_data.dataHash)), ("secret", ConstructorParameterDescription(_data.secret))]) + } + } + + public static func parse_secureData(_ reader: BufferReader) -> SecureData? { + var _1: Buffer? + _1 = parseBytes(reader) + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Buffer? + _3 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureData.secureData(Cons_secureData(data: _1!, dataHash: _2!, secret: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SecureFile: TypeConstructorDescription { + public class Cons_secureFile: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureFile", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("size", ConstructorParameterDescription(self.size)), ("dcId", ConstructorParameterDescription(self.dcId)), ("date", ConstructorParameterDescription(self.date)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("secret", ConstructorParameterDescription(self.secret))]) + } + } + case secureFile(Cons_secureFile) + 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, ConstructorParameterDescription)]) { + switch self { + case .secureFile(let _data): + return ("secureFile", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("size", ConstructorParameterDescription(_data.size)), ("dcId", ConstructorParameterDescription(_data.dcId)), ("date", ConstructorParameterDescription(_data.date)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("secret", ConstructorParameterDescription(_data.secret))]) + case .secureFileEmpty: + return ("secureFileEmpty", []) + } + } + + public static func parse_secureFile(_ reader: BufferReader) -> SecureFile? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Buffer? + _6 = parseBytes(reader) + var _7: Buffer? + _7 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.SecureFile.secureFile(Cons_secureFile(id: _1!, accessHash: _2!, size: _3!, dcId: _4!, date: _5!, fileHash: _6!, secret: _7!)) + } + else { + return nil + } + } + public static func parse_secureFileEmpty(_ reader: BufferReader) -> SecureFile? { + return Api.SecureFile.secureFileEmpty + } } } diff --git a/submodules/TelegramApi/Sources/Api25.swift b/submodules/TelegramApi/Sources/Api25.swift index 0c487ab302..ce9ae3bb19 100644 --- a/submodules/TelegramApi/Sources/Api25.swift +++ b/submodules/TelegramApi/Sources/Api25.swift @@ -1,31 +1,201 @@ public extension Api { - enum ShippingOption: TypeConstructorDescription { - public class Cons_shippingOption: TypeConstructorDescription { - 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 + enum SecurePasswordKdfAlgo: TypeConstructorDescription { + public class Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000: TypeConstructorDescription { + public var salt: Buffer + public init(salt: Buffer) { + self.salt = salt } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("shippingOption", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title)), ("prices", ConstructorParameterDescription(self.prices))]) + return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", ConstructorParameterDescription(self.salt))]) } } - case shippingOption(Cons_shippingOption) + public class Cons_securePasswordKdfAlgoSHA512: TypeConstructorDescription { + public var salt: Buffer + public init(salt: Buffer) { + self.salt = salt + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("securePasswordKdfAlgoSHA512", [("salt", ConstructorParameterDescription(self.salt))]) + } + } + case securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000) + case securePasswordKdfAlgoSHA512(Cons_securePasswordKdfAlgoSHA512) + case securePasswordKdfAlgoUnknown public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .shippingOption(let _data): + case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let _data): if boxed { - buffer.appendInt32(-1239335713) + 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, ConstructorParameterDescription)]) { + switch self { + case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let _data): + return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", ConstructorParameterDescription(_data.salt))]) + case .securePasswordKdfAlgoSHA512(let _data): + return ("securePasswordKdfAlgoSHA512", [("salt", ConstructorParameterDescription(_data.salt))]) + 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(Cons_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(salt: _1!)) + } + else { + return nil + } + } + public static func parse_securePasswordKdfAlgoSHA512(_ reader: BufferReader) -> SecurePasswordKdfAlgo? { + var _1: Buffer? + _1 = parseBytes(reader) + let _c1 = _1 != nil + if _c1 { + return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoSHA512(Cons_securePasswordKdfAlgoSHA512(salt: _1!)) + } + else { + return nil + } + } + public static func parse_securePasswordKdfAlgoUnknown(_ reader: BufferReader) -> SecurePasswordKdfAlgo? { + return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoUnknown + } + } +} +public extension Api { + enum SecurePlainData: TypeConstructorDescription { + public class Cons_securePlainEmail: TypeConstructorDescription { + public var email: String + public init(email: String) { + self.email = email + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("securePlainEmail", [("email", ConstructorParameterDescription(self.email))]) + } + } + public class Cons_securePlainPhone: TypeConstructorDescription { + public var phone: String + public init(phone: String) { + self.phone = phone + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("securePlainPhone", [("phone", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .securePlainEmail(let _data): + return ("securePlainEmail", [("email", ConstructorParameterDescription(_data.email))]) + case .securePlainPhone(let _data): + return ("securePlainPhone", [("phone", ConstructorParameterDescription(_data.phone))]) + } + } + + public static func parse_securePlainEmail(_ reader: BufferReader) -> SecurePlainData? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.SecurePlainData.securePlainEmail(Cons_securePlainEmail(email: _1!)) + } + else { + return nil + } + } + public static func parse_securePlainPhone(_ reader: BufferReader) -> SecurePlainData? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.SecurePlainData.securePlainPhone(Cons_securePlainPhone(phone: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SecureRequiredType: TypeConstructorDescription { + public class Cons_secureRequiredType: TypeConstructorDescription { + public var flags: Int32 + public var type: Api.SecureValueType + public init(flags: Int32, type: Api.SecureValueType) { + self.flags = flags + self.type = type + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureRequiredType", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type))]) + } + } + public class Cons_secureRequiredTypeOneOf: TypeConstructorDescription { + public var types: [Api.SecureRequiredType] + public init(types: [Api.SecureRequiredType]) { + self.types = types + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureRequiredTypeOneOf", [("types", ConstructorParameterDescription(self.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) } - 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 { + buffer.appendInt32(Int32(_data.types.count)) + for item in _data.types { item.serialize(buffer, true) } break @@ -34,297 +204,37 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .shippingOption(let _data): - return ("shippingOption", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title)), ("prices", ConstructorParameterDescription(_data.prices))]) + case .secureRequiredType(let _data): + return ("secureRequiredType", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type))]) + case .secureRequiredTypeOneOf(let _data): + return ("secureRequiredTypeOneOf", [("types", ConstructorParameterDescription(_data.types))]) } } - public static func parse_shippingOption(_ reader: BufferReader) -> ShippingOption? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: [Api.LabeledPrice]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.LabeledPrice.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.ShippingOption.shippingOption(Cons_shippingOption(id: _1!, title: _2!, prices: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SmsJob: TypeConstructorDescription { - public class Cons_smsJob: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("smsJob", [("jobId", ConstructorParameterDescription(self.jobId)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("text", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .smsJob(let _data): - return ("smsJob", [("jobId", ConstructorParameterDescription(_data.jobId)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("text", ConstructorParameterDescription(_data.text))]) - } - } - - public static func parse_smsJob(_ reader: BufferReader) -> SmsJob? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.SmsJob.smsJob(Cons_smsJob(jobId: _1!, phoneNumber: _2!, text: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum SponsoredMessage: TypeConstructorDescription { - public class Cons_sponsoredMessage: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sponsoredMessage", [("flags", ConstructorParameterDescription(self.flags)), ("randomId", ConstructorParameterDescription(self.randomId)), ("url", ConstructorParameterDescription(self.url)), ("title", ConstructorParameterDescription(self.title)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("photo", ConstructorParameterDescription(self.photo)), ("media", ConstructorParameterDescription(self.media)), ("color", ConstructorParameterDescription(self.color)), ("buttonText", ConstructorParameterDescription(self.buttonText)), ("sponsorInfo", ConstructorParameterDescription(self.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(self.additionalInfo)), ("minDisplayDuration", ConstructorParameterDescription(self.minDisplayDuration)), ("maxDisplayDuration", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .sponsoredMessage(let _data): - return ("sponsoredMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("url", ConstructorParameterDescription(_data.url)), ("title", ConstructorParameterDescription(_data.title)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("photo", ConstructorParameterDescription(_data.photo)), ("media", ConstructorParameterDescription(_data.media)), ("color", ConstructorParameterDescription(_data.color)), ("buttonText", ConstructorParameterDescription(_data.buttonText)), ("sponsorInfo", ConstructorParameterDescription(_data.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(_data.additionalInfo)), ("minDisplayDuration", ConstructorParameterDescription(_data.minDisplayDuration)), ("maxDisplayDuration", ConstructorParameterDescription(_data.maxDisplayDuration))]) - } - } - - public static func parse_sponsoredMessage(_ reader: BufferReader) -> SponsoredMessage? { + public static func parse_secureRequiredType(_ reader: BufferReader) -> SecureRequiredType? { var _1: Int32? _1 = reader.readInt32() - var _2: Buffer? - _2 = parseBytes(reader) - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: [Api.MessageEntity]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } + var _2: Api.SecureValueType? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.SecureValueType } - var _7: Api.Photo? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { - _11 = parseString(reader) - } - var _12: String? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _12 = parseString(reader) - } - var _13: Int32? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - _13 = reader.readInt32() - } - var _14: Int32? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - _14 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _9 != nil - let _c10 = _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & 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(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 { - public class Cons_sponsoredMessageReportOption: TypeConstructorDescription { - public var text: String - public var option: Buffer - public init(text: String, option: Buffer) { - self.text = text - self.option = option - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sponsoredMessageReportOption", [("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .sponsoredMessageReportOption(let _data): - return ("sponsoredMessageReportOption", [("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option))]) - } - } - - public static func parse_sponsoredMessageReportOption(_ reader: BufferReader) -> SponsoredMessageReportOption? { - var _1: String? - _1 = parseString(reader) - var _2: Buffer? - _2 = parseBytes(reader) let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.SponsoredMessageReportOption.sponsoredMessageReportOption(Cons_sponsoredMessageReportOption(text: _1!, option: _2!)) + return Api.SecureRequiredType.secureRequiredType(Cons_secureRequiredType(flags: _1!, type: _2!)) + } + else { + return nil + } + } + public static func parse_secureRequiredTypeOneOf(_ reader: BufferReader) -> SecureRequiredType? { + var _1: [Api.SecureRequiredType]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureRequiredType.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.SecureRequiredType.secureRequiredTypeOneOf(Cons_secureRequiredTypeOneOf(types: _1!)) } else { return nil @@ -333,621 +243,56 @@ public extension Api { } } public extension Api { - enum SponsoredPeer: TypeConstructorDescription { - public class Cons_sponsoredPeer: TypeConstructorDescription { - 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 + enum SecureSecretSettings: TypeConstructorDescription { + public class Cons_secureSecretSettings: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sponsoredPeer", [("flags", ConstructorParameterDescription(self.flags)), ("randomId", ConstructorParameterDescription(self.randomId)), ("peer", ConstructorParameterDescription(self.peer)), ("sponsorInfo", ConstructorParameterDescription(self.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(self.additionalInfo))]) + return ("secureSecretSettings", [("secureAlgo", ConstructorParameterDescription(self.secureAlgo)), ("secureSecret", ConstructorParameterDescription(self.secureSecret)), ("secureSecretId", ConstructorParameterDescription(self.secureSecretId))]) } } - case sponsoredPeer(Cons_sponsoredPeer) + case secureSecretSettings(Cons_secureSecretSettings) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .sponsoredPeer(let _data): + case .secureSecretSettings(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) + 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, ConstructorParameterDescription)]) { switch self { - case .sponsoredPeer(let _data): - return ("sponsoredPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("peer", ConstructorParameterDescription(_data.peer)), ("sponsorInfo", ConstructorParameterDescription(_data.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(_data.additionalInfo))]) + case .secureSecretSettings(let _data): + return ("secureSecretSettings", [("secureAlgo", ConstructorParameterDescription(_data.secureAlgo)), ("secureSecret", ConstructorParameterDescription(_data.secureSecret)), ("secureSecretId", ConstructorParameterDescription(_data.secureSecretId))]) } } - public static func parse_sponsoredPeer(_ reader: BufferReader) -> SponsoredPeer? { - var _1: Int32? - _1 = reader.readInt32() + public static func parse_secureSecretSettings(_ reader: BufferReader) -> SecureSecretSettings? { + var _1: Api.SecurePasswordKdfAlgo? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecurePasswordKdfAlgo + } var _2: Buffer? _2 = parseBytes(reader) - var _3: Api.Peer? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_starGift: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGift", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("sticker", ConstructorParameterDescription(self.sticker)), ("stars", ConstructorParameterDescription(self.stars)), ("availabilityRemains", ConstructorParameterDescription(self.availabilityRemains)), ("availabilityTotal", ConstructorParameterDescription(self.availabilityTotal)), ("availabilityResale", ConstructorParameterDescription(self.availabilityResale)), ("convertStars", ConstructorParameterDescription(self.convertStars)), ("firstSaleDate", ConstructorParameterDescription(self.firstSaleDate)), ("lastSaleDate", ConstructorParameterDescription(self.lastSaleDate)), ("upgradeStars", ConstructorParameterDescription(self.upgradeStars)), ("resellMinStars", ConstructorParameterDescription(self.resellMinStars)), ("title", ConstructorParameterDescription(self.title)), ("releasedBy", ConstructorParameterDescription(self.releasedBy)), ("perUserTotal", ConstructorParameterDescription(self.perUserTotal)), ("perUserRemains", ConstructorParameterDescription(self.perUserRemains)), ("lockedUntilDate", ConstructorParameterDescription(self.lockedUntilDate)), ("auctionSlug", ConstructorParameterDescription(self.auctionSlug)), ("giftsPerRound", ConstructorParameterDescription(self.giftsPerRound)), ("auctionStartDate", ConstructorParameterDescription(self.auctionStartDate)), ("upgradeVariants", ConstructorParameterDescription(self.upgradeVariants)), ("background", ConstructorParameterDescription(self.background))]) - } - } - public class Cons_starGiftUnique: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftUnique", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("giftId", ConstructorParameterDescription(self.giftId)), ("title", ConstructorParameterDescription(self.title)), ("slug", ConstructorParameterDescription(self.slug)), ("num", ConstructorParameterDescription(self.num)), ("ownerId", ConstructorParameterDescription(self.ownerId)), ("ownerName", ConstructorParameterDescription(self.ownerName)), ("ownerAddress", ConstructorParameterDescription(self.ownerAddress)), ("attributes", ConstructorParameterDescription(self.attributes)), ("availabilityIssued", ConstructorParameterDescription(self.availabilityIssued)), ("availabilityTotal", ConstructorParameterDescription(self.availabilityTotal)), ("giftAddress", ConstructorParameterDescription(self.giftAddress)), ("resellAmount", ConstructorParameterDescription(self.resellAmount)), ("releasedBy", ConstructorParameterDescription(self.releasedBy)), ("valueAmount", ConstructorParameterDescription(self.valueAmount)), ("valueCurrency", ConstructorParameterDescription(self.valueCurrency)), ("valueUsdAmount", ConstructorParameterDescription(self.valueUsdAmount)), ("themePeer", ConstructorParameterDescription(self.themePeer)), ("peerColor", ConstructorParameterDescription(self.peerColor)), ("hostId", ConstructorParameterDescription(self.hostId)), ("offerMinStars", ConstructorParameterDescription(self.offerMinStars)), ("craftChancePermille", ConstructorParameterDescription(self.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(_data.resellAmount!.count)) - for item in _data.resellAmount! { - item.serialize(buffer, true) - } - } - 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, ConstructorParameterDescription)]) { - switch self { - case .starGift(let _data): - return ("starGift", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("sticker", ConstructorParameterDescription(_data.sticker)), ("stars", ConstructorParameterDescription(_data.stars)), ("availabilityRemains", ConstructorParameterDescription(_data.availabilityRemains)), ("availabilityTotal", ConstructorParameterDescription(_data.availabilityTotal)), ("availabilityResale", ConstructorParameterDescription(_data.availabilityResale)), ("convertStars", ConstructorParameterDescription(_data.convertStars)), ("firstSaleDate", ConstructorParameterDescription(_data.firstSaleDate)), ("lastSaleDate", ConstructorParameterDescription(_data.lastSaleDate)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars)), ("resellMinStars", ConstructorParameterDescription(_data.resellMinStars)), ("title", ConstructorParameterDescription(_data.title)), ("releasedBy", ConstructorParameterDescription(_data.releasedBy)), ("perUserTotal", ConstructorParameterDescription(_data.perUserTotal)), ("perUserRemains", ConstructorParameterDescription(_data.perUserRemains)), ("lockedUntilDate", ConstructorParameterDescription(_data.lockedUntilDate)), ("auctionSlug", ConstructorParameterDescription(_data.auctionSlug)), ("giftsPerRound", ConstructorParameterDescription(_data.giftsPerRound)), ("auctionStartDate", ConstructorParameterDescription(_data.auctionStartDate)), ("upgradeVariants", ConstructorParameterDescription(_data.upgradeVariants)), ("background", ConstructorParameterDescription(_data.background))]) - case .starGiftUnique(let _data): - return ("starGiftUnique", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("giftId", ConstructorParameterDescription(_data.giftId)), ("title", ConstructorParameterDescription(_data.title)), ("slug", ConstructorParameterDescription(_data.slug)), ("num", ConstructorParameterDescription(_data.num)), ("ownerId", ConstructorParameterDescription(_data.ownerId)), ("ownerName", ConstructorParameterDescription(_data.ownerName)), ("ownerAddress", ConstructorParameterDescription(_data.ownerAddress)), ("attributes", ConstructorParameterDescription(_data.attributes)), ("availabilityIssued", ConstructorParameterDescription(_data.availabilityIssued)), ("availabilityTotal", ConstructorParameterDescription(_data.availabilityTotal)), ("giftAddress", ConstructorParameterDescription(_data.giftAddress)), ("resellAmount", ConstructorParameterDescription(_data.resellAmount)), ("releasedBy", ConstructorParameterDescription(_data.releasedBy)), ("valueAmount", ConstructorParameterDescription(_data.valueAmount)), ("valueCurrency", ConstructorParameterDescription(_data.valueCurrency)), ("valueUsdAmount", ConstructorParameterDescription(_data.valueUsdAmount)), ("themePeer", ConstructorParameterDescription(_data.themePeer)), ("peerColor", ConstructorParameterDescription(_data.peerColor)), ("hostId", ConstructorParameterDescription(_data.hostId)), ("offerMinStars", ConstructorParameterDescription(_data.offerMinStars)), ("craftChancePermille", ConstructorParameterDescription(_data.craftChancePermille))]) - } - } - - public static func parse_starGift(_ reader: BufferReader) -> StarGift? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.Document? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Document - } - var _4: Int64? - _4 = reader.readInt64() - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = reader.readInt32() - } - var _7: Int64? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _7 = reader.readInt64() - } - var _8: Int64? - _8 = reader.readInt64() - var _9: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _9 = reader.readInt32() - } - var _10: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _10 = reader.readInt32() - } - var _11: Int64? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _11 = reader.readInt64() - } - var _12: Int64? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _12 = reader.readInt64() - } - var _13: String? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _13 = parseString(reader) - } - var _14: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - if let signature = reader.readInt32() { - _14 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _15: Int32? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _15 = reader.readInt32() - } - var _16: Int32? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _16 = reader.readInt32() - } - var _17: Int32? - if Int(_1 ?? 0) & Int(1 << 9) != 0 { - _17 = reader.readInt32() - } - var _18: String? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _18 = parseString(reader) - } - var _19: Int32? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _19 = reader.readInt32() - } - var _20: Int32? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _20 = reader.readInt32() - } - var _21: Int32? - if Int(_1 ?? 0) & Int(1 << 12) != 0 { - _21 = reader.readInt32() - } - var _22: Api.StarGiftBackground? - if Int(_1 ?? 0) & 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 - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil - let _c8 = _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _15 != nil - let _c16 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _16 != nil - let _c17 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _17 != nil - let _c18 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _18 != nil - let _c19 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _19 != nil - let _c20 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _20 != nil - let _c21 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _21 != nil - let _c22 = (Int(_1 ?? 0) & 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(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 - } - } - public static func parse_starGiftUnique(_ reader: BufferReader) -> StarGift? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() var _3: Int64? _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Int32? - _6 = reader.readInt32() - var _7: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _8: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _8 = parseString(reader) - } - var _9: String? - if Int(_1 ?? 0) & 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) - } - var _11: Int32? - _11 = reader.readInt32() - var _12: Int32? - _12 = reader.readInt32() - var _13: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _13 = parseString(reader) - } - var _14: [Api.StarsAmount]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 5) != 0 { - if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _16: Int64? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _16 = reader.readInt64() - } - var _17: String? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _17 = parseString(reader) - } - var _18: Int64? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _18 = reader.readInt64() - } - var _19: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 12) != 0 { - if let signature = reader.readInt32() { - _21 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _22: Int32? - if Int(_1 ?? 0) & Int(1 << 13) != 0 { - _22 = reader.readInt32() - } - var _23: Int32? - if Int(_1 ?? 0) & Int(1 << 16) != 0 { - _23 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil - let _c10 = _10 != nil - let _c11 = _11 != nil - let _c12 = _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _15 != nil - let _c16 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _16 != nil - let _c17 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _17 != nil - let _c18 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _18 != nil - let _c19 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _19 != nil - let _c20 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _20 != nil - let _c21 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _21 != nil - let _c22 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _22 != nil - let _c23 = (Int(_1 ?? 0) & 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(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 { - public class Cons_starGiftActiveAuctionState: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftActiveAuctionState", [("gift", ConstructorParameterDescription(self.gift)), ("state", ConstructorParameterDescription(self.state)), ("userState", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftActiveAuctionState(let _data): - return ("starGiftActiveAuctionState", [("gift", ConstructorParameterDescription(_data.gift)), ("state", ConstructorParameterDescription(_data.state)), ("userState", ConstructorParameterDescription(_data.userState))]) - } - } - - public static func parse_starGiftActiveAuctionState(_ reader: BufferReader) -> StarGiftActiveAuctionState? { - var _1: Api.StarGift? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _2: Api.StarGiftAuctionState? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionState - } - var _3: Api.StarGiftAuctionUserState? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionUserState - } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StarGiftActiveAuctionState.starGiftActiveAuctionState(Cons_starGiftActiveAuctionState(gift: _1!, state: _2!, userState: _3!)) + return Api.SecureSecretSettings.secureSecretSettings(Cons_secureSecretSettings(secureAlgo: _1!, secureSecret: _2!, secureSecretId: _3!)) } else { return nil @@ -956,1124 +301,148 @@ public extension Api { } } public extension Api { - enum StarGiftAttribute: TypeConstructorDescription { - public class Cons_starGiftAttributeBackdrop: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeBackdrop", [("name", ConstructorParameterDescription(self.name)), ("backdropId", ConstructorParameterDescription(self.backdropId)), ("centerColor", ConstructorParameterDescription(self.centerColor)), ("edgeColor", ConstructorParameterDescription(self.edgeColor)), ("patternColor", ConstructorParameterDescription(self.patternColor)), ("textColor", ConstructorParameterDescription(self.textColor)), ("rarity", ConstructorParameterDescription(self.rarity))]) - } - } - public class Cons_starGiftAttributeModel: TypeConstructorDescription { + enum SecureValue: TypeConstructorDescription { + public class Cons_secureValue: TypeConstructorDescription { 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) { + 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.name = name - self.document = document - self.rarity = rarity - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeModel", [("flags", ConstructorParameterDescription(self.flags)), ("name", ConstructorParameterDescription(self.name)), ("document", ConstructorParameterDescription(self.document)), ("rarity", ConstructorParameterDescription(self.rarity))]) - } - } - public class Cons_starGiftAttributeOriginalDetails: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeOriginalDetails", [("flags", ConstructorParameterDescription(self.flags)), ("senderId", ConstructorParameterDescription(self.senderId)), ("recipientId", ConstructorParameterDescription(self.recipientId)), ("date", ConstructorParameterDescription(self.date)), ("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_starGiftAttributePattern: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributePattern", [("name", ConstructorParameterDescription(self.name)), ("document", ConstructorParameterDescription(self.document)), ("rarity", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAttributeBackdrop(let _data): - return ("starGiftAttributeBackdrop", [("name", ConstructorParameterDescription(_data.name)), ("backdropId", ConstructorParameterDescription(_data.backdropId)), ("centerColor", ConstructorParameterDescription(_data.centerColor)), ("edgeColor", ConstructorParameterDescription(_data.edgeColor)), ("patternColor", ConstructorParameterDescription(_data.patternColor)), ("textColor", ConstructorParameterDescription(_data.textColor)), ("rarity", ConstructorParameterDescription(_data.rarity))]) - case .starGiftAttributeModel(let _data): - return ("starGiftAttributeModel", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("document", ConstructorParameterDescription(_data.document)), ("rarity", ConstructorParameterDescription(_data.rarity))]) - case .starGiftAttributeOriginalDetails(let _data): - return ("starGiftAttributeOriginalDetails", [("flags", ConstructorParameterDescription(_data.flags)), ("senderId", ConstructorParameterDescription(_data.senderId)), ("recipientId", ConstructorParameterDescription(_data.recipientId)), ("date", ConstructorParameterDescription(_data.date)), ("message", ConstructorParameterDescription(_data.message))]) - case .starGiftAttributePattern(let _data): - return ("starGiftAttributePattern", [("name", ConstructorParameterDescription(_data.name)), ("document", ConstructorParameterDescription(_data.document)), ("rarity", ConstructorParameterDescription(_data.rarity))]) - } - } - - public static func parse_starGiftAttributeBackdrop(_ reader: BufferReader) -> StarGiftAttribute? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - var _7: Api.StarGiftAttributeRarity? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeRarity - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.StarGiftAttribute.starGiftAttributeBackdrop(Cons_starGiftAttributeBackdrop(name: _1!, backdropId: _2!, centerColor: _3!, edgeColor: _4!, patternColor: _5!, textColor: _6!, rarity: _7!)) - } - else { - return nil - } - } - public static func parse_starGiftAttributeModel(_ reader: BufferReader) -> StarGiftAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Api.Document? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Document - } - var _4: Api.StarGiftAttributeRarity? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeRarity - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.StarGiftAttribute.starGiftAttributeModel(Cons_starGiftAttributeModel(flags: _1!, name: _2!, document: _3!, rarity: _4!)) - } - else { - return nil - } - } - public static func parse_starGiftAttributeOriginalDetails(_ reader: BufferReader) -> StarGiftAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & 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 - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Api.TextWithEntities? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarGiftAttribute.starGiftAttributeOriginalDetails(Cons_starGiftAttributeOriginalDetails(flags: _1!, senderId: _2, recipientId: _3!, date: _4!, message: _5)) - } - else { - return nil - } - } - public static func parse_starGiftAttributePattern(_ reader: BufferReader) -> StarGiftAttribute? { - var _1: String? - _1 = parseString(reader) - var _2: Api.Document? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Document - } - var _3: Api.StarGiftAttributeRarity? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeRarity - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.StarGiftAttribute.starGiftAttributePattern(Cons_starGiftAttributePattern(name: _1!, document: _2!, rarity: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StarGiftAttributeCounter: TypeConstructorDescription { - public class Cons_starGiftAttributeCounter: TypeConstructorDescription { - public var attribute: Api.StarGiftAttributeId - public var count: Int32 - public init(attribute: Api.StarGiftAttributeId, count: Int32) { - self.attribute = attribute - self.count = count - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeCounter", [("attribute", ConstructorParameterDescription(self.attribute)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAttributeCounter(let _data): - return ("starGiftAttributeCounter", [("attribute", ConstructorParameterDescription(_data.attribute)), ("count", ConstructorParameterDescription(_data.count))]) - } - } - - public static func parse_starGiftAttributeCounter(_ reader: BufferReader) -> StarGiftAttributeCounter? { - var _1: Api.StarGiftAttributeId? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeId - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StarGiftAttributeCounter.starGiftAttributeCounter(Cons_starGiftAttributeCounter(attribute: _1!, count: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StarGiftAttributeId: TypeConstructorDescription { - public class Cons_starGiftAttributeIdBackdrop: TypeConstructorDescription { - public var backdropId: Int32 - public init(backdropId: Int32) { - self.backdropId = backdropId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeIdBackdrop", [("backdropId", ConstructorParameterDescription(self.backdropId))]) - } - } - public class Cons_starGiftAttributeIdModel: TypeConstructorDescription { - public var documentId: Int64 - public init(documentId: Int64) { - self.documentId = documentId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeIdModel", [("documentId", ConstructorParameterDescription(self.documentId))]) - } - } - public class Cons_starGiftAttributeIdPattern: TypeConstructorDescription { - public var documentId: Int64 - public init(documentId: Int64) { - self.documentId = documentId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeIdPattern", [("documentId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAttributeIdBackdrop(let _data): - return ("starGiftAttributeIdBackdrop", [("backdropId", ConstructorParameterDescription(_data.backdropId))]) - case .starGiftAttributeIdModel(let _data): - return ("starGiftAttributeIdModel", [("documentId", ConstructorParameterDescription(_data.documentId))]) - case .starGiftAttributeIdPattern(let _data): - return ("starGiftAttributeIdPattern", [("documentId", ConstructorParameterDescription(_data.documentId))]) - } - } - - public static func parse_starGiftAttributeIdBackdrop(_ reader: BufferReader) -> StarGiftAttributeId? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.StarGiftAttributeId.starGiftAttributeIdBackdrop(Cons_starGiftAttributeIdBackdrop(backdropId: _1!)) - } - else { - return nil - } - } - public static func parse_starGiftAttributeIdModel(_ reader: BufferReader) -> StarGiftAttributeId? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.StarGiftAttributeId.starGiftAttributeIdModel(Cons_starGiftAttributeIdModel(documentId: _1!)) - } - else { - return nil - } - } - public static func parse_starGiftAttributeIdPattern(_ reader: BufferReader) -> StarGiftAttributeId? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.StarGiftAttributeId.starGiftAttributeIdPattern(Cons_starGiftAttributeIdPattern(documentId: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StarGiftAttributeRarity: TypeConstructorDescription { - public class Cons_starGiftAttributeRarity: TypeConstructorDescription { - public var permille: Int32 - public init(permille: Int32) { - self.permille = permille - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAttributeRarity", [("permille", ConstructorParameterDescription(self.permille))]) - } - } - case starGiftAttributeRarity(Cons_starGiftAttributeRarity) - case starGiftAttributeRarityEpic - case starGiftAttributeRarityLegendary - case starGiftAttributeRarityRare - case starGiftAttributeRarityUncommon - - 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 - case .starGiftAttributeRarityUncommon: - if boxed { - buffer.appendInt32(-607231095) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .starGiftAttributeRarity(let _data): - return ("starGiftAttributeRarity", [("permille", ConstructorParameterDescription(_data.permille))]) - case .starGiftAttributeRarityEpic: - return ("starGiftAttributeRarityEpic", []) - case .starGiftAttributeRarityLegendary: - return ("starGiftAttributeRarityLegendary", []) - case .starGiftAttributeRarityRare: - return ("starGiftAttributeRarityRare", []) - case .starGiftAttributeRarityUncommon: - return ("starGiftAttributeRarityUncommon", []) - } - } - - public static func parse_starGiftAttributeRarity(_ reader: BufferReader) -> StarGiftAttributeRarity? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.StarGiftAttributeRarity.starGiftAttributeRarity(Cons_starGiftAttributeRarity(permille: _1!)) - } - else { - return nil - } - } - public static func parse_starGiftAttributeRarityEpic(_ reader: BufferReader) -> StarGiftAttributeRarity? { - return Api.StarGiftAttributeRarity.starGiftAttributeRarityEpic - } - public static func parse_starGiftAttributeRarityLegendary(_ reader: BufferReader) -> StarGiftAttributeRarity? { - return Api.StarGiftAttributeRarity.starGiftAttributeRarityLegendary - } - public static func parse_starGiftAttributeRarityRare(_ reader: BufferReader) -> StarGiftAttributeRarity? { - return Api.StarGiftAttributeRarity.starGiftAttributeRarityRare - } - public static func parse_starGiftAttributeRarityUncommon(_ reader: BufferReader) -> StarGiftAttributeRarity? { - return Api.StarGiftAttributeRarity.starGiftAttributeRarityUncommon - } - } -} -public extension Api { - enum StarGiftAuctionAcquiredGift: TypeConstructorDescription { - public class Cons_starGiftAuctionAcquiredGift: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionAcquiredGift", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date)), ("bidAmount", ConstructorParameterDescription(self.bidAmount)), ("round", ConstructorParameterDescription(self.round)), ("pos", ConstructorParameterDescription(self.pos)), ("message", ConstructorParameterDescription(self.message)), ("giftNum", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAuctionAcquiredGift(let _data): - return ("starGiftAuctionAcquiredGift", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date)), ("bidAmount", ConstructorParameterDescription(_data.bidAmount)), ("round", ConstructorParameterDescription(_data.round)), ("pos", ConstructorParameterDescription(_data.pos)), ("message", ConstructorParameterDescription(_data.message)), ("giftNum", ConstructorParameterDescription(_data.giftNum))]) - } - } - - public static func parse_starGiftAuctionAcquiredGift(_ reader: BufferReader) -> StarGiftAuctionAcquiredGift? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - _4 = reader.readInt64() - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - var _7: Api.TextWithEntities? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - } - var _8: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _8 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 { - public class Cons_starGiftAuctionRound: TypeConstructorDescription { - public var num: Int32 - public var duration: Int32 - public init(num: Int32, duration: Int32) { - self.num = num - self.duration = duration - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionRound", [("num", ConstructorParameterDescription(self.num)), ("duration", ConstructorParameterDescription(self.duration))]) - } - } - public class Cons_starGiftAuctionRoundExtendable: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionRoundExtendable", [("num", ConstructorParameterDescription(self.num)), ("duration", ConstructorParameterDescription(self.duration)), ("extendTop", ConstructorParameterDescription(self.extendTop)), ("extendWindow", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAuctionRound(let _data): - return ("starGiftAuctionRound", [("num", ConstructorParameterDescription(_data.num)), ("duration", ConstructorParameterDescription(_data.duration))]) - case .starGiftAuctionRoundExtendable(let _data): - return ("starGiftAuctionRoundExtendable", [("num", ConstructorParameterDescription(_data.num)), ("duration", ConstructorParameterDescription(_data.duration)), ("extendTop", ConstructorParameterDescription(_data.extendTop)), ("extendWindow", ConstructorParameterDescription(_data.extendWindow))]) - } - } - - public static func parse_starGiftAuctionRound(_ reader: BufferReader) -> StarGiftAuctionRound? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StarGiftAuctionRound.starGiftAuctionRound(Cons_starGiftAuctionRound(num: _1!, duration: _2!)) - } - else { - return nil - } - } - public static func parse_starGiftAuctionRoundExtendable(_ reader: BufferReader) -> StarGiftAuctionRound? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.StarGiftAuctionRound.starGiftAuctionRoundExtendable(Cons_starGiftAuctionRoundExtendable(num: _1!, duration: _2!, extendTop: _3!, extendWindow: _4!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StarGiftAuctionState: TypeConstructorDescription { - public class Cons_starGiftAuctionState: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionState", [("version", ConstructorParameterDescription(self.version)), ("startDate", ConstructorParameterDescription(self.startDate)), ("endDate", ConstructorParameterDescription(self.endDate)), ("minBidAmount", ConstructorParameterDescription(self.minBidAmount)), ("bidLevels", ConstructorParameterDescription(self.bidLevels)), ("topBidders", ConstructorParameterDescription(self.topBidders)), ("nextRoundAt", ConstructorParameterDescription(self.nextRoundAt)), ("lastGiftNum", ConstructorParameterDescription(self.lastGiftNum)), ("giftsLeft", ConstructorParameterDescription(self.giftsLeft)), ("currentRound", ConstructorParameterDescription(self.currentRound)), ("totalRounds", ConstructorParameterDescription(self.totalRounds)), ("rounds", ConstructorParameterDescription(self.rounds))]) - } - } - public class Cons_starGiftAuctionStateFinished: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionStateFinished", [("flags", ConstructorParameterDescription(self.flags)), ("startDate", ConstructorParameterDescription(self.startDate)), ("endDate", ConstructorParameterDescription(self.endDate)), ("averagePrice", ConstructorParameterDescription(self.averagePrice)), ("listedCount", ConstructorParameterDescription(self.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(self.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(self.fragmentListedUrl))]) - } - } - case starGiftAuctionState(Cons_starGiftAuctionState) - case starGiftAuctionStateFinished(Cons_starGiftAuctionStateFinished) - 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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAuctionState(let _data): - return ("starGiftAuctionState", [("version", ConstructorParameterDescription(_data.version)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("endDate", ConstructorParameterDescription(_data.endDate)), ("minBidAmount", ConstructorParameterDescription(_data.minBidAmount)), ("bidLevels", ConstructorParameterDescription(_data.bidLevels)), ("topBidders", ConstructorParameterDescription(_data.topBidders)), ("nextRoundAt", ConstructorParameterDescription(_data.nextRoundAt)), ("lastGiftNum", ConstructorParameterDescription(_data.lastGiftNum)), ("giftsLeft", ConstructorParameterDescription(_data.giftsLeft)), ("currentRound", ConstructorParameterDescription(_data.currentRound)), ("totalRounds", ConstructorParameterDescription(_data.totalRounds)), ("rounds", ConstructorParameterDescription(_data.rounds))]) - case .starGiftAuctionStateFinished(let _data): - return ("starGiftAuctionStateFinished", [("flags", ConstructorParameterDescription(_data.flags)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("endDate", ConstructorParameterDescription(_data.endDate)), ("averagePrice", ConstructorParameterDescription(_data.averagePrice)), ("listedCount", ConstructorParameterDescription(_data.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(_data.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(_data.fragmentListedUrl))]) - case .starGiftAuctionStateNotModified: - return ("starGiftAuctionStateNotModified", []) - } - } - - public static func parse_starGiftAuctionState(_ reader: BufferReader) -> StarGiftAuctionState? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - _4 = reader.readInt64() - var _5: [Api.AuctionBidLevel]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AuctionBidLevel.self) - } - var _6: [Int64]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - var _7: Int32? - _7 = reader.readInt32() - var _8: Int32? - _8 = reader.readInt32() - var _9: Int32? - _9 = reader.readInt32() - var _10: Int32? - _10 = reader.readInt32() - var _11: Int32? - _11 = reader.readInt32() - var _12: [Api.StarGiftAuctionRound]? - if let _ = reader.readInt32() { - _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAuctionRound.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = _10 != nil - 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(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 - } - } - public static func parse_starGiftAuctionStateFinished(_ reader: BufferReader) -> StarGiftAuctionState? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - _4 = reader.readInt64() - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _6 = reader.readInt32() - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _7 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.StarGiftAuctionState.starGiftAuctionStateFinished(Cons_starGiftAuctionStateFinished(flags: _1!, startDate: _2!, endDate: _3!, averagePrice: _4!, listedCount: _5, fragmentListedCount: _6, fragmentListedUrl: _7)) - } - else { - return nil - } - } - public static func parse_starGiftAuctionStateNotModified(_ reader: BufferReader) -> StarGiftAuctionState? { - return Api.StarGiftAuctionState.starGiftAuctionStateNotModified - } - } -} -public extension Api { - enum StarGiftAuctionUserState: TypeConstructorDescription { - public class Cons_starGiftAuctionUserState: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionUserState", [("flags", ConstructorParameterDescription(self.flags)), ("bidAmount", ConstructorParameterDescription(self.bidAmount)), ("bidDate", ConstructorParameterDescription(self.bidDate)), ("minBidAmount", ConstructorParameterDescription(self.minBidAmount)), ("bidPeer", ConstructorParameterDescription(self.bidPeer)), ("acquiredCount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAuctionUserState(let _data): - return ("starGiftAuctionUserState", [("flags", ConstructorParameterDescription(_data.flags)), ("bidAmount", ConstructorParameterDescription(_data.bidAmount)), ("bidDate", ConstructorParameterDescription(_data.bidDate)), ("minBidAmount", ConstructorParameterDescription(_data.minBidAmount)), ("bidPeer", ConstructorParameterDescription(_data.bidPeer)), ("acquiredCount", ConstructorParameterDescription(_data.acquiredCount))]) - } - } - - public static func parse_starGiftAuctionUserState(_ reader: BufferReader) -> StarGiftAuctionUserState? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt64() - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = reader.readInt64() - } - var _5: Api.Peer? - if Int(_1 ?? 0) & 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 - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_starGiftBackground: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftBackground", [("centerColor", ConstructorParameterDescription(self.centerColor)), ("edgeColor", ConstructorParameterDescription(self.edgeColor)), ("textColor", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftBackground(let _data): - return ("starGiftBackground", [("centerColor", ConstructorParameterDescription(_data.centerColor)), ("edgeColor", ConstructorParameterDescription(_data.edgeColor)), ("textColor", ConstructorParameterDescription(_data.textColor))]) - } - } - - public static func parse_starGiftBackground(_ reader: BufferReader) -> StarGiftBackground? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.StarGiftBackground.starGiftBackground(Cons_starGiftBackground(centerColor: _1!, edgeColor: _2!, textColor: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StarGiftCollection: TypeConstructorDescription { - public class Cons_starGiftCollection: TypeConstructorDescription { - 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.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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftCollection", [("flags", ConstructorParameterDescription(self.flags)), ("collectionId", ConstructorParameterDescription(self.collectionId)), ("title", ConstructorParameterDescription(self.title)), ("icon", ConstructorParameterDescription(self.icon)), ("giftsCount", ConstructorParameterDescription(self.giftsCount)), ("hash", ConstructorParameterDescription(self.hash))]) + return ("secureValue", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type)), ("data", ConstructorParameterDescription(self.data)), ("frontSide", ConstructorParameterDescription(self.frontSide)), ("reverseSide", ConstructorParameterDescription(self.reverseSide)), ("selfie", ConstructorParameterDescription(self.selfie)), ("translation", ConstructorParameterDescription(self.translation)), ("files", ConstructorParameterDescription(self.files)), ("plainData", ConstructorParameterDescription(self.plainData)), ("hash", ConstructorParameterDescription(self.hash))]) } } - case starGiftCollection(Cons_starGiftCollection) + case secureValue(Cons_secureValue) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starGiftCollection(let _data): + case .secureValue(let _data): if boxed { - buffer.appendInt32(-1653926992) + buffer.appendInt32(411017418) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt32(_data.collectionId, buffer: buffer, boxed: false) - serializeString(_data.title, buffer: buffer, boxed: false) + _data.type.serialize(buffer, true) if Int(_data.flags) & Int(1 << 0) != 0 { - _data.icon!.serialize(buffer, true) + _data.data!.serialize(buffer, true) } - serializeInt32(_data.giftsCount, buffer: buffer, boxed: false) - serializeInt64(_data.hash, buffer: buffer, boxed: false) + 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) + } + } + 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(_data.flags) & Int(1 << 5) != 0 { + _data.plainData!.serialize(buffer, true) + } + serializeBytes(_data.hash, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starGiftCollection(let _data): - return ("starGiftCollection", [("flags", ConstructorParameterDescription(_data.flags)), ("collectionId", ConstructorParameterDescription(_data.collectionId)), ("title", ConstructorParameterDescription(_data.title)), ("icon", ConstructorParameterDescription(_data.icon)), ("giftsCount", ConstructorParameterDescription(_data.giftsCount)), ("hash", ConstructorParameterDescription(_data.hash))]) + case .secureValue(let _data): + return ("secureValue", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type)), ("data", ConstructorParameterDescription(_data.data)), ("frontSide", ConstructorParameterDescription(_data.frontSide)), ("reverseSide", ConstructorParameterDescription(_data.reverseSide)), ("selfie", ConstructorParameterDescription(_data.selfie)), ("translation", ConstructorParameterDescription(_data.translation)), ("files", ConstructorParameterDescription(_data.files)), ("plainData", ConstructorParameterDescription(_data.plainData)), ("hash", ConstructorParameterDescription(_data.hash))]) } } - public static func parse_starGiftCollection(_ reader: BufferReader) -> StarGiftCollection? { + public static func parse_secureValue(_ reader: BufferReader) -> SecureValue? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - var _4: Api.Document? + var _2: Api.SecureValueType? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _3: Api.SecureData? if Int(_1 ?? 0) & Int(1 << 0) != 0 { if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Document + _3 = Api.parse(reader, signature: signature) as? Api.SecureData } } - var _5: Int32? - _5 = reader.readInt32() - var _6: Int64? - _6 = reader.readInt64() + var _4: Api.SecureFile? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.StarGiftCollection.starGiftCollection(Cons_starGiftCollection(flags: _1!, collectionId: _2!, title: _3!, icon: _4, giftsCount: _5!, hash: _6!)) + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & 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(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 @@ -2082,48 +451,470 @@ public extension Api { } } public extension Api { - enum StarGiftUpgradePrice: TypeConstructorDescription { - public class Cons_starGiftUpgradePrice: TypeConstructorDescription { - public var date: Int32 - public var upgradeStars: Int64 - public init(date: Int32, upgradeStars: Int64) { - self.date = date - self.upgradeStars = upgradeStars + enum SecureValueError: TypeConstructorDescription { + public class Cons_secureValueError: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftUpgradePrice", [("date", ConstructorParameterDescription(self.date)), ("upgradeStars", ConstructorParameterDescription(self.upgradeStars))]) + return ("secureValueError", [("type", ConstructorParameterDescription(self.type)), ("hash", ConstructorParameterDescription(self.hash)), ("text", ConstructorParameterDescription(self.text))]) } } - case starGiftUpgradePrice(Cons_starGiftUpgradePrice) + public class Cons_secureValueErrorData: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorData", [("type", ConstructorParameterDescription(self.type)), ("dataHash", ConstructorParameterDescription(self.dataHash)), ("field", ConstructorParameterDescription(self.field)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_secureValueErrorFile: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorFile", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_secureValueErrorFiles: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorFiles", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_secureValueErrorFrontSide: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorFrontSide", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_secureValueErrorReverseSide: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorReverseSide", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_secureValueErrorSelfie: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorSelfie", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_secureValueErrorTranslationFile: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorTranslationFile", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_secureValueErrorTranslationFiles: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorTranslationFiles", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.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 .starGiftUpgradePrice(let _data): + case .secureValueError(let _data): if boxed { - buffer.appendInt32(-1712704739) + buffer.appendInt32(-2036501105) } - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt64(_data.upgradeStars, buffer: buffer, boxed: false) + _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, ConstructorParameterDescription)]) { switch self { - case .starGiftUpgradePrice(let _data): - return ("starGiftUpgradePrice", [("date", ConstructorParameterDescription(_data.date)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars))]) + case .secureValueError(let _data): + return ("secureValueError", [("type", ConstructorParameterDescription(_data.type)), ("hash", ConstructorParameterDescription(_data.hash)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorData(let _data): + return ("secureValueErrorData", [("type", ConstructorParameterDescription(_data.type)), ("dataHash", ConstructorParameterDescription(_data.dataHash)), ("field", ConstructorParameterDescription(_data.field)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorFile(let _data): + return ("secureValueErrorFile", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorFiles(let _data): + return ("secureValueErrorFiles", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorFrontSide(let _data): + return ("secureValueErrorFrontSide", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorReverseSide(let _data): + return ("secureValueErrorReverseSide", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorSelfie(let _data): + return ("secureValueErrorSelfie", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorTranslationFile(let _data): + return ("secureValueErrorTranslationFile", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) + case .secureValueErrorTranslationFiles(let _data): + return ("secureValueErrorTranslationFiles", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) } } - public static func parse_starGiftUpgradePrice(_ reader: BufferReader) -> StarGiftUpgradePrice? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() + public static func parse_secureValueError(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueError(Cons_secureValueError(type: _1!, hash: _2!, text: _3!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorData(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.SecureValueError.secureValueErrorData(Cons_secureValueErrorData(type: _1!, dataHash: _2!, field: _3!, text: _4!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorFile(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueErrorFile(Cons_secureValueErrorFile(type: _1!, fileHash: _2!, text: _3!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorFiles(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: [Buffer]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueErrorFiles(Cons_secureValueErrorFiles(type: _1!, fileHash: _2!, text: _3!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorFrontSide(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueErrorFrontSide(Cons_secureValueErrorFrontSide(type: _1!, fileHash: _2!, text: _3!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorReverseSide(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueErrorReverseSide(Cons_secureValueErrorReverseSide(type: _1!, fileHash: _2!, text: _3!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorSelfie(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueErrorSelfie(Cons_secureValueErrorSelfie(type: _1!, fileHash: _2!, text: _3!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorTranslationFile(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueErrorTranslationFile(Cons_secureValueErrorTranslationFile(type: _1!, fileHash: _2!, text: _3!)) + } + else { + return nil + } + } + public static func parse_secureValueErrorTranslationFiles(_ reader: BufferReader) -> SecureValueError? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: [Buffer]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SecureValueError.secureValueErrorTranslationFiles(Cons_secureValueErrorTranslationFiles(type: _1!, fileHash: _2!, text: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SecureValueHash: TypeConstructorDescription { + public class Cons_secureValueHash: TypeConstructorDescription { + public var type: Api.SecureValueType + public var hash: Buffer + public init(type: Api.SecureValueType, hash: Buffer) { + self.type = type + self.hash = hash + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueHash", [("type", ConstructorParameterDescription(self.type)), ("hash", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .secureValueHash(let _data): + return ("secureValueHash", [("type", ConstructorParameterDescription(_data.type)), ("hash", ConstructorParameterDescription(_data.hash))]) + } + } + + public static func parse_secureValueHash(_ reader: BufferReader) -> SecureValueHash? { + var _1: Api.SecureValueType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.SecureValueType + } + var _2: Buffer? + _2 = parseBytes(reader) let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StarGiftUpgradePrice.starGiftUpgradePrice(Cons_starGiftUpgradePrice(date: _1!, upgradeStars: _2!)) + return Api.SecureValueHash.secureValueHash(Cons_secureValueHash(type: _1!, hash: _2!)) } else { return nil @@ -2132,45 +923,86 @@ public extension Api { } } public extension Api { - enum StarRefProgram: TypeConstructorDescription { - public class Cons_starRefProgram: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starRefProgram", [("flags", ConstructorParameterDescription(self.flags)), ("botId", ConstructorParameterDescription(self.botId)), ("commissionPermille", ConstructorParameterDescription(self.commissionPermille)), ("durationMonths", ConstructorParameterDescription(self.durationMonths)), ("endDate", ConstructorParameterDescription(self.endDate)), ("dailyRevenuePerUser", ConstructorParameterDescription(self.dailyRevenuePerUser))]) - } - } - case starRefProgram(Cons_starRefProgram) + enum SecureValueType: TypeConstructorDescription { + case secureValueTypeAddress + case secureValueTypeBankStatement + case secureValueTypeDriverLicense + case secureValueTypeEmail + case secureValueTypeIdentityCard + case secureValueTypeInternalPassport + case secureValueTypePassport + case secureValueTypePassportRegistration + case secureValueTypePersonalDetails + case secureValueTypePhone + case secureValueTypeRentalAgreement + case secureValueTypeTemporaryRegistration + case secureValueTypeUtilityBill public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starRefProgram(let _data): + case .secureValueTypeAddress: if boxed { - buffer.appendInt32(-586389774) + buffer.appendInt32(-874308058) } - 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) + break + case .secureValueTypeBankStatement: + if boxed { + buffer.appendInt32(-1995211763) } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.endDate!, buffer: buffer, boxed: false) + break + case .secureValueTypeDriverLicense: + if boxed { + buffer.appendInt32(115615172) } - if Int(_data.flags) & Int(1 << 2) != 0 { - _data.dailyRevenuePerUser!.serialize(buffer, true) + 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 } @@ -2178,44 +1010,73 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starRefProgram(let _data): - return ("starRefProgram", [("flags", ConstructorParameterDescription(_data.flags)), ("botId", ConstructorParameterDescription(_data.botId)), ("commissionPermille", ConstructorParameterDescription(_data.commissionPermille)), ("durationMonths", ConstructorParameterDescription(_data.durationMonths)), ("endDate", ConstructorParameterDescription(_data.endDate)), ("dailyRevenuePerUser", ConstructorParameterDescription(_data.dailyRevenuePerUser))]) + case .secureValueTypeAddress: + return ("secureValueTypeAddress", []) + case .secureValueTypeBankStatement: + return ("secureValueTypeBankStatement", []) + case .secureValueTypeDriverLicense: + return ("secureValueTypeDriverLicense", []) + case .secureValueTypeEmail: + return ("secureValueTypeEmail", []) + case .secureValueTypeIdentityCard: + return ("secureValueTypeIdentityCard", []) + case .secureValueTypeInternalPassport: + return ("secureValueTypeInternalPassport", []) + case .secureValueTypePassport: + return ("secureValueTypePassport", []) + case .secureValueTypePassportRegistration: + return ("secureValueTypePassportRegistration", []) + case .secureValueTypePersonalDetails: + return ("secureValueTypePersonalDetails", []) + case .secureValueTypePhone: + return ("secureValueTypePhone", []) + case .secureValueTypeRentalAgreement: + return ("secureValueTypeRentalAgreement", []) + case .secureValueTypeTemporaryRegistration: + return ("secureValueTypeTemporaryRegistration", []) + case .secureValueTypeUtilityBill: + return ("secureValueTypeUtilityBill", []) } } - public static func parse_starRefProgram(_ reader: BufferReader) -> StarRefProgram? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = reader.readInt32() - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = reader.readInt32() - } - var _6: Api.StarsAmount? - if Int(_1 ?? 0) & 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 - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.StarRefProgram.starRefProgram(Cons_starRefProgram(flags: _1!, botId: _2!, commissionPermille: _3!, durationMonths: _4, endDate: _5, dailyRevenuePerUser: _6)) - } - else { - return nil - } + public static func parse_secureValueTypeAddress(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeAddress + } + public static func parse_secureValueTypeBankStatement(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeBankStatement + } + public static func parse_secureValueTypeDriverLicense(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeDriverLicense + } + public static func parse_secureValueTypeEmail(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeEmail + } + public static func parse_secureValueTypeIdentityCard(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeIdentityCard + } + public static func parse_secureValueTypeInternalPassport(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeInternalPassport + } + public static func parse_secureValueTypePassport(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypePassport + } + public static func parse_secureValueTypePassportRegistration(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypePassportRegistration + } + public static func parse_secureValueTypePersonalDetails(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypePersonalDetails + } + public static func parse_secureValueTypePhone(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypePhone + } + public static func parse_secureValueTypeRentalAgreement(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeRentalAgreement + } + public static func parse_secureValueTypeTemporaryRegistration(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeTemporaryRegistration + } + public static func parse_secureValueTypeUtilityBill(_ reader: BufferReader) -> SecureValueType? { + return Api.SecureValueType.secureValueTypeUtilityBill } } } diff --git a/submodules/TelegramApi/Sources/Api26.swift b/submodules/TelegramApi/Sources/Api26.swift index 0fa1dcfe1c..8d71310c89 100644 --- a/submodules/TelegramApi/Sources/Api26.swift +++ b/submodules/TelegramApi/Sources/Api26.swift @@ -1,75 +1,48 @@ public extension Api { - enum StarsAmount: TypeConstructorDescription { - public class Cons_starsAmount: TypeConstructorDescription { - public var amount: Int64 - public var nanos: Int32 - public init(amount: Int64, nanos: Int32) { - self.amount = amount - self.nanos = nanos + enum SendAsPeer: TypeConstructorDescription { + public class Cons_sendAsPeer: TypeConstructorDescription { + public var flags: Int32 + public var peer: Api.Peer + public init(flags: Int32, peer: Api.Peer) { + self.flags = flags + self.peer = peer } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsAmount", [("amount", ConstructorParameterDescription(self.amount)), ("nanos", ConstructorParameterDescription(self.nanos))]) + return ("sendAsPeer", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer))]) } } - public class Cons_starsTonAmount: TypeConstructorDescription { - public var amount: Int64 - public init(amount: Int64) { - self.amount = amount - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsTonAmount", [("amount", ConstructorParameterDescription(self.amount))]) - } - } - case starsAmount(Cons_starsAmount) - case starsTonAmount(Cons_starsTonAmount) + case sendAsPeer(Cons_sendAsPeer) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starsAmount(let _data): + case .sendAsPeer(let _data): if boxed { - buffer.appendInt32(-1145654109) + buffer.appendInt32(-1206095820) } - 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) + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starsAmount(let _data): - return ("starsAmount", [("amount", ConstructorParameterDescription(_data.amount)), ("nanos", ConstructorParameterDescription(_data.nanos))]) - case .starsTonAmount(let _data): - return ("starsTonAmount", [("amount", ConstructorParameterDescription(_data.amount))]) + case .sendAsPeer(let _data): + return ("sendAsPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer))]) } } - public static func parse_starsAmount(_ reader: BufferReader) -> StarsAmount? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() + public static func parse_sendAsPeer(_ reader: BufferReader) -> SendAsPeer? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StarsAmount.starsAmount(Cons_starsAmount(amount: _1!, nanos: _2!)) - } - else { - return nil - } - } - public static func parse_starsTonAmount(_ reader: BufferReader) -> StarsAmount? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.StarsAmount.starsTonAmount(Cons_starsTonAmount(amount: _1!)) + return Api.SendAsPeer.sendAsPeer(Cons_sendAsPeer(flags: _1!, peer: _2!)) } else { return nil @@ -78,119 +51,441 @@ public extension Api { } } public extension Api { - enum StarsGiftOption: TypeConstructorDescription { - public class Cons_starsGiftOption: TypeConstructorDescription { - 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 + enum SendMessageAction: TypeConstructorDescription { + public class Cons_sendMessageEmojiInteraction: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsGiftOption", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) + return ("sendMessageEmojiInteraction", [("emoticon", ConstructorParameterDescription(self.emoticon)), ("msgId", ConstructorParameterDescription(self.msgId)), ("interaction", ConstructorParameterDescription(self.interaction))]) } } - case starsGiftOption(Cons_starsGiftOption) + public class Cons_sendMessageEmojiInteractionSeen: TypeConstructorDescription { + public var emoticon: String + public init(emoticon: String) { + self.emoticon = emoticon + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageEmojiInteractionSeen", [("emoticon", ConstructorParameterDescription(self.emoticon))]) + } + } + public class Cons_sendMessageHistoryImportAction: TypeConstructorDescription { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageHistoryImportAction", [("progress", ConstructorParameterDescription(self.progress))]) + } + } + public class Cons_sendMessageTextDraftAction: TypeConstructorDescription { + public var randomId: Int64 + public var text: Api.TextWithEntities + public init(randomId: Int64, text: Api.TextWithEntities) { + self.randomId = randomId + self.text = text + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageTextDraftAction", [("randomId", ConstructorParameterDescription(self.randomId)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_sendMessageUploadAudioAction: TypeConstructorDescription { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageUploadAudioAction", [("progress", ConstructorParameterDescription(self.progress))]) + } + } + public class Cons_sendMessageUploadDocumentAction: TypeConstructorDescription { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageUploadDocumentAction", [("progress", ConstructorParameterDescription(self.progress))]) + } + } + public class Cons_sendMessageUploadPhotoAction: TypeConstructorDescription { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageUploadPhotoAction", [("progress", ConstructorParameterDescription(self.progress))]) + } + } + public class Cons_sendMessageUploadRoundAction: TypeConstructorDescription { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageUploadRoundAction", [("progress", ConstructorParameterDescription(self.progress))]) + } + } + public class Cons_sendMessageUploadVideoAction: TypeConstructorDescription { + public var progress: Int32 + public init(progress: Int32) { + self.progress = progress + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageUploadVideoAction", [("progress", ConstructorParameterDescription(self.progress))]) + } + } + case sendMessageCancelAction + case sendMessageChooseContactAction + case sendMessageChooseStickerAction + case sendMessageEmojiInteraction(Cons_sendMessageEmojiInteraction) + case sendMessageEmojiInteractionSeen(Cons_sendMessageEmojiInteractionSeen) + case sendMessageGamePlayAction + case sendMessageGeoLocationAction + case sendMessageHistoryImportAction(Cons_sendMessageHistoryImportAction) + case sendMessageRecordAudioAction + case sendMessageRecordRoundAction + case sendMessageRecordVideoAction + case sendMessageTextDraftAction(Cons_sendMessageTextDraftAction) + case sendMessageTypingAction + 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 .starsGiftOption(let _data): + case .sendMessageCancelAction: if boxed { - buffer.appendInt32(1577421297) + buffer.appendInt32(-44119819) } - 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) + 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) } - serializeString(_data.currency, buffer: buffer, boxed: false) - serializeInt64(_data.amount, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starsGiftOption(let _data): - return ("starsGiftOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + case .sendMessageCancelAction: + return ("sendMessageCancelAction", []) + case .sendMessageChooseContactAction: + return ("sendMessageChooseContactAction", []) + case .sendMessageChooseStickerAction: + return ("sendMessageChooseStickerAction", []) + case .sendMessageEmojiInteraction(let _data): + return ("sendMessageEmojiInteraction", [("emoticon", ConstructorParameterDescription(_data.emoticon)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("interaction", ConstructorParameterDescription(_data.interaction))]) + case .sendMessageEmojiInteractionSeen(let _data): + return ("sendMessageEmojiInteractionSeen", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) + case .sendMessageGamePlayAction: + return ("sendMessageGamePlayAction", []) + case .sendMessageGeoLocationAction: + return ("sendMessageGeoLocationAction", []) + case .sendMessageHistoryImportAction(let _data): + return ("sendMessageHistoryImportAction", [("progress", ConstructorParameterDescription(_data.progress))]) + case .sendMessageRecordAudioAction: + return ("sendMessageRecordAudioAction", []) + case .sendMessageRecordRoundAction: + return ("sendMessageRecordRoundAction", []) + case .sendMessageRecordVideoAction: + return ("sendMessageRecordVideoAction", []) + case .sendMessageTextDraftAction(let _data): + return ("sendMessageTextDraftAction", [("randomId", ConstructorParameterDescription(_data.randomId)), ("text", ConstructorParameterDescription(_data.text))]) + case .sendMessageTypingAction: + return ("sendMessageTypingAction", []) + case .sendMessageUploadAudioAction(let _data): + return ("sendMessageUploadAudioAction", [("progress", ConstructorParameterDescription(_data.progress))]) + case .sendMessageUploadDocumentAction(let _data): + return ("sendMessageUploadDocumentAction", [("progress", ConstructorParameterDescription(_data.progress))]) + case .sendMessageUploadPhotoAction(let _data): + return ("sendMessageUploadPhotoAction", [("progress", ConstructorParameterDescription(_data.progress))]) + case .sendMessageUploadRoundAction(let _data): + return ("sendMessageUploadRoundAction", [("progress", ConstructorParameterDescription(_data.progress))]) + case .sendMessageUploadVideoAction(let _data): + return ("sendMessageUploadVideoAction", [("progress", ConstructorParameterDescription(_data.progress))]) + case .speakingInGroupCallAction: + return ("speakingInGroupCallAction", []) } } - 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 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) + public static func parse_sendMessageCancelAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageCancelAction + } + public static func parse_sendMessageChooseContactAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageChooseContactAction + } + public static func parse_sendMessageChooseStickerAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageChooseStickerAction + } + public static func parse_sendMessageEmojiInteraction(_ reader: BufferReader) -> SendMessageAction? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.DataJSON? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.DataJSON } - var _4: String? - _4 = parseString(reader) - var _5: Int64? - _5 = reader.readInt64() let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarsGiftOption.starsGiftOption(Cons_starsGiftOption(flags: _1!, stars: _2!, storeProduct: _3, currency: _4!, amount: _5!)) + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SendMessageAction.sendMessageEmojiInteraction(Cons_sendMessageEmojiInteraction(emoticon: _1!, msgId: _2!, interaction: _3!)) } else { return nil } } + public static func parse_sendMessageEmojiInteractionSeen(_ reader: BufferReader) -> SendMessageAction? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.SendMessageAction.sendMessageEmojiInteractionSeen(Cons_sendMessageEmojiInteractionSeen(emoticon: _1!)) + } + else { + return nil + } + } + public static func parse_sendMessageGamePlayAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageGamePlayAction + } + public static func parse_sendMessageGeoLocationAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageGeoLocationAction + } + public static func parse_sendMessageHistoryImportAction(_ reader: BufferReader) -> SendMessageAction? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.SendMessageAction.sendMessageHistoryImportAction(Cons_sendMessageHistoryImportAction(progress: _1!)) + } + else { + return nil + } + } + public static func parse_sendMessageRecordAudioAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageRecordAudioAction + } + public static func parse_sendMessageRecordRoundAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageRecordRoundAction + } + public static func parse_sendMessageRecordVideoAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageRecordVideoAction + } + public static func parse_sendMessageTextDraftAction(_ reader: BufferReader) -> SendMessageAction? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.SendMessageAction.sendMessageTextDraftAction(Cons_sendMessageTextDraftAction(randomId: _1!, text: _2!)) + } + else { + return nil + } + } + public static func parse_sendMessageTypingAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.sendMessageTypingAction + } + public static func parse_sendMessageUploadAudioAction(_ reader: BufferReader) -> SendMessageAction? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.SendMessageAction.sendMessageUploadAudioAction(Cons_sendMessageUploadAudioAction(progress: _1!)) + } + else { + return nil + } + } + public static func parse_sendMessageUploadDocumentAction(_ reader: BufferReader) -> SendMessageAction? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.SendMessageAction.sendMessageUploadDocumentAction(Cons_sendMessageUploadDocumentAction(progress: _1!)) + } + else { + return nil + } + } + public static func parse_sendMessageUploadPhotoAction(_ reader: BufferReader) -> SendMessageAction? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.SendMessageAction.sendMessageUploadPhotoAction(Cons_sendMessageUploadPhotoAction(progress: _1!)) + } + else { + return nil + } + } + public static func parse_sendMessageUploadRoundAction(_ reader: BufferReader) -> SendMessageAction? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.SendMessageAction.sendMessageUploadRoundAction(Cons_sendMessageUploadRoundAction(progress: _1!)) + } + else { + return nil + } + } + public static func parse_sendMessageUploadVideoAction(_ reader: BufferReader) -> SendMessageAction? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.SendMessageAction.sendMessageUploadVideoAction(Cons_sendMessageUploadVideoAction(progress: _1!)) + } + else { + return nil + } + } + public static func parse_speakingInGroupCallAction(_ reader: BufferReader) -> SendMessageAction? { + return Api.SendMessageAction.speakingInGroupCallAction + } } } public extension Api { - enum StarsGiveawayOption: TypeConstructorDescription { - public class Cons_starsGiveawayOption: TypeConstructorDescription { - 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 + enum ShippingOption: TypeConstructorDescription { + public class Cons_shippingOption: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsGiveawayOption", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("yearlyBoosts", ConstructorParameterDescription(self.yearlyBoosts)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("winners", ConstructorParameterDescription(self.winners))]) + return ("shippingOption", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title)), ("prices", ConstructorParameterDescription(self.prices))]) } } - case starsGiveawayOption(Cons_starsGiveawayOption) + case shippingOption(Cons_shippingOption) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starsGiveawayOption(let _data): + case .shippingOption(let _data): if boxed { - buffer.appendInt32(-1798404822) + buffer.appendInt32(-1239335713) } - 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) + serializeString(_data.id, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.winners.count)) - for item in _data.winners { + buffer.appendInt32(Int32(_data.prices.count)) + for item in _data.prices { item.serialize(buffer, true) } break @@ -199,95 +494,25 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starsGiveawayOption(let _data): - return ("starsGiveawayOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("yearlyBoosts", ConstructorParameterDescription(_data.yearlyBoosts)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("winners", ConstructorParameterDescription(_data.winners))]) + case .shippingOption(let _data): + return ("shippingOption", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title)), ("prices", ConstructorParameterDescription(_data.prices))]) } } - public static func parse_starsGiveawayOption(_ reader: BufferReader) -> StarsGiveawayOption? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = parseString(reader) - } - var _5: String? - _5 = parseString(reader) - var _6: Int64? - _6 = reader.readInt64() - var _7: [Api.StarsGiveawayWinnersOption]? + public static func parse_shippingOption(_ reader: BufferReader) -> ShippingOption? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: [Api.LabeledPrice]? if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiveawayWinnersOption.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.LabeledPrice.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - 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 { - public class Cons_starsGiveawayWinnersOption: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsGiveawayWinnersOption", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("perUserStars", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starsGiveawayWinnersOption(let _data): - return ("starsGiveawayWinnersOption", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("perUserStars", ConstructorParameterDescription(_data.perUserStars))]) - } - } - - public static func parse_starsGiveawayWinnersOption(_ reader: BufferReader) -> StarsGiveawayWinnersOption? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.StarsGiveawayWinnersOption.starsGiveawayWinnersOption(Cons_starsGiveawayWinnersOption(flags: _1!, users: _2!, perUserStars: _3!)) + return Api.ShippingOption.shippingOption(Cons_shippingOption(id: _1!, title: _2!, prices: _3!)) } else { return nil @@ -296,38 +521,139 @@ public extension Api { } } public extension Api { - enum StarsRating: TypeConstructorDescription { - public class Cons_starsRating: TypeConstructorDescription { - 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 + enum SmsJob: TypeConstructorDescription { + public class Cons_smsJob: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsRating", [("flags", ConstructorParameterDescription(self.flags)), ("level", ConstructorParameterDescription(self.level)), ("currentLevelStars", ConstructorParameterDescription(self.currentLevelStars)), ("stars", ConstructorParameterDescription(self.stars)), ("nextLevelStars", ConstructorParameterDescription(self.nextLevelStars))]) + return ("smsJob", [("jobId", ConstructorParameterDescription(self.jobId)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("text", ConstructorParameterDescription(self.text))]) } } - case starsRating(Cons_starsRating) + case smsJob(Cons_smsJob) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starsRating(let _data): + case .smsJob(let _data): if boxed { - buffer.appendInt32(453922567) + 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, ConstructorParameterDescription)]) { + switch self { + case .smsJob(let _data): + return ("smsJob", [("jobId", ConstructorParameterDescription(_data.jobId)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("text", ConstructorParameterDescription(_data.text))]) + } + } + + public static func parse_smsJob(_ reader: BufferReader) -> SmsJob? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.SmsJob.smsJob(Cons_smsJob(jobId: _1!, phoneNumber: _2!, text: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum SponsoredMessage: TypeConstructorDescription { + public class Cons_sponsoredMessage: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sponsoredMessage", [("flags", ConstructorParameterDescription(self.flags)), ("randomId", ConstructorParameterDescription(self.randomId)), ("url", ConstructorParameterDescription(self.url)), ("title", ConstructorParameterDescription(self.title)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("photo", ConstructorParameterDescription(self.photo)), ("media", ConstructorParameterDescription(self.media)), ("color", ConstructorParameterDescription(self.color)), ("buttonText", ConstructorParameterDescription(self.buttonText)), ("sponsorInfo", ConstructorParameterDescription(self.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(self.additionalInfo)), ("minDisplayDuration", ConstructorParameterDescription(self.minDisplayDuration)), ("maxDisplayDuration", ConstructorParameterDescription(self.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) - 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) + 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(_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 } @@ -335,109 +661,691 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starsRating(let _data): - return ("starsRating", [("flags", ConstructorParameterDescription(_data.flags)), ("level", ConstructorParameterDescription(_data.level)), ("currentLevelStars", ConstructorParameterDescription(_data.currentLevelStars)), ("stars", ConstructorParameterDescription(_data.stars)), ("nextLevelStars", ConstructorParameterDescription(_data.nextLevelStars))]) + case .sponsoredMessage(let _data): + return ("sponsoredMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("url", ConstructorParameterDescription(_data.url)), ("title", ConstructorParameterDescription(_data.title)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("photo", ConstructorParameterDescription(_data.photo)), ("media", ConstructorParameterDescription(_data.media)), ("color", ConstructorParameterDescription(_data.color)), ("buttonText", ConstructorParameterDescription(_data.buttonText)), ("sponsorInfo", ConstructorParameterDescription(_data.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(_data.additionalInfo)), ("minDisplayDuration", ConstructorParameterDescription(_data.minDisplayDuration)), ("maxDisplayDuration", ConstructorParameterDescription(_data.maxDisplayDuration))]) } } - public static func parse_starsRating(_ reader: BufferReader) -> StarsRating? { + public static func parse_sponsoredMessage(_ reader: BufferReader) -> SponsoredMessage? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() + var _2: Buffer? + _2 = parseBytes(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: [Api.MessageEntity]? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { + _11 = parseString(reader) + } + var _12: String? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _12 = parseString(reader) + } + var _13: Int32? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + _13 = reader.readInt32() + } + var _14: Int32? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + _14 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _9 != nil + let _c10 = _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & 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(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 { + public class Cons_sponsoredMessageReportOption: TypeConstructorDescription { + public var text: String + public var option: Buffer + public init(text: String, option: Buffer) { + self.text = text + self.option = option + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sponsoredMessageReportOption", [("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .sponsoredMessageReportOption(let _data): + return ("sponsoredMessageReportOption", [("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option))]) + } + } + + public static func parse_sponsoredMessageReportOption(_ reader: BufferReader) -> SponsoredMessageReportOption? { + var _1: String? + _1 = parseString(reader) + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.SponsoredMessageReportOption.sponsoredMessageReportOption(Cons_sponsoredMessageReportOption(text: _1!, option: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SponsoredPeer: TypeConstructorDescription { + public class Cons_sponsoredPeer: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sponsoredPeer", [("flags", ConstructorParameterDescription(self.flags)), ("randomId", ConstructorParameterDescription(self.randomId)), ("peer", ConstructorParameterDescription(self.peer)), ("sponsorInfo", ConstructorParameterDescription(self.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .sponsoredPeer(let _data): + return ("sponsoredPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("peer", ConstructorParameterDescription(_data.peer)), ("sponsorInfo", ConstructorParameterDescription(_data.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(_data.additionalInfo))]) + } + } + + public static func parse_sponsoredPeer(_ reader: BufferReader) -> SponsoredPeer? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Api.Peer? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_starGift: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGift", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("sticker", ConstructorParameterDescription(self.sticker)), ("stars", ConstructorParameterDescription(self.stars)), ("availabilityRemains", ConstructorParameterDescription(self.availabilityRemains)), ("availabilityTotal", ConstructorParameterDescription(self.availabilityTotal)), ("availabilityResale", ConstructorParameterDescription(self.availabilityResale)), ("convertStars", ConstructorParameterDescription(self.convertStars)), ("firstSaleDate", ConstructorParameterDescription(self.firstSaleDate)), ("lastSaleDate", ConstructorParameterDescription(self.lastSaleDate)), ("upgradeStars", ConstructorParameterDescription(self.upgradeStars)), ("resellMinStars", ConstructorParameterDescription(self.resellMinStars)), ("title", ConstructorParameterDescription(self.title)), ("releasedBy", ConstructorParameterDescription(self.releasedBy)), ("perUserTotal", ConstructorParameterDescription(self.perUserTotal)), ("perUserRemains", ConstructorParameterDescription(self.perUserRemains)), ("lockedUntilDate", ConstructorParameterDescription(self.lockedUntilDate)), ("auctionSlug", ConstructorParameterDescription(self.auctionSlug)), ("giftsPerRound", ConstructorParameterDescription(self.giftsPerRound)), ("auctionStartDate", ConstructorParameterDescription(self.auctionStartDate)), ("upgradeVariants", ConstructorParameterDescription(self.upgradeVariants)), ("background", ConstructorParameterDescription(self.background))]) + } + } + public class Cons_starGiftUnique: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftUnique", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("giftId", ConstructorParameterDescription(self.giftId)), ("title", ConstructorParameterDescription(self.title)), ("slug", ConstructorParameterDescription(self.slug)), ("num", ConstructorParameterDescription(self.num)), ("ownerId", ConstructorParameterDescription(self.ownerId)), ("ownerName", ConstructorParameterDescription(self.ownerName)), ("ownerAddress", ConstructorParameterDescription(self.ownerAddress)), ("attributes", ConstructorParameterDescription(self.attributes)), ("availabilityIssued", ConstructorParameterDescription(self.availabilityIssued)), ("availabilityTotal", ConstructorParameterDescription(self.availabilityTotal)), ("giftAddress", ConstructorParameterDescription(self.giftAddress)), ("resellAmount", ConstructorParameterDescription(self.resellAmount)), ("releasedBy", ConstructorParameterDescription(self.releasedBy)), ("valueAmount", ConstructorParameterDescription(self.valueAmount)), ("valueCurrency", ConstructorParameterDescription(self.valueCurrency)), ("valueUsdAmount", ConstructorParameterDescription(self.valueUsdAmount)), ("themePeer", ConstructorParameterDescription(self.themePeer)), ("peerColor", ConstructorParameterDescription(self.peerColor)), ("hostId", ConstructorParameterDescription(self.hostId)), ("offerMinStars", ConstructorParameterDescription(self.offerMinStars)), ("craftChancePermille", ConstructorParameterDescription(self.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(_data.resellAmount!.count)) + for item in _data.resellAmount! { + item.serialize(buffer, true) + } + } + 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, ConstructorParameterDescription)]) { + switch self { + case .starGift(let _data): + return ("starGift", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("sticker", ConstructorParameterDescription(_data.sticker)), ("stars", ConstructorParameterDescription(_data.stars)), ("availabilityRemains", ConstructorParameterDescription(_data.availabilityRemains)), ("availabilityTotal", ConstructorParameterDescription(_data.availabilityTotal)), ("availabilityResale", ConstructorParameterDescription(_data.availabilityResale)), ("convertStars", ConstructorParameterDescription(_data.convertStars)), ("firstSaleDate", ConstructorParameterDescription(_data.firstSaleDate)), ("lastSaleDate", ConstructorParameterDescription(_data.lastSaleDate)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars)), ("resellMinStars", ConstructorParameterDescription(_data.resellMinStars)), ("title", ConstructorParameterDescription(_data.title)), ("releasedBy", ConstructorParameterDescription(_data.releasedBy)), ("perUserTotal", ConstructorParameterDescription(_data.perUserTotal)), ("perUserRemains", ConstructorParameterDescription(_data.perUserRemains)), ("lockedUntilDate", ConstructorParameterDescription(_data.lockedUntilDate)), ("auctionSlug", ConstructorParameterDescription(_data.auctionSlug)), ("giftsPerRound", ConstructorParameterDescription(_data.giftsPerRound)), ("auctionStartDate", ConstructorParameterDescription(_data.auctionStartDate)), ("upgradeVariants", ConstructorParameterDescription(_data.upgradeVariants)), ("background", ConstructorParameterDescription(_data.background))]) + case .starGiftUnique(let _data): + return ("starGiftUnique", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("giftId", ConstructorParameterDescription(_data.giftId)), ("title", ConstructorParameterDescription(_data.title)), ("slug", ConstructorParameterDescription(_data.slug)), ("num", ConstructorParameterDescription(_data.num)), ("ownerId", ConstructorParameterDescription(_data.ownerId)), ("ownerName", ConstructorParameterDescription(_data.ownerName)), ("ownerAddress", ConstructorParameterDescription(_data.ownerAddress)), ("attributes", ConstructorParameterDescription(_data.attributes)), ("availabilityIssued", ConstructorParameterDescription(_data.availabilityIssued)), ("availabilityTotal", ConstructorParameterDescription(_data.availabilityTotal)), ("giftAddress", ConstructorParameterDescription(_data.giftAddress)), ("resellAmount", ConstructorParameterDescription(_data.resellAmount)), ("releasedBy", ConstructorParameterDescription(_data.releasedBy)), ("valueAmount", ConstructorParameterDescription(_data.valueAmount)), ("valueCurrency", ConstructorParameterDescription(_data.valueCurrency)), ("valueUsdAmount", ConstructorParameterDescription(_data.valueUsdAmount)), ("themePeer", ConstructorParameterDescription(_data.themePeer)), ("peerColor", ConstructorParameterDescription(_data.peerColor)), ("hostId", ConstructorParameterDescription(_data.hostId)), ("offerMinStars", ConstructorParameterDescription(_data.offerMinStars)), ("craftChancePermille", ConstructorParameterDescription(_data.craftChancePermille))]) + } + } + + public static func parse_starGift(_ reader: BufferReader) -> StarGift? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.Document? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Document + } var _4: Int64? _4 = reader.readInt64() - var _5: Int64? + var _5: Int32? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = reader.readInt64() + _5 = reader.readInt32() + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } + var _7: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _7 = reader.readInt64() + } + var _8: Int64? + _8 = reader.readInt64() + var _9: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _9 = reader.readInt32() + } + var _10: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _10 = reader.readInt32() + } + var _11: Int64? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _11 = reader.readInt64() + } + var _12: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _12 = reader.readInt64() + } + var _13: String? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _13 = parseString(reader) + } + var _14: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _14 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _15: Int32? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _15 = reader.readInt32() + } + var _16: Int32? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _16 = reader.readInt32() + } + var _17: Int32? + if Int(_1 ?? 0) & Int(1 << 9) != 0 { + _17 = reader.readInt32() + } + var _18: String? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _18 = parseString(reader) + } + var _19: Int32? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _19 = reader.readInt32() + } + var _20: Int32? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _20 = reader.readInt32() + } + var _21: Int32? + if Int(_1 ?? 0) & Int(1 << 12) != 0 { + _21 = reader.readInt32() + } + var _22: Api.StarGiftBackground? + if Int(_1 ?? 0) & 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 let _c4 = _4 != nil let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarsRating.starsRating(Cons_starsRating(flags: _1!, level: _2!, currentLevelStars: _3!, stars: _4!, nextLevelStars: _5)) + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil + let _c8 = _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _15 != nil + let _c16 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _16 != nil + let _c17 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _17 != nil + let _c18 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _18 != nil + let _c19 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _19 != nil + let _c20 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _20 != nil + let _c21 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _21 != nil + let _c22 = (Int(_1 ?? 0) & 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(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 } } - } -} -public extension Api { - enum StarsRevenueStatus: TypeConstructorDescription { - public class Cons_starsRevenueStatus: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsRevenueStatus", [("flags", ConstructorParameterDescription(self.flags)), ("currentBalance", ConstructorParameterDescription(self.currentBalance)), ("availableBalance", ConstructorParameterDescription(self.availableBalance)), ("overallRevenue", ConstructorParameterDescription(self.overallRevenue)), ("nextWithdrawalAt", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starsRevenueStatus(let _data): - return ("starsRevenueStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("currentBalance", ConstructorParameterDescription(_data.currentBalance)), ("availableBalance", ConstructorParameterDescription(_data.availableBalance)), ("overallRevenue", ConstructorParameterDescription(_data.overallRevenue)), ("nextWithdrawalAt", ConstructorParameterDescription(_data.nextWithdrawalAt))]) - } - } - - public static func parse_starsRevenueStatus(_ reader: BufferReader) -> StarsRevenueStatus? { + public static func parse_starGiftUnique(_ reader: BufferReader) -> StarGift? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.StarsAmount? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: Int32? + _6 = reader.readInt32() + var _7: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.Peer + } } - var _3: Api.StarsAmount? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - var _4: Api.StarsAmount? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - var _5: Int32? + var _8: String? if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = reader.readInt32() + _8 = parseString(reader) + } + var _9: String? + if Int(_1 ?? 0) & 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) + } + var _11: Int32? + _11 = reader.readInt32() + var _12: Int32? + _12 = reader.readInt32() + var _13: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _13 = parseString(reader) + } + var _14: [Api.StarsAmount]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _16: Int64? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _16 = reader.readInt64() + } + var _17: String? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _17 = parseString(reader) + } + var _18: Int64? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _18 = reader.readInt64() + } + var _19: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 12) != 0 { + if let signature = reader.readInt32() { + _21 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _22: Int32? + if Int(_1 ?? 0) & Int(1 << 13) != 0 { + _22 = reader.readInt32() + } + var _23: Int32? + if Int(_1 ?? 0) & Int(1 << 16) != 0 { + _23 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.StarsRevenueStatus.starsRevenueStatus(Cons_starsRevenueStatus(flags: _1!, currentBalance: _2!, availableBalance: _3!, overallRevenue: _4!, nextWithdrawalAt: _5)) + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil + let _c10 = _10 != nil + let _c11 = _11 != nil + let _c12 = _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _15 != nil + let _c16 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _16 != nil + let _c17 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _17 != nil + let _c18 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _18 != nil + let _c19 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _19 != nil + let _c20 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _20 != nil + let _c21 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _21 != nil + let _c22 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _22 != nil + let _c23 = (Int(_1 ?? 0) & 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(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 @@ -446,1363 +1354,305 @@ public extension Api { } } public extension Api { - enum StarsSubscription: TypeConstructorDescription { - public class Cons_starsSubscription: TypeConstructorDescription { - 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 + enum StarGiftActiveAuctionState: TypeConstructorDescription { + public class Cons_starGiftActiveAuctionState: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsSubscription", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("peer", ConstructorParameterDescription(self.peer)), ("untilDate", ConstructorParameterDescription(self.untilDate)), ("pricing", ConstructorParameterDescription(self.pricing)), ("chatInviteHash", ConstructorParameterDescription(self.chatInviteHash)), ("title", ConstructorParameterDescription(self.title)), ("photo", ConstructorParameterDescription(self.photo)), ("invoiceSlug", ConstructorParameterDescription(self.invoiceSlug))]) + return ("starGiftActiveAuctionState", [("gift", ConstructorParameterDescription(self.gift)), ("state", ConstructorParameterDescription(self.state)), ("userState", ConstructorParameterDescription(self.userState))]) } } - case starsSubscription(Cons_starsSubscription) + case starGiftActiveAuctionState(Cons_starGiftActiveAuctionState) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starsSubscription(let _data): + case .starGiftActiveAuctionState(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) + buffer.appendInt32(-753154979) } + _data.gift.serialize(buffer, true) + _data.state.serialize(buffer, true) + _data.userState.serialize(buffer, true) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starsSubscription(let _data): - return ("starsSubscription", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("peer", ConstructorParameterDescription(_data.peer)), ("untilDate", ConstructorParameterDescription(_data.untilDate)), ("pricing", ConstructorParameterDescription(_data.pricing)), ("chatInviteHash", ConstructorParameterDescription(_data.chatInviteHash)), ("title", ConstructorParameterDescription(_data.title)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoiceSlug", ConstructorParameterDescription(_data.invoiceSlug))]) + case .starGiftActiveAuctionState(let _data): + return ("starGiftActiveAuctionState", [("gift", ConstructorParameterDescription(_data.gift)), ("state", ConstructorParameterDescription(_data.state)), ("userState", ConstructorParameterDescription(_data.userState))]) } } - public static func parse_starsSubscription(_ reader: BufferReader) -> StarsSubscription? { + public static func parse_starGiftActiveAuctionState(_ reader: BufferReader) -> StarGiftActiveAuctionState? { + var _1: Api.StarGift? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _2: Api.StarGiftAuctionState? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionState + } + var _3: Api.StarGiftAuctionUserState? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionUserState + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.StarGiftActiveAuctionState.starGiftActiveAuctionState(Cons_starGiftActiveAuctionState(gift: _1!, state: _2!, userState: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum StarGiftAttribute: TypeConstructorDescription { + public class Cons_starGiftAttributeBackdrop: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributeBackdrop", [("name", ConstructorParameterDescription(self.name)), ("backdropId", ConstructorParameterDescription(self.backdropId)), ("centerColor", ConstructorParameterDescription(self.centerColor)), ("edgeColor", ConstructorParameterDescription(self.edgeColor)), ("patternColor", ConstructorParameterDescription(self.patternColor)), ("textColor", ConstructorParameterDescription(self.textColor)), ("rarity", ConstructorParameterDescription(self.rarity))]) + } + } + public class Cons_starGiftAttributeModel: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributeModel", [("flags", ConstructorParameterDescription(self.flags)), ("name", ConstructorParameterDescription(self.name)), ("document", ConstructorParameterDescription(self.document)), ("rarity", ConstructorParameterDescription(self.rarity))]) + } + } + public class Cons_starGiftAttributeOriginalDetails: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributeOriginalDetails", [("flags", ConstructorParameterDescription(self.flags)), ("senderId", ConstructorParameterDescription(self.senderId)), ("recipientId", ConstructorParameterDescription(self.recipientId)), ("date", ConstructorParameterDescription(self.date)), ("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_starGiftAttributePattern: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributePattern", [("name", ConstructorParameterDescription(self.name)), ("document", ConstructorParameterDescription(self.document)), ("rarity", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftAttributeBackdrop(let _data): + return ("starGiftAttributeBackdrop", [("name", ConstructorParameterDescription(_data.name)), ("backdropId", ConstructorParameterDescription(_data.backdropId)), ("centerColor", ConstructorParameterDescription(_data.centerColor)), ("edgeColor", ConstructorParameterDescription(_data.edgeColor)), ("patternColor", ConstructorParameterDescription(_data.patternColor)), ("textColor", ConstructorParameterDescription(_data.textColor)), ("rarity", ConstructorParameterDescription(_data.rarity))]) + case .starGiftAttributeModel(let _data): + return ("starGiftAttributeModel", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("document", ConstructorParameterDescription(_data.document)), ("rarity", ConstructorParameterDescription(_data.rarity))]) + case .starGiftAttributeOriginalDetails(let _data): + return ("starGiftAttributeOriginalDetails", [("flags", ConstructorParameterDescription(_data.flags)), ("senderId", ConstructorParameterDescription(_data.senderId)), ("recipientId", ConstructorParameterDescription(_data.recipientId)), ("date", ConstructorParameterDescription(_data.date)), ("message", ConstructorParameterDescription(_data.message))]) + case .starGiftAttributePattern(let _data): + return ("starGiftAttributePattern", [("name", ConstructorParameterDescription(_data.name)), ("document", ConstructorParameterDescription(_data.document)), ("rarity", ConstructorParameterDescription(_data.rarity))]) + } + } + + public static func parse_starGiftAttributeBackdrop(_ reader: BufferReader) -> StarGiftAttribute? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: Api.StarGiftAttributeRarity? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeRarity + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.StarGiftAttribute.starGiftAttributeBackdrop(Cons_starGiftAttributeBackdrop(name: _1!, backdropId: _2!, centerColor: _3!, edgeColor: _4!, patternColor: _5!, textColor: _6!, rarity: _7!)) + } + else { + return nil + } + } + public static func parse_starGiftAttributeModel(_ reader: BufferReader) -> StarGiftAttribute? { var _1: Int32? _1 = reader.readInt32() var _2: String? _2 = parseString(reader) + var _3: Api.Document? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Document + } + var _4: Api.StarGiftAttributeRarity? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeRarity + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.StarGiftAttribute.starGiftAttributeModel(Cons_starGiftAttributeModel(flags: _1!, name: _2!, document: _3!, rarity: _4!)) + } + else { + return nil + } + } + public static func parse_starGiftAttributeOriginalDetails(_ reader: BufferReader) -> StarGiftAttribute? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & 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 } var _4: Int32? _4 = reader.readInt32() - var _5: Api.StarsSubscriptionPricing? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.StarsSubscriptionPricing - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _6 = parseString(reader) - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _7 = parseString(reader) - } - var _8: Api.WebDocument? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.WebDocument - } - } - var _9: String? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _9 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 { - public class Cons_starsSubscriptionPricing: TypeConstructorDescription { - public var period: Int32 - public var amount: Int64 - public init(period: Int32, amount: Int64) { - self.period = period - self.amount = amount - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsSubscriptionPricing", [("period", ConstructorParameterDescription(self.period)), ("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starsSubscriptionPricing(let _data): - return ("starsSubscriptionPricing", [("period", ConstructorParameterDescription(_data.period)), ("amount", ConstructorParameterDescription(_data.amount))]) - } - } - - public static func parse_starsSubscriptionPricing(_ reader: BufferReader) -> StarsSubscriptionPricing? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StarsSubscriptionPricing.starsSubscriptionPricing(Cons_starsSubscriptionPricing(period: _1!, amount: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StarsTopupOption: TypeConstructorDescription { - public class Cons_starsTopupOption: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsTopupOption", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starsTopupOption(let _data): - return ("starsTopupOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) - } - } - - 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 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - var _4: String? - _4 = parseString(reader) - var _5: Int64? - _5 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_starsTransaction: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsTransaction", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("amount", ConstructorParameterDescription(self.amount)), ("date", ConstructorParameterDescription(self.date)), ("peer", ConstructorParameterDescription(self.peer)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("transactionDate", ConstructorParameterDescription(self.transactionDate)), ("transactionUrl", ConstructorParameterDescription(self.transactionUrl)), ("botPayload", ConstructorParameterDescription(self.botPayload)), ("msgId", ConstructorParameterDescription(self.msgId)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia)), ("subscriptionPeriod", ConstructorParameterDescription(self.subscriptionPeriod)), ("giveawayPostId", ConstructorParameterDescription(self.giveawayPostId)), ("stargift", ConstructorParameterDescription(self.stargift)), ("floodskipNumber", ConstructorParameterDescription(self.floodskipNumber)), ("starrefCommissionPermille", ConstructorParameterDescription(self.starrefCommissionPermille)), ("starrefPeer", ConstructorParameterDescription(self.starrefPeer)), ("starrefAmount", ConstructorParameterDescription(self.starrefAmount)), ("paidMessages", ConstructorParameterDescription(self.paidMessages)), ("premiumGiftMonths", ConstructorParameterDescription(self.premiumGiftMonths)), ("adsProceedsFromDate", ConstructorParameterDescription(self.adsProceedsFromDate)), ("adsProceedsToDate", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .starsTransaction(let _data): - return ("starsTransaction", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("amount", ConstructorParameterDescription(_data.amount)), ("date", ConstructorParameterDescription(_data.date)), ("peer", ConstructorParameterDescription(_data.peer)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("transactionDate", ConstructorParameterDescription(_data.transactionDate)), ("transactionUrl", ConstructorParameterDescription(_data.transactionUrl)), ("botPayload", ConstructorParameterDescription(_data.botPayload)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia)), ("subscriptionPeriod", ConstructorParameterDescription(_data.subscriptionPeriod)), ("giveawayPostId", ConstructorParameterDescription(_data.giveawayPostId)), ("stargift", ConstructorParameterDescription(_data.stargift)), ("floodskipNumber", ConstructorParameterDescription(_data.floodskipNumber)), ("starrefCommissionPermille", ConstructorParameterDescription(_data.starrefCommissionPermille)), ("starrefPeer", ConstructorParameterDescription(_data.starrefPeer)), ("starrefAmount", ConstructorParameterDescription(_data.starrefAmount)), ("paidMessages", ConstructorParameterDescription(_data.paidMessages)), ("premiumGiftMonths", ConstructorParameterDescription(_data.premiumGiftMonths)), ("adsProceedsFromDate", ConstructorParameterDescription(_data.adsProceedsFromDate)), ("adsProceedsToDate", ConstructorParameterDescription(_data.adsProceedsToDate))]) - } - } - - public static func parse_starsTransaction(_ reader: BufferReader) -> StarsTransaction? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Api.StarsAmount? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Api.StarsTransactionPeer? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.StarsTransactionPeer - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseString(reader) - } - var _7: String? + var _5: Api.TextWithEntities? if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _7 = parseString(reader) - } - var _8: Api.WebDocument? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.WebDocument + _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities } } - var _9: Int32? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _9 = reader.readInt32() - } - var _10: String? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _10 = parseString(reader) - } - var _11: Buffer? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - _11 = parseBytes(reader) - } - var _12: Int32? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _12 = reader.readInt32() - } - var _13: [Api.MessageMedia]? - if Int(_1 ?? 0) & Int(1 << 9) != 0 { - if let _ = reader.readInt32() { - _13 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageMedia.self) - } - } - var _14: Int32? - if Int(_1 ?? 0) & Int(1 << 12) != 0 { - _14 = reader.readInt32() - } - var _15: Int32? - if Int(_1 ?? 0) & Int(1 << 13) != 0 { - _15 = reader.readInt32() - } - var _16: Api.StarGift? - if Int(_1 ?? 0) & Int(1 << 14) != 0 { - if let signature = reader.readInt32() { - _16 = Api.parse(reader, signature: signature) as? Api.StarGift - } - } - var _17: Int32? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - _17 = reader.readInt32() - } - var _18: Int32? - if Int(_1 ?? 0) & Int(1 << 16) != 0 { - _18 = reader.readInt32() - } - var _19: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 17) != 0 { - if let signature = reader.readInt32() { - _20 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - } - var _21: Int32? - if Int(_1 ?? 0) & Int(1 << 19) != 0 { - _21 = reader.readInt32() - } - var _22: Int32? - if Int(_1 ?? 0) & Int(1 << 20) != 0 { - _22 = reader.readInt32() - } - var _23: Int32? - if Int(_1 ?? 0) & Int(1 << 23) != 0 { - _23 = reader.readInt32() - } - var _24: Int32? - if Int(_1 ?? 0) & Int(1 << 23) != 0 { - _24 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _15 != nil - let _c16 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _16 != nil - let _c17 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _17 != nil - let _c18 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _18 != nil - let _c19 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _19 != nil - let _c20 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _20 != nil - let _c21 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _21 != nil - let _c22 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _22 != nil - let _c23 = (Int(_1 ?? 0) & Int(1 << 23) == 0) || _23 != nil - let _c24 = (Int(_1 ?? 0) & 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(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 { - public class Cons_starsTransactionPeer: TypeConstructorDescription { - public var peer: Api.Peer - public init(peer: Api.Peer) { - self.peer = peer - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsTransactionPeer", [("peer", ConstructorParameterDescription(self.peer))]) - } - } - case starsTransactionPeer(Cons_starsTransactionPeer) - case starsTransactionPeerAPI - case starsTransactionPeerAds - case starsTransactionPeerAppStore - case starsTransactionPeerFragment - case starsTransactionPeerPlayMarket - case starsTransactionPeerPremiumBot - case starsTransactionPeerUnsupported - - 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, ConstructorParameterDescription)]) { - switch self { - case .starsTransactionPeer(let _data): - return ("starsTransactionPeer", [("peer", ConstructorParameterDescription(_data.peer))]) - case .starsTransactionPeerAPI: - return ("starsTransactionPeerAPI", []) - case .starsTransactionPeerAds: - return ("starsTransactionPeerAds", []) - case .starsTransactionPeerAppStore: - return ("starsTransactionPeerAppStore", []) - case .starsTransactionPeerFragment: - return ("starsTransactionPeerFragment", []) - case .starsTransactionPeerPlayMarket: - return ("starsTransactionPeerPlayMarket", []) - case .starsTransactionPeerPremiumBot: - return ("starsTransactionPeerPremiumBot", []) - case .starsTransactionPeerUnsupported: - return ("starsTransactionPeerUnsupported", []) - } - } - - public static func parse_starsTransactionPeer(_ reader: BufferReader) -> StarsTransactionPeer? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - let _c1 = _1 != nil - if _c1 { - return Api.StarsTransactionPeer.starsTransactionPeer(Cons_starsTransactionPeer(peer: _1!)) - } - else { - return nil - } - } - public static func parse_starsTransactionPeerAPI(_ reader: BufferReader) -> StarsTransactionPeer? { - return Api.StarsTransactionPeer.starsTransactionPeerAPI - } - public static func parse_starsTransactionPeerAds(_ reader: BufferReader) -> StarsTransactionPeer? { - return Api.StarsTransactionPeer.starsTransactionPeerAds - } - public static func parse_starsTransactionPeerAppStore(_ reader: BufferReader) -> StarsTransactionPeer? { - return Api.StarsTransactionPeer.starsTransactionPeerAppStore - } - public static func parse_starsTransactionPeerFragment(_ reader: BufferReader) -> StarsTransactionPeer? { - return Api.StarsTransactionPeer.starsTransactionPeerFragment - } - public static func parse_starsTransactionPeerPlayMarket(_ reader: BufferReader) -> StarsTransactionPeer? { - return Api.StarsTransactionPeer.starsTransactionPeerPlayMarket - } - public static func parse_starsTransactionPeerPremiumBot(_ reader: BufferReader) -> StarsTransactionPeer? { - return Api.StarsTransactionPeer.starsTransactionPeerPremiumBot - } - public static func parse_starsTransactionPeerUnsupported(_ reader: BufferReader) -> StarsTransactionPeer? { - return Api.StarsTransactionPeer.starsTransactionPeerUnsupported - } - } -} -public extension Api { - enum StatsAbsValueAndPrev: TypeConstructorDescription { - public class Cons_statsAbsValueAndPrev: TypeConstructorDescription { - public var current: Double - public var previous: Double - public init(current: Double, previous: Double) { - self.current = current - self.previous = previous - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsAbsValueAndPrev", [("current", ConstructorParameterDescription(self.current)), ("previous", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsAbsValueAndPrev(let _data): - return ("statsAbsValueAndPrev", [("current", ConstructorParameterDescription(_data.current)), ("previous", ConstructorParameterDescription(_data.previous))]) - } - } - - public static func parse_statsAbsValueAndPrev(_ reader: BufferReader) -> StatsAbsValueAndPrev? { - var _1: Double? - _1 = reader.readDouble() - var _2: Double? - _2 = reader.readDouble() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StatsAbsValueAndPrev.statsAbsValueAndPrev(Cons_statsAbsValueAndPrev(current: _1!, previous: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StatsDateRangeDays: TypeConstructorDescription { - public class Cons_statsDateRangeDays: TypeConstructorDescription { - public var minDate: Int32 - public var maxDate: Int32 - public init(minDate: Int32, maxDate: Int32) { - self.minDate = minDate - self.maxDate = maxDate - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsDateRangeDays", [("minDate", ConstructorParameterDescription(self.minDate)), ("maxDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsDateRangeDays(let _data): - return ("statsDateRangeDays", [("minDate", ConstructorParameterDescription(_data.minDate)), ("maxDate", ConstructorParameterDescription(_data.maxDate))]) - } - } - - public static func parse_statsDateRangeDays(_ reader: BufferReader) -> StatsDateRangeDays? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StatsDateRangeDays.statsDateRangeDays(Cons_statsDateRangeDays(minDate: _1!, maxDate: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StatsGraph: TypeConstructorDescription { - public class Cons_statsGraph: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsGraph", [("flags", ConstructorParameterDescription(self.flags)), ("json", ConstructorParameterDescription(self.json)), ("zoomToken", ConstructorParameterDescription(self.zoomToken))]) - } - } - public class Cons_statsGraphAsync: TypeConstructorDescription { - public var token: String - public init(token: String) { - self.token = token - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsGraphAsync", [("token", ConstructorParameterDescription(self.token))]) - } - } - public class Cons_statsGraphError: TypeConstructorDescription { - public var error: String - public init(error: String) { - self.error = error - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsGraphError", [("error", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsGraph(let _data): - return ("statsGraph", [("flags", ConstructorParameterDescription(_data.flags)), ("json", ConstructorParameterDescription(_data.json)), ("zoomToken", ConstructorParameterDescription(_data.zoomToken))]) - case .statsGraphAsync(let _data): - return ("statsGraphAsync", [("token", ConstructorParameterDescription(_data.token))]) - case .statsGraphError(let _data): - return ("statsGraphError", [("error", ConstructorParameterDescription(_data.error))]) - } - } - - public static func parse_statsGraph(_ reader: BufferReader) -> StatsGraph? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.DataJSON? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.StatsGraph.statsGraph(Cons_statsGraph(flags: _1!, json: _2!, zoomToken: _3)) - } - else { - return nil - } - } - public static func parse_statsGraphAsync(_ reader: BufferReader) -> StatsGraph? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.StatsGraph.statsGraphAsync(Cons_statsGraphAsync(token: _1!)) - } - else { - return nil - } - } - public static func parse_statsGraphError(_ reader: BufferReader) -> StatsGraph? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.StatsGraph.statsGraphError(Cons_statsGraphError(error: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StatsGroupTopAdmin: TypeConstructorDescription { - public class Cons_statsGroupTopAdmin: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsGroupTopAdmin", [("userId", ConstructorParameterDescription(self.userId)), ("deleted", ConstructorParameterDescription(self.deleted)), ("kicked", ConstructorParameterDescription(self.kicked)), ("banned", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsGroupTopAdmin(let _data): - return ("statsGroupTopAdmin", [("userId", ConstructorParameterDescription(_data.userId)), ("deleted", ConstructorParameterDescription(_data.deleted)), ("kicked", ConstructorParameterDescription(_data.kicked)), ("banned", ConstructorParameterDescription(_data.banned))]) - } - } - - public static func parse_statsGroupTopAdmin(_ reader: BufferReader) -> StatsGroupTopAdmin? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.StatsGroupTopAdmin.statsGroupTopAdmin(Cons_statsGroupTopAdmin(userId: _1!, deleted: _2!, kicked: _3!, banned: _4!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StatsGroupTopInviter: TypeConstructorDescription { - public class Cons_statsGroupTopInviter: TypeConstructorDescription { - public var userId: Int64 - public var invitations: Int32 - public init(userId: Int64, invitations: Int32) { - self.userId = userId - self.invitations = invitations - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsGroupTopInviter", [("userId", ConstructorParameterDescription(self.userId)), ("invitations", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsGroupTopInviter(let _data): - return ("statsGroupTopInviter", [("userId", ConstructorParameterDescription(_data.userId)), ("invitations", ConstructorParameterDescription(_data.invitations))]) - } - } - - public static func parse_statsGroupTopInviter(_ reader: BufferReader) -> StatsGroupTopInviter? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StatsGroupTopInviter.statsGroupTopInviter(Cons_statsGroupTopInviter(userId: _1!, invitations: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StatsGroupTopPoster: TypeConstructorDescription { - public class Cons_statsGroupTopPoster: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsGroupTopPoster", [("userId", ConstructorParameterDescription(self.userId)), ("messages", ConstructorParameterDescription(self.messages)), ("avgChars", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsGroupTopPoster(let _data): - return ("statsGroupTopPoster", [("userId", ConstructorParameterDescription(_data.userId)), ("messages", ConstructorParameterDescription(_data.messages)), ("avgChars", ConstructorParameterDescription(_data.avgChars))]) - } - } - - public static func parse_statsGroupTopPoster(_ reader: BufferReader) -> StatsGroupTopPoster? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.StatsGroupTopPoster.statsGroupTopPoster(Cons_statsGroupTopPoster(userId: _1!, messages: _2!, avgChars: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StatsPercentValue: TypeConstructorDescription { - public class Cons_statsPercentValue: TypeConstructorDescription { - public var part: Double - public var total: Double - public init(part: Double, total: Double) { - self.part = part - self.total = total - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsPercentValue", [("part", ConstructorParameterDescription(self.part)), ("total", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsPercentValue(let _data): - return ("statsPercentValue", [("part", ConstructorParameterDescription(_data.part)), ("total", ConstructorParameterDescription(_data.total))]) - } - } - - public static func parse_statsPercentValue(_ reader: BufferReader) -> StatsPercentValue? { - var _1: Double? - _1 = reader.readDouble() - var _2: Double? - _2 = reader.readDouble() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StatsPercentValue.statsPercentValue(Cons_statsPercentValue(part: _1!, total: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StatsURL: TypeConstructorDescription { - public class Cons_statsURL: TypeConstructorDescription { - public var url: String - public init(url: String) { - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("statsURL", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .statsURL(let _data): - return ("statsURL", [("url", ConstructorParameterDescription(_data.url))]) - } - } - - public static func parse_statsURL(_ reader: BufferReader) -> StatsURL? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.StatsURL.statsURL(Cons_statsURL(url: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StickerKeyword: TypeConstructorDescription { - public class Cons_stickerKeyword: TypeConstructorDescription { - public var documentId: Int64 - public var keyword: [String] - public init(documentId: Int64, keyword: [String]) { - self.documentId = documentId - self.keyword = keyword - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerKeyword", [("documentId", ConstructorParameterDescription(self.documentId)), ("keyword", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .stickerKeyword(let _data): - return ("stickerKeyword", [("documentId", ConstructorParameterDescription(_data.documentId)), ("keyword", ConstructorParameterDescription(_data.keyword))]) - } - } - - public static func parse_stickerKeyword(_ reader: BufferReader) -> StickerKeyword? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [String]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StickerKeyword.stickerKeyword(Cons_stickerKeyword(documentId: _1!, keyword: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StickerPack: TypeConstructorDescription { - public class Cons_stickerPack: TypeConstructorDescription { - public var emoticon: String - public var documents: [Int64] - public init(emoticon: String, documents: [Int64]) { - self.emoticon = emoticon - self.documents = documents - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerPack", [("emoticon", ConstructorParameterDescription(self.emoticon)), ("documents", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .stickerPack(let _data): - return ("stickerPack", [("emoticon", ConstructorParameterDescription(_data.emoticon)), ("documents", ConstructorParameterDescription(_data.documents))]) - } - } - - public static func parse_stickerPack(_ reader: BufferReader) -> StickerPack? { - var _1: String? - _1 = parseString(reader) - var _2: [Int64]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StickerPack.stickerPack(Cons_stickerPack(emoticon: _1!, documents: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StickerSet: TypeConstructorDescription { - public class Cons_stickerSet: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerSet", [("flags", ConstructorParameterDescription(self.flags)), ("installedDate", ConstructorParameterDescription(self.installedDate)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("title", ConstructorParameterDescription(self.title)), ("shortName", ConstructorParameterDescription(self.shortName)), ("thumbs", ConstructorParameterDescription(self.thumbs)), ("thumbDcId", ConstructorParameterDescription(self.thumbDcId)), ("thumbVersion", ConstructorParameterDescription(self.thumbVersion)), ("thumbDocumentId", ConstructorParameterDescription(self.thumbDocumentId)), ("count", ConstructorParameterDescription(self.count)), ("hash", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .stickerSet(let _data): - return ("stickerSet", [("flags", ConstructorParameterDescription(_data.flags)), ("installedDate", ConstructorParameterDescription(_data.installedDate)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("title", ConstructorParameterDescription(_data.title)), ("shortName", ConstructorParameterDescription(_data.shortName)), ("thumbs", ConstructorParameterDescription(_data.thumbs)), ("thumbDcId", ConstructorParameterDescription(_data.thumbDcId)), ("thumbVersion", ConstructorParameterDescription(_data.thumbVersion)), ("thumbDocumentId", ConstructorParameterDescription(_data.thumbDocumentId)), ("count", ConstructorParameterDescription(_data.count)), ("hash", ConstructorParameterDescription(_data.hash))]) - } - } - - public static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int64? - _3 = reader.readInt64() - var _4: Int64? - _4 = reader.readInt64() - var _5: String? - _5 = parseString(reader) - var _6: String? - _6 = parseString(reader) - var _7: [Api.PhotoSize]? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) - } - } - var _8: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _8 = reader.readInt32() - } - var _9: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _9 = reader.readInt32() - } - var _10: Int64? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _10 = reader.readInt64() - } - var _11: Int32? - _11 = reader.readInt32() - var _12: Int32? - _12 = reader.readInt32() let _c1 = _1 != nil let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _10 != nil - 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(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!)) + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.StarGiftAttribute.starGiftAttributeOriginalDetails(Cons_starGiftAttributeOriginalDetails(flags: _1!, senderId: _2, recipientId: _3!, date: _4!, message: _5)) + } + else { + return nil + } + } + public static func parse_starGiftAttributePattern(_ reader: BufferReader) -> StarGiftAttribute? { + var _1: String? + _1 = parseString(reader) + var _2: Api.Document? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Document + } + var _3: Api.StarGiftAttributeRarity? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeRarity + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.StarGiftAttribute.starGiftAttributePattern(Cons_starGiftAttributePattern(name: _1!, document: _2!, rarity: _3!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api27.swift b/submodules/TelegramApi/Sources/Api27.swift index 018d2238a9..ac9bb8ab2a 100644 --- a/submodules/TelegramApi/Sources/Api27.swift +++ b/submodules/TelegramApi/Sources/Api27.swift @@ -1,677 +1,419 @@ public extension Api { - enum StickerSetCovered: TypeConstructorDescription { - public class Cons_stickerSetCovered: TypeConstructorDescription { - public var set: Api.StickerSet - public var cover: Api.Document - public init(set: Api.StickerSet, cover: Api.Document) { - self.set = set - self.cover = cover + enum StarGiftAttributeCounter: TypeConstructorDescription { + public class Cons_starGiftAttributeCounter: TypeConstructorDescription { + public var attribute: Api.StarGiftAttributeId + public var count: Int32 + public init(attribute: Api.StarGiftAttributeId, count: Int32) { + self.attribute = attribute + self.count = count } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerSetCovered", [("set", ConstructorParameterDescription(self.set)), ("cover", ConstructorParameterDescription(self.cover))]) + return ("starGiftAttributeCounter", [("attribute", ConstructorParameterDescription(self.attribute)), ("count", ConstructorParameterDescription(self.count))]) } } - public class Cons_stickerSetFullCovered: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerSetFullCovered", [("set", ConstructorParameterDescription(self.set)), ("packs", ConstructorParameterDescription(self.packs)), ("keywords", ConstructorParameterDescription(self.keywords)), ("documents", ConstructorParameterDescription(self.documents))]) - } - } - public class Cons_stickerSetMultiCovered: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerSetMultiCovered", [("set", ConstructorParameterDescription(self.set)), ("covers", ConstructorParameterDescription(self.covers))]) - } - } - public class Cons_stickerSetNoCovered: TypeConstructorDescription { - public var set: Api.StickerSet - public init(set: Api.StickerSet) { - self.set = set - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerSetNoCovered", [("set", ConstructorParameterDescription(self.set))]) - } - } - case stickerSetCovered(Cons_stickerSetCovered) - case stickerSetFullCovered(Cons_stickerSetFullCovered) - case stickerSetMultiCovered(Cons_stickerSetMultiCovered) - case stickerSetNoCovered(Cons_stickerSetNoCovered) + case starGiftAttributeCounter(Cons_starGiftAttributeCounter) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .stickerSetCovered(let _data): + case .starGiftAttributeCounter(let _data): if boxed { - buffer.appendInt32(1678812626) + buffer.appendInt32(783398488) } - _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) + _data.attribute.serialize(buffer, true) + serializeInt32(_data.count, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .stickerSetCovered(let _data): - return ("stickerSetCovered", [("set", ConstructorParameterDescription(_data.set)), ("cover", ConstructorParameterDescription(_data.cover))]) - case .stickerSetFullCovered(let _data): - return ("stickerSetFullCovered", [("set", ConstructorParameterDescription(_data.set)), ("packs", ConstructorParameterDescription(_data.packs)), ("keywords", ConstructorParameterDescription(_data.keywords)), ("documents", ConstructorParameterDescription(_data.documents))]) - case .stickerSetMultiCovered(let _data): - return ("stickerSetMultiCovered", [("set", ConstructorParameterDescription(_data.set)), ("covers", ConstructorParameterDescription(_data.covers))]) - case .stickerSetNoCovered(let _data): - return ("stickerSetNoCovered", [("set", ConstructorParameterDescription(_data.set))]) + case .starGiftAttributeCounter(let _data): + return ("starGiftAttributeCounter", [("attribute", ConstructorParameterDescription(_data.attribute)), ("count", ConstructorParameterDescription(_data.count))]) } } - public static func parse_stickerSetCovered(_ reader: BufferReader) -> StickerSetCovered? { - var _1: Api.StickerSet? + public static func parse_starGiftAttributeCounter(_ reader: BufferReader) -> StarGiftAttributeCounter? { + var _1: Api.StarGiftAttributeId? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StickerSet - } - var _2: Api.Document? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Document + _1 = Api.parse(reader, signature: signature) as? Api.StarGiftAttributeId } + var _2: Int32? + _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StickerSetCovered.stickerSetCovered(Cons_stickerSetCovered(set: _1!, cover: _2!)) + return Api.StarGiftAttributeCounter.starGiftAttributeCounter(Cons_starGiftAttributeCounter(attribute: _1!, count: _2!)) } else { return nil } } - public static func parse_stickerSetFullCovered(_ reader: BufferReader) -> StickerSetCovered? { - var _1: Api.StickerSet? + } +} +public extension Api { + enum StarGiftAttributeId: TypeConstructorDescription { + public class Cons_starGiftAttributeIdBackdrop: TypeConstructorDescription { + public var backdropId: Int32 + public init(backdropId: Int32) { + self.backdropId = backdropId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributeIdBackdrop", [("backdropId", ConstructorParameterDescription(self.backdropId))]) + } + } + public class Cons_starGiftAttributeIdModel: TypeConstructorDescription { + public var documentId: Int64 + public init(documentId: Int64) { + self.documentId = documentId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributeIdModel", [("documentId", ConstructorParameterDescription(self.documentId))]) + } + } + public class Cons_starGiftAttributeIdPattern: TypeConstructorDescription { + public var documentId: Int64 + public init(documentId: Int64) { + self.documentId = documentId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributeIdPattern", [("documentId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftAttributeIdBackdrop(let _data): + return ("starGiftAttributeIdBackdrop", [("backdropId", ConstructorParameterDescription(_data.backdropId))]) + case .starGiftAttributeIdModel(let _data): + return ("starGiftAttributeIdModel", [("documentId", ConstructorParameterDescription(_data.documentId))]) + case .starGiftAttributeIdPattern(let _data): + return ("starGiftAttributeIdPattern", [("documentId", ConstructorParameterDescription(_data.documentId))]) + } + } + + public static func parse_starGiftAttributeIdBackdrop(_ reader: BufferReader) -> StarGiftAttributeId? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.StarGiftAttributeId.starGiftAttributeIdBackdrop(Cons_starGiftAttributeIdBackdrop(backdropId: _1!)) + } + else { + return nil + } + } + public static func parse_starGiftAttributeIdModel(_ reader: BufferReader) -> StarGiftAttributeId? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.StarGiftAttributeId.starGiftAttributeIdModel(Cons_starGiftAttributeIdModel(documentId: _1!)) + } + else { + return nil + } + } + public static func parse_starGiftAttributeIdPattern(_ reader: BufferReader) -> StarGiftAttributeId? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.StarGiftAttributeId.starGiftAttributeIdPattern(Cons_starGiftAttributeIdPattern(documentId: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum StarGiftAttributeRarity: TypeConstructorDescription { + public class Cons_starGiftAttributeRarity: TypeConstructorDescription { + public var permille: Int32 + public init(permille: Int32) { + self.permille = permille + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributeRarity", [("permille", ConstructorParameterDescription(self.permille))]) + } + } + case starGiftAttributeRarity(Cons_starGiftAttributeRarity) + case starGiftAttributeRarityEpic + case starGiftAttributeRarityLegendary + case starGiftAttributeRarityRare + case starGiftAttributeRarityUncommon + + 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 + case .starGiftAttributeRarityUncommon: + if boxed { + buffer.appendInt32(-607231095) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .starGiftAttributeRarity(let _data): + return ("starGiftAttributeRarity", [("permille", ConstructorParameterDescription(_data.permille))]) + case .starGiftAttributeRarityEpic: + return ("starGiftAttributeRarityEpic", []) + case .starGiftAttributeRarityLegendary: + return ("starGiftAttributeRarityLegendary", []) + case .starGiftAttributeRarityRare: + return ("starGiftAttributeRarityRare", []) + case .starGiftAttributeRarityUncommon: + return ("starGiftAttributeRarityUncommon", []) + } + } + + public static func parse_starGiftAttributeRarity(_ reader: BufferReader) -> StarGiftAttributeRarity? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.StarGiftAttributeRarity.starGiftAttributeRarity(Cons_starGiftAttributeRarity(permille: _1!)) + } + else { + return nil + } + } + public static func parse_starGiftAttributeRarityEpic(_ reader: BufferReader) -> StarGiftAttributeRarity? { + return Api.StarGiftAttributeRarity.starGiftAttributeRarityEpic + } + public static func parse_starGiftAttributeRarityLegendary(_ reader: BufferReader) -> StarGiftAttributeRarity? { + return Api.StarGiftAttributeRarity.starGiftAttributeRarityLegendary + } + public static func parse_starGiftAttributeRarityRare(_ reader: BufferReader) -> StarGiftAttributeRarity? { + return Api.StarGiftAttributeRarity.starGiftAttributeRarityRare + } + public static func parse_starGiftAttributeRarityUncommon(_ reader: BufferReader) -> StarGiftAttributeRarity? { + return Api.StarGiftAttributeRarity.starGiftAttributeRarityUncommon + } + } +} +public extension Api { + enum StarGiftAuctionAcquiredGift: TypeConstructorDescription { + public class Cons_starGiftAuctionAcquiredGift: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAuctionAcquiredGift", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date)), ("bidAmount", ConstructorParameterDescription(self.bidAmount)), ("round", ConstructorParameterDescription(self.round)), ("pos", ConstructorParameterDescription(self.pos)), ("message", ConstructorParameterDescription(self.message)), ("giftNum", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftAuctionAcquiredGift(let _data): + return ("starGiftAuctionAcquiredGift", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date)), ("bidAmount", ConstructorParameterDescription(_data.bidAmount)), ("round", ConstructorParameterDescription(_data.round)), ("pos", ConstructorParameterDescription(_data.pos)), ("message", ConstructorParameterDescription(_data.message)), ("giftNum", ConstructorParameterDescription(_data.giftNum))]) + } + } + + public static func parse_starGiftAuctionAcquiredGift(_ reader: BufferReader) -> StarGiftAuctionAcquiredGift? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StickerSet + _2 = Api.parse(reader, signature: signature) as? Api.Peer } - var _2: [Api.StickerPack]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerPack.self) + var _3: Int32? + _3 = reader.readInt32() + var _4: Int64? + _4 = reader.readInt64() + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: Api.TextWithEntities? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } } - var _3: [Api.StickerKeyword]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerKeyword.self) - } - var _4: [Api.Document]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + var _8: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _8 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.StickerSetCovered.stickerSetFullCovered(Cons_stickerSetFullCovered(set: _1!, packs: _2!, keywords: _3!, documents: _4!)) + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 static func parse_stickerSetMultiCovered(_ reader: BufferReader) -> StickerSetCovered? { - var _1: Api.StickerSet? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StickerSet + } +} +public extension Api { + enum StarGiftAuctionRound: TypeConstructorDescription { + public class Cons_starGiftAuctionRound: TypeConstructorDescription { + public var num: Int32 + public var duration: Int32 + public init(num: Int32, duration: Int32) { + self.num = num + self.duration = duration } - var _2: [Api.Document]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAuctionRound", [("num", ConstructorParameterDescription(self.num)), ("duration", ConstructorParameterDescription(self.duration))]) } + } + public class Cons_starGiftAuctionRoundExtendable: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAuctionRoundExtendable", [("num", ConstructorParameterDescription(self.num)), ("duration", ConstructorParameterDescription(self.duration)), ("extendTop", ConstructorParameterDescription(self.extendTop)), ("extendWindow", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftAuctionRound(let _data): + return ("starGiftAuctionRound", [("num", ConstructorParameterDescription(_data.num)), ("duration", ConstructorParameterDescription(_data.duration))]) + case .starGiftAuctionRoundExtendable(let _data): + return ("starGiftAuctionRoundExtendable", [("num", ConstructorParameterDescription(_data.num)), ("duration", ConstructorParameterDescription(_data.duration)), ("extendTop", ConstructorParameterDescription(_data.extendTop)), ("extendWindow", ConstructorParameterDescription(_data.extendWindow))]) + } + } + + public static func parse_starGiftAuctionRound(_ reader: BufferReader) -> StarGiftAuctionRound? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.StickerSetCovered.stickerSetMultiCovered(Cons_stickerSetMultiCovered(set: _1!, covers: _2!)) + return Api.StarGiftAuctionRound.starGiftAuctionRound(Cons_starGiftAuctionRound(num: _1!, duration: _2!)) } else { return nil } } - public static func parse_stickerSetNoCovered(_ reader: BufferReader) -> StickerSetCovered? { - var _1: Api.StickerSet? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StickerSet - } - let _c1 = _1 != nil - if _c1 { - return Api.StickerSetCovered.stickerSetNoCovered(Cons_stickerSetNoCovered(set: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StoriesStealthMode: TypeConstructorDescription { - public class Cons_storiesStealthMode: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storiesStealthMode", [("flags", ConstructorParameterDescription(self.flags)), ("activeUntilDate", ConstructorParameterDescription(self.activeUntilDate)), ("cooldownUntilDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .storiesStealthMode(let _data): - return ("storiesStealthMode", [("flags", ConstructorParameterDescription(_data.flags)), ("activeUntilDate", ConstructorParameterDescription(_data.activeUntilDate)), ("cooldownUntilDate", ConstructorParameterDescription(_data.cooldownUntilDate))]) - } - } - - public static func parse_storiesStealthMode(_ reader: BufferReader) -> StoriesStealthMode? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.StoriesStealthMode.storiesStealthMode(Cons_storiesStealthMode(flags: _1!, activeUntilDate: _2, cooldownUntilDate: _3)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StoryAlbum: TypeConstructorDescription { - public class Cons_storyAlbum: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyAlbum", [("flags", ConstructorParameterDescription(self.flags)), ("albumId", ConstructorParameterDescription(self.albumId)), ("title", ConstructorParameterDescription(self.title)), ("iconPhoto", ConstructorParameterDescription(self.iconPhoto)), ("iconVideo", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .storyAlbum(let _data): - return ("storyAlbum", [("flags", ConstructorParameterDescription(_data.flags)), ("albumId", ConstructorParameterDescription(_data.albumId)), ("title", ConstructorParameterDescription(_data.title)), ("iconPhoto", ConstructorParameterDescription(_data.iconPhoto)), ("iconVideo", ConstructorParameterDescription(_data.iconVideo))]) - } - } - - public static func parse_storyAlbum(_ reader: BufferReader) -> StoryAlbum? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - var _4: Api.Photo? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_storyFwdHeader: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyFwdHeader", [("flags", ConstructorParameterDescription(self.flags)), ("from", ConstructorParameterDescription(self.from)), ("fromName", ConstructorParameterDescription(self.fromName)), ("storyId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .storyFwdHeader(let _data): - return ("storyFwdHeader", [("flags", ConstructorParameterDescription(_data.flags)), ("from", ConstructorParameterDescription(_data.from)), ("fromName", ConstructorParameterDescription(_data.fromName)), ("storyId", ConstructorParameterDescription(_data.storyId))]) - } - } - - public static func parse_storyFwdHeader(_ reader: BufferReader) -> StoryFwdHeader? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = parseString(reader) - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.StoryFwdHeader.storyFwdHeader(Cons_storyFwdHeader(flags: _1!, from: _2, fromName: _3, storyId: _4)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum StoryItem: TypeConstructorDescription { - public class Cons_storyItem: TypeConstructorDescription { - 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 var music: Api.Document? - 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]?, music: Api.Document?) { - 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 - self.music = music - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyItem", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("date", ConstructorParameterDescription(self.date)), ("fromId", ConstructorParameterDescription(self.fromId)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("expireDate", ConstructorParameterDescription(self.expireDate)), ("caption", ConstructorParameterDescription(self.caption)), ("entities", ConstructorParameterDescription(self.entities)), ("media", ConstructorParameterDescription(self.media)), ("mediaAreas", ConstructorParameterDescription(self.mediaAreas)), ("privacy", ConstructorParameterDescription(self.privacy)), ("views", ConstructorParameterDescription(self.views)), ("sentReaction", ConstructorParameterDescription(self.sentReaction)), ("albums", ConstructorParameterDescription(self.albums)), ("music", ConstructorParameterDescription(self.music))]) - } - } - public class Cons_storyItemDeleted: TypeConstructorDescription { - public var id: Int32 - public init(id: Int32) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyItemDeleted", [("id", ConstructorParameterDescription(self.id))]) - } - } - public class Cons_storyItemSkipped: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyItemSkipped", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("date", ConstructorParameterDescription(self.date)), ("expireDate", ConstructorParameterDescription(self.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(379894076) - } - 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) - } - } - _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) - } - } - 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(_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) - } - } - if Int(_data.flags) & Int(1 << 20) != 0 { - _data.music!.serialize(buffer, true) - } - 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, ConstructorParameterDescription)]) { - switch self { - case .storyItem(let _data): - return ("storyItem", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("date", ConstructorParameterDescription(_data.date)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("expireDate", ConstructorParameterDescription(_data.expireDate)), ("caption", ConstructorParameterDescription(_data.caption)), ("entities", ConstructorParameterDescription(_data.entities)), ("media", ConstructorParameterDescription(_data.media)), ("mediaAreas", ConstructorParameterDescription(_data.mediaAreas)), ("privacy", ConstructorParameterDescription(_data.privacy)), ("views", ConstructorParameterDescription(_data.views)), ("sentReaction", ConstructorParameterDescription(_data.sentReaction)), ("albums", ConstructorParameterDescription(_data.albums)), ("music", ConstructorParameterDescription(_data.music))]) - case .storyItemDeleted(let _data): - return ("storyItemDeleted", [("id", ConstructorParameterDescription(_data.id))]) - case .storyItemSkipped(let _data): - return ("storyItemSkipped", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("date", ConstructorParameterDescription(_data.date)), ("expireDate", ConstructorParameterDescription(_data.expireDate))]) - } - } - - public static func parse_storyItem(_ reader: BufferReader) -> StoryItem? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) != 0 { - _7 = parseString(reader) - } - var _8: [Api.MessageEntity]? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 15) != 0 { - if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.Reaction - } - } - var _14: [Int32]? - if Int(_1 ?? 0) & Int(1 << 19) != 0 { - if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - } - var _15: Api.Document? - if Int(_1 ?? 0) & Int(1 << 20) != 0 { - if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.Document - } - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil - let _c9 = _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _15 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 { - 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, music: _15)) - } - else { - return nil - } - } - public static func parse_storyItemDeleted(_ reader: BufferReader) -> StoryItem? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.StoryItem.storyItemDeleted(Cons_storyItemDeleted(id: _1!)) - } - else { - return nil - } - } - public static func parse_storyItemSkipped(_ reader: BufferReader) -> StoryItem? { + public static func parse_starGiftAuctionRoundExtendable(_ reader: BufferReader) -> StarGiftAuctionRound? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? @@ -685,7 +427,7 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.StoryItem.storyItemSkipped(Cons_storyItemSkipped(flags: _1!, id: _2!, date: _3!, expireDate: _4!)) + return Api.StarGiftAuctionRound.starGiftAuctionRoundExtendable(Cons_starGiftAuctionRoundExtendable(num: _1!, duration: _2!, extendTop: _3!, extendWindow: _4!)) } else { return nil @@ -694,564 +436,115 @@ public extension Api { } } public extension Api { - indirect enum StoryReaction: TypeConstructorDescription { - public class Cons_storyReaction: TypeConstructorDescription { - 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 + enum StarGiftAuctionState: TypeConstructorDescription { + public class Cons_starGiftAuctionState: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyReaction", [("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.date)), ("reaction", ConstructorParameterDescription(self.reaction))]) + return ("starGiftAuctionState", [("version", ConstructorParameterDescription(self.version)), ("startDate", ConstructorParameterDescription(self.startDate)), ("endDate", ConstructorParameterDescription(self.endDate)), ("minBidAmount", ConstructorParameterDescription(self.minBidAmount)), ("bidLevels", ConstructorParameterDescription(self.bidLevels)), ("topBidders", ConstructorParameterDescription(self.topBidders)), ("nextRoundAt", ConstructorParameterDescription(self.nextRoundAt)), ("lastGiftNum", ConstructorParameterDescription(self.lastGiftNum)), ("giftsLeft", ConstructorParameterDescription(self.giftsLeft)), ("currentRound", ConstructorParameterDescription(self.currentRound)), ("totalRounds", ConstructorParameterDescription(self.totalRounds)), ("rounds", ConstructorParameterDescription(self.rounds))]) } } - public class Cons_storyReactionPublicForward: TypeConstructorDescription { - public var message: Api.Message - public init(message: Api.Message) { - self.message = message + public class Cons_starGiftAuctionStateFinished: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyReactionPublicForward", [("message", ConstructorParameterDescription(self.message))]) + return ("starGiftAuctionStateFinished", [("flags", ConstructorParameterDescription(self.flags)), ("startDate", ConstructorParameterDescription(self.startDate)), ("endDate", ConstructorParameterDescription(self.endDate)), ("averagePrice", ConstructorParameterDescription(self.averagePrice)), ("listedCount", ConstructorParameterDescription(self.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(self.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(self.fragmentListedUrl))]) } } - public class Cons_storyReactionPublicRepost: TypeConstructorDescription { - public var peerId: Api.Peer - public var story: Api.StoryItem - public init(peerId: Api.Peer, story: Api.StoryItem) { - self.peerId = peerId - self.story = story - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyReactionPublicRepost", [("peerId", ConstructorParameterDescription(self.peerId)), ("story", ConstructorParameterDescription(self.story))]) - } - } - case storyReaction(Cons_storyReaction) - case storyReactionPublicForward(Cons_storyReactionPublicForward) - case storyReactionPublicRepost(Cons_storyReactionPublicRepost) + case starGiftAuctionState(Cons_starGiftAuctionState) + case starGiftAuctionStateFinished(Cons_starGiftAuctionStateFinished) + case starGiftAuctionStateNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .storyReaction(let _data): + case .starGiftAuctionState(let _data): if boxed { - buffer.appendInt32(1620104917) + buffer.appendInt32(1998212710) } - _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, ConstructorParameterDescription)]) { - switch self { - case .storyReaction(let _data): - return ("storyReaction", [("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) - case .storyReactionPublicForward(let _data): - return ("storyReactionPublicForward", [("message", ConstructorParameterDescription(_data.message))]) - case .storyReactionPublicRepost(let _data): - return ("storyReactionPublicRepost", [("peerId", ConstructorParameterDescription(_data.peerId)), ("story", ConstructorParameterDescription(_data.story))]) - } - } - - public static func parse_storyReaction(_ reader: BufferReader) -> StoryReaction? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.Reaction? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Reaction - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.StoryReaction.storyReaction(Cons_storyReaction(peerId: _1!, date: _2!, reaction: _3!)) - } - else { - return nil - } - } - public static func parse_storyReactionPublicForward(_ reader: BufferReader) -> StoryReaction? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - let _c1 = _1 != nil - if _c1 { - return Api.StoryReaction.storyReactionPublicForward(Cons_storyReactionPublicForward(message: _1!)) - } - else { - return nil - } - } - public static func parse_storyReactionPublicRepost(_ reader: BufferReader) -> StoryReaction? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Api.StoryItem? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StoryItem - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StoryReaction.storyReactionPublicRepost(Cons_storyReactionPublicRepost(peerId: _1!, story: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - indirect enum StoryView: TypeConstructorDescription { - public class Cons_storyView: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyView", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.date)), ("reaction", ConstructorParameterDescription(self.reaction))]) - } - } - public class Cons_storyViewPublicForward: TypeConstructorDescription { - public var flags: Int32 - public var message: Api.Message - public init(flags: Int32, message: Api.Message) { - self.flags = flags - self.message = message - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyViewPublicForward", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_storyViewPublicRepost: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyViewPublicRepost", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("story", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .storyView(let _data): - return ("storyView", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) - case .storyViewPublicForward(let _data): - return ("storyViewPublicForward", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message))]) - case .storyViewPublicRepost(let _data): - return ("storyViewPublicRepost", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("story", ConstructorParameterDescription(_data.story))]) - } - } - - public static func parse_storyView(_ reader: BufferReader) -> StoryView? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Api.Reaction? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.StoryView.storyView(Cons_storyView(flags: _1!, userId: _2!, date: _3!, reaction: _4)) - } - else { - return nil - } - } - public static func parse_storyViewPublicForward(_ reader: BufferReader) -> StoryView? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Message? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Message - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StoryView.storyViewPublicForward(Cons_storyViewPublicForward(flags: _1!, message: _2!)) - } - else { - return nil - } - } - public static func parse_storyViewPublicRepost(_ reader: BufferReader) -> StoryView? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Api.StoryItem? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StoryItem - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.StoryView.storyViewPublicRepost(Cons_storyViewPublicRepost(flags: _1!, peerId: _2!, story: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum StoryViews: TypeConstructorDescription { - public class Cons_storyViews: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyViews", [("flags", ConstructorParameterDescription(self.flags)), ("viewsCount", ConstructorParameterDescription(self.viewsCount)), ("forwardsCount", ConstructorParameterDescription(self.forwardsCount)), ("reactions", ConstructorParameterDescription(self.reactions)), ("reactionsCount", ConstructorParameterDescription(self.reactionsCount)), ("recentViewers", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .storyViews(let _data): - return ("storyViews", [("flags", ConstructorParameterDescription(_data.flags)), ("viewsCount", ConstructorParameterDescription(_data.viewsCount)), ("forwardsCount", ConstructorParameterDescription(_data.forwardsCount)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("reactionsCount", ConstructorParameterDescription(_data.reactionsCount)), ("recentViewers", ConstructorParameterDescription(_data.recentViewers))]) - } - } - - 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 ?? 0) & Int(1 << 2) != 0 { - _3 = reader.readInt32() - } - var _4: [Api.ReactionCount]? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) - } - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = reader.readInt32() - } - var _6: [Int64]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_suggestedPost: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("suggestedPost", [("flags", ConstructorParameterDescription(self.flags)), ("price", ConstructorParameterDescription(self.price)), ("scheduleDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .suggestedPost(let _data): - return ("suggestedPost", [("flags", ConstructorParameterDescription(_data.flags)), ("price", ConstructorParameterDescription(_data.price)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate))]) - } - } - - public static func parse_suggestedPost(_ reader: BufferReader) -> SuggestedPost? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.StarsAmount? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.SuggestedPost.suggestedPost(Cons_suggestedPost(flags: _1!, price: _2, scheduleDate: _3)) - } - else { - return nil - } - } - } -} -public extension Api { - enum TextWithEntities: TypeConstructorDescription { - public class Cons_textWithEntities: TypeConstructorDescription { - public var text: String - public var entities: [Api.MessageEntity] - public init(text: String, entities: [Api.MessageEntity]) { - self.text = text - self.entities = entities - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("textWithEntities", [("text", ConstructorParameterDescription(self.text)), ("entities", ConstructorParameterDescription(self.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) + 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.entities.count)) - for item in _data.entities { + 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 - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .textWithEntities(let _data): - return ("textWithEntities", [("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities))]) - } - } - - public static func parse_textWithEntities(_ reader: BufferReader) -> TextWithEntities? { - var _1: String? - _1 = parseString(reader) - var _2: [Api.MessageEntity]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.TextWithEntities.textWithEntities(Cons_textWithEntities(text: _1!, entities: _2!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum Theme: TypeConstructorDescription { - public class Cons_theme: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("theme", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("slug", ConstructorParameterDescription(self.slug)), ("title", ConstructorParameterDescription(self.title)), ("document", ConstructorParameterDescription(self.document)), ("settings", ConstructorParameterDescription(self.settings)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("installsCount", ConstructorParameterDescription(self.installsCount))]) - } - } - case theme(Cons_theme) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .theme(let _data): + case .starGiftAuctionStateFinished(let _data): if boxed { - buffer.appendInt32(-1609668650) + buffer.appendInt32(-1758614593) } 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) + 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 << 3) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.settings!.count)) - for item in _data.settings! { - item.serialize(buffer, true) - } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.fragmentListedCount!, buffer: buffer, boxed: false) } - if Int(_data.flags) & Int(1 << 6) != 0 { - serializeString(_data.emoticon!, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.fragmentListedUrl!, buffer: buffer, boxed: false) } - if Int(_data.flags) & Int(1 << 4) != 0 { - serializeInt32(_data.installsCount!, buffer: buffer, boxed: false) + break + case .starGiftAuctionStateNotModified: + if boxed { + buffer.appendInt32(-30197422) } break } @@ -1259,149 +552,190 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .theme(let _data): - return ("theme", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("slug", ConstructorParameterDescription(_data.slug)), ("title", ConstructorParameterDescription(_data.title)), ("document", ConstructorParameterDescription(_data.document)), ("settings", ConstructorParameterDescription(_data.settings)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("installsCount", ConstructorParameterDescription(_data.installsCount))]) + case .starGiftAuctionState(let _data): + return ("starGiftAuctionState", [("version", ConstructorParameterDescription(_data.version)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("endDate", ConstructorParameterDescription(_data.endDate)), ("minBidAmount", ConstructorParameterDescription(_data.minBidAmount)), ("bidLevels", ConstructorParameterDescription(_data.bidLevels)), ("topBidders", ConstructorParameterDescription(_data.topBidders)), ("nextRoundAt", ConstructorParameterDescription(_data.nextRoundAt)), ("lastGiftNum", ConstructorParameterDescription(_data.lastGiftNum)), ("giftsLeft", ConstructorParameterDescription(_data.giftsLeft)), ("currentRound", ConstructorParameterDescription(_data.currentRound)), ("totalRounds", ConstructorParameterDescription(_data.totalRounds)), ("rounds", ConstructorParameterDescription(_data.rounds))]) + case .starGiftAuctionStateFinished(let _data): + return ("starGiftAuctionStateFinished", [("flags", ConstructorParameterDescription(_data.flags)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("endDate", ConstructorParameterDescription(_data.endDate)), ("averagePrice", ConstructorParameterDescription(_data.averagePrice)), ("listedCount", ConstructorParameterDescription(_data.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(_data.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(_data.fragmentListedUrl))]) + case .starGiftAuctionStateNotModified: + return ("starGiftAuctionStateNotModified", []) } } - public static func parse_theme(_ reader: BufferReader) -> Theme? { + public static func parse_starGiftAuctionState(_ reader: BufferReader) -> StarGiftAuctionState? { var _1: Int32? _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Api.Document? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Document - } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int64? + _4 = reader.readInt64() + var _5: [Api.AuctionBidLevel]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AuctionBidLevel.self) } - var _7: [Api.ThemeSettings]? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ThemeSettings.self) - } - } - var _8: String? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _8 = parseString(reader) + var _6: [Int64]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) } + var _7: Int32? + _7 = reader.readInt32() + var _8: Int32? + _8 = reader.readInt32() var _9: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _9 = reader.readInt32() + _9 = reader.readInt32() + var _10: Int32? + _10 = reader.readInt32() + var _11: Int32? + _11 = reader.readInt32() + var _12: [Api.StarGiftAuctionRound]? + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAuctionRound.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.Theme.theme(Cons_theme(flags: _1!, id: _2!, accessHash: _3!, slug: _4!, title: _5!, document: _6, settings: _7, emoticon: _8, installsCount: _9)) + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = _10 != nil + 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(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 } } - } -} -public extension Api { - enum ThemeSettings: TypeConstructorDescription { - public class Cons_themeSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("themeSettings", [("flags", ConstructorParameterDescription(self.flags)), ("baseTheme", ConstructorParameterDescription(self.baseTheme)), ("accentColor", ConstructorParameterDescription(self.accentColor)), ("outboxAccentColor", ConstructorParameterDescription(self.outboxAccentColor)), ("messageColors", ConstructorParameterDescription(self.messageColors)), ("wallpaper", ConstructorParameterDescription(self.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(_data.flags) & Int(1 << 1) != 0 { - _data.wallpaper!.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .themeSettings(let _data): - return ("themeSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("baseTheme", ConstructorParameterDescription(_data.baseTheme)), ("accentColor", ConstructorParameterDescription(_data.accentColor)), ("outboxAccentColor", ConstructorParameterDescription(_data.outboxAccentColor)), ("messageColors", ConstructorParameterDescription(_data.messageColors)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) - } - } - - public static func parse_themeSettings(_ reader: BufferReader) -> ThemeSettings? { + public static func parse_starGiftAuctionStateFinished(_ reader: BufferReader) -> StarGiftAuctionState? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.BaseTheme? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.BaseTheme - } + var _2: Int32? + _2 = reader.readInt32() var _3: Int32? _3 = reader.readInt32() - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _4 = reader.readInt32() - } - var _5: [Int32]? + var _4: Int64? + _4 = reader.readInt64() + var _5: Int32? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } + _5 = reader.readInt32() } - var _6: Api.WallPaper? + var _6: Int32? if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WallPaper - } + _6 = reader.readInt32() + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _7 = parseString(reader) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + let _c4 = _4 != nil let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.StarGiftAuctionState.starGiftAuctionStateFinished(Cons_starGiftAuctionStateFinished(flags: _1!, startDate: _2!, endDate: _3!, averagePrice: _4!, listedCount: _5, fragmentListedCount: _6, fragmentListedUrl: _7)) + } + else { + return nil + } + } + public static func parse_starGiftAuctionStateNotModified(_ reader: BufferReader) -> StarGiftAuctionState? { + return Api.StarGiftAuctionState.starGiftAuctionStateNotModified + } + } +} +public extension Api { + enum StarGiftAuctionUserState: TypeConstructorDescription { + public class Cons_starGiftAuctionUserState: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAuctionUserState", [("flags", ConstructorParameterDescription(self.flags)), ("bidAmount", ConstructorParameterDescription(self.bidAmount)), ("bidDate", ConstructorParameterDescription(self.bidDate)), ("minBidAmount", ConstructorParameterDescription(self.minBidAmount)), ("bidPeer", ConstructorParameterDescription(self.bidPeer)), ("acquiredCount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftAuctionUserState(let _data): + return ("starGiftAuctionUserState", [("flags", ConstructorParameterDescription(_data.flags)), ("bidAmount", ConstructorParameterDescription(_data.bidAmount)), ("bidDate", ConstructorParameterDescription(_data.bidDate)), ("minBidAmount", ConstructorParameterDescription(_data.minBidAmount)), ("bidPeer", ConstructorParameterDescription(_data.bidPeer)), ("acquiredCount", ConstructorParameterDescription(_data.acquiredCount))]) + } + } + + public static func parse_starGiftAuctionUserState(_ reader: BufferReader) -> StarGiftAuctionUserState? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } + var _5: Api.Peer? + if Int(_1 ?? 0) & 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 + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.ThemeSettings.themeSettings(Cons_themeSettings(flags: _1!, baseTheme: _2!, accentColor: _3!, outboxAccentColor: _4, messageColors: _5, wallpaper: _6)) + return Api.StarGiftAuctionUserState.starGiftAuctionUserState(Cons_starGiftAuctionUserState(flags: _1!, bidAmount: _2, bidDate: _3, minBidAmount: _4, bidPeer: _5, acquiredCount: _6!)) } else { return nil @@ -1410,112 +744,54 @@ public extension Api { } } public extension Api { - enum Timezone: TypeConstructorDescription { - public class Cons_timezone: TypeConstructorDescription { - 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 + enum StarGiftBackground: TypeConstructorDescription { + public class Cons_starGiftBackground: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("timezone", [("id", ConstructorParameterDescription(self.id)), ("name", ConstructorParameterDescription(self.name)), ("utcOffset", ConstructorParameterDescription(self.utcOffset))]) + return ("starGiftBackground", [("centerColor", ConstructorParameterDescription(self.centerColor)), ("edgeColor", ConstructorParameterDescription(self.edgeColor)), ("textColor", ConstructorParameterDescription(self.textColor))]) } } - case timezone(Cons_timezone) + case starGiftBackground(Cons_starGiftBackground) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .timezone(let _data): + case .starGiftBackground(let _data): if boxed { - buffer.appendInt32(-7173643) + buffer.appendInt32(-1342872680) } - serializeString(_data.id, buffer: buffer, boxed: false) - serializeString(_data.name, buffer: buffer, boxed: false) - serializeInt32(_data.utcOffset, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { switch self { - case .timezone(let _data): - return ("timezone", [("id", ConstructorParameterDescription(_data.id)), ("name", ConstructorParameterDescription(_data.name)), ("utcOffset", ConstructorParameterDescription(_data.utcOffset))]) + case .starGiftBackground(let _data): + return ("starGiftBackground", [("centerColor", ConstructorParameterDescription(_data.centerColor)), ("edgeColor", ConstructorParameterDescription(_data.edgeColor)), ("textColor", ConstructorParameterDescription(_data.textColor))]) } } - public static func parse_timezone(_ reader: BufferReader) -> Timezone? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Timezone.timezone(Cons_timezone(id: _1!, name: _2!, utcOffset: _3!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum TodoCompletion: TypeConstructorDescription { - public class Cons_todoCompletion: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("todoCompletion", [("id", ConstructorParameterDescription(self.id)), ("completedBy", ConstructorParameterDescription(self.completedBy)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .todoCompletion(let _data): - return ("todoCompletion", [("id", ConstructorParameterDescription(_data.id)), ("completedBy", ConstructorParameterDescription(_data.completedBy)), ("date", ConstructorParameterDescription(_data.date))]) - } - } - - public static func parse_todoCompletion(_ reader: BufferReader) -> TodoCompletion? { + public static func parse_starGiftBackground(_ reader: BufferReader) -> StarGiftBackground? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } + var _2: Int32? + _2 = reader.readInt32() var _3: Int32? _3 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.TodoCompletion.todoCompletion(Cons_todoCompletion(id: _1!, completedBy: _2!, date: _3!)) + return Api.StarGiftBackground.starGiftBackground(Cons_starGiftBackground(centerColor: _1!, edgeColor: _2!, textColor: _3!)) } else { return nil @@ -1524,50 +800,128 @@ public extension Api { } } public extension Api { - enum TodoItem: TypeConstructorDescription { - public class Cons_todoItem: TypeConstructorDescription { - public var id: Int32 - public var title: Api.TextWithEntities - public init(id: Int32, title: Api.TextWithEntities) { - self.id = id + enum StarGiftCollection: TypeConstructorDescription { + public class Cons_starGiftCollection: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("todoItem", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title))]) + return ("starGiftCollection", [("flags", ConstructorParameterDescription(self.flags)), ("collectionId", ConstructorParameterDescription(self.collectionId)), ("title", ConstructorParameterDescription(self.title)), ("icon", ConstructorParameterDescription(self.icon)), ("giftsCount", ConstructorParameterDescription(self.giftsCount)), ("hash", ConstructorParameterDescription(self.hash))]) } } - case todoItem(Cons_todoItem) + case starGiftCollection(Cons_starGiftCollection) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .todoItem(let _data): + case .starGiftCollection(let _data): if boxed { - buffer.appendInt32(-878074577) + buffer.appendInt32(-1653926992) } - serializeInt32(_data.id, buffer: buffer, boxed: false) - _data.title.serialize(buffer, true) + 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, ConstructorParameterDescription)]) { switch self { - case .todoItem(let _data): - return ("todoItem", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title))]) + case .starGiftCollection(let _data): + return ("starGiftCollection", [("flags", ConstructorParameterDescription(_data.flags)), ("collectionId", ConstructorParameterDescription(_data.collectionId)), ("title", ConstructorParameterDescription(_data.title)), ("icon", ConstructorParameterDescription(_data.icon)), ("giftsCount", ConstructorParameterDescription(_data.giftsCount)), ("hash", ConstructorParameterDescription(_data.hash))]) } } - public static func parse_todoItem(_ reader: BufferReader) -> TodoItem? { + public static func parse_starGiftCollection(_ reader: BufferReader) -> StarGiftCollection? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + var _4: Api.Document? + if Int(_1 ?? 0) & 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? + _6 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_starGiftUpgradePrice: TypeConstructorDescription { + public var date: Int32 + public var upgradeStars: Int64 + public init(date: Int32, upgradeStars: Int64) { + self.date = date + self.upgradeStars = upgradeStars + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftUpgradePrice", [("date", ConstructorParameterDescription(self.date)), ("upgradeStars", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftUpgradePrice(let _data): + return ("starGiftUpgradePrice", [("date", ConstructorParameterDescription(_data.date)), ("upgradeStars", ConstructorParameterDescription(_data.upgradeStars))]) + } + } + + public static func parse_starGiftUpgradePrice(_ reader: BufferReader) -> StarGiftUpgradePrice? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.TodoItem.todoItem(Cons_todoItem(id: _1!, title: _2!)) + return Api.StarGiftUpgradePrice.starGiftUpgradePrice(Cons_starGiftUpgradePrice(date: _1!, upgradeStars: _2!)) } else { return nil @@ -1576,33 +930,286 @@ public extension Api { } } public extension Api { - enum TodoList: TypeConstructorDescription { - public class Cons_todoList: TypeConstructorDescription { + enum StarRefProgram: TypeConstructorDescription { + public class Cons_starRefProgram: TypeConstructorDescription { public var flags: Int32 - public var title: Api.TextWithEntities - public var list: [Api.TodoItem] - public init(flags: Int32, title: Api.TextWithEntities, list: [Api.TodoItem]) { + 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.title = title - self.list = list + self.botId = botId + self.commissionPermille = commissionPermille + self.durationMonths = durationMonths + self.endDate = endDate + self.dailyRevenuePerUser = dailyRevenuePerUser } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("todoList", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("list", ConstructorParameterDescription(self.list))]) + return ("starRefProgram", [("flags", ConstructorParameterDescription(self.flags)), ("botId", ConstructorParameterDescription(self.botId)), ("commissionPermille", ConstructorParameterDescription(self.commissionPermille)), ("durationMonths", ConstructorParameterDescription(self.durationMonths)), ("endDate", ConstructorParameterDescription(self.endDate)), ("dailyRevenuePerUser", ConstructorParameterDescription(self.dailyRevenuePerUser))]) } } - case todoList(Cons_todoList) + case starRefProgram(Cons_starRefProgram) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .todoList(let _data): + case .starRefProgram(let _data): if boxed { - buffer.appendInt32(1236871718) + buffer.appendInt32(-586389774) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.title.serialize(buffer, true) + 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, ConstructorParameterDescription)]) { + switch self { + case .starRefProgram(let _data): + return ("starRefProgram", [("flags", ConstructorParameterDescription(_data.flags)), ("botId", ConstructorParameterDescription(_data.botId)), ("commissionPermille", ConstructorParameterDescription(_data.commissionPermille)), ("durationMonths", ConstructorParameterDescription(_data.durationMonths)), ("endDate", ConstructorParameterDescription(_data.endDate)), ("dailyRevenuePerUser", ConstructorParameterDescription(_data.dailyRevenuePerUser))]) + } + } + + public static func parse_starRefProgram(_ reader: BufferReader) -> StarRefProgram? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } + var _6: Api.StarsAmount? + if Int(_1 ?? 0) & 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 + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_starsAmount: TypeConstructorDescription { + public var amount: Int64 + public var nanos: Int32 + public init(amount: Int64, nanos: Int32) { + self.amount = amount + self.nanos = nanos + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsAmount", [("amount", ConstructorParameterDescription(self.amount)), ("nanos", ConstructorParameterDescription(self.nanos))]) + } + } + public class Cons_starsTonAmount: TypeConstructorDescription { + public var amount: Int64 + public init(amount: Int64) { + self.amount = amount + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsTonAmount", [("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsAmount(let _data): + return ("starsAmount", [("amount", ConstructorParameterDescription(_data.amount)), ("nanos", ConstructorParameterDescription(_data.nanos))]) + case .starsTonAmount(let _data): + return ("starsTonAmount", [("amount", ConstructorParameterDescription(_data.amount))]) + } + } + + public static func parse_starsAmount(_ reader: BufferReader) -> StarsAmount? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.StarsAmount.starsAmount(Cons_starsAmount(amount: _1!, nanos: _2!)) + } + else { + return nil + } + } + public static func parse_starsTonAmount(_ reader: BufferReader) -> StarsAmount? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.StarsAmount.starsTonAmount(Cons_starsTonAmount(amount: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum StarsGiftOption: TypeConstructorDescription { + public class Cons_starsGiftOption: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsGiftOption", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsGiftOption(let _data): + return ("starsGiftOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + } + } + + 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 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: String? + _4 = parseString(reader) + var _5: Int64? + _5 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_starsGiveawayOption: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsGiveawayOption", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("yearlyBoosts", ConstructorParameterDescription(self.yearlyBoosts)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("winners", ConstructorParameterDescription(self.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.list.count)) - for item in _data.list { + buffer.appendInt32(Int32(_data.winners.count)) + for item in _data.winners { item.serialize(buffer, true) } break @@ -1611,27 +1218,39 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .todoList(let _data): - return ("todoList", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("list", ConstructorParameterDescription(_data.list))]) + case .starsGiveawayOption(let _data): + return ("starsGiveawayOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("yearlyBoosts", ConstructorParameterDescription(_data.yearlyBoosts)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("winners", ConstructorParameterDescription(_data.winners))]) } } - public static func parse_todoList(_ reader: BufferReader) -> TodoList? { + public static func parse_starsGiveawayOption(_ reader: BufferReader) -> StarsGiveawayOption? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = parseString(reader) } - var _3: [Api.TodoItem]? + var _5: String? + _5 = parseString(reader) + var _6: Int64? + _6 = reader.readInt64() + var _7: [Api.StarsGiveawayWinnersOption]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoItem.self) + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiveawayWinnersOption.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.TodoList.todoList(Cons_todoList(flags: _1!, title: _2!, list: _3!)) + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.StarsGiveawayOption.starsGiveawayOption(Cons_starsGiveawayOption(flags: _1!, stars: _2!, yearlyBoosts: _3!, storeProduct: _4, currency: _5!, amount: _6!, winners: _7!)) } else { return nil @@ -1640,179 +1259,843 @@ public extension Api { } } public extension Api { - enum TopPeer: TypeConstructorDescription { - public class Cons_topPeer: TypeConstructorDescription { - public var peer: Api.Peer - public var rating: Double - public init(peer: Api.Peer, rating: Double) { - self.peer = peer - self.rating = rating + enum StarsGiveawayWinnersOption: TypeConstructorDescription { + public class Cons_starsGiveawayWinnersOption: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("topPeer", [("peer", ConstructorParameterDescription(self.peer)), ("rating", ConstructorParameterDescription(self.rating))]) + return ("starsGiveawayWinnersOption", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("perUserStars", ConstructorParameterDescription(self.perUserStars))]) } } - case topPeer(Cons_topPeer) + case starsGiveawayWinnersOption(Cons_starsGiveawayWinnersOption) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .topPeer(let _data): + case .starsGiveawayWinnersOption(let _data): if boxed { - buffer.appendInt32(-305282981) + buffer.appendInt32(1411605001) } - _data.peer.serialize(buffer, true) - serializeDouble(_data.rating, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { switch self { - case .topPeer(let _data): - return ("topPeer", [("peer", ConstructorParameterDescription(_data.peer)), ("rating", ConstructorParameterDescription(_data.rating))]) + case .starsGiveawayWinnersOption(let _data): + return ("starsGiveawayWinnersOption", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("perUserStars", ConstructorParameterDescription(_data.perUserStars))]) } } - public static func parse_topPeer(_ reader: BufferReader) -> TopPeer? { + public static func parse_starsGiveawayWinnersOption(_ reader: BufferReader) -> StarsGiveawayWinnersOption? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.StarsGiveawayWinnersOption.starsGiveawayWinnersOption(Cons_starsGiveawayWinnersOption(flags: _1!, users: _2!, perUserStars: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum StarsRating: TypeConstructorDescription { + public class Cons_starsRating: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsRating", [("flags", ConstructorParameterDescription(self.flags)), ("level", ConstructorParameterDescription(self.level)), ("currentLevelStars", ConstructorParameterDescription(self.currentLevelStars)), ("stars", ConstructorParameterDescription(self.stars)), ("nextLevelStars", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsRating(let _data): + return ("starsRating", [("flags", ConstructorParameterDescription(_data.flags)), ("level", ConstructorParameterDescription(_data.level)), ("currentLevelStars", ConstructorParameterDescription(_data.currentLevelStars)), ("stars", ConstructorParameterDescription(_data.stars)), ("nextLevelStars", ConstructorParameterDescription(_data.nextLevelStars))]) + } + } + + public static func parse_starsRating(_ reader: BufferReader) -> StarsRating? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int64? + _4 = reader.readInt64() + var _5: Int64? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_starsRevenueStatus: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsRevenueStatus", [("flags", ConstructorParameterDescription(self.flags)), ("currentBalance", ConstructorParameterDescription(self.currentBalance)), ("availableBalance", ConstructorParameterDescription(self.availableBalance)), ("overallRevenue", ConstructorParameterDescription(self.overallRevenue)), ("nextWithdrawalAt", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsRevenueStatus(let _data): + return ("starsRevenueStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("currentBalance", ConstructorParameterDescription(_data.currentBalance)), ("availableBalance", ConstructorParameterDescription(_data.availableBalance)), ("overallRevenue", ConstructorParameterDescription(_data.overallRevenue)), ("nextWithdrawalAt", ConstructorParameterDescription(_data.nextWithdrawalAt))]) + } + } + + public static func parse_starsRevenueStatus(_ reader: BufferReader) -> StarsRevenueStatus? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StarsAmount? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + var _3: Api.StarsAmount? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + var _4: Api.StarsAmount? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + var _5: Int32? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_starsSubscription: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsSubscription", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("peer", ConstructorParameterDescription(self.peer)), ("untilDate", ConstructorParameterDescription(self.untilDate)), ("pricing", ConstructorParameterDescription(self.pricing)), ("chatInviteHash", ConstructorParameterDescription(self.chatInviteHash)), ("title", ConstructorParameterDescription(self.title)), ("photo", ConstructorParameterDescription(self.photo)), ("invoiceSlug", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsSubscription(let _data): + return ("starsSubscription", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("peer", ConstructorParameterDescription(_data.peer)), ("untilDate", ConstructorParameterDescription(_data.untilDate)), ("pricing", ConstructorParameterDescription(_data.pricing)), ("chatInviteHash", ConstructorParameterDescription(_data.chatInviteHash)), ("title", ConstructorParameterDescription(_data.title)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoiceSlug", ConstructorParameterDescription(_data.invoiceSlug))]) + } + } + + public static func parse_starsSubscription(_ reader: BufferReader) -> StarsSubscription? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Api.Peer? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Api.StarsSubscriptionPricing? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.StarsSubscriptionPricing + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _6 = parseString(reader) + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _7 = parseString(reader) + } + var _8: Api.WebDocument? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } + var _9: String? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _9 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 { + public class Cons_starsSubscriptionPricing: TypeConstructorDescription { + public var period: Int32 + public var amount: Int64 + public init(period: Int32, amount: Int64) { + self.period = period + self.amount = amount + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsSubscriptionPricing", [("period", ConstructorParameterDescription(self.period)), ("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsSubscriptionPricing(let _data): + return ("starsSubscriptionPricing", [("period", ConstructorParameterDescription(_data.period)), ("amount", ConstructorParameterDescription(_data.amount))]) + } + } + + public static func parse_starsSubscriptionPricing(_ reader: BufferReader) -> StarsSubscriptionPricing? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.StarsSubscriptionPricing.starsSubscriptionPricing(Cons_starsSubscriptionPricing(period: _1!, amount: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum StarsTopupOption: TypeConstructorDescription { + public class Cons_starsTopupOption: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsTopupOption", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars)), ("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsTopupOption(let _data): + return ("starsTopupOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + } + } + + 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 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: String? + _4 = parseString(reader) + var _5: Int64? + _5 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_starsTransaction: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsTransaction", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("amount", ConstructorParameterDescription(self.amount)), ("date", ConstructorParameterDescription(self.date)), ("peer", ConstructorParameterDescription(self.peer)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("transactionDate", ConstructorParameterDescription(self.transactionDate)), ("transactionUrl", ConstructorParameterDescription(self.transactionUrl)), ("botPayload", ConstructorParameterDescription(self.botPayload)), ("msgId", ConstructorParameterDescription(self.msgId)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia)), ("subscriptionPeriod", ConstructorParameterDescription(self.subscriptionPeriod)), ("giveawayPostId", ConstructorParameterDescription(self.giveawayPostId)), ("stargift", ConstructorParameterDescription(self.stargift)), ("floodskipNumber", ConstructorParameterDescription(self.floodskipNumber)), ("starrefCommissionPermille", ConstructorParameterDescription(self.starrefCommissionPermille)), ("starrefPeer", ConstructorParameterDescription(self.starrefPeer)), ("starrefAmount", ConstructorParameterDescription(self.starrefAmount)), ("paidMessages", ConstructorParameterDescription(self.paidMessages)), ("premiumGiftMonths", ConstructorParameterDescription(self.premiumGiftMonths)), ("adsProceedsFromDate", ConstructorParameterDescription(self.adsProceedsFromDate)), ("adsProceedsToDate", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { + switch self { + case .starsTransaction(let _data): + return ("starsTransaction", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("amount", ConstructorParameterDescription(_data.amount)), ("date", ConstructorParameterDescription(_data.date)), ("peer", ConstructorParameterDescription(_data.peer)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("transactionDate", ConstructorParameterDescription(_data.transactionDate)), ("transactionUrl", ConstructorParameterDescription(_data.transactionUrl)), ("botPayload", ConstructorParameterDescription(_data.botPayload)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia)), ("subscriptionPeriod", ConstructorParameterDescription(_data.subscriptionPeriod)), ("giveawayPostId", ConstructorParameterDescription(_data.giveawayPostId)), ("stargift", ConstructorParameterDescription(_data.stargift)), ("floodskipNumber", ConstructorParameterDescription(_data.floodskipNumber)), ("starrefCommissionPermille", ConstructorParameterDescription(_data.starrefCommissionPermille)), ("starrefPeer", ConstructorParameterDescription(_data.starrefPeer)), ("starrefAmount", ConstructorParameterDescription(_data.starrefAmount)), ("paidMessages", ConstructorParameterDescription(_data.paidMessages)), ("premiumGiftMonths", ConstructorParameterDescription(_data.premiumGiftMonths)), ("adsProceedsFromDate", ConstructorParameterDescription(_data.adsProceedsFromDate)), ("adsProceedsToDate", ConstructorParameterDescription(_data.adsProceedsToDate))]) + } + } + + public static func parse_starsTransaction(_ reader: BufferReader) -> StarsTransaction? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Api.StarsAmount? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Api.StarsTransactionPeer? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.StarsTransactionPeer + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } + var _8: Api.WebDocument? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.WebDocument + } + } + var _9: Int32? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _9 = reader.readInt32() + } + var _10: String? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _10 = parseString(reader) + } + var _11: Buffer? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + _11 = parseBytes(reader) + } + var _12: Int32? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _12 = reader.readInt32() + } + var _13: [Api.MessageMedia]? + if Int(_1 ?? 0) & Int(1 << 9) != 0 { + if let _ = reader.readInt32() { + _13 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageMedia.self) + } + } + var _14: Int32? + if Int(_1 ?? 0) & Int(1 << 12) != 0 { + _14 = reader.readInt32() + } + var _15: Int32? + if Int(_1 ?? 0) & Int(1 << 13) != 0 { + _15 = reader.readInt32() + } + var _16: Api.StarGift? + if Int(_1 ?? 0) & Int(1 << 14) != 0 { + if let signature = reader.readInt32() { + _16 = Api.parse(reader, signature: signature) as? Api.StarGift + } + } + var _17: Int32? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + _17 = reader.readInt32() + } + var _18: Int32? + if Int(_1 ?? 0) & Int(1 << 16) != 0 { + _18 = reader.readInt32() + } + var _19: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 17) != 0 { + if let signature = reader.readInt32() { + _20 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } + var _21: Int32? + if Int(_1 ?? 0) & Int(1 << 19) != 0 { + _21 = reader.readInt32() + } + var _22: Int32? + if Int(_1 ?? 0) & Int(1 << 20) != 0 { + _22 = reader.readInt32() + } + var _23: Int32? + if Int(_1 ?? 0) & Int(1 << 23) != 0 { + _23 = reader.readInt32() + } + var _24: Int32? + if Int(_1 ?? 0) & Int(1 << 23) != 0 { + _24 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 12) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 13) == 0) || _15 != nil + let _c16 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _16 != nil + let _c17 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _17 != nil + let _c18 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _18 != nil + let _c19 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _19 != nil + let _c20 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _20 != nil + let _c21 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _21 != nil + let _c22 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _22 != nil + let _c23 = (Int(_1 ?? 0) & Int(1 << 23) == 0) || _23 != nil + let _c24 = (Int(_1 ?? 0) & 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(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 { + public class Cons_starsTransactionPeer: TypeConstructorDescription { + public var peer: Api.Peer + public init(peer: Api.Peer) { + self.peer = peer + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsTransactionPeer", [("peer", ConstructorParameterDescription(self.peer))]) + } + } + case starsTransactionPeer(Cons_starsTransactionPeer) + case starsTransactionPeerAPI + case starsTransactionPeerAds + case starsTransactionPeerAppStore + case starsTransactionPeerFragment + case starsTransactionPeerPlayMarket + case starsTransactionPeerPremiumBot + case starsTransactionPeerUnsupported + + 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, ConstructorParameterDescription)]) { + switch self { + case .starsTransactionPeer(let _data): + return ("starsTransactionPeer", [("peer", ConstructorParameterDescription(_data.peer))]) + case .starsTransactionPeerAPI: + return ("starsTransactionPeerAPI", []) + case .starsTransactionPeerAds: + return ("starsTransactionPeerAds", []) + case .starsTransactionPeerAppStore: + return ("starsTransactionPeerAppStore", []) + case .starsTransactionPeerFragment: + return ("starsTransactionPeerFragment", []) + case .starsTransactionPeerPlayMarket: + return ("starsTransactionPeerPlayMarket", []) + case .starsTransactionPeerPremiumBot: + return ("starsTransactionPeerPremiumBot", []) + case .starsTransactionPeerUnsupported: + return ("starsTransactionPeerUnsupported", []) + } + } + + public static func parse_starsTransactionPeer(_ reader: BufferReader) -> StarsTransactionPeer? { var _1: Api.Peer? if let signature = reader.readInt32() { _1 = Api.parse(reader, signature: signature) as? Api.Peer } - var _2: Double? - _2 = reader.readDouble() let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.TopPeer.topPeer(Cons_topPeer(peer: _1!, rating: _2!)) + if _c1 { + return Api.StarsTransactionPeer.starsTransactionPeer(Cons_starsTransactionPeer(peer: _1!)) } else { return nil } } - } -} -public extension Api { - enum TopPeerCategory: TypeConstructorDescription { - case topPeerCategoryBotsApp - case topPeerCategoryBotsGuestChat - case topPeerCategoryBotsInline - case topPeerCategoryBotsPM - case topPeerCategoryChannels - case topPeerCategoryCorrespondents - case topPeerCategoryForwardChats - 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 .topPeerCategoryBotsGuestChat: - if boxed { - buffer.appendInt32(1814361053) - } - 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 static func parse_starsTransactionPeerAPI(_ reader: BufferReader) -> StarsTransactionPeer? { + return Api.StarsTransactionPeer.starsTransactionPeerAPI } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .topPeerCategoryBotsApp: - return ("topPeerCategoryBotsApp", []) - case .topPeerCategoryBotsGuestChat: - return ("topPeerCategoryBotsGuestChat", []) - case .topPeerCategoryBotsInline: - return ("topPeerCategoryBotsInline", []) - case .topPeerCategoryBotsPM: - return ("topPeerCategoryBotsPM", []) - case .topPeerCategoryChannels: - return ("topPeerCategoryChannels", []) - case .topPeerCategoryCorrespondents: - return ("topPeerCategoryCorrespondents", []) - case .topPeerCategoryForwardChats: - return ("topPeerCategoryForwardChats", []) - case .topPeerCategoryForwardUsers: - return ("topPeerCategoryForwardUsers", []) - case .topPeerCategoryGroups: - return ("topPeerCategoryGroups", []) - case .topPeerCategoryPhoneCalls: - return ("topPeerCategoryPhoneCalls", []) - } + public static func parse_starsTransactionPeerAds(_ reader: BufferReader) -> StarsTransactionPeer? { + return Api.StarsTransactionPeer.starsTransactionPeerAds } - - public static func parse_topPeerCategoryBotsApp(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryBotsApp + public static func parse_starsTransactionPeerAppStore(_ reader: BufferReader) -> StarsTransactionPeer? { + return Api.StarsTransactionPeer.starsTransactionPeerAppStore } - public static func parse_topPeerCategoryBotsGuestChat(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryBotsGuestChat + public static func parse_starsTransactionPeerFragment(_ reader: BufferReader) -> StarsTransactionPeer? { + return Api.StarsTransactionPeer.starsTransactionPeerFragment } - public static func parse_topPeerCategoryBotsInline(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryBotsInline + public static func parse_starsTransactionPeerPlayMarket(_ reader: BufferReader) -> StarsTransactionPeer? { + return Api.StarsTransactionPeer.starsTransactionPeerPlayMarket } - public static func parse_topPeerCategoryBotsPM(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryBotsPM + public static func parse_starsTransactionPeerPremiumBot(_ reader: BufferReader) -> StarsTransactionPeer? { + return Api.StarsTransactionPeer.starsTransactionPeerPremiumBot } - public static func parse_topPeerCategoryChannels(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryChannels - } - public static func parse_topPeerCategoryCorrespondents(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryCorrespondents - } - public static func parse_topPeerCategoryForwardChats(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryForwardChats - } - public static func parse_topPeerCategoryForwardUsers(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryForwardUsers - } - public static func parse_topPeerCategoryGroups(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryGroups - } - public static func parse_topPeerCategoryPhoneCalls(_ reader: BufferReader) -> TopPeerCategory? { - return Api.TopPeerCategory.topPeerCategoryPhoneCalls + public static func parse_starsTransactionPeerUnsupported(_ reader: BufferReader) -> StarsTransactionPeer? { + return Api.StarsTransactionPeer.starsTransactionPeerUnsupported } } } diff --git a/submodules/TelegramApi/Sources/Api28.swift b/submodules/TelegramApi/Sources/Api28.swift index 9412289751..cb92c9896d 100644 --- a/submodules/TelegramApi/Sources/Api28.swift +++ b/submodules/TelegramApi/Sources/Api28.swift @@ -1,60 +1,46 @@ public extension Api { - enum TopPeerCategoryPeers: TypeConstructorDescription { - public class Cons_topPeerCategoryPeers: TypeConstructorDescription { - 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 + enum StatsAbsValueAndPrev: TypeConstructorDescription { + public class Cons_statsAbsValueAndPrev: TypeConstructorDescription { + public var current: Double + public var previous: Double + public init(current: Double, previous: Double) { + self.current = current + self.previous = previous } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("topPeerCategoryPeers", [("category", ConstructorParameterDescription(self.category)), ("count", ConstructorParameterDescription(self.count)), ("peers", ConstructorParameterDescription(self.peers))]) + return ("statsAbsValueAndPrev", [("current", ConstructorParameterDescription(self.current)), ("previous", ConstructorParameterDescription(self.previous))]) } } - case topPeerCategoryPeers(Cons_topPeerCategoryPeers) + case statsAbsValueAndPrev(Cons_statsAbsValueAndPrev) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .topPeerCategoryPeers(let _data): + case .statsAbsValueAndPrev(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) + buffer.appendInt32(-884757282) } + serializeDouble(_data.current, buffer: buffer, boxed: false) + serializeDouble(_data.previous, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .topPeerCategoryPeers(let _data): - return ("topPeerCategoryPeers", [("category", ConstructorParameterDescription(_data.category)), ("count", ConstructorParameterDescription(_data.count)), ("peers", ConstructorParameterDescription(_data.peers))]) + case .statsAbsValueAndPrev(let _data): + return ("statsAbsValueAndPrev", [("current", ConstructorParameterDescription(_data.current)), ("previous", ConstructorParameterDescription(_data.previous))]) } } - public static func parse_topPeerCategoryPeers(_ reader: BufferReader) -> TopPeerCategoryPeers? { - var _1: Api.TopPeerCategory? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.TopPeerCategory - } - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.TopPeer]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TopPeer.self) - } + public static func parse_statsAbsValueAndPrev(_ reader: BufferReader) -> StatsAbsValueAndPrev? { + var _1: Double? + _1 = reader.readDouble() + var _2: Double? + _2 = reader.readDouble() let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.TopPeerCategoryPeers.topPeerCategoryPeers(Cons_topPeerCategoryPeers(category: _1!, count: _2!, peers: _3!)) + if _c1 && _c2 { + return Api.StatsAbsValueAndPrev.statsAbsValueAndPrev(Cons_statsAbsValueAndPrev(current: _1!, previous: _2!)) } else { return nil @@ -63,6160 +49,218 @@ public extension Api { } } public extension Api { - indirect enum Update: TypeConstructorDescription { - public class Cons_updateBotBusinessConnect: TypeConstructorDescription { - public var connection: Api.BotBusinessConnection - public var qts: Int32 - public init(connection: Api.BotBusinessConnection, qts: Int32) { - self.connection = connection - self.qts = qts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotBusinessConnect", [("connection", ConstructorParameterDescription(self.connection)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotCallbackQuery: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotCallbackQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("chatInstance", ConstructorParameterDescription(self.chatInstance)), ("data", ConstructorParameterDescription(self.data)), ("gameShortName", ConstructorParameterDescription(self.gameShortName))]) - } - } - public class Cons_updateBotChatBoost: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotChatBoost", [("peer", ConstructorParameterDescription(self.peer)), ("boost", ConstructorParameterDescription(self.boost)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotChatInviteRequester: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotChatInviteRequester", [("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date)), ("userId", ConstructorParameterDescription(self.userId)), ("about", ConstructorParameterDescription(self.about)), ("invite", ConstructorParameterDescription(self.invite)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotCommands: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotCommands", [("peer", ConstructorParameterDescription(self.peer)), ("botId", ConstructorParameterDescription(self.botId)), ("commands", ConstructorParameterDescription(self.commands))]) - } - } - public class Cons_updateBotDeleteBusinessMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotDeleteBusinessMessage", [("connectionId", ConstructorParameterDescription(self.connectionId)), ("peer", ConstructorParameterDescription(self.peer)), ("messages", ConstructorParameterDescription(self.messages)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotEditBusinessMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotEditBusinessMessage", [("flags", ConstructorParameterDescription(self.flags)), ("connectionId", ConstructorParameterDescription(self.connectionId)), ("message", ConstructorParameterDescription(self.message)), ("replyToMessage", ConstructorParameterDescription(self.replyToMessage)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotGuestChatQuery: TypeConstructorDescription { - public var flags: Int32 - public var queryId: Int64 - public var message: Api.Message - public var referenceMessages: [Api.Message]? - public var qts: Int32 - public init(flags: Int32, queryId: Int64, message: Api.Message, referenceMessages: [Api.Message]?, qts: Int32) { - self.flags = flags - self.queryId = queryId - self.message = message - self.referenceMessages = referenceMessages - self.qts = qts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotGuestChatQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("message", ConstructorParameterDescription(self.message)), ("referenceMessages", ConstructorParameterDescription(self.referenceMessages)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotInlineQuery: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotInlineQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("query", ConstructorParameterDescription(self.query)), ("geo", ConstructorParameterDescription(self.geo)), ("peerType", ConstructorParameterDescription(self.peerType)), ("offset", ConstructorParameterDescription(self.offset))]) - } - } - public class Cons_updateBotInlineSend: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotInlineSend", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("query", ConstructorParameterDescription(self.query)), ("geo", ConstructorParameterDescription(self.geo)), ("id", ConstructorParameterDescription(self.id)), ("msgId", ConstructorParameterDescription(self.msgId))]) - } - } - public class Cons_updateBotMenuButton: TypeConstructorDescription { - public var botId: Int64 - public var button: Api.BotMenuButton - public init(botId: Int64, button: Api.BotMenuButton) { - self.botId = botId - self.button = button - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotMenuButton", [("botId", ConstructorParameterDescription(self.botId)), ("button", ConstructorParameterDescription(self.button))]) - } - } - public class Cons_updateBotMessageReaction: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotMessageReaction", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("date", ConstructorParameterDescription(self.date)), ("actor", ConstructorParameterDescription(self.actor)), ("oldReactions", ConstructorParameterDescription(self.oldReactions)), ("newReactions", ConstructorParameterDescription(self.newReactions)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotMessageReactions: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotMessageReactions", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("date", ConstructorParameterDescription(self.date)), ("reactions", ConstructorParameterDescription(self.reactions)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotNewBusinessMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotNewBusinessMessage", [("flags", ConstructorParameterDescription(self.flags)), ("connectionId", ConstructorParameterDescription(self.connectionId)), ("message", ConstructorParameterDescription(self.message)), ("replyToMessage", ConstructorParameterDescription(self.replyToMessage)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotPrecheckoutQuery: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotPrecheckoutQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("payload", ConstructorParameterDescription(self.payload)), ("info", ConstructorParameterDescription(self.info)), ("shippingOptionId", ConstructorParameterDescription(self.shippingOptionId)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount))]) - } - } - public class Cons_updateBotPurchasedPaidMedia: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotPurchasedPaidMedia", [("userId", ConstructorParameterDescription(self.userId)), ("payload", ConstructorParameterDescription(self.payload)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotShippingQuery: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotShippingQuery", [("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("payload", ConstructorParameterDescription(self.payload)), ("shippingAddress", ConstructorParameterDescription(self.shippingAddress))]) - } - } - public class Cons_updateBotStopped: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotStopped", [("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.date)), ("stopped", ConstructorParameterDescription(self.stopped)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateBotWebhookJSON: TypeConstructorDescription { - public var data: Api.DataJSON - public init(data: Api.DataJSON) { - self.data = data - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotWebhookJSON", [("data", ConstructorParameterDescription(self.data))]) - } - } - public class Cons_updateBotWebhookJSONQuery: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBotWebhookJSONQuery", [("queryId", ConstructorParameterDescription(self.queryId)), ("data", ConstructorParameterDescription(self.data)), ("timeout", ConstructorParameterDescription(self.timeout))]) - } - } - public class Cons_updateBusinessBotCallbackQuery: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateBusinessBotCallbackQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("connectionId", ConstructorParameterDescription(self.connectionId)), ("message", ConstructorParameterDescription(self.message)), ("replyToMessage", ConstructorParameterDescription(self.replyToMessage)), ("chatInstance", ConstructorParameterDescription(self.chatInstance)), ("data", ConstructorParameterDescription(self.data))]) - } - } - public class Cons_updateChannel: TypeConstructorDescription { - public var channelId: Int64 - public init(channelId: Int64) { - self.channelId = channelId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannel", [("channelId", ConstructorParameterDescription(self.channelId))]) - } - } - public class Cons_updateChannelAvailableMessages: TypeConstructorDescription { - public var channelId: Int64 - public var availableMinId: Int32 - public init(channelId: Int64, availableMinId: Int32) { - self.channelId = channelId - self.availableMinId = availableMinId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelAvailableMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("availableMinId", ConstructorParameterDescription(self.availableMinId))]) - } - } - public class Cons_updateChannelMessageForwards: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelMessageForwards", [("channelId", ConstructorParameterDescription(self.channelId)), ("id", ConstructorParameterDescription(self.id)), ("forwards", ConstructorParameterDescription(self.forwards))]) - } - } - public class Cons_updateChannelMessageViews: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelMessageViews", [("channelId", ConstructorParameterDescription(self.channelId)), ("id", ConstructorParameterDescription(self.id)), ("views", ConstructorParameterDescription(self.views))]) - } - } - public class Cons_updateChannelParticipant: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelParticipant", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("date", ConstructorParameterDescription(self.date)), ("actorId", ConstructorParameterDescription(self.actorId)), ("userId", ConstructorParameterDescription(self.userId)), ("prevParticipant", ConstructorParameterDescription(self.prevParticipant)), ("newParticipant", ConstructorParameterDescription(self.newParticipant)), ("invite", ConstructorParameterDescription(self.invite)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateChannelReadMessagesContents: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelReadMessagesContents", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("messages", ConstructorParameterDescription(self.messages))]) - } - } - public class Cons_updateChannelTooLong: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelTooLong", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("pts", ConstructorParameterDescription(self.pts))]) - } - } - public class Cons_updateChannelUserTyping: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelUserTyping", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("fromId", ConstructorParameterDescription(self.fromId)), ("action", ConstructorParameterDescription(self.action))]) - } - } - public class Cons_updateChannelViewForumAsMessages: TypeConstructorDescription { - public var channelId: Int64 - public var enabled: Api.Bool - public init(channelId: Int64, enabled: Api.Bool) { - self.channelId = channelId - self.enabled = enabled - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelViewForumAsMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("enabled", ConstructorParameterDescription(self.enabled))]) - } - } - public class Cons_updateChannelWebPage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChannelWebPage", [("channelId", ConstructorParameterDescription(self.channelId)), ("webpage", ConstructorParameterDescription(self.webpage)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateChat: TypeConstructorDescription { - public var chatId: Int64 - public init(chatId: Int64) { - self.chatId = chatId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChat", [("chatId", ConstructorParameterDescription(self.chatId))]) - } - } - public class Cons_updateChatDefaultBannedRights: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatDefaultBannedRights", [("peer", ConstructorParameterDescription(self.peer)), ("defaultBannedRights", ConstructorParameterDescription(self.defaultBannedRights)), ("version", ConstructorParameterDescription(self.version))]) - } - } - public class Cons_updateChatParticipant: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatParticipant", [("flags", ConstructorParameterDescription(self.flags)), ("chatId", ConstructorParameterDescription(self.chatId)), ("date", ConstructorParameterDescription(self.date)), ("actorId", ConstructorParameterDescription(self.actorId)), ("userId", ConstructorParameterDescription(self.userId)), ("prevParticipant", ConstructorParameterDescription(self.prevParticipant)), ("newParticipant", ConstructorParameterDescription(self.newParticipant)), ("invite", ConstructorParameterDescription(self.invite)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateChatParticipantAdd: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatParticipantAdd", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("inviterId", ConstructorParameterDescription(self.inviterId)), ("date", ConstructorParameterDescription(self.date)), ("version", ConstructorParameterDescription(self.version))]) - } - } - public class Cons_updateChatParticipantAdmin: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatParticipantAdmin", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("isAdmin", ConstructorParameterDescription(self.isAdmin)), ("version", ConstructorParameterDescription(self.version))]) - } - } - public class Cons_updateChatParticipantDelete: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatParticipantDelete", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("version", ConstructorParameterDescription(self.version))]) - } - } - public class Cons_updateChatParticipantRank: TypeConstructorDescription { - public var chatId: Int64 - public var userId: Int64 - public var rank: String - public var version: Int32 - public init(chatId: Int64, userId: Int64, rank: String, version: Int32) { - self.chatId = chatId - self.userId = userId - self.rank = rank - self.version = version - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatParticipantRank", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("rank", ConstructorParameterDescription(self.rank)), ("version", ConstructorParameterDescription(self.version))]) - } - } - public class Cons_updateChatParticipants: TypeConstructorDescription { - public var participants: Api.ChatParticipants - public init(participants: Api.ChatParticipants) { - self.participants = participants - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatParticipants", [("participants", ConstructorParameterDescription(self.participants))]) - } - } - public class Cons_updateChatUserTyping: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateChatUserTyping", [("chatId", ConstructorParameterDescription(self.chatId)), ("fromId", ConstructorParameterDescription(self.fromId)), ("action", ConstructorParameterDescription(self.action))]) - } - } - public class Cons_updateDcOptions: TypeConstructorDescription { - public var dcOptions: [Api.DcOption] - public init(dcOptions: [Api.DcOption]) { - self.dcOptions = dcOptions - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDcOptions", [("dcOptions", ConstructorParameterDescription(self.dcOptions))]) - } - } - public class Cons_updateDeleteChannelMessages: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDeleteChannelMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateDeleteGroupCallMessages: TypeConstructorDescription { - public var call: Api.InputGroupCall - public var messages: [Int32] - public init(call: Api.InputGroupCall, messages: [Int32]) { - self.call = call - self.messages = messages - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDeleteGroupCallMessages", [("call", ConstructorParameterDescription(self.call)), ("messages", ConstructorParameterDescription(self.messages))]) - } - } - public class Cons_updateDeleteMessages: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDeleteMessages", [("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateDeleteQuickReply: TypeConstructorDescription { - public var shortcutId: Int32 - public init(shortcutId: Int32) { - self.shortcutId = shortcutId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDeleteQuickReply", [("shortcutId", ConstructorParameterDescription(self.shortcutId))]) - } - } - public class Cons_updateDeleteQuickReplyMessages: TypeConstructorDescription { - public var shortcutId: Int32 - public var messages: [Int32] - public init(shortcutId: Int32, messages: [Int32]) { - self.shortcutId = shortcutId - self.messages = messages - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDeleteQuickReplyMessages", [("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("messages", ConstructorParameterDescription(self.messages))]) - } - } - public class Cons_updateDeleteScheduledMessages: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDeleteScheduledMessages", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("messages", ConstructorParameterDescription(self.messages)), ("sentMessages", ConstructorParameterDescription(self.sentMessages))]) - } - } - public class Cons_updateDialogFilter: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDialogFilter", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("filter", ConstructorParameterDescription(self.filter))]) - } - } - public class Cons_updateDialogFilterOrder: TypeConstructorDescription { - public var order: [Int32] - public init(order: [Int32]) { - self.order = order - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDialogFilterOrder", [("order", ConstructorParameterDescription(self.order))]) - } - } - public class Cons_updateDialogPinned: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDialogPinned", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("peer", ConstructorParameterDescription(self.peer))]) - } - } - public class Cons_updateDialogUnreadMark: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDialogUnreadMark", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId))]) - } - } - public class Cons_updateDraftMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateDraftMessage", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("draft", ConstructorParameterDescription(self.draft))]) - } - } - public class Cons_updateEditChannelMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateEditChannelMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateEditMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateEditMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateEmojiGameInfo: TypeConstructorDescription { - public var info: Api.messages.EmojiGameInfo - public init(info: Api.messages.EmojiGameInfo) { - self.info = info - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateEmojiGameInfo", [("info", ConstructorParameterDescription(self.info))]) - } - } - public class Cons_updateEncryptedChatTyping: TypeConstructorDescription { - public var chatId: Int32 - public init(chatId: Int32) { - self.chatId = chatId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateEncryptedChatTyping", [("chatId", ConstructorParameterDescription(self.chatId))]) - } - } - public class Cons_updateEncryptedMessagesRead: TypeConstructorDescription { - public var chatId: Int32 + enum StatsDateRangeDays: TypeConstructorDescription { + public class Cons_statsDateRangeDays: TypeConstructorDescription { + public var minDate: Int32 public var maxDate: Int32 - public var date: Int32 - public init(chatId: Int32, maxDate: Int32, date: Int32) { - self.chatId = chatId + public init(minDate: Int32, maxDate: Int32) { + self.minDate = minDate self.maxDate = maxDate - self.date = date } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateEncryptedMessagesRead", [("chatId", ConstructorParameterDescription(self.chatId)), ("maxDate", ConstructorParameterDescription(self.maxDate)), ("date", ConstructorParameterDescription(self.date))]) + return ("statsDateRangeDays", [("minDate", ConstructorParameterDescription(self.minDate)), ("maxDate", ConstructorParameterDescription(self.maxDate))]) } } - public class Cons_updateEncryption: TypeConstructorDescription { - public var chat: Api.EncryptedChat - public var date: Int32 - public init(chat: Api.EncryptedChat, date: Int32) { - self.chat = chat - self.date = date - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateEncryption", [("chat", ConstructorParameterDescription(self.chat)), ("date", ConstructorParameterDescription(self.date))]) - } - } - public class Cons_updateFolderPeers: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateFolderPeers", [("folderPeers", ConstructorParameterDescription(self.folderPeers)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateGeoLiveViewed: TypeConstructorDescription { - public var peer: Api.Peer - public var msgId: Int32 - public init(peer: Api.Peer, msgId: Int32) { - self.peer = peer - self.msgId = msgId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateGeoLiveViewed", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId))]) - } - } - public class Cons_updateGroupCall: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateGroupCall", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("call", ConstructorParameterDescription(self.call))]) - } - } - public class Cons_updateGroupCallChainBlocks: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateGroupCallChainBlocks", [("call", ConstructorParameterDescription(self.call)), ("subChainId", ConstructorParameterDescription(self.subChainId)), ("blocks", ConstructorParameterDescription(self.blocks)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) - } - } - public class Cons_updateGroupCallConnection: TypeConstructorDescription { - public var flags: Int32 - public var params: Api.DataJSON - public init(flags: Int32, params: Api.DataJSON) { - self.flags = flags - self.params = params - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateGroupCallConnection", [("flags", ConstructorParameterDescription(self.flags)), ("params", ConstructorParameterDescription(self.params))]) - } - } - public class Cons_updateGroupCallEncryptedMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateGroupCallEncryptedMessage", [("call", ConstructorParameterDescription(self.call)), ("fromId", ConstructorParameterDescription(self.fromId)), ("encryptedMessage", ConstructorParameterDescription(self.encryptedMessage))]) - } - } - public class Cons_updateGroupCallMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateGroupCallMessage", [("call", ConstructorParameterDescription(self.call)), ("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_updateGroupCallParticipants: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateGroupCallParticipants", [("call", ConstructorParameterDescription(self.call)), ("participants", ConstructorParameterDescription(self.participants)), ("version", ConstructorParameterDescription(self.version))]) - } - } - public class Cons_updateInlineBotCallbackQuery: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateInlineBotCallbackQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("msgId", ConstructorParameterDescription(self.msgId)), ("chatInstance", ConstructorParameterDescription(self.chatInstance)), ("data", ConstructorParameterDescription(self.data)), ("gameShortName", ConstructorParameterDescription(self.gameShortName))]) - } - } - public class Cons_updateLangPack: TypeConstructorDescription { - public var difference: Api.LangPackDifference - public init(difference: Api.LangPackDifference) { - self.difference = difference - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateLangPack", [("difference", ConstructorParameterDescription(self.difference))]) - } - } - public class Cons_updateLangPackTooLong: TypeConstructorDescription { - public var langCode: String - public init(langCode: String) { - self.langCode = langCode - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateLangPackTooLong", [("langCode", ConstructorParameterDescription(self.langCode))]) - } - } - public class Cons_updateManagedBot: TypeConstructorDescription { - public var userId: Int64 - public var botId: Int64 - public var qts: Int32 - public init(userId: Int64, botId: Int64, qts: Int32) { - self.userId = userId - self.botId = botId - self.qts = qts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateManagedBot", [("userId", ConstructorParameterDescription(self.userId)), ("botId", ConstructorParameterDescription(self.botId)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateMessageExtendedMedia: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateMessageExtendedMedia", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) - } - } - public class Cons_updateMessageID: TypeConstructorDescription { - public var id: Int32 - public var randomId: Int64 - public init(id: Int32, randomId: Int64) { - self.id = id - self.randomId = randomId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateMessageID", [("id", ConstructorParameterDescription(self.id)), ("randomId", ConstructorParameterDescription(self.randomId))]) - } - } - public class Cons_updateMessagePoll: TypeConstructorDescription { - public var flags: Int32 - public var peer: Api.Peer? - public var msgId: Int32? - public var topMsgId: Int32? - public var pollId: Int64 - public var poll: Api.Poll? - public var results: Api.PollResults - public init(flags: Int32, peer: Api.Peer?, msgId: Int32?, topMsgId: Int32?, pollId: Int64, poll: Api.Poll?, results: Api.PollResults) { - self.flags = flags - self.peer = peer - self.msgId = msgId - self.topMsgId = topMsgId - self.pollId = pollId - self.poll = poll - self.results = results - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateMessagePoll", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("pollId", ConstructorParameterDescription(self.pollId)), ("poll", ConstructorParameterDescription(self.poll)), ("results", ConstructorParameterDescription(self.results))]) - } - } - public class Cons_updateMessagePollVote: TypeConstructorDescription { - public var pollId: Int64 - public var peer: Api.Peer - public var options: [Buffer] - public var positions: [Int32] - public var qts: Int32 - public init(pollId: Int64, peer: Api.Peer, options: [Buffer], positions: [Int32], qts: Int32) { - self.pollId = pollId - self.peer = peer - self.options = options - self.positions = positions - self.qts = qts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateMessagePollVote", [("pollId", ConstructorParameterDescription(self.pollId)), ("peer", ConstructorParameterDescription(self.peer)), ("options", ConstructorParameterDescription(self.options)), ("positions", ConstructorParameterDescription(self.positions)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateMessageReactions: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateMessageReactions", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("reactions", ConstructorParameterDescription(self.reactions))]) - } - } - public class Cons_updateMonoForumNoPaidException: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateMonoForumNoPaidException", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId))]) - } - } - public class Cons_updateMoveStickerSetToTop: TypeConstructorDescription { - public var flags: Int32 - public var stickerset: Int64 - public init(flags: Int32, stickerset: Int64) { - self.flags = flags - self.stickerset = stickerset - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateMoveStickerSetToTop", [("flags", ConstructorParameterDescription(self.flags)), ("stickerset", ConstructorParameterDescription(self.stickerset))]) - } - } - public class Cons_updateNewAuthorization: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewAuthorization", [("flags", ConstructorParameterDescription(self.flags)), ("hash", ConstructorParameterDescription(self.hash)), ("date", ConstructorParameterDescription(self.date)), ("device", ConstructorParameterDescription(self.device)), ("location", ConstructorParameterDescription(self.location))]) - } - } - public class Cons_updateNewChannelMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewChannelMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateNewEncryptedMessage: TypeConstructorDescription { - public var message: Api.EncryptedMessage - public var qts: Int32 - public init(message: Api.EncryptedMessage, qts: Int32) { - self.message = message - self.qts = qts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewEncryptedMessage", [("message", ConstructorParameterDescription(self.message)), ("qts", ConstructorParameterDescription(self.qts))]) - } - } - public class Cons_updateNewMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateNewQuickReply: TypeConstructorDescription { - public var quickReply: Api.QuickReply - public init(quickReply: Api.QuickReply) { - self.quickReply = quickReply - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewQuickReply", [("quickReply", ConstructorParameterDescription(self.quickReply))]) - } - } - public class Cons_updateNewScheduledMessage: TypeConstructorDescription { - public var message: Api.Message - public init(message: Api.Message) { - self.message = message - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewScheduledMessage", [("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_updateNewStickerSet: TypeConstructorDescription { - public var stickerset: Api.messages.StickerSet - public init(stickerset: Api.messages.StickerSet) { - self.stickerset = stickerset - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewStickerSet", [("stickerset", ConstructorParameterDescription(self.stickerset))]) - } - } - public class Cons_updateNewStoryReaction: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNewStoryReaction", [("storyId", ConstructorParameterDescription(self.storyId)), ("peer", ConstructorParameterDescription(self.peer)), ("reaction", ConstructorParameterDescription(self.reaction))]) - } - } - public class Cons_updateNotifySettings: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateNotifySettings", [("peer", ConstructorParameterDescription(self.peer)), ("notifySettings", ConstructorParameterDescription(self.notifySettings))]) - } - } - public class Cons_updatePaidReactionPrivacy: TypeConstructorDescription { - public var `private`: Api.PaidReactionPrivacy - public init(`private`: Api.PaidReactionPrivacy) { - self.`private` = `private` - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePaidReactionPrivacy", [("`private`", ConstructorParameterDescription(self.`private`))]) - } - } - public class Cons_updatePeerBlocked: TypeConstructorDescription { - public var flags: Int32 - public var peerId: Api.Peer - public init(flags: Int32, peerId: Api.Peer) { - self.flags = flags - self.peerId = peerId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePeerBlocked", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId))]) - } - } - public class Cons_updatePeerHistoryTTL: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePeerHistoryTTL", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) - } - } - public class Cons_updatePeerLocated: TypeConstructorDescription { - public var peers: [Api.PeerLocated] - public init(peers: [Api.PeerLocated]) { - self.peers = peers - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePeerLocated", [("peers", ConstructorParameterDescription(self.peers))]) - } - } - public class Cons_updatePeerSettings: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePeerSettings", [("peer", ConstructorParameterDescription(self.peer)), ("settings", ConstructorParameterDescription(self.settings))]) - } - } - public class Cons_updatePeerWallpaper: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePeerWallpaper", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("wallpaper", ConstructorParameterDescription(self.wallpaper))]) - } - } - public class Cons_updatePendingJoinRequests: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePendingJoinRequests", [("peer", ConstructorParameterDescription(self.peer)), ("requestsPending", ConstructorParameterDescription(self.requestsPending)), ("recentRequesters", ConstructorParameterDescription(self.recentRequesters))]) - } - } - public class Cons_updatePhoneCall: TypeConstructorDescription { - public var phoneCall: Api.PhoneCall - public init(phoneCall: Api.PhoneCall) { - self.phoneCall = phoneCall - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePhoneCall", [("phoneCall", ConstructorParameterDescription(self.phoneCall))]) - } - } - public class Cons_updatePhoneCallSignalingData: TypeConstructorDescription { - public var phoneCallId: Int64 - public var data: Buffer - public init(phoneCallId: Int64, data: Buffer) { - self.phoneCallId = phoneCallId - self.data = data - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePhoneCallSignalingData", [("phoneCallId", ConstructorParameterDescription(self.phoneCallId)), ("data", ConstructorParameterDescription(self.data))]) - } - } - public class Cons_updatePinnedChannelMessages: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePinnedChannelMessages", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updatePinnedDialogs: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePinnedDialogs", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("order", ConstructorParameterDescription(self.order))]) - } - } - public class Cons_updatePinnedForumTopic: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePinnedForumTopic", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topicId", ConstructorParameterDescription(self.topicId))]) - } - } - public class Cons_updatePinnedForumTopics: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePinnedForumTopics", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("order", ConstructorParameterDescription(self.order))]) - } - } - public class Cons_updatePinnedMessages: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePinnedMessages", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updatePinnedSavedDialogs: TypeConstructorDescription { - public var flags: Int32 - public var order: [Api.DialogPeer]? - public init(flags: Int32, order: [Api.DialogPeer]?) { - self.flags = flags - self.order = order - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePinnedSavedDialogs", [("flags", ConstructorParameterDescription(self.flags)), ("order", ConstructorParameterDescription(self.order))]) - } - } - public class Cons_updatePrivacy: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatePrivacy", [("key", ConstructorParameterDescription(self.key)), ("rules", ConstructorParameterDescription(self.rules))]) - } - } - public class Cons_updateQuickReplies: TypeConstructorDescription { - public var quickReplies: [Api.QuickReply] - public init(quickReplies: [Api.QuickReply]) { - self.quickReplies = quickReplies - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateQuickReplies", [("quickReplies", ConstructorParameterDescription(self.quickReplies))]) - } - } - public class Cons_updateQuickReplyMessage: TypeConstructorDescription { - public var message: Api.Message - public init(message: Api.Message) { - self.message = message - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateQuickReplyMessage", [("message", ConstructorParameterDescription(self.message))]) - } - } - public class Cons_updateReadChannelDiscussionInbox: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadChannelDiscussionInbox", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId)), ("broadcastId", ConstructorParameterDescription(self.broadcastId)), ("broadcastPost", ConstructorParameterDescription(self.broadcastPost))]) - } - } - public class Cons_updateReadChannelDiscussionOutbox: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadChannelDiscussionOutbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId))]) - } - } - public class Cons_updateReadChannelInbox: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadChannelInbox", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("channelId", ConstructorParameterDescription(self.channelId)), ("maxId", ConstructorParameterDescription(self.maxId)), ("stillUnreadCount", ConstructorParameterDescription(self.stillUnreadCount)), ("pts", ConstructorParameterDescription(self.pts))]) - } - } - public class Cons_updateReadChannelOutbox: TypeConstructorDescription { - public var channelId: Int64 - public var maxId: Int32 - public init(channelId: Int64, maxId: Int32) { - self.channelId = channelId - self.maxId = maxId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadChannelOutbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("maxId", ConstructorParameterDescription(self.maxId))]) - } - } - public class Cons_updateReadHistoryInbox: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadHistoryInbox", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("maxId", ConstructorParameterDescription(self.maxId)), ("stillUnreadCount", ConstructorParameterDescription(self.stillUnreadCount)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateReadHistoryOutbox: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadHistoryOutbox", [("peer", ConstructorParameterDescription(self.peer)), ("maxId", ConstructorParameterDescription(self.maxId)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateReadMessagesContents: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadMessagesContents", [("flags", ConstructorParameterDescription(self.flags)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date))]) - } - } - public class Cons_updateReadMonoForumInbox: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadMonoForumInbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId))]) - } - } - public class Cons_updateReadMonoForumOutbox: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadMonoForumOutbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId))]) - } - } - public class Cons_updateReadStories: TypeConstructorDescription { - public var peer: Api.Peer - public var maxId: Int32 - public init(peer: Api.Peer, maxId: Int32) { - self.peer = peer - self.maxId = maxId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateReadStories", [("peer", ConstructorParameterDescription(self.peer)), ("maxId", ConstructorParameterDescription(self.maxId))]) - } - } - public class Cons_updateSavedDialogPinned: TypeConstructorDescription { - public var flags: Int32 - public var peer: Api.DialogPeer - public init(flags: Int32, peer: Api.DialogPeer) { - self.flags = flags - self.peer = peer - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateSavedDialogPinned", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer))]) - } - } - public class Cons_updateSentPhoneCode: TypeConstructorDescription { - public var sentCode: Api.auth.SentCode - public init(sentCode: Api.auth.SentCode) { - self.sentCode = sentCode - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateSentPhoneCode", [("sentCode", ConstructorParameterDescription(self.sentCode))]) - } - } - public class Cons_updateSentStoryReaction: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateSentStoryReaction", [("peer", ConstructorParameterDescription(self.peer)), ("storyId", ConstructorParameterDescription(self.storyId)), ("reaction", ConstructorParameterDescription(self.reaction))]) - } - } - public class Cons_updateServiceNotification: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateServiceNotification", [("flags", ConstructorParameterDescription(self.flags)), ("inboxDate", ConstructorParameterDescription(self.inboxDate)), ("type", ConstructorParameterDescription(self.type)), ("message", ConstructorParameterDescription(self.message)), ("media", ConstructorParameterDescription(self.media)), ("entities", ConstructorParameterDescription(self.entities))]) - } - } - public class Cons_updateSmsJob: TypeConstructorDescription { - public var jobId: String - public init(jobId: String) { - self.jobId = jobId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateSmsJob", [("jobId", ConstructorParameterDescription(self.jobId))]) - } - } - public class Cons_updateStarGiftAuctionState: TypeConstructorDescription { - public var giftId: Int64 - public var state: Api.StarGiftAuctionState - public init(giftId: Int64, state: Api.StarGiftAuctionState) { - self.giftId = giftId - self.state = state - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStarGiftAuctionState", [("giftId", ConstructorParameterDescription(self.giftId)), ("state", ConstructorParameterDescription(self.state))]) - } - } - public class Cons_updateStarGiftAuctionUserState: TypeConstructorDescription { - public var giftId: Int64 - public var userState: Api.StarGiftAuctionUserState - public init(giftId: Int64, userState: Api.StarGiftAuctionUserState) { - self.giftId = giftId - self.userState = userState - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStarGiftAuctionUserState", [("giftId", ConstructorParameterDescription(self.giftId)), ("userState", ConstructorParameterDescription(self.userState))]) - } - } - public class Cons_updateStarsBalance: TypeConstructorDescription { - public var balance: Api.StarsAmount - public init(balance: Api.StarsAmount) { - self.balance = balance - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStarsBalance", [("balance", ConstructorParameterDescription(self.balance))]) - } - } - public class Cons_updateStarsRevenueStatus: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStarsRevenueStatus", [("peer", ConstructorParameterDescription(self.peer)), ("status", ConstructorParameterDescription(self.status))]) - } - } - public class Cons_updateStickerSets: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStickerSets", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - public class Cons_updateStickerSetsOrder: TypeConstructorDescription { - public var flags: Int32 - public var order: [Int64] - public init(flags: Int32, order: [Int64]) { - self.flags = flags - self.order = order - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStickerSetsOrder", [("flags", ConstructorParameterDescription(self.flags)), ("order", ConstructorParameterDescription(self.order))]) - } - } - public class Cons_updateStoriesStealthMode: TypeConstructorDescription { - public var stealthMode: Api.StoriesStealthMode - public init(stealthMode: Api.StoriesStealthMode) { - self.stealthMode = stealthMode - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStoriesStealthMode", [("stealthMode", ConstructorParameterDescription(self.stealthMode))]) - } - } - public class Cons_updateStory: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStory", [("peer", ConstructorParameterDescription(self.peer)), ("story", ConstructorParameterDescription(self.story))]) - } - } - public class Cons_updateStoryID: TypeConstructorDescription { - public var id: Int32 - public var randomId: Int64 - public init(id: Int32, randomId: Int64) { - self.id = id - self.randomId = randomId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateStoryID", [("id", ConstructorParameterDescription(self.id)), ("randomId", ConstructorParameterDescription(self.randomId))]) - } - } - public class Cons_updateTheme: TypeConstructorDescription { - public var theme: Api.Theme - public init(theme: Api.Theme) { - self.theme = theme - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateTheme", [("theme", ConstructorParameterDescription(self.theme))]) - } - } - public class Cons_updateTranscribedAudio: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateTranscribedAudio", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("transcriptionId", ConstructorParameterDescription(self.transcriptionId)), ("text", ConstructorParameterDescription(self.text))]) - } - } - public class Cons_updateUser: TypeConstructorDescription { - public var userId: Int64 - public init(userId: Int64) { - self.userId = userId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateUser", [("userId", ConstructorParameterDescription(self.userId))]) - } - } - public class Cons_updateUserEmojiStatus: TypeConstructorDescription { - public var userId: Int64 - public var emojiStatus: Api.EmojiStatus - public init(userId: Int64, emojiStatus: Api.EmojiStatus) { - self.userId = userId - self.emojiStatus = emojiStatus - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateUserEmojiStatus", [("userId", ConstructorParameterDescription(self.userId)), ("emojiStatus", ConstructorParameterDescription(self.emojiStatus))]) - } - } - public class Cons_updateUserName: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateUserName", [("userId", ConstructorParameterDescription(self.userId)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("usernames", ConstructorParameterDescription(self.usernames))]) - } - } - public class Cons_updateUserPhone: TypeConstructorDescription { - public var userId: Int64 - public var phone: String - public init(userId: Int64, phone: String) { - self.userId = userId - self.phone = phone - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateUserPhone", [("userId", ConstructorParameterDescription(self.userId)), ("phone", ConstructorParameterDescription(self.phone))]) - } - } - public class Cons_updateUserStatus: TypeConstructorDescription { - public var userId: Int64 - public var status: Api.UserStatus - public init(userId: Int64, status: Api.UserStatus) { - self.userId = userId - self.status = status - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateUserStatus", [("userId", ConstructorParameterDescription(self.userId)), ("status", ConstructorParameterDescription(self.status))]) - } - } - public class Cons_updateUserTyping: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateUserTyping", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("action", ConstructorParameterDescription(self.action))]) - } - } - public class Cons_updateWebPage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateWebPage", [("webpage", ConstructorParameterDescription(self.webpage)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) - } - } - public class Cons_updateWebViewResultSent: TypeConstructorDescription { - public var queryId: Int64 - public init(queryId: Int64) { - self.queryId = queryId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateWebViewResultSent", [("queryId", ConstructorParameterDescription(self.queryId))]) - } - } - case updateAiComposeTones - case updateAttachMenuBots - case updateAutoSaveSettings - 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 updateBotGuestChatQuery(Cons_updateBotGuestChatQuery) - 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 updateChatParticipantRank(Cons_updateChatParticipantRank) - case updateChatParticipants(Cons_updateChatParticipants) - case updateChatUserTyping(Cons_updateChatUserTyping) - case updateConfig - case updateContactsReset - 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(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(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 updateManagedBot(Cons_updateManagedBot) - 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(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(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(Cons_updateSavedDialogPinned) - case updateSavedGifs - case updateSavedReactionTags - case updateSavedRingtones - 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(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) + case statsDateRangeDays(Cons_statsDateRangeDays) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .updateAiComposeTones: + case .statsDateRangeDays(let _data): if boxed { - buffer.appendInt32(-1945136645) + buffer.appendInt32(-1237848657) } - break - 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 .updateBotGuestChatQuery(let _data): - if boxed { - buffer.appendInt32(-841742019) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.queryId, buffer: buffer, boxed: false) - _data.message.serialize(buffer, true) - if Int(_data.flags) & Int(1 << 0) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.referenceMessages!.count)) - for item in _data.referenceMessages! { - item.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 .updateChatParticipantRank(let _data): - if boxed { - buffer.appendInt32(-1115461703) - } - serializeInt64(_data.chatId, buffer: buffer, boxed: false) - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeString(_data.rank, 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(_data.sentMessages!.count)) - for item in _data.sentMessages! { - serializeInt32(item, buffer: buffer, boxed: false) - } - } - 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.minDate, 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 .updateManagedBot(let _data): - if boxed { - buffer.appendInt32(1216408986) - } - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeInt64(_data.botId, buffer: buffer, boxed: false) - serializeInt32(_data.qts, buffer: buffer, boxed: false) - 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(-699641301) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 1) != 0 { - _data.peer!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.msgId!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeInt32(_data.topMsgId!, 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(1989799956) - } - 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) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.positions.count)) - for item in _data.positions { - serializeInt32(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(_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(_data.order!.count)) - for item in _data.order! { - serializeInt32(item, buffer: buffer, boxed: false) - } - } - 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(_data.order!.count)) - for item in _data.order! { - item.serialize(buffer, true) - } - } - 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, ConstructorParameterDescription)]) { switch self { - case .updateAiComposeTones: - return ("updateAiComposeTones", []) - case .updateAttachMenuBots: - return ("updateAttachMenuBots", []) - case .updateAutoSaveSettings: - return ("updateAutoSaveSettings", []) - case .updateBotBusinessConnect(let _data): - return ("updateBotBusinessConnect", [("connection", ConstructorParameterDescription(_data.connection)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotCallbackQuery(let _data): - return ("updateBotCallbackQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("chatInstance", ConstructorParameterDescription(_data.chatInstance)), ("data", ConstructorParameterDescription(_data.data)), ("gameShortName", ConstructorParameterDescription(_data.gameShortName))]) - case .updateBotChatBoost(let _data): - return ("updateBotChatBoost", [("peer", ConstructorParameterDescription(_data.peer)), ("boost", ConstructorParameterDescription(_data.boost)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotChatInviteRequester(let _data): - return ("updateBotChatInviteRequester", [("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date)), ("userId", ConstructorParameterDescription(_data.userId)), ("about", ConstructorParameterDescription(_data.about)), ("invite", ConstructorParameterDescription(_data.invite)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotCommands(let _data): - return ("updateBotCommands", [("peer", ConstructorParameterDescription(_data.peer)), ("botId", ConstructorParameterDescription(_data.botId)), ("commands", ConstructorParameterDescription(_data.commands))]) - case .updateBotDeleteBusinessMessage(let _data): - return ("updateBotDeleteBusinessMessage", [("connectionId", ConstructorParameterDescription(_data.connectionId)), ("peer", ConstructorParameterDescription(_data.peer)), ("messages", ConstructorParameterDescription(_data.messages)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotEditBusinessMessage(let _data): - return ("updateBotEditBusinessMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("message", ConstructorParameterDescription(_data.message)), ("replyToMessage", ConstructorParameterDescription(_data.replyToMessage)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotGuestChatQuery(let _data): - return ("updateBotGuestChatQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("message", ConstructorParameterDescription(_data.message)), ("referenceMessages", ConstructorParameterDescription(_data.referenceMessages)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotInlineQuery(let _data): - return ("updateBotInlineQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("query", ConstructorParameterDescription(_data.query)), ("geo", ConstructorParameterDescription(_data.geo)), ("peerType", ConstructorParameterDescription(_data.peerType)), ("offset", ConstructorParameterDescription(_data.offset))]) - case .updateBotInlineSend(let _data): - return ("updateBotInlineSend", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("query", ConstructorParameterDescription(_data.query)), ("geo", ConstructorParameterDescription(_data.geo)), ("id", ConstructorParameterDescription(_data.id)), ("msgId", ConstructorParameterDescription(_data.msgId))]) - case .updateBotMenuButton(let _data): - return ("updateBotMenuButton", [("botId", ConstructorParameterDescription(_data.botId)), ("button", ConstructorParameterDescription(_data.button))]) - case .updateBotMessageReaction(let _data): - return ("updateBotMessageReaction", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("date", ConstructorParameterDescription(_data.date)), ("actor", ConstructorParameterDescription(_data.actor)), ("oldReactions", ConstructorParameterDescription(_data.oldReactions)), ("newReactions", ConstructorParameterDescription(_data.newReactions)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotMessageReactions(let _data): - return ("updateBotMessageReactions", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("date", ConstructorParameterDescription(_data.date)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotNewBusinessMessage(let _data): - return ("updateBotNewBusinessMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("message", ConstructorParameterDescription(_data.message)), ("replyToMessage", ConstructorParameterDescription(_data.replyToMessage)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotPrecheckoutQuery(let _data): - return ("updateBotPrecheckoutQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("payload", ConstructorParameterDescription(_data.payload)), ("info", ConstructorParameterDescription(_data.info)), ("shippingOptionId", ConstructorParameterDescription(_data.shippingOptionId)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount))]) - case .updateBotPurchasedPaidMedia(let _data): - return ("updateBotPurchasedPaidMedia", [("userId", ConstructorParameterDescription(_data.userId)), ("payload", ConstructorParameterDescription(_data.payload)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotShippingQuery(let _data): - return ("updateBotShippingQuery", [("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("payload", ConstructorParameterDescription(_data.payload)), ("shippingAddress", ConstructorParameterDescription(_data.shippingAddress))]) - case .updateBotStopped(let _data): - return ("updateBotStopped", [("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date)), ("stopped", ConstructorParameterDescription(_data.stopped)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateBotWebhookJSON(let _data): - return ("updateBotWebhookJSON", [("data", ConstructorParameterDescription(_data.data))]) - case .updateBotWebhookJSONQuery(let _data): - return ("updateBotWebhookJSONQuery", [("queryId", ConstructorParameterDescription(_data.queryId)), ("data", ConstructorParameterDescription(_data.data)), ("timeout", ConstructorParameterDescription(_data.timeout))]) - case .updateBusinessBotCallbackQuery(let _data): - return ("updateBusinessBotCallbackQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("message", ConstructorParameterDescription(_data.message)), ("replyToMessage", ConstructorParameterDescription(_data.replyToMessage)), ("chatInstance", ConstructorParameterDescription(_data.chatInstance)), ("data", ConstructorParameterDescription(_data.data))]) - case .updateChannel(let _data): - return ("updateChannel", [("channelId", ConstructorParameterDescription(_data.channelId))]) - case .updateChannelAvailableMessages(let _data): - return ("updateChannelAvailableMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("availableMinId", ConstructorParameterDescription(_data.availableMinId))]) - case .updateChannelMessageForwards(let _data): - return ("updateChannelMessageForwards", [("channelId", ConstructorParameterDescription(_data.channelId)), ("id", ConstructorParameterDescription(_data.id)), ("forwards", ConstructorParameterDescription(_data.forwards))]) - case .updateChannelMessageViews(let _data): - return ("updateChannelMessageViews", [("channelId", ConstructorParameterDescription(_data.channelId)), ("id", ConstructorParameterDescription(_data.id)), ("views", ConstructorParameterDescription(_data.views))]) - case .updateChannelParticipant(let _data): - return ("updateChannelParticipant", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("date", ConstructorParameterDescription(_data.date)), ("actorId", ConstructorParameterDescription(_data.actorId)), ("userId", ConstructorParameterDescription(_data.userId)), ("prevParticipant", ConstructorParameterDescription(_data.prevParticipant)), ("newParticipant", ConstructorParameterDescription(_data.newParticipant)), ("invite", ConstructorParameterDescription(_data.invite)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateChannelReadMessagesContents(let _data): - return ("updateChannelReadMessagesContents", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("messages", ConstructorParameterDescription(_data.messages))]) - case .updateChannelTooLong(let _data): - return ("updateChannelTooLong", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("pts", ConstructorParameterDescription(_data.pts))]) - case .updateChannelUserTyping(let _data): - return ("updateChannelUserTyping", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("action", ConstructorParameterDescription(_data.action))]) - case .updateChannelViewForumAsMessages(let _data): - return ("updateChannelViewForumAsMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("enabled", ConstructorParameterDescription(_data.enabled))]) - case .updateChannelWebPage(let _data): - return ("updateChannelWebPage", [("channelId", ConstructorParameterDescription(_data.channelId)), ("webpage", ConstructorParameterDescription(_data.webpage)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateChat(let _data): - return ("updateChat", [("chatId", ConstructorParameterDescription(_data.chatId))]) - case .updateChatDefaultBannedRights(let _data): - return ("updateChatDefaultBannedRights", [("peer", ConstructorParameterDescription(_data.peer)), ("defaultBannedRights", ConstructorParameterDescription(_data.defaultBannedRights)), ("version", ConstructorParameterDescription(_data.version))]) - case .updateChatParticipant(let _data): - return ("updateChatParticipant", [("flags", ConstructorParameterDescription(_data.flags)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("date", ConstructorParameterDescription(_data.date)), ("actorId", ConstructorParameterDescription(_data.actorId)), ("userId", ConstructorParameterDescription(_data.userId)), ("prevParticipant", ConstructorParameterDescription(_data.prevParticipant)), ("newParticipant", ConstructorParameterDescription(_data.newParticipant)), ("invite", ConstructorParameterDescription(_data.invite)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateChatParticipantAdd(let _data): - return ("updateChatParticipantAdd", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("inviterId", ConstructorParameterDescription(_data.inviterId)), ("date", ConstructorParameterDescription(_data.date)), ("version", ConstructorParameterDescription(_data.version))]) - case .updateChatParticipantAdmin(let _data): - return ("updateChatParticipantAdmin", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("isAdmin", ConstructorParameterDescription(_data.isAdmin)), ("version", ConstructorParameterDescription(_data.version))]) - case .updateChatParticipantDelete(let _data): - return ("updateChatParticipantDelete", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("version", ConstructorParameterDescription(_data.version))]) - case .updateChatParticipantRank(let _data): - return ("updateChatParticipantRank", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("rank", ConstructorParameterDescription(_data.rank)), ("version", ConstructorParameterDescription(_data.version))]) - case .updateChatParticipants(let _data): - return ("updateChatParticipants", [("participants", ConstructorParameterDescription(_data.participants))]) - case .updateChatUserTyping(let _data): - return ("updateChatUserTyping", [("chatId", ConstructorParameterDescription(_data.chatId)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("action", ConstructorParameterDescription(_data.action))]) - case .updateConfig: - return ("updateConfig", []) - case .updateContactsReset: - return ("updateContactsReset", []) - case .updateDcOptions(let _data): - return ("updateDcOptions", [("dcOptions", ConstructorParameterDescription(_data.dcOptions))]) - case .updateDeleteChannelMessages(let _data): - return ("updateDeleteChannelMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateDeleteGroupCallMessages(let _data): - return ("updateDeleteGroupCallMessages", [("call", ConstructorParameterDescription(_data.call)), ("messages", ConstructorParameterDescription(_data.messages))]) - case .updateDeleteMessages(let _data): - return ("updateDeleteMessages", [("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateDeleteQuickReply(let _data): - return ("updateDeleteQuickReply", [("shortcutId", ConstructorParameterDescription(_data.shortcutId))]) - case .updateDeleteQuickReplyMessages(let _data): - return ("updateDeleteQuickReplyMessages", [("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("messages", ConstructorParameterDescription(_data.messages))]) - case .updateDeleteScheduledMessages(let _data): - return ("updateDeleteScheduledMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("messages", ConstructorParameterDescription(_data.messages)), ("sentMessages", ConstructorParameterDescription(_data.sentMessages))]) - case .updateDialogFilter(let _data): - return ("updateDialogFilter", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("filter", ConstructorParameterDescription(_data.filter))]) - case .updateDialogFilterOrder(let _data): - return ("updateDialogFilterOrder", [("order", ConstructorParameterDescription(_data.order))]) - case .updateDialogFilters: - return ("updateDialogFilters", []) - case .updateDialogPinned(let _data): - return ("updateDialogPinned", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("peer", ConstructorParameterDescription(_data.peer))]) - case .updateDialogUnreadMark(let _data): - return ("updateDialogUnreadMark", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId))]) - case .updateDraftMessage(let _data): - return ("updateDraftMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("draft", ConstructorParameterDescription(_data.draft))]) - case .updateEditChannelMessage(let _data): - return ("updateEditChannelMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateEditMessage(let _data): - return ("updateEditMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateEmojiGameInfo(let _data): - return ("updateEmojiGameInfo", [("info", ConstructorParameterDescription(_data.info))]) - case .updateEncryptedChatTyping(let _data): - return ("updateEncryptedChatTyping", [("chatId", ConstructorParameterDescription(_data.chatId))]) - case .updateEncryptedMessagesRead(let _data): - return ("updateEncryptedMessagesRead", [("chatId", ConstructorParameterDescription(_data.chatId)), ("maxDate", ConstructorParameterDescription(_data.maxDate)), ("date", ConstructorParameterDescription(_data.date))]) - case .updateEncryption(let _data): - return ("updateEncryption", [("chat", ConstructorParameterDescription(_data.chat)), ("date", ConstructorParameterDescription(_data.date))]) - case .updateFavedStickers: - return ("updateFavedStickers", []) - case .updateFolderPeers(let _data): - return ("updateFolderPeers", [("folderPeers", ConstructorParameterDescription(_data.folderPeers)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateGeoLiveViewed(let _data): - return ("updateGeoLiveViewed", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId))]) - case .updateGroupCall(let _data): - return ("updateGroupCall", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("call", ConstructorParameterDescription(_data.call))]) - case .updateGroupCallChainBlocks(let _data): - return ("updateGroupCallChainBlocks", [("call", ConstructorParameterDescription(_data.call)), ("subChainId", ConstructorParameterDescription(_data.subChainId)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) - case .updateGroupCallConnection(let _data): - return ("updateGroupCallConnection", [("flags", ConstructorParameterDescription(_data.flags)), ("params", ConstructorParameterDescription(_data.params))]) - case .updateGroupCallEncryptedMessage(let _data): - return ("updateGroupCallEncryptedMessage", [("call", ConstructorParameterDescription(_data.call)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("encryptedMessage", ConstructorParameterDescription(_data.encryptedMessage))]) - case .updateGroupCallMessage(let _data): - return ("updateGroupCallMessage", [("call", ConstructorParameterDescription(_data.call)), ("message", ConstructorParameterDescription(_data.message))]) - case .updateGroupCallParticipants(let _data): - return ("updateGroupCallParticipants", [("call", ConstructorParameterDescription(_data.call)), ("participants", ConstructorParameterDescription(_data.participants)), ("version", ConstructorParameterDescription(_data.version))]) - case .updateInlineBotCallbackQuery(let _data): - return ("updateInlineBotCallbackQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("chatInstance", ConstructorParameterDescription(_data.chatInstance)), ("data", ConstructorParameterDescription(_data.data)), ("gameShortName", ConstructorParameterDescription(_data.gameShortName))]) - case .updateLangPack(let _data): - return ("updateLangPack", [("difference", ConstructorParameterDescription(_data.difference))]) - case .updateLangPackTooLong(let _data): - return ("updateLangPackTooLong", [("langCode", ConstructorParameterDescription(_data.langCode))]) - case .updateLoginToken: - return ("updateLoginToken", []) - case .updateManagedBot(let _data): - return ("updateManagedBot", [("userId", ConstructorParameterDescription(_data.userId)), ("botId", ConstructorParameterDescription(_data.botId)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateMessageExtendedMedia(let _data): - return ("updateMessageExtendedMedia", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) - case .updateMessageID(let _data): - return ("updateMessageID", [("id", ConstructorParameterDescription(_data.id)), ("randomId", ConstructorParameterDescription(_data.randomId))]) - case .updateMessagePoll(let _data): - return ("updateMessagePoll", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("pollId", ConstructorParameterDescription(_data.pollId)), ("poll", ConstructorParameterDescription(_data.poll)), ("results", ConstructorParameterDescription(_data.results))]) - case .updateMessagePollVote(let _data): - return ("updateMessagePollVote", [("pollId", ConstructorParameterDescription(_data.pollId)), ("peer", ConstructorParameterDescription(_data.peer)), ("options", ConstructorParameterDescription(_data.options)), ("positions", ConstructorParameterDescription(_data.positions)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateMessageReactions(let _data): - return ("updateMessageReactions", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("reactions", ConstructorParameterDescription(_data.reactions))]) - case .updateMonoForumNoPaidException(let _data): - return ("updateMonoForumNoPaidException", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId))]) - case .updateMoveStickerSetToTop(let _data): - return ("updateMoveStickerSetToTop", [("flags", ConstructorParameterDescription(_data.flags)), ("stickerset", ConstructorParameterDescription(_data.stickerset))]) - case .updateNewAuthorization(let _data): - return ("updateNewAuthorization", [("flags", ConstructorParameterDescription(_data.flags)), ("hash", ConstructorParameterDescription(_data.hash)), ("date", ConstructorParameterDescription(_data.date)), ("device", ConstructorParameterDescription(_data.device)), ("location", ConstructorParameterDescription(_data.location))]) - case .updateNewChannelMessage(let _data): - return ("updateNewChannelMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateNewEncryptedMessage(let _data): - return ("updateNewEncryptedMessage", [("message", ConstructorParameterDescription(_data.message)), ("qts", ConstructorParameterDescription(_data.qts))]) - case .updateNewMessage(let _data): - return ("updateNewMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateNewQuickReply(let _data): - return ("updateNewQuickReply", [("quickReply", ConstructorParameterDescription(_data.quickReply))]) - case .updateNewScheduledMessage(let _data): - return ("updateNewScheduledMessage", [("message", ConstructorParameterDescription(_data.message))]) - case .updateNewStickerSet(let _data): - return ("updateNewStickerSet", [("stickerset", ConstructorParameterDescription(_data.stickerset))]) - case .updateNewStoryReaction(let _data): - return ("updateNewStoryReaction", [("storyId", ConstructorParameterDescription(_data.storyId)), ("peer", ConstructorParameterDescription(_data.peer)), ("reaction", ConstructorParameterDescription(_data.reaction))]) - case .updateNotifySettings(let _data): - return ("updateNotifySettings", [("peer", ConstructorParameterDescription(_data.peer)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings))]) - case .updatePaidReactionPrivacy(let _data): - return ("updatePaidReactionPrivacy", [("`private`", ConstructorParameterDescription(_data.`private`))]) - case .updatePeerBlocked(let _data): - return ("updatePeerBlocked", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId))]) - case .updatePeerHistoryTTL(let _data): - return ("updatePeerHistoryTTL", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) - case .updatePeerLocated(let _data): - return ("updatePeerLocated", [("peers", ConstructorParameterDescription(_data.peers))]) - case .updatePeerSettings(let _data): - return ("updatePeerSettings", [("peer", ConstructorParameterDescription(_data.peer)), ("settings", ConstructorParameterDescription(_data.settings))]) - case .updatePeerWallpaper(let _data): - return ("updatePeerWallpaper", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) - case .updatePendingJoinRequests(let _data): - return ("updatePendingJoinRequests", [("peer", ConstructorParameterDescription(_data.peer)), ("requestsPending", ConstructorParameterDescription(_data.requestsPending)), ("recentRequesters", ConstructorParameterDescription(_data.recentRequesters))]) - case .updatePhoneCall(let _data): - return ("updatePhoneCall", [("phoneCall", ConstructorParameterDescription(_data.phoneCall))]) - case .updatePhoneCallSignalingData(let _data): - return ("updatePhoneCallSignalingData", [("phoneCallId", ConstructorParameterDescription(_data.phoneCallId)), ("data", ConstructorParameterDescription(_data.data))]) - case .updatePinnedChannelMessages(let _data): - return ("updatePinnedChannelMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updatePinnedDialogs(let _data): - return ("updatePinnedDialogs", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("order", ConstructorParameterDescription(_data.order))]) - case .updatePinnedForumTopic(let _data): - return ("updatePinnedForumTopic", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topicId", ConstructorParameterDescription(_data.topicId))]) - case .updatePinnedForumTopics(let _data): - return ("updatePinnedForumTopics", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("order", ConstructorParameterDescription(_data.order))]) - case .updatePinnedMessages(let _data): - return ("updatePinnedMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updatePinnedSavedDialogs(let _data): - return ("updatePinnedSavedDialogs", [("flags", ConstructorParameterDescription(_data.flags)), ("order", ConstructorParameterDescription(_data.order))]) - case .updatePrivacy(let _data): - return ("updatePrivacy", [("key", ConstructorParameterDescription(_data.key)), ("rules", ConstructorParameterDescription(_data.rules))]) - case .updatePtsChanged: - return ("updatePtsChanged", []) - case .updateQuickReplies(let _data): - return ("updateQuickReplies", [("quickReplies", ConstructorParameterDescription(_data.quickReplies))]) - case .updateQuickReplyMessage(let _data): - return ("updateQuickReplyMessage", [("message", ConstructorParameterDescription(_data.message))]) - case .updateReadChannelDiscussionInbox(let _data): - return ("updateReadChannelDiscussionInbox", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId)), ("broadcastId", ConstructorParameterDescription(_data.broadcastId)), ("broadcastPost", ConstructorParameterDescription(_data.broadcastPost))]) - case .updateReadChannelDiscussionOutbox(let _data): - return ("updateReadChannelDiscussionOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) - case .updateReadChannelInbox(let _data): - return ("updateReadChannelInbox", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("stillUnreadCount", ConstructorParameterDescription(_data.stillUnreadCount)), ("pts", ConstructorParameterDescription(_data.pts))]) - case .updateReadChannelOutbox(let _data): - return ("updateReadChannelOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("maxId", ConstructorParameterDescription(_data.maxId))]) - case .updateReadFeaturedEmojiStickers: - return ("updateReadFeaturedEmojiStickers", []) - case .updateReadFeaturedStickers: - return ("updateReadFeaturedStickers", []) - case .updateReadHistoryInbox(let _data): - return ("updateReadHistoryInbox", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("stillUnreadCount", ConstructorParameterDescription(_data.stillUnreadCount)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateReadHistoryOutbox(let _data): - return ("updateReadHistoryOutbox", [("peer", ConstructorParameterDescription(_data.peer)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateReadMessagesContents(let _data): - return ("updateReadMessagesContents", [("flags", ConstructorParameterDescription(_data.flags)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date))]) - case .updateReadMonoForumInbox(let _data): - return ("updateReadMonoForumInbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) - case .updateReadMonoForumOutbox(let _data): - return ("updateReadMonoForumOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) - case .updateReadStories(let _data): - return ("updateReadStories", [("peer", ConstructorParameterDescription(_data.peer)), ("maxId", ConstructorParameterDescription(_data.maxId))]) - case .updateRecentEmojiStatuses: - return ("updateRecentEmojiStatuses", []) - case .updateRecentReactions: - return ("updateRecentReactions", []) - case .updateRecentStickers: - return ("updateRecentStickers", []) - case .updateSavedDialogPinned(let _data): - return ("updateSavedDialogPinned", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer))]) - case .updateSavedGifs: - return ("updateSavedGifs", []) - case .updateSavedReactionTags: - return ("updateSavedReactionTags", []) - case .updateSavedRingtones: - return ("updateSavedRingtones", []) - case .updateSentPhoneCode(let _data): - return ("updateSentPhoneCode", [("sentCode", ConstructorParameterDescription(_data.sentCode))]) - case .updateSentStoryReaction(let _data): - return ("updateSentStoryReaction", [("peer", ConstructorParameterDescription(_data.peer)), ("storyId", ConstructorParameterDescription(_data.storyId)), ("reaction", ConstructorParameterDescription(_data.reaction))]) - case .updateServiceNotification(let _data): - return ("updateServiceNotification", [("flags", ConstructorParameterDescription(_data.flags)), ("inboxDate", ConstructorParameterDescription(_data.inboxDate)), ("type", ConstructorParameterDescription(_data.type)), ("message", ConstructorParameterDescription(_data.message)), ("media", ConstructorParameterDescription(_data.media)), ("entities", ConstructorParameterDescription(_data.entities))]) - case .updateSmsJob(let _data): - return ("updateSmsJob", [("jobId", ConstructorParameterDescription(_data.jobId))]) - case .updateStarGiftAuctionState(let _data): - return ("updateStarGiftAuctionState", [("giftId", ConstructorParameterDescription(_data.giftId)), ("state", ConstructorParameterDescription(_data.state))]) - case .updateStarGiftAuctionUserState(let _data): - return ("updateStarGiftAuctionUserState", [("giftId", ConstructorParameterDescription(_data.giftId)), ("userState", ConstructorParameterDescription(_data.userState))]) - case .updateStarGiftCraftFail: - return ("updateStarGiftCraftFail", []) - case .updateStarsBalance(let _data): - return ("updateStarsBalance", [("balance", ConstructorParameterDescription(_data.balance))]) - case .updateStarsRevenueStatus(let _data): - return ("updateStarsRevenueStatus", [("peer", ConstructorParameterDescription(_data.peer)), ("status", ConstructorParameterDescription(_data.status))]) - case .updateStickerSets(let _data): - return ("updateStickerSets", [("flags", ConstructorParameterDescription(_data.flags))]) - case .updateStickerSetsOrder(let _data): - return ("updateStickerSetsOrder", [("flags", ConstructorParameterDescription(_data.flags)), ("order", ConstructorParameterDescription(_data.order))]) - case .updateStoriesStealthMode(let _data): - return ("updateStoriesStealthMode", [("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) - case .updateStory(let _data): - return ("updateStory", [("peer", ConstructorParameterDescription(_data.peer)), ("story", ConstructorParameterDescription(_data.story))]) - case .updateStoryID(let _data): - return ("updateStoryID", [("id", ConstructorParameterDescription(_data.id)), ("randomId", ConstructorParameterDescription(_data.randomId))]) - case .updateTheme(let _data): - return ("updateTheme", [("theme", ConstructorParameterDescription(_data.theme))]) - case .updateTranscribedAudio(let _data): - return ("updateTranscribedAudio", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("transcriptionId", ConstructorParameterDescription(_data.transcriptionId)), ("text", ConstructorParameterDescription(_data.text))]) - case .updateUser(let _data): - return ("updateUser", [("userId", ConstructorParameterDescription(_data.userId))]) - case .updateUserEmojiStatus(let _data): - return ("updateUserEmojiStatus", [("userId", ConstructorParameterDescription(_data.userId)), ("emojiStatus", ConstructorParameterDescription(_data.emojiStatus))]) - case .updateUserName(let _data): - return ("updateUserName", [("userId", ConstructorParameterDescription(_data.userId)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("usernames", ConstructorParameterDescription(_data.usernames))]) - case .updateUserPhone(let _data): - return ("updateUserPhone", [("userId", ConstructorParameterDescription(_data.userId)), ("phone", ConstructorParameterDescription(_data.phone))]) - case .updateUserStatus(let _data): - return ("updateUserStatus", [("userId", ConstructorParameterDescription(_data.userId)), ("status", ConstructorParameterDescription(_data.status))]) - case .updateUserTyping(let _data): - return ("updateUserTyping", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("action", ConstructorParameterDescription(_data.action))]) - case .updateWebPage(let _data): - return ("updateWebPage", [("webpage", ConstructorParameterDescription(_data.webpage)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - case .updateWebViewResultSent(let _data): - return ("updateWebViewResultSent", [("queryId", ConstructorParameterDescription(_data.queryId))]) + case .statsDateRangeDays(let _data): + return ("statsDateRangeDays", [("minDate", ConstructorParameterDescription(_data.minDate)), ("maxDate", ConstructorParameterDescription(_data.maxDate))]) } } - public static func parse_updateAiComposeTones(_ reader: BufferReader) -> Update? { - return Api.Update.updateAiComposeTones - } - public static func parse_updateAttachMenuBots(_ reader: BufferReader) -> Update? { - return Api.Update.updateAttachMenuBots - } - public static func parse_updateAutoSaveSettings(_ reader: BufferReader) -> Update? { - return Api.Update.updateAutoSaveSettings - } - public static func parse_updateBotBusinessConnect(_ reader: BufferReader) -> Update? { - var _1: Api.BotBusinessConnection? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.BotBusinessConnection - } + public static func parse_statsDateRangeDays(_ reader: BufferReader) -> StatsDateRangeDays? { + var _1: Int32? + _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateBotBusinessConnect(Cons_updateBotBusinessConnect(connection: _1!, qts: _2!)) + return Api.StatsDateRangeDays.statsDateRangeDays(Cons_statsDateRangeDays(minDate: _1!, maxDate: _2!)) } else { return nil } } - public static func parse_updateBotCallbackQuery(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Api.Peer? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer + } +} +public extension Api { + enum StatsGraph: TypeConstructorDescription { + public class Cons_statsGraph: TypeConstructorDescription { + 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 } - var _5: Int32? - _5 = reader.readInt32() - var _6: Int64? - _6 = reader.readInt64() - var _7: Buffer? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _7 = parseBytes(reader) - } - var _8: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _8 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsGraph", [("flags", ConstructorParameterDescription(self.flags)), ("json", ConstructorParameterDescription(self.json)), ("zoomToken", ConstructorParameterDescription(self.zoomToken))]) } } - public static func parse_updateBotChatBoost(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer + public class Cons_statsGraphAsync: TypeConstructorDescription { + public var token: String + public init(token: String) { + self.token = token } - var _2: Api.Boost? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Boost - } - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateBotChatBoost(Cons_updateBotChatBoost(peer: _1!, boost: _2!, qts: _3!)) - } - else { - return nil + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsGraphAsync", [("token", ConstructorParameterDescription(self.token))]) } } - public static func parse_updateBotChatInviteRequester(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer + public class Cons_statsGraphError: TypeConstructorDescription { + public var error: String + public init(error: String) { + self.error = error } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: Api.ExportedChatInvite? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateBotChatInviteRequester(Cons_updateBotChatInviteRequester(peer: _1!, date: _2!, userId: _3!, about: _4!, invite: _5!, qts: _6!)) - } - else { - return nil + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsGraphError", [("error", ConstructorParameterDescription(self.error))]) } } - public static func parse_updateBotCommands(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int64? - _2 = reader.readInt64() - var _3: [Api.BotCommand]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateBotCommands(Cons_updateBotCommands(peer: _1!, botId: _2!, commands: _3!)) - } - else { - return nil - } - } - public static func parse_updateBotDeleteBusinessMessage(_ reader: BufferReader) -> Update? { - var _1: String? - _1 = parseString(reader) - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: [Int32]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateBotDeleteBusinessMessage(Cons_updateBotDeleteBusinessMessage(connectionId: _1!, peer: _2!, messages: _3!, qts: _4!)) - } - else { - return nil - } - } - public static func parse_updateBotEditBusinessMessage(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Api.Message? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Message - } - var _4: Api.Message? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Message + 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) } - } - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateBotEditBusinessMessage(Cons_updateBotEditBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!)) - } - else { - return nil - } - } - public static func parse_updateBotGuestChatQuery(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.Message? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Message - } - var _4: [Api.Message]? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + 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) } - } - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateBotGuestChatQuery(Cons_updateBotGuestChatQuery(flags: _1!, queryId: _2!, message: _3!, referenceMessages: _4, qts: _5!)) - } - else { - return nil - } - } - public static func parse_updateBotInlineQuery(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: Api.GeoPoint? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.GeoPoint + break + case .statsGraphAsync(let _data): + if boxed { + buffer.appendInt32(1244130093) } - } - var _6: Api.InlineQueryPeerType? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.InlineQueryPeerType + serializeString(_data.token, buffer: buffer, boxed: false) + break + case .statsGraphError(let _data): + if boxed { + buffer.appendInt32(-1092839390) } - } - var _7: String? - _7 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Update.updateBotInlineQuery(Cons_updateBotInlineQuery(flags: _1!, queryId: _2!, userId: _3!, query: _4!, geo: _5, peerType: _6, offset: _7!)) - } - else { - return nil + serializeString(_data.error, buffer: buffer, boxed: false) + break } } - public static func parse_updateBotInlineSend(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: Api.GeoPoint? - if Int(_1 ?? 0) & 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 ?? 0) & 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 - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateBotInlineSend(Cons_updateBotInlineSend(flags: _1!, userId: _2!, query: _3!, geo: _4, id: _5!, msgId: _6)) - } - else { - return nil + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .statsGraph(let _data): + return ("statsGraph", [("flags", ConstructorParameterDescription(_data.flags)), ("json", ConstructorParameterDescription(_data.json)), ("zoomToken", ConstructorParameterDescription(_data.zoomToken))]) + case .statsGraphAsync(let _data): + return ("statsGraphAsync", [("token", ConstructorParameterDescription(_data.token))]) + case .statsGraphError(let _data): + return ("statsGraphError", [("error", ConstructorParameterDescription(_data.error))]) } } - public static func parse_updateBotMenuButton(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.BotMenuButton? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.BotMenuButton - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateBotMenuButton(Cons_updateBotMenuButton(botId: _1!, button: _2!)) - } - else { - return nil - } - } - public static func parse_updateBotMessageReaction(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Api.Peer? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _5: [Api.Reaction]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Reaction.self) - } - var _6: [Api.Reaction]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Reaction.self) - } - var _7: Int32? - _7 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Update.updateBotMessageReaction(Cons_updateBotMessageReaction(peer: _1!, msgId: _2!, date: _3!, actor: _4!, oldReactions: _5!, newReactions: _6!, qts: _7!)) - } - else { - return nil - } - } - public static func parse_updateBotMessageReactions(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: [Api.ReactionCount]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) - } - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateBotMessageReactions(Cons_updateBotMessageReactions(peer: _1!, msgId: _2!, date: _3!, reactions: _4!, qts: _5!)) - } - else { - return nil - } - } - public static func parse_updateBotNewBusinessMessage(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Api.Message? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Message - } - var _4: Api.Message? - if Int(_1 ?? 0) & 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 - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateBotNewBusinessMessage(Cons_updateBotNewBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!)) - } - else { - return nil - } - } - public static func parse_updateBotPrecheckoutQuery(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Buffer? - _4 = parseBytes(reader) - var _5: Api.PaymentRequestedInfo? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo - } - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _6 = parseString(reader) - } - var _7: String? - _7 = parseString(reader) - var _8: Int64? - _8 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_updateBotPurchasedPaidMedia(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: String? - _2 = parseString(reader) - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateBotPurchasedPaidMedia(Cons_updateBotPurchasedPaidMedia(userId: _1!, payload: _2!, qts: _3!)) - } - else { - return nil - } - } - public static func parse_updateBotShippingQuery(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Buffer? - _3 = parseBytes(reader) - var _4: Api.PostAddress? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.PostAddress - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateBotShippingQuery(Cons_updateBotShippingQuery(queryId: _1!, userId: _2!, payload: _3!, shippingAddress: _4!)) - } - else { - return nil - } - } - public static func parse_updateBotStopped(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.Bool? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateBotStopped(Cons_updateBotStopped(userId: _1!, date: _2!, stopped: _3!, qts: _4!)) - } - else { - return nil - } - } - public static func parse_updateBotWebhookJSON(_ reader: BufferReader) -> Update? { - var _1: Api.DataJSON? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateBotWebhookJSON(Cons_updateBotWebhookJSON(data: _1!)) - } - else { - return nil - } - } - public static func parse_updateBotWebhookJSONQuery(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.DataJSON? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateBotWebhookJSONQuery(Cons_updateBotWebhookJSONQuery(queryId: _1!, data: _2!, timeout: _3!)) - } - else { - return nil - } - } - public static func parse_updateBusinessBotCallbackQuery(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: Api.Message? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Message - } - var _6: Api.Message? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) != 0 { - _8 = parseBytes(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_updateChannel(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateChannel(Cons_updateChannel(channelId: _1!)) - } - else { - return nil - } - } - public static func parse_updateChannelAvailableMessages(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateChannelAvailableMessages(Cons_updateChannelAvailableMessages(channelId: _1!, availableMinId: _2!)) - } - else { - return nil - } - } - public static func parse_updateChannelMessageForwards(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateChannelMessageForwards(Cons_updateChannelMessageForwards(channelId: _1!, id: _2!, forwards: _3!)) - } - else { - return nil - } - } - public static func parse_updateChannelMessageViews(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateChannelMessageViews(Cons_updateChannelMessageViews(channelId: _1!, id: _2!, views: _3!)) - } - else { - return nil - } - } - public static func parse_updateChannelParticipant(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - _4 = reader.readInt64() - var _5: Int64? - _5 = reader.readInt64() - var _6: Api.ChannelParticipant? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 - } - } - public static func parse_updateChannelReadMessagesContents(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Api.Peer? - if Int(_1 ?? 0) & 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) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateChannelReadMessagesContents(Cons_updateChannelReadMessagesContents(flags: _1!, channelId: _2!, topMsgId: _3, savedPeerId: _4, messages: _5!)) - } - else { - return nil - } - } - public static func parse_updateChannelTooLong(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateChannelTooLong(Cons_updateChannelTooLong(flags: _1!, channelId: _2!, pts: _3)) - } - else { - return nil - } - } - public static func parse_updateChannelUserTyping(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - if Int(_1 ?? 0) & 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 - } - var _5: Api.SendMessageAction? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.SendMessageAction - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateChannelUserTyping(Cons_updateChannelUserTyping(flags: _1!, channelId: _2!, topMsgId: _3, fromId: _4!, action: _5!)) - } - else { - return nil - } - } - public static func parse_updateChannelViewForumAsMessages(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.Bool? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateChannelViewForumAsMessages(Cons_updateChannelViewForumAsMessages(channelId: _1!, enabled: _2!)) - } - else { - return nil - } - } - public static func parse_updateChannelWebPage(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.WebPage? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.WebPage - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateChannelWebPage(Cons_updateChannelWebPage(channelId: _1!, webpage: _2!, pts: _3!, ptsCount: _4!)) - } - else { - return nil - } - } - public static func parse_updateChat(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateChat(Cons_updateChat(chatId: _1!)) - } - else { - return nil - } - } - public static func parse_updateChatDefaultBannedRights(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Api.ChatBannedRights? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights - } - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateChatDefaultBannedRights(Cons_updateChatDefaultBannedRights(peer: _1!, defaultBannedRights: _2!, version: _3!)) - } - else { - return nil - } - } - public static func parse_updateChatParticipant(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - _4 = reader.readInt64() - var _5: Int64? - _5 = reader.readInt64() - var _6: Api.ChatParticipant? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 - } - } - public static func parse_updateChatParticipantAdd(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateChatParticipantAdd(Cons_updateChatParticipantAdd(chatId: _1!, userId: _2!, inviterId: _3!, date: _4!, version: _5!)) - } - else { - return nil - } - } - public static func parse_updateChatParticipantAdmin(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.Bool? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateChatParticipantAdmin(Cons_updateChatParticipantAdmin(chatId: _1!, userId: _2!, isAdmin: _3!, version: _4!)) - } - else { - return nil - } - } - public static func parse_updateChatParticipantDelete(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateChatParticipantDelete(Cons_updateChatParticipantDelete(chatId: _1!, userId: _2!, version: _3!)) - } - else { - return nil - } - } - public static func parse_updateChatParticipantRank(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateChatParticipantRank(Cons_updateChatParticipantRank(chatId: _1!, userId: _2!, rank: _3!, version: _4!)) - } - else { - return nil - } - } - public static func parse_updateChatParticipants(_ reader: BufferReader) -> Update? { - var _1: Api.ChatParticipants? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.ChatParticipants - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateChatParticipants(Cons_updateChatParticipants(participants: _1!)) - } - else { - return nil - } - } - public static func parse_updateChatUserTyping(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Api.SendMessageAction? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.SendMessageAction - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateChatUserTyping(Cons_updateChatUserTyping(chatId: _1!, fromId: _2!, action: _3!)) - } - else { - return nil - } - } - public static func parse_updateConfig(_ reader: BufferReader) -> Update? { - return Api.Update.updateConfig - } - public static func parse_updateContactsReset(_ reader: BufferReader) -> Update? { - return Api.Update.updateContactsReset - } - public static func parse_updateDcOptions(_ reader: BufferReader) -> Update? { - var _1: [Api.DcOption]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DcOption.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateDcOptions(Cons_updateDcOptions(dcOptions: _1!)) - } - else { - return nil - } - } - public static func parse_updateDeleteChannelMessages(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateDeleteChannelMessages(Cons_updateDeleteChannelMessages(channelId: _1!, messages: _2!, pts: _3!, ptsCount: _4!)) - } - else { - return nil - } - } - public static func parse_updateDeleteGroupCallMessages(_ reader: BufferReader) -> Update? { - var _1: Api.InputGroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateDeleteGroupCallMessages(Cons_updateDeleteGroupCallMessages(call: _1!, messages: _2!)) - } - else { - return nil - } - } - public static func parse_updateDeleteMessages(_ reader: BufferReader) -> Update? { - var _1: [Int32]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateDeleteMessages(Cons_updateDeleteMessages(messages: _1!, pts: _2!, ptsCount: _3!)) - } - else { - return nil - } - } - public static func parse_updateDeleteQuickReply(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateDeleteQuickReply(Cons_updateDeleteQuickReply(shortcutId: _1!)) - } - else { - return nil - } - } - public static func parse_updateDeleteQuickReplyMessages(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateDeleteQuickReplyMessages(Cons_updateDeleteQuickReplyMessages(shortcutId: _1!, messages: _2!)) - } - else { - return nil - } - } - public static func parse_updateDeleteScheduledMessages(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: [Int32]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _4: [Int32]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateDeleteScheduledMessages(Cons_updateDeleteScheduledMessages(flags: _1!, peer: _2!, messages: _3!, sentMessages: _4)) - } - else { - return nil - } - } - public static func parse_updateDialogFilter(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.DialogFilter? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateDialogFilter(Cons_updateDialogFilter(flags: _1!, id: _2!, filter: _3)) - } - else { - return nil - } - } - public static func parse_updateDialogFilterOrder(_ reader: BufferReader) -> Update? { - var _1: [Int32]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateDialogFilterOrder(Cons_updateDialogFilterOrder(order: _1!)) - } - else { - return nil - } - } - public static func parse_updateDialogFilters(_ reader: BufferReader) -> Update? { - return Api.Update.updateDialogFilters - } - public static func parse_updateDialogPinned(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & 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 - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateDialogPinned(Cons_updateDialogPinned(flags: _1!, folderId: _2, peer: _3!)) - } - else { - return nil - } - } - public static func parse_updateDialogUnreadMark(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.DialogPeer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.DialogPeer - } - var _3: Api.Peer? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateDialogUnreadMark(Cons_updateDialogUnreadMark(flags: _1!, peer: _2!, savedPeerId: _3)) - } - else { - return nil - } - } - public static func parse_updateDraftMessage(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Api.Peer? - if Int(_1 ?? 0) & 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 - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateDraftMessage(Cons_updateDraftMessage(flags: _1!, peer: _2!, topMsgId: _3, savedPeerId: _4, draft: _5!)) - } - else { - return nil - } - } - public static func parse_updateEditChannelMessage(_ reader: BufferReader) -> Update? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateEditChannelMessage(Cons_updateEditChannelMessage(message: _1!, pts: _2!, ptsCount: _3!)) - } - else { - return nil - } - } - public static func parse_updateEditMessage(_ reader: BufferReader) -> Update? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateEditMessage(Cons_updateEditMessage(message: _1!, pts: _2!, ptsCount: _3!)) - } - else { - return nil - } - } - public static func parse_updateEmojiGameInfo(_ reader: BufferReader) -> Update? { - var _1: Api.messages.EmojiGameInfo? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.messages.EmojiGameInfo - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateEmojiGameInfo(Cons_updateEmojiGameInfo(info: _1!)) - } - else { - return nil - } - } - public static func parse_updateEncryptedChatTyping(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateEncryptedChatTyping(Cons_updateEncryptedChatTyping(chatId: _1!)) - } - else { - return nil - } - } - public static func parse_updateEncryptedMessagesRead(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateEncryptedMessagesRead(Cons_updateEncryptedMessagesRead(chatId: _1!, maxDate: _2!, date: _3!)) - } - else { - return nil - } - } - public static func parse_updateEncryption(_ reader: BufferReader) -> Update? { - var _1: Api.EncryptedChat? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.EncryptedChat - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateEncryption(Cons_updateEncryption(chat: _1!, date: _2!)) - } - else { - return nil - } - } - public static func parse_updateFavedStickers(_ reader: BufferReader) -> Update? { - return Api.Update.updateFavedStickers - } - public static func parse_updateFolderPeers(_ reader: BufferReader) -> Update? { - var _1: [Api.FolderPeer]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FolderPeer.self) - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateFolderPeers(Cons_updateFolderPeers(folderPeers: _1!, pts: _2!, ptsCount: _3!)) - } - else { - return nil - } - } - public static func parse_updateGeoLiveViewed(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateGeoLiveViewed(Cons_updateGeoLiveViewed(peer: _1!, msgId: _2!)) - } - else { - return nil - } - } - public static func parse_updateGroupCall(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & 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 - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateGroupCall(Cons_updateGroupCall(flags: _1!, peer: _2, call: _3!)) - } - else { - return nil - } - } - public static func parse_updateGroupCallChainBlocks(_ reader: BufferReader) -> Update? { - var _1: Api.InputGroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _2: Int32? - _2 = reader.readInt32() - var _3: [Buffer]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) - } - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateGroupCallChainBlocks(Cons_updateGroupCallChainBlocks(call: _1!, subChainId: _2!, blocks: _3!, nextOffset: _4!)) - } - else { - return nil - } - } - public static func parse_updateGroupCallConnection(_ reader: BufferReader) -> Update? { + + public static func parse_statsGraph(_ reader: BufferReader) -> StatsGraph? { var _1: Int32? _1 = reader.readInt32() var _2: Api.DataJSON? if let signature = reader.readInt32() { _2 = Api.parse(reader, signature: signature) as? Api.DataJSON } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateGroupCallConnection(Cons_updateGroupCallConnection(flags: _1!, params: _2!)) - } - else { - return nil - } - } - public static func parse_updateGroupCallEncryptedMessage(_ reader: BufferReader) -> Update? { - var _1: Api.InputGroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Buffer? - _3 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateGroupCallEncryptedMessage(Cons_updateGroupCallEncryptedMessage(call: _1!, fromId: _2!, encryptedMessage: _3!)) - } - else { - return nil - } - } - public static func parse_updateGroupCallMessage(_ reader: BufferReader) -> Update? { - var _1: Api.InputGroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _2: Api.GroupCallMessage? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.GroupCallMessage - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateGroupCallMessage(Cons_updateGroupCallMessage(call: _1!, message: _2!)) - } - else { - return nil - } - } - public static func parse_updateGroupCallParticipants(_ reader: BufferReader) -> Update? { - var _1: Api.InputGroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall - } - var _2: [Api.GroupCallParticipant]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) - } - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateGroupCallParticipants(Cons_updateGroupCallParticipants(call: _1!, participants: _2!, version: _3!)) - } - else { - return nil - } - } - public static func parse_updateInlineBotCallbackQuery(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: Api.InputBotInlineMessageID? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID - } - var _5: Int64? - _5 = reader.readInt64() - var _6: Buffer? + var _3: String? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseBytes(reader) - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _7 = parseString(reader) + _3 = parseString(reader) } let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Update.updateInlineBotCallbackQuery(Cons_updateInlineBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, msgId: _4!, chatInstance: _5!, data: _6, gameShortName: _7)) + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.StatsGraph.statsGraph(Cons_statsGraph(flags: _1!, json: _2!, zoomToken: _3)) } else { return nil } } - public static func parse_updateLangPack(_ reader: BufferReader) -> Update? { - var _1: Api.LangPackDifference? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.LangPackDifference - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateLangPack(Cons_updateLangPack(difference: _1!)) - } - else { - return nil - } - } - public static func parse_updateLangPackTooLong(_ reader: BufferReader) -> Update? { + public static func parse_statsGraphAsync(_ reader: BufferReader) -> StatsGraph? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.Update.updateLangPackTooLong(Cons_updateLangPackTooLong(langCode: _1!)) + return Api.StatsGraph.statsGraphAsync(Cons_statsGraphAsync(token: _1!)) } else { return nil } } - public static func parse_updateLoginToken(_ reader: BufferReader) -> Update? { - return Api.Update.updateLoginToken + public static func parse_statsGraphError(_ reader: BufferReader) -> StatsGraph? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.StatsGraph.statsGraphError(Cons_statsGraphError(error: _1!)) + } + else { + return nil + } } - public static func parse_updateManagedBot(_ reader: BufferReader) -> Update? { + } +} +public extension Api { + enum StatsGroupTopAdmin: TypeConstructorDescription { + public class Cons_statsGroupTopAdmin: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsGroupTopAdmin", [("userId", ConstructorParameterDescription(self.userId)), ("deleted", ConstructorParameterDescription(self.deleted)), ("kicked", ConstructorParameterDescription(self.kicked)), ("banned", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .statsGroupTopAdmin(let _data): + return ("statsGroupTopAdmin", [("userId", ConstructorParameterDescription(_data.userId)), ("deleted", ConstructorParameterDescription(_data.deleted)), ("kicked", ConstructorParameterDescription(_data.kicked)), ("banned", ConstructorParameterDescription(_data.banned))]) + } + } + + public static func parse_statsGroupTopAdmin(_ reader: BufferReader) -> StatsGroupTopAdmin? { var _1: Int64? _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateManagedBot(Cons_updateManagedBot(userId: _1!, botId: _2!, qts: _3!)) - } - else { - return nil - } - } - public static func parse_updateMessageExtendedMedia(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.MessageExtendedMedia]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageExtendedMedia.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateMessageExtendedMedia(Cons_updateMessageExtendedMedia(peer: _1!, msgId: _2!, extendedMedia: _3!)) - } - else { - return nil - } - } - public static func parse_updateMessageID(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateMessageID(Cons_updateMessageID(id: _1!, randomId: _2!)) - } - else { - return nil - } - } - public static func parse_updateMessagePoll(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt32() - } - var _5: Int64? - _5 = reader.readInt64() - var _6: Api.Poll? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Poll - } - } - var _7: Api.PollResults? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.PollResults - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.Update.updateMessagePoll(Cons_updateMessagePoll(flags: _1!, peer: _2, msgId: _3, topMsgId: _4, pollId: _5!, poll: _6, results: _7!)) - } - else { - return nil - } - } - public static func parse_updateMessagePollVote(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: [Buffer]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) - } - var _4: [Int32]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateMessagePollVote(Cons_updateMessagePollVote(pollId: _1!, peer: _2!, options: _3!, positions: _4!, qts: _5!)) - } - else { - return nil - } - } - public static func parse_updateMessageReactions(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = reader.readInt32() - } - var _5: Api.Peer? - if Int(_1 ?? 0) & 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 - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateMessageReactions(Cons_updateMessageReactions(flags: _1!, peer: _2!, msgId: _3!, topMsgId: _4, savedPeerId: _5, reactions: _6!)) - } - else { - return nil - } - } - public static func parse_updateMonoForumNoPaidException(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Api.Peer? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateMonoForumNoPaidException(Cons_updateMonoForumNoPaidException(flags: _1!, channelId: _2!, savedPeerId: _3!)) - } - else { - return nil - } - } - public static func parse_updateMoveStickerSetToTop(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateMoveStickerSetToTop(Cons_updateMoveStickerSetToTop(flags: _1!, stickerset: _2!)) - } - else { - return nil - } - } - public static func parse_updateNewAuthorization(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateNewAuthorization(Cons_updateNewAuthorization(flags: _1!, hash: _2!, date: _3, device: _4, location: _5)) - } - else { - return nil - } - } - public static func parse_updateNewChannelMessage(_ reader: BufferReader) -> Update? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateNewChannelMessage(Cons_updateNewChannelMessage(message: _1!, pts: _2!, ptsCount: _3!)) - } - else { - return nil - } - } - public static func parse_updateNewEncryptedMessage(_ reader: BufferReader) -> Update? { - var _1: Api.EncryptedMessage? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.EncryptedMessage - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateNewEncryptedMessage(Cons_updateNewEncryptedMessage(message: _1!, qts: _2!)) - } - else { - return nil - } - } - public static func parse_updateNewMessage(_ reader: BufferReader) -> Update? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateNewMessage(Cons_updateNewMessage(message: _1!, pts: _2!, ptsCount: _3!)) - } - else { - return nil - } - } - public static func parse_updateNewQuickReply(_ reader: BufferReader) -> Update? { - var _1: Api.QuickReply? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.QuickReply - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateNewQuickReply(Cons_updateNewQuickReply(quickReply: _1!)) - } - else { - return nil - } - } - public static func parse_updateNewScheduledMessage(_ reader: BufferReader) -> Update? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateNewScheduledMessage(Cons_updateNewScheduledMessage(message: _1!)) - } - else { - return nil - } - } - public static func parse_updateNewStickerSet(_ reader: BufferReader) -> Update? { - var _1: Api.messages.StickerSet? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.messages.StickerSet - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateNewStickerSet(Cons_updateNewStickerSet(stickerset: _1!)) - } - else { - return nil - } - } - public static func parse_updateNewStoryReaction(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Api.Reaction? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Reaction - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateNewStoryReaction(Cons_updateNewStoryReaction(storyId: _1!, peer: _2!, reaction: _3!)) - } - else { - return nil - } - } - public static func parse_updateNotifySettings(_ reader: BufferReader) -> Update? { - var _1: Api.NotifyPeer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.NotifyPeer - } - var _2: Api.PeerNotifySettings? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateNotifySettings(Cons_updateNotifySettings(peer: _1!, notifySettings: _2!)) - } - else { - return nil - } - } - public static func parse_updatePaidReactionPrivacy(_ reader: BufferReader) -> Update? { - var _1: Api.PaidReactionPrivacy? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PaidReactionPrivacy - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updatePaidReactionPrivacy(Cons_updatePaidReactionPrivacy(private: _1!)) - } - else { - return nil - } - } - public static func parse_updatePeerBlocked(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updatePeerBlocked(Cons_updatePeerBlocked(flags: _1!, peerId: _2!)) - } - else { - return nil - } - } - public static func parse_updatePeerHistoryTTL(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updatePeerHistoryTTL(Cons_updatePeerHistoryTTL(flags: _1!, peer: _2!, ttlPeriod: _3)) - } - else { - return nil - } - } - public static func parse_updatePeerLocated(_ reader: BufferReader) -> Update? { - var _1: [Api.PeerLocated]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerLocated.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updatePeerLocated(Cons_updatePeerLocated(peers: _1!)) - } - else { - return nil - } - } - public static func parse_updatePeerSettings(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Api.PeerSettings? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PeerSettings - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updatePeerSettings(Cons_updatePeerSettings(peer: _1!, settings: _2!)) - } - else { - return nil - } - } - public static func parse_updatePeerWallpaper(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Api.WallPaper? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updatePeerWallpaper(Cons_updatePeerWallpaper(flags: _1!, peer: _2!, wallpaper: _3)) - } - else { - return nil - } - } - public static func parse_updatePendingJoinRequests(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Int32? - _2 = reader.readInt32() - var _3: [Int64]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updatePendingJoinRequests(Cons_updatePendingJoinRequests(peer: _1!, requestsPending: _2!, recentRequesters: _3!)) - } - else { - return nil - } - } - public static func parse_updatePhoneCall(_ reader: BufferReader) -> Update? { - var _1: Api.PhoneCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PhoneCall - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updatePhoneCall(Cons_updatePhoneCall(phoneCall: _1!)) - } - else { - return nil - } - } - public static func parse_updatePhoneCallSignalingData(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updatePhoneCallSignalingData(Cons_updatePhoneCallSignalingData(phoneCallId: _1!, data: _2!)) - } - else { - return nil - } - } - public static func parse_updatePinnedChannelMessages(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: [Int32]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updatePinnedChannelMessages(Cons_updatePinnedChannelMessages(flags: _1!, channelId: _2!, messages: _3!, pts: _4!, ptsCount: _5!)) - } - else { - return nil - } - } - public static func parse_updatePinnedDialogs(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _2 = reader.readInt32() - } - var _3: [Api.DialogPeer]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updatePinnedDialogs(Cons_updatePinnedDialogs(flags: _1!, folderId: _2, order: _3)) - } - else { - return nil - } - } - public static func parse_updatePinnedForumTopic(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - 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 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updatePinnedForumTopic(Cons_updatePinnedForumTopic(flags: _1!, peer: _2!, topicId: _3!)) - } - else { - return nil - } - } - public static func parse_updatePinnedForumTopics(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: [Int32]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updatePinnedForumTopics(Cons_updatePinnedForumTopics(flags: _1!, peer: _2!, order: _3)) - } - else { - return nil - } - } - public static func parse_updatePinnedMessages(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: [Int32]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updatePinnedMessages(Cons_updatePinnedMessages(flags: _1!, peer: _2!, messages: _3!, pts: _4!, ptsCount: _5!)) - } - else { - return nil - } - } - public static func parse_updatePinnedSavedDialogs(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.DialogPeer]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.Update.updatePinnedSavedDialogs(Cons_updatePinnedSavedDialogs(flags: _1!, order: _2)) - } - else { - return nil - } - } - public static func parse_updatePrivacy(_ reader: BufferReader) -> Update? { - var _1: Api.PrivacyKey? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PrivacyKey - } - var _2: [Api.PrivacyRule]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updatePrivacy(Cons_updatePrivacy(key: _1!, rules: _2!)) - } - else { - return nil - } - } - public static func parse_updatePtsChanged(_ reader: BufferReader) -> Update? { - return Api.Update.updatePtsChanged - } - public static func parse_updateQuickReplies(_ reader: BufferReader) -> Update? { - var _1: [Api.QuickReply]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.QuickReply.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateQuickReplies(Cons_updateQuickReplies(quickReplies: _1!)) - } - else { - return nil - } - } - public static func parse_updateQuickReplyMessage(_ reader: BufferReader) -> Update? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Message - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateQuickReplyMessage(Cons_updateQuickReplyMessage(message: _1!)) - } - else { - return nil - } - } - public static func parse_updateReadChannelDiscussionInbox(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _5 = reader.readInt64() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateReadChannelDiscussionInbox(Cons_updateReadChannelDiscussionInbox(flags: _1!, channelId: _2!, topMsgId: _3!, readMaxId: _4!, broadcastId: _5, broadcastPost: _6)) - } - else { - return nil - } - } - public static func parse_updateReadChannelDiscussionOutbox(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateReadChannelDiscussionOutbox(Cons_updateReadChannelDiscussionOutbox(channelId: _1!, topMsgId: _2!, readMaxId: _3!)) - } - else { - return nil - } - } - public static func parse_updateReadChannelInbox(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateReadChannelInbox(Cons_updateReadChannelInbox(flags: _1!, folderId: _2, channelId: _3!, maxId: _4!, stillUnreadCount: _5!, pts: _6!)) - } - else { - return nil - } - } - public static func parse_updateReadChannelOutbox(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateReadChannelOutbox(Cons_updateReadChannelOutbox(channelId: _1!, maxId: _2!)) - } - else { - return nil - } - } - public static func parse_updateReadFeaturedEmojiStickers(_ reader: BufferReader) -> Update? { - return Api.Update.updateReadFeaturedEmojiStickers - } - public static func parse_updateReadFeaturedStickers(_ reader: BufferReader) -> Update? { - return Api.Update.updateReadFeaturedStickers - } - public static func parse_updateReadHistoryInbox(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { - _4 = reader.readInt32() - } - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - var _7: Int32? - _7 = reader.readInt32() - var _8: Int32? - _8 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_updateReadHistoryOutbox(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } var _2: Int32? _2 = reader.readInt32() var _3: Int32? @@ -6228,284 +272,311 @@ public extension Api { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateReadHistoryOutbox(Cons_updateReadHistoryOutbox(peer: _1!, maxId: _2!, pts: _3!, ptsCount: _4!)) + return Api.StatsGroupTopAdmin.statsGroupTopAdmin(Cons_statsGroupTopAdmin(userId: _1!, deleted: _2!, kicked: _3!, banned: _4!)) } else { return nil } } - public static func parse_updateReadMessagesContents(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } +} +public extension Api { + enum StatsGroupTopInviter: TypeConstructorDescription { + public class Cons_statsGroupTopInviter: TypeConstructorDescription { + public var userId: Int64 + public var invitations: Int32 + public init(userId: Int64, invitations: Int32) { + self.userId = userId + self.invitations = invitations } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateReadMessagesContents(Cons_updateReadMessagesContents(flags: _1!, messages: _2!, pts: _3!, ptsCount: _4!, date: _5)) - } - else { - return nil + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsGroupTopInviter", [("userId", ConstructorParameterDescription(self.userId)), ("invitations", ConstructorParameterDescription(self.invitations))]) } } - public static func parse_updateReadMonoForumInbox(_ reader: BufferReader) -> Update? { + 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, ConstructorParameterDescription)]) { + switch self { + case .statsGroupTopInviter(let _data): + return ("statsGroupTopInviter", [("userId", ConstructorParameterDescription(_data.userId)), ("invitations", ConstructorParameterDescription(_data.invitations))]) + } + } + + public static func parse_statsGroupTopInviter(_ reader: BufferReader) -> StatsGroupTopInviter? { var _1: Int64? _1 = reader.readInt64() - var _2: Api.Peer? - 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 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateReadMonoForumInbox(Cons_updateReadMonoForumInbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!)) - } - else { - return nil - } - } - public static func parse_updateReadMonoForumOutbox(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.Peer? - 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 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateReadMonoForumOutbox(Cons_updateReadMonoForumOutbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!)) - } - else { - return nil - } - } - public static func parse_updateReadStories(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } var _2: Int32? _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateReadStories(Cons_updateReadStories(peer: _1!, maxId: _2!)) + return Api.StatsGroupTopInviter.statsGroupTopInviter(Cons_statsGroupTopInviter(userId: _1!, invitations: _2!)) } else { return nil } } - public static func parse_updateRecentEmojiStatuses(_ reader: BufferReader) -> Update? { - return Api.Update.updateRecentEmojiStatuses - } - public static func parse_updateRecentReactions(_ reader: BufferReader) -> Update? { - return Api.Update.updateRecentReactions - } - public static func parse_updateRecentStickers(_ reader: BufferReader) -> Update? { - return Api.Update.updateRecentStickers - } - public static func parse_updateSavedDialogPinned(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.DialogPeer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.DialogPeer + } +} +public extension Api { + enum StatsGroupTopPoster: TypeConstructorDescription { + public class Cons_statsGroupTopPoster: TypeConstructorDescription { + 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 } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateSavedDialogPinned(Cons_updateSavedDialogPinned(flags: _1!, peer: _2!)) - } - else { - return nil + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsGroupTopPoster", [("userId", ConstructorParameterDescription(self.userId)), ("messages", ConstructorParameterDescription(self.messages)), ("avgChars", ConstructorParameterDescription(self.avgChars))]) } } - public static func parse_updateSavedGifs(_ reader: BufferReader) -> Update? { - return Api.Update.updateSavedGifs - } - public static func parse_updateSavedReactionTags(_ reader: BufferReader) -> Update? { - return Api.Update.updateSavedReactionTags - } - public static func parse_updateSavedRingtones(_ reader: BufferReader) -> Update? { - return Api.Update.updateSavedRingtones - } - public static func parse_updateSentPhoneCode(_ reader: BufferReader) -> Update? { - var _1: Api.auth.SentCode? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateSentPhoneCode(Cons_updateSentPhoneCode(sentCode: _1!)) - } - else { - return nil + 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 static func parse_updateSentStoryReaction(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .statsGroupTopPoster(let _data): + return ("statsGroupTopPoster", [("userId", ConstructorParameterDescription(_data.userId)), ("messages", ConstructorParameterDescription(_data.messages)), ("avgChars", ConstructorParameterDescription(_data.avgChars))]) } + } + + public static func parse_statsGroupTopPoster(_ reader: BufferReader) -> StatsGroupTopPoster? { + var _1: Int64? + _1 = reader.readInt64() var _2: Int32? _2 = reader.readInt32() - var _3: Api.Reaction? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Reaction - } + var _3: Int32? + _3 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.Update.updateSentStoryReaction(Cons_updateSentStoryReaction(peer: _1!, storyId: _2!, reaction: _3!)) + return Api.StatsGroupTopPoster.statsGroupTopPoster(Cons_statsGroupTopPoster(userId: _1!, messages: _2!, avgChars: _3!)) } else { return nil } } - public static func parse_updateServiceNotification(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _2 = reader.readInt32() + } +} +public extension Api { + enum StatsPercentValue: TypeConstructorDescription { + public class Cons_statsPercentValue: TypeConstructorDescription { + public var part: Double + public var total: Double + public init(part: Double, total: Double) { + self.part = part + self.total = total } - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: Api.MessageMedia? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.MessageMedia + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsPercentValue", [("part", ConstructorParameterDescription(self.part)), ("total", ConstructorParameterDescription(self.total))]) } - var _6: [Api.MessageEntity]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + 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, ConstructorParameterDescription)]) { + switch self { + case .statsPercentValue(let _data): + return ("statsPercentValue", [("part", ConstructorParameterDescription(_data.part)), ("total", ConstructorParameterDescription(_data.total))]) + } + } + + public static func parse_statsPercentValue(_ reader: BufferReader) -> StatsPercentValue? { + var _1: Double? + _1 = reader.readDouble() + var _2: Double? + _2 = reader.readDouble() let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Update.updateServiceNotification(Cons_updateServiceNotification(flags: _1!, inboxDate: _2, type: _3!, message: _4!, media: _5!, entities: _6!)) + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.StatsPercentValue.statsPercentValue(Cons_statsPercentValue(part: _1!, total: _2!)) } else { return nil } } - public static func parse_updateSmsJob(_ reader: BufferReader) -> Update? { + } +} +public extension Api { + enum StatsURL: TypeConstructorDescription { + public class Cons_statsURL: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("statsURL", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .statsURL(let _data): + return ("statsURL", [("url", ConstructorParameterDescription(_data.url))]) + } + } + + public static func parse_statsURL(_ reader: BufferReader) -> StatsURL? { var _1: String? _1 = parseString(reader) let _c1 = _1 != nil if _c1 { - return Api.Update.updateSmsJob(Cons_updateSmsJob(jobId: _1!)) + return Api.StatsURL.statsURL(Cons_statsURL(url: _1!)) } else { return nil } } - public static func parse_updateStarGiftAuctionState(_ reader: BufferReader) -> Update? { + } +} +public extension Api { + enum StickerKeyword: TypeConstructorDescription { + public class Cons_stickerKeyword: TypeConstructorDescription { + public var documentId: Int64 + public var keyword: [String] + public init(documentId: Int64, keyword: [String]) { + self.documentId = documentId + self.keyword = keyword + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerKeyword", [("documentId", ConstructorParameterDescription(self.documentId)), ("keyword", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .stickerKeyword(let _data): + return ("stickerKeyword", [("documentId", ConstructorParameterDescription(_data.documentId)), ("keyword", ConstructorParameterDescription(_data.keyword))]) + } + } + + public static func parse_stickerKeyword(_ reader: BufferReader) -> StickerKeyword? { var _1: Int64? _1 = reader.readInt64() - var _2: Api.StarGiftAuctionState? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionState + var _2: [String]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStarGiftAuctionState(Cons_updateStarGiftAuctionState(giftId: _1!, state: _2!)) + return Api.StickerKeyword.stickerKeyword(Cons_stickerKeyword(documentId: _1!, keyword: _2!)) } else { return nil } } - public static func parse_updateStarGiftAuctionUserState(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.StarGiftAuctionUserState? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionUserState + } +} +public extension Api { + enum StickerPack: TypeConstructorDescription { + public class Cons_stickerPack: TypeConstructorDescription { + public var emoticon: String + public var documents: [Int64] + public init(emoticon: String, documents: [Int64]) { + self.emoticon = emoticon + self.documents = documents } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateStarGiftAuctionUserState(Cons_updateStarGiftAuctionUserState(giftId: _1!, userState: _2!)) - } - else { - return nil + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerPack", [("emoticon", ConstructorParameterDescription(self.emoticon)), ("documents", ConstructorParameterDescription(self.documents))]) } } - public static func parse_updateStarGiftCraftFail(_ reader: BufferReader) -> Update? { - return Api.Update.updateStarGiftCraftFail - } - public static func parse_updateStarsBalance(_ reader: BufferReader) -> Update? { - var _1: Api.StarsAmount? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateStarsBalance(Cons_updateStarsBalance(balance: _1!)) - } - else { - return nil + 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 static func parse_updateStarsRevenueStatus(_ reader: BufferReader) -> Update? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: Api.StarsRevenueStatus? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarsRevenueStatus - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateStarsRevenueStatus(Cons_updateStarsRevenueStatus(peer: _1!, status: _2!)) - } - else { - return nil + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .stickerPack(let _data): + return ("stickerPack", [("emoticon", ConstructorParameterDescription(_data.emoticon)), ("documents", ConstructorParameterDescription(_data.documents))]) } } - public static func parse_updateStickerSets(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateStickerSets(Cons_updateStickerSets(flags: _1!)) - } - else { - return nil - } - } - public static func parse_updateStickerSetsOrder(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() + + public static func parse_stickerPack(_ reader: BufferReader) -> StickerPack? { + var _1: String? + _1 = parseString(reader) var _2: [Int64]? if let _ = reader.readInt32() { _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) @@ -6513,26 +584,956 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStickerSetsOrder(Cons_updateStickerSetsOrder(flags: _1!, order: _2!)) + return Api.StickerPack.stickerPack(Cons_stickerPack(emoticon: _1!, documents: _2!)) } else { return nil } } - public static func parse_updateStoriesStealthMode(_ reader: BufferReader) -> Update? { - var _1: Api.StoriesStealthMode? + } +} +public extension Api { + enum StickerSet: TypeConstructorDescription { + public class Cons_stickerSet: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSet", [("flags", ConstructorParameterDescription(self.flags)), ("installedDate", ConstructorParameterDescription(self.installedDate)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("title", ConstructorParameterDescription(self.title)), ("shortName", ConstructorParameterDescription(self.shortName)), ("thumbs", ConstructorParameterDescription(self.thumbs)), ("thumbDcId", ConstructorParameterDescription(self.thumbDcId)), ("thumbVersion", ConstructorParameterDescription(self.thumbVersion)), ("thumbDocumentId", ConstructorParameterDescription(self.thumbDocumentId)), ("count", ConstructorParameterDescription(self.count)), ("hash", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { + switch self { + case .stickerSet(let _data): + return ("stickerSet", [("flags", ConstructorParameterDescription(_data.flags)), ("installedDate", ConstructorParameterDescription(_data.installedDate)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("title", ConstructorParameterDescription(_data.title)), ("shortName", ConstructorParameterDescription(_data.shortName)), ("thumbs", ConstructorParameterDescription(_data.thumbs)), ("thumbDcId", ConstructorParameterDescription(_data.thumbDcId)), ("thumbVersion", ConstructorParameterDescription(_data.thumbVersion)), ("thumbDocumentId", ConstructorParameterDescription(_data.thumbDocumentId)), ("count", ConstructorParameterDescription(_data.count)), ("hash", ConstructorParameterDescription(_data.hash))]) + } + } + + public static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + var _3: Int64? + _3 = reader.readInt64() + var _4: Int64? + _4 = reader.readInt64() + var _5: String? + _5 = parseString(reader) + var _6: String? + _6 = parseString(reader) + var _7: [Api.PhotoSize]? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) + } + } + var _8: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } + var _9: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _9 = reader.readInt32() + } + var _10: Int64? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _10 = reader.readInt64() + } + var _11: Int32? + _11 = reader.readInt32() + var _12: Int32? + _12 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _10 != nil + 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(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 { + public class Cons_stickerSetCovered: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetCovered", [("set", ConstructorParameterDescription(self.set)), ("cover", ConstructorParameterDescription(self.cover))]) + } + } + public class Cons_stickerSetFullCovered: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetFullCovered", [("set", ConstructorParameterDescription(self.set)), ("packs", ConstructorParameterDescription(self.packs)), ("keywords", ConstructorParameterDescription(self.keywords)), ("documents", ConstructorParameterDescription(self.documents))]) + } + } + public class Cons_stickerSetMultiCovered: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetMultiCovered", [("set", ConstructorParameterDescription(self.set)), ("covers", ConstructorParameterDescription(self.covers))]) + } + } + public class Cons_stickerSetNoCovered: TypeConstructorDescription { + public var set: Api.StickerSet + public init(set: Api.StickerSet) { + self.set = set + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetNoCovered", [("set", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .stickerSetCovered(let _data): + return ("stickerSetCovered", [("set", ConstructorParameterDescription(_data.set)), ("cover", ConstructorParameterDescription(_data.cover))]) + case .stickerSetFullCovered(let _data): + return ("stickerSetFullCovered", [("set", ConstructorParameterDescription(_data.set)), ("packs", ConstructorParameterDescription(_data.packs)), ("keywords", ConstructorParameterDescription(_data.keywords)), ("documents", ConstructorParameterDescription(_data.documents))]) + case .stickerSetMultiCovered(let _data): + return ("stickerSetMultiCovered", [("set", ConstructorParameterDescription(_data.set)), ("covers", ConstructorParameterDescription(_data.covers))]) + case .stickerSetNoCovered(let _data): + return ("stickerSetNoCovered", [("set", ConstructorParameterDescription(_data.set))]) + } + } + + public static func parse_stickerSetCovered(_ reader: BufferReader) -> StickerSetCovered? { + var _1: Api.StickerSet? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StoriesStealthMode + _1 = Api.parse(reader, signature: signature) as? Api.StickerSet + } + var _2: Api.Document? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Document + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.StickerSetCovered.stickerSetCovered(Cons_stickerSetCovered(set: _1!, cover: _2!)) + } + else { + return nil + } + } + public static func parse_stickerSetFullCovered(_ reader: BufferReader) -> StickerSetCovered? { + var _1: Api.StickerSet? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StickerSet + } + var _2: [Api.StickerPack]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerPack.self) + } + var _3: [Api.StickerKeyword]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerKeyword.self) + } + var _4: [Api.Document]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.StickerSetCovered.stickerSetFullCovered(Cons_stickerSetFullCovered(set: _1!, packs: _2!, keywords: _3!, documents: _4!)) + } + else { + return nil + } + } + public static func parse_stickerSetMultiCovered(_ reader: BufferReader) -> StickerSetCovered? { + var _1: Api.StickerSet? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StickerSet + } + var _2: [Api.Document]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.StickerSetCovered.stickerSetMultiCovered(Cons_stickerSetMultiCovered(set: _1!, covers: _2!)) + } + else { + return nil + } + } + public static func parse_stickerSetNoCovered(_ reader: BufferReader) -> StickerSetCovered? { + var _1: Api.StickerSet? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StickerSet } let _c1 = _1 != nil if _c1 { - return Api.Update.updateStoriesStealthMode(Cons_updateStoriesStealthMode(stealthMode: _1!)) + return Api.StickerSetCovered.stickerSetNoCovered(Cons_stickerSetNoCovered(set: _1!)) } else { return nil } } - public static func parse_updateStory(_ reader: BufferReader) -> Update? { + } +} +public extension Api { + enum StoriesStealthMode: TypeConstructorDescription { + public class Cons_storiesStealthMode: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storiesStealthMode", [("flags", ConstructorParameterDescription(self.flags)), ("activeUntilDate", ConstructorParameterDescription(self.activeUntilDate)), ("cooldownUntilDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .storiesStealthMode(let _data): + return ("storiesStealthMode", [("flags", ConstructorParameterDescription(_data.flags)), ("activeUntilDate", ConstructorParameterDescription(_data.activeUntilDate)), ("cooldownUntilDate", ConstructorParameterDescription(_data.cooldownUntilDate))]) + } + } + + public static func parse_storiesStealthMode(_ reader: BufferReader) -> StoriesStealthMode? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.StoriesStealthMode.storiesStealthMode(Cons_storiesStealthMode(flags: _1!, activeUntilDate: _2, cooldownUntilDate: _3)) + } + else { + return nil + } + } + } +} +public extension Api { + enum StoryAlbum: TypeConstructorDescription { + public class Cons_storyAlbum: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyAlbum", [("flags", ConstructorParameterDescription(self.flags)), ("albumId", ConstructorParameterDescription(self.albumId)), ("title", ConstructorParameterDescription(self.title)), ("iconPhoto", ConstructorParameterDescription(self.iconPhoto)), ("iconVideo", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .storyAlbum(let _data): + return ("storyAlbum", [("flags", ConstructorParameterDescription(_data.flags)), ("albumId", ConstructorParameterDescription(_data.albumId)), ("title", ConstructorParameterDescription(_data.title)), ("iconPhoto", ConstructorParameterDescription(_data.iconPhoto)), ("iconVideo", ConstructorParameterDescription(_data.iconVideo))]) + } + } + + public static func parse_storyAlbum(_ reader: BufferReader) -> StoryAlbum? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + var _4: Api.Photo? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_storyFwdHeader: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyFwdHeader", [("flags", ConstructorParameterDescription(self.flags)), ("from", ConstructorParameterDescription(self.from)), ("fromName", ConstructorParameterDescription(self.fromName)), ("storyId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .storyFwdHeader(let _data): + return ("storyFwdHeader", [("flags", ConstructorParameterDescription(_data.flags)), ("from", ConstructorParameterDescription(_data.from)), ("fromName", ConstructorParameterDescription(_data.fromName)), ("storyId", ConstructorParameterDescription(_data.storyId))]) + } + } + + public static func parse_storyFwdHeader(_ reader: BufferReader) -> StoryFwdHeader? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.StoryFwdHeader.storyFwdHeader(Cons_storyFwdHeader(flags: _1!, from: _2, fromName: _3, storyId: _4)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum StoryItem: TypeConstructorDescription { + public class Cons_storyItem: TypeConstructorDescription { + 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 var music: Api.Document? + 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]?, music: Api.Document?) { + 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 + self.music = music + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyItem", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("date", ConstructorParameterDescription(self.date)), ("fromId", ConstructorParameterDescription(self.fromId)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("expireDate", ConstructorParameterDescription(self.expireDate)), ("caption", ConstructorParameterDescription(self.caption)), ("entities", ConstructorParameterDescription(self.entities)), ("media", ConstructorParameterDescription(self.media)), ("mediaAreas", ConstructorParameterDescription(self.mediaAreas)), ("privacy", ConstructorParameterDescription(self.privacy)), ("views", ConstructorParameterDescription(self.views)), ("sentReaction", ConstructorParameterDescription(self.sentReaction)), ("albums", ConstructorParameterDescription(self.albums)), ("music", ConstructorParameterDescription(self.music))]) + } + } + public class Cons_storyItemDeleted: TypeConstructorDescription { + public var id: Int32 + public init(id: Int32) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyItemDeleted", [("id", ConstructorParameterDescription(self.id))]) + } + } + public class Cons_storyItemSkipped: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyItemSkipped", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("date", ConstructorParameterDescription(self.date)), ("expireDate", ConstructorParameterDescription(self.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(379894076) + } + 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) + } + } + _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) + } + } + 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(_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) + } + } + if Int(_data.flags) & Int(1 << 20) != 0 { + _data.music!.serialize(buffer, true) + } + 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, ConstructorParameterDescription)]) { + switch self { + case .storyItem(let _data): + return ("storyItem", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("date", ConstructorParameterDescription(_data.date)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("expireDate", ConstructorParameterDescription(_data.expireDate)), ("caption", ConstructorParameterDescription(_data.caption)), ("entities", ConstructorParameterDescription(_data.entities)), ("media", ConstructorParameterDescription(_data.media)), ("mediaAreas", ConstructorParameterDescription(_data.mediaAreas)), ("privacy", ConstructorParameterDescription(_data.privacy)), ("views", ConstructorParameterDescription(_data.views)), ("sentReaction", ConstructorParameterDescription(_data.sentReaction)), ("albums", ConstructorParameterDescription(_data.albums)), ("music", ConstructorParameterDescription(_data.music))]) + case .storyItemDeleted(let _data): + return ("storyItemDeleted", [("id", ConstructorParameterDescription(_data.id))]) + case .storyItemSkipped(let _data): + return ("storyItemSkipped", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("date", ConstructorParameterDescription(_data.date)), ("expireDate", ConstructorParameterDescription(_data.expireDate))]) + } + } + + public static func parse_storyItem(_ reader: BufferReader) -> StoryItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) != 0 { + _7 = parseString(reader) + } + var _8: [Api.MessageEntity]? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.Reaction + } + } + var _14: [Int32]? + if Int(_1 ?? 0) & Int(1 << 19) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } + var _15: Api.Document? + if Int(_1 ?? 0) & Int(1 << 20) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.Document + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil + let _c9 = _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 20) == 0) || _15 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 { + 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, music: _15)) + } + else { + return nil + } + } + public static func parse_storyItemDeleted(_ reader: BufferReader) -> StoryItem? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.StoryItem.storyItemDeleted(Cons_storyItemDeleted(id: _1!)) + } + else { + return nil + } + } + public static func parse_storyItemSkipped(_ reader: BufferReader) -> StoryItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.StoryItem.storyItemSkipped(Cons_storyItemSkipped(flags: _1!, id: _2!, date: _3!, expireDate: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum StoryReaction: TypeConstructorDescription { + public class Cons_storyReaction: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyReaction", [("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.date)), ("reaction", ConstructorParameterDescription(self.reaction))]) + } + } + public class Cons_storyReactionPublicForward: TypeConstructorDescription { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyReactionPublicForward", [("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_storyReactionPublicRepost: TypeConstructorDescription { + public var peerId: Api.Peer + public var story: Api.StoryItem + public init(peerId: Api.Peer, story: Api.StoryItem) { + self.peerId = peerId + self.story = story + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyReactionPublicRepost", [("peerId", ConstructorParameterDescription(self.peerId)), ("story", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .storyReaction(let _data): + return ("storyReaction", [("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) + case .storyReactionPublicForward(let _data): + return ("storyReactionPublicForward", [("message", ConstructorParameterDescription(_data.message))]) + case .storyReactionPublicRepost(let _data): + return ("storyReactionPublicRepost", [("peerId", ConstructorParameterDescription(_data.peerId)), ("story", ConstructorParameterDescription(_data.story))]) + } + } + + public static func parse_storyReaction(_ reader: BufferReader) -> StoryReaction? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.Reaction? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Reaction + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.StoryReaction.storyReaction(Cons_storyReaction(peerId: _1!, date: _2!, reaction: _3!)) + } + else { + return nil + } + } + public static func parse_storyReactionPublicForward(_ reader: BufferReader) -> StoryReaction? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + let _c1 = _1 != nil + if _c1 { + return Api.StoryReaction.storyReactionPublicForward(Cons_storyReactionPublicForward(message: _1!)) + } + else { + return nil + } + } + public static func parse_storyReactionPublicRepost(_ reader: BufferReader) -> StoryReaction? { var _1: Api.Peer? if let signature = reader.readInt32() { _1 = Api.parse(reader, signature: signature) as? Api.Peer @@ -6544,192 +1545,381 @@ public extension Api { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Update.updateStory(Cons_updateStory(peer: _1!, story: _2!)) - } - else { - return nil - } - } - public static func parse_updateStoryID(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateStoryID(Cons_updateStoryID(id: _1!, randomId: _2!)) - } - else { - return nil - } - } - public static func parse_updateTheme(_ reader: BufferReader) -> Update? { - var _1: Api.Theme? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Theme - } - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateTheme(Cons_updateTheme(theme: _1!)) - } - else { - return nil - } - } - public static func parse_updateTranscribedAudio(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Int64? - _4 = reader.readInt64() - var _5: String? - _5 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Update.updateTranscribedAudio(Cons_updateTranscribedAudio(flags: _1!, peer: _2!, msgId: _3!, transcriptionId: _4!, text: _5!)) - } - else { - return nil - } - } - public static func parse_updateUser(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateUser(Cons_updateUser(userId: _1!)) - } - else { - return nil - } - } - public static func parse_updateUserEmojiStatus(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.EmojiStatus? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.EmojiStatus - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateUserEmojiStatus(Cons_updateUserEmojiStatus(userId: _1!, emojiStatus: _2!)) - } - else { - return nil - } - } - public static func parse_updateUserName(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: [Api.Username]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Username.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateUserName(Cons_updateUserName(userId: _1!, firstName: _2!, lastName: _3!, usernames: _4!)) - } - else { - return nil - } - } - public static func parse_updateUserPhone(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateUserPhone(Cons_updateUserPhone(userId: _1!, phone: _2!)) - } - else { - return nil - } - } - public static func parse_updateUserStatus(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.UserStatus? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.UserStatus - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Update.updateUserStatus(Cons_updateUserStatus(userId: _1!, status: _2!)) - } - else { - return nil - } - } - public static func parse_updateUserTyping(_ reader: BufferReader) -> Update? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - if Int(_1 ?? 0) & 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 - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.Update.updateUserTyping(Cons_updateUserTyping(flags: _1!, userId: _2!, topMsgId: _3, action: _4!)) - } - else { - return nil - } - } - public static func parse_updateWebPage(_ reader: BufferReader) -> Update? { - var _1: Api.WebPage? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.WebPage - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.Update.updateWebPage(Cons_updateWebPage(webpage: _1!, pts: _2!, ptsCount: _3!)) - } - else { - return nil - } - } - public static func parse_updateWebViewResultSent(_ reader: BufferReader) -> Update? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.Update.updateWebViewResultSent(Cons_updateWebViewResultSent(queryId: _1!)) + return Api.StoryReaction.storyReactionPublicRepost(Cons_storyReactionPublicRepost(peerId: _1!, story: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum StoryView: TypeConstructorDescription { + public class Cons_storyView: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyView", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.date)), ("reaction", ConstructorParameterDescription(self.reaction))]) + } + } + public class Cons_storyViewPublicForward: TypeConstructorDescription { + public var flags: Int32 + public var message: Api.Message + public init(flags: Int32, message: Api.Message) { + self.flags = flags + self.message = message + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViewPublicForward", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_storyViewPublicRepost: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViewPublicRepost", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("story", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .storyView(let _data): + return ("storyView", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) + case .storyViewPublicForward(let _data): + return ("storyViewPublicForward", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message))]) + case .storyViewPublicRepost(let _data): + return ("storyViewPublicRepost", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("story", ConstructorParameterDescription(_data.story))]) + } + } + + public static func parse_storyView(_ reader: BufferReader) -> StoryView? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: Api.Reaction? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.StoryView.storyView(Cons_storyView(flags: _1!, userId: _2!, date: _3!, reaction: _4)) + } + else { + return nil + } + } + public static func parse_storyViewPublicForward(_ reader: BufferReader) -> StoryView? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Message? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Message + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.StoryView.storyViewPublicForward(Cons_storyViewPublicForward(flags: _1!, message: _2!)) + } + else { + return nil + } + } + public static func parse_storyViewPublicRepost(_ reader: BufferReader) -> StoryView? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Api.StoryItem? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StoryItem + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.StoryView.storyViewPublicRepost(Cons_storyViewPublicRepost(flags: _1!, peerId: _2!, story: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum StoryViews: TypeConstructorDescription { + public class Cons_storyViews: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViews", [("flags", ConstructorParameterDescription(self.flags)), ("viewsCount", ConstructorParameterDescription(self.viewsCount)), ("forwardsCount", ConstructorParameterDescription(self.forwardsCount)), ("reactions", ConstructorParameterDescription(self.reactions)), ("reactionsCount", ConstructorParameterDescription(self.reactionsCount)), ("recentViewers", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { + switch self { + case .storyViews(let _data): + return ("storyViews", [("flags", ConstructorParameterDescription(_data.flags)), ("viewsCount", ConstructorParameterDescription(_data.viewsCount)), ("forwardsCount", ConstructorParameterDescription(_data.forwardsCount)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("reactionsCount", ConstructorParameterDescription(_data.reactionsCount)), ("recentViewers", ConstructorParameterDescription(_data.recentViewers))]) + } + } + + 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 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt32() + } + var _4: [Api.ReactionCount]? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) + } + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } + var _6: [Int64]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_suggestedPost: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("suggestedPost", [("flags", ConstructorParameterDescription(self.flags)), ("price", ConstructorParameterDescription(self.price)), ("scheduleDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .suggestedPost(let _data): + return ("suggestedPost", [("flags", ConstructorParameterDescription(_data.flags)), ("price", ConstructorParameterDescription(_data.price)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate))]) + } + } + + public static func parse_suggestedPost(_ reader: BufferReader) -> SuggestedPost? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StarsAmount? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.SuggestedPost.suggestedPost(Cons_suggestedPost(flags: _1!, price: _2, scheduleDate: _3)) + } + else { + return nil + } + } + } +} +public extension Api { + enum TextWithEntities: TypeConstructorDescription { + public class Cons_textWithEntities: TypeConstructorDescription { + public var text: String + public var entities: [Api.MessageEntity] + public init(text: String, entities: [Api.MessageEntity]) { + self.text = text + self.entities = entities + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textWithEntities", [("text", ConstructorParameterDescription(self.text)), ("entities", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .textWithEntities(let _data): + return ("textWithEntities", [("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities))]) + } + } + + public static func parse_textWithEntities(_ reader: BufferReader) -> TextWithEntities? { + var _1: String? + _1 = parseString(reader) + var _2: [Api.MessageEntity]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.TextWithEntities.textWithEntities(Cons_textWithEntities(text: _1!, entities: _2!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api29.swift b/submodules/TelegramApi/Sources/Api29.swift index 6943418b04..8325a5c29c 100644 --- a/submodules/TelegramApi/Sources/Api29.swift +++ b/submodules/TelegramApi/Sources/Api29.swift @@ -1,290 +1,58 @@ public extension Api { - indirect enum Updates: TypeConstructorDescription { - public class Cons_updateShort: TypeConstructorDescription { - public var update: Api.Update - public var date: Int32 - public init(update: Api.Update, date: Int32) { - self.update = update - self.date = date - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateShort", [("update", ConstructorParameterDescription(self.update)), ("date", ConstructorParameterDescription(self.date))]) - } - } - public class Cons_updateShortChatMessage: TypeConstructorDescription { + enum Theme: TypeConstructorDescription { + public class Cons_theme: TypeConstructorDescription { 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?) { + 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.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 + self.accessHash = accessHash + self.slug = slug + self.title = title + self.document = document + self.settings = settings + self.emoticon = emoticon + self.installsCount = installsCount } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateShortChatMessage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("fromId", ConstructorParameterDescription(self.fromId)), ("chatId", ConstructorParameterDescription(self.chatId)), ("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("viaBotId", ConstructorParameterDescription(self.viaBotId)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("entities", ConstructorParameterDescription(self.entities)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) + return ("theme", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("slug", ConstructorParameterDescription(self.slug)), ("title", ConstructorParameterDescription(self.title)), ("document", ConstructorParameterDescription(self.document)), ("settings", ConstructorParameterDescription(self.settings)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("installsCount", ConstructorParameterDescription(self.installsCount))]) } } - public class Cons_updateShortMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateShortMessage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("userId", ConstructorParameterDescription(self.userId)), ("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("viaBotId", ConstructorParameterDescription(self.viaBotId)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("entities", ConstructorParameterDescription(self.entities)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) - } - } - public class Cons_updateShortSentMessage: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updateShortSentMessage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date)), ("media", ConstructorParameterDescription(self.media)), ("entities", ConstructorParameterDescription(self.entities)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) - } - } - public class Cons_updates: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updates", [("updates", ConstructorParameterDescription(self.updates)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats)), ("date", ConstructorParameterDescription(self.date)), ("seq", ConstructorParameterDescription(self.seq))]) - } - } - public class Cons_updatesCombined: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("updatesCombined", [("updates", ConstructorParameterDescription(self.updates)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats)), ("date", ConstructorParameterDescription(self.date)), ("seqStart", ConstructorParameterDescription(self.seqStart)), ("seq", ConstructorParameterDescription(self.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 + case theme(Cons_theme) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .updateShort(let _data): + case .theme(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) + buffer.appendInt32(-1609668650) } 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) + 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.fwdFrom!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 11) != 0 { - serializeInt64(_data.viaBotId!, buffer: buffer, boxed: false) + _data.document!.serialize(buffer, true) } 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(_data.entities!.count)) - for item in _data.entities! { + buffer.appendInt32(Int32(_data.settings!.count)) + for item in _data.settings! { item.serialize(buffer, true) } } - if Int(_data.flags) & Int(1 << 25) != 0 { - serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.emoticon!, 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(_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(_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 .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) + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.installsCount!, buffer: buffer, boxed: false) } break } @@ -292,142 +60,4623 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .updateShort(let _data): - return ("updateShort", [("update", ConstructorParameterDescription(_data.update)), ("date", ConstructorParameterDescription(_data.date))]) - case .updateShortChatMessage(let _data): - return ("updateShortChatMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("viaBotId", ConstructorParameterDescription(_data.viaBotId)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("entities", ConstructorParameterDescription(_data.entities)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) - case .updateShortMessage(let _data): - return ("updateShortMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("userId", ConstructorParameterDescription(_data.userId)), ("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("viaBotId", ConstructorParameterDescription(_data.viaBotId)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("entities", ConstructorParameterDescription(_data.entities)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) - case .updateShortSentMessage(let _data): - return ("updateShortSentMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date)), ("media", ConstructorParameterDescription(_data.media)), ("entities", ConstructorParameterDescription(_data.entities)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) - case .updates(let _data): - return ("updates", [("updates", ConstructorParameterDescription(_data.updates)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats)), ("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq))]) - case .updatesCombined(let _data): - return ("updatesCombined", [("updates", ConstructorParameterDescription(_data.updates)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats)), ("date", ConstructorParameterDescription(_data.date)), ("seqStart", ConstructorParameterDescription(_data.seqStart)), ("seq", ConstructorParameterDescription(_data.seq))]) - case .updatesTooLong: - return ("updatesTooLong", []) + case .theme(let _data): + return ("theme", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("slug", ConstructorParameterDescription(_data.slug)), ("title", ConstructorParameterDescription(_data.title)), ("document", ConstructorParameterDescription(_data.document)), ("settings", ConstructorParameterDescription(_data.settings)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("installsCount", ConstructorParameterDescription(_data.installsCount))]) } } - public static func parse_updateShort(_ reader: BufferReader) -> Updates? { - var _1: Api.Update? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Update - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.Updates.updateShort(Cons_updateShort(update: _1!, date: _2!)) - } - else { - return nil - } - } - public static func parse_updateShortChatMessage(_ reader: BufferReader) -> Updates? { + public static func parse_theme(_ reader: BufferReader) -> Theme? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int64? - _4 = reader.readInt64() - var _5: String? - _5 = parseString(reader) - var _6: Int32? - _6 = reader.readInt32() - var _7: Int32? - _7 = reader.readInt32() - var _8: Int32? - _8 = reader.readInt32() - var _9: Api.MessageFwdHeader? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader - } - } - var _10: Int64? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _10 = reader.readInt64() - } - var _11: Api.MessageReplyHeader? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { - if let _ = reader.readInt32() { - _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - } - var _13: Int32? - if Int(_1 ?? 0) & Int(1 << 25) != 0 { - _13 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _13 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { - 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 - } - } - public static func parse_updateShortMessage(_ reader: BufferReader) -> Updates? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() var _3: Int64? _3 = reader.readInt64() var _4: String? _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - var _7: Int32? - _7 = reader.readInt32() - var _8: Api.MessageFwdHeader? + var _5: String? + _5 = parseString(reader) + var _6: Api.Document? if Int(_1 ?? 0) & Int(1 << 2) != 0 { if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader + _6 = Api.parse(reader, signature: signature) as? Api.Document } } - var _9: Int64? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _9 = reader.readInt64() - } - var _10: Api.MessageReplyHeader? + var _7: [Api.ThemeSettings]? if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { if let _ = reader.readInt32() { - _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ThemeSettings.self) } } - var _12: Int32? - if Int(_1 ?? 0) & Int(1 << 25) != 0 { - _12 = reader.readInt32() + var _8: String? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _8 = parseString(reader) + } + var _9: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _9 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 { + public class Cons_themeSettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("themeSettings", [("flags", ConstructorParameterDescription(self.flags)), ("baseTheme", ConstructorParameterDescription(self.baseTheme)), ("accentColor", ConstructorParameterDescription(self.accentColor)), ("outboxAccentColor", ConstructorParameterDescription(self.outboxAccentColor)), ("messageColors", ConstructorParameterDescription(self.messageColors)), ("wallpaper", ConstructorParameterDescription(self.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(_data.flags) & Int(1 << 1) != 0 { + _data.wallpaper!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .themeSettings(let _data): + return ("themeSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("baseTheme", ConstructorParameterDescription(_data.baseTheme)), ("accentColor", ConstructorParameterDescription(_data.accentColor)), ("outboxAccentColor", ConstructorParameterDescription(_data.outboxAccentColor)), ("messageColors", ConstructorParameterDescription(_data.messageColors)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) + } + } + + public static func parse_themeSettings(_ reader: BufferReader) -> ThemeSettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.BaseTheme? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.BaseTheme + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _4 = reader.readInt32() + } + var _5: [Int32]? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } + var _6: Api.WallPaper? + if Int(_1 ?? 0) & 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 + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_timezone: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("timezone", [("id", ConstructorParameterDescription(self.id)), ("name", ConstructorParameterDescription(self.name)), ("utcOffset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .timezone(let _data): + return ("timezone", [("id", ConstructorParameterDescription(_data.id)), ("name", ConstructorParameterDescription(_data.name)), ("utcOffset", ConstructorParameterDescription(_data.utcOffset))]) + } + } + + public static func parse_timezone(_ reader: BufferReader) -> Timezone? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Timezone.timezone(Cons_timezone(id: _1!, name: _2!, utcOffset: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum TodoCompletion: TypeConstructorDescription { + public class Cons_todoCompletion: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("todoCompletion", [("id", ConstructorParameterDescription(self.id)), ("completedBy", ConstructorParameterDescription(self.completedBy)), ("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .todoCompletion(let _data): + return ("todoCompletion", [("id", ConstructorParameterDescription(_data.id)), ("completedBy", ConstructorParameterDescription(_data.completedBy)), ("date", ConstructorParameterDescription(_data.date))]) + } + } + + public static func parse_todoCompletion(_ reader: BufferReader) -> TodoCompletion? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + 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 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.TodoCompletion.todoCompletion(Cons_todoCompletion(id: _1!, completedBy: _2!, date: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum TodoItem: TypeConstructorDescription { + public class Cons_todoItem: TypeConstructorDescription { + public var id: Int32 + public var title: Api.TextWithEntities + public init(id: Int32, title: Api.TextWithEntities) { + self.id = id + self.title = title + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("todoItem", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .todoItem(let _data): + return ("todoItem", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title))]) + } + } + + public static func parse_todoItem(_ reader: BufferReader) -> TodoItem? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.TodoItem.todoItem(Cons_todoItem(id: _1!, title: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum TodoList: TypeConstructorDescription { + public class Cons_todoList: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("todoList", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("list", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .todoList(let _data): + return ("todoList", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("list", ConstructorParameterDescription(_data.list))]) + } + } + + public static func parse_todoList(_ reader: BufferReader) -> TodoList? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + var _3: [Api.TodoItem]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TodoItem.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.TodoList.todoList(Cons_todoList(flags: _1!, title: _2!, list: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum TopPeer: TypeConstructorDescription { + public class Cons_topPeer: TypeConstructorDescription { + public var peer: Api.Peer + public var rating: Double + public init(peer: Api.Peer, rating: Double) { + self.peer = peer + self.rating = rating + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("topPeer", [("peer", ConstructorParameterDescription(self.peer)), ("rating", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .topPeer(let _data): + return ("topPeer", [("peer", ConstructorParameterDescription(_data.peer)), ("rating", ConstructorParameterDescription(_data.rating))]) + } + } + + public static func parse_topPeer(_ reader: BufferReader) -> TopPeer? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Double? + _2 = reader.readDouble() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.TopPeer.topPeer(Cons_topPeer(peer: _1!, rating: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum TopPeerCategory: TypeConstructorDescription { + case topPeerCategoryBotsApp + case topPeerCategoryBotsGuestChat + case topPeerCategoryBotsInline + case topPeerCategoryBotsPM + case topPeerCategoryChannels + case topPeerCategoryCorrespondents + case topPeerCategoryForwardChats + 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 .topPeerCategoryBotsGuestChat: + if boxed { + buffer.appendInt32(1814361053) + } + 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, ConstructorParameterDescription)]) { + switch self { + case .topPeerCategoryBotsApp: + return ("topPeerCategoryBotsApp", []) + case .topPeerCategoryBotsGuestChat: + return ("topPeerCategoryBotsGuestChat", []) + case .topPeerCategoryBotsInline: + return ("topPeerCategoryBotsInline", []) + case .topPeerCategoryBotsPM: + return ("topPeerCategoryBotsPM", []) + case .topPeerCategoryChannels: + return ("topPeerCategoryChannels", []) + case .topPeerCategoryCorrespondents: + return ("topPeerCategoryCorrespondents", []) + case .topPeerCategoryForwardChats: + return ("topPeerCategoryForwardChats", []) + case .topPeerCategoryForwardUsers: + return ("topPeerCategoryForwardUsers", []) + case .topPeerCategoryGroups: + return ("topPeerCategoryGroups", []) + case .topPeerCategoryPhoneCalls: + return ("topPeerCategoryPhoneCalls", []) + } + } + + public static func parse_topPeerCategoryBotsApp(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryBotsApp + } + public static func parse_topPeerCategoryBotsGuestChat(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryBotsGuestChat + } + public static func parse_topPeerCategoryBotsInline(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryBotsInline + } + public static func parse_topPeerCategoryBotsPM(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryBotsPM + } + public static func parse_topPeerCategoryChannels(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryChannels + } + public static func parse_topPeerCategoryCorrespondents(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryCorrespondents + } + public static func parse_topPeerCategoryForwardChats(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryForwardChats + } + public static func parse_topPeerCategoryForwardUsers(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryForwardUsers + } + public static func parse_topPeerCategoryGroups(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryGroups + } + public static func parse_topPeerCategoryPhoneCalls(_ reader: BufferReader) -> TopPeerCategory? { + return Api.TopPeerCategory.topPeerCategoryPhoneCalls + } + } +} +public extension Api { + enum TopPeerCategoryPeers: TypeConstructorDescription { + public class Cons_topPeerCategoryPeers: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("topPeerCategoryPeers", [("category", ConstructorParameterDescription(self.category)), ("count", ConstructorParameterDescription(self.count)), ("peers", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .topPeerCategoryPeers(let _data): + return ("topPeerCategoryPeers", [("category", ConstructorParameterDescription(_data.category)), ("count", ConstructorParameterDescription(_data.count)), ("peers", ConstructorParameterDescription(_data.peers))]) + } + } + + public static func parse_topPeerCategoryPeers(_ reader: BufferReader) -> TopPeerCategoryPeers? { + var _1: Api.TopPeerCategory? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.TopPeerCategory + } + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.TopPeer]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TopPeer.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.TopPeerCategoryPeers.topPeerCategoryPeers(Cons_topPeerCategoryPeers(category: _1!, count: _2!, peers: _3!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum Update: TypeConstructorDescription { + public class Cons_updateBotBusinessConnect: TypeConstructorDescription { + public var connection: Api.BotBusinessConnection + public var qts: Int32 + public init(connection: Api.BotBusinessConnection, qts: Int32) { + self.connection = connection + self.qts = qts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotBusinessConnect", [("connection", ConstructorParameterDescription(self.connection)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotCallbackQuery: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotCallbackQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("chatInstance", ConstructorParameterDescription(self.chatInstance)), ("data", ConstructorParameterDescription(self.data)), ("gameShortName", ConstructorParameterDescription(self.gameShortName))]) + } + } + public class Cons_updateBotChatBoost: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotChatBoost", [("peer", ConstructorParameterDescription(self.peer)), ("boost", ConstructorParameterDescription(self.boost)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotChatInviteRequester: TypeConstructorDescription { + public var flags: Int32 + 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 var queryId: Int64? + public init(flags: Int32, peer: Api.Peer, date: Int32, userId: Int64, about: String, invite: Api.ExportedChatInvite, qts: Int32, queryId: Int64?) { + self.flags = flags + self.peer = peer + self.date = date + self.userId = userId + self.about = about + self.invite = invite + self.qts = qts + self.queryId = queryId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotChatInviteRequester", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date)), ("userId", ConstructorParameterDescription(self.userId)), ("about", ConstructorParameterDescription(self.about)), ("invite", ConstructorParameterDescription(self.invite)), ("qts", ConstructorParameterDescription(self.qts)), ("queryId", ConstructorParameterDescription(self.queryId))]) + } + } + public class Cons_updateBotCommands: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotCommands", [("peer", ConstructorParameterDescription(self.peer)), ("botId", ConstructorParameterDescription(self.botId)), ("commands", ConstructorParameterDescription(self.commands))]) + } + } + public class Cons_updateBotDeleteBusinessMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotDeleteBusinessMessage", [("connectionId", ConstructorParameterDescription(self.connectionId)), ("peer", ConstructorParameterDescription(self.peer)), ("messages", ConstructorParameterDescription(self.messages)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotEditBusinessMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotEditBusinessMessage", [("flags", ConstructorParameterDescription(self.flags)), ("connectionId", ConstructorParameterDescription(self.connectionId)), ("message", ConstructorParameterDescription(self.message)), ("replyToMessage", ConstructorParameterDescription(self.replyToMessage)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotGuestChatQuery: TypeConstructorDescription { + public var flags: Int32 + public var queryId: Int64 + public var message: Api.Message + public var referenceMessages: [Api.Message]? + public var qts: Int32 + public init(flags: Int32, queryId: Int64, message: Api.Message, referenceMessages: [Api.Message]?, qts: Int32) { + self.flags = flags + self.queryId = queryId + self.message = message + self.referenceMessages = referenceMessages + self.qts = qts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotGuestChatQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("message", ConstructorParameterDescription(self.message)), ("referenceMessages", ConstructorParameterDescription(self.referenceMessages)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotInlineQuery: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotInlineQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("query", ConstructorParameterDescription(self.query)), ("geo", ConstructorParameterDescription(self.geo)), ("peerType", ConstructorParameterDescription(self.peerType)), ("offset", ConstructorParameterDescription(self.offset))]) + } + } + public class Cons_updateBotInlineSend: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotInlineSend", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("query", ConstructorParameterDescription(self.query)), ("geo", ConstructorParameterDescription(self.geo)), ("id", ConstructorParameterDescription(self.id)), ("msgId", ConstructorParameterDescription(self.msgId))]) + } + } + public class Cons_updateBotMenuButton: TypeConstructorDescription { + public var botId: Int64 + public var button: Api.BotMenuButton + public init(botId: Int64, button: Api.BotMenuButton) { + self.botId = botId + self.button = button + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotMenuButton", [("botId", ConstructorParameterDescription(self.botId)), ("button", ConstructorParameterDescription(self.button))]) + } + } + public class Cons_updateBotMessageReaction: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotMessageReaction", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("date", ConstructorParameterDescription(self.date)), ("actor", ConstructorParameterDescription(self.actor)), ("oldReactions", ConstructorParameterDescription(self.oldReactions)), ("newReactions", ConstructorParameterDescription(self.newReactions)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotMessageReactions: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotMessageReactions", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("date", ConstructorParameterDescription(self.date)), ("reactions", ConstructorParameterDescription(self.reactions)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotNewBusinessMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotNewBusinessMessage", [("flags", ConstructorParameterDescription(self.flags)), ("connectionId", ConstructorParameterDescription(self.connectionId)), ("message", ConstructorParameterDescription(self.message)), ("replyToMessage", ConstructorParameterDescription(self.replyToMessage)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotPrecheckoutQuery: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotPrecheckoutQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("payload", ConstructorParameterDescription(self.payload)), ("info", ConstructorParameterDescription(self.info)), ("shippingOptionId", ConstructorParameterDescription(self.shippingOptionId)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount))]) + } + } + public class Cons_updateBotPurchasedPaidMedia: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotPurchasedPaidMedia", [("userId", ConstructorParameterDescription(self.userId)), ("payload", ConstructorParameterDescription(self.payload)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotShippingQuery: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotShippingQuery", [("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("payload", ConstructorParameterDescription(self.payload)), ("shippingAddress", ConstructorParameterDescription(self.shippingAddress))]) + } + } + public class Cons_updateBotStopped: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotStopped", [("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.date)), ("stopped", ConstructorParameterDescription(self.stopped)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateBotWebhookJSON: TypeConstructorDescription { + public var data: Api.DataJSON + public init(data: Api.DataJSON) { + self.data = data + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotWebhookJSON", [("data", ConstructorParameterDescription(self.data))]) + } + } + public class Cons_updateBotWebhookJSONQuery: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotWebhookJSONQuery", [("queryId", ConstructorParameterDescription(self.queryId)), ("data", ConstructorParameterDescription(self.data)), ("timeout", ConstructorParameterDescription(self.timeout))]) + } + } + public class Cons_updateBusinessBotCallbackQuery: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBusinessBotCallbackQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("connectionId", ConstructorParameterDescription(self.connectionId)), ("message", ConstructorParameterDescription(self.message)), ("replyToMessage", ConstructorParameterDescription(self.replyToMessage)), ("chatInstance", ConstructorParameterDescription(self.chatInstance)), ("data", ConstructorParameterDescription(self.data))]) + } + } + public class Cons_updateChannel: TypeConstructorDescription { + public var channelId: Int64 + public init(channelId: Int64) { + self.channelId = channelId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannel", [("channelId", ConstructorParameterDescription(self.channelId))]) + } + } + public class Cons_updateChannelAvailableMessages: TypeConstructorDescription { + public var channelId: Int64 + public var availableMinId: Int32 + public init(channelId: Int64, availableMinId: Int32) { + self.channelId = channelId + self.availableMinId = availableMinId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelAvailableMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("availableMinId", ConstructorParameterDescription(self.availableMinId))]) + } + } + public class Cons_updateChannelMessageForwards: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelMessageForwards", [("channelId", ConstructorParameterDescription(self.channelId)), ("id", ConstructorParameterDescription(self.id)), ("forwards", ConstructorParameterDescription(self.forwards))]) + } + } + public class Cons_updateChannelMessageViews: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelMessageViews", [("channelId", ConstructorParameterDescription(self.channelId)), ("id", ConstructorParameterDescription(self.id)), ("views", ConstructorParameterDescription(self.views))]) + } + } + public class Cons_updateChannelParticipant: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelParticipant", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("date", ConstructorParameterDescription(self.date)), ("actorId", ConstructorParameterDescription(self.actorId)), ("userId", ConstructorParameterDescription(self.userId)), ("prevParticipant", ConstructorParameterDescription(self.prevParticipant)), ("newParticipant", ConstructorParameterDescription(self.newParticipant)), ("invite", ConstructorParameterDescription(self.invite)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateChannelReadMessagesContents: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelReadMessagesContents", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("messages", ConstructorParameterDescription(self.messages))]) + } + } + public class Cons_updateChannelTooLong: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelTooLong", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("pts", ConstructorParameterDescription(self.pts))]) + } + } + public class Cons_updateChannelUserTyping: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelUserTyping", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("fromId", ConstructorParameterDescription(self.fromId)), ("action", ConstructorParameterDescription(self.action))]) + } + } + public class Cons_updateChannelViewForumAsMessages: TypeConstructorDescription { + public var channelId: Int64 + public var enabled: Api.Bool + public init(channelId: Int64, enabled: Api.Bool) { + self.channelId = channelId + self.enabled = enabled + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelViewForumAsMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("enabled", ConstructorParameterDescription(self.enabled))]) + } + } + public class Cons_updateChannelWebPage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelWebPage", [("channelId", ConstructorParameterDescription(self.channelId)), ("webpage", ConstructorParameterDescription(self.webpage)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateChat: TypeConstructorDescription { + public var chatId: Int64 + public init(chatId: Int64) { + self.chatId = chatId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChat", [("chatId", ConstructorParameterDescription(self.chatId))]) + } + } + public class Cons_updateChatDefaultBannedRights: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatDefaultBannedRights", [("peer", ConstructorParameterDescription(self.peer)), ("defaultBannedRights", ConstructorParameterDescription(self.defaultBannedRights)), ("version", ConstructorParameterDescription(self.version))]) + } + } + public class Cons_updateChatParticipant: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatParticipant", [("flags", ConstructorParameterDescription(self.flags)), ("chatId", ConstructorParameterDescription(self.chatId)), ("date", ConstructorParameterDescription(self.date)), ("actorId", ConstructorParameterDescription(self.actorId)), ("userId", ConstructorParameterDescription(self.userId)), ("prevParticipant", ConstructorParameterDescription(self.prevParticipant)), ("newParticipant", ConstructorParameterDescription(self.newParticipant)), ("invite", ConstructorParameterDescription(self.invite)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateChatParticipantAdd: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatParticipantAdd", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("inviterId", ConstructorParameterDescription(self.inviterId)), ("date", ConstructorParameterDescription(self.date)), ("version", ConstructorParameterDescription(self.version))]) + } + } + public class Cons_updateChatParticipantAdmin: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatParticipantAdmin", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("isAdmin", ConstructorParameterDescription(self.isAdmin)), ("version", ConstructorParameterDescription(self.version))]) + } + } + public class Cons_updateChatParticipantDelete: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatParticipantDelete", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("version", ConstructorParameterDescription(self.version))]) + } + } + public class Cons_updateChatParticipantRank: TypeConstructorDescription { + public var chatId: Int64 + public var userId: Int64 + public var rank: String + public var version: Int32 + public init(chatId: Int64, userId: Int64, rank: String, version: Int32) { + self.chatId = chatId + self.userId = userId + self.rank = rank + self.version = version + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatParticipantRank", [("chatId", ConstructorParameterDescription(self.chatId)), ("userId", ConstructorParameterDescription(self.userId)), ("rank", ConstructorParameterDescription(self.rank)), ("version", ConstructorParameterDescription(self.version))]) + } + } + public class Cons_updateChatParticipants: TypeConstructorDescription { + public var participants: Api.ChatParticipants + public init(participants: Api.ChatParticipants) { + self.participants = participants + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatParticipants", [("participants", ConstructorParameterDescription(self.participants))]) + } + } + public class Cons_updateChatUserTyping: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatUserTyping", [("chatId", ConstructorParameterDescription(self.chatId)), ("fromId", ConstructorParameterDescription(self.fromId)), ("action", ConstructorParameterDescription(self.action))]) + } + } + public class Cons_updateDcOptions: TypeConstructorDescription { + public var dcOptions: [Api.DcOption] + public init(dcOptions: [Api.DcOption]) { + self.dcOptions = dcOptions + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDcOptions", [("dcOptions", ConstructorParameterDescription(self.dcOptions))]) + } + } + public class Cons_updateDeleteChannelMessages: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteChannelMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateDeleteGroupCallMessages: TypeConstructorDescription { + public var call: Api.InputGroupCall + public var messages: [Int32] + public init(call: Api.InputGroupCall, messages: [Int32]) { + self.call = call + self.messages = messages + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteGroupCallMessages", [("call", ConstructorParameterDescription(self.call)), ("messages", ConstructorParameterDescription(self.messages))]) + } + } + public class Cons_updateDeleteMessages: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteMessages", [("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateDeleteQuickReply: TypeConstructorDescription { + public var shortcutId: Int32 + public init(shortcutId: Int32) { + self.shortcutId = shortcutId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteQuickReply", [("shortcutId", ConstructorParameterDescription(self.shortcutId))]) + } + } + public class Cons_updateDeleteQuickReplyMessages: TypeConstructorDescription { + public var shortcutId: Int32 + public var messages: [Int32] + public init(shortcutId: Int32, messages: [Int32]) { + self.shortcutId = shortcutId + self.messages = messages + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteQuickReplyMessages", [("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("messages", ConstructorParameterDescription(self.messages))]) + } + } + public class Cons_updateDeleteScheduledMessages: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteScheduledMessages", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("messages", ConstructorParameterDescription(self.messages)), ("sentMessages", ConstructorParameterDescription(self.sentMessages))]) + } + } + public class Cons_updateDialogFilter: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDialogFilter", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("filter", ConstructorParameterDescription(self.filter))]) + } + } + public class Cons_updateDialogFilterOrder: TypeConstructorDescription { + public var order: [Int32] + public init(order: [Int32]) { + self.order = order + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDialogFilterOrder", [("order", ConstructorParameterDescription(self.order))]) + } + } + public class Cons_updateDialogPinned: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDialogPinned", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("peer", ConstructorParameterDescription(self.peer))]) + } + } + public class Cons_updateDialogUnreadMark: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDialogUnreadMark", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId))]) + } + } + public class Cons_updateDraftMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDraftMessage", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("draft", ConstructorParameterDescription(self.draft))]) + } + } + public class Cons_updateEditChannelMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEditChannelMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateEditMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEditMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateEmojiGameInfo: TypeConstructorDescription { + public var info: Api.messages.EmojiGameInfo + public init(info: Api.messages.EmojiGameInfo) { + self.info = info + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEmojiGameInfo", [("info", ConstructorParameterDescription(self.info))]) + } + } + public class Cons_updateEncryptedChatTyping: TypeConstructorDescription { + public var chatId: Int32 + public init(chatId: Int32) { + self.chatId = chatId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEncryptedChatTyping", [("chatId", ConstructorParameterDescription(self.chatId))]) + } + } + public class Cons_updateEncryptedMessagesRead: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEncryptedMessagesRead", [("chatId", ConstructorParameterDescription(self.chatId)), ("maxDate", ConstructorParameterDescription(self.maxDate)), ("date", ConstructorParameterDescription(self.date))]) + } + } + public class Cons_updateEncryption: TypeConstructorDescription { + public var chat: Api.EncryptedChat + public var date: Int32 + public init(chat: Api.EncryptedChat, date: Int32) { + self.chat = chat + self.date = date + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEncryption", [("chat", ConstructorParameterDescription(self.chat)), ("date", ConstructorParameterDescription(self.date))]) + } + } + public class Cons_updateFolderPeers: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateFolderPeers", [("folderPeers", ConstructorParameterDescription(self.folderPeers)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateGeoLiveViewed: TypeConstructorDescription { + public var peer: Api.Peer + public var msgId: Int32 + public init(peer: Api.Peer, msgId: Int32) { + self.peer = peer + self.msgId = msgId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGeoLiveViewed", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId))]) + } + } + public class Cons_updateGroupCall: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCall", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("call", ConstructorParameterDescription(self.call))]) + } + } + public class Cons_updateGroupCallChainBlocks: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCallChainBlocks", [("call", ConstructorParameterDescription(self.call)), ("subChainId", ConstructorParameterDescription(self.subChainId)), ("blocks", ConstructorParameterDescription(self.blocks)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) + } + } + public class Cons_updateGroupCallConnection: TypeConstructorDescription { + public var flags: Int32 + public var params: Api.DataJSON + public init(flags: Int32, params: Api.DataJSON) { + self.flags = flags + self.params = params + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCallConnection", [("flags", ConstructorParameterDescription(self.flags)), ("params", ConstructorParameterDescription(self.params))]) + } + } + public class Cons_updateGroupCallEncryptedMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCallEncryptedMessage", [("call", ConstructorParameterDescription(self.call)), ("fromId", ConstructorParameterDescription(self.fromId)), ("encryptedMessage", ConstructorParameterDescription(self.encryptedMessage))]) + } + } + public class Cons_updateGroupCallMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCallMessage", [("call", ConstructorParameterDescription(self.call)), ("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_updateGroupCallParticipants: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCallParticipants", [("call", ConstructorParameterDescription(self.call)), ("participants", ConstructorParameterDescription(self.participants)), ("version", ConstructorParameterDescription(self.version))]) + } + } + public class Cons_updateInlineBotCallbackQuery: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateInlineBotCallbackQuery", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("userId", ConstructorParameterDescription(self.userId)), ("msgId", ConstructorParameterDescription(self.msgId)), ("chatInstance", ConstructorParameterDescription(self.chatInstance)), ("data", ConstructorParameterDescription(self.data)), ("gameShortName", ConstructorParameterDescription(self.gameShortName))]) + } + } + public class Cons_updateJoinChatWebViewDecision: TypeConstructorDescription { + public var peer: Api.Peer + public var queryId: Int64 + public var result: Api.JoinChatBotResult + public init(peer: Api.Peer, queryId: Int64, result: Api.JoinChatBotResult) { + self.peer = peer + self.queryId = queryId + self.result = result + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateJoinChatWebViewDecision", [("peer", ConstructorParameterDescription(self.peer)), ("queryId", ConstructorParameterDescription(self.queryId)), ("result", ConstructorParameterDescription(self.result))]) + } + } + public class Cons_updateLangPack: TypeConstructorDescription { + public var difference: Api.LangPackDifference + public init(difference: Api.LangPackDifference) { + self.difference = difference + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateLangPack", [("difference", ConstructorParameterDescription(self.difference))]) + } + } + public class Cons_updateLangPackTooLong: TypeConstructorDescription { + public var langCode: String + public init(langCode: String) { + self.langCode = langCode + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateLangPackTooLong", [("langCode", ConstructorParameterDescription(self.langCode))]) + } + } + public class Cons_updateManagedBot: TypeConstructorDescription { + public var userId: Int64 + public var botId: Int64 + public var qts: Int32 + public init(userId: Int64, botId: Int64, qts: Int32) { + self.userId = userId + self.botId = botId + self.qts = qts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateManagedBot", [("userId", ConstructorParameterDescription(self.userId)), ("botId", ConstructorParameterDescription(self.botId)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateMessageExtendedMedia: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMessageExtendedMedia", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) + } + } + public class Cons_updateMessageID: TypeConstructorDescription { + public var id: Int32 + public var randomId: Int64 + public init(id: Int32, randomId: Int64) { + self.id = id + self.randomId = randomId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMessageID", [("id", ConstructorParameterDescription(self.id)), ("randomId", ConstructorParameterDescription(self.randomId))]) + } + } + public class Cons_updateMessagePoll: TypeConstructorDescription { + public var flags: Int32 + public var peer: Api.Peer? + public var msgId: Int32? + public var topMsgId: Int32? + public var pollId: Int64 + public var poll: Api.Poll? + public var results: Api.PollResults + public init(flags: Int32, peer: Api.Peer?, msgId: Int32?, topMsgId: Int32?, pollId: Int64, poll: Api.Poll?, results: Api.PollResults) { + self.flags = flags + self.peer = peer + self.msgId = msgId + self.topMsgId = topMsgId + self.pollId = pollId + self.poll = poll + self.results = results + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMessagePoll", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("pollId", ConstructorParameterDescription(self.pollId)), ("poll", ConstructorParameterDescription(self.poll)), ("results", ConstructorParameterDescription(self.results))]) + } + } + public class Cons_updateMessagePollVote: TypeConstructorDescription { + public var pollId: Int64 + public var peer: Api.Peer + public var options: [Buffer] + public var positions: [Int32] + public var qts: Int32 + public init(pollId: Int64, peer: Api.Peer, options: [Buffer], positions: [Int32], qts: Int32) { + self.pollId = pollId + self.peer = peer + self.options = options + self.positions = positions + self.qts = qts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMessagePollVote", [("pollId", ConstructorParameterDescription(self.pollId)), ("peer", ConstructorParameterDescription(self.peer)), ("options", ConstructorParameterDescription(self.options)), ("positions", ConstructorParameterDescription(self.positions)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateMessageReactions: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMessageReactions", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("reactions", ConstructorParameterDescription(self.reactions))]) + } + } + public class Cons_updateMonoForumNoPaidException: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMonoForumNoPaidException", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId))]) + } + } + public class Cons_updateMoveStickerSetToTop: TypeConstructorDescription { + public var flags: Int32 + public var stickerset: Int64 + public init(flags: Int32, stickerset: Int64) { + self.flags = flags + self.stickerset = stickerset + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMoveStickerSetToTop", [("flags", ConstructorParameterDescription(self.flags)), ("stickerset", ConstructorParameterDescription(self.stickerset))]) + } + } + public class Cons_updateNewAuthorization: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewAuthorization", [("flags", ConstructorParameterDescription(self.flags)), ("hash", ConstructorParameterDescription(self.hash)), ("date", ConstructorParameterDescription(self.date)), ("device", ConstructorParameterDescription(self.device)), ("location", ConstructorParameterDescription(self.location))]) + } + } + public class Cons_updateNewBotConnection: TypeConstructorDescription { + public var flags: Int32 + public var botId: Int64 + public var date: Int32? + public var device: String? + public var location: String? + public init(flags: Int32, botId: Int64, date: Int32?, device: String?, location: String?) { + self.flags = flags + self.botId = botId + self.date = date + self.device = device + self.location = location + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewBotConnection", [("flags", ConstructorParameterDescription(self.flags)), ("botId", ConstructorParameterDescription(self.botId)), ("date", ConstructorParameterDescription(self.date)), ("device", ConstructorParameterDescription(self.device)), ("location", ConstructorParameterDescription(self.location))]) + } + } + public class Cons_updateNewChannelMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewChannelMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateNewEncryptedMessage: TypeConstructorDescription { + public var message: Api.EncryptedMessage + public var qts: Int32 + public init(message: Api.EncryptedMessage, qts: Int32) { + self.message = message + self.qts = qts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewEncryptedMessage", [("message", ConstructorParameterDescription(self.message)), ("qts", ConstructorParameterDescription(self.qts))]) + } + } + public class Cons_updateNewMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewMessage", [("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateNewQuickReply: TypeConstructorDescription { + public var quickReply: Api.QuickReply + public init(quickReply: Api.QuickReply) { + self.quickReply = quickReply + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewQuickReply", [("quickReply", ConstructorParameterDescription(self.quickReply))]) + } + } + public class Cons_updateNewScheduledMessage: TypeConstructorDescription { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewScheduledMessage", [("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_updateNewStickerSet: TypeConstructorDescription { + public var stickerset: Api.messages.StickerSet + public init(stickerset: Api.messages.StickerSet) { + self.stickerset = stickerset + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewStickerSet", [("stickerset", ConstructorParameterDescription(self.stickerset))]) + } + } + public class Cons_updateNewStoryReaction: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewStoryReaction", [("storyId", ConstructorParameterDescription(self.storyId)), ("peer", ConstructorParameterDescription(self.peer)), ("reaction", ConstructorParameterDescription(self.reaction))]) + } + } + public class Cons_updateNotifySettings: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNotifySettings", [("peer", ConstructorParameterDescription(self.peer)), ("notifySettings", ConstructorParameterDescription(self.notifySettings))]) + } + } + public class Cons_updatePaidReactionPrivacy: TypeConstructorDescription { + public var `private`: Api.PaidReactionPrivacy + public init(`private`: Api.PaidReactionPrivacy) { + self.`private` = `private` + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePaidReactionPrivacy", [("`private`", ConstructorParameterDescription(self.`private`))]) + } + } + public class Cons_updatePeerBlocked: TypeConstructorDescription { + public var flags: Int32 + public var peerId: Api.Peer + public init(flags: Int32, peerId: Api.Peer) { + self.flags = flags + self.peerId = peerId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerBlocked", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId))]) + } + } + public class Cons_updatePeerHistoryTTL: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerHistoryTTL", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) + } + } + public class Cons_updatePeerLocated: TypeConstructorDescription { + public var peers: [Api.PeerLocated] + public init(peers: [Api.PeerLocated]) { + self.peers = peers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerLocated", [("peers", ConstructorParameterDescription(self.peers))]) + } + } + public class Cons_updatePeerSettings: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerSettings", [("peer", ConstructorParameterDescription(self.peer)), ("settings", ConstructorParameterDescription(self.settings))]) + } + } + public class Cons_updatePeerWallpaper: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerWallpaper", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("wallpaper", ConstructorParameterDescription(self.wallpaper))]) + } + } + public class Cons_updatePendingJoinRequests: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePendingJoinRequests", [("peer", ConstructorParameterDescription(self.peer)), ("requestsPending", ConstructorParameterDescription(self.requestsPending)), ("recentRequesters", ConstructorParameterDescription(self.recentRequesters))]) + } + } + public class Cons_updatePhoneCall: TypeConstructorDescription { + public var phoneCall: Api.PhoneCall + public init(phoneCall: Api.PhoneCall) { + self.phoneCall = phoneCall + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePhoneCall", [("phoneCall", ConstructorParameterDescription(self.phoneCall))]) + } + } + public class Cons_updatePhoneCallSignalingData: TypeConstructorDescription { + public var phoneCallId: Int64 + public var data: Buffer + public init(phoneCallId: Int64, data: Buffer) { + self.phoneCallId = phoneCallId + self.data = data + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePhoneCallSignalingData", [("phoneCallId", ConstructorParameterDescription(self.phoneCallId)), ("data", ConstructorParameterDescription(self.data))]) + } + } + public class Cons_updatePinnedChannelMessages: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePinnedChannelMessages", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updatePinnedDialogs: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePinnedDialogs", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("order", ConstructorParameterDescription(self.order))]) + } + } + public class Cons_updatePinnedForumTopic: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePinnedForumTopic", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topicId", ConstructorParameterDescription(self.topicId))]) + } + } + public class Cons_updatePinnedForumTopics: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePinnedForumTopics", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("order", ConstructorParameterDescription(self.order))]) + } + } + public class Cons_updatePinnedMessages: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePinnedMessages", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updatePinnedSavedDialogs: TypeConstructorDescription { + public var flags: Int32 + public var order: [Api.DialogPeer]? + public init(flags: Int32, order: [Api.DialogPeer]?) { + self.flags = flags + self.order = order + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePinnedSavedDialogs", [("flags", ConstructorParameterDescription(self.flags)), ("order", ConstructorParameterDescription(self.order))]) + } + } + public class Cons_updatePrivacy: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePrivacy", [("key", ConstructorParameterDescription(self.key)), ("rules", ConstructorParameterDescription(self.rules))]) + } + } + public class Cons_updateQuickReplies: TypeConstructorDescription { + public var quickReplies: [Api.QuickReply] + public init(quickReplies: [Api.QuickReply]) { + self.quickReplies = quickReplies + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateQuickReplies", [("quickReplies", ConstructorParameterDescription(self.quickReplies))]) + } + } + public class Cons_updateQuickReplyMessage: TypeConstructorDescription { + public var message: Api.Message + public init(message: Api.Message) { + self.message = message + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateQuickReplyMessage", [("message", ConstructorParameterDescription(self.message))]) + } + } + public class Cons_updateReadChannelDiscussionInbox: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadChannelDiscussionInbox", [("flags", ConstructorParameterDescription(self.flags)), ("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId)), ("broadcastId", ConstructorParameterDescription(self.broadcastId)), ("broadcastPost", ConstructorParameterDescription(self.broadcastPost))]) + } + } + public class Cons_updateReadChannelDiscussionOutbox: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadChannelDiscussionOutbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId))]) + } + } + public class Cons_updateReadChannelInbox: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadChannelInbox", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("channelId", ConstructorParameterDescription(self.channelId)), ("maxId", ConstructorParameterDescription(self.maxId)), ("stillUnreadCount", ConstructorParameterDescription(self.stillUnreadCount)), ("pts", ConstructorParameterDescription(self.pts))]) + } + } + public class Cons_updateReadChannelOutbox: TypeConstructorDescription { + public var channelId: Int64 + public var maxId: Int32 + public init(channelId: Int64, maxId: Int32) { + self.channelId = channelId + self.maxId = maxId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadChannelOutbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("maxId", ConstructorParameterDescription(self.maxId))]) + } + } + public class Cons_updateReadHistoryInbox: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadHistoryInbox", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("maxId", ConstructorParameterDescription(self.maxId)), ("stillUnreadCount", ConstructorParameterDescription(self.stillUnreadCount)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateReadHistoryOutbox: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadHistoryOutbox", [("peer", ConstructorParameterDescription(self.peer)), ("maxId", ConstructorParameterDescription(self.maxId)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateReadMessagesContents: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadMessagesContents", [("flags", ConstructorParameterDescription(self.flags)), ("messages", ConstructorParameterDescription(self.messages)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date))]) + } + } + public class Cons_updateReadMonoForumInbox: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadMonoForumInbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId))]) + } + } + public class Cons_updateReadMonoForumOutbox: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadMonoForumOutbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("savedPeerId", ConstructorParameterDescription(self.savedPeerId)), ("readMaxId", ConstructorParameterDescription(self.readMaxId))]) + } + } + public class Cons_updateReadStories: TypeConstructorDescription { + public var peer: Api.Peer + public var maxId: Int32 + public init(peer: Api.Peer, maxId: Int32) { + self.peer = peer + self.maxId = maxId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadStories", [("peer", ConstructorParameterDescription(self.peer)), ("maxId", ConstructorParameterDescription(self.maxId))]) + } + } + public class Cons_updateSavedDialogPinned: TypeConstructorDescription { + public var flags: Int32 + public var peer: Api.DialogPeer + public init(flags: Int32, peer: Api.DialogPeer) { + self.flags = flags + self.peer = peer + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateSavedDialogPinned", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer))]) + } + } + public class Cons_updateSentPhoneCode: TypeConstructorDescription { + public var sentCode: Api.auth.SentCode + public init(sentCode: Api.auth.SentCode) { + self.sentCode = sentCode + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateSentPhoneCode", [("sentCode", ConstructorParameterDescription(self.sentCode))]) + } + } + public class Cons_updateSentStoryReaction: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateSentStoryReaction", [("peer", ConstructorParameterDescription(self.peer)), ("storyId", ConstructorParameterDescription(self.storyId)), ("reaction", ConstructorParameterDescription(self.reaction))]) + } + } + public class Cons_updateServiceNotification: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateServiceNotification", [("flags", ConstructorParameterDescription(self.flags)), ("inboxDate", ConstructorParameterDescription(self.inboxDate)), ("type", ConstructorParameterDescription(self.type)), ("message", ConstructorParameterDescription(self.message)), ("media", ConstructorParameterDescription(self.media)), ("entities", ConstructorParameterDescription(self.entities))]) + } + } + public class Cons_updateSmsJob: TypeConstructorDescription { + public var jobId: String + public init(jobId: String) { + self.jobId = jobId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateSmsJob", [("jobId", ConstructorParameterDescription(self.jobId))]) + } + } + public class Cons_updateStarGiftAuctionState: TypeConstructorDescription { + public var giftId: Int64 + public var state: Api.StarGiftAuctionState + public init(giftId: Int64, state: Api.StarGiftAuctionState) { + self.giftId = giftId + self.state = state + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarGiftAuctionState", [("giftId", ConstructorParameterDescription(self.giftId)), ("state", ConstructorParameterDescription(self.state))]) + } + } + public class Cons_updateStarGiftAuctionUserState: TypeConstructorDescription { + public var giftId: Int64 + public var userState: Api.StarGiftAuctionUserState + public init(giftId: Int64, userState: Api.StarGiftAuctionUserState) { + self.giftId = giftId + self.userState = userState + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarGiftAuctionUserState", [("giftId", ConstructorParameterDescription(self.giftId)), ("userState", ConstructorParameterDescription(self.userState))]) + } + } + public class Cons_updateStarsBalance: TypeConstructorDescription { + public var balance: Api.StarsAmount + public init(balance: Api.StarsAmount) { + self.balance = balance + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarsBalance", [("balance", ConstructorParameterDescription(self.balance))]) + } + } + public class Cons_updateStarsRevenueStatus: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarsRevenueStatus", [("peer", ConstructorParameterDescription(self.peer)), ("status", ConstructorParameterDescription(self.status))]) + } + } + public class Cons_updateStickerSets: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStickerSets", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_updateStickerSetsOrder: TypeConstructorDescription { + public var flags: Int32 + public var order: [Int64] + public init(flags: Int32, order: [Int64]) { + self.flags = flags + self.order = order + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStickerSetsOrder", [("flags", ConstructorParameterDescription(self.flags)), ("order", ConstructorParameterDescription(self.order))]) + } + } + public class Cons_updateStoriesStealthMode: TypeConstructorDescription { + public var stealthMode: Api.StoriesStealthMode + public init(stealthMode: Api.StoriesStealthMode) { + self.stealthMode = stealthMode + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStoriesStealthMode", [("stealthMode", ConstructorParameterDescription(self.stealthMode))]) + } + } + public class Cons_updateStory: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStory", [("peer", ConstructorParameterDescription(self.peer)), ("story", ConstructorParameterDescription(self.story))]) + } + } + public class Cons_updateStoryID: TypeConstructorDescription { + public var id: Int32 + public var randomId: Int64 + public init(id: Int32, randomId: Int64) { + self.id = id + self.randomId = randomId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStoryID", [("id", ConstructorParameterDescription(self.id)), ("randomId", ConstructorParameterDescription(self.randomId))]) + } + } + public class Cons_updateTheme: TypeConstructorDescription { + public var theme: Api.Theme + public init(theme: Api.Theme) { + self.theme = theme + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateTheme", [("theme", ConstructorParameterDescription(self.theme))]) + } + } + public class Cons_updateTranscribedAudio: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateTranscribedAudio", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("transcriptionId", ConstructorParameterDescription(self.transcriptionId)), ("text", ConstructorParameterDescription(self.text))]) + } + } + public class Cons_updateUser: TypeConstructorDescription { + public var userId: Int64 + public init(userId: Int64) { + self.userId = userId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUser", [("userId", ConstructorParameterDescription(self.userId))]) + } + } + public class Cons_updateUserEmojiStatus: TypeConstructorDescription { + public var userId: Int64 + public var emojiStatus: Api.EmojiStatus + public init(userId: Int64, emojiStatus: Api.EmojiStatus) { + self.userId = userId + self.emojiStatus = emojiStatus + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserEmojiStatus", [("userId", ConstructorParameterDescription(self.userId)), ("emojiStatus", ConstructorParameterDescription(self.emojiStatus))]) + } + } + public class Cons_updateUserName: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserName", [("userId", ConstructorParameterDescription(self.userId)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("usernames", ConstructorParameterDescription(self.usernames))]) + } + } + public class Cons_updateUserPhone: TypeConstructorDescription { + public var userId: Int64 + public var phone: String + public init(userId: Int64, phone: String) { + self.userId = userId + self.phone = phone + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserPhone", [("userId", ConstructorParameterDescription(self.userId)), ("phone", ConstructorParameterDescription(self.phone))]) + } + } + public class Cons_updateUserStatus: TypeConstructorDescription { + public var userId: Int64 + public var status: Api.UserStatus + public init(userId: Int64, status: Api.UserStatus) { + self.userId = userId + self.status = status + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserStatus", [("userId", ConstructorParameterDescription(self.userId)), ("status", ConstructorParameterDescription(self.status))]) + } + } + public class Cons_updateUserTyping: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserTyping", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("action", ConstructorParameterDescription(self.action))]) + } + } + public class Cons_updateWebBrowserException: TypeConstructorDescription { + public var flags: Int32 + public var openExternalBrowser: Api.Bool? + public var exception: Api.WebDomainException + public init(flags: Int32, openExternalBrowser: Api.Bool?, exception: Api.WebDomainException) { + self.flags = flags + self.openExternalBrowser = openExternalBrowser + self.exception = exception + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateWebBrowserException", [("flags", ConstructorParameterDescription(self.flags)), ("openExternalBrowser", ConstructorParameterDescription(self.openExternalBrowser)), ("exception", ConstructorParameterDescription(self.exception))]) + } + } + public class Cons_updateWebBrowserSettings: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateWebBrowserSettings", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_updateWebPage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateWebPage", [("webpage", ConstructorParameterDescription(self.webpage)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + } + } + public class Cons_updateWebViewResultSent: TypeConstructorDescription { + public var queryId: Int64 + public init(queryId: Int64) { + self.queryId = queryId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateWebViewResultSent", [("queryId", ConstructorParameterDescription(self.queryId))]) + } + } + case updateAiComposeTones + case updateAttachMenuBots + case updateAutoSaveSettings + 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 updateBotGuestChatQuery(Cons_updateBotGuestChatQuery) + 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 updateChatParticipantRank(Cons_updateChatParticipantRank) + case updateChatParticipants(Cons_updateChatParticipants) + case updateChatUserTyping(Cons_updateChatUserTyping) + case updateConfig + case updateContactsReset + 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(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(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 updateJoinChatWebViewDecision(Cons_updateJoinChatWebViewDecision) + case updateLangPack(Cons_updateLangPack) + case updateLangPackTooLong(Cons_updateLangPackTooLong) + case updateLoginToken + case updateManagedBot(Cons_updateManagedBot) + 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 updateNewBotConnection(Cons_updateNewBotConnection) + 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(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(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(Cons_updateSavedDialogPinned) + case updateSavedGifs + case updateSavedReactionTags + case updateSavedRingtones + 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(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 updateWebBrowserException(Cons_updateWebBrowserException) + case updateWebBrowserSettings(Cons_updateWebBrowserSettings) + case updateWebPage(Cons_updateWebPage) + case updateWebViewResultSent(Cons_updateWebViewResultSent) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .updateAiComposeTones: + if boxed { + buffer.appendInt32(-1945136645) + } + break + 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(2092125561) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _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) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.queryId!, 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 .updateBotGuestChatQuery(let _data): + if boxed { + buffer.appendInt32(-841742019) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + _data.message.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.referenceMessages!.count)) + for item in _data.referenceMessages! { + item.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 .updateChatParticipantRank(let _data): + if boxed { + buffer.appendInt32(-1115461703) + } + serializeInt64(_data.chatId, buffer: buffer, boxed: false) + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeString(_data.rank, 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(_data.sentMessages!.count)) + for item in _data.sentMessages! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + 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 .updateJoinChatWebViewDecision(let _data): + if boxed { + buffer.appendInt32(-1112768912) + } + _data.peer.serialize(buffer, true) + serializeInt64(_data.queryId, buffer: buffer, boxed: false) + _data.result.serialize(buffer, true) + 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 .updateManagedBot(let _data): + if boxed { + buffer.appendInt32(1216408986) + } + serializeInt64(_data.userId, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeInt32(_data.qts, buffer: buffer, boxed: false) + 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(-699641301) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + _data.peer!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.msgId!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt32(_data.topMsgId!, 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(1989799956) + } + 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) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.positions.count)) + for item in _data.positions { + serializeInt32(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 .updateNewBotConnection(let _data): + if boxed { + buffer.appendInt32(-1306491994) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.date!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeString(_data.device!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 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(_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(_data.order!.count)) + for item in _data.order! { + serializeInt32(item, buffer: buffer, boxed: false) + } + } + 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(_data.order!.count)) + for item in _data.order! { + item.serialize(buffer, true) + } + } + 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 .updateWebBrowserException(let _data): + if boxed { + buffer.appendInt32(335872721) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.openExternalBrowser!.serialize(buffer, true) + } + _data.exception.serialize(buffer, true) + break + case .updateWebBrowserSettings(let _data): + if boxed { + buffer.appendInt32(-1013306658) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { + switch self { + case .updateAiComposeTones: + return ("updateAiComposeTones", []) + case .updateAttachMenuBots: + return ("updateAttachMenuBots", []) + case .updateAutoSaveSettings: + return ("updateAutoSaveSettings", []) + case .updateBotBusinessConnect(let _data): + return ("updateBotBusinessConnect", [("connection", ConstructorParameterDescription(_data.connection)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotCallbackQuery(let _data): + return ("updateBotCallbackQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("chatInstance", ConstructorParameterDescription(_data.chatInstance)), ("data", ConstructorParameterDescription(_data.data)), ("gameShortName", ConstructorParameterDescription(_data.gameShortName))]) + case .updateBotChatBoost(let _data): + return ("updateBotChatBoost", [("peer", ConstructorParameterDescription(_data.peer)), ("boost", ConstructorParameterDescription(_data.boost)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotChatInviteRequester(let _data): + return ("updateBotChatInviteRequester", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date)), ("userId", ConstructorParameterDescription(_data.userId)), ("about", ConstructorParameterDescription(_data.about)), ("invite", ConstructorParameterDescription(_data.invite)), ("qts", ConstructorParameterDescription(_data.qts)), ("queryId", ConstructorParameterDescription(_data.queryId))]) + case .updateBotCommands(let _data): + return ("updateBotCommands", [("peer", ConstructorParameterDescription(_data.peer)), ("botId", ConstructorParameterDescription(_data.botId)), ("commands", ConstructorParameterDescription(_data.commands))]) + case .updateBotDeleteBusinessMessage(let _data): + return ("updateBotDeleteBusinessMessage", [("connectionId", ConstructorParameterDescription(_data.connectionId)), ("peer", ConstructorParameterDescription(_data.peer)), ("messages", ConstructorParameterDescription(_data.messages)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotEditBusinessMessage(let _data): + return ("updateBotEditBusinessMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("message", ConstructorParameterDescription(_data.message)), ("replyToMessage", ConstructorParameterDescription(_data.replyToMessage)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotGuestChatQuery(let _data): + return ("updateBotGuestChatQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("message", ConstructorParameterDescription(_data.message)), ("referenceMessages", ConstructorParameterDescription(_data.referenceMessages)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotInlineQuery(let _data): + return ("updateBotInlineQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("query", ConstructorParameterDescription(_data.query)), ("geo", ConstructorParameterDescription(_data.geo)), ("peerType", ConstructorParameterDescription(_data.peerType)), ("offset", ConstructorParameterDescription(_data.offset))]) + case .updateBotInlineSend(let _data): + return ("updateBotInlineSend", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("query", ConstructorParameterDescription(_data.query)), ("geo", ConstructorParameterDescription(_data.geo)), ("id", ConstructorParameterDescription(_data.id)), ("msgId", ConstructorParameterDescription(_data.msgId))]) + case .updateBotMenuButton(let _data): + return ("updateBotMenuButton", [("botId", ConstructorParameterDescription(_data.botId)), ("button", ConstructorParameterDescription(_data.button))]) + case .updateBotMessageReaction(let _data): + return ("updateBotMessageReaction", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("date", ConstructorParameterDescription(_data.date)), ("actor", ConstructorParameterDescription(_data.actor)), ("oldReactions", ConstructorParameterDescription(_data.oldReactions)), ("newReactions", ConstructorParameterDescription(_data.newReactions)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotMessageReactions(let _data): + return ("updateBotMessageReactions", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("date", ConstructorParameterDescription(_data.date)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotNewBusinessMessage(let _data): + return ("updateBotNewBusinessMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("message", ConstructorParameterDescription(_data.message)), ("replyToMessage", ConstructorParameterDescription(_data.replyToMessage)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotPrecheckoutQuery(let _data): + return ("updateBotPrecheckoutQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("payload", ConstructorParameterDescription(_data.payload)), ("info", ConstructorParameterDescription(_data.info)), ("shippingOptionId", ConstructorParameterDescription(_data.shippingOptionId)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount))]) + case .updateBotPurchasedPaidMedia(let _data): + return ("updateBotPurchasedPaidMedia", [("userId", ConstructorParameterDescription(_data.userId)), ("payload", ConstructorParameterDescription(_data.payload)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotShippingQuery(let _data): + return ("updateBotShippingQuery", [("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("payload", ConstructorParameterDescription(_data.payload)), ("shippingAddress", ConstructorParameterDescription(_data.shippingAddress))]) + case .updateBotStopped(let _data): + return ("updateBotStopped", [("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date)), ("stopped", ConstructorParameterDescription(_data.stopped)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateBotWebhookJSON(let _data): + return ("updateBotWebhookJSON", [("data", ConstructorParameterDescription(_data.data))]) + case .updateBotWebhookJSONQuery(let _data): + return ("updateBotWebhookJSONQuery", [("queryId", ConstructorParameterDescription(_data.queryId)), ("data", ConstructorParameterDescription(_data.data)), ("timeout", ConstructorParameterDescription(_data.timeout))]) + case .updateBusinessBotCallbackQuery(let _data): + return ("updateBusinessBotCallbackQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("message", ConstructorParameterDescription(_data.message)), ("replyToMessage", ConstructorParameterDescription(_data.replyToMessage)), ("chatInstance", ConstructorParameterDescription(_data.chatInstance)), ("data", ConstructorParameterDescription(_data.data))]) + case .updateChannel(let _data): + return ("updateChannel", [("channelId", ConstructorParameterDescription(_data.channelId))]) + case .updateChannelAvailableMessages(let _data): + return ("updateChannelAvailableMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("availableMinId", ConstructorParameterDescription(_data.availableMinId))]) + case .updateChannelMessageForwards(let _data): + return ("updateChannelMessageForwards", [("channelId", ConstructorParameterDescription(_data.channelId)), ("id", ConstructorParameterDescription(_data.id)), ("forwards", ConstructorParameterDescription(_data.forwards))]) + case .updateChannelMessageViews(let _data): + return ("updateChannelMessageViews", [("channelId", ConstructorParameterDescription(_data.channelId)), ("id", ConstructorParameterDescription(_data.id)), ("views", ConstructorParameterDescription(_data.views))]) + case .updateChannelParticipant(let _data): + return ("updateChannelParticipant", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("date", ConstructorParameterDescription(_data.date)), ("actorId", ConstructorParameterDescription(_data.actorId)), ("userId", ConstructorParameterDescription(_data.userId)), ("prevParticipant", ConstructorParameterDescription(_data.prevParticipant)), ("newParticipant", ConstructorParameterDescription(_data.newParticipant)), ("invite", ConstructorParameterDescription(_data.invite)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateChannelReadMessagesContents(let _data): + return ("updateChannelReadMessagesContents", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("messages", ConstructorParameterDescription(_data.messages))]) + case .updateChannelTooLong(let _data): + return ("updateChannelTooLong", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("pts", ConstructorParameterDescription(_data.pts))]) + case .updateChannelUserTyping(let _data): + return ("updateChannelUserTyping", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("action", ConstructorParameterDescription(_data.action))]) + case .updateChannelViewForumAsMessages(let _data): + return ("updateChannelViewForumAsMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("enabled", ConstructorParameterDescription(_data.enabled))]) + case .updateChannelWebPage(let _data): + return ("updateChannelWebPage", [("channelId", ConstructorParameterDescription(_data.channelId)), ("webpage", ConstructorParameterDescription(_data.webpage)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateChat(let _data): + return ("updateChat", [("chatId", ConstructorParameterDescription(_data.chatId))]) + case .updateChatDefaultBannedRights(let _data): + return ("updateChatDefaultBannedRights", [("peer", ConstructorParameterDescription(_data.peer)), ("defaultBannedRights", ConstructorParameterDescription(_data.defaultBannedRights)), ("version", ConstructorParameterDescription(_data.version))]) + case .updateChatParticipant(let _data): + return ("updateChatParticipant", [("flags", ConstructorParameterDescription(_data.flags)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("date", ConstructorParameterDescription(_data.date)), ("actorId", ConstructorParameterDescription(_data.actorId)), ("userId", ConstructorParameterDescription(_data.userId)), ("prevParticipant", ConstructorParameterDescription(_data.prevParticipant)), ("newParticipant", ConstructorParameterDescription(_data.newParticipant)), ("invite", ConstructorParameterDescription(_data.invite)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateChatParticipantAdd(let _data): + return ("updateChatParticipantAdd", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("inviterId", ConstructorParameterDescription(_data.inviterId)), ("date", ConstructorParameterDescription(_data.date)), ("version", ConstructorParameterDescription(_data.version))]) + case .updateChatParticipantAdmin(let _data): + return ("updateChatParticipantAdmin", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("isAdmin", ConstructorParameterDescription(_data.isAdmin)), ("version", ConstructorParameterDescription(_data.version))]) + case .updateChatParticipantDelete(let _data): + return ("updateChatParticipantDelete", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("version", ConstructorParameterDescription(_data.version))]) + case .updateChatParticipantRank(let _data): + return ("updateChatParticipantRank", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("rank", ConstructorParameterDescription(_data.rank)), ("version", ConstructorParameterDescription(_data.version))]) + case .updateChatParticipants(let _data): + return ("updateChatParticipants", [("participants", ConstructorParameterDescription(_data.participants))]) + case .updateChatUserTyping(let _data): + return ("updateChatUserTyping", [("chatId", ConstructorParameterDescription(_data.chatId)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("action", ConstructorParameterDescription(_data.action))]) + case .updateConfig: + return ("updateConfig", []) + case .updateContactsReset: + return ("updateContactsReset", []) + case .updateDcOptions(let _data): + return ("updateDcOptions", [("dcOptions", ConstructorParameterDescription(_data.dcOptions))]) + case .updateDeleteChannelMessages(let _data): + return ("updateDeleteChannelMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateDeleteGroupCallMessages(let _data): + return ("updateDeleteGroupCallMessages", [("call", ConstructorParameterDescription(_data.call)), ("messages", ConstructorParameterDescription(_data.messages))]) + case .updateDeleteMessages(let _data): + return ("updateDeleteMessages", [("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateDeleteQuickReply(let _data): + return ("updateDeleteQuickReply", [("shortcutId", ConstructorParameterDescription(_data.shortcutId))]) + case .updateDeleteQuickReplyMessages(let _data): + return ("updateDeleteQuickReplyMessages", [("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("messages", ConstructorParameterDescription(_data.messages))]) + case .updateDeleteScheduledMessages(let _data): + return ("updateDeleteScheduledMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("messages", ConstructorParameterDescription(_data.messages)), ("sentMessages", ConstructorParameterDescription(_data.sentMessages))]) + case .updateDialogFilter(let _data): + return ("updateDialogFilter", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("filter", ConstructorParameterDescription(_data.filter))]) + case .updateDialogFilterOrder(let _data): + return ("updateDialogFilterOrder", [("order", ConstructorParameterDescription(_data.order))]) + case .updateDialogFilters: + return ("updateDialogFilters", []) + case .updateDialogPinned(let _data): + return ("updateDialogPinned", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("peer", ConstructorParameterDescription(_data.peer))]) + case .updateDialogUnreadMark(let _data): + return ("updateDialogUnreadMark", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId))]) + case .updateDraftMessage(let _data): + return ("updateDraftMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("draft", ConstructorParameterDescription(_data.draft))]) + case .updateEditChannelMessage(let _data): + return ("updateEditChannelMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateEditMessage(let _data): + return ("updateEditMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateEmojiGameInfo(let _data): + return ("updateEmojiGameInfo", [("info", ConstructorParameterDescription(_data.info))]) + case .updateEncryptedChatTyping(let _data): + return ("updateEncryptedChatTyping", [("chatId", ConstructorParameterDescription(_data.chatId))]) + case .updateEncryptedMessagesRead(let _data): + return ("updateEncryptedMessagesRead", [("chatId", ConstructorParameterDescription(_data.chatId)), ("maxDate", ConstructorParameterDescription(_data.maxDate)), ("date", ConstructorParameterDescription(_data.date))]) + case .updateEncryption(let _data): + return ("updateEncryption", [("chat", ConstructorParameterDescription(_data.chat)), ("date", ConstructorParameterDescription(_data.date))]) + case .updateFavedStickers: + return ("updateFavedStickers", []) + case .updateFolderPeers(let _data): + return ("updateFolderPeers", [("folderPeers", ConstructorParameterDescription(_data.folderPeers)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateGeoLiveViewed(let _data): + return ("updateGeoLiveViewed", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId))]) + case .updateGroupCall(let _data): + return ("updateGroupCall", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("call", ConstructorParameterDescription(_data.call))]) + case .updateGroupCallChainBlocks(let _data): + return ("updateGroupCallChainBlocks", [("call", ConstructorParameterDescription(_data.call)), ("subChainId", ConstructorParameterDescription(_data.subChainId)), ("blocks", ConstructorParameterDescription(_data.blocks)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) + case .updateGroupCallConnection(let _data): + return ("updateGroupCallConnection", [("flags", ConstructorParameterDescription(_data.flags)), ("params", ConstructorParameterDescription(_data.params))]) + case .updateGroupCallEncryptedMessage(let _data): + return ("updateGroupCallEncryptedMessage", [("call", ConstructorParameterDescription(_data.call)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("encryptedMessage", ConstructorParameterDescription(_data.encryptedMessage))]) + case .updateGroupCallMessage(let _data): + return ("updateGroupCallMessage", [("call", ConstructorParameterDescription(_data.call)), ("message", ConstructorParameterDescription(_data.message))]) + case .updateGroupCallParticipants(let _data): + return ("updateGroupCallParticipants", [("call", ConstructorParameterDescription(_data.call)), ("participants", ConstructorParameterDescription(_data.participants)), ("version", ConstructorParameterDescription(_data.version))]) + case .updateInlineBotCallbackQuery(let _data): + return ("updateInlineBotCallbackQuery", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("userId", ConstructorParameterDescription(_data.userId)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("chatInstance", ConstructorParameterDescription(_data.chatInstance)), ("data", ConstructorParameterDescription(_data.data)), ("gameShortName", ConstructorParameterDescription(_data.gameShortName))]) + case .updateJoinChatWebViewDecision(let _data): + return ("updateJoinChatWebViewDecision", [("peer", ConstructorParameterDescription(_data.peer)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("result", ConstructorParameterDescription(_data.result))]) + case .updateLangPack(let _data): + return ("updateLangPack", [("difference", ConstructorParameterDescription(_data.difference))]) + case .updateLangPackTooLong(let _data): + return ("updateLangPackTooLong", [("langCode", ConstructorParameterDescription(_data.langCode))]) + case .updateLoginToken: + return ("updateLoginToken", []) + case .updateManagedBot(let _data): + return ("updateManagedBot", [("userId", ConstructorParameterDescription(_data.userId)), ("botId", ConstructorParameterDescription(_data.botId)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateMessageExtendedMedia(let _data): + return ("updateMessageExtendedMedia", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) + case .updateMessageID(let _data): + return ("updateMessageID", [("id", ConstructorParameterDescription(_data.id)), ("randomId", ConstructorParameterDescription(_data.randomId))]) + case .updateMessagePoll(let _data): + return ("updateMessagePoll", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("pollId", ConstructorParameterDescription(_data.pollId)), ("poll", ConstructorParameterDescription(_data.poll)), ("results", ConstructorParameterDescription(_data.results))]) + case .updateMessagePollVote(let _data): + return ("updateMessagePollVote", [("pollId", ConstructorParameterDescription(_data.pollId)), ("peer", ConstructorParameterDescription(_data.peer)), ("options", ConstructorParameterDescription(_data.options)), ("positions", ConstructorParameterDescription(_data.positions)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateMessageReactions(let _data): + return ("updateMessageReactions", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("reactions", ConstructorParameterDescription(_data.reactions))]) + case .updateMonoForumNoPaidException(let _data): + return ("updateMonoForumNoPaidException", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId))]) + case .updateMoveStickerSetToTop(let _data): + return ("updateMoveStickerSetToTop", [("flags", ConstructorParameterDescription(_data.flags)), ("stickerset", ConstructorParameterDescription(_data.stickerset))]) + case .updateNewAuthorization(let _data): + return ("updateNewAuthorization", [("flags", ConstructorParameterDescription(_data.flags)), ("hash", ConstructorParameterDescription(_data.hash)), ("date", ConstructorParameterDescription(_data.date)), ("device", ConstructorParameterDescription(_data.device)), ("location", ConstructorParameterDescription(_data.location))]) + case .updateNewBotConnection(let _data): + return ("updateNewBotConnection", [("flags", ConstructorParameterDescription(_data.flags)), ("botId", ConstructorParameterDescription(_data.botId)), ("date", ConstructorParameterDescription(_data.date)), ("device", ConstructorParameterDescription(_data.device)), ("location", ConstructorParameterDescription(_data.location))]) + case .updateNewChannelMessage(let _data): + return ("updateNewChannelMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateNewEncryptedMessage(let _data): + return ("updateNewEncryptedMessage", [("message", ConstructorParameterDescription(_data.message)), ("qts", ConstructorParameterDescription(_data.qts))]) + case .updateNewMessage(let _data): + return ("updateNewMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateNewQuickReply(let _data): + return ("updateNewQuickReply", [("quickReply", ConstructorParameterDescription(_data.quickReply))]) + case .updateNewScheduledMessage(let _data): + return ("updateNewScheduledMessage", [("message", ConstructorParameterDescription(_data.message))]) + case .updateNewStickerSet(let _data): + return ("updateNewStickerSet", [("stickerset", ConstructorParameterDescription(_data.stickerset))]) + case .updateNewStoryReaction(let _data): + return ("updateNewStoryReaction", [("storyId", ConstructorParameterDescription(_data.storyId)), ("peer", ConstructorParameterDescription(_data.peer)), ("reaction", ConstructorParameterDescription(_data.reaction))]) + case .updateNotifySettings(let _data): + return ("updateNotifySettings", [("peer", ConstructorParameterDescription(_data.peer)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings))]) + case .updatePaidReactionPrivacy(let _data): + return ("updatePaidReactionPrivacy", [("`private`", ConstructorParameterDescription(_data.`private`))]) + case .updatePeerBlocked(let _data): + return ("updatePeerBlocked", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId))]) + case .updatePeerHistoryTTL(let _data): + return ("updatePeerHistoryTTL", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) + case .updatePeerLocated(let _data): + return ("updatePeerLocated", [("peers", ConstructorParameterDescription(_data.peers))]) + case .updatePeerSettings(let _data): + return ("updatePeerSettings", [("peer", ConstructorParameterDescription(_data.peer)), ("settings", ConstructorParameterDescription(_data.settings))]) + case .updatePeerWallpaper(let _data): + return ("updatePeerWallpaper", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) + case .updatePendingJoinRequests(let _data): + return ("updatePendingJoinRequests", [("peer", ConstructorParameterDescription(_data.peer)), ("requestsPending", ConstructorParameterDescription(_data.requestsPending)), ("recentRequesters", ConstructorParameterDescription(_data.recentRequesters))]) + case .updatePhoneCall(let _data): + return ("updatePhoneCall", [("phoneCall", ConstructorParameterDescription(_data.phoneCall))]) + case .updatePhoneCallSignalingData(let _data): + return ("updatePhoneCallSignalingData", [("phoneCallId", ConstructorParameterDescription(_data.phoneCallId)), ("data", ConstructorParameterDescription(_data.data))]) + case .updatePinnedChannelMessages(let _data): + return ("updatePinnedChannelMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updatePinnedDialogs(let _data): + return ("updatePinnedDialogs", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("order", ConstructorParameterDescription(_data.order))]) + case .updatePinnedForumTopic(let _data): + return ("updatePinnedForumTopic", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topicId", ConstructorParameterDescription(_data.topicId))]) + case .updatePinnedForumTopics(let _data): + return ("updatePinnedForumTopics", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("order", ConstructorParameterDescription(_data.order))]) + case .updatePinnedMessages(let _data): + return ("updatePinnedMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updatePinnedSavedDialogs(let _data): + return ("updatePinnedSavedDialogs", [("flags", ConstructorParameterDescription(_data.flags)), ("order", ConstructorParameterDescription(_data.order))]) + case .updatePrivacy(let _data): + return ("updatePrivacy", [("key", ConstructorParameterDescription(_data.key)), ("rules", ConstructorParameterDescription(_data.rules))]) + case .updatePtsChanged: + return ("updatePtsChanged", []) + case .updateQuickReplies(let _data): + return ("updateQuickReplies", [("quickReplies", ConstructorParameterDescription(_data.quickReplies))]) + case .updateQuickReplyMessage(let _data): + return ("updateQuickReplyMessage", [("message", ConstructorParameterDescription(_data.message))]) + case .updateReadChannelDiscussionInbox(let _data): + return ("updateReadChannelDiscussionInbox", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId)), ("broadcastId", ConstructorParameterDescription(_data.broadcastId)), ("broadcastPost", ConstructorParameterDescription(_data.broadcastPost))]) + case .updateReadChannelDiscussionOutbox(let _data): + return ("updateReadChannelDiscussionOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) + case .updateReadChannelInbox(let _data): + return ("updateReadChannelInbox", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("stillUnreadCount", ConstructorParameterDescription(_data.stillUnreadCount)), ("pts", ConstructorParameterDescription(_data.pts))]) + case .updateReadChannelOutbox(let _data): + return ("updateReadChannelOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("maxId", ConstructorParameterDescription(_data.maxId))]) + case .updateReadFeaturedEmojiStickers: + return ("updateReadFeaturedEmojiStickers", []) + case .updateReadFeaturedStickers: + return ("updateReadFeaturedStickers", []) + case .updateReadHistoryInbox(let _data): + return ("updateReadHistoryInbox", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("stillUnreadCount", ConstructorParameterDescription(_data.stillUnreadCount)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateReadHistoryOutbox(let _data): + return ("updateReadHistoryOutbox", [("peer", ConstructorParameterDescription(_data.peer)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateReadMessagesContents(let _data): + return ("updateReadMessagesContents", [("flags", ConstructorParameterDescription(_data.flags)), ("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date))]) + case .updateReadMonoForumInbox(let _data): + return ("updateReadMonoForumInbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) + case .updateReadMonoForumOutbox(let _data): + return ("updateReadMonoForumOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) + case .updateReadStories(let _data): + return ("updateReadStories", [("peer", ConstructorParameterDescription(_data.peer)), ("maxId", ConstructorParameterDescription(_data.maxId))]) + case .updateRecentEmojiStatuses: + return ("updateRecentEmojiStatuses", []) + case .updateRecentReactions: + return ("updateRecentReactions", []) + case .updateRecentStickers: + return ("updateRecentStickers", []) + case .updateSavedDialogPinned(let _data): + return ("updateSavedDialogPinned", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer))]) + case .updateSavedGifs: + return ("updateSavedGifs", []) + case .updateSavedReactionTags: + return ("updateSavedReactionTags", []) + case .updateSavedRingtones: + return ("updateSavedRingtones", []) + case .updateSentPhoneCode(let _data): + return ("updateSentPhoneCode", [("sentCode", ConstructorParameterDescription(_data.sentCode))]) + case .updateSentStoryReaction(let _data): + return ("updateSentStoryReaction", [("peer", ConstructorParameterDescription(_data.peer)), ("storyId", ConstructorParameterDescription(_data.storyId)), ("reaction", ConstructorParameterDescription(_data.reaction))]) + case .updateServiceNotification(let _data): + return ("updateServiceNotification", [("flags", ConstructorParameterDescription(_data.flags)), ("inboxDate", ConstructorParameterDescription(_data.inboxDate)), ("type", ConstructorParameterDescription(_data.type)), ("message", ConstructorParameterDescription(_data.message)), ("media", ConstructorParameterDescription(_data.media)), ("entities", ConstructorParameterDescription(_data.entities))]) + case .updateSmsJob(let _data): + return ("updateSmsJob", [("jobId", ConstructorParameterDescription(_data.jobId))]) + case .updateStarGiftAuctionState(let _data): + return ("updateStarGiftAuctionState", [("giftId", ConstructorParameterDescription(_data.giftId)), ("state", ConstructorParameterDescription(_data.state))]) + case .updateStarGiftAuctionUserState(let _data): + return ("updateStarGiftAuctionUserState", [("giftId", ConstructorParameterDescription(_data.giftId)), ("userState", ConstructorParameterDescription(_data.userState))]) + case .updateStarGiftCraftFail: + return ("updateStarGiftCraftFail", []) + case .updateStarsBalance(let _data): + return ("updateStarsBalance", [("balance", ConstructorParameterDescription(_data.balance))]) + case .updateStarsRevenueStatus(let _data): + return ("updateStarsRevenueStatus", [("peer", ConstructorParameterDescription(_data.peer)), ("status", ConstructorParameterDescription(_data.status))]) + case .updateStickerSets(let _data): + return ("updateStickerSets", [("flags", ConstructorParameterDescription(_data.flags))]) + case .updateStickerSetsOrder(let _data): + return ("updateStickerSetsOrder", [("flags", ConstructorParameterDescription(_data.flags)), ("order", ConstructorParameterDescription(_data.order))]) + case .updateStoriesStealthMode(let _data): + return ("updateStoriesStealthMode", [("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) + case .updateStory(let _data): + return ("updateStory", [("peer", ConstructorParameterDescription(_data.peer)), ("story", ConstructorParameterDescription(_data.story))]) + case .updateStoryID(let _data): + return ("updateStoryID", [("id", ConstructorParameterDescription(_data.id)), ("randomId", ConstructorParameterDescription(_data.randomId))]) + case .updateTheme(let _data): + return ("updateTheme", [("theme", ConstructorParameterDescription(_data.theme))]) + case .updateTranscribedAudio(let _data): + return ("updateTranscribedAudio", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("transcriptionId", ConstructorParameterDescription(_data.transcriptionId)), ("text", ConstructorParameterDescription(_data.text))]) + case .updateUser(let _data): + return ("updateUser", [("userId", ConstructorParameterDescription(_data.userId))]) + case .updateUserEmojiStatus(let _data): + return ("updateUserEmojiStatus", [("userId", ConstructorParameterDescription(_data.userId)), ("emojiStatus", ConstructorParameterDescription(_data.emojiStatus))]) + case .updateUserName(let _data): + return ("updateUserName", [("userId", ConstructorParameterDescription(_data.userId)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("usernames", ConstructorParameterDescription(_data.usernames))]) + case .updateUserPhone(let _data): + return ("updateUserPhone", [("userId", ConstructorParameterDescription(_data.userId)), ("phone", ConstructorParameterDescription(_data.phone))]) + case .updateUserStatus(let _data): + return ("updateUserStatus", [("userId", ConstructorParameterDescription(_data.userId)), ("status", ConstructorParameterDescription(_data.status))]) + case .updateUserTyping(let _data): + return ("updateUserTyping", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("action", ConstructorParameterDescription(_data.action))]) + case .updateWebBrowserException(let _data): + return ("updateWebBrowserException", [("flags", ConstructorParameterDescription(_data.flags)), ("openExternalBrowser", ConstructorParameterDescription(_data.openExternalBrowser)), ("exception", ConstructorParameterDescription(_data.exception))]) + case .updateWebBrowserSettings(let _data): + return ("updateWebBrowserSettings", [("flags", ConstructorParameterDescription(_data.flags))]) + case .updateWebPage(let _data): + return ("updateWebPage", [("webpage", ConstructorParameterDescription(_data.webpage)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) + case .updateWebViewResultSent(let _data): + return ("updateWebViewResultSent", [("queryId", ConstructorParameterDescription(_data.queryId))]) + } + } + + public static func parse_updateAiComposeTones(_ reader: BufferReader) -> Update? { + return Api.Update.updateAiComposeTones + } + public static func parse_updateAttachMenuBots(_ reader: BufferReader) -> Update? { + return Api.Update.updateAttachMenuBots + } + public static func parse_updateAutoSaveSettings(_ reader: BufferReader) -> Update? { + return Api.Update.updateAutoSaveSettings + } + public static func parse_updateBotBusinessConnect(_ reader: BufferReader) -> Update? { + var _1: Api.BotBusinessConnection? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.BotBusinessConnection + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateBotBusinessConnect(Cons_updateBotBusinessConnect(connection: _1!, qts: _2!)) + } + else { + return nil + } + } + public static func parse_updateBotCallbackQuery(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Api.Peer? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _5: Int32? + _5 = reader.readInt32() + var _6: Int64? + _6 = reader.readInt64() + var _7: Buffer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _7 = parseBytes(reader) + } + var _8: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _8 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_updateBotChatBoost(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Api.Boost? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Boost + } + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateBotChatBoost(Cons_updateBotChatBoost(peer: _1!, boost: _2!, qts: _3!)) + } + else { + return nil + } + } + public static func parse_updateBotChatInviteRequester(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int64? + _4 = reader.readInt64() + var _5: String? + _5 = parseString(reader) + var _6: Api.ExportedChatInvite? + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + var _7: Int32? + _7 = reader.readInt32() + var _8: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _8 = reader.readInt64() } let _c1 = _1 != nil let _c2 = _2 != nil @@ -436,1856 +4685,227 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _12 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { - 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 - } - } - public static func parse_updateShortSentMessage(_ reader: BufferReader) -> Updates? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Api.MessageMedia? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - } - var _8: Int32? - if Int(_1 ?? 0) & Int(1 << 25) != 0 { - _8 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _8 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.Updates.updateShortSentMessage(Cons_updateShortSentMessage(flags: _1!, id: _2!, pts: _3!, ptsCount: _4!, date: _5!, media: _6, entities: _7, ttlPeriod: _8)) + return Api.Update.updateBotChatInviteRequester(Cons_updateBotChatInviteRequester(flags: _1!, peer: _2!, date: _3!, userId: _4!, about: _5!, invite: _6!, qts: _7!, queryId: _8)) } else { return nil } } - public static func parse_updates(_ reader: BufferReader) -> Updates? { - var _1: [Api.Update]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) + public static func parse_updateBotCommands(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer } - var _2: [Api.User]? + var _2: Int64? + _2 = reader.readInt64() + var _3: [Api.BotCommand]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self) } - var _3: [Api.Chat]? + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateBotCommands(Cons_updateBotCommands(peer: _1!, botId: _2!, commands: _3!)) + } + else { + return nil + } + } + public static func parse_updateBotDeleteBusinessMessage(_ reader: BufferReader) -> Update? { + var _1: String? + _1 = parseString(reader) + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: [Int32]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } var _4: Int32? _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.Updates.updates(Cons_updates(updates: _1!, users: _2!, chats: _3!, date: _4!, seq: _5!)) + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateBotDeleteBusinessMessage(Cons_updateBotDeleteBusinessMessage(connectionId: _1!, peer: _2!, messages: _3!, qts: _4!)) } else { return nil } } - public static func parse_updatesCombined(_ reader: BufferReader) -> Updates? { - var _1: [Api.Update]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.Updates.updatesCombined(Cons_updatesCombined(updates: _1!, users: _2!, chats: _3!, date: _4!, seqStart: _5!, seq: _6!)) - } - else { - return nil - } - } - public static func parse_updatesTooLong(_ reader: BufferReader) -> Updates? { - return Api.Updates.updatesTooLong - } - } -} -public extension Api { - enum UrlAuthResult: TypeConstructorDescription { - public class Cons_urlAuthResultAccepted: TypeConstructorDescription { - public var flags: Int32 - public var url: String? - public init(flags: Int32, url: String?) { - self.flags = flags - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("urlAuthResultAccepted", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url))]) - } - } - public class Cons_urlAuthResultRequest: TypeConstructorDescription { - public var flags: Int32 - public var bot: Api.User - public var domain: String - public var browser: String? - public var platform: String? - public var ip: String? - public var region: String? - public var matchCodes: [String]? - public var userIdHint: Int64? - public var verifiedAppName: String? - public init(flags: Int32, bot: Api.User, domain: String, browser: String?, platform: String?, ip: String?, region: String?, matchCodes: [String]?, userIdHint: Int64?, verifiedAppName: String?) { - self.flags = flags - self.bot = bot - self.domain = domain - self.browser = browser - self.platform = platform - self.ip = ip - self.region = region - self.matchCodes = matchCodes - self.userIdHint = userIdHint - self.verifiedAppName = verifiedAppName - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("urlAuthResultRequest", [("flags", ConstructorParameterDescription(self.flags)), ("bot", ConstructorParameterDescription(self.bot)), ("domain", ConstructorParameterDescription(self.domain)), ("browser", ConstructorParameterDescription(self.browser)), ("platform", ConstructorParameterDescription(self.platform)), ("ip", ConstructorParameterDescription(self.ip)), ("region", ConstructorParameterDescription(self.region)), ("matchCodes", ConstructorParameterDescription(self.matchCodes)), ("userIdHint", ConstructorParameterDescription(self.userIdHint)), ("verifiedAppName", ConstructorParameterDescription(self.verifiedAppName))]) - } - } - case urlAuthResultAccepted(Cons_urlAuthResultAccepted) - case urlAuthResultDefault - case urlAuthResultRequest(Cons_urlAuthResultRequest) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .urlAuthResultAccepted(let _data): - if boxed { - buffer.appendInt32(1648005024) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.url!, buffer: buffer, boxed: false) - } - break - case .urlAuthResultDefault: - if boxed { - buffer.appendInt32(-1445536993) - } - break - case .urlAuthResultRequest(let _data): - if boxed { - buffer.appendInt32(1020666860) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.bot.serialize(buffer, true) - serializeString(_data.domain, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeString(_data.browser!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeString(_data.platform!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeString(_data.ip!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeString(_data.region!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 3) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.matchCodes!.count)) - for item in _data.matchCodes! { - serializeString(item, buffer: buffer, boxed: false) - } - } - if Int(_data.flags) & Int(1 << 4) != 0 { - serializeInt64(_data.userIdHint!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 7) != 0 { - serializeString(_data.verifiedAppName!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .urlAuthResultAccepted(let _data): - return ("urlAuthResultAccepted", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url))]) - case .urlAuthResultDefault: - return ("urlAuthResultDefault", []) - case .urlAuthResultRequest(let _data): - return ("urlAuthResultRequest", [("flags", ConstructorParameterDescription(_data.flags)), ("bot", ConstructorParameterDescription(_data.bot)), ("domain", ConstructorParameterDescription(_data.domain)), ("browser", ConstructorParameterDescription(_data.browser)), ("platform", ConstructorParameterDescription(_data.platform)), ("ip", ConstructorParameterDescription(_data.ip)), ("region", ConstructorParameterDescription(_data.region)), ("matchCodes", ConstructorParameterDescription(_data.matchCodes)), ("userIdHint", ConstructorParameterDescription(_data.userIdHint)), ("verifiedAppName", ConstructorParameterDescription(_data.verifiedAppName))]) - } - } - - public static func parse_urlAuthResultAccepted(_ reader: BufferReader) -> UrlAuthResult? { + public static func parse_updateBotEditBusinessMessage(_ reader: BufferReader) -> Update? { var _1: Int32? _1 = reader.readInt32() var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.UrlAuthResult.urlAuthResultAccepted(Cons_urlAuthResultAccepted(flags: _1!, url: _2)) - } - else { - return nil - } - } - public static func parse_urlAuthResultDefault(_ reader: BufferReader) -> UrlAuthResult? { - return Api.UrlAuthResult.urlAuthResultDefault - } - public static func parse_urlAuthResultRequest(_ reader: BufferReader) -> UrlAuthResult? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.User? + _2 = parseString(reader) + var _3: Api.Message? if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.User + _3 = Api.parse(reader, signature: signature) as? Api.Message } - var _3: String? - _3 = parseString(reader) - var _4: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _5 = parseString(reader) - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _6 = parseString(reader) - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _7 = parseString(reader) - } - var _8: [String]? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + var _4: Api.Message? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Message } } - var _9: Int64? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _9 = reader.readInt64() - } - var _10: String? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - _10 = parseString(reader) - } + var _5: Int32? + _5 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _10 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - return Api.UrlAuthResult.urlAuthResultRequest(Cons_urlAuthResultRequest(flags: _1!, bot: _2!, domain: _3!, browser: _4, platform: _5, ip: _6, region: _7, matchCodes: _8, userIdHint: _9, verifiedAppName: _10)) + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateBotEditBusinessMessage(Cons_updateBotEditBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!)) } else { return nil } } - } -} -public extension Api { - enum User: TypeConstructorDescription { - public class Cons_user: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("user", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("username", ConstructorParameterDescription(self.username)), ("phone", ConstructorParameterDescription(self.phone)), ("photo", ConstructorParameterDescription(self.photo)), ("status", ConstructorParameterDescription(self.status)), ("botInfoVersion", ConstructorParameterDescription(self.botInfoVersion)), ("restrictionReason", ConstructorParameterDescription(self.restrictionReason)), ("botInlinePlaceholder", ConstructorParameterDescription(self.botInlinePlaceholder)), ("langCode", ConstructorParameterDescription(self.langCode)), ("emojiStatus", ConstructorParameterDescription(self.emojiStatus)), ("usernames", ConstructorParameterDescription(self.usernames)), ("storiesMaxId", ConstructorParameterDescription(self.storiesMaxId)), ("color", ConstructorParameterDescription(self.color)), ("profileColor", ConstructorParameterDescription(self.profileColor)), ("botActiveUsers", ConstructorParameterDescription(self.botActiveUsers)), ("botVerificationIcon", ConstructorParameterDescription(self.botVerificationIcon)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars))]) - } - } - public class Cons_userEmpty: TypeConstructorDescription { - public var id: Int64 - public init(id: Int64) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userEmpty", [("id", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .user(let _data): - return ("user", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("username", ConstructorParameterDescription(_data.username)), ("phone", ConstructorParameterDescription(_data.phone)), ("photo", ConstructorParameterDescription(_data.photo)), ("status", ConstructorParameterDescription(_data.status)), ("botInfoVersion", ConstructorParameterDescription(_data.botInfoVersion)), ("restrictionReason", ConstructorParameterDescription(_data.restrictionReason)), ("botInlinePlaceholder", ConstructorParameterDescription(_data.botInlinePlaceholder)), ("langCode", ConstructorParameterDescription(_data.langCode)), ("emojiStatus", ConstructorParameterDescription(_data.emojiStatus)), ("usernames", ConstructorParameterDescription(_data.usernames)), ("storiesMaxId", ConstructorParameterDescription(_data.storiesMaxId)), ("color", ConstructorParameterDescription(_data.color)), ("profileColor", ConstructorParameterDescription(_data.profileColor)), ("botActiveUsers", ConstructorParameterDescription(_data.botActiveUsers)), ("botVerificationIcon", ConstructorParameterDescription(_data.botVerificationIcon)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars))]) - case .userEmpty(let _data): - return ("userEmpty", [("id", ConstructorParameterDescription(_data.id))]) - } - } - - public static func parse_user(_ reader: BufferReader) -> User? { + public static func parse_updateBotGuestChatQuery(_ reader: BufferReader) -> Update? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.Message? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Message + } + var _4: [Api.Message]? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + } + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateBotGuestChatQuery(Cons_updateBotGuestChatQuery(flags: _1!, queryId: _2!, message: _3!, referenceMessages: _4, qts: _5!)) + } + else { + return nil + } + } + public static func parse_updateBotInlineQuery(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() var _3: Int64? _3 = reader.readInt64() - var _4: Int64? + var _4: String? + _4 = parseString(reader) + var _5: Api.GeoPoint? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = reader.readInt64() + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.GeoPoint + } } - var _5: String? + var _6: Api.InlineQueryPeerType? if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _6 = parseString(reader) + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.InlineQueryPeerType + } } var _7: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _7 = parseString(reader) + _7 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.Update.updateBotInlineQuery(Cons_updateBotInlineQuery(flags: _1!, queryId: _2!, userId: _3!, query: _4!, geo: _5, peerType: _6, offset: _7!)) } - var _8: String? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _8 = parseString(reader) + else { + return nil } - var _9: Api.UserProfilePhoto? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { + } + public static func parse_updateBotInlineSend(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: Api.GeoPoint? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.UserProfilePhoto + _4 = Api.parse(reader, signature: signature) as? Api.GeoPoint } } - var _10: Api.UserStatus? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { + var _5: String? + _5 = parseString(reader) + var _6: Api.InputBotInlineMessageID? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.UserStatus + _6 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID } } - var _11: Int32? - if Int(_1 ?? 0) & Int(1 << 14) != 0 { - _11 = reader.readInt32() - } - var _12: [Api.RestrictionReason]? - if Int(_1 ?? 0) & Int(1 << 18) != 0 { - if let _ = reader.readInt32() { - _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) - } - } - var _13: String? - if Int(_1 ?? 0) & Int(1 << 19) != 0 { - _13 = parseString(reader) - } - var _14: String? - if Int(_1 ?? 0) & Int(1 << 22) != 0 { - _14 = parseString(reader) - } - var _15: Api.EmojiStatus? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 9) != 0 { - if let signature = reader.readInt32() { - _19 = Api.parse(reader, signature: signature) as? Api.PeerColor - } - } - var _20: Int32? - if Int(_2 ?? 0) & Int(1 << 12) != 0 { - _20 = reader.readInt32() - } - var _21: Int64? - if Int(_2 ?? 0) & Int(1 << 14) != 0 { - _21 = reader.readInt64() - } - var _22: Int64? - if Int(_2 ?? 0) & Int(1 << 15) != 0 { - _22 = reader.readInt64() - } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 22) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 30) == 0) || _15 != nil - let _c16 = (Int(_2 ?? 0) & Int(1 << 0) == 0) || _16 != nil - let _c17 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _17 != nil - let _c18 = (Int(_2 ?? 0) & Int(1 << 8) == 0) || _18 != nil - let _c19 = (Int(_2 ?? 0) & Int(1 << 9) == 0) || _19 != nil - let _c20 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _20 != nil - let _c21 = (Int(_2 ?? 0) & Int(1 << 14) == 0) || _21 != nil - let _c22 = (Int(_2 ?? 0) & 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(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)) + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.Update.updateBotInlineSend(Cons_updateBotInlineSend(flags: _1!, userId: _2!, query: _3!, geo: _4, id: _5!, msgId: _6)) } else { return nil } } - public static func parse_userEmpty(_ reader: BufferReader) -> User? { + public static func parse_updateBotMenuButton(_ reader: BufferReader) -> Update? { var _1: Int64? _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.User.userEmpty(Cons_userEmpty(id: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum UserFull: TypeConstructorDescription { - public class Cons_userFull: TypeConstructorDescription { - 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 var botManagerId: Int64? - 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?, botManagerId: Int64?) { - 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 - self.botManagerId = botManagerId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userFull", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("about", ConstructorParameterDescription(self.about)), ("settings", ConstructorParameterDescription(self.settings)), ("personalPhoto", ConstructorParameterDescription(self.personalPhoto)), ("profilePhoto", ConstructorParameterDescription(self.profilePhoto)), ("fallbackPhoto", ConstructorParameterDescription(self.fallbackPhoto)), ("notifySettings", ConstructorParameterDescription(self.notifySettings)), ("botInfo", ConstructorParameterDescription(self.botInfo)), ("pinnedMsgId", ConstructorParameterDescription(self.pinnedMsgId)), ("commonChatsCount", ConstructorParameterDescription(self.commonChatsCount)), ("folderId", ConstructorParameterDescription(self.folderId)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod)), ("theme", ConstructorParameterDescription(self.theme)), ("privateForwardName", ConstructorParameterDescription(self.privateForwardName)), ("botGroupAdminRights", ConstructorParameterDescription(self.botGroupAdminRights)), ("botBroadcastAdminRights", ConstructorParameterDescription(self.botBroadcastAdminRights)), ("wallpaper", ConstructorParameterDescription(self.wallpaper)), ("stories", ConstructorParameterDescription(self.stories)), ("businessWorkHours", ConstructorParameterDescription(self.businessWorkHours)), ("businessLocation", ConstructorParameterDescription(self.businessLocation)), ("businessGreetingMessage", ConstructorParameterDescription(self.businessGreetingMessage)), ("businessAwayMessage", ConstructorParameterDescription(self.businessAwayMessage)), ("businessIntro", ConstructorParameterDescription(self.businessIntro)), ("birthday", ConstructorParameterDescription(self.birthday)), ("personalChannelId", ConstructorParameterDescription(self.personalChannelId)), ("personalChannelMessage", ConstructorParameterDescription(self.personalChannelMessage)), ("stargiftsCount", ConstructorParameterDescription(self.stargiftsCount)), ("starrefProgram", ConstructorParameterDescription(self.starrefProgram)), ("botVerification", ConstructorParameterDescription(self.botVerification)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars)), ("disallowedGifts", ConstructorParameterDescription(self.disallowedGifts)), ("starsRating", ConstructorParameterDescription(self.starsRating)), ("starsMyPendingRating", ConstructorParameterDescription(self.starsMyPendingRating)), ("starsMyPendingRatingDate", ConstructorParameterDescription(self.starsMyPendingRatingDate)), ("mainTab", ConstructorParameterDescription(self.mainTab)), ("savedMusic", ConstructorParameterDescription(self.savedMusic)), ("note", ConstructorParameterDescription(self.note)), ("botManagerId", ConstructorParameterDescription(self.botManagerId))]) - } - } - case userFull(Cons_userFull) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .userFull(let _data): - if boxed { - buffer.appendInt32(114026053) - } - 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) - } - if Int(_data.flags2) & Int(1 << 25) != 0 { - serializeInt64(_data.botManagerId!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .userFull(let _data): - return ("userFull", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("about", ConstructorParameterDescription(_data.about)), ("settings", ConstructorParameterDescription(_data.settings)), ("personalPhoto", ConstructorParameterDescription(_data.personalPhoto)), ("profilePhoto", ConstructorParameterDescription(_data.profilePhoto)), ("fallbackPhoto", ConstructorParameterDescription(_data.fallbackPhoto)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings)), ("botInfo", ConstructorParameterDescription(_data.botInfo)), ("pinnedMsgId", ConstructorParameterDescription(_data.pinnedMsgId)), ("commonChatsCount", ConstructorParameterDescription(_data.commonChatsCount)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod)), ("theme", ConstructorParameterDescription(_data.theme)), ("privateForwardName", ConstructorParameterDescription(_data.privateForwardName)), ("botGroupAdminRights", ConstructorParameterDescription(_data.botGroupAdminRights)), ("botBroadcastAdminRights", ConstructorParameterDescription(_data.botBroadcastAdminRights)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper)), ("stories", ConstructorParameterDescription(_data.stories)), ("businessWorkHours", ConstructorParameterDescription(_data.businessWorkHours)), ("businessLocation", ConstructorParameterDescription(_data.businessLocation)), ("businessGreetingMessage", ConstructorParameterDescription(_data.businessGreetingMessage)), ("businessAwayMessage", ConstructorParameterDescription(_data.businessAwayMessage)), ("businessIntro", ConstructorParameterDescription(_data.businessIntro)), ("birthday", ConstructorParameterDescription(_data.birthday)), ("personalChannelId", ConstructorParameterDescription(_data.personalChannelId)), ("personalChannelMessage", ConstructorParameterDescription(_data.personalChannelMessage)), ("stargiftsCount", ConstructorParameterDescription(_data.stargiftsCount)), ("starrefProgram", ConstructorParameterDescription(_data.starrefProgram)), ("botVerification", ConstructorParameterDescription(_data.botVerification)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars)), ("disallowedGifts", ConstructorParameterDescription(_data.disallowedGifts)), ("starsRating", ConstructorParameterDescription(_data.starsRating)), ("starsMyPendingRating", ConstructorParameterDescription(_data.starsMyPendingRating)), ("starsMyPendingRatingDate", ConstructorParameterDescription(_data.starsMyPendingRatingDate)), ("mainTab", ConstructorParameterDescription(_data.mainTab)), ("savedMusic", ConstructorParameterDescription(_data.savedMusic)), ("note", ConstructorParameterDescription(_data.note)), ("botManagerId", ConstructorParameterDescription(_data.botManagerId))]) - } - } - - public static func parse_userFull(_ reader: BufferReader) -> UserFull? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = parseString(reader) - } - var _5: Api.PeerSettings? + var _2: Api.BotMenuButton? if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.PeerSettings + _2 = Api.parse(reader, signature: signature) as? Api.BotMenuButton } - var _6: Api.Photo? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 3) != 0 { - if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.BotInfo - } - } - var _11: Int32? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _11 = reader.readInt32() - } - var _12: Int32? - _12 = reader.readInt32() - var _13: Int32? - if Int(_1 ?? 0) & Int(1 << 11) != 0 { - _13 = reader.readInt32() - } - var _14: Int32? - if Int(_1 ?? 0) & Int(1 << 14) != 0 { - _14 = reader.readInt32() - } - var _15: Api.ChatTheme? - if Int(_1 ?? 0) & Int(1 << 15) != 0 { - if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.ChatTheme - } - } - var _16: String? - if Int(_1 ?? 0) & Int(1 << 16) != 0 { - _16 = parseString(reader) - } - var _17: Api.ChatAdminRights? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 5) != 0 { - if let signature = reader.readInt32() { - _26 = Api.parse(reader, signature: signature) as? Api.Birthday - } - } - var _27: Int64? - if Int(_2 ?? 0) & Int(1 << 6) != 0 { - _27 = reader.readInt64() - } - var _28: Int32? - if Int(_2 ?? 0) & Int(1 << 6) != 0 { - _28 = reader.readInt32() - } - var _29: Int32? - if Int(_2 ?? 0) & Int(1 << 8) != 0 { - _29 = reader.readInt32() - } - var _30: Api.StarRefProgram? - if Int(_2 ?? 0) & 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 ?? 0) & Int(1 << 12) != 0 { - if let signature = reader.readInt32() { - _31 = Api.parse(reader, signature: signature) as? Api.BotVerification - } - } - var _32: Int64? - if Int(_2 ?? 0) & Int(1 << 14) != 0 { - _32 = reader.readInt64() - } - var _33: Api.DisallowedGiftsSettings? - if Int(_2 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 18) != 0 { - if let signature = reader.readInt32() { - _35 = Api.parse(reader, signature: signature) as? Api.StarsRating - } - } - var _36: Int32? - if Int(_2 ?? 0) & Int(1 << 18) != 0 { - _36 = reader.readInt32() - } - var _37: Api.ProfileTab? - if Int(_2 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 22) != 0 { - if let signature = reader.readInt32() { - _39 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - } - var _40: Int64? - if Int(_2 ?? 0) & Int(1 << 25) != 0 { - _40 = reader.readInt64() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 21) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 22) == 0) || _8 != nil - let _c9 = _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _11 != nil - let _c12 = _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _15 != nil - let _c16 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _16 != nil - let _c17 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _17 != nil - let _c18 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _18 != nil - let _c19 = (Int(_1 ?? 0) & Int(1 << 24) == 0) || _19 != nil - let _c20 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _20 != nil - let _c21 = (Int(_2 ?? 0) & Int(1 << 0) == 0) || _21 != nil - let _c22 = (Int(_2 ?? 0) & Int(1 << 1) == 0) || _22 != nil - let _c23 = (Int(_2 ?? 0) & Int(1 << 2) == 0) || _23 != nil - let _c24 = (Int(_2 ?? 0) & Int(1 << 3) == 0) || _24 != nil - let _c25 = (Int(_2 ?? 0) & Int(1 << 4) == 0) || _25 != nil - let _c26 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _26 != nil - let _c27 = (Int(_2 ?? 0) & Int(1 << 6) == 0) || _27 != nil - let _c28 = (Int(_2 ?? 0) & Int(1 << 6) == 0) || _28 != nil - let _c29 = (Int(_2 ?? 0) & Int(1 << 8) == 0) || _29 != nil - let _c30 = (Int(_2 ?? 0) & Int(1 << 11) == 0) || _30 != nil - let _c31 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _31 != nil - let _c32 = (Int(_2 ?? 0) & Int(1 << 14) == 0) || _32 != nil - let _c33 = (Int(_2 ?? 0) & Int(1 << 15) == 0) || _33 != nil - let _c34 = (Int(_2 ?? 0) & Int(1 << 17) == 0) || _34 != nil - let _c35 = (Int(_2 ?? 0) & Int(1 << 18) == 0) || _35 != nil - let _c36 = (Int(_2 ?? 0) & Int(1 << 18) == 0) || _36 != nil - let _c37 = (Int(_2 ?? 0) & Int(1 << 20) == 0) || _37 != nil - let _c38 = (Int(_2 ?? 0) & Int(1 << 21) == 0) || _38 != nil - let _c39 = (Int(_2 ?? 0) & Int(1 << 22) == 0) || _39 != nil - let _c40 = (Int(_2 ?? 0) & Int(1 << 25) == 0) || _40 != 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 { - 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, botManagerId: _40)) - } - else { - return nil - } - } - } -} -public extension Api { - enum UserProfilePhoto: TypeConstructorDescription { - public class Cons_userProfilePhoto: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userProfilePhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photoId", ConstructorParameterDescription(self.photoId)), ("strippedThumb", ConstructorParameterDescription(self.strippedThumb)), ("dcId", ConstructorParameterDescription(self.dcId))]) - } - } - case userProfilePhoto(Cons_userProfilePhoto) - 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, ConstructorParameterDescription)]) { - switch self { - case .userProfilePhoto(let _data): - return ("userProfilePhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("strippedThumb", ConstructorParameterDescription(_data.strippedThumb)), ("dcId", ConstructorParameterDescription(_data.dcId))]) - 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 ?? 0) & Int(1 << 1) != 0 { - _3 = parseBytes(reader) - } - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.UserProfilePhoto.userProfilePhoto(Cons_userProfilePhoto(flags: _1!, photoId: _2!, strippedThumb: _3, dcId: _4!)) - } - else { - return nil - } - } - public static func parse_userProfilePhotoEmpty(_ reader: BufferReader) -> UserProfilePhoto? { - return Api.UserProfilePhoto.userProfilePhotoEmpty - } - } -} -public extension Api { - enum UserStatus: TypeConstructorDescription { - public class Cons_userStatusLastMonth: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userStatusLastMonth", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - public class Cons_userStatusLastWeek: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userStatusLastWeek", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - public class Cons_userStatusOffline: TypeConstructorDescription { - public var wasOnline: Int32 - public init(wasOnline: Int32) { - self.wasOnline = wasOnline - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userStatusOffline", [("wasOnline", ConstructorParameterDescription(self.wasOnline))]) - } - } - public class Cons_userStatusOnline: TypeConstructorDescription { - public var expires: Int32 - public init(expires: Int32) { - self.expires = expires - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userStatusOnline", [("expires", ConstructorParameterDescription(self.expires))]) - } - } - public class Cons_userStatusRecently: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userStatusRecently", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - 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, ConstructorParameterDescription)]) { - switch self { - case .userStatusEmpty: - return ("userStatusEmpty", []) - case .userStatusLastMonth(let _data): - return ("userStatusLastMonth", [("flags", ConstructorParameterDescription(_data.flags))]) - case .userStatusLastWeek(let _data): - return ("userStatusLastWeek", [("flags", ConstructorParameterDescription(_data.flags))]) - case .userStatusOffline(let _data): - return ("userStatusOffline", [("wasOnline", ConstructorParameterDescription(_data.wasOnline))]) - case .userStatusOnline(let _data): - return ("userStatusOnline", [("expires", ConstructorParameterDescription(_data.expires))]) - case .userStatusRecently(let _data): - return ("userStatusRecently", [("flags", ConstructorParameterDescription(_data.flags))]) - } - } - - public static func parse_userStatusEmpty(_ reader: BufferReader) -> UserStatus? { - return Api.UserStatus.userStatusEmpty - } - public static func parse_userStatusLastMonth(_ reader: BufferReader) -> UserStatus? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.UserStatus.userStatusLastMonth(Cons_userStatusLastMonth(flags: _1!)) - } - else { - return nil - } - } - public static func parse_userStatusLastWeek(_ reader: BufferReader) -> UserStatus? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.UserStatus.userStatusLastWeek(Cons_userStatusLastWeek(flags: _1!)) - } - else { - return nil - } - } - public static func parse_userStatusOffline(_ reader: BufferReader) -> UserStatus? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.UserStatus.userStatusOffline(Cons_userStatusOffline(wasOnline: _1!)) - } - else { - return nil - } - } - public static func parse_userStatusOnline(_ reader: BufferReader) -> UserStatus? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.UserStatus.userStatusOnline(Cons_userStatusOnline(expires: _1!)) - } - else { - return nil - } - } - public static func parse_userStatusRecently(_ reader: BufferReader) -> UserStatus? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.UserStatus.userStatusRecently(Cons_userStatusRecently(flags: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum Username: TypeConstructorDescription { - public class Cons_username: TypeConstructorDescription { - public var flags: Int32 - public var username: String - public init(flags: Int32, username: String) { - self.flags = flags - self.username = username - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("username", [("flags", ConstructorParameterDescription(self.flags)), ("username", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .username(let _data): - return ("username", [("flags", ConstructorParameterDescription(_data.flags)), ("username", ConstructorParameterDescription(_data.username))]) - } - } - - public static func parse_username(_ reader: BufferReader) -> Username? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.Username.username(Cons_username(flags: _1!, username: _2!)) + return Api.Update.updateBotMenuButton(Cons_updateBotMenuButton(botId: _1!, button: _2!)) } else { return nil } } - } -} -public extension Api { - enum VideoSize: TypeConstructorDescription { - public class Cons_videoSize: TypeConstructorDescription { - 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 static func parse_updateBotMessageReaction(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("videoSize", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("size", ConstructorParameterDescription(self.size)), ("videoStartTs", ConstructorParameterDescription(self.videoStartTs))]) - } - } - public class Cons_videoSizeEmojiMarkup: TypeConstructorDescription { - public var emojiId: Int64 - public var backgroundColors: [Int32] - public init(emojiId: Int64, backgroundColors: [Int32]) { - self.emojiId = emojiId - self.backgroundColors = backgroundColors - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("videoSizeEmojiMarkup", [("emojiId", ConstructorParameterDescription(self.emojiId)), ("backgroundColors", ConstructorParameterDescription(self.backgroundColors))]) - } - } - public class Cons_videoSizeStickerMarkup: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("videoSizeStickerMarkup", [("stickerset", ConstructorParameterDescription(self.stickerset)), ("stickerId", ConstructorParameterDescription(self.stickerId)), ("backgroundColors", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .videoSize(let _data): - return ("videoSize", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("size", ConstructorParameterDescription(_data.size)), ("videoStartTs", ConstructorParameterDescription(_data.videoStartTs))]) - case .videoSizeEmojiMarkup(let _data): - return ("videoSizeEmojiMarkup", [("emojiId", ConstructorParameterDescription(_data.emojiId)), ("backgroundColors", ConstructorParameterDescription(_data.backgroundColors))]) - case .videoSizeStickerMarkup(let _data): - return ("videoSizeStickerMarkup", [("stickerset", ConstructorParameterDescription(_data.stickerset)), ("stickerId", ConstructorParameterDescription(_data.stickerId)), ("backgroundColors", ConstructorParameterDescription(_data.backgroundColors))]) - } - } - - public static func parse_videoSize(_ reader: BufferReader) -> VideoSize? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() var _3: Int32? _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: Double? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = reader.readDouble() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.VideoSize.videoSize(Cons_videoSize(flags: _1!, type: _2!, w: _3!, h: _4!, size: _5!, videoStartTs: _6)) - } - else { - return nil - } - } - public static func parse_videoSizeEmojiMarkup(_ reader: BufferReader) -> VideoSize? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.VideoSize.videoSizeEmojiMarkup(Cons_videoSizeEmojiMarkup(emojiId: _1!, backgroundColors: _2!)) - } - else { - return nil - } - } - public static func parse_videoSizeStickerMarkup(_ reader: BufferReader) -> VideoSize? { - var _1: Api.InputStickerSet? + var _4: Api.Peer? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.InputStickerSet + _4 = Api.parse(reader, signature: signature) as? Api.Peer } - var _2: Int64? - _2 = reader.readInt64() - var _3: [Int32]? + var _5: [Api.Reaction]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Reaction.self) } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.VideoSize.videoSizeStickerMarkup(Cons_videoSizeStickerMarkup(stickerset: _1!, stickerId: _2!, backgroundColors: _3!)) + var _6: [Api.Reaction]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Reaction.self) } - else { - return nil - } - } - } -} -public extension Api { - enum WallPaper: TypeConstructorDescription { - public class Cons_wallPaper: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("wallPaper", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("slug", ConstructorParameterDescription(self.slug)), ("document", ConstructorParameterDescription(self.document)), ("settings", ConstructorParameterDescription(self.settings))]) - } - } - public class Cons_wallPaperNoFile: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("wallPaperNoFile", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags)), ("settings", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .wallPaper(let _data): - return ("wallPaper", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("slug", ConstructorParameterDescription(_data.slug)), ("document", ConstructorParameterDescription(_data.document)), ("settings", ConstructorParameterDescription(_data.settings))]) - case .wallPaperNoFile(let _data): - return ("wallPaperNoFile", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags)), ("settings", ConstructorParameterDescription(_data.settings))]) - } - } - - public static func parse_wallPaper(_ reader: BufferReader) -> WallPaper? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: Api.Document? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Document - } - var _6: Api.WallPaperSettings? - if Int(_2 ?? 0) & 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 - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_2 ?? 0) & Int(1 << 2) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.WallPaper.wallPaper(Cons_wallPaper(id: _1!, flags: _2!, accessHash: _3!, slug: _4!, document: _5!, settings: _6)) - } - else { - return nil - } - } - public static func parse_wallPaperNoFile(_ reader: BufferReader) -> WallPaper? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - var _3: Api.WallPaperSettings? - if Int(_2 ?? 0) & 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 ?? 0) & Int(1 << 2) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.WallPaper.wallPaperNoFile(Cons_wallPaperNoFile(id: _1!, flags: _2!, settings: _3)) - } - else { - return nil - } - } - } -} -public extension Api { - enum WallPaperSettings: TypeConstructorDescription { - public class Cons_wallPaperSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("wallPaperSettings", [("flags", ConstructorParameterDescription(self.flags)), ("backgroundColor", ConstructorParameterDescription(self.backgroundColor)), ("secondBackgroundColor", ConstructorParameterDescription(self.secondBackgroundColor)), ("thirdBackgroundColor", ConstructorParameterDescription(self.thirdBackgroundColor)), ("fourthBackgroundColor", ConstructorParameterDescription(self.fourthBackgroundColor)), ("intensity", ConstructorParameterDescription(self.intensity)), ("rotation", ConstructorParameterDescription(self.rotation)), ("emoticon", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .wallPaperSettings(let _data): - return ("wallPaperSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("backgroundColor", ConstructorParameterDescription(_data.backgroundColor)), ("secondBackgroundColor", ConstructorParameterDescription(_data.secondBackgroundColor)), ("thirdBackgroundColor", ConstructorParameterDescription(_data.thirdBackgroundColor)), ("fourthBackgroundColor", ConstructorParameterDescription(_data.fourthBackgroundColor)), ("intensity", ConstructorParameterDescription(_data.intensity)), ("rotation", ConstructorParameterDescription(_data.rotation)), ("emoticon", ConstructorParameterDescription(_data.emoticon))]) - } - } - - public static func parse_wallPaperSettings(_ reader: BufferReader) -> WallPaperSettings? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _4 = reader.readInt32() - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _6 = reader.readInt32() - } - var _7: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _7 = reader.readInt32() - } - var _8: String? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - _8 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 { - public class Cons_webAuthorization: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webAuthorization", [("hash", ConstructorParameterDescription(self.hash)), ("botId", ConstructorParameterDescription(self.botId)), ("domain", ConstructorParameterDescription(self.domain)), ("browser", ConstructorParameterDescription(self.browser)), ("platform", ConstructorParameterDescription(self.platform)), ("dateCreated", ConstructorParameterDescription(self.dateCreated)), ("dateActive", ConstructorParameterDescription(self.dateActive)), ("ip", ConstructorParameterDescription(self.ip)), ("region", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .webAuthorization(let _data): - return ("webAuthorization", [("hash", ConstructorParameterDescription(_data.hash)), ("botId", ConstructorParameterDescription(_data.botId)), ("domain", ConstructorParameterDescription(_data.domain)), ("browser", ConstructorParameterDescription(_data.browser)), ("platform", ConstructorParameterDescription(_data.platform)), ("dateCreated", ConstructorParameterDescription(_data.dateCreated)), ("dateActive", ConstructorParameterDescription(_data.dateActive)), ("ip", ConstructorParameterDescription(_data.ip)), ("region", ConstructorParameterDescription(_data.region))]) - } - } - - public static func parse_webAuthorization(_ reader: BufferReader) -> WebAuthorization? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Int32? - _6 = reader.readInt32() var _7: Int32? _7 = reader.readInt32() - var _8: String? - _8 = parseString(reader) - var _9: String? - _9 = parseString(reader) let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2293,414 +4913,330 @@ public extension Api { let _c5 = _5 != nil let _c6 = _6 != nil let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.WebAuthorization.webAuthorization(Cons_webAuthorization(hash: _1!, botId: _2!, domain: _3!, browser: _4!, platform: _5!, dateCreated: _6!, dateActive: _7!, ip: _8!, region: _9!)) + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.Update.updateBotMessageReaction(Cons_updateBotMessageReaction(peer: _1!, msgId: _2!, date: _3!, actor: _4!, oldReactions: _5!, newReactions: _6!, qts: _7!)) } else { return nil } } - } -} -public extension Api { - enum WebDocument: TypeConstructorDescription { - public class Cons_webDocument: TypeConstructorDescription { - 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 static func parse_updateBotMessageReactions(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webDocument", [("url", ConstructorParameterDescription(self.url)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("size", ConstructorParameterDescription(self.size)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("attributes", ConstructorParameterDescription(self.attributes))]) - } - } - public class Cons_webDocumentNoProxy: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webDocumentNoProxy", [("url", ConstructorParameterDescription(self.url)), ("size", ConstructorParameterDescription(self.size)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("attributes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .webDocument(let _data): - return ("webDocument", [("url", ConstructorParameterDescription(_data.url)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("attributes", ConstructorParameterDescription(_data.attributes))]) - case .webDocumentNoProxy(let _data): - return ("webDocumentNoProxy", [("url", ConstructorParameterDescription(_data.url)), ("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("attributes", ConstructorParameterDescription(_data.attributes))]) - } - } - - public static func parse_webDocument(_ reader: BufferReader) -> WebDocument? { - var _1: String? - _1 = parseString(reader) - var _2: Int64? - _2 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() var _3: Int32? _3 = reader.readInt32() - var _4: String? - _4 = parseString(reader) - var _5: [Api.DocumentAttribute]? + var _4: [Api.ReactionCount]? if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DocumentAttribute.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReactionCount.self) } + var _5: Int32? + _5 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.WebDocument.webDocument(Cons_webDocument(url: _1!, accessHash: _2!, size: _3!, mimeType: _4!, attributes: _5!)) + return Api.Update.updateBotMessageReactions(Cons_updateBotMessageReactions(peer: _1!, msgId: _2!, date: _3!, reactions: _4!, qts: _5!)) } else { return nil } } - public static func parse_webDocumentNoProxy(_ reader: BufferReader) -> WebDocument? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - var _4: [Api.DocumentAttribute]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DocumentAttribute.self) + public static func parse_updateBotNewBusinessMessage(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Api.Message? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Message + } + var _4: Api.Message? + if Int(_1 ?? 0) & 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 + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateBotNewBusinessMessage(Cons_updateBotNewBusinessMessage(flags: _1!, connectionId: _2!, message: _3!, replyToMessage: _4, qts: _5!)) + } + else { + return nil + } + } + public static func parse_updateBotPrecheckoutQuery(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Buffer? + _4 = parseBytes(reader) + var _5: Api.PaymentRequestedInfo? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _6 = parseString(reader) + } + var _7: String? + _7 = parseString(reader) + var _8: Int64? + _8 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_updateBotPurchasedPaidMedia(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: String? + _2 = parseString(reader) + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateBotPurchasedPaidMedia(Cons_updateBotPurchasedPaidMedia(userId: _1!, payload: _2!, qts: _3!)) + } + else { + return nil + } + } + public static func parse_updateBotShippingQuery(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: Buffer? + _3 = parseBytes(reader) + var _4: Api.PostAddress? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.PostAddress } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.WebDocument.webDocumentNoProxy(Cons_webDocumentNoProxy(url: _1!, size: _2!, mimeType: _3!, attributes: _4!)) + return Api.Update.updateBotShippingQuery(Cons_updateBotShippingQuery(queryId: _1!, userId: _2!, payload: _3!, shippingAddress: _4!)) } else { return nil } } - } -} -public extension Api { - enum WebPage: TypeConstructorDescription { - public class Cons_webPage: TypeConstructorDescription { - 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 static func parse_updateBotStopped(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.Bool? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("url", ConstructorParameterDescription(self.url)), ("displayUrl", ConstructorParameterDescription(self.displayUrl)), ("hash", ConstructorParameterDescription(self.hash)), ("type", ConstructorParameterDescription(self.type)), ("siteName", ConstructorParameterDescription(self.siteName)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("embedUrl", ConstructorParameterDescription(self.embedUrl)), ("embedType", ConstructorParameterDescription(self.embedType)), ("embedWidth", ConstructorParameterDescription(self.embedWidth)), ("embedHeight", ConstructorParameterDescription(self.embedHeight)), ("duration", ConstructorParameterDescription(self.duration)), ("author", ConstructorParameterDescription(self.author)), ("document", ConstructorParameterDescription(self.document)), ("cachedPage", ConstructorParameterDescription(self.cachedPage)), ("attributes", ConstructorParameterDescription(self.attributes))]) + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateBotStopped(Cons_updateBotStopped(userId: _1!, date: _2!, stopped: _3!, qts: _4!)) + } + else { + return nil } } - public class Cons_webPageEmpty: TypeConstructorDescription { - 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 static func parse_updateBotWebhookJSON(_ reader: BufferReader) -> Update? { + var _1: Api.DataJSON? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.DataJSON } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageEmpty", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("url", ConstructorParameterDescription(self.url))]) + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateBotWebhookJSON(Cons_updateBotWebhookJSON(data: _1!)) + } + else { + return nil } } - public class Cons_webPageNotModified: TypeConstructorDescription { - public var flags: Int32 - public var cachedPageViews: Int32? - public init(flags: Int32, cachedPageViews: Int32?) { - self.flags = flags - self.cachedPageViews = cachedPageViews + public static func parse_updateBotWebhookJSONQuery(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.DataJSON? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.DataJSON } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("cachedPageViews", ConstructorParameterDescription(self.cachedPageViews))]) + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateBotWebhookJSONQuery(Cons_updateBotWebhookJSONQuery(queryId: _1!, data: _2!, timeout: _3!)) + } + else { + return nil } } - public class Cons_webPagePending: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPagePending", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("url", ConstructorParameterDescription(self.url)), ("date", ConstructorParameterDescription(self.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 _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, ConstructorParameterDescription)]) { - switch self { - case .webPage(let _data): - return ("webPage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url)), ("displayUrl", ConstructorParameterDescription(_data.displayUrl)), ("hash", ConstructorParameterDescription(_data.hash)), ("type", ConstructorParameterDescription(_data.type)), ("siteName", ConstructorParameterDescription(_data.siteName)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("embedUrl", ConstructorParameterDescription(_data.embedUrl)), ("embedType", ConstructorParameterDescription(_data.embedType)), ("embedWidth", ConstructorParameterDescription(_data.embedWidth)), ("embedHeight", ConstructorParameterDescription(_data.embedHeight)), ("duration", ConstructorParameterDescription(_data.duration)), ("author", ConstructorParameterDescription(_data.author)), ("document", ConstructorParameterDescription(_data.document)), ("cachedPage", ConstructorParameterDescription(_data.cachedPage)), ("attributes", ConstructorParameterDescription(_data.attributes))]) - case .webPageEmpty(let _data): - return ("webPageEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url))]) - case .webPageNotModified(let _data): - return ("webPageNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("cachedPageViews", ConstructorParameterDescription(_data.cachedPageViews))]) - case .webPagePending(let _data): - return ("webPagePending", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url)), ("date", ConstructorParameterDescription(_data.date))]) - } - } - - public static func parse_webPage(_ reader: BufferReader) -> WebPage? { + public static func parse_updateBusinessBotCallbackQuery(_ reader: BufferReader) -> Update? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() var _4: String? _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() - var _6: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseString(reader) + var _5: Api.Message? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Message } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _7 = parseString(reader) - } - var _8: String? + var _6: Api.Message? if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _8 = parseString(reader) - } - var _9: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _9 = parseString(reader) - } - var _10: Api.Photo? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.Photo + _6 = Api.parse(reader, signature: signature) as? Api.Message } } - var _11: String? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _11 = parseString(reader) + var _7: Int64? + _7 = reader.readInt64() + var _8: Buffer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _8 = parseBytes(reader) } - var _12: String? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _12 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + return Api.Update.updateBusinessBotCallbackQuery(Cons_updateBusinessBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, connectionId: _4!, message: _5!, replyToMessage: _6, chatInstance: _7!, data: _8)) } - var _13: Int32? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _13 = reader.readInt32() + else { + return nil } - var _14: Int32? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _14 = reader.readInt32() + } + public static func parse_updateChannel(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateChannel(Cons_updateChannel(channelId: _1!)) } - var _15: Int32? - if Int(_1 ?? 0) & Int(1 << 7) != 0 { - _15 = reader.readInt32() + else { + return nil } - var _16: String? - if Int(_1 ?? 0) & Int(1 << 8) != 0 { - _16 = parseString(reader) + } + public static func parse_updateChannelAvailableMessages(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateChannelAvailableMessages(Cons_updateChannelAvailableMessages(channelId: _1!, availableMinId: _2!)) } - var _17: Api.Document? - if Int(_1 ?? 0) & Int(1 << 9) != 0 { + else { + return nil + } + } + public static func parse_updateChannelMessageForwards(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateChannelMessageForwards(Cons_updateChannelMessageForwards(channelId: _1!, id: _2!, forwards: _3!)) + } + else { + return nil + } + } + public static func parse_updateChannelMessageViews(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateChannelMessageViews(Cons_updateChannelMessageViews(channelId: _1!, id: _2!, views: _3!)) + } + else { + return nil + } + } + public static func parse_updateChannelParticipant(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int64? + _4 = reader.readInt64() + var _5: Int64? + _5 = reader.readInt64() + var _6: Api.ChannelParticipant? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.Document + _6 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant } } - var _18: Api.Page? - if Int(_1 ?? 0) & Int(1 << 10) != 0 { + var _7: Api.ChannelParticipant? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { if let signature = reader.readInt32() { - _18 = Api.parse(reader, signature: signature) as? Api.Page + _7 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant } } - var _19: [Api.WebPageAttribute]? - if Int(_1 ?? 0) & Int(1 << 12) != 0 { - if let _ = reader.readInt32() { - _19 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WebPageAttribute.self) + var _8: Api.ExportedChatInvite? + if Int(_1 ?? 0) & 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 let _c2 = _2 != nil let _c3 = _3 != nil @@ -2709,76 +5245,2314 @@ public extension Api { let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _14 != nil - let _c15 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _15 != nil - let _c16 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _16 != nil - let _c17 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _17 != nil - let _c18 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _18 != nil - let _c19 = (Int(_1 ?? 0) & 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(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)) + let _c9 = _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 } } - public static func parse_webPageEmpty(_ reader: BufferReader) -> WebPage? { + public static func parse_updateChannelReadMessagesContents(_ reader: BufferReader) -> Update? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() - var _3: String? + var _3: Int32? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) + _3 = reader.readInt32() + } + var _4: Api.Peer? + if Int(_1 ?? 0) & 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) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateChannelReadMessagesContents(Cons_updateChannelReadMessagesContents(flags: _1!, channelId: _2!, topMsgId: _3, savedPeerId: _4, messages: _5!)) + } + else { + return nil + } + } + public static func parse_updateChannelTooLong(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil if _c1 && _c2 && _c3 { - return Api.WebPage.webPageEmpty(Cons_webPageEmpty(flags: _1!, id: _2!, url: _3)) + return Api.Update.updateChannelTooLong(Cons_updateChannelTooLong(flags: _1!, channelId: _2!, pts: _3)) } else { return nil } } - public static func parse_webPageNotModified(_ reader: BufferReader) -> WebPage? { + public static func parse_updateChannelUserTyping(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + if Int(_1 ?? 0) & 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 + } + var _5: Api.SendMessageAction? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.SendMessageAction + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateChannelUserTyping(Cons_updateChannelUserTyping(flags: _1!, channelId: _2!, topMsgId: _3, fromId: _4!, action: _5!)) + } + else { + return nil + } + } + public static func parse_updateChannelViewForumAsMessages(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.Bool? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateChannelViewForumAsMessages(Cons_updateChannelViewForumAsMessages(channelId: _1!, enabled: _2!)) + } + else { + return nil + } + } + public static func parse_updateChannelWebPage(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.WebPage? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.WebPage + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateChannelWebPage(Cons_updateChannelWebPage(channelId: _1!, webpage: _2!, pts: _3!, ptsCount: _4!)) + } + else { + return nil + } + } + public static func parse_updateChat(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateChat(Cons_updateChat(chatId: _1!)) + } + else { + return nil + } + } + public static func parse_updateChatDefaultBannedRights(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Api.ChatBannedRights? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ChatBannedRights + } + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateChatDefaultBannedRights(Cons_updateChatDefaultBannedRights(peer: _1!, defaultBannedRights: _2!, version: _3!)) + } + else { + return nil + } + } + public static func parse_updateChatParticipant(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int64? + _4 = reader.readInt64() + var _5: Int64? + _5 = reader.readInt64() + var _6: Api.ChatParticipant? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil + let _c9 = _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 + } + } + public static func parse_updateChatParticipantAdd(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateChatParticipantAdd(Cons_updateChatParticipantAdd(chatId: _1!, userId: _2!, inviterId: _3!, date: _4!, version: _5!)) + } + else { + return nil + } + } + public static func parse_updateChatParticipantAdmin(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.Bool? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateChatParticipantAdmin(Cons_updateChatParticipantAdmin(chatId: _1!, userId: _2!, isAdmin: _3!, version: _4!)) + } + else { + return nil + } + } + public static func parse_updateChatParticipantDelete(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateChatParticipantDelete(Cons_updateChatParticipantDelete(chatId: _1!, userId: _2!, version: _3!)) + } + else { + return nil + } + } + public static func parse_updateChatParticipantRank(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateChatParticipantRank(Cons_updateChatParticipantRank(chatId: _1!, userId: _2!, rank: _3!, version: _4!)) + } + else { + return nil + } + } + public static func parse_updateChatParticipants(_ reader: BufferReader) -> Update? { + var _1: Api.ChatParticipants? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.ChatParticipants + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateChatParticipants(Cons_updateChatParticipants(participants: _1!)) + } + else { + return nil + } + } + public static func parse_updateChatUserTyping(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Api.SendMessageAction? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.SendMessageAction + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateChatUserTyping(Cons_updateChatUserTyping(chatId: _1!, fromId: _2!, action: _3!)) + } + else { + return nil + } + } + public static func parse_updateConfig(_ reader: BufferReader) -> Update? { + return Api.Update.updateConfig + } + public static func parse_updateContactsReset(_ reader: BufferReader) -> Update? { + return Api.Update.updateContactsReset + } + public static func parse_updateDcOptions(_ reader: BufferReader) -> Update? { + var _1: [Api.DcOption]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DcOption.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateDcOptions(Cons_updateDcOptions(dcOptions: _1!)) + } + else { + return nil + } + } + public static func parse_updateDeleteChannelMessages(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Int32]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateDeleteChannelMessages(Cons_updateDeleteChannelMessages(channelId: _1!, messages: _2!, pts: _3!, ptsCount: _4!)) + } + else { + return nil + } + } + public static func parse_updateDeleteGroupCallMessages(_ reader: BufferReader) -> Update? { + var _1: Api.InputGroupCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + var _2: [Int32]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateDeleteGroupCallMessages(Cons_updateDeleteGroupCallMessages(call: _1!, messages: _2!)) + } + else { + return nil + } + } + public static func parse_updateDeleteMessages(_ reader: BufferReader) -> Update? { + var _1: [Int32]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateDeleteMessages(Cons_updateDeleteMessages(messages: _1!, pts: _2!, ptsCount: _3!)) + } + else { + return nil + } + } + public static func parse_updateDeleteQuickReply(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateDeleteQuickReply(Cons_updateDeleteQuickReply(shortcutId: _1!)) + } + else { + return nil + } + } + public static func parse_updateDeleteQuickReplyMessages(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Int32]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateDeleteQuickReplyMessages(Cons_updateDeleteQuickReplyMessages(shortcutId: _1!, messages: _2!)) + } + else { + return nil + } + } + public static func parse_updateDeleteScheduledMessages(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: [Int32]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _4: [Int32]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateDeleteScheduledMessages(Cons_updateDeleteScheduledMessages(flags: _1!, peer: _2!, messages: _3!, sentMessages: _4)) + } + else { + return nil + } + } + public static func parse_updateDialogFilter(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.DialogFilter? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateDialogFilter(Cons_updateDialogFilter(flags: _1!, id: _2!, filter: _3)) + } + else { + return nil + } + } + public static func parse_updateDialogFilterOrder(_ reader: BufferReader) -> Update? { + var _1: [Int32]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateDialogFilterOrder(Cons_updateDialogFilterOrder(order: _1!)) + } + else { + return nil + } + } + public static func parse_updateDialogFilters(_ reader: BufferReader) -> Update? { + return Api.Update.updateDialogFilters + } + public static func parse_updateDialogPinned(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & 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 + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateDialogPinned(Cons_updateDialogPinned(flags: _1!, folderId: _2, peer: _3!)) + } + else { + return nil + } + } + public static func parse_updateDialogUnreadMark(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.DialogPeer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.DialogPeer + } + var _3: Api.Peer? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateDialogUnreadMark(Cons_updateDialogUnreadMark(flags: _1!, peer: _2!, savedPeerId: _3)) + } + else { + return nil + } + } + public static func parse_updateDraftMessage(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: Api.Peer? + if Int(_1 ?? 0) & 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 + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateDraftMessage(Cons_updateDraftMessage(flags: _1!, peer: _2!, topMsgId: _3, savedPeerId: _4, draft: _5!)) + } + else { + return nil + } + } + public static func parse_updateEditChannelMessage(_ reader: BufferReader) -> Update? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateEditChannelMessage(Cons_updateEditChannelMessage(message: _1!, pts: _2!, ptsCount: _3!)) + } + else { + return nil + } + } + public static func parse_updateEditMessage(_ reader: BufferReader) -> Update? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateEditMessage(Cons_updateEditMessage(message: _1!, pts: _2!, ptsCount: _3!)) + } + else { + return nil + } + } + public static func parse_updateEmojiGameInfo(_ reader: BufferReader) -> Update? { + var _1: Api.messages.EmojiGameInfo? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.messages.EmojiGameInfo + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateEmojiGameInfo(Cons_updateEmojiGameInfo(info: _1!)) + } + else { + return nil + } + } + public static func parse_updateEncryptedChatTyping(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateEncryptedChatTyping(Cons_updateEncryptedChatTyping(chatId: _1!)) + } + else { + return nil + } + } + public static func parse_updateEncryptedMessagesRead(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateEncryptedMessagesRead(Cons_updateEncryptedMessagesRead(chatId: _1!, maxDate: _2!, date: _3!)) + } + else { + return nil + } + } + public static func parse_updateEncryption(_ reader: BufferReader) -> Update? { + var _1: Api.EncryptedChat? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.EncryptedChat + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateEncryption(Cons_updateEncryption(chat: _1!, date: _2!)) + } + else { + return nil + } + } + public static func parse_updateFavedStickers(_ reader: BufferReader) -> Update? { + return Api.Update.updateFavedStickers + } + public static func parse_updateFolderPeers(_ reader: BufferReader) -> Update? { + var _1: [Api.FolderPeer]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FolderPeer.self) + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateFolderPeers(Cons_updateFolderPeers(folderPeers: _1!, pts: _2!, ptsCount: _3!)) + } + else { + return nil + } + } + public static func parse_updateGeoLiveViewed(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateGeoLiveViewed(Cons_updateGeoLiveViewed(peer: _1!, msgId: _2!)) + } + else { + return nil + } + } + public static func parse_updateGroupCall(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & 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 + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateGroupCall(Cons_updateGroupCall(flags: _1!, peer: _2, call: _3!)) + } + else { + return nil + } + } + public static func parse_updateGroupCallChainBlocks(_ reader: BufferReader) -> Update? { + var _1: Api.InputGroupCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + var _2: Int32? + _2 = reader.readInt32() + var _3: [Buffer]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) + } + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateGroupCallChainBlocks(Cons_updateGroupCallChainBlocks(call: _1!, subChainId: _2!, blocks: _3!, nextOffset: _4!)) + } + else { + return nil + } + } + public static func parse_updateGroupCallConnection(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.DataJSON? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateGroupCallConnection(Cons_updateGroupCallConnection(flags: _1!, params: _2!)) + } + else { + return nil + } + } + public static func parse_updateGroupCallEncryptedMessage(_ reader: BufferReader) -> Update? { + var _1: Api.InputGroupCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Buffer? + _3 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateGroupCallEncryptedMessage(Cons_updateGroupCallEncryptedMessage(call: _1!, fromId: _2!, encryptedMessage: _3!)) + } + else { + return nil + } + } + public static func parse_updateGroupCallMessage(_ reader: BufferReader) -> Update? { + var _1: Api.InputGroupCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + var _2: Api.GroupCallMessage? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.GroupCallMessage + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateGroupCallMessage(Cons_updateGroupCallMessage(call: _1!, message: _2!)) + } + else { + return nil + } + } + public static func parse_updateGroupCallParticipants(_ reader: BufferReader) -> Update? { + var _1: Api.InputGroupCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.InputGroupCall + } + var _2: [Api.GroupCallParticipant]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) + } + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateGroupCallParticipants(Cons_updateGroupCallParticipants(call: _1!, participants: _2!, version: _3!)) + } + else { + return nil + } + } + public static func parse_updateInlineBotCallbackQuery(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: Api.InputBotInlineMessageID? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID + } + var _5: Int64? + _5 = reader.readInt64() + var _6: Buffer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = parseBytes(reader) + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.Update.updateInlineBotCallbackQuery(Cons_updateInlineBotCallbackQuery(flags: _1!, queryId: _2!, userId: _3!, msgId: _4!, chatInstance: _5!, data: _6, gameShortName: _7)) + } + else { + return nil + } + } + public static func parse_updateJoinChatWebViewDecision(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.JoinChatBotResult? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.JoinChatBotResult + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateJoinChatWebViewDecision(Cons_updateJoinChatWebViewDecision(peer: _1!, queryId: _2!, result: _3!)) + } + else { + return nil + } + } + public static func parse_updateLangPack(_ reader: BufferReader) -> Update? { + var _1: Api.LangPackDifference? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.LangPackDifference + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateLangPack(Cons_updateLangPack(difference: _1!)) + } + else { + return nil + } + } + public static func parse_updateLangPackTooLong(_ reader: BufferReader) -> Update? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateLangPackTooLong(Cons_updateLangPackTooLong(langCode: _1!)) + } + else { + return nil + } + } + public static func parse_updateLoginToken(_ reader: BufferReader) -> Update? { + return Api.Update.updateLoginToken + } + public static func parse_updateManagedBot(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateManagedBot(Cons_updateManagedBot(userId: _1!, botId: _2!, qts: _3!)) + } + else { + return nil + } + } + public static func parse_updateMessageExtendedMedia(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.MessageExtendedMedia]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageExtendedMedia.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateMessageExtendedMedia(Cons_updateMessageExtendedMedia(peer: _1!, msgId: _2!, extendedMedia: _3!)) + } + else { + return nil + } + } + public static func parse_updateMessageID(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateMessageID(Cons_updateMessageID(id: _1!, randomId: _2!)) + } + else { + return nil + } + } + public static func parse_updateMessagePoll(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } + var _5: Int64? + _5 = reader.readInt64() + var _6: Api.Poll? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Poll + } + } + var _7: Api.PollResults? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.PollResults + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.Update.updateMessagePoll(Cons_updateMessagePoll(flags: _1!, peer: _2, msgId: _3, topMsgId: _4, pollId: _5!, poll: _6, results: _7!)) + } + else { + return nil + } + } + public static func parse_updateMessagePollVote(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: [Buffer]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: Buffer.self) + } + var _4: [Int32]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateMessagePollVote(Cons_updateMessagePollVote(pollId: _1!, peer: _2!, options: _3!, positions: _4!, qts: _5!)) + } + else { + return nil + } + } + public static func parse_updateMessageReactions(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } + var _5: Api.Peer? + if Int(_1 ?? 0) & 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 + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.Update.updateMessageReactions(Cons_updateMessageReactions(flags: _1!, peer: _2!, msgId: _3!, topMsgId: _4, savedPeerId: _5, reactions: _6!)) + } + else { + return nil + } + } + public static func parse_updateMonoForumNoPaidException(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Api.Peer? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateMonoForumNoPaidException(Cons_updateMonoForumNoPaidException(flags: _1!, channelId: _2!, savedPeerId: _3!)) + } + else { + return nil + } + } + public static func parse_updateMoveStickerSetToTop(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateMoveStickerSetToTop(Cons_updateMoveStickerSetToTop(flags: _1!, stickerset: _2!)) + } + else { + return nil + } + } + public static func parse_updateNewAuthorization(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateNewAuthorization(Cons_updateNewAuthorization(flags: _1!, hash: _2!, date: _3, device: _4, location: _5)) + } + else { + return nil + } + } + public static func parse_updateNewBotConnection(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateNewBotConnection(Cons_updateNewBotConnection(flags: _1!, botId: _2!, date: _3, device: _4, location: _5)) + } + else { + return nil + } + } + public static func parse_updateNewChannelMessage(_ reader: BufferReader) -> Update? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateNewChannelMessage(Cons_updateNewChannelMessage(message: _1!, pts: _2!, ptsCount: _3!)) + } + else { + return nil + } + } + public static func parse_updateNewEncryptedMessage(_ reader: BufferReader) -> Update? { + var _1: Api.EncryptedMessage? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.EncryptedMessage + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateNewEncryptedMessage(Cons_updateNewEncryptedMessage(message: _1!, qts: _2!)) + } + else { + return nil + } + } + public static func parse_updateNewMessage(_ reader: BufferReader) -> Update? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateNewMessage(Cons_updateNewMessage(message: _1!, pts: _2!, ptsCount: _3!)) + } + else { + return nil + } + } + public static func parse_updateNewQuickReply(_ reader: BufferReader) -> Update? { + var _1: Api.QuickReply? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.QuickReply + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateNewQuickReply(Cons_updateNewQuickReply(quickReply: _1!)) + } + else { + return nil + } + } + public static func parse_updateNewScheduledMessage(_ reader: BufferReader) -> Update? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateNewScheduledMessage(Cons_updateNewScheduledMessage(message: _1!)) + } + else { + return nil + } + } + public static func parse_updateNewStickerSet(_ reader: BufferReader) -> Update? { + var _1: Api.messages.StickerSet? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.messages.StickerSet + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateNewStickerSet(Cons_updateNewStickerSet(stickerset: _1!)) + } + else { + return nil + } + } + public static func parse_updateNewStoryReaction(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Api.Reaction? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Reaction + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateNewStoryReaction(Cons_updateNewStoryReaction(storyId: _1!, peer: _2!, reaction: _3!)) + } + else { + return nil + } + } + public static func parse_updateNotifySettings(_ reader: BufferReader) -> Update? { + var _1: Api.NotifyPeer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.NotifyPeer + } + var _2: Api.PeerNotifySettings? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PeerNotifySettings + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateNotifySettings(Cons_updateNotifySettings(peer: _1!, notifySettings: _2!)) + } + else { + return nil + } + } + public static func parse_updatePaidReactionPrivacy(_ reader: BufferReader) -> Update? { + var _1: Api.PaidReactionPrivacy? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PaidReactionPrivacy + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updatePaidReactionPrivacy(Cons_updatePaidReactionPrivacy(private: _1!)) + } + else { + return nil + } + } + public static func parse_updatePeerBlocked(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updatePeerBlocked(Cons_updatePeerBlocked(flags: _1!, peerId: _2!)) + } + else { + return nil + } + } + public static func parse_updatePeerHistoryTTL(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updatePeerHistoryTTL(Cons_updatePeerHistoryTTL(flags: _1!, peer: _2!, ttlPeriod: _3)) + } + else { + return nil + } + } + public static func parse_updatePeerLocated(_ reader: BufferReader) -> Update? { + var _1: [Api.PeerLocated]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerLocated.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updatePeerLocated(Cons_updatePeerLocated(peers: _1!)) + } + else { + return nil + } + } + public static func parse_updatePeerSettings(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Api.PeerSettings? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PeerSettings + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updatePeerSettings(Cons_updatePeerSettings(peer: _1!, settings: _2!)) + } + else { + return nil + } + } + public static func parse_updatePeerWallpaper(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Api.WallPaper? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updatePeerWallpaper(Cons_updatePeerWallpaper(flags: _1!, peer: _2!, wallpaper: _3)) + } + else { + return nil + } + } + public static func parse_updatePendingJoinRequests(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + var _3: [Int64]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updatePendingJoinRequests(Cons_updatePendingJoinRequests(peer: _1!, requestsPending: _2!, recentRequesters: _3!)) + } + else { + return nil + } + } + public static func parse_updatePhoneCall(_ reader: BufferReader) -> Update? { + var _1: Api.PhoneCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PhoneCall + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updatePhoneCall(Cons_updatePhoneCall(phoneCall: _1!)) + } + else { + return nil + } + } + public static func parse_updatePhoneCallSignalingData(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updatePhoneCallSignalingData(Cons_updatePhoneCallSignalingData(phoneCallId: _1!, data: _2!)) + } + else { + return nil + } + } + public static func parse_updatePinnedChannelMessages(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: [Int32]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updatePinnedChannelMessages(Cons_updatePinnedChannelMessages(flags: _1!, channelId: _2!, messages: _3!, pts: _4!, ptsCount: _5!)) + } + else { + return nil + } + } + public static func parse_updatePinnedDialogs(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } + var _3: [Api.DialogPeer]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updatePinnedDialogs(Cons_updatePinnedDialogs(flags: _1!, folderId: _2, order: _3)) + } + else { + return nil + } + } + public static func parse_updatePinnedForumTopic(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + 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 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updatePinnedForumTopic(Cons_updatePinnedForumTopic(flags: _1!, peer: _2!, topicId: _3!)) + } + else { + return nil + } + } + public static func parse_updatePinnedForumTopics(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: [Int32]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updatePinnedForumTopics(Cons_updatePinnedForumTopics(flags: _1!, peer: _2!, order: _3)) + } + else { + return nil + } + } + public static func parse_updatePinnedMessages(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: [Int32]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updatePinnedMessages(Cons_updatePinnedMessages(flags: _1!, peer: _2!, messages: _3!, pts: _4!, ptsCount: _5!)) + } + else { + return nil + } + } + public static func parse_updatePinnedSavedDialogs(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.DialogPeer]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.Update.updatePinnedSavedDialogs(Cons_updatePinnedSavedDialogs(flags: _1!, order: _2)) + } + else { + return nil + } + } + public static func parse_updatePrivacy(_ reader: BufferReader) -> Update? { + var _1: Api.PrivacyKey? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PrivacyKey + } + var _2: [Api.PrivacyRule]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updatePrivacy(Cons_updatePrivacy(key: _1!, rules: _2!)) + } + else { + return nil + } + } + public static func parse_updatePtsChanged(_ reader: BufferReader) -> Update? { + return Api.Update.updatePtsChanged + } + public static func parse_updateQuickReplies(_ reader: BufferReader) -> Update? { + var _1: [Api.QuickReply]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.QuickReply.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateQuickReplies(Cons_updateQuickReplies(quickReplies: _1!)) + } + else { + return nil + } + } + public static func parse_updateQuickReplyMessage(_ reader: BufferReader) -> Update? { + var _1: Api.Message? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Message + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateQuickReplyMessage(Cons_updateQuickReplyMessage(message: _1!)) + } + else { + return nil + } + } + public static func parse_updateReadChannelDiscussionInbox(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _5 = reader.readInt64() + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.Update.updateReadChannelDiscussionInbox(Cons_updateReadChannelDiscussionInbox(flags: _1!, channelId: _2!, topMsgId: _3!, readMaxId: _4!, broadcastId: _5, broadcastPost: _6)) + } + else { + return nil + } + } + public static func parse_updateReadChannelDiscussionOutbox(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateReadChannelDiscussionOutbox(Cons_updateReadChannelDiscussionOutbox(channelId: _1!, topMsgId: _2!, readMaxId: _3!)) + } + else { + return nil + } + } + public static func parse_updateReadChannelInbox(_ reader: BufferReader) -> Update? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? if Int(_1 ?? 0) & Int(1 << 0) != 0 { _2 = reader.readInt32() } + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() let _c1 = _1 != nil let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.WebPage.webPageNotModified(Cons_webPageNotModified(flags: _1!, cachedPageViews: _2)) + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.Update.updateReadChannelInbox(Cons_updateReadChannelInbox(flags: _1!, folderId: _2, channelId: _3!, maxId: _4!, stillUnreadCount: _5!, pts: _6!)) } else { return nil } } - public static func parse_webPagePending(_ reader: BufferReader) -> WebPage? { + public static func parse_updateReadChannelOutbox(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateReadChannelOutbox(Cons_updateReadChannelOutbox(channelId: _1!, maxId: _2!)) + } + else { + return nil + } + } + public static func parse_updateReadFeaturedEmojiStickers(_ reader: BufferReader) -> Update? { + return Api.Update.updateReadFeaturedEmojiStickers + } + public static func parse_updateReadFeaturedStickers(_ reader: BufferReader) -> Update? { + return Api.Update.updateReadFeaturedStickers + } + public static func parse_updateReadHistoryInbox(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: Int32? + _7 = reader.readInt32() + var _8: Int32? + _8 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_updateReadHistoryOutbox(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateReadHistoryOutbox(Cons_updateReadHistoryOutbox(peer: _1!, maxId: _2!, pts: _3!, ptsCount: _4!)) + } + else { + return nil + } + } + public static func parse_updateReadMessagesContents(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Int32]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateReadMessagesContents(Cons_updateReadMessagesContents(flags: _1!, messages: _2!, pts: _3!, ptsCount: _4!, date: _5)) + } + else { + return nil + } + } + public static func parse_updateReadMonoForumInbox(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.Peer? + 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 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateReadMonoForumInbox(Cons_updateReadMonoForumInbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!)) + } + else { + return nil + } + } + public static func parse_updateReadMonoForumOutbox(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.Peer? + 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 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateReadMonoForumOutbox(Cons_updateReadMonoForumOutbox(channelId: _1!, savedPeerId: _2!, readMaxId: _3!)) + } + else { + return nil + } + } + public static func parse_updateReadStories(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateReadStories(Cons_updateReadStories(peer: _1!, maxId: _2!)) + } + else { + return nil + } + } + public static func parse_updateRecentEmojiStatuses(_ reader: BufferReader) -> Update? { + return Api.Update.updateRecentEmojiStatuses + } + public static func parse_updateRecentReactions(_ reader: BufferReader) -> Update? { + return Api.Update.updateRecentReactions + } + public static func parse_updateRecentStickers(_ reader: BufferReader) -> Update? { + return Api.Update.updateRecentStickers + } + public static func parse_updateSavedDialogPinned(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.DialogPeer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.DialogPeer + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateSavedDialogPinned(Cons_updateSavedDialogPinned(flags: _1!, peer: _2!)) + } + else { + return nil + } + } + public static func parse_updateSavedGifs(_ reader: BufferReader) -> Update? { + return Api.Update.updateSavedGifs + } + public static func parse_updateSavedReactionTags(_ reader: BufferReader) -> Update? { + return Api.Update.updateSavedReactionTags + } + public static func parse_updateSavedRingtones(_ reader: BufferReader) -> Update? { + return Api.Update.updateSavedRingtones + } + public static func parse_updateSentPhoneCode(_ reader: BufferReader) -> Update? { + var _1: Api.auth.SentCode? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateSentPhoneCode(Cons_updateSentPhoneCode(sentCode: _1!)) + } + else { + return nil + } + } + public static func parse_updateSentStoryReaction(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.Reaction? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Reaction + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateSentStoryReaction(Cons_updateSentStoryReaction(peer: _1!, storyId: _2!, reaction: _3!)) + } + else { + return nil + } + } + public static func parse_updateServiceNotification(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: Api.MessageMedia? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + var _6: [Api.MessageEntity]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.Update.updateServiceNotification(Cons_updateServiceNotification(flags: _1!, inboxDate: _2, type: _3!, message: _4!, media: _5!, entities: _6!)) + } + else { + return nil + } + } + public static func parse_updateSmsJob(_ reader: BufferReader) -> Update? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateSmsJob(Cons_updateSmsJob(jobId: _1!)) + } + else { + return nil + } + } + public static func parse_updateStarGiftAuctionState(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.StarGiftAuctionState? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionState + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateStarGiftAuctionState(Cons_updateStarGiftAuctionState(giftId: _1!, state: _2!)) + } + else { + return nil + } + } + public static func parse_updateStarGiftAuctionUserState(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.StarGiftAuctionUserState? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionUserState + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateStarGiftAuctionUserState(Cons_updateStarGiftAuctionUserState(giftId: _1!, userState: _2!)) + } + else { + return nil + } + } + public static func parse_updateStarGiftCraftFail(_ reader: BufferReader) -> Update? { + return Api.Update.updateStarGiftCraftFail + } + public static func parse_updateStarsBalance(_ reader: BufferReader) -> Update? { + var _1: Api.StarsAmount? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateStarsBalance(Cons_updateStarsBalance(balance: _1!)) + } + else { + return nil + } + } + public static func parse_updateStarsRevenueStatus(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Api.StarsRevenueStatus? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarsRevenueStatus + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateStarsRevenueStatus(Cons_updateStarsRevenueStatus(peer: _1!, status: _2!)) + } + else { + return nil + } + } + public static func parse_updateStickerSets(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateStickerSets(Cons_updateStickerSets(flags: _1!)) + } + else { + return nil + } + } + public static func parse_updateStickerSetsOrder(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Int64]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateStickerSetsOrder(Cons_updateStickerSetsOrder(flags: _1!, order: _2!)) + } + else { + return nil + } + } + public static func parse_updateStoriesStealthMode(_ reader: BufferReader) -> Update? { + var _1: Api.StoriesStealthMode? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StoriesStealthMode + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateStoriesStealthMode(Cons_updateStoriesStealthMode(stealthMode: _1!)) + } + else { + return nil + } + } + public static func parse_updateStory(_ reader: BufferReader) -> Update? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: Api.StoryItem? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StoryItem + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateStory(Cons_updateStory(peer: _1!, story: _2!)) + } + else { + return nil + } + } + public static func parse_updateStoryID(_ reader: BufferReader) -> Update? { var _1: Int32? _1 = reader.readInt32() var _2: Int64? _2 = reader.readInt64() - var _3: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateStoryID(Cons_updateStoryID(id: _1!, randomId: _2!)) + } + else { + return nil + } + } + public static func parse_updateTheme(_ reader: BufferReader) -> Update? { + var _1: Api.Theme? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Theme + } + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateTheme(Cons_updateTheme(theme: _1!)) + } + else { + return nil + } + } + public static func parse_updateTranscribedAudio(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Int64? + _4 = reader.readInt64() + var _5: String? + _5 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Update.updateTranscribedAudio(Cons_updateTranscribedAudio(flags: _1!, peer: _2!, msgId: _3!, transcriptionId: _4!, text: _5!)) + } + else { + return nil + } + } + public static func parse_updateUser(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateUser(Cons_updateUser(userId: _1!)) + } + else { + return nil + } + } + public static func parse_updateUserEmojiStatus(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.EmojiStatus? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.EmojiStatus + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateUserEmojiStatus(Cons_updateUserEmojiStatus(userId: _1!, emojiStatus: _2!)) + } + else { + return nil + } + } + public static func parse_updateUserName(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: [Api.Username]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Username.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.Update.updateUserName(Cons_updateUserName(userId: _1!, firstName: _2!, lastName: _3!, usernames: _4!)) + } + else { + return nil + } + } + public static func parse_updateUserPhone(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateUserPhone(Cons_updateUserPhone(userId: _1!, phone: _2!)) + } + else { + return nil + } + } + public static func parse_updateUserStatus(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.UserStatus? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.UserStatus + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Update.updateUserStatus(Cons_updateUserStatus(userId: _1!, status: _2!)) + } + else { + return nil + } + } + public static func parse_updateUserTyping(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + if Int(_1 ?? 0) & 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 } - var _4: Int32? - _4 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.WebPage.webPagePending(Cons_webPagePending(flags: _1!, id: _2!, url: _3, date: _4!)) + return Api.Update.updateUserTyping(Cons_updateUserTyping(flags: _1!, userId: _2!, topMsgId: _3, action: _4!)) + } + else { + return nil + } + } + public static func parse_updateWebBrowserException(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Bool? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } + var _3: Api.WebDomainException? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.WebDomainException + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateWebBrowserException(Cons_updateWebBrowserException(flags: _1!, openExternalBrowser: _2, exception: _3!)) + } + else { + return nil + } + } + public static func parse_updateWebBrowserSettings(_ reader: BufferReader) -> Update? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateWebBrowserSettings(Cons_updateWebBrowserSettings(flags: _1!)) + } + else { + return nil + } + } + public static func parse_updateWebPage(_ reader: BufferReader) -> Update? { + var _1: Api.WebPage? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.WebPage + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.Update.updateWebPage(Cons_updateWebPage(webpage: _1!, pts: _2!, ptsCount: _3!)) + } + else { + return nil + } + } + public static func parse_updateWebViewResultSent(_ reader: BufferReader) -> Update? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.Update.updateWebViewResultSent(Cons_updateWebViewResultSent(queryId: _1!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api30.swift b/submodules/TelegramApi/Sources/Api30.swift index 4e8f33efba..638cfb804c 100644 --- a/submodules/TelegramApi/Sources/Api30.swift +++ b/submodules/TelegramApi/Sources/Api30.swift @@ -1,462 +1,249 @@ public extension Api { - indirect enum WebPageAttribute: TypeConstructorDescription { - public class Cons_webPageAttributeAiComposeTone: TypeConstructorDescription { - public var emojiId: Int64 - public init(emojiId: Int64) { - self.emojiId = emojiId + indirect enum Updates: TypeConstructorDescription { + public class Cons_updateShort: TypeConstructorDescription { + public var update: Api.Update + public var date: Int32 + public init(update: Api.Update, date: Int32) { + self.update = update + self.date = date } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageAttributeAiComposeTone", [("emojiId", ConstructorParameterDescription(self.emojiId))]) + return ("updateShort", [("update", ConstructorParameterDescription(self.update)), ("date", ConstructorParameterDescription(self.date))]) } } - public class Cons_webPageAttributeStarGiftAuction: TypeConstructorDescription { - public var gift: Api.StarGift - public var endDate: Int32 - public init(gift: Api.StarGift, endDate: Int32) { - self.gift = gift - self.endDate = endDate - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageAttributeStarGiftAuction", [("gift", ConstructorParameterDescription(self.gift)), ("endDate", ConstructorParameterDescription(self.endDate))]) - } - } - public class Cons_webPageAttributeStarGiftCollection: TypeConstructorDescription { - public var icons: [Api.Document] - public init(icons: [Api.Document]) { - self.icons = icons - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageAttributeStarGiftCollection", [("icons", ConstructorParameterDescription(self.icons))]) - } - } - public class Cons_webPageAttributeStickerSet: TypeConstructorDescription { + public class Cons_updateShortChatMessage: TypeConstructorDescription { public var flags: Int32 - public var stickers: [Api.Document] - public init(flags: Int32, stickers: [Api.Document]) { - self.flags = flags - self.stickers = stickers - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageAttributeStickerSet", [("flags", ConstructorParameterDescription(self.flags)), ("stickers", ConstructorParameterDescription(self.stickers))]) - } - } - public class Cons_webPageAttributeStory: TypeConstructorDescription { - 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?) { + 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.peer = peer self.id = id - self.story = story + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageAttributeStory", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("id", ConstructorParameterDescription(self.id)), ("story", ConstructorParameterDescription(self.story))]) + return ("updateShortChatMessage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("fromId", ConstructorParameterDescription(self.fromId)), ("chatId", ConstructorParameterDescription(self.chatId)), ("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("viaBotId", ConstructorParameterDescription(self.viaBotId)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("entities", ConstructorParameterDescription(self.entities)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) } } - public class Cons_webPageAttributeTheme: TypeConstructorDescription { + public class Cons_updateShortMessage: TypeConstructorDescription { public var flags: Int32 - public var documents: [Api.Document]? - public var settings: Api.ThemeSettings? - public init(flags: Int32, documents: [Api.Document]?, settings: Api.ThemeSettings?) { + 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.documents = documents - self.settings = settings + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageAttributeTheme", [("flags", ConstructorParameterDescription(self.flags)), ("documents", ConstructorParameterDescription(self.documents)), ("settings", ConstructorParameterDescription(self.settings))]) + return ("updateShortMessage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("userId", ConstructorParameterDescription(self.userId)), ("message", ConstructorParameterDescription(self.message)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date)), ("fwdFrom", ConstructorParameterDescription(self.fwdFrom)), ("viaBotId", ConstructorParameterDescription(self.viaBotId)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("entities", ConstructorParameterDescription(self.entities)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) } } - public class Cons_webPageAttributeUniqueStarGift: TypeConstructorDescription { - public var gift: Api.StarGift - public init(gift: Api.StarGift) { - self.gift = gift + public class Cons_updateShortSentMessage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPageAttributeUniqueStarGift", [("gift", ConstructorParameterDescription(self.gift))]) + return ("updateShortSentMessage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("date", ConstructorParameterDescription(self.date)), ("media", ConstructorParameterDescription(self.media)), ("entities", ConstructorParameterDescription(self.entities)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) } } - case webPageAttributeAiComposeTone(Cons_webPageAttributeAiComposeTone) - 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 class Cons_updates: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updates", [("updates", ConstructorParameterDescription(self.updates)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats)), ("date", ConstructorParameterDescription(self.date)), ("seq", ConstructorParameterDescription(self.seq))]) + } + } + public class Cons_updatesCombined: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatesCombined", [("updates", ConstructorParameterDescription(self.updates)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats)), ("date", ConstructorParameterDescription(self.date)), ("seqStart", ConstructorParameterDescription(self.seqStart)), ("seq", ConstructorParameterDescription(self.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 .webPageAttributeAiComposeTone(let _data): + case .updateShort(let _data): if boxed { - buffer.appendInt32(2005007896) + buffer.appendInt32(2027216577) } - serializeInt64(_data.emojiId, buffer: buffer, boxed: false) + _data.update.serialize(buffer, true) + serializeInt32(_data.date, buffer: buffer, boxed: false) break - case .webPageAttributeStarGiftAuction(let _data): + case .updateShortChatMessage(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) + buffer.appendInt32(1299050149) } 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) + 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) } - break - case .webPageAttributeTheme(let _data): - if boxed { - buffer.appendInt32(1421174295) + if Int(_data.flags) & Int(1 << 11) != 0 { + serializeInt64(_data.viaBotId!, buffer: buffer, boxed: false) } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { + 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(_data.documents!.count)) - for item in _data.documents! { + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { item.serialize(buffer, true) } } - if Int(_data.flags) & Int(1 << 1) != 0 { - _data.settings!.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 25) != 0 { + serializeInt32(_data.ttlPeriod!, buffer: buffer, boxed: false) } break - case .webPageAttributeUniqueStarGift(let _data): + case .updateShortMessage(let _data): if boxed { - buffer.appendInt32(-814781000) - } - _data.gift.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .webPageAttributeAiComposeTone(let _data): - return ("webPageAttributeAiComposeTone", [("emojiId", ConstructorParameterDescription(_data.emojiId))]) - case .webPageAttributeStarGiftAuction(let _data): - return ("webPageAttributeStarGiftAuction", [("gift", ConstructorParameterDescription(_data.gift)), ("endDate", ConstructorParameterDescription(_data.endDate))]) - case .webPageAttributeStarGiftCollection(let _data): - return ("webPageAttributeStarGiftCollection", [("icons", ConstructorParameterDescription(_data.icons))]) - case .webPageAttributeStickerSet(let _data): - return ("webPageAttributeStickerSet", [("flags", ConstructorParameterDescription(_data.flags)), ("stickers", ConstructorParameterDescription(_data.stickers))]) - case .webPageAttributeStory(let _data): - return ("webPageAttributeStory", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("id", ConstructorParameterDescription(_data.id)), ("story", ConstructorParameterDescription(_data.story))]) - case .webPageAttributeTheme(let _data): - return ("webPageAttributeTheme", [("flags", ConstructorParameterDescription(_data.flags)), ("documents", ConstructorParameterDescription(_data.documents)), ("settings", ConstructorParameterDescription(_data.settings))]) - case .webPageAttributeUniqueStarGift(let _data): - return ("webPageAttributeUniqueStarGift", [("gift", ConstructorParameterDescription(_data.gift))]) - } - } - - public static func parse_webPageAttributeAiComposeTone(_ reader: BufferReader) -> WebPageAttribute? { - var _1: Int64? - _1 = reader.readInt64() - let _c1 = _1 != nil - if _c1 { - return Api.WebPageAttribute.webPageAttributeAiComposeTone(Cons_webPageAttributeAiComposeTone(emojiId: _1!)) - } - else { - return nil - } - } - public static func parse_webPageAttributeStarGiftAuction(_ reader: BufferReader) -> WebPageAttribute? { - var _1: Api.StarGift? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.WebPageAttribute.webPageAttributeStarGiftAuction(Cons_webPageAttributeStarGiftAuction(gift: _1!, endDate: _2!)) - } - else { - return nil - } - } - public static func parse_webPageAttributeStarGiftCollection(_ reader: BufferReader) -> WebPageAttribute? { - var _1: [Api.Document]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.WebPageAttribute.webPageAttributeStarGiftCollection(Cons_webPageAttributeStarGiftCollection(icons: _1!)) - } - else { - return nil - } - } - public static func parse_webPageAttributeStickerSet(_ reader: BufferReader) -> WebPageAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Document]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.WebPageAttribute.webPageAttributeStickerSet(Cons_webPageAttributeStickerSet(flags: _1!, stickers: _2!)) - } - else { - return nil - } - } - public static func parse_webPageAttributeStory(_ reader: BufferReader) -> WebPageAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _3: Int32? - _3 = reader.readInt32() - var _4: Api.StoryItem? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.WebPageAttribute.webPageAttributeStory(Cons_webPageAttributeStory(flags: _1!, peer: _2!, id: _3!, story: _4)) - } - else { - return nil - } - } - public static func parse_webPageAttributeTheme(_ reader: BufferReader) -> WebPageAttribute? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Document]? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.WebPageAttribute.webPageAttributeTheme(Cons_webPageAttributeTheme(flags: _1!, documents: _2, settings: _3)) - } - else { - return nil - } - } - public static func parse_webPageAttributeUniqueStarGift(_ reader: BufferReader) -> WebPageAttribute? { - var _1: Api.StarGift? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarGift - } - let _c1 = _1 != nil - if _c1 { - return Api.WebPageAttribute.webPageAttributeUniqueStarGift(Cons_webPageAttributeUniqueStarGift(gift: _1!)) - } - else { - return nil - } - } - } -} -public extension Api { - enum WebViewMessageSent: TypeConstructorDescription { - public class Cons_webViewMessageSent: TypeConstructorDescription { - public var flags: Int32 - public var msgId: Api.InputBotInlineMessageID? - public init(flags: Int32, msgId: Api.InputBotInlineMessageID?) { - self.flags = flags - self.msgId = msgId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webViewMessageSent", [("flags", ConstructorParameterDescription(self.flags)), ("msgId", ConstructorParameterDescription(self.msgId))]) - } - } - case webViewMessageSent(Cons_webViewMessageSent) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webViewMessageSent(let _data): - if boxed { - buffer.appendInt32(211046684) + buffer.appendInt32(826001400) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.msgId!.serialize(buffer, true) + 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(_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 - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .webViewMessageSent(let _data): - return ("webViewMessageSent", [("flags", ConstructorParameterDescription(_data.flags)), ("msgId", ConstructorParameterDescription(_data.msgId))]) - } - } - - public static func parse_webViewMessageSent(_ reader: BufferReader) -> WebViewMessageSent? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.InputBotInlineMessageID? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.WebViewMessageSent.webViewMessageSent(Cons_webViewMessageSent(flags: _1!, msgId: _2)) - } - else { - return nil - } - } - } -} -public extension Api { - enum WebViewResult: TypeConstructorDescription { - public class Cons_webViewResultUrl: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webViewResultUrl", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("url", ConstructorParameterDescription(self.url))]) - } - } - case webViewResultUrl(Cons_webViewResultUrl) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .webViewResultUrl(let _data): + case .updateShortSentMessage(let _data): if boxed { - buffer.appendInt32(1294139288) + buffer.appendInt32(-1877614335) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeInt64(_data.queryId!, 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(_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) } - serializeString(_data.url, buffer: buffer, boxed: false) break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .webViewResultUrl(let _data): - return ("webViewResultUrl", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("url", ConstructorParameterDescription(_data.url))]) - } - } - - public static func parse_webViewResultUrl(_ reader: BufferReader) -> WebViewResult? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt64() - } - var _3: String? - _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.WebViewResult.webViewResultUrl(Cons_webViewResultUrl(flags: _1!, queryId: _2, url: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum AuthorizationForm: TypeConstructorDescription { - public class Cons_authorizationForm: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("authorizationForm", [("flags", ConstructorParameterDescription(self.flags)), ("requiredTypes", ConstructorParameterDescription(self.requiredTypes)), ("values", ConstructorParameterDescription(self.values)), ("errors", ConstructorParameterDescription(self.errors)), ("users", ConstructorParameterDescription(self.users)), ("privacyPolicyUrl", ConstructorParameterDescription(self.privacyPolicyUrl))]) - } - } - case authorizationForm(Cons_authorizationForm) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .authorizationForm(let _data): + case .updates(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(1957577280) } 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 { + buffer.appendInt32(Int32(_data.updates.count)) + for item in _data.updates { item.serialize(buffer, true) } buffer.appendInt32(481674261) @@ -464,258 +251,122 @@ public extension Api.account { 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, ConstructorParameterDescription)]) { - switch self { - case .authorizationForm(let _data): - return ("authorizationForm", [("flags", ConstructorParameterDescription(_data.flags)), ("requiredTypes", ConstructorParameterDescription(_data.requiredTypes)), ("values", ConstructorParameterDescription(_data.values)), ("errors", ConstructorParameterDescription(_data.errors)), ("users", ConstructorParameterDescription(_data.users)), ("privacyPolicyUrl", ConstructorParameterDescription(_data.privacyPolicyUrl))]) - } - } - - public static func parse_authorizationForm(_ reader: BufferReader) -> AuthorizationForm? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.SecureRequiredType]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureRequiredType.self) - } - var _3: [Api.SecureValue]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) - } - var _4: [Api.SecureValueError]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValueError.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_authorizations: TypeConstructorDescription { - public var authorizationTtlDays: Int32 - public var authorizations: [Api.Authorization] - public init(authorizationTtlDays: Int32, authorizations: [Api.Authorization]) { - self.authorizationTtlDays = authorizationTtlDays - self.authorizations = authorizations - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("authorizations", [("authorizationTtlDays", ConstructorParameterDescription(self.authorizationTtlDays)), ("authorizations", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .authorizations(let _data): - return ("authorizations", [("authorizationTtlDays", ConstructorParameterDescription(_data.authorizationTtlDays)), ("authorizations", ConstructorParameterDescription(_data.authorizations))]) - } - } - - public static func parse_authorizations(_ reader: BufferReader) -> Authorizations? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Authorization]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Authorization.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.Authorizations.authorizations(Cons_authorizations(authorizationTtlDays: _1!, authorizations: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum AutoDownloadSettings: TypeConstructorDescription { - public class Cons_autoDownloadSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("autoDownloadSettings", [("low", ConstructorParameterDescription(self.low)), ("medium", ConstructorParameterDescription(self.medium)), ("high", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .autoDownloadSettings(let _data): - return ("autoDownloadSettings", [("low", ConstructorParameterDescription(_data.low)), ("medium", ConstructorParameterDescription(_data.medium)), ("high", ConstructorParameterDescription(_data.high))]) - } - } - - public static func parse_autoDownloadSettings(_ reader: BufferReader) -> AutoDownloadSettings? { - var _1: Api.AutoDownloadSettings? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.AutoDownloadSettings - } - var _2: Api.AutoDownloadSettings? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.AutoDownloadSettings - } - var _3: Api.AutoDownloadSettings? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.AutoDownloadSettings - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.account.AutoDownloadSettings.autoDownloadSettings(Cons_autoDownloadSettings(low: _1!, medium: _2!, high: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum AutoSaveSettings: TypeConstructorDescription { - public class Cons_autoSaveSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("autoSaveSettings", [("usersSettings", ConstructorParameterDescription(self.usersSettings)), ("chatsSettings", ConstructorParameterDescription(self.chatsSettings)), ("broadcastsSettings", ConstructorParameterDescription(self.broadcastsSettings)), ("exceptions", ConstructorParameterDescription(self.exceptions)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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) } + 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, ConstructorParameterDescription)]) { switch self { - case .autoSaveSettings(let _data): - return ("autoSaveSettings", [("usersSettings", ConstructorParameterDescription(_data.usersSettings)), ("chatsSettings", ConstructorParameterDescription(_data.chatsSettings)), ("broadcastsSettings", ConstructorParameterDescription(_data.broadcastsSettings)), ("exceptions", ConstructorParameterDescription(_data.exceptions)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .updateShort(let _data): + return ("updateShort", [("update", ConstructorParameterDescription(_data.update)), ("date", ConstructorParameterDescription(_data.date))]) + case .updateShortChatMessage(let _data): + return ("updateShortChatMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("viaBotId", ConstructorParameterDescription(_data.viaBotId)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("entities", ConstructorParameterDescription(_data.entities)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) + case .updateShortMessage(let _data): + return ("updateShortMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("userId", ConstructorParameterDescription(_data.userId)), ("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date)), ("fwdFrom", ConstructorParameterDescription(_data.fwdFrom)), ("viaBotId", ConstructorParameterDescription(_data.viaBotId)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("entities", ConstructorParameterDescription(_data.entities)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) + case .updateShortSentMessage(let _data): + return ("updateShortSentMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("date", ConstructorParameterDescription(_data.date)), ("media", ConstructorParameterDescription(_data.media)), ("entities", ConstructorParameterDescription(_data.entities)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) + case .updates(let _data): + return ("updates", [("updates", ConstructorParameterDescription(_data.updates)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats)), ("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq))]) + case .updatesCombined(let _data): + return ("updatesCombined", [("updates", ConstructorParameterDescription(_data.updates)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats)), ("date", ConstructorParameterDescription(_data.date)), ("seqStart", ConstructorParameterDescription(_data.seqStart)), ("seq", ConstructorParameterDescription(_data.seq))]) + case .updatesTooLong: + return ("updatesTooLong", []) } } - public static func parse_autoSaveSettings(_ reader: BufferReader) -> AutoSaveSettings? { - var _1: Api.AutoSaveSettings? + public static func parse_updateShort(_ reader: BufferReader) -> Updates? { + var _1: Api.Update? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.AutoSaveSettings + _1 = Api.parse(reader, signature: signature) as? Api.Update } - var _2: Api.AutoSaveSettings? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.AutoSaveSettings + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Updates.updateShort(Cons_updateShort(update: _1!, date: _2!)) } - var _3: Api.AutoSaveSettings? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.AutoSaveSettings + else { + return nil } - var _4: [Api.AutoSaveException]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AutoSaveException.self) + } + public static func parse_updateShortChatMessage(_ reader: BufferReader) -> Updates? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int64? + _4 = reader.readInt64() + var _5: String? + _5 = parseString(reader) + var _6: Int32? + _6 = reader.readInt32() + var _7: Int32? + _7 = reader.readInt32() + var _8: Int32? + _8 = reader.readInt32() + var _9: Api.MessageFwdHeader? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader + } } - var _5: [Api.Chat]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + var _10: Int64? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _10 = reader.readInt64() } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + var _11: Api.MessageReplyHeader? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } + var _13: Int32? + if Int(_1 ?? 0) & Int(1 << 25) != 0 { + _13 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil @@ -723,143 +374,279 @@ public extension Api.account { let _c4 = _4 != nil let _c5 = _5 != nil let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.AutoSaveSettings.autoSaveSettings(Cons_autoSaveSettings(usersSettings: _1!, chatsSettings: _2!, broadcastsSettings: _3!, exceptions: _4!, chats: _5!, users: _6!)) + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _13 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 { + 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 } } - } -} -public extension Api.account { - enum BusinessChatLinks: TypeConstructorDescription { - public class Cons_businessChatLinks: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("businessChatLinks", [("links", ConstructorParameterDescription(self.links)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case businessChatLinks(Cons_businessChatLinks) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .businessChatLinks(let _data): - if boxed { - buffer.appendInt32(-331111727) + public static func parse_updateShortMessage(_ reader: BufferReader) -> Updates? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: Int32? + _7 = reader.readInt32() + var _8: Api.MessageFwdHeader? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.MessageFwdHeader } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.links.count)) - for item in _data.links { - item.serialize(buffer, true) + } + var _9: Int64? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _9 = reader.readInt64() + } + var _10: Api.MessageReplyHeader? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.MessageReplyHeader } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) + } + var _11: [Api.MessageEntity]? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .businessChatLinks(let _data): - return ("businessChatLinks", [("links", ConstructorParameterDescription(_data.links)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_businessChatLinks(_ reader: BufferReader) -> BusinessChatLinks? { - var _1: [Api.BusinessChatLink]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BusinessChatLink.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + var _12: Int32? + if Int(_1 ?? 0) & Int(1 << 25) != 0 { + _12 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.account.BusinessChatLinks.businessChatLinks(Cons_businessChatLinks(links: _1!, chats: _2!, users: _3!)) + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _12 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 { + 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 } } - } -} -public extension Api.account { - enum ChatThemes: TypeConstructorDescription { - public class Cons_chatThemes: TypeConstructorDescription { - 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 + public static func parse_updateShortSentMessage(_ reader: BufferReader) -> Updates? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Api.MessageMedia? + if Int(_1 ?? 0) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatThemes", [("flags", ConstructorParameterDescription(self.flags)), ("hash", ConstructorParameterDescription(self.hash)), ("themes", ConstructorParameterDescription(self.themes)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) + var _7: [Api.MessageEntity]? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + } + var _8: Int32? + if Int(_1 ?? 0) & Int(1 << 25) != 0 { + _8 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 } } - case chatThemes(Cons_chatThemes) - case chatThemesNotModified + public static func parse_updates(_ reader: BufferReader) -> Updates? { + var _1: [Api.Update]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.Updates.updates(Cons_updates(updates: _1!, users: _2!, chats: _3!, date: _4!, seq: _5!)) + } + else { + return nil + } + } + public static func parse_updatesCombined(_ reader: BufferReader) -> Updates? { + var _1: [Api.Update]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.Updates.updatesCombined(Cons_updatesCombined(updates: _1!, users: _2!, chats: _3!, date: _4!, seqStart: _5!, seq: _6!)) + } + else { + return nil + } + } + public static func parse_updatesTooLong(_ reader: BufferReader) -> Updates? { + return Api.Updates.updatesTooLong + } + } +} +public extension Api { + enum UrlAuthResult: TypeConstructorDescription { + public class Cons_urlAuthResultAccepted: TypeConstructorDescription { + public var flags: Int32 + public var url: String? + public init(flags: Int32, url: String?) { + self.flags = flags + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("urlAuthResultAccepted", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url))]) + } + } + public class Cons_urlAuthResultRequest: TypeConstructorDescription { + public var flags: Int32 + public var bot: Api.User + public var domain: String + public var browser: String? + public var platform: String? + public var ip: String? + public var region: String? + public var matchCodes: [String]? + public var userIdHint: Int64? + public var verifiedAppName: String? + public init(flags: Int32, bot: Api.User, domain: String, browser: String?, platform: String?, ip: String?, region: String?, matchCodes: [String]?, userIdHint: Int64?, verifiedAppName: String?) { + self.flags = flags + self.bot = bot + self.domain = domain + self.browser = browser + self.platform = platform + self.ip = ip + self.region = region + self.matchCodes = matchCodes + self.userIdHint = userIdHint + self.verifiedAppName = verifiedAppName + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("urlAuthResultRequest", [("flags", ConstructorParameterDescription(self.flags)), ("bot", ConstructorParameterDescription(self.bot)), ("domain", ConstructorParameterDescription(self.domain)), ("browser", ConstructorParameterDescription(self.browser)), ("platform", ConstructorParameterDescription(self.platform)), ("ip", ConstructorParameterDescription(self.ip)), ("region", ConstructorParameterDescription(self.region)), ("matchCodes", ConstructorParameterDescription(self.matchCodes)), ("userIdHint", ConstructorParameterDescription(self.userIdHint)), ("verifiedAppName", ConstructorParameterDescription(self.verifiedAppName))]) + } + } + case urlAuthResultAccepted(Cons_urlAuthResultAccepted) + case urlAuthResultDefault + case urlAuthResultRequest(Cons_urlAuthResultRequest) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .chatThemes(let _data): + case .urlAuthResultAccepted(let _data): if boxed { - buffer.appendInt32(-1106673293) + buffer.appendInt32(1648005024) } 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) + serializeString(_data.url!, buffer: buffer, boxed: false) } break - case .chatThemesNotModified: + case .urlAuthResultDefault: if boxed { - buffer.appendInt32(-535699004) + buffer.appendInt32(-1445536993) + } + break + case .urlAuthResultRequest(let _data): + if boxed { + buffer.appendInt32(1020666860) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.bot.serialize(buffer, true) + serializeString(_data.domain, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.browser!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.platform!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.ip!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.region!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.matchCodes!.count)) + for item in _data.matchCodes! { + serializeString(item, buffer: buffer, boxed: false) + } + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt64(_data.userIdHint!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 7) != 0 { + serializeString(_data.verifiedAppName!, buffer: buffer, boxed: false) } break } @@ -867,33 +654,1268 @@ public extension Api.account { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .chatThemes(let _data): - return ("chatThemes", [("flags", ConstructorParameterDescription(_data.flags)), ("hash", ConstructorParameterDescription(_data.hash)), ("themes", ConstructorParameterDescription(_data.themes)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) - case .chatThemesNotModified: - return ("chatThemesNotModified", []) + case .urlAuthResultAccepted(let _data): + return ("urlAuthResultAccepted", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url))]) + case .urlAuthResultDefault: + return ("urlAuthResultDefault", []) + case .urlAuthResultRequest(let _data): + return ("urlAuthResultRequest", [("flags", ConstructorParameterDescription(_data.flags)), ("bot", ConstructorParameterDescription(_data.bot)), ("domain", ConstructorParameterDescription(_data.domain)), ("browser", ConstructorParameterDescription(_data.browser)), ("platform", ConstructorParameterDescription(_data.platform)), ("ip", ConstructorParameterDescription(_data.ip)), ("region", ConstructorParameterDescription(_data.region)), ("matchCodes", ConstructorParameterDescription(_data.matchCodes)), ("userIdHint", ConstructorParameterDescription(_data.userIdHint)), ("verifiedAppName", ConstructorParameterDescription(_data.verifiedAppName))]) } } - public static func parse_chatThemes(_ reader: BufferReader) -> ChatThemes? { + public static func parse_urlAuthResultAccepted(_ reader: BufferReader) -> UrlAuthResult? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.UrlAuthResult.urlAuthResultAccepted(Cons_urlAuthResultAccepted(flags: _1!, url: _2)) + } + else { + return nil + } + } + public static func parse_urlAuthResultDefault(_ reader: BufferReader) -> UrlAuthResult? { + return Api.UrlAuthResult.urlAuthResultDefault + } + public static func parse_urlAuthResultRequest(_ reader: BufferReader) -> UrlAuthResult? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.User? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.User + } + var _3: String? + _3 = parseString(reader) + var _4: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _6 = parseString(reader) + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _7 = parseString(reader) + } + var _8: [String]? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } + var _9: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _9 = reader.readInt64() + } + var _10: String? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + _10 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _10 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { + return Api.UrlAuthResult.urlAuthResultRequest(Cons_urlAuthResultRequest(flags: _1!, bot: _2!, domain: _3!, browser: _4, platform: _5, ip: _6, region: _7, matchCodes: _8, userIdHint: _9, verifiedAppName: _10)) + } + else { + return nil + } + } + } +} +public extension Api { + enum User: TypeConstructorDescription { + public class Cons_user: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("user", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("username", ConstructorParameterDescription(self.username)), ("phone", ConstructorParameterDescription(self.phone)), ("photo", ConstructorParameterDescription(self.photo)), ("status", ConstructorParameterDescription(self.status)), ("botInfoVersion", ConstructorParameterDescription(self.botInfoVersion)), ("restrictionReason", ConstructorParameterDescription(self.restrictionReason)), ("botInlinePlaceholder", ConstructorParameterDescription(self.botInlinePlaceholder)), ("langCode", ConstructorParameterDescription(self.langCode)), ("emojiStatus", ConstructorParameterDescription(self.emojiStatus)), ("usernames", ConstructorParameterDescription(self.usernames)), ("storiesMaxId", ConstructorParameterDescription(self.storiesMaxId)), ("color", ConstructorParameterDescription(self.color)), ("profileColor", ConstructorParameterDescription(self.profileColor)), ("botActiveUsers", ConstructorParameterDescription(self.botActiveUsers)), ("botVerificationIcon", ConstructorParameterDescription(self.botVerificationIcon)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars))]) + } + } + public class Cons_userEmpty: TypeConstructorDescription { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userEmpty", [("id", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { + switch self { + case .user(let _data): + return ("user", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("username", ConstructorParameterDescription(_data.username)), ("phone", ConstructorParameterDescription(_data.phone)), ("photo", ConstructorParameterDescription(_data.photo)), ("status", ConstructorParameterDescription(_data.status)), ("botInfoVersion", ConstructorParameterDescription(_data.botInfoVersion)), ("restrictionReason", ConstructorParameterDescription(_data.restrictionReason)), ("botInlinePlaceholder", ConstructorParameterDescription(_data.botInlinePlaceholder)), ("langCode", ConstructorParameterDescription(_data.langCode)), ("emojiStatus", ConstructorParameterDescription(_data.emojiStatus)), ("usernames", ConstructorParameterDescription(_data.usernames)), ("storiesMaxId", ConstructorParameterDescription(_data.storiesMaxId)), ("color", ConstructorParameterDescription(_data.color)), ("profileColor", ConstructorParameterDescription(_data.profileColor)), ("botActiveUsers", ConstructorParameterDescription(_data.botActiveUsers)), ("botVerificationIcon", ConstructorParameterDescription(_data.botVerificationIcon)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars))]) + case .userEmpty(let _data): + return ("userEmpty", [("id", ConstructorParameterDescription(_data.id))]) + } + } + + public static func parse_user(_ reader: BufferReader) -> User? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _6 = parseString(reader) + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _7 = parseString(reader) + } + var _8: String? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _8 = parseString(reader) + } + var _9: Api.UserProfilePhoto? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 6) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.UserStatus + } + } + var _11: Int32? + if Int(_1 ?? 0) & Int(1 << 14) != 0 { + _11 = reader.readInt32() + } + var _12: [Api.RestrictionReason]? + if Int(_1 ?? 0) & Int(1 << 18) != 0 { + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RestrictionReason.self) + } + } + var _13: String? + if Int(_1 ?? 0) & Int(1 << 19) != 0 { + _13 = parseString(reader) + } + var _14: String? + if Int(_1 ?? 0) & Int(1 << 22) != 0 { + _14 = parseString(reader) + } + var _15: Api.EmojiStatus? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 9) != 0 { + if let signature = reader.readInt32() { + _19 = Api.parse(reader, signature: signature) as? Api.PeerColor + } + } + var _20: Int32? + if Int(_2 ?? 0) & Int(1 << 12) != 0 { + _20 = reader.readInt32() + } + var _21: Int64? + if Int(_2 ?? 0) & Int(1 << 14) != 0 { + _21 = reader.readInt64() + } + var _22: Int64? + if Int(_2 ?? 0) & Int(1 << 15) != 0 { + _22 = reader.readInt64() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 19) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 22) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 30) == 0) || _15 != nil + let _c16 = (Int(_2 ?? 0) & Int(1 << 0) == 0) || _16 != nil + let _c17 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _17 != nil + let _c18 = (Int(_2 ?? 0) & Int(1 << 8) == 0) || _18 != nil + let _c19 = (Int(_2 ?? 0) & Int(1 << 9) == 0) || _19 != nil + let _c20 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _20 != nil + let _c21 = (Int(_2 ?? 0) & Int(1 << 14) == 0) || _21 != nil + let _c22 = (Int(_2 ?? 0) & 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(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 + } + } + public static func parse_userEmpty(_ reader: BufferReader) -> User? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.User.userEmpty(Cons_userEmpty(id: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum UserFull: TypeConstructorDescription { + public class Cons_userFull: TypeConstructorDescription { + 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 var botManagerId: Int64? + 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?, botManagerId: Int64?) { + 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 + self.botManagerId = botManagerId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userFull", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("about", ConstructorParameterDescription(self.about)), ("settings", ConstructorParameterDescription(self.settings)), ("personalPhoto", ConstructorParameterDescription(self.personalPhoto)), ("profilePhoto", ConstructorParameterDescription(self.profilePhoto)), ("fallbackPhoto", ConstructorParameterDescription(self.fallbackPhoto)), ("notifySettings", ConstructorParameterDescription(self.notifySettings)), ("botInfo", ConstructorParameterDescription(self.botInfo)), ("pinnedMsgId", ConstructorParameterDescription(self.pinnedMsgId)), ("commonChatsCount", ConstructorParameterDescription(self.commonChatsCount)), ("folderId", ConstructorParameterDescription(self.folderId)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod)), ("theme", ConstructorParameterDescription(self.theme)), ("privateForwardName", ConstructorParameterDescription(self.privateForwardName)), ("botGroupAdminRights", ConstructorParameterDescription(self.botGroupAdminRights)), ("botBroadcastAdminRights", ConstructorParameterDescription(self.botBroadcastAdminRights)), ("wallpaper", ConstructorParameterDescription(self.wallpaper)), ("stories", ConstructorParameterDescription(self.stories)), ("businessWorkHours", ConstructorParameterDescription(self.businessWorkHours)), ("businessLocation", ConstructorParameterDescription(self.businessLocation)), ("businessGreetingMessage", ConstructorParameterDescription(self.businessGreetingMessage)), ("businessAwayMessage", ConstructorParameterDescription(self.businessAwayMessage)), ("businessIntro", ConstructorParameterDescription(self.businessIntro)), ("birthday", ConstructorParameterDescription(self.birthday)), ("personalChannelId", ConstructorParameterDescription(self.personalChannelId)), ("personalChannelMessage", ConstructorParameterDescription(self.personalChannelMessage)), ("stargiftsCount", ConstructorParameterDescription(self.stargiftsCount)), ("starrefProgram", ConstructorParameterDescription(self.starrefProgram)), ("botVerification", ConstructorParameterDescription(self.botVerification)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars)), ("disallowedGifts", ConstructorParameterDescription(self.disallowedGifts)), ("starsRating", ConstructorParameterDescription(self.starsRating)), ("starsMyPendingRating", ConstructorParameterDescription(self.starsMyPendingRating)), ("starsMyPendingRatingDate", ConstructorParameterDescription(self.starsMyPendingRatingDate)), ("mainTab", ConstructorParameterDescription(self.mainTab)), ("savedMusic", ConstructorParameterDescription(self.savedMusic)), ("note", ConstructorParameterDescription(self.note)), ("botManagerId", ConstructorParameterDescription(self.botManagerId))]) + } + } + case userFull(Cons_userFull) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .userFull(let _data): + if boxed { + buffer.appendInt32(114026053) + } + 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) + } + if Int(_data.flags2) & Int(1 << 25) != 0 { + serializeInt64(_data.botManagerId!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .userFull(let _data): + return ("userFull", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("about", ConstructorParameterDescription(_data.about)), ("settings", ConstructorParameterDescription(_data.settings)), ("personalPhoto", ConstructorParameterDescription(_data.personalPhoto)), ("profilePhoto", ConstructorParameterDescription(_data.profilePhoto)), ("fallbackPhoto", ConstructorParameterDescription(_data.fallbackPhoto)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings)), ("botInfo", ConstructorParameterDescription(_data.botInfo)), ("pinnedMsgId", ConstructorParameterDescription(_data.pinnedMsgId)), ("commonChatsCount", ConstructorParameterDescription(_data.commonChatsCount)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod)), ("theme", ConstructorParameterDescription(_data.theme)), ("privateForwardName", ConstructorParameterDescription(_data.privateForwardName)), ("botGroupAdminRights", ConstructorParameterDescription(_data.botGroupAdminRights)), ("botBroadcastAdminRights", ConstructorParameterDescription(_data.botBroadcastAdminRights)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper)), ("stories", ConstructorParameterDescription(_data.stories)), ("businessWorkHours", ConstructorParameterDescription(_data.businessWorkHours)), ("businessLocation", ConstructorParameterDescription(_data.businessLocation)), ("businessGreetingMessage", ConstructorParameterDescription(_data.businessGreetingMessage)), ("businessAwayMessage", ConstructorParameterDescription(_data.businessAwayMessage)), ("businessIntro", ConstructorParameterDescription(_data.businessIntro)), ("birthday", ConstructorParameterDescription(_data.birthday)), ("personalChannelId", ConstructorParameterDescription(_data.personalChannelId)), ("personalChannelMessage", ConstructorParameterDescription(_data.personalChannelMessage)), ("stargiftsCount", ConstructorParameterDescription(_data.stargiftsCount)), ("starrefProgram", ConstructorParameterDescription(_data.starrefProgram)), ("botVerification", ConstructorParameterDescription(_data.botVerification)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars)), ("disallowedGifts", ConstructorParameterDescription(_data.disallowedGifts)), ("starsRating", ConstructorParameterDescription(_data.starsRating)), ("starsMyPendingRating", ConstructorParameterDescription(_data.starsMyPendingRating)), ("starsMyPendingRatingDate", ConstructorParameterDescription(_data.starsMyPendingRatingDate)), ("mainTab", ConstructorParameterDescription(_data.mainTab)), ("savedMusic", ConstructorParameterDescription(_data.savedMusic)), ("note", ConstructorParameterDescription(_data.note)), ("botManagerId", ConstructorParameterDescription(_data.botManagerId))]) + } + } + + public static func parse_userFull(_ reader: BufferReader) -> UserFull? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.BotInfo + } + } + var _11: Int32? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _11 = reader.readInt32() + } + var _12: Int32? + _12 = reader.readInt32() + var _13: Int32? + if Int(_1 ?? 0) & Int(1 << 11) != 0 { + _13 = reader.readInt32() + } + var _14: Int32? + if Int(_1 ?? 0) & Int(1 << 14) != 0 { + _14 = reader.readInt32() + } + var _15: Api.ChatTheme? + if Int(_1 ?? 0) & Int(1 << 15) != 0 { + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.ChatTheme + } + } + var _16: String? + if Int(_1 ?? 0) & Int(1 << 16) != 0 { + _16 = parseString(reader) + } + var _17: Api.ChatAdminRights? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _26 = Api.parse(reader, signature: signature) as? Api.Birthday + } + } + var _27: Int64? + if Int(_2 ?? 0) & Int(1 << 6) != 0 { + _27 = reader.readInt64() + } + var _28: Int32? + if Int(_2 ?? 0) & Int(1 << 6) != 0 { + _28 = reader.readInt32() + } + var _29: Int32? + if Int(_2 ?? 0) & Int(1 << 8) != 0 { + _29 = reader.readInt32() + } + var _30: Api.StarRefProgram? + if Int(_2 ?? 0) & 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 ?? 0) & Int(1 << 12) != 0 { + if let signature = reader.readInt32() { + _31 = Api.parse(reader, signature: signature) as? Api.BotVerification + } + } + var _32: Int64? + if Int(_2 ?? 0) & Int(1 << 14) != 0 { + _32 = reader.readInt64() + } + var _33: Api.DisallowedGiftsSettings? + if Int(_2 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 18) != 0 { + if let signature = reader.readInt32() { + _35 = Api.parse(reader, signature: signature) as? Api.StarsRating + } + } + var _36: Int32? + if Int(_2 ?? 0) & Int(1 << 18) != 0 { + _36 = reader.readInt32() + } + var _37: Api.ProfileTab? + if Int(_2 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 22) != 0 { + if let signature = reader.readInt32() { + _39 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } + var _40: Int64? + if Int(_2 ?? 0) & Int(1 << 25) != 0 { + _40 = reader.readInt64() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 21) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 22) == 0) || _8 != nil + let _c9 = _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _11 != nil + let _c12 = _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 11) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 14) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 15) == 0) || _15 != nil + let _c16 = (Int(_1 ?? 0) & Int(1 << 16) == 0) || _16 != nil + let _c17 = (Int(_1 ?? 0) & Int(1 << 17) == 0) || _17 != nil + let _c18 = (Int(_1 ?? 0) & Int(1 << 18) == 0) || _18 != nil + let _c19 = (Int(_1 ?? 0) & Int(1 << 24) == 0) || _19 != nil + let _c20 = (Int(_1 ?? 0) & Int(1 << 25) == 0) || _20 != nil + let _c21 = (Int(_2 ?? 0) & Int(1 << 0) == 0) || _21 != nil + let _c22 = (Int(_2 ?? 0) & Int(1 << 1) == 0) || _22 != nil + let _c23 = (Int(_2 ?? 0) & Int(1 << 2) == 0) || _23 != nil + let _c24 = (Int(_2 ?? 0) & Int(1 << 3) == 0) || _24 != nil + let _c25 = (Int(_2 ?? 0) & Int(1 << 4) == 0) || _25 != nil + let _c26 = (Int(_2 ?? 0) & Int(1 << 5) == 0) || _26 != nil + let _c27 = (Int(_2 ?? 0) & Int(1 << 6) == 0) || _27 != nil + let _c28 = (Int(_2 ?? 0) & Int(1 << 6) == 0) || _28 != nil + let _c29 = (Int(_2 ?? 0) & Int(1 << 8) == 0) || _29 != nil + let _c30 = (Int(_2 ?? 0) & Int(1 << 11) == 0) || _30 != nil + let _c31 = (Int(_2 ?? 0) & Int(1 << 12) == 0) || _31 != nil + let _c32 = (Int(_2 ?? 0) & Int(1 << 14) == 0) || _32 != nil + let _c33 = (Int(_2 ?? 0) & Int(1 << 15) == 0) || _33 != nil + let _c34 = (Int(_2 ?? 0) & Int(1 << 17) == 0) || _34 != nil + let _c35 = (Int(_2 ?? 0) & Int(1 << 18) == 0) || _35 != nil + let _c36 = (Int(_2 ?? 0) & Int(1 << 18) == 0) || _36 != nil + let _c37 = (Int(_2 ?? 0) & Int(1 << 20) == 0) || _37 != nil + let _c38 = (Int(_2 ?? 0) & Int(1 << 21) == 0) || _38 != nil + let _c39 = (Int(_2 ?? 0) & Int(1 << 22) == 0) || _39 != nil + let _c40 = (Int(_2 ?? 0) & Int(1 << 25) == 0) || _40 != 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 { + 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, botManagerId: _40)) + } + else { + return nil + } + } + } +} +public extension Api { + enum UserProfilePhoto: TypeConstructorDescription { + public class Cons_userProfilePhoto: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userProfilePhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photoId", ConstructorParameterDescription(self.photoId)), ("strippedThumb", ConstructorParameterDescription(self.strippedThumb)), ("dcId", ConstructorParameterDescription(self.dcId))]) + } + } + case userProfilePhoto(Cons_userProfilePhoto) + 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, ConstructorParameterDescription)]) { + switch self { + case .userProfilePhoto(let _data): + return ("userProfilePhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("strippedThumb", ConstructorParameterDescription(_data.strippedThumb)), ("dcId", ConstructorParameterDescription(_data.dcId))]) + 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: [Api.ChatTheme]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatTheme.self) + var _3: Buffer? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = parseBytes(reader) } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.UserProfilePhoto.userProfilePhoto(Cons_userProfilePhoto(flags: _1!, photoId: _2!, strippedThumb: _3, dcId: _4!)) } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + else { + return nil } - var _6: String? + } + public static func parse_userProfilePhotoEmpty(_ reader: BufferReader) -> UserProfilePhoto? { + return Api.UserProfilePhoto.userProfilePhotoEmpty + } + } +} +public extension Api { + enum UserStatus: TypeConstructorDescription { + public class Cons_userStatusLastMonth: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusLastMonth", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_userStatusLastWeek: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusLastWeek", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_userStatusOffline: TypeConstructorDescription { + public var wasOnline: Int32 + public init(wasOnline: Int32) { + self.wasOnline = wasOnline + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusOffline", [("wasOnline", ConstructorParameterDescription(self.wasOnline))]) + } + } + public class Cons_userStatusOnline: TypeConstructorDescription { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusOnline", [("expires", ConstructorParameterDescription(self.expires))]) + } + } + public class Cons_userStatusRecently: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusRecently", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + 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, ConstructorParameterDescription)]) { + switch self { + case .userStatusEmpty: + return ("userStatusEmpty", []) + case .userStatusLastMonth(let _data): + return ("userStatusLastMonth", [("flags", ConstructorParameterDescription(_data.flags))]) + case .userStatusLastWeek(let _data): + return ("userStatusLastWeek", [("flags", ConstructorParameterDescription(_data.flags))]) + case .userStatusOffline(let _data): + return ("userStatusOffline", [("wasOnline", ConstructorParameterDescription(_data.wasOnline))]) + case .userStatusOnline(let _data): + return ("userStatusOnline", [("expires", ConstructorParameterDescription(_data.expires))]) + case .userStatusRecently(let _data): + return ("userStatusRecently", [("flags", ConstructorParameterDescription(_data.flags))]) + } + } + + public static func parse_userStatusEmpty(_ reader: BufferReader) -> UserStatus? { + return Api.UserStatus.userStatusEmpty + } + public static func parse_userStatusLastMonth(_ reader: BufferReader) -> UserStatus? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusLastMonth(Cons_userStatusLastMonth(flags: _1!)) + } + else { + return nil + } + } + public static func parse_userStatusLastWeek(_ reader: BufferReader) -> UserStatus? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusLastWeek(Cons_userStatusLastWeek(flags: _1!)) + } + else { + return nil + } + } + public static func parse_userStatusOffline(_ reader: BufferReader) -> UserStatus? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusOffline(Cons_userStatusOffline(wasOnline: _1!)) + } + else { + return nil + } + } + public static func parse_userStatusOnline(_ reader: BufferReader) -> UserStatus? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusOnline(Cons_userStatusOnline(expires: _1!)) + } + else { + return nil + } + } + public static func parse_userStatusRecently(_ reader: BufferReader) -> UserStatus? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.UserStatus.userStatusRecently(Cons_userStatusRecently(flags: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum Username: TypeConstructorDescription { + public class Cons_username: TypeConstructorDescription { + public var flags: Int32 + public var username: String + public init(flags: Int32, username: String) { + self.flags = flags + self.username = username + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("username", [("flags", ConstructorParameterDescription(self.flags)), ("username", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .username(let _data): + return ("username", [("flags", ConstructorParameterDescription(_data.flags)), ("username", ConstructorParameterDescription(_data.username))]) + } + } + + public static func parse_username(_ reader: BufferReader) -> Username? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.Username.username(Cons_username(flags: _1!, username: _2!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum VideoSize: TypeConstructorDescription { + public class Cons_videoSize: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("videoSize", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("size", ConstructorParameterDescription(self.size)), ("videoStartTs", ConstructorParameterDescription(self.videoStartTs))]) + } + } + public class Cons_videoSizeEmojiMarkup: TypeConstructorDescription { + public var emojiId: Int64 + public var backgroundColors: [Int32] + public init(emojiId: Int64, backgroundColors: [Int32]) { + self.emojiId = emojiId + self.backgroundColors = backgroundColors + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("videoSizeEmojiMarkup", [("emojiId", ConstructorParameterDescription(self.emojiId)), ("backgroundColors", ConstructorParameterDescription(self.backgroundColors))]) + } + } + public class Cons_videoSizeStickerMarkup: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("videoSizeStickerMarkup", [("stickerset", ConstructorParameterDescription(self.stickerset)), ("stickerId", ConstructorParameterDescription(self.stickerId)), ("backgroundColors", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .videoSize(let _data): + return ("videoSize", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("size", ConstructorParameterDescription(_data.size)), ("videoStartTs", ConstructorParameterDescription(_data.videoStartTs))]) + case .videoSizeEmojiMarkup(let _data): + return ("videoSizeEmojiMarkup", [("emojiId", ConstructorParameterDescription(_data.emojiId)), ("backgroundColors", ConstructorParameterDescription(_data.backgroundColors))]) + case .videoSizeStickerMarkup(let _data): + return ("videoSizeStickerMarkup", [("stickerset", ConstructorParameterDescription(_data.stickerset)), ("stickerId", ConstructorParameterDescription(_data.stickerId)), ("backgroundColors", ConstructorParameterDescription(_data.backgroundColors))]) + } + } + + public static func parse_videoSize(_ reader: BufferReader) -> VideoSize? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Double? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseString(reader) + _6 = reader.readDouble() } let _c1 = _1 != nil let _c2 = _2 != nil @@ -902,780 +1924,44 @@ public extension Api.account { let _c5 = _5 != nil let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.ChatThemes.chatThemes(Cons_chatThemes(flags: _1!, hash: _2!, themes: _3!, chats: _4!, users: _5!, nextOffset: _6)) + return Api.VideoSize.videoSize(Cons_videoSize(flags: _1!, type: _2!, w: _3!, h: _4!, size: _5!, videoStartTs: _6)) } else { return nil } } - public static func parse_chatThemesNotModified(_ reader: BufferReader) -> ChatThemes? { - return Api.account.ChatThemes.chatThemesNotModified - } - } -} -public extension Api.account { - enum ConnectedBots: TypeConstructorDescription { - public class Cons_connectedBots: TypeConstructorDescription { - public var connectedBots: [Api.ConnectedBot] - public var users: [Api.User] - public init(connectedBots: [Api.ConnectedBot], users: [Api.User]) { - self.connectedBots = connectedBots - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("connectedBots", [("connectedBots", ConstructorParameterDescription(self.connectedBots)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .connectedBots(let _data): - return ("connectedBots", [("connectedBots", ConstructorParameterDescription(_data.connectedBots)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_connectedBots(_ reader: BufferReader) -> ConnectedBots? { - var _1: [Api.ConnectedBot]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ConnectedBot.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.ConnectedBots.connectedBots(Cons_connectedBots(connectedBots: _1!, users: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum ContentSettings: TypeConstructorDescription { - public class Cons_contentSettings: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("contentSettings", [("flags", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .contentSettings(let _data): - return ("contentSettings", [("flags", ConstructorParameterDescription(_data.flags))]) - } - } - - 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(Cons_contentSettings(flags: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum EmailVerified: TypeConstructorDescription { - public class Cons_emailVerified: TypeConstructorDescription { - public var email: String - public init(email: String) { - self.email = email - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("emailVerified", [("email", ConstructorParameterDescription(self.email))]) - } - } - public class Cons_emailVerifiedLogin: TypeConstructorDescription { - public var email: String - public var sentCode: Api.auth.SentCode - public init(email: String, sentCode: Api.auth.SentCode) { - self.email = email - self.sentCode = sentCode - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("emailVerifiedLogin", [("email", ConstructorParameterDescription(self.email)), ("sentCode", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .emailVerified(let _data): - return ("emailVerified", [("email", ConstructorParameterDescription(_data.email))]) - case .emailVerifiedLogin(let _data): - return ("emailVerifiedLogin", [("email", ConstructorParameterDescription(_data.email)), ("sentCode", ConstructorParameterDescription(_data.sentCode))]) - } - } - - 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(Cons_emailVerified(email: _1!)) - } - else { - return nil - } - } - public static func parse_emailVerifiedLogin(_ reader: BufferReader) -> EmailVerified? { - var _1: String? - _1 = parseString(reader) - var _2: Api.auth.SentCode? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.auth.SentCode - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.EmailVerified.emailVerifiedLogin(Cons_emailVerifiedLogin(email: _1!, sentCode: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum EmojiStatuses: TypeConstructorDescription { - public class Cons_emojiStatuses: TypeConstructorDescription { - public var hash: Int64 - public var statuses: [Api.EmojiStatus] - public init(hash: Int64, statuses: [Api.EmojiStatus]) { - self.hash = hash - self.statuses = statuses - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("emojiStatuses", [("hash", ConstructorParameterDescription(self.hash)), ("statuses", ConstructorParameterDescription(self.statuses))]) - } - } - case emojiStatuses(Cons_emojiStatuses) - 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, ConstructorParameterDescription)]) { - switch self { - case .emojiStatuses(let _data): - return ("emojiStatuses", [("hash", ConstructorParameterDescription(_data.hash)), ("statuses", ConstructorParameterDescription(_data.statuses))]) - case .emojiStatusesNotModified: - return ("emojiStatusesNotModified", []) - } - } - - public static func parse_emojiStatuses(_ reader: BufferReader) -> EmojiStatuses? { + public static func parse_videoSizeEmojiMarkup(_ reader: BufferReader) -> VideoSize? { var _1: Int64? _1 = reader.readInt64() - var _2: [Api.EmojiStatus]? + var _2: [Int32]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EmojiStatus.self) + _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.account.EmojiStatuses.emojiStatuses(Cons_emojiStatuses(hash: _1!, statuses: _2!)) + return Api.VideoSize.videoSizeEmojiMarkup(Cons_videoSizeEmojiMarkup(emojiId: _1!, backgroundColors: _2!)) } else { return nil } } - public static func parse_emojiStatusesNotModified(_ reader: BufferReader) -> EmojiStatuses? { - return Api.account.EmojiStatuses.emojiStatusesNotModified - } - } -} -public extension Api.account { - enum PaidMessagesRevenue: TypeConstructorDescription { - public class Cons_paidMessagesRevenue: TypeConstructorDescription { - public var starsAmount: Int64 - public init(starsAmount: Int64) { - self.starsAmount = starsAmount - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paidMessagesRevenue", [("starsAmount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .paidMessagesRevenue(let _data): - return ("paidMessagesRevenue", [("starsAmount", ConstructorParameterDescription(_data.starsAmount))]) - } - } - - 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(Cons_paidMessagesRevenue(starsAmount: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum PasskeyRegistrationOptions: TypeConstructorDescription { - public class Cons_passkeyRegistrationOptions: TypeConstructorDescription { - public var options: Api.DataJSON - public init(options: Api.DataJSON) { - self.options = options - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passkeyRegistrationOptions", [("options", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .passkeyRegistrationOptions(let _data): - return ("passkeyRegistrationOptions", [("options", ConstructorParameterDescription(_data.options))]) - } - } - - public static func parse_passkeyRegistrationOptions(_ reader: BufferReader) -> PasskeyRegistrationOptions? { - var _1: Api.DataJSON? + public static func parse_videoSizeStickerMarkup(_ reader: BufferReader) -> VideoSize? { + var _1: Api.InputStickerSet? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.DataJSON + _1 = Api.parse(reader, signature: signature) as? Api.InputStickerSet } - let _c1 = _1 != nil - if _c1 { - return Api.account.PasskeyRegistrationOptions.passkeyRegistrationOptions(Cons_passkeyRegistrationOptions(options: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum Passkeys: TypeConstructorDescription { - public class Cons_passkeys: TypeConstructorDescription { - public var passkeys: [Api.Passkey] - public init(passkeys: [Api.Passkey]) { - self.passkeys = passkeys - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passkeys", [("passkeys", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .passkeys(let _data): - return ("passkeys", [("passkeys", ConstructorParameterDescription(_data.passkeys))]) - } - } - - public static func parse_passkeys(_ reader: BufferReader) -> Passkeys? { - var _1: [Api.Passkey]? + var _2: Int64? + _2 = reader.readInt64() + var _3: [Int32]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Passkey.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.account.Passkeys.passkeys(Cons_passkeys(passkeys: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum Password: TypeConstructorDescription { - public class Cons_password: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("password", [("flags", ConstructorParameterDescription(self.flags)), ("currentAlgo", ConstructorParameterDescription(self.currentAlgo)), ("srpB", ConstructorParameterDescription(self.srpB)), ("srpId", ConstructorParameterDescription(self.srpId)), ("hint", ConstructorParameterDescription(self.hint)), ("emailUnconfirmedPattern", ConstructorParameterDescription(self.emailUnconfirmedPattern)), ("newAlgo", ConstructorParameterDescription(self.newAlgo)), ("newSecureAlgo", ConstructorParameterDescription(self.newSecureAlgo)), ("secureRandom", ConstructorParameterDescription(self.secureRandom)), ("pendingResetDate", ConstructorParameterDescription(self.pendingResetDate)), ("loginEmailPattern", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .password(let _data): - return ("password", [("flags", ConstructorParameterDescription(_data.flags)), ("currentAlgo", ConstructorParameterDescription(_data.currentAlgo)), ("srpB", ConstructorParameterDescription(_data.srpB)), ("srpId", ConstructorParameterDescription(_data.srpId)), ("hint", ConstructorParameterDescription(_data.hint)), ("emailUnconfirmedPattern", ConstructorParameterDescription(_data.emailUnconfirmedPattern)), ("newAlgo", ConstructorParameterDescription(_data.newAlgo)), ("newSecureAlgo", ConstructorParameterDescription(_data.newSecureAlgo)), ("secureRandom", ConstructorParameterDescription(_data.secureRandom)), ("pendingResetDate", ConstructorParameterDescription(_data.pendingResetDate)), ("loginEmailPattern", ConstructorParameterDescription(_data.loginEmailPattern))]) - } - } - - public static func parse_password(_ reader: BufferReader) -> Password? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.PasswordKdfAlgo? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo - } - } - var _3: Buffer? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = parseBytes(reader) - } - var _4: Int64? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt64() - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _5 = parseString(reader) - } - var _6: String? - if Int(_1 ?? 0) & 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 - } - var _8: Api.SecurePasswordKdfAlgo? - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.SecurePasswordKdfAlgo - } - var _9: Buffer? - _9 = parseBytes(reader) - var _10: Int32? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _10 = reader.readInt32() - } - var _11: String? - if Int(_1 ?? 0) & Int(1 << 6) != 0 { - _11 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _11 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { - 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 { - public class Cons_passwordInputSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passwordInputSettings", [("flags", ConstructorParameterDescription(self.flags)), ("newAlgo", ConstructorParameterDescription(self.newAlgo)), ("newPasswordHash", ConstructorParameterDescription(self.newPasswordHash)), ("hint", ConstructorParameterDescription(self.hint)), ("email", ConstructorParameterDescription(self.email)), ("newSecureSettings", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .passwordInputSettings(let _data): - return ("passwordInputSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("newAlgo", ConstructorParameterDescription(_data.newAlgo)), ("newPasswordHash", ConstructorParameterDescription(_data.newPasswordHash)), ("hint", ConstructorParameterDescription(_data.hint)), ("email", ConstructorParameterDescription(_data.email)), ("newSecureSettings", ConstructorParameterDescription(_data.newSecureSettings))]) - } - } - - public static func parse_passwordInputSettings(_ reader: BufferReader) -> PasswordInputSettings? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.PasswordKdfAlgo? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo - } - } - var _3: Buffer? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = parseBytes(reader) - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - var _6: Api.SecureSecretSettings? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_passwordSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passwordSettings", [("flags", ConstructorParameterDescription(self.flags)), ("email", ConstructorParameterDescription(self.email)), ("secureSettings", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .passwordSettings(let _data): - return ("passwordSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("email", ConstructorParameterDescription(_data.email)), ("secureSettings", ConstructorParameterDescription(_data.secureSettings))]) - } - } - - public static func parse_passwordSettings(_ reader: BufferReader) -> PasswordSettings? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - var _3: Api.SecureSecretSettings? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.account.PasswordSettings.passwordSettings(Cons_passwordSettings(flags: _1!, email: _2, secureSettings: _3)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum PrivacyRules: TypeConstructorDescription { - public class Cons_privacyRules: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("privacyRules", [("rules", ConstructorParameterDescription(self.rules)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .privacyRules(let _data): - return ("privacyRules", [("rules", ConstructorParameterDescription(_data.rules)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_privacyRules(_ reader: BufferReader) -> PrivacyRules? { - var _1: [Api.PrivacyRule]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.account.PrivacyRules.privacyRules(Cons_privacyRules(rules: _1!, chats: _2!, users: _3!)) + return Api.VideoSize.videoSizeStickerMarkup(Cons_videoSizeStickerMarkup(stickerset: _1!, stickerId: _2!, backgroundColors: _3!)) } else { return nil @@ -1683,83 +1969,533 @@ public extension Api.account { } } } -public extension Api.account { - enum ResetPasswordResult: TypeConstructorDescription { - public class Cons_resetPasswordFailedWait: TypeConstructorDescription { - public var retryDate: Int32 - public init(retryDate: Int32) { - self.retryDate = retryDate +public extension Api { + enum WallPaper: TypeConstructorDescription { + public class Cons_wallPaper: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("resetPasswordFailedWait", [("retryDate", ConstructorParameterDescription(self.retryDate))]) + return ("wallPaper", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("slug", ConstructorParameterDescription(self.slug)), ("document", ConstructorParameterDescription(self.document)), ("settings", ConstructorParameterDescription(self.settings))]) } } - public class Cons_resetPasswordRequestedWait: TypeConstructorDescription { - public var untilDate: Int32 - public init(untilDate: Int32) { - self.untilDate = untilDate + public class Cons_wallPaperNoFile: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("resetPasswordRequestedWait", [("untilDate", ConstructorParameterDescription(self.untilDate))]) + return ("wallPaperNoFile", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags)), ("settings", ConstructorParameterDescription(self.settings))]) } } - case resetPasswordFailedWait(Cons_resetPasswordFailedWait) - case resetPasswordOk - case resetPasswordRequestedWait(Cons_resetPasswordRequestedWait) + case wallPaper(Cons_wallPaper) + case wallPaperNoFile(Cons_wallPaperNoFile) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .resetPasswordFailedWait(let _data): + case .wallPaper(let _data): if boxed { - buffer.appendInt32(-478701471) + buffer.appendInt32(-1539849235) } - serializeInt32(_data.retryDate, buffer: buffer, boxed: false) - break - case .resetPasswordOk: - if boxed { - buffer.appendInt32(-383330754) + 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 .resetPasswordRequestedWait(let _data): + case .wallPaperNoFile(let _data): if boxed { - buffer.appendInt32(-370148227) + 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) } - serializeInt32(_data.untilDate, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .resetPasswordFailedWait(let _data): - return ("resetPasswordFailedWait", [("retryDate", ConstructorParameterDescription(_data.retryDate))]) - case .resetPasswordOk: - return ("resetPasswordOk", []) - case .resetPasswordRequestedWait(let _data): - return ("resetPasswordRequestedWait", [("untilDate", ConstructorParameterDescription(_data.untilDate))]) + case .wallPaper(let _data): + return ("wallPaper", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("slug", ConstructorParameterDescription(_data.slug)), ("document", ConstructorParameterDescription(_data.document)), ("settings", ConstructorParameterDescription(_data.settings))]) + case .wallPaperNoFile(let _data): + return ("wallPaperNoFile", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags)), ("settings", ConstructorParameterDescription(_data.settings))]) } } - public static func parse_resetPasswordFailedWait(_ reader: BufferReader) -> ResetPasswordResult? { - var _1: Int32? - _1 = reader.readInt32() + public static func parse_wallPaper(_ reader: BufferReader) -> WallPaper? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: Api.Document? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Document + } + var _6: Api.WallPaperSettings? + if Int(_2 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings + } + } let _c1 = _1 != nil - if _c1 { - return Api.account.ResetPasswordResult.resetPasswordFailedWait(Cons_resetPasswordFailedWait(retryDate: _1!)) + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_2 ?? 0) & Int(1 << 2) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.WallPaper.wallPaper(Cons_wallPaper(id: _1!, flags: _2!, accessHash: _3!, slug: _4!, document: _5!, settings: _6)) } else { return nil } } - public static func parse_resetPasswordOk(_ reader: BufferReader) -> ResetPasswordResult? { - return Api.account.ResetPasswordResult.resetPasswordOk - } - public static func parse_resetPasswordRequestedWait(_ reader: BufferReader) -> ResetPasswordResult? { - var _1: Int32? - _1 = reader.readInt32() + public static func parse_wallPaperNoFile(_ reader: BufferReader) -> WallPaper? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.WallPaperSettings? + if Int(_2 ?? 0) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings + } + } let _c1 = _1 != nil - if _c1 { - return Api.account.ResetPasswordResult.resetPasswordRequestedWait(Cons_resetPasswordRequestedWait(untilDate: _1!)) + let _c2 = _2 != nil + let _c3 = (Int(_2 ?? 0) & Int(1 << 2) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.WallPaper.wallPaperNoFile(Cons_wallPaperNoFile(id: _1!, flags: _2!, settings: _3)) + } + else { + return nil + } + } + } +} +public extension Api { + enum WallPaperSettings: TypeConstructorDescription { + public class Cons_wallPaperSettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("wallPaperSettings", [("flags", ConstructorParameterDescription(self.flags)), ("backgroundColor", ConstructorParameterDescription(self.backgroundColor)), ("secondBackgroundColor", ConstructorParameterDescription(self.secondBackgroundColor)), ("thirdBackgroundColor", ConstructorParameterDescription(self.thirdBackgroundColor)), ("fourthBackgroundColor", ConstructorParameterDescription(self.fourthBackgroundColor)), ("intensity", ConstructorParameterDescription(self.intensity)), ("rotation", ConstructorParameterDescription(self.rotation)), ("emoticon", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .wallPaperSettings(let _data): + return ("wallPaperSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("backgroundColor", ConstructorParameterDescription(_data.backgroundColor)), ("secondBackgroundColor", ConstructorParameterDescription(_data.secondBackgroundColor)), ("thirdBackgroundColor", ConstructorParameterDescription(_data.thirdBackgroundColor)), ("fourthBackgroundColor", ConstructorParameterDescription(_data.fourthBackgroundColor)), ("intensity", ConstructorParameterDescription(_data.intensity)), ("rotation", ConstructorParameterDescription(_data.rotation)), ("emoticon", ConstructorParameterDescription(_data.emoticon))]) + } + } + + public static func parse_wallPaperSettings(_ reader: BufferReader) -> WallPaperSettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _4 = reader.readInt32() + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _5 = reader.readInt32() + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _6 = reader.readInt32() + } + var _7: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _7 = reader.readInt32() + } + var _8: String? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + _8 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 { + public class Cons_webAuthorization: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webAuthorization", [("hash", ConstructorParameterDescription(self.hash)), ("botId", ConstructorParameterDescription(self.botId)), ("domain", ConstructorParameterDescription(self.domain)), ("browser", ConstructorParameterDescription(self.browser)), ("platform", ConstructorParameterDescription(self.platform)), ("dateCreated", ConstructorParameterDescription(self.dateCreated)), ("dateActive", ConstructorParameterDescription(self.dateActive)), ("ip", ConstructorParameterDescription(self.ip)), ("region", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .webAuthorization(let _data): + return ("webAuthorization", [("hash", ConstructorParameterDescription(_data.hash)), ("botId", ConstructorParameterDescription(_data.botId)), ("domain", ConstructorParameterDescription(_data.domain)), ("browser", ConstructorParameterDescription(_data.browser)), ("platform", ConstructorParameterDescription(_data.platform)), ("dateCreated", ConstructorParameterDescription(_data.dateCreated)), ("dateActive", ConstructorParameterDescription(_data.dateActive)), ("ip", ConstructorParameterDescription(_data.ip)), ("region", ConstructorParameterDescription(_data.region))]) + } + } + + public static func parse_webAuthorization(_ reader: BufferReader) -> WebAuthorization? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: Int32? + _6 = reader.readInt32() + var _7: Int32? + _7 = reader.readInt32() + var _8: String? + _8 = parseString(reader) + var _9: String? + _9 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 { + public class Cons_webDocument: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webDocument", [("url", ConstructorParameterDescription(self.url)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("size", ConstructorParameterDescription(self.size)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("attributes", ConstructorParameterDescription(self.attributes))]) + } + } + public class Cons_webDocumentNoProxy: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webDocumentNoProxy", [("url", ConstructorParameterDescription(self.url)), ("size", ConstructorParameterDescription(self.size)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("attributes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .webDocument(let _data): + return ("webDocument", [("url", ConstructorParameterDescription(_data.url)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("attributes", ConstructorParameterDescription(_data.attributes))]) + case .webDocumentNoProxy(let _data): + return ("webDocumentNoProxy", [("url", ConstructorParameterDescription(_data.url)), ("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("attributes", ConstructorParameterDescription(_data.attributes))]) + } + } + + public static func parse_webDocument(_ reader: BufferReader) -> WebDocument? { + var _1: String? + _1 = parseString(reader) + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: String? + _4 = parseString(reader) + var _5: [Api.DocumentAttribute]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DocumentAttribute.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.WebDocument.webDocument(Cons_webDocument(url: _1!, accessHash: _2!, size: _3!, mimeType: _4!, attributes: _5!)) + } + else { + return nil + } + } + public static func parse_webDocumentNoProxy(_ reader: BufferReader) -> WebDocument? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + var _4: [Api.DocumentAttribute]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DocumentAttribute.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.WebDocument.webDocumentNoProxy(Cons_webDocumentNoProxy(url: _1!, size: _2!, mimeType: _3!, attributes: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum WebDomainException: TypeConstructorDescription { + public class Cons_webDomainException: TypeConstructorDescription { + public var flags: Int32 + public var domain: String + public var url: String + public var title: String + public var favicon: Int64? + public init(flags: Int32, domain: String, url: String, title: String, favicon: Int64?) { + self.flags = flags + self.domain = domain + self.url = url + self.title = title + self.favicon = favicon + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webDomainException", [("flags", ConstructorParameterDescription(self.flags)), ("domain", ConstructorParameterDescription(self.domain)), ("url", ConstructorParameterDescription(self.url)), ("title", ConstructorParameterDescription(self.title)), ("favicon", ConstructorParameterDescription(self.favicon))]) + } + } + case webDomainException(Cons_webDomainException) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .webDomainException(let _data): + if boxed { + buffer.appendInt32(-1824741993) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeString(_data.domain, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt64(_data.favicon!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .webDomainException(let _data): + return ("webDomainException", [("flags", ConstructorParameterDescription(_data.flags)), ("domain", ConstructorParameterDescription(_data.domain)), ("url", ConstructorParameterDescription(_data.url)), ("title", ConstructorParameterDescription(_data.title)), ("favicon", ConstructorParameterDescription(_data.favicon))]) + } + } + + public static func parse_webDomainException(_ reader: BufferReader) -> WebDomainException? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: Int64? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.WebDomainException.webDomainException(Cons_webDomainException(flags: _1!, domain: _2!, url: _3!, title: _4!, favicon: _5)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api31.swift b/submodules/TelegramApi/Sources/Api31.swift index 4e02876037..9f01fe1ae2 100644 --- a/submodules/TelegramApi/Sources/Api31.swift +++ b/submodules/TelegramApi/Sources/Api31.swift @@ -1,41 +1,1030 @@ -public extension Api.account { - enum ResolvedBusinessChatLinks: TypeConstructorDescription { - public class Cons_resolvedBusinessChatLinks: TypeConstructorDescription { +public extension Api { + enum WebPage: TypeConstructorDescription { + public class Cons_webPage: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("url", ConstructorParameterDescription(self.url)), ("displayUrl", ConstructorParameterDescription(self.displayUrl)), ("hash", ConstructorParameterDescription(self.hash)), ("type", ConstructorParameterDescription(self.type)), ("siteName", ConstructorParameterDescription(self.siteName)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("embedUrl", ConstructorParameterDescription(self.embedUrl)), ("embedType", ConstructorParameterDescription(self.embedType)), ("embedWidth", ConstructorParameterDescription(self.embedWidth)), ("embedHeight", ConstructorParameterDescription(self.embedHeight)), ("duration", ConstructorParameterDescription(self.duration)), ("author", ConstructorParameterDescription(self.author)), ("document", ConstructorParameterDescription(self.document)), ("cachedPage", ConstructorParameterDescription(self.cachedPage)), ("attributes", ConstructorParameterDescription(self.attributes))]) + } + } + public class Cons_webPageEmpty: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageEmpty", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("url", ConstructorParameterDescription(self.url))]) + } + } + public class Cons_webPageNotModified: TypeConstructorDescription { + public var flags: Int32 + public var cachedPageViews: Int32? + public init(flags: Int32, cachedPageViews: Int32?) { + self.flags = flags + self.cachedPageViews = cachedPageViews + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("cachedPageViews", ConstructorParameterDescription(self.cachedPageViews))]) + } + } + public class Cons_webPagePending: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPagePending", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("url", ConstructorParameterDescription(self.url)), ("date", ConstructorParameterDescription(self.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 _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, ConstructorParameterDescription)]) { + switch self { + case .webPage(let _data): + return ("webPage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url)), ("displayUrl", ConstructorParameterDescription(_data.displayUrl)), ("hash", ConstructorParameterDescription(_data.hash)), ("type", ConstructorParameterDescription(_data.type)), ("siteName", ConstructorParameterDescription(_data.siteName)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("embedUrl", ConstructorParameterDescription(_data.embedUrl)), ("embedType", ConstructorParameterDescription(_data.embedType)), ("embedWidth", ConstructorParameterDescription(_data.embedWidth)), ("embedHeight", ConstructorParameterDescription(_data.embedHeight)), ("duration", ConstructorParameterDescription(_data.duration)), ("author", ConstructorParameterDescription(_data.author)), ("document", ConstructorParameterDescription(_data.document)), ("cachedPage", ConstructorParameterDescription(_data.cachedPage)), ("attributes", ConstructorParameterDescription(_data.attributes))]) + case .webPageEmpty(let _data): + return ("webPageEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url))]) + case .webPageNotModified(let _data): + return ("webPageNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("cachedPageViews", ConstructorParameterDescription(_data.cachedPageViews))]) + case .webPagePending(let _data): + return ("webPagePending", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url)), ("date", ConstructorParameterDescription(_data.date))]) + } + } + + public static func parse_webPage(_ reader: BufferReader) -> WebPage? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: Int32? + _5 = reader.readInt32() + var _6: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } + var _8: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _8 = parseString(reader) + } + var _9: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _9 = parseString(reader) + } + var _10: Api.Photo? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.Photo + } + } + var _11: String? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _11 = parseString(reader) + } + var _12: String? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _12 = parseString(reader) + } + var _13: Int32? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _13 = reader.readInt32() + } + var _14: Int32? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _14 = reader.readInt32() + } + var _15: Int32? + if Int(_1 ?? 0) & Int(1 << 7) != 0 { + _15 = reader.readInt32() + } + var _16: String? + if Int(_1 ?? 0) & Int(1 << 8) != 0 { + _16 = parseString(reader) + } + var _17: Api.Document? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _14 != nil + let _c15 = (Int(_1 ?? 0) & Int(1 << 7) == 0) || _15 != nil + let _c16 = (Int(_1 ?? 0) & Int(1 << 8) == 0) || _16 != nil + let _c17 = (Int(_1 ?? 0) & Int(1 << 9) == 0) || _17 != nil + let _c18 = (Int(_1 ?? 0) & Int(1 << 10) == 0) || _18 != nil + let _c19 = (Int(_1 ?? 0) & 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(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 + } + } + public static func parse_webPageEmpty(_ reader: BufferReader) -> WebPage? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.WebPage.webPageEmpty(Cons_webPageEmpty(flags: _1!, id: _2!, url: _3)) + } + else { + return nil + } + } + public static func parse_webPageNotModified(_ reader: BufferReader) -> WebPage? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.WebPage.webPageNotModified(Cons_webPageNotModified(flags: _1!, cachedPageViews: _2)) + } + else { + return nil + } + } + public static func parse_webPagePending(_ reader: BufferReader) -> WebPage? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.WebPage.webPagePending(Cons_webPagePending(flags: _1!, id: _2!, url: _3, date: _4!)) + } + else { + return nil + } + } + } +} +public extension Api { + indirect enum WebPageAttribute: TypeConstructorDescription { + public class Cons_webPageAttributeAiComposeTone: TypeConstructorDescription { + public var emojiId: Int64 + public init(emojiId: Int64) { + self.emojiId = emojiId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeAiComposeTone", [("emojiId", ConstructorParameterDescription(self.emojiId))]) + } + } + public class Cons_webPageAttributeStarGiftAuction: TypeConstructorDescription { + public var gift: Api.StarGift + public var endDate: Int32 + public init(gift: Api.StarGift, endDate: Int32) { + self.gift = gift + self.endDate = endDate + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeStarGiftAuction", [("gift", ConstructorParameterDescription(self.gift)), ("endDate", ConstructorParameterDescription(self.endDate))]) + } + } + public class Cons_webPageAttributeStarGiftCollection: TypeConstructorDescription { + public var icons: [Api.Document] + public init(icons: [Api.Document]) { + self.icons = icons + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeStarGiftCollection", [("icons", ConstructorParameterDescription(self.icons))]) + } + } + public class Cons_webPageAttributeStickerSet: TypeConstructorDescription { + public var flags: Int32 + public var stickers: [Api.Document] + public init(flags: Int32, stickers: [Api.Document]) { + self.flags = flags + self.stickers = stickers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeStickerSet", [("flags", ConstructorParameterDescription(self.flags)), ("stickers", ConstructorParameterDescription(self.stickers))]) + } + } + public class Cons_webPageAttributeStory: TypeConstructorDescription { 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]) { + 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.message = message - self.entities = entities + self.id = id + self.story = story + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeStory", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("id", ConstructorParameterDescription(self.id)), ("story", ConstructorParameterDescription(self.story))]) + } + } + public class Cons_webPageAttributeTheme: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeTheme", [("flags", ConstructorParameterDescription(self.flags)), ("documents", ConstructorParameterDescription(self.documents)), ("settings", ConstructorParameterDescription(self.settings))]) + } + } + public class Cons_webPageAttributeUniqueStarGift: TypeConstructorDescription { + public var gift: Api.StarGift + public init(gift: Api.StarGift) { + self.gift = gift + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeUniqueStarGift", [("gift", ConstructorParameterDescription(self.gift))]) + } + } + case webPageAttributeAiComposeTone(Cons_webPageAttributeAiComposeTone) + 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 .webPageAttributeAiComposeTone(let _data): + if boxed { + buffer.appendInt32(2005007896) + } + serializeInt64(_data.emojiId, buffer: buffer, boxed: false) + break + 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(_data.documents!.count)) + for item in _data.documents! { + item.serialize(buffer, true) + } + } + 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, ConstructorParameterDescription)]) { + switch self { + case .webPageAttributeAiComposeTone(let _data): + return ("webPageAttributeAiComposeTone", [("emojiId", ConstructorParameterDescription(_data.emojiId))]) + case .webPageAttributeStarGiftAuction(let _data): + return ("webPageAttributeStarGiftAuction", [("gift", ConstructorParameterDescription(_data.gift)), ("endDate", ConstructorParameterDescription(_data.endDate))]) + case .webPageAttributeStarGiftCollection(let _data): + return ("webPageAttributeStarGiftCollection", [("icons", ConstructorParameterDescription(_data.icons))]) + case .webPageAttributeStickerSet(let _data): + return ("webPageAttributeStickerSet", [("flags", ConstructorParameterDescription(_data.flags)), ("stickers", ConstructorParameterDescription(_data.stickers))]) + case .webPageAttributeStory(let _data): + return ("webPageAttributeStory", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("id", ConstructorParameterDescription(_data.id)), ("story", ConstructorParameterDescription(_data.story))]) + case .webPageAttributeTheme(let _data): + return ("webPageAttributeTheme", [("flags", ConstructorParameterDescription(_data.flags)), ("documents", ConstructorParameterDescription(_data.documents)), ("settings", ConstructorParameterDescription(_data.settings))]) + case .webPageAttributeUniqueStarGift(let _data): + return ("webPageAttributeUniqueStarGift", [("gift", ConstructorParameterDescription(_data.gift))]) + } + } + + public static func parse_webPageAttributeAiComposeTone(_ reader: BufferReader) -> WebPageAttribute? { + var _1: Int64? + _1 = reader.readInt64() + let _c1 = _1 != nil + if _c1 { + return Api.WebPageAttribute.webPageAttributeAiComposeTone(Cons_webPageAttributeAiComposeTone(emojiId: _1!)) + } + else { + return nil + } + } + public static func parse_webPageAttributeStarGiftAuction(_ reader: BufferReader) -> WebPageAttribute? { + var _1: Api.StarGift? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.WebPageAttribute.webPageAttributeStarGiftAuction(Cons_webPageAttributeStarGiftAuction(gift: _1!, endDate: _2!)) + } + else { + return nil + } + } + public static func parse_webPageAttributeStarGiftCollection(_ reader: BufferReader) -> WebPageAttribute? { + var _1: [Api.Document]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.WebPageAttribute.webPageAttributeStarGiftCollection(Cons_webPageAttributeStarGiftCollection(icons: _1!)) + } + else { + return nil + } + } + public static func parse_webPageAttributeStickerSet(_ reader: BufferReader) -> WebPageAttribute? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Document]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.WebPageAttribute.webPageAttributeStickerSet(Cons_webPageAttributeStickerSet(flags: _1!, stickers: _2!)) + } + else { + return nil + } + } + public static func parse_webPageAttributeStory(_ reader: BufferReader) -> WebPageAttribute? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _3: Int32? + _3 = reader.readInt32() + var _4: Api.StoryItem? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.WebPageAttribute.webPageAttributeStory(Cons_webPageAttributeStory(flags: _1!, peer: _2!, id: _3!, story: _4)) + } + else { + return nil + } + } + public static func parse_webPageAttributeTheme(_ reader: BufferReader) -> WebPageAttribute? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Document]? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.WebPageAttribute.webPageAttributeTheme(Cons_webPageAttributeTheme(flags: _1!, documents: _2, settings: _3)) + } + else { + return nil + } + } + public static func parse_webPageAttributeUniqueStarGift(_ reader: BufferReader) -> WebPageAttribute? { + var _1: Api.StarGift? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StarGift + } + let _c1 = _1 != nil + if _c1 { + return Api.WebPageAttribute.webPageAttributeUniqueStarGift(Cons_webPageAttributeUniqueStarGift(gift: _1!)) + } + else { + return nil + } + } + } +} +public extension Api { + enum WebViewMessageSent: TypeConstructorDescription { + public class Cons_webViewMessageSent: TypeConstructorDescription { + public var flags: Int32 + public var msgId: Api.InputBotInlineMessageID? + public init(flags: Int32, msgId: Api.InputBotInlineMessageID?) { + self.flags = flags + self.msgId = msgId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webViewMessageSent", [("flags", ConstructorParameterDescription(self.flags)), ("msgId", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .webViewMessageSent(let _data): + return ("webViewMessageSent", [("flags", ConstructorParameterDescription(_data.flags)), ("msgId", ConstructorParameterDescription(_data.msgId))]) + } + } + + public static func parse_webViewMessageSent(_ reader: BufferReader) -> WebViewMessageSent? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.InputBotInlineMessageID? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.WebViewMessageSent.webViewMessageSent(Cons_webViewMessageSent(flags: _1!, msgId: _2)) + } + else { + return nil + } + } + } +} +public extension Api { + enum WebViewResult: TypeConstructorDescription { + public class Cons_webViewResultUrl: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webViewResultUrl", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .webViewResultUrl(let _data): + return ("webViewResultUrl", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("url", ConstructorParameterDescription(_data.url))]) + } + } + + public static func parse_webViewResultUrl(_ reader: BufferReader) -> WebViewResult? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.WebViewResult.webViewResultUrl(Cons_webViewResultUrl(flags: _1!, queryId: _2, url: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum AuthorizationForm: TypeConstructorDescription { + public class Cons_authorizationForm: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("authorizationForm", [("flags", ConstructorParameterDescription(self.flags)), ("requiredTypes", ConstructorParameterDescription(self.requiredTypes)), ("values", ConstructorParameterDescription(self.values)), ("errors", ConstructorParameterDescription(self.errors)), ("users", ConstructorParameterDescription(self.users)), ("privacyPolicyUrl", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .authorizationForm(let _data): + return ("authorizationForm", [("flags", ConstructorParameterDescription(_data.flags)), ("requiredTypes", ConstructorParameterDescription(_data.requiredTypes)), ("values", ConstructorParameterDescription(_data.values)), ("errors", ConstructorParameterDescription(_data.errors)), ("users", ConstructorParameterDescription(_data.users)), ("privacyPolicyUrl", ConstructorParameterDescription(_data.privacyPolicyUrl))]) + } + } + + public static func parse_authorizationForm(_ reader: BufferReader) -> AuthorizationForm? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.SecureRequiredType]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureRequiredType.self) + } + var _3: [Api.SecureValue]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) + } + var _4: [Api.SecureValueError]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValueError.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_authorizations: TypeConstructorDescription { + public var authorizationTtlDays: Int32 + public var authorizations: [Api.Authorization] + public init(authorizationTtlDays: Int32, authorizations: [Api.Authorization]) { + self.authorizationTtlDays = authorizationTtlDays + self.authorizations = authorizations + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("authorizations", [("authorizationTtlDays", ConstructorParameterDescription(self.authorizationTtlDays)), ("authorizations", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .authorizations(let _data): + return ("authorizations", [("authorizationTtlDays", ConstructorParameterDescription(_data.authorizationTtlDays)), ("authorizations", ConstructorParameterDescription(_data.authorizations))]) + } + } + + public static func parse_authorizations(_ reader: BufferReader) -> Authorizations? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Authorization]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Authorization.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.account.Authorizations.authorizations(Cons_authorizations(authorizationTtlDays: _1!, authorizations: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum AutoDownloadSettings: TypeConstructorDescription { + public class Cons_autoDownloadSettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("autoDownloadSettings", [("low", ConstructorParameterDescription(self.low)), ("medium", ConstructorParameterDescription(self.medium)), ("high", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .autoDownloadSettings(let _data): + return ("autoDownloadSettings", [("low", ConstructorParameterDescription(_data.low)), ("medium", ConstructorParameterDescription(_data.medium)), ("high", ConstructorParameterDescription(_data.high))]) + } + } + + public static func parse_autoDownloadSettings(_ reader: BufferReader) -> AutoDownloadSettings? { + var _1: Api.AutoDownloadSettings? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.AutoDownloadSettings + } + var _2: Api.AutoDownloadSettings? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.AutoDownloadSettings + } + var _3: Api.AutoDownloadSettings? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.AutoDownloadSettings + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.account.AutoDownloadSettings.autoDownloadSettings(Cons_autoDownloadSettings(low: _1!, medium: _2!, high: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum AutoSaveSettings: TypeConstructorDescription { + public class Cons_autoSaveSettings: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("resolvedBusinessChatLinks", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("autoSaveSettings", [("usersSettings", ConstructorParameterDescription(self.usersSettings)), ("chatsSettings", ConstructorParameterDescription(self.chatsSettings)), ("broadcastsSettings", ConstructorParameterDescription(self.broadcastsSettings)), ("exceptions", ConstructorParameterDescription(self.exceptions)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case resolvedBusinessChatLinks(Cons_resolvedBusinessChatLinks) + case autoSaveSettings(Cons_autoSaveSettings) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .resolvedBusinessChatLinks(let _data): + case .autoSaveSettings(let _data): if boxed { - buffer.appendInt32(-1708937439) + buffer.appendInt32(1279133341) } - 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(_data.entities!.count)) - for item in _data.entities! { - item.serialize(buffer, true) - } + _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)) @@ -53,25 +1042,27 @@ public extension Api.account { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .resolvedBusinessChatLinks(let _data): - return ("resolvedBusinessChatLinks", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .autoSaveSettings(let _data): + return ("autoSaveSettings", [("usersSettings", ConstructorParameterDescription(_data.usersSettings)), ("chatsSettings", ConstructorParameterDescription(_data.chatsSettings)), ("broadcastsSettings", ConstructorParameterDescription(_data.broadcastsSettings)), ("exceptions", ConstructorParameterDescription(_data.exceptions)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_resolvedBusinessChatLinks(_ reader: BufferReader) -> ResolvedBusinessChatLinks? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? + public static func parse_autoSaveSettings(_ reader: BufferReader) -> AutoSaveSettings? { + var _1: Api.AutoSaveSettings? if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer + _1 = Api.parse(reader, signature: signature) as? Api.AutoSaveSettings } - var _3: String? - _3 = parseString(reader) - var _4: [Api.MessageEntity]? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } + var _2: Api.AutoSaveSettings? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.AutoSaveSettings + } + var _3: Api.AutoSaveSettings? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.AutoSaveSettings + } + var _4: [Api.AutoSaveException]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AutoSaveException.self) } var _5: [Api.Chat]? if let _ = reader.readInt32() { @@ -84,11 +1075,11 @@ public extension Api.account { let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c4 = _4 != nil let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.account.ResolvedBusinessChatLinks.resolvedBusinessChatLinks(Cons_resolvedBusinessChatLinks(flags: _1!, peer: _2!, message: _3!, entities: _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 @@ -97,492 +1088,36 @@ public extension Api.account { } } public extension Api.account { - enum SavedMusicIds: TypeConstructorDescription { - public class Cons_savedMusicIds: TypeConstructorDescription { - public var ids: [Int64] - public init(ids: [Int64]) { - self.ids = ids - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedMusicIds", [("ids", ConstructorParameterDescription(self.ids))]) - } - } - case savedMusicIds(Cons_savedMusicIds) - 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, ConstructorParameterDescription)]) { - switch self { - case .savedMusicIds(let _data): - return ("savedMusicIds", [("ids", ConstructorParameterDescription(_data.ids))]) - case .savedMusicIdsNotModified: - return ("savedMusicIdsNotModified", []) - } - } - - public static func parse_savedMusicIds(_ reader: BufferReader) -> SavedMusicIds? { - var _1: [Int64]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.account.SavedMusicIds.savedMusicIds(Cons_savedMusicIds(ids: _1!)) - } - else { - return nil - } - } - public static func parse_savedMusicIdsNotModified(_ reader: BufferReader) -> SavedMusicIds? { - return Api.account.SavedMusicIds.savedMusicIdsNotModified - } - } -} -public extension Api.account { - enum SavedRingtone: TypeConstructorDescription { - public class Cons_savedRingtoneConverted: TypeConstructorDescription { - public var document: Api.Document - public init(document: Api.Document) { - self.document = document - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedRingtoneConverted", [("document", ConstructorParameterDescription(self.document))]) - } - } - 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, ConstructorParameterDescription)]) { - switch self { - case .savedRingtone: - return ("savedRingtone", []) - case .savedRingtoneConverted(let _data): - return ("savedRingtoneConverted", [("document", ConstructorParameterDescription(_data.document))]) - } - } - - public static func parse_savedRingtone(_ reader: BufferReader) -> SavedRingtone? { - return Api.account.SavedRingtone.savedRingtone - } - public static func parse_savedRingtoneConverted(_ reader: BufferReader) -> SavedRingtone? { - var _1: Api.Document? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Document - } - let _c1 = _1 != nil - if _c1 { - return Api.account.SavedRingtone.savedRingtoneConverted(Cons_savedRingtoneConverted(document: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum SavedRingtones: TypeConstructorDescription { - public class Cons_savedRingtones: TypeConstructorDescription { - public var hash: Int64 - public var ringtones: [Api.Document] - public init(hash: Int64, ringtones: [Api.Document]) { - self.hash = hash - self.ringtones = ringtones - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedRingtones", [("hash", ConstructorParameterDescription(self.hash)), ("ringtones", ConstructorParameterDescription(self.ringtones))]) - } - } - case savedRingtones(Cons_savedRingtones) - 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, ConstructorParameterDescription)]) { - switch self { - case .savedRingtones(let _data): - return ("savedRingtones", [("hash", ConstructorParameterDescription(_data.hash)), ("ringtones", ConstructorParameterDescription(_data.ringtones))]) - case .savedRingtonesNotModified: - return ("savedRingtonesNotModified", []) - } - } - - public static func parse_savedRingtones(_ reader: BufferReader) -> SavedRingtones? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.Document]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.SavedRingtones.savedRingtones(Cons_savedRingtones(hash: _1!, ringtones: _2!)) - } - else { - return nil - } - } - public static func parse_savedRingtonesNotModified(_ reader: BufferReader) -> SavedRingtones? { - return Api.account.SavedRingtones.savedRingtonesNotModified - } - } -} -public extension Api.account { - enum SentEmailCode: TypeConstructorDescription { - public class Cons_sentEmailCode: TypeConstructorDescription { - public var emailPattern: String - public var length: Int32 - public init(emailPattern: String, length: Int32) { - self.emailPattern = emailPattern - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentEmailCode", [("emailPattern", ConstructorParameterDescription(self.emailPattern)), ("length", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .sentEmailCode(let _data): - return ("sentEmailCode", [("emailPattern", ConstructorParameterDescription(_data.emailPattern)), ("length", ConstructorParameterDescription(_data.length))]) - } - } - - public static func parse_sentEmailCode(_ reader: BufferReader) -> SentEmailCode? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.SentEmailCode.sentEmailCode(Cons_sentEmailCode(emailPattern: _1!, length: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum Takeout: TypeConstructorDescription { - public class Cons_takeout: TypeConstructorDescription { - public var id: Int64 - public init(id: Int64) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("takeout", [("id", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .takeout(let _data): - return ("takeout", [("id", ConstructorParameterDescription(_data.id))]) - } - } - - 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(Cons_takeout(id: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum Themes: TypeConstructorDescription { - public class Cons_themes: TypeConstructorDescription { - public var hash: Int64 - public var themes: [Api.Theme] - public init(hash: Int64, themes: [Api.Theme]) { - self.hash = hash - self.themes = themes - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("themes", [("hash", ConstructorParameterDescription(self.hash)), ("themes", ConstructorParameterDescription(self.themes))]) - } - } - case themes(Cons_themes) - 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, ConstructorParameterDescription)]) { - switch self { - case .themes(let _data): - return ("themes", [("hash", ConstructorParameterDescription(_data.hash)), ("themes", ConstructorParameterDescription(_data.themes))]) - case .themesNotModified: - return ("themesNotModified", []) - } - } - - public static func parse_themes(_ reader: BufferReader) -> Themes? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.Theme]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Theme.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.Themes.themes(Cons_themes(hash: _1!, themes: _2!)) - } - else { - return nil - } - } - public static func parse_themesNotModified(_ reader: BufferReader) -> Themes? { - return Api.account.Themes.themesNotModified - } - } -} -public extension Api.account { - enum TmpPassword: TypeConstructorDescription { - public class Cons_tmpPassword: TypeConstructorDescription { - public var tmpPassword: Buffer - public var validUntil: Int32 - public init(tmpPassword: Buffer, validUntil: Int32) { - self.tmpPassword = tmpPassword - self.validUntil = validUntil - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("tmpPassword", [("tmpPassword", ConstructorParameterDescription(self.tmpPassword)), ("validUntil", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .tmpPassword(let _data): - return ("tmpPassword", [("tmpPassword", ConstructorParameterDescription(_data.tmpPassword)), ("validUntil", ConstructorParameterDescription(_data.validUntil))]) - } - } - - public static func parse_tmpPassword(_ reader: BufferReader) -> TmpPassword? { - var _1: Buffer? - _1 = parseBytes(reader) - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.TmpPassword.tmpPassword(Cons_tmpPassword(tmpPassword: _1!, validUntil: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.account { - enum WallPapers: TypeConstructorDescription { - public class Cons_wallPapers: TypeConstructorDescription { - public var hash: Int64 - public var wallpapers: [Api.WallPaper] - public init(hash: Int64, wallpapers: [Api.WallPaper]) { - self.hash = hash - self.wallpapers = wallpapers - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("wallPapers", [("hash", ConstructorParameterDescription(self.hash)), ("wallpapers", ConstructorParameterDescription(self.wallpapers))]) - } - } - case wallPapers(Cons_wallPapers) - 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, ConstructorParameterDescription)]) { - switch self { - case .wallPapers(let _data): - return ("wallPapers", [("hash", ConstructorParameterDescription(_data.hash)), ("wallpapers", ConstructorParameterDescription(_data.wallpapers))]) - case .wallPapersNotModified: - return ("wallPapersNotModified", []) - } - } - - public static func parse_wallPapers(_ reader: BufferReader) -> WallPapers? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.WallPaper]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WallPaper.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.WallPapers.wallPapers(Cons_wallPapers(hash: _1!, wallpapers: _2!)) - } - else { - return nil - } - } - public static func parse_wallPapersNotModified(_ reader: BufferReader) -> WallPapers? { - return Api.account.WallPapers.wallPapersNotModified - } - } -} -public extension Api.account { - enum WebAuthorizations: TypeConstructorDescription { - public class Cons_webAuthorizations: TypeConstructorDescription { - public var authorizations: [Api.WebAuthorization] + enum BusinessChatLinks: TypeConstructorDescription { + public class Cons_businessChatLinks: TypeConstructorDescription { + public var links: [Api.BusinessChatLink] + public var chats: [Api.Chat] public var users: [Api.User] - public init(authorizations: [Api.WebAuthorization], users: [Api.User]) { - self.authorizations = authorizations + public init(links: [Api.BusinessChatLink], chats: [Api.Chat], users: [Api.User]) { + self.links = links + self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webAuthorizations", [("authorizations", ConstructorParameterDescription(self.authorizations)), ("users", ConstructorParameterDescription(self.users))]) + return ("businessChatLinks", [("links", ConstructorParameterDescription(self.links)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case webAuthorizations(Cons_webAuthorizations) + case businessChatLinks(Cons_businessChatLinks) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .webAuthorizations(let _data): + case .businessChatLinks(let _data): if boxed { - buffer.appendInt32(-313079300) + buffer.appendInt32(-331111727) } buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.authorizations.count)) - for item in _data.authorizations { + 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) @@ -596,90 +1131,19 @@ public extension Api.account { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .webAuthorizations(let _data): - return ("webAuthorizations", [("authorizations", ConstructorParameterDescription(_data.authorizations)), ("users", ConstructorParameterDescription(_data.users))]) + case .businessChatLinks(let _data): + return ("businessChatLinks", [("links", ConstructorParameterDescription(_data.links)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_webAuthorizations(_ reader: BufferReader) -> WebAuthorizations? { - var _1: [Api.WebAuthorization]? + public static func parse_businessChatLinks(_ reader: BufferReader) -> BusinessChatLinks? { + var _1: [Api.BusinessChatLink]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WebAuthorization.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BusinessChatLink.self) } - var _2: [Api.User]? + var _2: [Api.Chat]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.account.WebAuthorizations.webAuthorizations(Cons_webAuthorizations(authorizations: _1!, users: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.aicompose { - enum Tones: TypeConstructorDescription { - public class Cons_tones: TypeConstructorDescription { - public var hash: Int64 - public var tones: [Api.AiComposeTone] - public var users: [Api.User] - public init(hash: Int64, tones: [Api.AiComposeTone], users: [Api.User]) { - self.hash = hash - self.tones = tones - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("tones", [("hash", ConstructorParameterDescription(self.hash)), ("tones", ConstructorParameterDescription(self.tones)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case tones(Cons_tones) - case tonesNotModified - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .tones(let _data): - if boxed { - buffer.appendInt32(1822232318) - } - serializeInt64(_data.hash, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.tones.count)) - for item in _data.tones { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - case .tonesNotModified: - if boxed { - buffer.appendInt32(-1040948989) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .tones(let _data): - return ("tones", [("hash", ConstructorParameterDescription(_data.hash)), ("tones", ConstructorParameterDescription(_data.tones)), ("users", ConstructorParameterDescription(_data.users))]) - case .tonesNotModified: - return ("tonesNotModified", []) - } - } - - public static func parse_tones(_ reader: BufferReader) -> Tones? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.AiComposeTone]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AiComposeTone.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } var _3: [Api.User]? if let _ = reader.readInt32() { @@ -689,75 +1153,68 @@ public extension Api.aicompose { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.aicompose.Tones.tones(Cons_tones(hash: _1!, tones: _2!, users: _3!)) + return Api.account.BusinessChatLinks.businessChatLinks(Cons_businessChatLinks(links: _1!, chats: _2!, users: _3!)) } else { return nil } } - public static func parse_tonesNotModified(_ reader: BufferReader) -> Tones? { - return Api.aicompose.Tones.tonesNotModified - } } } -public extension Api.auth { - enum Authorization: TypeConstructorDescription { - public class Cons_authorization: TypeConstructorDescription { +public extension Api.account { + enum ChatThemes: TypeConstructorDescription { + public class Cons_chatThemes: TypeConstructorDescription { 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) { + 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.otherwiseReloginDays = otherwiseReloginDays - self.tmpSessions = tmpSessions - self.futureAuthToken = futureAuthToken - self.user = user + self.hash = hash + self.themes = themes + self.chats = chats + self.users = users + self.nextOffset = nextOffset } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("authorization", [("flags", ConstructorParameterDescription(self.flags)), ("otherwiseReloginDays", ConstructorParameterDescription(self.otherwiseReloginDays)), ("tmpSessions", ConstructorParameterDescription(self.tmpSessions)), ("futureAuthToken", ConstructorParameterDescription(self.futureAuthToken)), ("user", ConstructorParameterDescription(self.user))]) + return ("chatThemes", [("flags", ConstructorParameterDescription(self.flags)), ("hash", ConstructorParameterDescription(self.hash)), ("themes", ConstructorParameterDescription(self.themes)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) } } - public class Cons_authorizationSignUpRequired: TypeConstructorDescription { - public var flags: Int32 - public var termsOfService: Api.help.TermsOfService? - public init(flags: Int32, termsOfService: Api.help.TermsOfService?) { - self.flags = flags - self.termsOfService = termsOfService - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("authorizationSignUpRequired", [("flags", ConstructorParameterDescription(self.flags)), ("termsOfService", ConstructorParameterDescription(self.termsOfService))]) - } - } - case authorization(Cons_authorization) - case authorizationSignUpRequired(Cons_authorizationSignUpRequired) + case chatThemes(Cons_chatThemes) + case chatThemesNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .authorization(let _data): + case .chatThemes(let _data): if boxed { - buffer.appendInt32(782418132) + buffer.appendInt32(-1106673293) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.otherwiseReloginDays!, 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 { - serializeInt32(_data.tmpSessions!, buffer: buffer, boxed: false) + serializeString(_data.nextOffset!, 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): + case .chatThemesNotModified: 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) + buffer.appendInt32(-535699004) } break } @@ -765,177 +1222,107 @@ public extension Api.auth { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .authorization(let _data): - return ("authorization", [("flags", ConstructorParameterDescription(_data.flags)), ("otherwiseReloginDays", ConstructorParameterDescription(_data.otherwiseReloginDays)), ("tmpSessions", ConstructorParameterDescription(_data.tmpSessions)), ("futureAuthToken", ConstructorParameterDescription(_data.futureAuthToken)), ("user", ConstructorParameterDescription(_data.user))]) - case .authorizationSignUpRequired(let _data): - return ("authorizationSignUpRequired", [("flags", ConstructorParameterDescription(_data.flags)), ("termsOfService", ConstructorParameterDescription(_data.termsOfService))]) + case .chatThemes(let _data): + return ("chatThemes", [("flags", ConstructorParameterDescription(_data.flags)), ("hash", ConstructorParameterDescription(_data.hash)), ("themes", ConstructorParameterDescription(_data.themes)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) + case .chatThemesNotModified: + return ("chatThemesNotModified", []) } } - public static func parse_authorization(_ reader: BufferReader) -> Authorization? { + public static func parse_chatThemes(_ reader: BufferReader) -> ChatThemes? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _2 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: [Api.ChatTheme]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatTheme.self) } - var _3: Int32? + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: String? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Buffer? - if Int(_1 ?? 0) & 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 + _6 = parseString(reader) } let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.auth.Authorization.authorization(Cons_authorization(flags: _1!, otherwiseReloginDays: _2, tmpSessions: _3, futureAuthToken: _4, user: _5!)) + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.account.ChatThemes.chatThemes(Cons_chatThemes(flags: _1!, hash: _2!, themes: _3!, chats: _4!, users: _5!, nextOffset: _6)) } else { return nil } } - public static func parse_authorizationSignUpRequired(_ reader: BufferReader) -> Authorization? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.help.TermsOfService? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.auth.Authorization.authorizationSignUpRequired(Cons_authorizationSignUpRequired(flags: _1!, termsOfService: _2)) - } - else { - return nil - } + public static func parse_chatThemesNotModified(_ reader: BufferReader) -> ChatThemes? { + return Api.account.ChatThemes.chatThemesNotModified } } } -public extension Api.auth { - enum CodeType: TypeConstructorDescription { - case codeTypeCall - case codeTypeFlashCall - 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, ConstructorParameterDescription)]) { - switch self { - case .codeTypeCall: - return ("codeTypeCall", []) - case .codeTypeFlashCall: - return ("codeTypeFlashCall", []) - case .codeTypeFragmentSms: - return ("codeTypeFragmentSms", []) - case .codeTypeMissedCall: - return ("codeTypeMissedCall", []) - case .codeTypeSms: - return ("codeTypeSms", []) - } - } - - public static func parse_codeTypeCall(_ reader: BufferReader) -> CodeType? { - return Api.auth.CodeType.codeTypeCall - } - public static func parse_codeTypeFlashCall(_ reader: BufferReader) -> CodeType? { - return Api.auth.CodeType.codeTypeFlashCall - } - public static func parse_codeTypeFragmentSms(_ reader: BufferReader) -> CodeType? { - return Api.auth.CodeType.codeTypeFragmentSms - } - public static func parse_codeTypeMissedCall(_ reader: BufferReader) -> CodeType? { - return Api.auth.CodeType.codeTypeMissedCall - } - public static func parse_codeTypeSms(_ reader: BufferReader) -> CodeType? { - return Api.auth.CodeType.codeTypeSms - } - } -} -public extension Api.auth { - enum ExportedAuthorization: TypeConstructorDescription { - public class Cons_exportedAuthorization: TypeConstructorDescription { - public var id: Int64 - public var bytes: Buffer - public init(id: Int64, bytes: Buffer) { - self.id = id - self.bytes = bytes +public extension Api.account { + enum ConnectedBots: TypeConstructorDescription { + public class Cons_connectedBots: TypeConstructorDescription { + public var connectedBots: [Api.ConnectedBot] + public var users: [Api.User] + public init(connectedBots: [Api.ConnectedBot], users: [Api.User]) { + self.connectedBots = connectedBots + self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedAuthorization", [("id", ConstructorParameterDescription(self.id)), ("bytes", ConstructorParameterDescription(self.bytes))]) + return ("connectedBots", [("connectedBots", ConstructorParameterDescription(self.connectedBots)), ("users", ConstructorParameterDescription(self.users))]) } } - case exportedAuthorization(Cons_exportedAuthorization) + case connectedBots(Cons_connectedBots) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .exportedAuthorization(let _data): + case .connectedBots(let _data): if boxed { - buffer.appendInt32(-1271602504) + 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) } - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeBytes(_data.bytes, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .exportedAuthorization(let _data): - return ("exportedAuthorization", [("id", ConstructorParameterDescription(_data.id)), ("bytes", ConstructorParameterDescription(_data.bytes))]) + case .connectedBots(let _data): + return ("connectedBots", [("connectedBots", ConstructorParameterDescription(_data.connectedBots)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_exportedAuthorization(_ reader: BufferReader) -> ExportedAuthorization? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Buffer? - _2 = parseBytes(reader) + public static func parse_connectedBots(_ reader: BufferReader) -> ConnectedBots? { + var _1: [Api.ConnectedBot]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ConnectedBot.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.auth.ExportedAuthorization.exportedAuthorization(Cons_exportedAuthorization(id: _1!, bytes: _2!)) + return Api.account.ConnectedBots.connectedBots(Cons_connectedBots(connectedBots: _1!, users: _2!)) } else { return nil @@ -943,169 +1330,43 @@ public extension Api.auth { } } } -public extension Api.auth { - enum LoggedOut: TypeConstructorDescription { - public class Cons_loggedOut: TypeConstructorDescription { +public extension Api.account { + enum ContentSettings: TypeConstructorDescription { + public class Cons_contentSettings: TypeConstructorDescription { public var flags: Int32 - public var futureAuthToken: Buffer? - public init(flags: Int32, futureAuthToken: Buffer?) { + public init(flags: Int32) { self.flags = flags - self.futureAuthToken = futureAuthToken } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("loggedOut", [("flags", ConstructorParameterDescription(self.flags)), ("futureAuthToken", ConstructorParameterDescription(self.futureAuthToken))]) + return ("contentSettings", [("flags", ConstructorParameterDescription(self.flags))]) } } - case loggedOut(Cons_loggedOut) + case contentSettings(Cons_contentSettings) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .loggedOut(let _data): + case .contentSettings(let _data): if boxed { - buffer.appendInt32(-1012759713) + buffer.appendInt32(1474462241) } 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, ConstructorParameterDescription)]) { switch self { - case .loggedOut(let _data): - return ("loggedOut", [("flags", ConstructorParameterDescription(_data.flags)), ("futureAuthToken", ConstructorParameterDescription(_data.futureAuthToken))]) + case .contentSettings(let _data): + return ("contentSettings", [("flags", ConstructorParameterDescription(_data.flags))]) } } - public static func parse_loggedOut(_ reader: BufferReader) -> LoggedOut? { + public static func parse_contentSettings(_ reader: BufferReader) -> ContentSettings? { var _1: Int32? _1 = reader.readInt32() - var _2: Buffer? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseBytes(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.auth.LoggedOut.loggedOut(Cons_loggedOut(flags: _1!, futureAuthToken: _2)) - } - else { - return nil - } - } - } -} -public extension Api.auth { - enum LoginToken: TypeConstructorDescription { - public class Cons_loginToken: TypeConstructorDescription { - public var expires: Int32 - public var token: Buffer - public init(expires: Int32, token: Buffer) { - self.expires = expires - self.token = token - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("loginToken", [("expires", ConstructorParameterDescription(self.expires)), ("token", ConstructorParameterDescription(self.token))]) - } - } - public class Cons_loginTokenMigrateTo: TypeConstructorDescription { - public var dcId: Int32 - public var token: Buffer - public init(dcId: Int32, token: Buffer) { - self.dcId = dcId - self.token = token - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("loginTokenMigrateTo", [("dcId", ConstructorParameterDescription(self.dcId)), ("token", ConstructorParameterDescription(self.token))]) - } - } - public class Cons_loginTokenSuccess: TypeConstructorDescription { - public var authorization: Api.auth.Authorization - public init(authorization: Api.auth.Authorization) { - self.authorization = authorization - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("loginTokenSuccess", [("authorization", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .loginToken(let _data): - return ("loginToken", [("expires", ConstructorParameterDescription(_data.expires)), ("token", ConstructorParameterDescription(_data.token))]) - case .loginTokenMigrateTo(let _data): - return ("loginTokenMigrateTo", [("dcId", ConstructorParameterDescription(_data.dcId)), ("token", ConstructorParameterDescription(_data.token))]) - case .loginTokenSuccess(let _data): - return ("loginTokenSuccess", [("authorization", ConstructorParameterDescription(_data.authorization))]) - } - } - - public static func parse_loginToken(_ reader: BufferReader) -> LoginToken? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.auth.LoginToken.loginToken(Cons_loginToken(expires: _1!, token: _2!)) - } - else { - return nil - } - } - public static func parse_loginTokenMigrateTo(_ reader: BufferReader) -> LoginToken? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Buffer? - _2 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.auth.LoginToken.loginTokenMigrateTo(Cons_loginTokenMigrateTo(dcId: _1!, token: _2!)) - } - else { - return nil - } - } - public static func parse_loginTokenSuccess(_ reader: BufferReader) -> LoginToken? { - var _1: Api.auth.Authorization? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.auth.Authorization - } let _c1 = _1 != nil if _c1 { - return Api.auth.LoginToken.loginTokenSuccess(Cons_loginTokenSuccess(authorization: _1!)) + return Api.account.ContentSettings.contentSettings(Cons_contentSettings(flags: _1!)) } else { return nil @@ -1113,24 +1374,216 @@ public extension Api.auth { } } } -public extension Api.auth { - enum PasskeyLoginOptions: TypeConstructorDescription { - public class Cons_passkeyLoginOptions: TypeConstructorDescription { +public extension Api.account { + enum EmailVerified: TypeConstructorDescription { + public class Cons_emailVerified: TypeConstructorDescription { + public var email: String + public init(email: String) { + self.email = email + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerified", [("email", ConstructorParameterDescription(self.email))]) + } + } + public class Cons_emailVerifiedLogin: TypeConstructorDescription { + public var email: String + public var sentCode: Api.auth.SentCode + public init(email: String, sentCode: Api.auth.SentCode) { + self.email = email + self.sentCode = sentCode + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerifiedLogin", [("email", ConstructorParameterDescription(self.email)), ("sentCode", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .emailVerified(let _data): + return ("emailVerified", [("email", ConstructorParameterDescription(_data.email))]) + case .emailVerifiedLogin(let _data): + return ("emailVerifiedLogin", [("email", ConstructorParameterDescription(_data.email)), ("sentCode", ConstructorParameterDescription(_data.sentCode))]) + } + } + + 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(Cons_emailVerified(email: _1!)) + } + else { + return nil + } + } + public static func parse_emailVerifiedLogin(_ reader: BufferReader) -> EmailVerified? { + var _1: String? + _1 = parseString(reader) + var _2: Api.auth.SentCode? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.auth.SentCode + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.account.EmailVerified.emailVerifiedLogin(Cons_emailVerifiedLogin(email: _1!, sentCode: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum EmojiStatuses: TypeConstructorDescription { + public class Cons_emojiStatuses: TypeConstructorDescription { + public var hash: Int64 + public var statuses: [Api.EmojiStatus] + public init(hash: Int64, statuses: [Api.EmojiStatus]) { + self.hash = hash + self.statuses = statuses + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiStatuses", [("hash", ConstructorParameterDescription(self.hash)), ("statuses", ConstructorParameterDescription(self.statuses))]) + } + } + case emojiStatuses(Cons_emojiStatuses) + 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, ConstructorParameterDescription)]) { + switch self { + case .emojiStatuses(let _data): + return ("emojiStatuses", [("hash", ConstructorParameterDescription(_data.hash)), ("statuses", ConstructorParameterDescription(_data.statuses))]) + case .emojiStatusesNotModified: + return ("emojiStatusesNotModified", []) + } + } + + public static func parse_emojiStatuses(_ reader: BufferReader) -> EmojiStatuses? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.EmojiStatus]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EmojiStatus.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.account.EmojiStatuses.emojiStatuses(Cons_emojiStatuses(hash: _1!, statuses: _2!)) + } + else { + return nil + } + } + public static func parse_emojiStatusesNotModified(_ reader: BufferReader) -> EmojiStatuses? { + return Api.account.EmojiStatuses.emojiStatusesNotModified + } + } +} +public extension Api.account { + enum PaidMessagesRevenue: TypeConstructorDescription { + public class Cons_paidMessagesRevenue: TypeConstructorDescription { + public var starsAmount: Int64 + public init(starsAmount: Int64) { + self.starsAmount = starsAmount + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paidMessagesRevenue", [("starsAmount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .paidMessagesRevenue(let _data): + return ("paidMessagesRevenue", [("starsAmount", ConstructorParameterDescription(_data.starsAmount))]) + } + } + + 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(Cons_paidMessagesRevenue(starsAmount: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum PasskeyRegistrationOptions: TypeConstructorDescription { + public class Cons_passkeyRegistrationOptions: TypeConstructorDescription { public var options: Api.DataJSON public init(options: Api.DataJSON) { self.options = options } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passkeyLoginOptions", [("options", ConstructorParameterDescription(self.options))]) + return ("passkeyRegistrationOptions", [("options", ConstructorParameterDescription(self.options))]) } } - case passkeyLoginOptions(Cons_passkeyLoginOptions) + case passkeyRegistrationOptions(Cons_passkeyRegistrationOptions) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .passkeyLoginOptions(let _data): + case .passkeyRegistrationOptions(let _data): if boxed { - buffer.appendInt32(-503089271) + buffer.appendInt32(-513057567) } _data.options.serialize(buffer, true) break @@ -1139,19 +1592,19 @@ public extension Api.auth { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .passkeyLoginOptions(let _data): - return ("passkeyLoginOptions", [("options", ConstructorParameterDescription(_data.options))]) + case .passkeyRegistrationOptions(let _data): + return ("passkeyRegistrationOptions", [("options", ConstructorParameterDescription(_data.options))]) } } - public static func parse_passkeyLoginOptions(_ reader: BufferReader) -> PasskeyLoginOptions? { + public static func parse_passkeyRegistrationOptions(_ reader: BufferReader) -> PasskeyRegistrationOptions? { var _1: Api.DataJSON? if let signature = reader.readInt32() { _1 = Api.parse(reader, signature: signature) as? Api.DataJSON } let _c1 = _1 != nil if _c1 { - return Api.auth.PasskeyLoginOptions.passkeyLoginOptions(Cons_passkeyLoginOptions(options: _1!)) + return Api.account.PasskeyRegistrationOptions.passkeyRegistrationOptions(Cons_passkeyRegistrationOptions(options: _1!)) } else { return nil @@ -1159,43 +1612,49 @@ public extension Api.auth { } } } -public extension Api.auth { - enum PasswordRecovery: TypeConstructorDescription { - public class Cons_passwordRecovery: TypeConstructorDescription { - public var emailPattern: String - public init(emailPattern: String) { - self.emailPattern = emailPattern +public extension Api.account { + enum Passkeys: TypeConstructorDescription { + public class Cons_passkeys: TypeConstructorDescription { + public var passkeys: [Api.Passkey] + public init(passkeys: [Api.Passkey]) { + self.passkeys = passkeys } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passwordRecovery", [("emailPattern", ConstructorParameterDescription(self.emailPattern))]) + return ("passkeys", [("passkeys", ConstructorParameterDescription(self.passkeys))]) } } - case passwordRecovery(Cons_passwordRecovery) + case passkeys(Cons_passkeys) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .passwordRecovery(let _data): + case .passkeys(let _data): if boxed { - buffer.appendInt32(326715557) + buffer.appendInt32(-119494116) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.passkeys.count)) + for item in _data.passkeys { + item.serialize(buffer, true) } - serializeString(_data.emailPattern, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .passwordRecovery(let _data): - return ("passwordRecovery", [("emailPattern", ConstructorParameterDescription(_data.emailPattern))]) + case .passkeys(let _data): + return ("passkeys", [("passkeys", ConstructorParameterDescription(_data.passkeys))]) } } - public static func parse_passwordRecovery(_ reader: BufferReader) -> PasswordRecovery? { - var _1: String? - _1 = parseString(reader) + public static func parse_passkeys(_ reader: BufferReader) -> Passkeys? { + var _1: [Api.Passkey]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Passkey.self) + } let _c1 = _1 != nil if _c1 { - return Api.auth.PasswordRecovery.passwordRecovery(Cons_passwordRecovery(emailPattern: _1!)) + return Api.account.Passkeys.passkeys(Cons_passkeys(passkeys: _1!)) } else { return nil @@ -1203,175 +1662,301 @@ public extension Api.auth { } } } -public extension Api.auth { - enum SentCode: TypeConstructorDescription { - public class Cons_sentCode: TypeConstructorDescription { +public extension Api.account { + enum Password: TypeConstructorDescription { + public class Cons_password: TypeConstructorDescription { 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?) { + 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.type = type - self.phoneCodeHash = phoneCodeHash - self.nextType = nextType - self.timeout = timeout + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCode", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("nextType", ConstructorParameterDescription(self.nextType)), ("timeout", ConstructorParameterDescription(self.timeout))]) + return ("password", [("flags", ConstructorParameterDescription(self.flags)), ("currentAlgo", ConstructorParameterDescription(self.currentAlgo)), ("srpB", ConstructorParameterDescription(self.srpB)), ("srpId", ConstructorParameterDescription(self.srpId)), ("hint", ConstructorParameterDescription(self.hint)), ("emailUnconfirmedPattern", ConstructorParameterDescription(self.emailUnconfirmedPattern)), ("newAlgo", ConstructorParameterDescription(self.newAlgo)), ("newSecureAlgo", ConstructorParameterDescription(self.newSecureAlgo)), ("secureRandom", ConstructorParameterDescription(self.secureRandom)), ("pendingResetDate", ConstructorParameterDescription(self.pendingResetDate)), ("loginEmailPattern", ConstructorParameterDescription(self.loginEmailPattern))]) } } - public class Cons_sentCodePaymentRequired: TypeConstructorDescription { - public var storeProduct: String - public var phoneCodeHash: String - public var supportEmailAddress: String - public var supportEmailSubject: String - public var premiumDays: Int32 - public var currency: String - public var amount: Int64 - public init(storeProduct: String, phoneCodeHash: String, supportEmailAddress: String, supportEmailSubject: String, premiumDays: Int32, currency: String, amount: Int64) { - self.storeProduct = storeProduct - self.phoneCodeHash = phoneCodeHash - self.supportEmailAddress = supportEmailAddress - self.supportEmailSubject = supportEmailSubject - self.premiumDays = premiumDays - self.currency = currency - self.amount = amount - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodePaymentRequired", [("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("supportEmailAddress", ConstructorParameterDescription(self.supportEmailAddress)), ("supportEmailSubject", ConstructorParameterDescription(self.supportEmailSubject)), ("premiumDays", ConstructorParameterDescription(self.premiumDays)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) - } - } - public class Cons_sentCodeSuccess: TypeConstructorDescription { - public var authorization: Api.auth.Authorization - public init(authorization: Api.auth.Authorization) { - self.authorization = authorization - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeSuccess", [("authorization", ConstructorParameterDescription(self.authorization))]) - } - } - case sentCode(Cons_sentCode) - case sentCodePaymentRequired(Cons_sentCodePaymentRequired) - case sentCodeSuccess(Cons_sentCodeSuccess) + case password(Cons_password) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .sentCode(let _data): + case .password(let _data): if boxed { - buffer.appendInt32(1577067778) + buffer.appendInt32(-1787080453) } 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 { + _data.currentAlgo!.serialize(buffer, true) } if Int(_data.flags) & Int(1 << 2) != 0 { - serializeInt32(_data.timeout!, buffer: buffer, boxed: false) + serializeBytes(_data.srpB!, buffer: buffer, boxed: false) } - break - case .sentCodePaymentRequired(let _data): - if boxed { - buffer.appendInt32(-125665601) + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeInt64(_data.srpId!, buffer: buffer, boxed: false) } - 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) - serializeInt32(_data.premiumDays, 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) + 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) } - _data.authorization.serialize(buffer, true) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .sentCode(let _data): - return ("sentCode", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("nextType", ConstructorParameterDescription(_data.nextType)), ("timeout", ConstructorParameterDescription(_data.timeout))]) - case .sentCodePaymentRequired(let _data): - return ("sentCodePaymentRequired", [("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("supportEmailAddress", ConstructorParameterDescription(_data.supportEmailAddress)), ("supportEmailSubject", ConstructorParameterDescription(_data.supportEmailSubject)), ("premiumDays", ConstructorParameterDescription(_data.premiumDays)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) - case .sentCodeSuccess(let _data): - return ("sentCodeSuccess", [("authorization", ConstructorParameterDescription(_data.authorization))]) + case .password(let _data): + return ("password", [("flags", ConstructorParameterDescription(_data.flags)), ("currentAlgo", ConstructorParameterDescription(_data.currentAlgo)), ("srpB", ConstructorParameterDescription(_data.srpB)), ("srpId", ConstructorParameterDescription(_data.srpId)), ("hint", ConstructorParameterDescription(_data.hint)), ("emailUnconfirmedPattern", ConstructorParameterDescription(_data.emailUnconfirmedPattern)), ("newAlgo", ConstructorParameterDescription(_data.newAlgo)), ("newSecureAlgo", ConstructorParameterDescription(_data.newSecureAlgo)), ("secureRandom", ConstructorParameterDescription(_data.secureRandom)), ("pendingResetDate", ConstructorParameterDescription(_data.pendingResetDate)), ("loginEmailPattern", ConstructorParameterDescription(_data.loginEmailPattern))]) } } - public static func parse_sentCode(_ reader: BufferReader) -> SentCode? { + public static func parse_password(_ reader: BufferReader) -> Password? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.auth.SentCodeType? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.auth.SentCodeType - } - var _3: String? - _3 = parseString(reader) - var _4: Api.auth.CodeType? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { + var _2: Api.PasswordKdfAlgo? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.auth.CodeType + _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo } } - var _5: Int32? + var _3: Buffer? if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _5 = reader.readInt32() + _3 = parseBytes(reader) } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.auth.SentCode.sentCode(Cons_sentCode(flags: _1!, type: _2!, phoneCodeHash: _3!, nextType: _4, timeout: _5)) + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = reader.readInt64() } - else { - return nil + var _5: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _5 = parseString(reader) } - } - public static func parse_sentCodePaymentRequired(_ reader: BufferReader) -> SentCode? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: Int32? - _5 = reader.readInt32() var _6: String? - _6 = parseString(reader) - var _7: Int64? - _7 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.auth.SentCode.sentCodePaymentRequired(Cons_sentCodePaymentRequired(storeProduct: _1!, phoneCodeHash: _2!, supportEmailAddress: _3!, supportEmailSubject: _4!, premiumDays: _5!, currency: _6!, amount: _7!)) + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _6 = parseString(reader) } - else { - return nil - } - } - public static func parse_sentCodeSuccess(_ reader: BufferReader) -> SentCode? { - var _1: Api.auth.Authorization? + var _7: Api.PasswordKdfAlgo? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.auth.Authorization + _7 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo + } + var _8: Api.SecurePasswordKdfAlgo? + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.SecurePasswordKdfAlgo + } + var _9: Buffer? + _9 = parseBytes(reader) + var _10: Int32? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _10 = reader.readInt32() + } + var _11: String? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + _11 = parseString(reader) } let _c1 = _1 != nil - if _c1 { - return Api.auth.SentCode.sentCodeSuccess(Cons_sentCodeSuccess(authorization: _1!)) + let _c2 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _11 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { + 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 { + public class Cons_passwordInputSettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passwordInputSettings", [("flags", ConstructorParameterDescription(self.flags)), ("newAlgo", ConstructorParameterDescription(self.newAlgo)), ("newPasswordHash", ConstructorParameterDescription(self.newPasswordHash)), ("hint", ConstructorParameterDescription(self.hint)), ("email", ConstructorParameterDescription(self.email)), ("newSecureSettings", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .passwordInputSettings(let _data): + return ("passwordInputSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("newAlgo", ConstructorParameterDescription(_data.newAlgo)), ("newPasswordHash", ConstructorParameterDescription(_data.newPasswordHash)), ("hint", ConstructorParameterDescription(_data.hint)), ("email", ConstructorParameterDescription(_data.email)), ("newSecureSettings", ConstructorParameterDescription(_data.newSecureSettings))]) + } + } + + public static func parse_passwordInputSettings(_ reader: BufferReader) -> PasswordInputSettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.PasswordKdfAlgo? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PasswordKdfAlgo + } + } + var _3: Buffer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = parseBytes(reader) + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + var _6: Api.SecureSecretSettings? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_passwordSettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passwordSettings", [("flags", ConstructorParameterDescription(self.flags)), ("email", ConstructorParameterDescription(self.email)), ("secureSettings", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .passwordSettings(let _data): + return ("passwordSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("email", ConstructorParameterDescription(_data.email)), ("secureSettings", ConstructorParameterDescription(_data.secureSettings))]) + } + } + + public static func parse_passwordSettings(_ reader: BufferReader) -> PasswordSettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + var _3: Api.SecureSecretSettings? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.account.PasswordSettings.passwordSettings(Cons_passwordSettings(flags: _1!, email: _2, secureSettings: _3)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api32.swift b/submodules/TelegramApi/Sources/Api32.swift index fbf3ae21e5..490b0d6ae1 100644 --- a/submodules/TelegramApi/Sources/Api32.swift +++ b/submodules/TelegramApi/Sources/Api32.swift @@ -1,242 +1,40 @@ -public extension Api.auth { - enum SentCodeType: TypeConstructorDescription { - public class Cons_sentCodeTypeApp: TypeConstructorDescription { - public var length: Int32 - public init(length: Int32) { - self.length = length +public extension Api.account { + enum PrivacyRules: TypeConstructorDescription { + public class Cons_privacyRules: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeApp", [("length", ConstructorParameterDescription(self.length))]) + return ("privacyRules", [("rules", ConstructorParameterDescription(self.rules)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - public class Cons_sentCodeTypeCall: TypeConstructorDescription { - public var length: Int32 - public init(length: Int32) { - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeCall", [("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_sentCodeTypeEmailCode: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeEmailCode", [("flags", ConstructorParameterDescription(self.flags)), ("emailPattern", ConstructorParameterDescription(self.emailPattern)), ("length", ConstructorParameterDescription(self.length)), ("resetAvailablePeriod", ConstructorParameterDescription(self.resetAvailablePeriod)), ("resetPendingDate", ConstructorParameterDescription(self.resetPendingDate))]) - } - } - public class Cons_sentCodeTypeFirebaseSms: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeFirebaseSms", [("flags", ConstructorParameterDescription(self.flags)), ("nonce", ConstructorParameterDescription(self.nonce)), ("playIntegrityProjectId", ConstructorParameterDescription(self.playIntegrityProjectId)), ("playIntegrityNonce", ConstructorParameterDescription(self.playIntegrityNonce)), ("receipt", ConstructorParameterDescription(self.receipt)), ("pushTimeout", ConstructorParameterDescription(self.pushTimeout)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_sentCodeTypeFlashCall: TypeConstructorDescription { - public var pattern: String - public init(pattern: String) { - self.pattern = pattern - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeFlashCall", [("pattern", ConstructorParameterDescription(self.pattern))]) - } - } - public class Cons_sentCodeTypeFragmentSms: TypeConstructorDescription { - public var url: String - public var length: Int32 - public init(url: String, length: Int32) { - self.url = url - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeFragmentSms", [("url", ConstructorParameterDescription(self.url)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_sentCodeTypeMissedCall: TypeConstructorDescription { - public var prefix: String - public var length: Int32 - public init(prefix: String, length: Int32) { - self.prefix = prefix - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeMissedCall", [("prefix", ConstructorParameterDescription(self.prefix)), ("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_sentCodeTypeSetUpEmailRequired: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeSetUpEmailRequired", [("flags", ConstructorParameterDescription(self.flags))]) - } - } - public class Cons_sentCodeTypeSms: TypeConstructorDescription { - public var length: Int32 - public init(length: Int32) { - self.length = length - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeSms", [("length", ConstructorParameterDescription(self.length))]) - } - } - public class Cons_sentCodeTypeSmsPhrase: TypeConstructorDescription { - public var flags: Int32 - public var beginning: String? - public init(flags: Int32, beginning: String?) { - self.flags = flags - self.beginning = beginning - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeSmsPhrase", [("flags", ConstructorParameterDescription(self.flags)), ("beginning", ConstructorParameterDescription(self.beginning))]) - } - } - public class Cons_sentCodeTypeSmsWord: TypeConstructorDescription { - public var flags: Int32 - public var beginning: String? - public init(flags: Int32, beginning: String?) { - self.flags = flags - self.beginning = beginning - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentCodeTypeSmsWord", [("flags", ConstructorParameterDescription(self.flags)), ("beginning", ConstructorParameterDescription(self.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) + case privacyRules(Cons_privacyRules) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .sentCodeTypeApp(let _data): + case .privacyRules(let _data): if boxed { - buffer.appendInt32(1035688326) + buffer.appendInt32(1352683077) } - serializeInt32(_data.length, buffer: buffer, boxed: false) - break - case .sentCodeTypeCall(let _data): - if boxed { - buffer.appendInt32(1398007207) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.rules.count)) + for item in _data.rules { + item.serialize(buffer, true) } - serializeInt32(_data.length, buffer: buffer, boxed: false) - break - case .sentCodeTypeEmailCode(let _data): - if boxed { - buffer.appendInt32(-196020837) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { + item.serialize(buffer, true) } - 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) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) } break } @@ -244,207 +42,29 @@ public extension Api.auth { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .sentCodeTypeApp(let _data): - return ("sentCodeTypeApp", [("length", ConstructorParameterDescription(_data.length))]) - case .sentCodeTypeCall(let _data): - return ("sentCodeTypeCall", [("length", ConstructorParameterDescription(_data.length))]) - case .sentCodeTypeEmailCode(let _data): - return ("sentCodeTypeEmailCode", [("flags", ConstructorParameterDescription(_data.flags)), ("emailPattern", ConstructorParameterDescription(_data.emailPattern)), ("length", ConstructorParameterDescription(_data.length)), ("resetAvailablePeriod", ConstructorParameterDescription(_data.resetAvailablePeriod)), ("resetPendingDate", ConstructorParameterDescription(_data.resetPendingDate))]) - case .sentCodeTypeFirebaseSms(let _data): - return ("sentCodeTypeFirebaseSms", [("flags", ConstructorParameterDescription(_data.flags)), ("nonce", ConstructorParameterDescription(_data.nonce)), ("playIntegrityProjectId", ConstructorParameterDescription(_data.playIntegrityProjectId)), ("playIntegrityNonce", ConstructorParameterDescription(_data.playIntegrityNonce)), ("receipt", ConstructorParameterDescription(_data.receipt)), ("pushTimeout", ConstructorParameterDescription(_data.pushTimeout)), ("length", ConstructorParameterDescription(_data.length))]) - case .sentCodeTypeFlashCall(let _data): - return ("sentCodeTypeFlashCall", [("pattern", ConstructorParameterDescription(_data.pattern))]) - case .sentCodeTypeFragmentSms(let _data): - return ("sentCodeTypeFragmentSms", [("url", ConstructorParameterDescription(_data.url)), ("length", ConstructorParameterDescription(_data.length))]) - case .sentCodeTypeMissedCall(let _data): - return ("sentCodeTypeMissedCall", [("prefix", ConstructorParameterDescription(_data.prefix)), ("length", ConstructorParameterDescription(_data.length))]) - case .sentCodeTypeSetUpEmailRequired(let _data): - return ("sentCodeTypeSetUpEmailRequired", [("flags", ConstructorParameterDescription(_data.flags))]) - case .sentCodeTypeSms(let _data): - return ("sentCodeTypeSms", [("length", ConstructorParameterDescription(_data.length))]) - case .sentCodeTypeSmsPhrase(let _data): - return ("sentCodeTypeSmsPhrase", [("flags", ConstructorParameterDescription(_data.flags)), ("beginning", ConstructorParameterDescription(_data.beginning))]) - case .sentCodeTypeSmsWord(let _data): - return ("sentCodeTypeSmsWord", [("flags", ConstructorParameterDescription(_data.flags)), ("beginning", ConstructorParameterDescription(_data.beginning))]) + case .privacyRules(let _data): + return ("privacyRules", [("rules", ConstructorParameterDescription(_data.rules)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - 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(Cons_sentCodeTypeApp(length: _1!)) + public static func parse_privacyRules(_ reader: BufferReader) -> PrivacyRules? { + var _1: [Api.PrivacyRule]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrivacyRule.self) } - else { - return nil + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } - } - public static func parse_sentCodeTypeCall(_ reader: BufferReader) -> SentCodeType? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.auth.SentCodeType.sentCodeTypeCall(Cons_sentCodeTypeCall(length: _1!)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeEmailCode(_ reader: BufferReader) -> SentCodeType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _4 = reader.readInt32() - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = reader.readInt32() + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.auth.SentCodeType.sentCodeTypeEmailCode(Cons_sentCodeTypeEmailCode(flags: _1!, emailPattern: _2!, length: _3!, resetAvailablePeriod: _4, resetPendingDate: _5)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeFirebaseSms(_ reader: BufferReader) -> SentCodeType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Buffer? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseBytes(reader) - } - var _3: Int64? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = reader.readInt64() - } - var _4: Buffer? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = parseBytes(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _6 = reader.readInt32() - } - var _7: Int32? - _7 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.auth.SentCodeType.sentCodeTypeFirebaseSms(Cons_sentCodeTypeFirebaseSms(flags: _1!, nonce: _2, playIntegrityProjectId: _3, playIntegrityNonce: _4, receipt: _5, pushTimeout: _6, length: _7!)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeFlashCall(_ reader: BufferReader) -> SentCodeType? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.auth.SentCodeType.sentCodeTypeFlashCall(Cons_sentCodeTypeFlashCall(pattern: _1!)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeFragmentSms(_ reader: BufferReader) -> SentCodeType? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeFragmentSms(Cons_sentCodeTypeFragmentSms(url: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeMissedCall(_ reader: BufferReader) -> SentCodeType? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeMissedCall(Cons_sentCodeTypeMissedCall(prefix: _1!, length: _2!)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeSetUpEmailRequired(_ reader: BufferReader) -> SentCodeType? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.auth.SentCodeType.sentCodeTypeSetUpEmailRequired(Cons_sentCodeTypeSetUpEmailRequired(flags: _1!)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeSms(_ reader: BufferReader) -> SentCodeType? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.auth.SentCodeType.sentCodeTypeSms(Cons_sentCodeTypeSms(length: _1!)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeSmsPhrase(_ reader: BufferReader) -> SentCodeType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeSmsPhrase(Cons_sentCodeTypeSmsPhrase(flags: _1!, beginning: _2)) - } - else { - return nil - } - } - public static func parse_sentCodeTypeSmsWord(_ reader: BufferReader) -> SentCodeType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.auth.SentCodeType.sentCodeTypeSmsWord(Cons_sentCodeTypeSmsWord(flags: _1!, beginning: _2)) + if _c1 && _c2 && _c3 { + return Api.account.PrivacyRules.privacyRules(Cons_privacyRules(rules: _1!, chats: _2!, users: _3!)) } else { return nil @@ -452,845 +72,164 @@ public extension Api.auth { } } } -public extension Api.bots { - enum AccessSettings: TypeConstructorDescription { - public class Cons_accessSettings: TypeConstructorDescription { - public var flags: Int32 - public var addUsers: [Api.User]? - public init(flags: Int32, addUsers: [Api.User]?) { - self.flags = flags - self.addUsers = addUsers +public extension Api.account { + enum ResetPasswordResult: TypeConstructorDescription { + public class Cons_resetPasswordFailedWait: TypeConstructorDescription { + public var retryDate: Int32 + public init(retryDate: Int32) { + self.retryDate = retryDate } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("accessSettings", [("flags", ConstructorParameterDescription(self.flags)), ("addUsers", ConstructorParameterDescription(self.addUsers))]) + return ("resetPasswordFailedWait", [("retryDate", ConstructorParameterDescription(self.retryDate))]) } } - case accessSettings(Cons_accessSettings) + public class Cons_resetPasswordRequestedWait: TypeConstructorDescription { + public var untilDate: Int32 + public init(untilDate: Int32) { + self.untilDate = untilDate + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("resetPasswordRequestedWait", [("untilDate", ConstructorParameterDescription(self.untilDate))]) + } + } + case resetPasswordFailedWait(Cons_resetPasswordFailedWait) + case resetPasswordOk + case resetPasswordRequestedWait(Cons_resetPasswordRequestedWait) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .accessSettings(let _data): + case .resetPasswordFailedWait(let _data): if boxed { - buffer.appendInt32(-585121901) + 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, ConstructorParameterDescription)]) { + switch self { + case .resetPasswordFailedWait(let _data): + return ("resetPasswordFailedWait", [("retryDate", ConstructorParameterDescription(_data.retryDate))]) + case .resetPasswordOk: + return ("resetPasswordOk", []) + case .resetPasswordRequestedWait(let _data): + return ("resetPasswordRequestedWait", [("untilDate", ConstructorParameterDescription(_data.untilDate))]) + } + } + + 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(Cons_resetPasswordFailedWait(retryDate: _1!)) + } + else { + return nil + } + } + public static func parse_resetPasswordOk(_ reader: BufferReader) -> ResetPasswordResult? { + return Api.account.ResetPasswordResult.resetPasswordOk + } + public static func parse_resetPasswordRequestedWait(_ reader: BufferReader) -> ResetPasswordResult? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.account.ResetPasswordResult.resetPasswordRequestedWait(Cons_resetPasswordRequestedWait(untilDate: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum ResolvedBusinessChatLinks: TypeConstructorDescription { + public class Cons_resolvedBusinessChatLinks: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("resolvedBusinessChatLinks", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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) - if Int(_data.flags) & Int(1 << 1) != 0 { + _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(_data.addUsers!.count)) - for item in _data.addUsers! { + buffer.appendInt32(Int32(_data.entities!.count)) + for item in _data.entities! { 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, ConstructorParameterDescription)]) { switch self { - case .accessSettings(let _data): - return ("accessSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("addUsers", ConstructorParameterDescription(_data.addUsers))]) + case .resolvedBusinessChatLinks(let _data): + return ("resolvedBusinessChatLinks", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_accessSettings(_ reader: BufferReader) -> AccessSettings? { + public static func parse_resolvedBusinessChatLinks(_ reader: BufferReader) -> ResolvedBusinessChatLinks? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.User]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } + var _2: Api.Peer? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - if _c1 && _c2 { - return Api.bots.AccessSettings.accessSettings(Cons_accessSettings(flags: _1!, addUsers: _2)) - } - else { - return nil - } - } - } -} -public extension Api.bots { - enum BotInfo: TypeConstructorDescription { - public class Cons_botInfo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("botInfo", [("name", ConstructorParameterDescription(self.name)), ("about", ConstructorParameterDescription(self.about)), ("description", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .botInfo(let _data): - return ("botInfo", [("name", ConstructorParameterDescription(_data.name)), ("about", ConstructorParameterDescription(_data.about)), ("description", ConstructorParameterDescription(_data.description))]) - } - } - - public static func parse_botInfo(_ reader: BufferReader) -> BotInfo? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) var _3: String? _3 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.bots.BotInfo.botInfo(Cons_botInfo(name: _1!, about: _2!, description: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.bots { - enum ExportedBotToken: TypeConstructorDescription { - public class Cons_exportedBotToken: TypeConstructorDescription { - public var token: String - public init(token: String) { - self.token = token - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedBotToken", [("token", ConstructorParameterDescription(self.token))]) - } - } - case exportedBotToken(Cons_exportedBotToken) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .exportedBotToken(let _data): - if boxed { - buffer.appendInt32(1012971041) - } - serializeString(_data.token, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .exportedBotToken(let _data): - return ("exportedBotToken", [("token", ConstructorParameterDescription(_data.token))]) - } - } - - public static func parse_exportedBotToken(_ reader: BufferReader) -> ExportedBotToken? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.bots.ExportedBotToken.exportedBotToken(Cons_exportedBotToken(token: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.bots { - enum PopularAppBots: TypeConstructorDescription { - public class Cons_popularAppBots: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("popularAppBots", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .popularAppBots(let _data): - return ("popularAppBots", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_popularAppBots(_ reader: BufferReader) -> PopularAppBots? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? + var _4: [Api.MessageEntity]? if Int(_1 ?? 0) & 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) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.bots.PopularAppBots.popularAppBots(Cons_popularAppBots(flags: _1!, nextOffset: _2, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.bots { - enum PreviewInfo: TypeConstructorDescription { - public class Cons_previewInfo: TypeConstructorDescription { - public var media: [Api.BotPreviewMedia] - public var langCodes: [String] - public init(media: [Api.BotPreviewMedia], langCodes: [String]) { - self.media = media - self.langCodes = langCodes - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("previewInfo", [("media", ConstructorParameterDescription(self.media)), ("langCodes", ConstructorParameterDescription(self.langCodes))]) - } - } - case previewInfo(Cons_previewInfo) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .previewInfo(let _data): - if boxed { - buffer.appendInt32(212278628) + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) } - 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, ConstructorParameterDescription)]) { - switch self { - case .previewInfo(let _data): - return ("previewInfo", [("media", ConstructorParameterDescription(_data.media)), ("langCodes", ConstructorParameterDescription(_data.langCodes))]) - } - } - - public static func parse_previewInfo(_ reader: BufferReader) -> PreviewInfo? { - var _1: [Api.BotPreviewMedia]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotPreviewMedia.self) - } - var _2: [String]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.bots.PreviewInfo.previewInfo(Cons_previewInfo(media: _1!, langCodes: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.bots { - enum RequestedButton: TypeConstructorDescription { - public class Cons_requestedButton: TypeConstructorDescription { - public var webappReqId: String - public init(webappReqId: String) { - self.webappReqId = webappReqId - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("requestedButton", [("webappReqId", ConstructorParameterDescription(self.webappReqId))]) - } - } - case requestedButton(Cons_requestedButton) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .requestedButton(let _data): - if boxed { - buffer.appendInt32(-247743273) - } - serializeString(_data.webappReqId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .requestedButton(let _data): - return ("requestedButton", [("webappReqId", ConstructorParameterDescription(_data.webappReqId))]) - } - } - - public static func parse_requestedButton(_ reader: BufferReader) -> RequestedButton? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.bots.RequestedButton.requestedButton(Cons_requestedButton(webappReqId: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.channels { - enum AdminLogResults: TypeConstructorDescription { - public class Cons_adminLogResults: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("adminLogResults", [("events", ConstructorParameterDescription(self.events)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .adminLogResults(let _data): - return ("adminLogResults", [("events", ConstructorParameterDescription(_data.events)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_adminLogResults(_ reader: BufferReader) -> AdminLogResults? { - var _1: [Api.ChannelAdminLogEvent]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChannelAdminLogEvent.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.channels.AdminLogResults.adminLogResults(Cons_adminLogResults(events: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.channels { - enum ChannelParticipant: TypeConstructorDescription { - public class Cons_channelParticipant: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("channelParticipant", [("participant", ConstructorParameterDescription(self.participant)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .channelParticipant(let _data): - return ("channelParticipant", [("participant", ConstructorParameterDescription(_data.participant)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_channelParticipant(_ reader: BufferReader) -> ChannelParticipant? { - var _1: Api.ChannelParticipant? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.channels.ChannelParticipant.channelParticipant(Cons_channelParticipant(participant: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.channels { - enum ChannelParticipants: TypeConstructorDescription { - public class Cons_channelParticipants: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("channelParticipants", [("count", ConstructorParameterDescription(self.count)), ("participants", ConstructorParameterDescription(self.participants)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case channelParticipants(Cons_channelParticipants) - 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, ConstructorParameterDescription)]) { - switch self { - case .channelParticipants(let _data): - return ("channelParticipants", [("count", ConstructorParameterDescription(_data.count)), ("participants", ConstructorParameterDescription(_data.participants)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .channelParticipantsNotModified: - return ("channelParticipantsNotModified", []) - } - } - - public static func parse_channelParticipants(_ reader: BufferReader) -> ChannelParticipants? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.ChannelParticipant]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChannelParticipant.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.channels.ChannelParticipants.channelParticipants(Cons_channelParticipants(count: _1!, participants: _2!, chats: _3!, users: _4!)) - } - else { - return nil - } - } - public static func parse_channelParticipantsNotModified(_ reader: BufferReader) -> ChannelParticipants? { - return Api.channels.ChannelParticipants.channelParticipantsNotModified - } - } -} -public extension Api.channels { - enum SendAsPeers: TypeConstructorDescription { - public class Cons_sendAsPeers: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sendAsPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .sendAsPeers(let _data): - return ("sendAsPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_sendAsPeers(_ reader: BufferReader) -> SendAsPeers? { - var _1: [Api.SendAsPeer]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SendAsPeer.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - 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: TypeConstructorDescription { - public var title: String - public var options: [Api.SponsoredMessageReportOption] - public init(title: String, options: [Api.SponsoredMessageReportOption]) { - self.title = title - self.options = options - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sponsoredMessageReportResultChooseOption", [("title", ConstructorParameterDescription(self.title)), ("options", ConstructorParameterDescription(self.options))]) - } - } - case sponsoredMessageReportResultAdsHidden - 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 _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, ConstructorParameterDescription)]) { - switch self { - case .sponsoredMessageReportResultAdsHidden: - return ("sponsoredMessageReportResultAdsHidden", []) - case .sponsoredMessageReportResultChooseOption(let _data): - return ("sponsoredMessageReportResultChooseOption", [("title", ConstructorParameterDescription(_data.title)), ("options", ConstructorParameterDescription(_data.options))]) - case .sponsoredMessageReportResultReported: - return ("sponsoredMessageReportResultReported", []) - } - } - - public static func parse_sponsoredMessageReportResultAdsHidden(_ reader: BufferReader) -> SponsoredMessageReportResult? { - return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultAdsHidden - } - public static func parse_sponsoredMessageReportResultChooseOption(_ reader: BufferReader) -> SponsoredMessageReportResult? { - var _1: String? - _1 = parseString(reader) - var _2: [Api.SponsoredMessageReportOption]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SponsoredMessageReportOption.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultChooseOption(Cons_sponsoredMessageReportResultChooseOption(title: _1!, options: _2!)) - } - else { - return nil - } - } - public static func parse_sponsoredMessageReportResultReported(_ reader: BufferReader) -> SponsoredMessageReportResult? { - return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultReported - } - } -} -public extension Api.chatlists { - enum ChatlistInvite: TypeConstructorDescription { - public class Cons_chatlistInvite: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatlistInvite", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_chatlistInviteAlready: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatlistInviteAlready", [("filterId", ConstructorParameterDescription(self.filterId)), ("missingPeers", ConstructorParameterDescription(self.missingPeers)), ("alreadyPeers", ConstructorParameterDescription(self.alreadyPeers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .chatlistInvite(let _data): - return ("chatlistInvite", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .chatlistInviteAlready(let _data): - return ("chatlistInviteAlready", [("filterId", ConstructorParameterDescription(_data.filterId)), ("missingPeers", ConstructorParameterDescription(_data.missingPeers)), ("alreadyPeers", ConstructorParameterDescription(_data.alreadyPeers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_chatlistInvite(_ reader: BufferReader) -> ChatlistInvite? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - var _3: String? - if Int(_1 ?? 0) & 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) } var _5: [Api.Chat]? if let _ = reader.readInt32() { @@ -1302,43 +241,12 @@ public extension Api.chatlists { } let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = _4 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil let _c5 = _5 != nil let _c6 = _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.chatlists.ChatlistInvite.chatlistInvite(Cons_chatlistInvite(flags: _1!, title: _2!, emoticon: _3, peers: _4!, chats: _5!, users: _6!)) - } - else { - return nil - } - } - public static func parse_chatlistInviteAlready(_ reader: BufferReader) -> ChatlistInvite? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Peer]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - var _3: [Api.Peer]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.chatlists.ChatlistInvite.chatlistInviteAlready(Cons_chatlistInviteAlready(filterId: _1!, missingPeers: _2!, alreadyPeers: _3!, chats: _4!, users: _5!)) + return Api.account.ResolvedBusinessChatLinks.resolvedBusinessChatLinks(Cons_resolvedBusinessChatLinks(flags: _1!, peer: _2!, message: _3!, entities: _4, chats: _5!, users: _6!)) } else { return nil @@ -1346,43 +254,35 @@ public extension Api.chatlists { } } } -public extension Api.chatlists { - enum ChatlistUpdates: TypeConstructorDescription { - public class Cons_chatlistUpdates: TypeConstructorDescription { - 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 +public extension Api.account { + enum SavedMusicIds: TypeConstructorDescription { + public class Cons_savedMusicIds: TypeConstructorDescription { + public var ids: [Int64] + public init(ids: [Int64]) { + self.ids = ids } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatlistUpdates", [("missingPeers", ConstructorParameterDescription(self.missingPeers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("savedMusicIds", [("ids", ConstructorParameterDescription(self.ids))]) } } - case chatlistUpdates(Cons_chatlistUpdates) + case savedMusicIds(Cons_savedMusicIds) + case savedMusicIdsNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .chatlistUpdates(let _data): + case .savedMusicIds(let _data): if boxed { - buffer.appendInt32(-1816295539) + buffer.appendInt32(-1718786506) } buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.missingPeers.count)) - for item in _data.missingPeers { - item.serialize(buffer, true) + buffer.appendInt32(Int32(_data.ids.count)) + for item in _data.ids { + serializeInt64(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 + case .savedMusicIdsNotModified: + if boxed { + buffer.appendInt32(1338514798) } break } @@ -1390,29 +290,81 @@ public extension Api.chatlists { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .chatlistUpdates(let _data): - return ("chatlistUpdates", [("missingPeers", ConstructorParameterDescription(_data.missingPeers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .savedMusicIds(let _data): + return ("savedMusicIds", [("ids", ConstructorParameterDescription(_data.ids))]) + case .savedMusicIdsNotModified: + return ("savedMusicIdsNotModified", []) } } - public static func parse_chatlistUpdates(_ reader: BufferReader) -> ChatlistUpdates? { - var _1: [Api.Peer]? + public static func parse_savedMusicIds(_ reader: BufferReader) -> SavedMusicIds? { + var _1: [Int64]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) } let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.chatlists.ChatlistUpdates.chatlistUpdates(Cons_chatlistUpdates(missingPeers: _1!, chats: _2!, users: _3!)) + if _c1 { + return Api.account.SavedMusicIds.savedMusicIds(Cons_savedMusicIds(ids: _1!)) + } + else { + return nil + } + } + public static func parse_savedMusicIdsNotModified(_ reader: BufferReader) -> SavedMusicIds? { + return Api.account.SavedMusicIds.savedMusicIdsNotModified + } + } +} +public extension Api.account { + enum SavedRingtone: TypeConstructorDescription { + public class Cons_savedRingtoneConverted: TypeConstructorDescription { + public var document: Api.Document + public init(document: Api.Document) { + self.document = document + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedRingtoneConverted", [("document", ConstructorParameterDescription(self.document))]) + } + } + 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, ConstructorParameterDescription)]) { + switch self { + case .savedRingtone: + return ("savedRingtone", []) + case .savedRingtoneConverted(let _data): + return ("savedRingtoneConverted", [("document", ConstructorParameterDescription(_data.document))]) + } + } + + public static func parse_savedRingtone(_ reader: BufferReader) -> SavedRingtone? { + return Api.account.SavedRingtone.savedRingtone + } + public static func parse_savedRingtoneConverted(_ reader: BufferReader) -> SavedRingtone? { + var _1: Api.Document? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Document + } + let _c1 = _1 != nil + if _c1 { + return Api.account.SavedRingtone.savedRingtoneConverted(Cons_savedRingtoneConverted(document: _1!)) } else { return nil @@ -1420,53 +372,116 @@ public extension Api.chatlists { } } } -public extension Api.chatlists { - enum ExportedChatlistInvite: TypeConstructorDescription { - public class Cons_exportedChatlistInvite: TypeConstructorDescription { - public var filter: Api.DialogFilter - public var invite: Api.ExportedChatlistInvite - public init(filter: Api.DialogFilter, invite: Api.ExportedChatlistInvite) { - self.filter = filter - self.invite = invite +public extension Api.account { + enum SavedRingtones: TypeConstructorDescription { + public class Cons_savedRingtones: TypeConstructorDescription { + public var hash: Int64 + public var ringtones: [Api.Document] + public init(hash: Int64, ringtones: [Api.Document]) { + self.hash = hash + self.ringtones = ringtones } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedChatlistInvite", [("filter", ConstructorParameterDescription(self.filter)), ("invite", ConstructorParameterDescription(self.invite))]) + return ("savedRingtones", [("hash", ConstructorParameterDescription(self.hash)), ("ringtones", ConstructorParameterDescription(self.ringtones))]) } } - case exportedChatlistInvite(Cons_exportedChatlistInvite) + case savedRingtones(Cons_savedRingtones) + case savedRingtonesNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .exportedChatlistInvite(let _data): + case .savedRingtones(let _data): if boxed { - buffer.appendInt32(283567014) + 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) } - _data.filter.serialize(buffer, true) - _data.invite.serialize(buffer, true) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .exportedChatlistInvite(let _data): - return ("exportedChatlistInvite", [("filter", ConstructorParameterDescription(_data.filter)), ("invite", ConstructorParameterDescription(_data.invite))]) + case .savedRingtones(let _data): + return ("savedRingtones", [("hash", ConstructorParameterDescription(_data.hash)), ("ringtones", ConstructorParameterDescription(_data.ringtones))]) + case .savedRingtonesNotModified: + return ("savedRingtonesNotModified", []) } } - public static func parse_exportedChatlistInvite(_ reader: BufferReader) -> ExportedChatlistInvite? { - var _1: Api.DialogFilter? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.DialogFilter - } - var _2: Api.ExportedChatlistInvite? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ExportedChatlistInvite + public static func parse_savedRingtones(_ reader: BufferReader) -> SavedRingtones? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.Document]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.chatlists.ExportedChatlistInvite.exportedChatlistInvite(Cons_exportedChatlistInvite(filter: _1!, invite: _2!)) + return Api.account.SavedRingtones.savedRingtones(Cons_savedRingtones(hash: _1!, ringtones: _2!)) + } + else { + return nil + } + } + public static func parse_savedRingtonesNotModified(_ reader: BufferReader) -> SavedRingtones? { + return Api.account.SavedRingtones.savedRingtonesNotModified + } + } +} +public extension Api.account { + enum SentEmailCode: TypeConstructorDescription { + public class Cons_sentEmailCode: TypeConstructorDescription { + public var emailPattern: String + public var length: Int32 + public init(emailPattern: String, length: Int32) { + self.emailPattern = emailPattern + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentEmailCode", [("emailPattern", ConstructorParameterDescription(self.emailPattern)), ("length", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .sentEmailCode(let _data): + return ("sentEmailCode", [("emailPattern", ConstructorParameterDescription(_data.emailPattern)), ("length", ConstructorParameterDescription(_data.length))]) + } + } + + public static func parse_sentEmailCode(_ reader: BufferReader) -> SentEmailCode? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.account.SentEmailCode.sentEmailCode(Cons_sentEmailCode(emailPattern: _1!, length: _2!)) } else { return nil @@ -1474,37 +489,258 @@ public extension Api.chatlists { } } } -public extension Api.chatlists { - enum ExportedInvites: TypeConstructorDescription { - public class Cons_exportedInvites: TypeConstructorDescription { - 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 +public extension Api.account { + enum Takeout: TypeConstructorDescription { + public class Cons_takeout: TypeConstructorDescription { + public var id: Int64 + public init(id: Int64) { + self.id = id } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedInvites", [("invites", ConstructorParameterDescription(self.invites)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("takeout", [("id", ConstructorParameterDescription(self.id))]) } } - case exportedInvites(Cons_exportedInvites) + case takeout(Cons_takeout) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .exportedInvites(let _data): + case .takeout(let _data): if boxed { - buffer.appendInt32(279670215) + buffer.appendInt32(1304052993) } + serializeInt64(_data.id, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .takeout(let _data): + return ("takeout", [("id", ConstructorParameterDescription(_data.id))]) + } + } + + 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(Cons_takeout(id: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum Themes: TypeConstructorDescription { + public class Cons_themes: TypeConstructorDescription { + public var hash: Int64 + public var themes: [Api.Theme] + public init(hash: Int64, themes: [Api.Theme]) { + self.hash = hash + self.themes = themes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("themes", [("hash", ConstructorParameterDescription(self.hash)), ("themes", ConstructorParameterDescription(self.themes))]) + } + } + case themes(Cons_themes) + 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.invites.count)) - for item in _data.invites { + 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, ConstructorParameterDescription)]) { + switch self { + case .themes(let _data): + return ("themes", [("hash", ConstructorParameterDescription(_data.hash)), ("themes", ConstructorParameterDescription(_data.themes))]) + case .themesNotModified: + return ("themesNotModified", []) + } + } + + public static func parse_themes(_ reader: BufferReader) -> Themes? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.Theme]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Theme.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.account.Themes.themes(Cons_themes(hash: _1!, themes: _2!)) + } + else { + return nil + } + } + public static func parse_themesNotModified(_ reader: BufferReader) -> Themes? { + return Api.account.Themes.themesNotModified + } + } +} +public extension Api.account { + enum TmpPassword: TypeConstructorDescription { + public class Cons_tmpPassword: TypeConstructorDescription { + public var tmpPassword: Buffer + public var validUntil: Int32 + public init(tmpPassword: Buffer, validUntil: Int32) { + self.tmpPassword = tmpPassword + self.validUntil = validUntil + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("tmpPassword", [("tmpPassword", ConstructorParameterDescription(self.tmpPassword)), ("validUntil", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .tmpPassword(let _data): + return ("tmpPassword", [("tmpPassword", ConstructorParameterDescription(_data.tmpPassword)), ("validUntil", ConstructorParameterDescription(_data.validUntil))]) + } + } + + public static func parse_tmpPassword(_ reader: BufferReader) -> TmpPassword? { + var _1: Buffer? + _1 = parseBytes(reader) + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.account.TmpPassword.tmpPassword(Cons_tmpPassword(tmpPassword: _1!, validUntil: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.account { + enum WallPapers: TypeConstructorDescription { + public class Cons_wallPapers: TypeConstructorDescription { + public var hash: Int64 + public var wallpapers: [Api.WallPaper] + public init(hash: Int64, wallpapers: [Api.WallPaper]) { + self.hash = hash + self.wallpapers = wallpapers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("wallPapers", [("hash", ConstructorParameterDescription(self.hash)), ("wallpapers", ConstructorParameterDescription(self.wallpapers))]) + } + } + case wallPapers(Cons_wallPapers) + 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.chats.count)) - for item in _data.chats { + 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, ConstructorParameterDescription)]) { + switch self { + case .wallPapers(let _data): + return ("wallPapers", [("hash", ConstructorParameterDescription(_data.hash)), ("wallpapers", ConstructorParameterDescription(_data.wallpapers))]) + case .wallPapersNotModified: + return ("wallPapersNotModified", []) + } + } + + public static func parse_wallPapers(_ reader: BufferReader) -> WallPapers? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.WallPaper]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WallPaper.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.account.WallPapers.wallPapers(Cons_wallPapers(hash: _1!, wallpapers: _2!)) + } + else { + return nil + } + } + public static func parse_wallPapersNotModified(_ reader: BufferReader) -> WallPapers? { + return Api.account.WallPapers.wallPapersNotModified + } + } +} +public extension Api.account { + enum WebAuthorizations: TypeConstructorDescription { + public class Cons_webAuthorizations: TypeConstructorDescription { + public var authorizations: [Api.WebAuthorization] + public var users: [Api.User] + public init(authorizations: [Api.WebAuthorization], users: [Api.User]) { + self.authorizations = authorizations + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webAuthorizations", [("authorizations", ConstructorParameterDescription(self.authorizations)), ("users", ConstructorParameterDescription(self.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) @@ -1518,29 +754,24 @@ public extension Api.chatlists { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .exportedInvites(let _data): - return ("exportedInvites", [("invites", ConstructorParameterDescription(_data.invites)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .webAuthorizations(let _data): + return ("webAuthorizations", [("authorizations", ConstructorParameterDescription(_data.authorizations)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_exportedInvites(_ reader: BufferReader) -> ExportedInvites? { - var _1: [Api.ExportedChatlistInvite]? + public static func parse_webAuthorizations(_ reader: BufferReader) -> WebAuthorizations? { + var _1: [Api.WebAuthorization]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ExportedChatlistInvite.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WebAuthorization.self) } - var _2: [Api.Chat]? + var _2: [Api.User]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.chatlists.ExportedInvites.exportedInvites(Cons_exportedInvites(invites: _1!, chats: _2!, users: _3!)) + if _c1 && _c2 { + return Api.account.WebAuthorizations.webAuthorizations(Cons_webAuthorizations(authorizations: _1!, users: _2!)) } else { return nil @@ -1548,80 +779,48 @@ public extension Api.chatlists { } } } -public extension Api.contacts { - enum Blocked: TypeConstructorDescription { - public class Cons_blocked: TypeConstructorDescription { - 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 extension Api.account { + enum WebBrowserSettings: TypeConstructorDescription { + public class Cons_webBrowserSettings: TypeConstructorDescription { + public var flags: Int32 + public var externalExceptions: [Api.WebDomainException] + public var inappExceptions: [Api.WebDomainException] + public var hash: Int64 + public init(flags: Int32, externalExceptions: [Api.WebDomainException], inappExceptions: [Api.WebDomainException], hash: Int64) { + self.flags = flags + self.externalExceptions = externalExceptions + self.inappExceptions = inappExceptions + self.hash = hash } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("blocked", [("blocked", ConstructorParameterDescription(self.blocked)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("webBrowserSettings", [("flags", ConstructorParameterDescription(self.flags)), ("externalExceptions", ConstructorParameterDescription(self.externalExceptions)), ("inappExceptions", ConstructorParameterDescription(self.inappExceptions)), ("hash", ConstructorParameterDescription(self.hash))]) } } - public class Cons_blockedSlice: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("blockedSlice", [("count", ConstructorParameterDescription(self.count)), ("blocked", ConstructorParameterDescription(self.blocked)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case blocked(Cons_blocked) - case blockedSlice(Cons_blockedSlice) + case webBrowserSettings(Cons_webBrowserSettings) + case webBrowserSettingsNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .blocked(let _data): + case .webBrowserSettings(let _data): if boxed { - buffer.appendInt32(182326673) + buffer.appendInt32(2045480115) } + serializeInt32(_data.flags, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.blocked.count)) - for item in _data.blocked { + buffer.appendInt32(Int32(_data.externalExceptions.count)) + for item in _data.externalExceptions { 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 { + buffer.appendInt32(Int32(_data.inappExceptions.count)) + for item in _data.inappExceptions { item.serialize(buffer, true) } + serializeInt64(_data.hash, buffer: buffer, boxed: false) break - case .blockedSlice(let _data): + case .webBrowserSettingsNotModified: 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) + buffer.appendInt32(-1021538482) } break } @@ -1629,57 +828,411 @@ public extension Api.contacts { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .blocked(let _data): - return ("blocked", [("blocked", ConstructorParameterDescription(_data.blocked)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .blockedSlice(let _data): - return ("blockedSlice", [("count", ConstructorParameterDescription(_data.count)), ("blocked", ConstructorParameterDescription(_data.blocked)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .webBrowserSettings(let _data): + return ("webBrowserSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("externalExceptions", ConstructorParameterDescription(_data.externalExceptions)), ("inappExceptions", ConstructorParameterDescription(_data.inappExceptions)), ("hash", ConstructorParameterDescription(_data.hash))]) + case .webBrowserSettingsNotModified: + return ("webBrowserSettingsNotModified", []) } } - public static func parse_blocked(_ reader: BufferReader) -> Blocked? { - var _1: [Api.PeerBlocked]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerBlocked.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.contacts.Blocked.blocked(Cons_blocked(blocked: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - public static func parse_blockedSlice(_ reader: BufferReader) -> Blocked? { + public static func parse_webBrowserSettings(_ reader: BufferReader) -> WebBrowserSettings? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.PeerBlocked]? + var _2: [Api.WebDomainException]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerBlocked.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WebDomainException.self) } - var _3: [Api.Chat]? + var _3: [Api.WebDomainException]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.WebDomainException.self) } + var _4: Int64? + _4 = reader.readInt64() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.contacts.Blocked.blockedSlice(Cons_blockedSlice(count: _1!, blocked: _2!, chats: _3!, users: _4!)) + return Api.account.WebBrowserSettings.webBrowserSettings(Cons_webBrowserSettings(flags: _1!, externalExceptions: _2!, inappExceptions: _3!, hash: _4!)) + } + else { + return nil + } + } + public static func parse_webBrowserSettingsNotModified(_ reader: BufferReader) -> WebBrowserSettings? { + return Api.account.WebBrowserSettings.webBrowserSettingsNotModified + } + } +} +public extension Api.aicompose { + enum Tones: TypeConstructorDescription { + public class Cons_tones: TypeConstructorDescription { + public var hash: Int64 + public var tones: [Api.AiComposeTone] + public var users: [Api.User] + public init(hash: Int64, tones: [Api.AiComposeTone], users: [Api.User]) { + self.hash = hash + self.tones = tones + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("tones", [("hash", ConstructorParameterDescription(self.hash)), ("tones", ConstructorParameterDescription(self.tones)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case tones(Cons_tones) + case tonesNotModified + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .tones(let _data): + if boxed { + buffer.appendInt32(1822232318) + } + serializeInt64(_data.hash, buffer: buffer, boxed: false) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.tones.count)) + for item in _data.tones { + item.serialize(buffer, true) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + case .tonesNotModified: + if boxed { + buffer.appendInt32(-1040948989) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .tones(let _data): + return ("tones", [("hash", ConstructorParameterDescription(_data.hash)), ("tones", ConstructorParameterDescription(_data.tones)), ("users", ConstructorParameterDescription(_data.users))]) + case .tonesNotModified: + return ("tonesNotModified", []) + } + } + + public static func parse_tones(_ reader: BufferReader) -> Tones? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.AiComposeTone]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AiComposeTone.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.aicompose.Tones.tones(Cons_tones(hash: _1!, tones: _2!, users: _3!)) + } + else { + return nil + } + } + public static func parse_tonesNotModified(_ reader: BufferReader) -> Tones? { + return Api.aicompose.Tones.tonesNotModified + } + } +} +public extension Api.auth { + enum Authorization: TypeConstructorDescription { + public class Cons_authorization: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("authorization", [("flags", ConstructorParameterDescription(self.flags)), ("otherwiseReloginDays", ConstructorParameterDescription(self.otherwiseReloginDays)), ("tmpSessions", ConstructorParameterDescription(self.tmpSessions)), ("futureAuthToken", ConstructorParameterDescription(self.futureAuthToken)), ("user", ConstructorParameterDescription(self.user))]) + } + } + public class Cons_authorizationSignUpRequired: TypeConstructorDescription { + public var flags: Int32 + public var termsOfService: Api.help.TermsOfService? + public init(flags: Int32, termsOfService: Api.help.TermsOfService?) { + self.flags = flags + self.termsOfService = termsOfService + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("authorizationSignUpRequired", [("flags", ConstructorParameterDescription(self.flags)), ("termsOfService", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .authorization(let _data): + return ("authorization", [("flags", ConstructorParameterDescription(_data.flags)), ("otherwiseReloginDays", ConstructorParameterDescription(_data.otherwiseReloginDays)), ("tmpSessions", ConstructorParameterDescription(_data.tmpSessions)), ("futureAuthToken", ConstructorParameterDescription(_data.futureAuthToken)), ("user", ConstructorParameterDescription(_data.user))]) + case .authorizationSignUpRequired(let _data): + return ("authorizationSignUpRequired", [("flags", ConstructorParameterDescription(_data.flags)), ("termsOfService", ConstructorParameterDescription(_data.termsOfService))]) + } + } + + public static func parse_authorization(_ reader: BufferReader) -> Authorization? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _2 = reader.readInt32() + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: Buffer? + if Int(_1 ?? 0) & 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 + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.auth.Authorization.authorization(Cons_authorization(flags: _1!, otherwiseReloginDays: _2, tmpSessions: _3, futureAuthToken: _4, user: _5!)) + } + else { + return nil + } + } + public static func parse_authorizationSignUpRequired(_ reader: BufferReader) -> Authorization? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.help.TermsOfService? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.auth.Authorization.authorizationSignUpRequired(Cons_authorizationSignUpRequired(flags: _1!, termsOfService: _2)) + } + else { + return nil + } + } + } +} +public extension Api.auth { + enum CodeType: TypeConstructorDescription { + case codeTypeCall + case codeTypeFlashCall + 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, ConstructorParameterDescription)]) { + switch self { + case .codeTypeCall: + return ("codeTypeCall", []) + case .codeTypeFlashCall: + return ("codeTypeFlashCall", []) + case .codeTypeFragmentSms: + return ("codeTypeFragmentSms", []) + case .codeTypeMissedCall: + return ("codeTypeMissedCall", []) + case .codeTypeSms: + return ("codeTypeSms", []) + } + } + + public static func parse_codeTypeCall(_ reader: BufferReader) -> CodeType? { + return Api.auth.CodeType.codeTypeCall + } + public static func parse_codeTypeFlashCall(_ reader: BufferReader) -> CodeType? { + return Api.auth.CodeType.codeTypeFlashCall + } + public static func parse_codeTypeFragmentSms(_ reader: BufferReader) -> CodeType? { + return Api.auth.CodeType.codeTypeFragmentSms + } + public static func parse_codeTypeMissedCall(_ reader: BufferReader) -> CodeType? { + return Api.auth.CodeType.codeTypeMissedCall + } + public static func parse_codeTypeSms(_ reader: BufferReader) -> CodeType? { + return Api.auth.CodeType.codeTypeSms + } + } +} +public extension Api.auth { + enum ExportedAuthorization: TypeConstructorDescription { + public class Cons_exportedAuthorization: TypeConstructorDescription { + public var id: Int64 + public var bytes: Buffer + public init(id: Int64, bytes: Buffer) { + self.id = id + self.bytes = bytes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedAuthorization", [("id", ConstructorParameterDescription(self.id)), ("bytes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .exportedAuthorization(let _data): + return ("exportedAuthorization", [("id", ConstructorParameterDescription(_data.id)), ("bytes", ConstructorParameterDescription(_data.bytes))]) + } + } + + public static func parse_exportedAuthorization(_ reader: BufferReader) -> ExportedAuthorization? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.auth.ExportedAuthorization.exportedAuthorization(Cons_exportedAuthorization(id: _1!, bytes: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.auth { + enum LoggedOut: TypeConstructorDescription { + public class Cons_loggedOut: TypeConstructorDescription { + public var flags: Int32 + public var futureAuthToken: Buffer? + public init(flags: Int32, futureAuthToken: Buffer?) { + self.flags = flags + self.futureAuthToken = futureAuthToken + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("loggedOut", [("flags", ConstructorParameterDescription(self.flags)), ("futureAuthToken", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .loggedOut(let _data): + return ("loggedOut", [("flags", ConstructorParameterDescription(_data.flags)), ("futureAuthToken", ConstructorParameterDescription(_data.futureAuthToken))]) + } + } + + public static func parse_loggedOut(_ reader: BufferReader) -> LoggedOut? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseBytes(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.auth.LoggedOut.loggedOut(Cons_loggedOut(flags: _1!, futureAuthToken: _2)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api33.swift b/submodules/TelegramApi/Sources/Api33.swift index 5a54e3e8a9..aae52360c3 100644 --- a/submodules/TelegramApi/Sources/Api33.swift +++ b/submodules/TelegramApi/Sources/Api33.swift @@ -1,58 +1,112 @@ -public extension Api.contacts { - enum ContactBirthdays: TypeConstructorDescription { - public class Cons_contactBirthdays: TypeConstructorDescription { - public var contacts: [Api.ContactBirthday] - public var users: [Api.User] - public init(contacts: [Api.ContactBirthday], users: [Api.User]) { - self.contacts = contacts - self.users = users +public extension Api.auth { + enum LoginToken: TypeConstructorDescription { + public class Cons_loginToken: TypeConstructorDescription { + public var expires: Int32 + public var token: Buffer + public init(expires: Int32, token: Buffer) { + self.expires = expires + self.token = token } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("contactBirthdays", [("contacts", ConstructorParameterDescription(self.contacts)), ("users", ConstructorParameterDescription(self.users))]) + return ("loginToken", [("expires", ConstructorParameterDescription(self.expires)), ("token", ConstructorParameterDescription(self.token))]) } } - case contactBirthdays(Cons_contactBirthdays) + public class Cons_loginTokenMigrateTo: TypeConstructorDescription { + public var dcId: Int32 + public var token: Buffer + public init(dcId: Int32, token: Buffer) { + self.dcId = dcId + self.token = token + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("loginTokenMigrateTo", [("dcId", ConstructorParameterDescription(self.dcId)), ("token", ConstructorParameterDescription(self.token))]) + } + } + public class Cons_loginTokenSuccess: TypeConstructorDescription { + public var authorization: Api.auth.Authorization + public init(authorization: Api.auth.Authorization) { + self.authorization = authorization + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("loginTokenSuccess", [("authorization", ConstructorParameterDescription(self.authorization))]) + } + } + case loginToken(Cons_loginToken) + case loginTokenMigrateTo(Cons_loginTokenMigrateTo) + case loginTokenSuccess(Cons_loginTokenSuccess) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .contactBirthdays(let _data): + case .loginToken(let _data): if boxed { - buffer.appendInt32(290452237) + buffer.appendInt32(1654593920) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.contacts.count)) - for item in _data.contacts { - item.serialize(buffer, true) + serializeInt32(_data.expires, buffer: buffer, boxed: false) + serializeBytes(_data.token, buffer: buffer, boxed: false) + break + case .loginTokenMigrateTo(let _data): + if boxed { + buffer.appendInt32(110008598) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) + 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, ConstructorParameterDescription)]) { switch self { - case .contactBirthdays(let _data): - return ("contactBirthdays", [("contacts", ConstructorParameterDescription(_data.contacts)), ("users", ConstructorParameterDescription(_data.users))]) + case .loginToken(let _data): + return ("loginToken", [("expires", ConstructorParameterDescription(_data.expires)), ("token", ConstructorParameterDescription(_data.token))]) + case .loginTokenMigrateTo(let _data): + return ("loginTokenMigrateTo", [("dcId", ConstructorParameterDescription(_data.dcId)), ("token", ConstructorParameterDescription(_data.token))]) + case .loginTokenSuccess(let _data): + return ("loginTokenSuccess", [("authorization", ConstructorParameterDescription(_data.authorization))]) } } - public static func parse_contactBirthdays(_ reader: BufferReader) -> ContactBirthdays? { - var _1: [Api.ContactBirthday]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ContactBirthday.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } + public static func parse_loginToken(_ reader: BufferReader) -> LoginToken? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + _2 = parseBytes(reader) let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.contacts.ContactBirthdays.contactBirthdays(Cons_contactBirthdays(contacts: _1!, users: _2!)) + return Api.auth.LoginToken.loginToken(Cons_loginToken(expires: _1!, token: _2!)) + } + else { + return nil + } + } + public static func parse_loginTokenMigrateTo(_ reader: BufferReader) -> LoginToken? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + _2 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.auth.LoginToken.loginTokenMigrateTo(Cons_loginTokenMigrateTo(dcId: _1!, token: _2!)) + } + else { + return nil + } + } + public static func parse_loginTokenSuccess(_ reader: BufferReader) -> LoginToken? { + var _1: Api.auth.Authorization? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + let _c1 = _1 != nil + if _c1 { + return Api.auth.LoginToken.loginTokenSuccess(Cons_loginTokenSuccess(authorization: _1!)) } else { return nil @@ -60,45 +114,511 @@ public extension Api.contacts { } } } -public extension Api.contacts { - enum Contacts: TypeConstructorDescription { - public class Cons_contacts: TypeConstructorDescription { - 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 +public extension Api.auth { + enum PasskeyLoginOptions: TypeConstructorDescription { + public class Cons_passkeyLoginOptions: TypeConstructorDescription { + public var options: Api.DataJSON + public init(options: Api.DataJSON) { + self.options = options } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("contacts", [("contacts", ConstructorParameterDescription(self.contacts)), ("savedCount", ConstructorParameterDescription(self.savedCount)), ("users", ConstructorParameterDescription(self.users))]) + return ("passkeyLoginOptions", [("options", ConstructorParameterDescription(self.options))]) } } - case contacts(Cons_contacts) - case contactsNotModified + case passkeyLoginOptions(Cons_passkeyLoginOptions) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .contacts(let _data): + case .passkeyLoginOptions(let _data): if boxed { - buffer.appendInt32(-353862078) + buffer.appendInt32(-503089271) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.contacts.count)) - for item in _data.contacts { - item.serialize(buffer, true) + _data.options.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .passkeyLoginOptions(let _data): + return ("passkeyLoginOptions", [("options", ConstructorParameterDescription(_data.options))]) + } + } + + public static func parse_passkeyLoginOptions(_ reader: BufferReader) -> PasskeyLoginOptions? { + var _1: Api.DataJSON? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + let _c1 = _1 != nil + if _c1 { + return Api.auth.PasskeyLoginOptions.passkeyLoginOptions(Cons_passkeyLoginOptions(options: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.auth { + enum PasswordRecovery: TypeConstructorDescription { + public class Cons_passwordRecovery: TypeConstructorDescription { + public var emailPattern: String + public init(emailPattern: String) { + self.emailPattern = emailPattern + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passwordRecovery", [("emailPattern", ConstructorParameterDescription(self.emailPattern))]) + } + } + case passwordRecovery(Cons_passwordRecovery) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .passwordRecovery(let _data): + if boxed { + buffer.appendInt32(326715557) } - 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) + serializeString(_data.emailPattern, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .passwordRecovery(let _data): + return ("passwordRecovery", [("emailPattern", ConstructorParameterDescription(_data.emailPattern))]) + } + } + + 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(Cons_passwordRecovery(emailPattern: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.auth { + enum SentCode: TypeConstructorDescription { + public class Cons_sentCode: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCode", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("nextType", ConstructorParameterDescription(self.nextType)), ("timeout", ConstructorParameterDescription(self.timeout))]) + } + } + public class Cons_sentCodePaymentRequired: TypeConstructorDescription { + public var storeProduct: String + public var phoneCodeHash: String + public var supportEmailAddress: String + public var supportEmailSubject: String + public var premiumDays: Int32 + public var currency: String + public var amount: Int64 + public init(storeProduct: String, phoneCodeHash: String, supportEmailAddress: String, supportEmailSubject: String, premiumDays: Int32, currency: String, amount: Int64) { + self.storeProduct = storeProduct + self.phoneCodeHash = phoneCodeHash + self.supportEmailAddress = supportEmailAddress + self.supportEmailSubject = supportEmailSubject + self.premiumDays = premiumDays + self.currency = currency + self.amount = amount + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodePaymentRequired", [("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("supportEmailAddress", ConstructorParameterDescription(self.supportEmailAddress)), ("supportEmailSubject", ConstructorParameterDescription(self.supportEmailSubject)), ("premiumDays", ConstructorParameterDescription(self.premiumDays)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) + } + } + public class Cons_sentCodeSuccess: TypeConstructorDescription { + public var authorization: Api.auth.Authorization + public init(authorization: Api.auth.Authorization) { + self.authorization = authorization + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeSuccess", [("authorization", ConstructorParameterDescription(self.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 .contactsNotModified: + case .sentCodePaymentRequired(let _data): if boxed { - buffer.appendInt32(-1219778094) + buffer.appendInt32(-125665601) + } + 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) + serializeInt32(_data.premiumDays, 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, ConstructorParameterDescription)]) { + switch self { + case .sentCode(let _data): + return ("sentCode", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("nextType", ConstructorParameterDescription(_data.nextType)), ("timeout", ConstructorParameterDescription(_data.timeout))]) + case .sentCodePaymentRequired(let _data): + return ("sentCodePaymentRequired", [("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("supportEmailAddress", ConstructorParameterDescription(_data.supportEmailAddress)), ("supportEmailSubject", ConstructorParameterDescription(_data.supportEmailSubject)), ("premiumDays", ConstructorParameterDescription(_data.premiumDays)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) + case .sentCodeSuccess(let _data): + return ("sentCodeSuccess", [("authorization", ConstructorParameterDescription(_data.authorization))]) + } + } + + public static func parse_sentCode(_ reader: BufferReader) -> SentCode? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.auth.SentCodeType? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.auth.SentCodeType + } + var _3: String? + _3 = parseString(reader) + var _4: Api.auth.CodeType? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) != 0 { + _5 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.auth.SentCode.sentCode(Cons_sentCode(flags: _1!, type: _2!, phoneCodeHash: _3!, nextType: _4, timeout: _5)) + } + else { + return nil + } + } + public static func parse_sentCodePaymentRequired(_ reader: BufferReader) -> SentCode? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: Int32? + _5 = reader.readInt32() + var _6: String? + _6 = parseString(reader) + var _7: Int64? + _7 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.auth.SentCode.sentCodePaymentRequired(Cons_sentCodePaymentRequired(storeProduct: _1!, phoneCodeHash: _2!, supportEmailAddress: _3!, supportEmailSubject: _4!, premiumDays: _5!, currency: _6!, amount: _7!)) + } + else { + return nil + } + } + public static func parse_sentCodeSuccess(_ reader: BufferReader) -> SentCode? { + var _1: Api.auth.Authorization? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.auth.Authorization + } + let _c1 = _1 != nil + if _c1 { + return Api.auth.SentCode.sentCodeSuccess(Cons_sentCodeSuccess(authorization: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.auth { + enum SentCodeType: TypeConstructorDescription { + public class Cons_sentCodeTypeApp: TypeConstructorDescription { + public var length: Int32 + public init(length: Int32) { + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeApp", [("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_sentCodeTypeCall: TypeConstructorDescription { + public var length: Int32 + public init(length: Int32) { + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeCall", [("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_sentCodeTypeEmailCode: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeEmailCode", [("flags", ConstructorParameterDescription(self.flags)), ("emailPattern", ConstructorParameterDescription(self.emailPattern)), ("length", ConstructorParameterDescription(self.length)), ("resetAvailablePeriod", ConstructorParameterDescription(self.resetAvailablePeriod)), ("resetPendingDate", ConstructorParameterDescription(self.resetPendingDate))]) + } + } + public class Cons_sentCodeTypeFirebaseSms: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeFirebaseSms", [("flags", ConstructorParameterDescription(self.flags)), ("nonce", ConstructorParameterDescription(self.nonce)), ("playIntegrityProjectId", ConstructorParameterDescription(self.playIntegrityProjectId)), ("playIntegrityNonce", ConstructorParameterDescription(self.playIntegrityNonce)), ("receipt", ConstructorParameterDescription(self.receipt)), ("pushTimeout", ConstructorParameterDescription(self.pushTimeout)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_sentCodeTypeFlashCall: TypeConstructorDescription { + public var pattern: String + public init(pattern: String) { + self.pattern = pattern + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeFlashCall", [("pattern", ConstructorParameterDescription(self.pattern))]) + } + } + public class Cons_sentCodeTypeFragmentSms: TypeConstructorDescription { + public var url: String + public var length: Int32 + public init(url: String, length: Int32) { + self.url = url + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeFragmentSms", [("url", ConstructorParameterDescription(self.url)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_sentCodeTypeMissedCall: TypeConstructorDescription { + public var prefix: String + public var length: Int32 + public init(prefix: String, length: Int32) { + self.prefix = prefix + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeMissedCall", [("prefix", ConstructorParameterDescription(self.prefix)), ("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_sentCodeTypeSetUpEmailRequired: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSetUpEmailRequired", [("flags", ConstructorParameterDescription(self.flags))]) + } + } + public class Cons_sentCodeTypeSms: TypeConstructorDescription { + public var length: Int32 + public init(length: Int32) { + self.length = length + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSms", [("length", ConstructorParameterDescription(self.length))]) + } + } + public class Cons_sentCodeTypeSmsPhrase: TypeConstructorDescription { + public var flags: Int32 + public var beginning: String? + public init(flags: Int32, beginning: String?) { + self.flags = flags + self.beginning = beginning + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSmsPhrase", [("flags", ConstructorParameterDescription(self.flags)), ("beginning", ConstructorParameterDescription(self.beginning))]) + } + } + public class Cons_sentCodeTypeSmsWord: TypeConstructorDescription { + public var flags: Int32 + public var beginning: String? + public init(flags: Int32, beginning: String?) { + self.flags = flags + self.beginning = beginning + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSmsWord", [("flags", ConstructorParameterDescription(self.flags)), ("beginning", ConstructorParameterDescription(self.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 } @@ -106,72 +626,572 @@ public extension Api.contacts { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .contacts(let _data): - return ("contacts", [("contacts", ConstructorParameterDescription(_data.contacts)), ("savedCount", ConstructorParameterDescription(_data.savedCount)), ("users", ConstructorParameterDescription(_data.users))]) - case .contactsNotModified: - return ("contactsNotModified", []) + case .sentCodeTypeApp(let _data): + return ("sentCodeTypeApp", [("length", ConstructorParameterDescription(_data.length))]) + case .sentCodeTypeCall(let _data): + return ("sentCodeTypeCall", [("length", ConstructorParameterDescription(_data.length))]) + case .sentCodeTypeEmailCode(let _data): + return ("sentCodeTypeEmailCode", [("flags", ConstructorParameterDescription(_data.flags)), ("emailPattern", ConstructorParameterDescription(_data.emailPattern)), ("length", ConstructorParameterDescription(_data.length)), ("resetAvailablePeriod", ConstructorParameterDescription(_data.resetAvailablePeriod)), ("resetPendingDate", ConstructorParameterDescription(_data.resetPendingDate))]) + case .sentCodeTypeFirebaseSms(let _data): + return ("sentCodeTypeFirebaseSms", [("flags", ConstructorParameterDescription(_data.flags)), ("nonce", ConstructorParameterDescription(_data.nonce)), ("playIntegrityProjectId", ConstructorParameterDescription(_data.playIntegrityProjectId)), ("playIntegrityNonce", ConstructorParameterDescription(_data.playIntegrityNonce)), ("receipt", ConstructorParameterDescription(_data.receipt)), ("pushTimeout", ConstructorParameterDescription(_data.pushTimeout)), ("length", ConstructorParameterDescription(_data.length))]) + case .sentCodeTypeFlashCall(let _data): + return ("sentCodeTypeFlashCall", [("pattern", ConstructorParameterDescription(_data.pattern))]) + case .sentCodeTypeFragmentSms(let _data): + return ("sentCodeTypeFragmentSms", [("url", ConstructorParameterDescription(_data.url)), ("length", ConstructorParameterDescription(_data.length))]) + case .sentCodeTypeMissedCall(let _data): + return ("sentCodeTypeMissedCall", [("prefix", ConstructorParameterDescription(_data.prefix)), ("length", ConstructorParameterDescription(_data.length))]) + case .sentCodeTypeSetUpEmailRequired(let _data): + return ("sentCodeTypeSetUpEmailRequired", [("flags", ConstructorParameterDescription(_data.flags))]) + case .sentCodeTypeSms(let _data): + return ("sentCodeTypeSms", [("length", ConstructorParameterDescription(_data.length))]) + case .sentCodeTypeSmsPhrase(let _data): + return ("sentCodeTypeSmsPhrase", [("flags", ConstructorParameterDescription(_data.flags)), ("beginning", ConstructorParameterDescription(_data.beginning))]) + case .sentCodeTypeSmsWord(let _data): + return ("sentCodeTypeSmsWord", [("flags", ConstructorParameterDescription(_data.flags)), ("beginning", ConstructorParameterDescription(_data.beginning))]) } } - public static func parse_contacts(_ reader: BufferReader) -> Contacts? { - var _1: [Api.Contact]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Contact.self) + 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(Cons_sentCodeTypeApp(length: _1!)) } + else { + return nil + } + } + public static func parse_sentCodeTypeCall(_ reader: BufferReader) -> SentCodeType? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.auth.SentCodeType.sentCodeTypeCall(Cons_sentCodeTypeCall(length: _1!)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeEmailCode(_ reader: BufferReader) -> SentCodeType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _4 = reader.readInt32() + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _5 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.auth.SentCodeType.sentCodeTypeEmailCode(Cons_sentCodeTypeEmailCode(flags: _1!, emailPattern: _2!, length: _3!, resetAvailablePeriod: _4, resetPendingDate: _5)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeFirebaseSms(_ reader: BufferReader) -> SentCodeType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseBytes(reader) + } + var _3: Int64? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = reader.readInt64() + } + var _4: Buffer? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = parseBytes(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } + var _7: Int32? + _7 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.auth.SentCodeType.sentCodeTypeFirebaseSms(Cons_sentCodeTypeFirebaseSms(flags: _1!, nonce: _2, playIntegrityProjectId: _3, playIntegrityNonce: _4, receipt: _5, pushTimeout: _6, length: _7!)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeFlashCall(_ reader: BufferReader) -> SentCodeType? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.auth.SentCodeType.sentCodeTypeFlashCall(Cons_sentCodeTypeFlashCall(pattern: _1!)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeFragmentSms(_ reader: BufferReader) -> SentCodeType? { + var _1: String? + _1 = parseString(reader) var _2: Int32? _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.auth.SentCodeType.sentCodeTypeFragmentSms(Cons_sentCodeTypeFragmentSms(url: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeMissedCall(_ reader: BufferReader) -> SentCodeType? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.auth.SentCodeType.sentCodeTypeMissedCall(Cons_sentCodeTypeMissedCall(prefix: _1!, length: _2!)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeSetUpEmailRequired(_ reader: BufferReader) -> SentCodeType? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.auth.SentCodeType.sentCodeTypeSetUpEmailRequired(Cons_sentCodeTypeSetUpEmailRequired(flags: _1!)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeSms(_ reader: BufferReader) -> SentCodeType? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.auth.SentCodeType.sentCodeTypeSms(Cons_sentCodeTypeSms(length: _1!)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeSmsPhrase(_ reader: BufferReader) -> SentCodeType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.auth.SentCodeType.sentCodeTypeSmsPhrase(Cons_sentCodeTypeSmsPhrase(flags: _1!, beginning: _2)) + } + else { + return nil + } + } + public static func parse_sentCodeTypeSmsWord(_ reader: BufferReader) -> SentCodeType? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.auth.SentCodeType.sentCodeTypeSmsWord(Cons_sentCodeTypeSmsWord(flags: _1!, beginning: _2)) + } + else { + return nil + } + } + } +} +public extension Api.bots { + enum AccessSettings: TypeConstructorDescription { + public class Cons_accessSettings: TypeConstructorDescription { + public var flags: Int32 + public var addUsers: [Api.User]? + public init(flags: Int32, addUsers: [Api.User]?) { + self.flags = flags + self.addUsers = addUsers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("accessSettings", [("flags", ConstructorParameterDescription(self.flags)), ("addUsers", ConstructorParameterDescription(self.addUsers))]) + } + } + case accessSettings(Cons_accessSettings) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .accessSettings(let _data): + if boxed { + buffer.appendInt32(-585121901) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.addUsers!.count)) + for item in _data.addUsers! { + item.serialize(buffer, true) + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .accessSettings(let _data): + return ("accessSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("addUsers", ConstructorParameterDescription(_data.addUsers))]) + } + } + + public static func parse_accessSettings(_ reader: BufferReader) -> AccessSettings? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.User]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + if _c1 && _c2 { + return Api.bots.AccessSettings.accessSettings(Cons_accessSettings(flags: _1!, addUsers: _2)) + } + else { + return nil + } + } + } +} +public extension Api.bots { + enum BotInfo: TypeConstructorDescription { + public class Cons_botInfo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInfo", [("name", ConstructorParameterDescription(self.name)), ("about", ConstructorParameterDescription(self.about)), ("description", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .botInfo(let _data): + return ("botInfo", [("name", ConstructorParameterDescription(_data.name)), ("about", ConstructorParameterDescription(_data.about)), ("description", ConstructorParameterDescription(_data.description))]) + } + } + + public static func parse_botInfo(_ reader: BufferReader) -> BotInfo? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.bots.BotInfo.botInfo(Cons_botInfo(name: _1!, about: _2!, description: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.bots { + enum ExportedBotToken: TypeConstructorDescription { + public class Cons_exportedBotToken: TypeConstructorDescription { + public var token: String + public init(token: String) { + self.token = token + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedBotToken", [("token", ConstructorParameterDescription(self.token))]) + } + } + case exportedBotToken(Cons_exportedBotToken) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .exportedBotToken(let _data): + if boxed { + buffer.appendInt32(1012971041) + } + serializeString(_data.token, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .exportedBotToken(let _data): + return ("exportedBotToken", [("token", ConstructorParameterDescription(_data.token))]) + } + } + + public static func parse_exportedBotToken(_ reader: BufferReader) -> ExportedBotToken? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.bots.ExportedBotToken.exportedBotToken(Cons_exportedBotToken(token: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.bots { + enum PopularAppBots: TypeConstructorDescription { + public class Cons_popularAppBots: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("popularAppBots", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .popularAppBots(let _data): + return ("popularAppBots", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_popularAppBots(_ reader: BufferReader) -> PopularAppBots? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & 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) } let _c1 = _1 != nil - let _c2 = _2 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.contacts.Contacts.contacts(Cons_contacts(contacts: _1!, savedCount: _2!, users: _3!)) + return Api.bots.PopularAppBots.popularAppBots(Cons_popularAppBots(flags: _1!, nextOffset: _2, users: _3!)) } else { return nil } } - public static func parse_contactsNotModified(_ reader: BufferReader) -> Contacts? { - return Api.contacts.Contacts.contactsNotModified + } +} +public extension Api.bots { + enum PreviewInfo: TypeConstructorDescription { + public class Cons_previewInfo: TypeConstructorDescription { + public var media: [Api.BotPreviewMedia] + public var langCodes: [String] + public init(media: [Api.BotPreviewMedia], langCodes: [String]) { + self.media = media + self.langCodes = langCodes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("previewInfo", [("media", ConstructorParameterDescription(self.media)), ("langCodes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .previewInfo(let _data): + return ("previewInfo", [("media", ConstructorParameterDescription(_data.media)), ("langCodes", ConstructorParameterDescription(_data.langCodes))]) + } + } + + public static func parse_previewInfo(_ reader: BufferReader) -> PreviewInfo? { + var _1: [Api.BotPreviewMedia]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotPreviewMedia.self) + } + var _2: [String]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.bots.PreviewInfo.previewInfo(Cons_previewInfo(media: _1!, langCodes: _2!)) + } + else { + return nil + } } } } -public extension Api.contacts { - enum Found: TypeConstructorDescription { - public class Cons_found: TypeConstructorDescription { - public var myResults: [Api.Peer] - public var results: [Api.Peer] +public extension Api.bots { + enum RequestedButton: TypeConstructorDescription { + public class Cons_requestedButton: TypeConstructorDescription { + public var webappReqId: String + public init(webappReqId: String) { + self.webappReqId = webappReqId + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestedButton", [("webappReqId", ConstructorParameterDescription(self.webappReqId))]) + } + } + case requestedButton(Cons_requestedButton) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .requestedButton(let _data): + if boxed { + buffer.appendInt32(-247743273) + } + serializeString(_data.webappReqId, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .requestedButton(let _data): + return ("requestedButton", [("webappReqId", ConstructorParameterDescription(_data.webappReqId))]) + } + } + + public static func parse_requestedButton(_ reader: BufferReader) -> RequestedButton? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.bots.RequestedButton.requestedButton(Cons_requestedButton(webappReqId: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.channels { + enum AdminLogResults: TypeConstructorDescription { + public class Cons_adminLogResults: TypeConstructorDescription { + public var events: [Api.ChannelAdminLogEvent] 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 + public init(events: [Api.ChannelAdminLogEvent], chats: [Api.Chat], users: [Api.User]) { + self.events = events self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("found", [("myResults", ConstructorParameterDescription(self.myResults)), ("results", ConstructorParameterDescription(self.results)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("adminLogResults", [("events", ConstructorParameterDescription(self.events)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case found(Cons_found) + case adminLogResults(Cons_adminLogResults) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .found(let _data): + case .adminLogResults(let _data): if boxed { - buffer.appendInt32(-1290580579) + buffer.appendInt32(-309659827) } 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 { + buffer.appendInt32(Int32(_data.events.count)) + for item in _data.events { item.serialize(buffer, true) } buffer.appendInt32(481674261) @@ -190,19 +1210,172 @@ public extension Api.contacts { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .found(let _data): - return ("found", [("myResults", ConstructorParameterDescription(_data.myResults)), ("results", ConstructorParameterDescription(_data.results)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .adminLogResults(let _data): + return ("adminLogResults", [("events", ConstructorParameterDescription(_data.events)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_found(_ reader: BufferReader) -> Found? { - var _1: [Api.Peer]? + public static func parse_adminLogResults(_ reader: BufferReader) -> AdminLogResults? { + var _1: [Api.ChannelAdminLogEvent]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChannelAdminLogEvent.self) } - var _2: [Api.Peer]? + var _2: [Api.Chat]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.channels.AdminLogResults.adminLogResults(Cons_adminLogResults(events: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.channels { + enum ChannelParticipant: TypeConstructorDescription { + public class Cons_channelParticipant: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipant", [("participant", ConstructorParameterDescription(self.participant)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .channelParticipant(let _data): + return ("channelParticipant", [("participant", ConstructorParameterDescription(_data.participant)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_channelParticipant(_ reader: BufferReader) -> ChannelParticipant? { + var _1: Api.ChannelParticipant? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.ChannelParticipant + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.channels.ChannelParticipant.channelParticipant(Cons_channelParticipant(participant: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.channels { + enum ChannelParticipants: TypeConstructorDescription { + public class Cons_channelParticipants: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipants", [("count", ConstructorParameterDescription(self.count)), ("participants", ConstructorParameterDescription(self.participants)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case channelParticipants(Cons_channelParticipants) + 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, ConstructorParameterDescription)]) { + switch self { + case .channelParticipants(let _data): + return ("channelParticipants", [("count", ConstructorParameterDescription(_data.count)), ("participants", ConstructorParameterDescription(_data.participants)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .channelParticipantsNotModified: + return ("channelParticipantsNotModified", []) + } + } + + public static func parse_channelParticipants(_ reader: BufferReader) -> ChannelParticipants? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.ChannelParticipant]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChannelParticipant.self) } var _3: [Api.Chat]? if let _ = reader.readInt32() { @@ -217,193 +1390,39 @@ public extension Api.contacts { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.contacts.Found.found(Cons_found(myResults: _1!, results: _2!, chats: _3!, users: _4!)) + return Api.channels.ChannelParticipants.channelParticipants(Cons_channelParticipants(count: _1!, participants: _2!, chats: _3!, users: _4!)) } else { return nil } } - } -} -public extension Api.contacts { - enum ImportedContacts: TypeConstructorDescription { - public class Cons_importedContacts: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("importedContacts", [("imported", ConstructorParameterDescription(self.imported)), ("popularInvites", ConstructorParameterDescription(self.popularInvites)), ("retryContacts", ConstructorParameterDescription(self.retryContacts)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .importedContacts(let _data): - return ("importedContacts", [("imported", ConstructorParameterDescription(_data.imported)), ("popularInvites", ConstructorParameterDescription(_data.popularInvites)), ("retryContacts", ConstructorParameterDescription(_data.retryContacts)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_importedContacts(_ reader: BufferReader) -> ImportedContacts? { - var _1: [Api.ImportedContact]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ImportedContact.self) - } - var _2: [Api.PopularContact]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PopularContact.self) - } - var _3: [Int64]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.contacts.ImportedContacts.importedContacts(Cons_importedContacts(imported: _1!, popularInvites: _2!, retryContacts: _3!, users: _4!)) - } - else { - return nil - } + public static func parse_channelParticipantsNotModified(_ reader: BufferReader) -> ChannelParticipants? { + return Api.channels.ChannelParticipants.channelParticipantsNotModified } } } -public extension Api.contacts { - enum ResolvedPeer: TypeConstructorDescription { - public class Cons_resolvedPeer: TypeConstructorDescription { - public var peer: Api.Peer +public extension Api.channels { + enum SendAsPeers: TypeConstructorDescription { + public class Cons_sendAsPeers: TypeConstructorDescription { + public var peers: [Api.SendAsPeer] 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("resolvedPeer", [("peer", ConstructorParameterDescription(self.peer)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .resolvedPeer(let _data): - return ("resolvedPeer", [("peer", ConstructorParameterDescription(_data.peer)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_resolvedPeer(_ reader: BufferReader) -> ResolvedPeer? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Peer - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.contacts.ResolvedPeer.resolvedPeer(Cons_resolvedPeer(peer: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.contacts { - enum SponsoredPeers: TypeConstructorDescription { - public class Cons_sponsoredPeers: TypeConstructorDescription { - 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]) { + public init(peers: [Api.SendAsPeer], chats: [Api.Chat], users: [Api.User]) { self.peers = peers self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sponsoredPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("sendAsPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case sponsoredPeers(Cons_sponsoredPeers) - case sponsoredPeersEmpty + case sendAsPeers(Cons_sendAsPeers) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .sponsoredPeers(let _data): + case .sendAsPeers(let _data): if boxed { - buffer.appendInt32(-352114556) + buffer.appendInt32(-191450938) } buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.peers.count)) @@ -421,27 +1440,20 @@ public extension Api.contacts { item.serialize(buffer, true) } break - case .sponsoredPeersEmpty: - if boxed { - buffer.appendInt32(-365775695) - } - break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .sponsoredPeers(let _data): - return ("sponsoredPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .sponsoredPeersEmpty: - return ("sponsoredPeersEmpty", []) + case .sendAsPeers(let _data): + return ("sendAsPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_sponsoredPeers(_ reader: BufferReader) -> SponsoredPeers? { - var _1: [Api.SponsoredPeer]? + public static func parse_sendAsPeers(_ reader: BufferReader) -> SendAsPeers? { + var _1: [Api.SendAsPeer]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SponsoredPeer.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SendAsPeer.self) } var _2: [Api.Chat]? if let _ = reader.readInt32() { @@ -455,66 +1467,52 @@ public extension Api.contacts { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.contacts.SponsoredPeers.sponsoredPeers(Cons_sponsoredPeers(peers: _1!, chats: _2!, users: _3!)) + return Api.channels.SendAsPeers.sendAsPeers(Cons_sendAsPeers(peers: _1!, chats: _2!, users: _3!)) } else { return nil } } - public static func parse_sponsoredPeersEmpty(_ reader: BufferReader) -> SponsoredPeers? { - return Api.contacts.SponsoredPeers.sponsoredPeersEmpty - } } } -public extension Api.contacts { - enum TopPeers: TypeConstructorDescription { - public class Cons_topPeers: TypeConstructorDescription { - 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 +public extension Api.channels { + enum SponsoredMessageReportResult: TypeConstructorDescription { + public class Cons_sponsoredMessageReportResultChooseOption: TypeConstructorDescription { + public var title: String + public var options: [Api.SponsoredMessageReportOption] + public init(title: String, options: [Api.SponsoredMessageReportOption]) { + self.title = title + self.options = options } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("topPeers", [("categories", ConstructorParameterDescription(self.categories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("sponsoredMessageReportResultChooseOption", [("title", ConstructorParameterDescription(self.title)), ("options", ConstructorParameterDescription(self.options))]) } } - case topPeers(Cons_topPeers) - case topPeersDisabled - case topPeersNotModified + case sponsoredMessageReportResultAdsHidden + case sponsoredMessageReportResultChooseOption(Cons_sponsoredMessageReportResultChooseOption) + case sponsoredMessageReportResultReported public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .topPeers(let _data): + case .sponsoredMessageReportResultAdsHidden: if boxed { - buffer.appendInt32(1891070632) + buffer.appendInt32(1044107055) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.categories.count)) - for item in _data.categories { - item.serialize(buffer, true) + break + case .sponsoredMessageReportResultChooseOption(let _data): + if boxed { + buffer.appendInt32(-2073059774) } + serializeString(_data.title, 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 { + buffer.appendInt32(Int32(_data.options.count)) + for item in _data.options { item.serialize(buffer, true) } break - case .topPeersDisabled: + case .sponsoredMessageReportResultReported: if boxed { - buffer.appendInt32(-1255369827) - } - break - case .topPeersNotModified: - if boxed { - buffer.appendInt32(-567906571) + buffer.appendInt32(-1384544183) } break } @@ -522,1255 +1520,36 @@ public extension Api.contacts { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .topPeers(let _data): - return ("topPeers", [("categories", ConstructorParameterDescription(_data.categories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .topPeersDisabled: - return ("topPeersDisabled", []) - case .topPeersNotModified: - return ("topPeersNotModified", []) + case .sponsoredMessageReportResultAdsHidden: + return ("sponsoredMessageReportResultAdsHidden", []) + case .sponsoredMessageReportResultChooseOption(let _data): + return ("sponsoredMessageReportResultChooseOption", [("title", ConstructorParameterDescription(_data.title)), ("options", ConstructorParameterDescription(_data.options))]) + case .sponsoredMessageReportResultReported: + return ("sponsoredMessageReportResultReported", []) } } - public static func parse_topPeers(_ reader: BufferReader) -> TopPeers? { - var _1: [Api.TopPeerCategoryPeers]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TopPeerCategoryPeers.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.contacts.TopPeers.topPeers(Cons_topPeers(categories: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } + public static func parse_sponsoredMessageReportResultAdsHidden(_ reader: BufferReader) -> SponsoredMessageReportResult? { + return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultAdsHidden } - public static func parse_topPeersDisabled(_ reader: BufferReader) -> TopPeers? { - return Api.contacts.TopPeers.topPeersDisabled - } - public static func parse_topPeersNotModified(_ reader: BufferReader) -> TopPeers? { - return Api.contacts.TopPeers.topPeersNotModified - } - } -} -public extension Api.fragment { - enum CollectibleInfo: TypeConstructorDescription { - public class Cons_collectibleInfo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("collectibleInfo", [("purchaseDate", ConstructorParameterDescription(self.purchaseDate)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .collectibleInfo(let _data): - return ("collectibleInfo", [("purchaseDate", ConstructorParameterDescription(_data.purchaseDate)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("url", ConstructorParameterDescription(_data.url))]) - } - } - - public static func parse_collectibleInfo(_ reader: BufferReader) -> CollectibleInfo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: Int64? - _5 = reader.readInt64() - var _6: String? - _6 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_appConfig: TypeConstructorDescription { - public var hash: Int32 - public var config: Api.JSONValue - public init(hash: Int32, config: Api.JSONValue) { - self.hash = hash - self.config = config - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("appConfig", [("hash", ConstructorParameterDescription(self.hash)), ("config", ConstructorParameterDescription(self.config))]) - } - } - case appConfig(Cons_appConfig) - 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, ConstructorParameterDescription)]) { - switch self { - case .appConfig(let _data): - return ("appConfig", [("hash", ConstructorParameterDescription(_data.hash)), ("config", ConstructorParameterDescription(_data.config))]) - case .appConfigNotModified: - return ("appConfigNotModified", []) - } - } - - public static func parse_appConfig(_ reader: BufferReader) -> AppConfig? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.JSONValue? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.JSONValue - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.help.AppConfig.appConfig(Cons_appConfig(hash: _1!, config: _2!)) - } - else { - return nil - } - } - public static func parse_appConfigNotModified(_ reader: BufferReader) -> AppConfig? { - return Api.help.AppConfig.appConfigNotModified - } - } -} -public extension Api.help { - enum AppUpdate: TypeConstructorDescription { - public class Cons_appUpdate: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("appUpdate", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("version", ConstructorParameterDescription(self.version)), ("text", ConstructorParameterDescription(self.text)), ("entities", ConstructorParameterDescription(self.entities)), ("document", ConstructorParameterDescription(self.document)), ("url", ConstructorParameterDescription(self.url)), ("sticker", ConstructorParameterDescription(self.sticker))]) - } - } - case appUpdate(Cons_appUpdate) - 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, ConstructorParameterDescription)]) { - switch self { - case .appUpdate(let _data): - return ("appUpdate", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("version", ConstructorParameterDescription(_data.version)), ("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities)), ("document", ConstructorParameterDescription(_data.document)), ("url", ConstructorParameterDescription(_data.url)), ("sticker", ConstructorParameterDescription(_data.sticker))]) - case .noAppUpdate: - return ("noAppUpdate", []) - } - } - - public static func parse_appUpdate(_ reader: BufferReader) -> AppUpdate? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - var _4: String? - _4 = parseString(reader) - var _5: [Api.MessageEntity]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - var _6: Api.Document? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Document - } - } - var _7: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _7 = parseString(reader) - } - var _8: Api.Document? - if Int(_1 ?? 0) & 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 - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_noAppUpdate(_ reader: BufferReader) -> AppUpdate? { - return Api.help.AppUpdate.noAppUpdate - } - } -} -public extension Api.help { - enum CountriesList: TypeConstructorDescription { - public class Cons_countriesList: TypeConstructorDescription { - public var countries: [Api.help.Country] - public var hash: Int32 - public init(countries: [Api.help.Country], hash: Int32) { - self.countries = countries - self.hash = hash - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("countriesList", [("countries", ConstructorParameterDescription(self.countries)), ("hash", ConstructorParameterDescription(self.hash))]) - } - } - case countriesList(Cons_countriesList) - 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, ConstructorParameterDescription)]) { - switch self { - case .countriesList(let _data): - return ("countriesList", [("countries", ConstructorParameterDescription(_data.countries)), ("hash", ConstructorParameterDescription(_data.hash))]) - case .countriesListNotModified: - return ("countriesListNotModified", []) - } - } - - public static func parse_countriesList(_ reader: BufferReader) -> CountriesList? { - var _1: [Api.help.Country]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.help.Country.self) - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.help.CountriesList.countriesList(Cons_countriesList(countries: _1!, hash: _2!)) - } - else { - return nil - } - } - public static func parse_countriesListNotModified(_ reader: BufferReader) -> CountriesList? { - return Api.help.CountriesList.countriesListNotModified - } - } -} -public extension Api.help { - enum Country: TypeConstructorDescription { - public class Cons_country: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("country", [("flags", ConstructorParameterDescription(self.flags)), ("iso2", ConstructorParameterDescription(self.iso2)), ("defaultName", ConstructorParameterDescription(self.defaultName)), ("name", ConstructorParameterDescription(self.name)), ("countryCodes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .country(let _data): - return ("country", [("flags", ConstructorParameterDescription(_data.flags)), ("iso2", ConstructorParameterDescription(_data.iso2)), ("defaultName", ConstructorParameterDescription(_data.defaultName)), ("name", ConstructorParameterDescription(_data.name)), ("countryCodes", ConstructorParameterDescription(_data.countryCodes))]) - } - } - - public static func parse_country(_ reader: BufferReader) -> Country? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: String? - _3 = parseString(reader) - var _4: String? - if Int(_1 ?? 0) & 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) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_countryCode: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("countryCode", [("flags", ConstructorParameterDescription(self.flags)), ("countryCode", ConstructorParameterDescription(self.countryCode)), ("prefixes", ConstructorParameterDescription(self.prefixes)), ("patterns", ConstructorParameterDescription(self.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) - } - } - 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) - } - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .countryCode(let _data): - return ("countryCode", [("flags", ConstructorParameterDescription(_data.flags)), ("countryCode", ConstructorParameterDescription(_data.countryCode)), ("prefixes", ConstructorParameterDescription(_data.prefixes)), ("patterns", ConstructorParameterDescription(_data.patterns))]) - } - } - - 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 ?? 0) & Int(1 << 0) != 0 { - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - } - var _4: [String]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - 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 { - public class Cons_deepLinkInfo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("deepLinkInfo", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities))]) - } - } - case deepLinkInfo(Cons_deepLinkInfo) - case deepLinkInfoEmpty - - 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, ConstructorParameterDescription)]) { - switch self { - case .deepLinkInfo(let _data): - return ("deepLinkInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities))]) - 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 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.help.DeepLinkInfo.deepLinkInfo(Cons_deepLinkInfo(flags: _1!, message: _2!, entities: _3)) - } - else { - return nil - } - } - public static func parse_deepLinkInfoEmpty(_ reader: BufferReader) -> DeepLinkInfo? { - return Api.help.DeepLinkInfo.deepLinkInfoEmpty - } - } -} -public extension Api.help { - enum InviteText: TypeConstructorDescription { - public class Cons_inviteText: TypeConstructorDescription { - public var message: String - public init(message: String) { - self.message = message - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inviteText", [("message", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .inviteText(let _data): - return ("inviteText", [("message", ConstructorParameterDescription(_data.message))]) - } - } - - public static func parse_inviteText(_ reader: BufferReader) -> InviteText? { + public static func parse_sponsoredMessageReportResultChooseOption(_ reader: BufferReader) -> SponsoredMessageReportResult? { var _1: String? _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.help.InviteText.inviteText(Cons_inviteText(message: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.help { - enum PassportConfig: TypeConstructorDescription { - public class Cons_passportConfig: TypeConstructorDescription { - public var hash: Int32 - public var countriesLangs: Api.DataJSON - public init(hash: Int32, countriesLangs: Api.DataJSON) { - self.hash = hash - self.countriesLangs = countriesLangs - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("passportConfig", [("hash", ConstructorParameterDescription(self.hash)), ("countriesLangs", ConstructorParameterDescription(self.countriesLangs))]) - } - } - case passportConfig(Cons_passportConfig) - 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, ConstructorParameterDescription)]) { - switch self { - case .passportConfig(let _data): - return ("passportConfig", [("hash", ConstructorParameterDescription(_data.hash)), ("countriesLangs", ConstructorParameterDescription(_data.countriesLangs))]) - case .passportConfigNotModified: - return ("passportConfigNotModified", []) - } - } - - public static func parse_passportConfig(_ reader: BufferReader) -> PassportConfig? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.DataJSON? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.DataJSON + var _2: [Api.SponsoredMessageReportOption]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SponsoredMessageReportOption.self) } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.PassportConfig.passportConfig(Cons_passportConfig(hash: _1!, countriesLangs: _2!)) + return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultChooseOption(Cons_sponsoredMessageReportResultChooseOption(title: _1!, options: _2!)) } else { return nil } } - public static func parse_passportConfigNotModified(_ reader: BufferReader) -> PassportConfig? { - return Api.help.PassportConfig.passportConfigNotModified - } - } -} -public extension Api.help { - enum PeerColorOption: TypeConstructorDescription { - public class Cons_peerColorOption: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerColorOption", [("flags", ConstructorParameterDescription(self.flags)), ("colorId", ConstructorParameterDescription(self.colorId)), ("colors", ConstructorParameterDescription(self.colors)), ("darkColors", ConstructorParameterDescription(self.darkColors)), ("channelMinLevel", ConstructorParameterDescription(self.channelMinLevel)), ("groupMinLevel", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerColorOption(let _data): - return ("peerColorOption", [("flags", ConstructorParameterDescription(_data.flags)), ("colorId", ConstructorParameterDescription(_data.colorId)), ("colors", ConstructorParameterDescription(_data.colors)), ("darkColors", ConstructorParameterDescription(_data.darkColors)), ("channelMinLevel", ConstructorParameterDescription(_data.channelMinLevel)), ("groupMinLevel", ConstructorParameterDescription(_data.groupMinLevel))]) - } - } - - 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 3) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _6 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_peerColorProfileSet: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerColorProfileSet", [("paletteColors", ConstructorParameterDescription(self.paletteColors)), ("bgColors", ConstructorParameterDescription(self.bgColors)), ("storyColors", ConstructorParameterDescription(self.storyColors))]) - } - } - public class Cons_peerColorSet: TypeConstructorDescription { - public var colors: [Int32] - public init(colors: [Int32]) { - self.colors = colors - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerColorSet", [("colors", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerColorProfileSet(let _data): - return ("peerColorProfileSet", [("paletteColors", ConstructorParameterDescription(_data.paletteColors)), ("bgColors", ConstructorParameterDescription(_data.bgColors)), ("storyColors", ConstructorParameterDescription(_data.storyColors))]) - case .peerColorSet(let _data): - return ("peerColorSet", [("colors", ConstructorParameterDescription(_data.colors))]) - } - } - - public static func parse_peerColorProfileSet(_ reader: BufferReader) -> PeerColorSet? { - var _1: [Int32]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _2: [Int32]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _3: [Int32]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.help.PeerColorSet.peerColorProfileSet(Cons_peerColorProfileSet(paletteColors: _1!, bgColors: _2!, storyColors: _3!)) - } - else { - return nil - } - } - public static func parse_peerColorSet(_ reader: BufferReader) -> PeerColorSet? { - var _1: [Int32]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.help.PeerColorSet.peerColorSet(Cons_peerColorSet(colors: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.help { - enum PeerColors: TypeConstructorDescription { - public class Cons_peerColors: TypeConstructorDescription { - public var hash: Int32 - public var colors: [Api.help.PeerColorOption] - public init(hash: Int32, colors: [Api.help.PeerColorOption]) { - self.hash = hash - self.colors = colors - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerColors", [("hash", ConstructorParameterDescription(self.hash)), ("colors", ConstructorParameterDescription(self.colors))]) - } - } - case peerColors(Cons_peerColors) - 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, ConstructorParameterDescription)]) { - switch self { - case .peerColors(let _data): - return ("peerColors", [("hash", ConstructorParameterDescription(_data.hash)), ("colors", ConstructorParameterDescription(_data.colors))]) - case .peerColorsNotModified: - return ("peerColorsNotModified", []) - } - } - - public static func parse_peerColors(_ reader: BufferReader) -> PeerColors? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.help.PeerColorOption]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.help.PeerColorOption.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.help.PeerColors.peerColors(Cons_peerColors(hash: _1!, colors: _2!)) - } - else { - return nil - } - } - public static func parse_peerColorsNotModified(_ reader: BufferReader) -> PeerColors? { - return Api.help.PeerColors.peerColorsNotModified - } - } -} -public extension Api.help { - enum PremiumPromo: TypeConstructorDescription { - public class Cons_premiumPromo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("premiumPromo", [("statusText", ConstructorParameterDescription(self.statusText)), ("statusEntities", ConstructorParameterDescription(self.statusEntities)), ("videoSections", ConstructorParameterDescription(self.videoSections)), ("videos", ConstructorParameterDescription(self.videos)), ("periodOptions", ConstructorParameterDescription(self.periodOptions)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .premiumPromo(let _data): - return ("premiumPromo", [("statusText", ConstructorParameterDescription(_data.statusText)), ("statusEntities", ConstructorParameterDescription(_data.statusEntities)), ("videoSections", ConstructorParameterDescription(_data.videoSections)), ("videos", ConstructorParameterDescription(_data.videos)), ("periodOptions", ConstructorParameterDescription(_data.periodOptions)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_premiumPromo(_ reader: BufferReader) -> PremiumPromo? { - var _1: String? - _1 = parseString(reader) - var _2: [Api.MessageEntity]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - var _3: [String]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - var _4: [Api.Document]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - var _5: [Api.PremiumSubscriptionOption]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PremiumSubscriptionOption.self) - } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_promoData: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("promoData", [("flags", ConstructorParameterDescription(self.flags)), ("expires", ConstructorParameterDescription(self.expires)), ("peer", ConstructorParameterDescription(self.peer)), ("psaType", ConstructorParameterDescription(self.psaType)), ("psaMessage", ConstructorParameterDescription(self.psaMessage)), ("pendingSuggestions", ConstructorParameterDescription(self.pendingSuggestions)), ("dismissedSuggestions", ConstructorParameterDescription(self.dismissedSuggestions)), ("customPendingSuggestion", ConstructorParameterDescription(self.customPendingSuggestion)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_promoDataEmpty: TypeConstructorDescription { - public var expires: Int32 - public init(expires: Int32) { - self.expires = expires - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("promoDataEmpty", [("expires", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .promoData(let _data): - return ("promoData", [("flags", ConstructorParameterDescription(_data.flags)), ("expires", ConstructorParameterDescription(_data.expires)), ("peer", ConstructorParameterDescription(_data.peer)), ("psaType", ConstructorParameterDescription(_data.psaType)), ("psaMessage", ConstructorParameterDescription(_data.psaMessage)), ("pendingSuggestions", ConstructorParameterDescription(_data.pendingSuggestions)), ("dismissedSuggestions", ConstructorParameterDescription(_data.dismissedSuggestions)), ("customPendingSuggestion", ConstructorParameterDescription(_data.customPendingSuggestion)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .promoDataEmpty(let _data): - return ("promoDataEmpty", [("expires", ConstructorParameterDescription(_data.expires))]) - } - } - - 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 ?? 0) & Int(1 << 3) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _5 = parseString(reader) - } - var _6: [String]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - var _7: [String]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) - } - var _8: Api.PendingSuggestion? - if Int(_1 ?? 0) & 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) - } - var _10: [Api.User]? - if let _ = reader.readInt32() { - _10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil - let _c9 = _9 != nil - let _c10 = _10 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - 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 - } - } - public static func parse_promoDataEmpty(_ reader: BufferReader) -> PromoData? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.help.PromoData.promoDataEmpty(Cons_promoDataEmpty(expires: _1!)) - } - else { - return nil - } + public static func parse_sponsoredMessageReportResultReported(_ reader: BufferReader) -> SponsoredMessageReportResult? { + return Api.channels.SponsoredMessageReportResult.sponsoredMessageReportResultReported } } } diff --git a/submodules/TelegramApi/Sources/Api34.swift b/submodules/TelegramApi/Sources/Api34.swift index 8423bd6add..8f8345bbcf 100644 --- a/submodules/TelegramApi/Sources/Api34.swift +++ b/submodules/TelegramApi/Sources/Api34.swift @@ -1,29 +1,84 @@ -public extension Api.help { - enum RecentMeUrls: TypeConstructorDescription { - public class Cons_recentMeUrls: TypeConstructorDescription { - public var urls: [Api.RecentMeUrl] +public extension Api.chatlists { + enum ChatlistInvite: TypeConstructorDescription { + public class Cons_chatlistInvite: TypeConstructorDescription { + 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(urls: [Api.RecentMeUrl], chats: [Api.Chat], users: [Api.User]) { - self.urls = urls + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentMeUrls", [("urls", ConstructorParameterDescription(self.urls)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("chatlistInvite", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case recentMeUrls(Cons_recentMeUrls) + public class Cons_chatlistInviteAlready: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatlistInviteAlready", [("filterId", ConstructorParameterDescription(self.filterId)), ("missingPeers", ConstructorParameterDescription(self.missingPeers)), ("alreadyPeers", ConstructorParameterDescription(self.alreadyPeers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case chatlistInvite(Cons_chatlistInvite) + case chatlistInviteAlready(Cons_chatlistInviteAlready) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .recentMeUrls(let _data): + case .chatlistInvite(let _data): if boxed { - buffer.appendInt32(235081943) + 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.urls.count)) - for item in _data.urls { + 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) @@ -42,15 +97,135 @@ public extension Api.help { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .recentMeUrls(let _data): - return ("recentMeUrls", [("urls", ConstructorParameterDescription(_data.urls)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .chatlistInvite(let _data): + return ("chatlistInvite", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .chatlistInviteAlready(let _data): + return ("chatlistInviteAlready", [("filterId", ConstructorParameterDescription(_data.filterId)), ("missingPeers", ConstructorParameterDescription(_data.missingPeers)), ("alreadyPeers", ConstructorParameterDescription(_data.alreadyPeers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_recentMeUrls(_ reader: BufferReader) -> RecentMeUrls? { - var _1: [Api.RecentMeUrl]? + public static func parse_chatlistInvite(_ reader: BufferReader) -> ChatlistInvite? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: [Api.Peer]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentMeUrl.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + var _5: [Api.Chat]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _6: [Api.User]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.chatlists.ChatlistInvite.chatlistInvite(Cons_chatlistInvite(flags: _1!, title: _2!, emoticon: _3, peers: _4!, chats: _5!, users: _6!)) + } + else { + return nil + } + } + public static func parse_chatlistInviteAlready(_ reader: BufferReader) -> ChatlistInvite? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Peer]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + var _3: [Api.Peer]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_chatlistUpdates: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatlistUpdates", [("missingPeers", ConstructorParameterDescription(self.missingPeers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .chatlistUpdates(let _data): + return ("chatlistUpdates", [("missingPeers", ConstructorParameterDescription(_data.missingPeers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_chatlistUpdates(_ reader: BufferReader) -> ChatlistUpdates? { + var _1: [Api.Peer]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) } var _2: [Api.Chat]? if let _ = reader.readInt32() { @@ -64,7 +239,7 @@ public extension Api.help { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.help.RecentMeUrls.recentMeUrls(Cons_recentMeUrls(urls: _1!, chats: _2!, users: _3!)) + return Api.chatlists.ChatlistUpdates.chatlistUpdates(Cons_chatlistUpdates(missingPeers: _1!, chats: _2!, users: _3!)) } else { return nil @@ -72,51 +247,53 @@ public extension Api.help { } } } -public extension Api.help { - enum Support: TypeConstructorDescription { - public class Cons_support: TypeConstructorDescription { - public var phoneNumber: String - public var user: Api.User - public init(phoneNumber: String, user: Api.User) { - self.phoneNumber = phoneNumber - self.user = user +public extension Api.chatlists { + enum ExportedChatlistInvite: TypeConstructorDescription { + public class Cons_exportedChatlistInvite: TypeConstructorDescription { + public var filter: Api.DialogFilter + public var invite: Api.ExportedChatlistInvite + public init(filter: Api.DialogFilter, invite: Api.ExportedChatlistInvite) { + self.filter = filter + self.invite = invite } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("support", [("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("user", ConstructorParameterDescription(self.user))]) + return ("exportedChatlistInvite", [("filter", ConstructorParameterDescription(self.filter)), ("invite", ConstructorParameterDescription(self.invite))]) } } - case support(Cons_support) + case exportedChatlistInvite(Cons_exportedChatlistInvite) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .support(let _data): + case .exportedChatlistInvite(let _data): if boxed { - buffer.appendInt32(398898678) + buffer.appendInt32(283567014) } - serializeString(_data.phoneNumber, buffer: buffer, boxed: false) - _data.user.serialize(buffer, true) + _data.filter.serialize(buffer, true) + _data.invite.serialize(buffer, true) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .support(let _data): - return ("support", [("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("user", ConstructorParameterDescription(_data.user))]) + case .exportedChatlistInvite(let _data): + return ("exportedChatlistInvite", [("filter", ConstructorParameterDescription(_data.filter)), ("invite", ConstructorParameterDescription(_data.invite))]) } } - public static func parse_support(_ reader: BufferReader) -> Support? { - var _1: String? - _1 = parseString(reader) - var _2: Api.User? + public static func parse_exportedChatlistInvite(_ reader: BufferReader) -> ExportedChatlistInvite? { + var _1: Api.DialogFilter? if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.User + _1 = Api.parse(reader, signature: signature) as? Api.DialogFilter + } + var _2: Api.ExportedChatlistInvite? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ExportedChatlistInvite } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.help.Support.support(Cons_support(phoneNumber: _1!, user: _2!)) + return Api.chatlists.ExportedChatlistInvite.exportedChatlistInvite(Cons_exportedChatlistInvite(filter: _1!, invite: _2!)) } else { return nil @@ -124,474 +301,73 @@ public extension Api.help { } } } -public extension Api.help { - enum SupportName: TypeConstructorDescription { - public class Cons_supportName: TypeConstructorDescription { - public var name: String - public init(name: String) { - self.name = name +public extension Api.chatlists { + enum ExportedInvites: TypeConstructorDescription { + public class Cons_exportedInvites: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("supportName", [("name", ConstructorParameterDescription(self.name))]) + return ("exportedInvites", [("invites", ConstructorParameterDescription(self.invites)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case supportName(Cons_supportName) + case exportedInvites(Cons_exportedInvites) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .supportName(let _data): + case .exportedInvites(let _data): if boxed { - buffer.appendInt32(-1945767479) + buffer.appendInt32(279670215) } - serializeString(_data.name, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .supportName(let _data): - return ("supportName", [("name", ConstructorParameterDescription(_data.name))]) - } - } - - 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(Cons_supportName(name: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.help { - enum TermsOfService: TypeConstructorDescription { - public class Cons_termsOfService: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("termsOfService", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("text", ConstructorParameterDescription(self.text)), ("entities", ConstructorParameterDescription(self.entities)), ("minAgeConfirm", ConstructorParameterDescription(self.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 { + buffer.appendInt32(Int32(_data.invites.count)) + for item in _data.invites { 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, ConstructorParameterDescription)]) { - switch self { - case .termsOfService(let _data): - return ("termsOfService", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities)), ("minAgeConfirm", ConstructorParameterDescription(_data.minAgeConfirm))]) - } - } - - public static func parse_termsOfService(_ reader: BufferReader) -> TermsOfService? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.DataJSON? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - var _3: String? - _3 = parseString(reader) - var _4: [Api.MessageEntity]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) - } - var _5: Int32? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_termsOfServiceUpdate: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("termsOfServiceUpdate", [("expires", ConstructorParameterDescription(self.expires)), ("termsOfService", ConstructorParameterDescription(self.termsOfService))]) - } - } - public class Cons_termsOfServiceUpdateEmpty: TypeConstructorDescription { - public var expires: Int32 - public init(expires: Int32) { - self.expires = expires - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("termsOfServiceUpdateEmpty", [("expires", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .termsOfServiceUpdate(let _data): - return ("termsOfServiceUpdate", [("expires", ConstructorParameterDescription(_data.expires)), ("termsOfService", ConstructorParameterDescription(_data.termsOfService))]) - case .termsOfServiceUpdateEmpty(let _data): - return ("termsOfServiceUpdateEmpty", [("expires", ConstructorParameterDescription(_data.expires))]) - } - } - - public static func parse_termsOfServiceUpdate(_ reader: BufferReader) -> TermsOfServiceUpdate? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.help.TermsOfService? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.help.TermsOfService - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.help.TermsOfServiceUpdate.termsOfServiceUpdate(Cons_termsOfServiceUpdate(expires: _1!, termsOfService: _2!)) - } - else { - return nil - } - } - public static func parse_termsOfServiceUpdateEmpty(_ reader: BufferReader) -> TermsOfServiceUpdate? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.help.TermsOfServiceUpdate.termsOfServiceUpdateEmpty(Cons_termsOfServiceUpdateEmpty(expires: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.help { - enum TimezonesList: TypeConstructorDescription { - public class Cons_timezonesList: TypeConstructorDescription { - public var timezones: [Api.Timezone] - public var hash: Int32 - public init(timezones: [Api.Timezone], hash: Int32) { - self.timezones = timezones - self.hash = hash - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("timezonesList", [("timezones", ConstructorParameterDescription(self.timezones)), ("hash", ConstructorParameterDescription(self.hash))]) - } - } - case timezonesList(Cons_timezonesList) - 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 { + buffer.appendInt32(Int32(_data.chats.count)) + for item in _data.chats { 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, ConstructorParameterDescription)]) { - switch self { - case .timezonesList(let _data): - return ("timezonesList", [("timezones", ConstructorParameterDescription(_data.timezones)), ("hash", ConstructorParameterDescription(_data.hash))]) - case .timezonesListNotModified: - return ("timezonesListNotModified", []) - } - } - - public static func parse_timezonesList(_ reader: BufferReader) -> TimezonesList? { - var _1: [Api.Timezone]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Timezone.self) - } - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.help.TimezonesList.timezonesList(Cons_timezonesList(timezones: _1!, hash: _2!)) - } - else { - return nil - } - } - public static func parse_timezonesListNotModified(_ reader: BufferReader) -> TimezonesList? { - return Api.help.TimezonesList.timezonesListNotModified - } - } -} -public extension Api.help { - enum UserInfo: TypeConstructorDescription { - public class Cons_userInfo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userInfo", [("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("author", ConstructorParameterDescription(self.author)), ("date", ConstructorParameterDescription(self.date))]) - } - } - case userInfo(Cons_userInfo) - 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 { + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { 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, ConstructorParameterDescription)]) { switch self { - case .userInfo(let _data): - return ("userInfo", [("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("author", ConstructorParameterDescription(_data.author)), ("date", ConstructorParameterDescription(_data.date))]) - case .userInfoEmpty: - return ("userInfoEmpty", []) + case .exportedInvites(let _data): + return ("exportedInvites", [("invites", ConstructorParameterDescription(_data.invites)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_userInfo(_ reader: BufferReader) -> UserInfo? { - var _1: String? - _1 = parseString(reader) - var _2: [Api.MessageEntity]? + public static func parse_exportedInvites(_ reader: BufferReader) -> ExportedInvites? { + var _1: [Api.ExportedChatlistInvite]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ExportedChatlistInvite.self) } - var _3: String? - _3 = parseString(reader) - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.help.UserInfo.userInfo(Cons_userInfo(message: _1!, entities: _2!, author: _3!, date: _4!)) - } - else { - return nil - } - } - public static func parse_userInfoEmpty(_ reader: BufferReader) -> UserInfo? { - return Api.help.UserInfo.userInfoEmpty - } - } -} -public extension Api.messages { - enum AffectedFoundMessages: TypeConstructorDescription { - public class Cons_affectedFoundMessages: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("affectedFoundMessages", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("offset", ConstructorParameterDescription(self.offset)), ("messages", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .affectedFoundMessages(let _data): - return ("affectedFoundMessages", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("offset", ConstructorParameterDescription(_data.offset)), ("messages", ConstructorParameterDescription(_data.messages))]) - } - } - - public static func parse_affectedFoundMessages(_ reader: BufferReader) -> AffectedFoundMessages? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: [Int32]? + var _2: [Api.Chat]? if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.messages.AffectedFoundMessages.affectedFoundMessages(Cons_affectedFoundMessages(pts: _1!, ptsCount: _2!, offset: _3!, messages: _4!)) + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } - else { - return nil - } - } - } -} -public extension Api.messages { - enum AffectedHistory: TypeConstructorDescription { - public class Cons_affectedHistory: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("affectedHistory", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("offset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .affectedHistory(let _data): - return ("affectedHistory", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("offset", ConstructorParameterDescription(_data.offset))]) - } - } - - public static func parse_affectedHistory(_ reader: BufferReader) -> AffectedHistory? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.AffectedHistory.affectedHistory(Cons_affectedHistory(pts: _1!, ptsCount: _2!, offset: _3!)) + return Api.chatlists.ExportedInvites.exportedInvites(Cons_exportedInvites(invites: _1!, chats: _2!, users: _3!)) } else { return nil @@ -599,148 +375,79 @@ public extension Api.messages { } } } -public extension Api.messages { - enum AffectedMessages: TypeConstructorDescription { - public class Cons_affectedMessages: TypeConstructorDescription { - public var pts: Int32 - public var ptsCount: Int32 - public init(pts: Int32, ptsCount: Int32) { - self.pts = pts - self.ptsCount = ptsCount +public extension Api.contacts { + enum Blocked: TypeConstructorDescription { + public class Cons_blocked: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("affectedMessages", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) + return ("blocked", [("blocked", ConstructorParameterDescription(self.blocked)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case affectedMessages(Cons_affectedMessages) + public class Cons_blockedSlice: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("blockedSlice", [("count", ConstructorParameterDescription(self.count)), ("blocked", ConstructorParameterDescription(self.blocked)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case blocked(Cons_blocked) + case blockedSlice(Cons_blockedSlice) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .affectedMessages(let _data): + case .blocked(let _data): if boxed { - buffer.appendInt32(-2066640507) + buffer.appendInt32(182326673) } - serializeInt32(_data.pts, buffer: buffer, boxed: false) - serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .affectedMessages(let _data): - return ("affectedMessages", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) - } - } - - public static func parse_affectedMessages(_ reader: BufferReader) -> AffectedMessages? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.AffectedMessages.affectedMessages(Cons_affectedMessages(pts: _1!, ptsCount: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum AllStickers: TypeConstructorDescription { - public class Cons_allStickers: TypeConstructorDescription { - public var hash: Int64 - public var sets: [Api.StickerSet] - public init(hash: Int64, sets: [Api.StickerSet]) { - self.hash = hash - self.sets = sets - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("allStickers", [("hash", ConstructorParameterDescription(self.hash)), ("sets", ConstructorParameterDescription(self.sets))]) - } - } - case allStickers(Cons_allStickers) - 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 { + 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 .allStickersNotModified: + case .blockedSlice(let _data): if boxed { - buffer.appendInt32(-395967805) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .allStickers(let _data): - return ("allStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("sets", ConstructorParameterDescription(_data.sets))]) - case .allStickersNotModified: - return ("allStickersNotModified", []) - } - } - - public static func parse_allStickers(_ reader: BufferReader) -> AllStickers? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.StickerSet]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSet.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.AllStickers.allStickers(Cons_allStickers(hash: _1!, sets: _2!)) - } - else { - return nil - } - } - public static func parse_allStickersNotModified(_ reader: BufferReader) -> AllStickers? { - return Api.messages.AllStickers.allStickersNotModified - } - } -} -public extension Api.messages { - enum ArchivedStickers: TypeConstructorDescription { - public class Cons_archivedStickers: TypeConstructorDescription { - public var count: Int32 - public var sets: [Api.StickerSetCovered] - public init(count: Int32, sets: [Api.StickerSetCovered]) { - self.count = count - self.sets = sets - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("archivedStickers", [("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.sets))]) - } - } - case archivedStickers(Cons_archivedStickers) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .archivedStickers(let _data): - if boxed { - buffer.appendInt32(1338747336) + buffer.appendInt32(-513392236) } serializeInt32(_data.count, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.sets.count)) - for item in _data.sets { + 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 @@ -749,290 +456,57 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .archivedStickers(let _data): - return ("archivedStickers", [("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets))]) + case .blocked(let _data): + return ("blocked", [("blocked", ConstructorParameterDescription(_data.blocked)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .blockedSlice(let _data): + return ("blockedSlice", [("count", ConstructorParameterDescription(_data.count)), ("blocked", ConstructorParameterDescription(_data.blocked)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_archivedStickers(_ reader: BufferReader) -> ArchivedStickers? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.StickerSetCovered]? + public static func parse_blocked(_ reader: BufferReader) -> Blocked? { + var _1: [Api.PeerBlocked]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerBlocked.self) } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.ArchivedStickers.archivedStickers(Cons_archivedStickers(count: _1!, sets: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum AvailableEffects: TypeConstructorDescription { - public class Cons_availableEffects: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("availableEffects", [("hash", ConstructorParameterDescription(self.hash)), ("effects", ConstructorParameterDescription(self.effects)), ("documents", ConstructorParameterDescription(self.documents))]) - } - } - case availableEffects(Cons_availableEffects) - 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, ConstructorParameterDescription)]) { - switch self { - case .availableEffects(let _data): - return ("availableEffects", [("hash", ConstructorParameterDescription(_data.hash)), ("effects", ConstructorParameterDescription(_data.effects)), ("documents", ConstructorParameterDescription(_data.documents))]) - case .availableEffectsNotModified: - return ("availableEffectsNotModified", []) - } - } - - public static func parse_availableEffects(_ reader: BufferReader) -> AvailableEffects? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.AvailableEffect]? + var _2: [Api.Chat]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AvailableEffect.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } - var _3: [Api.Document]? + var _3: [Api.User]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.AvailableEffects.availableEffects(Cons_availableEffects(hash: _1!, effects: _2!, documents: _3!)) + return Api.contacts.Blocked.blocked(Cons_blocked(blocked: _1!, chats: _2!, users: _3!)) } else { return nil } } - public static func parse_availableEffectsNotModified(_ reader: BufferReader) -> AvailableEffects? { - return Api.messages.AvailableEffects.availableEffectsNotModified - } - } -} -public extension Api.messages { - enum AvailableReactions: TypeConstructorDescription { - public class Cons_availableReactions: TypeConstructorDescription { - public var hash: Int32 - public var reactions: [Api.AvailableReaction] - public init(hash: Int32, reactions: [Api.AvailableReaction]) { - self.hash = hash - self.reactions = reactions - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("availableReactions", [("hash", ConstructorParameterDescription(self.hash)), ("reactions", ConstructorParameterDescription(self.reactions))]) - } - } - case availableReactions(Cons_availableReactions) - 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, ConstructorParameterDescription)]) { - switch self { - case .availableReactions(let _data): - return ("availableReactions", [("hash", ConstructorParameterDescription(_data.hash)), ("reactions", ConstructorParameterDescription(_data.reactions))]) - case .availableReactionsNotModified: - return ("availableReactionsNotModified", []) - } - } - - public static func parse_availableReactions(_ reader: BufferReader) -> AvailableReactions? { + public static func parse_blockedSlice(_ reader: BufferReader) -> Blocked? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.AvailableReaction]? + var _2: [Api.PeerBlocked]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AvailableReaction.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerBlocked.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.AvailableReactions.availableReactions(Cons_availableReactions(hash: _1!, reactions: _2!)) - } - else { - return nil - } - } - public static func parse_availableReactionsNotModified(_ reader: BufferReader) -> AvailableReactions? { - return Api.messages.AvailableReactions.availableReactionsNotModified - } - } -} -public extension Api.messages { - enum BotApp: TypeConstructorDescription { - public class Cons_botApp: TypeConstructorDescription { - public var flags: Int32 - public var app: Api.BotApp - public init(flags: Int32, app: Api.BotApp) { - self.flags = flags - self.app = app - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("botApp", [("flags", ConstructorParameterDescription(self.flags)), ("app", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .botApp(let _data): - return ("botApp", [("flags", ConstructorParameterDescription(_data.flags)), ("app", ConstructorParameterDescription(_data.app))]) - } - } - - public static func parse_botApp(_ reader: BufferReader) -> BotApp? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.BotApp? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.BotApp - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.BotApp.botApp(Cons_botApp(flags: _1!, app: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum BotCallbackAnswer: TypeConstructorDescription { - public class Cons_botCallbackAnswer: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("botCallbackAnswer", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("url", ConstructorParameterDescription(self.url)), ("cacheTime", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .botCallbackAnswer(let _data): - return ("botCallbackAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("url", ConstructorParameterDescription(_data.url)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime))]) - } - } - - public static func parse_botCallbackAnswer(_ reader: BufferReader) -> BotCallbackAnswer? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - var _3: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _3 = parseString(reader) - } - var _4: Int32? - _4 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.BotCallbackAnswer.botCallbackAnswer(Cons_botCallbackAnswer(flags: _1!, message: _2, url: _3, cacheTime: _4!)) + return Api.contacts.Blocked.blockedSlice(Cons_blockedSlice(count: _1!, blocked: _2!, chats: _3!, users: _4!)) } else { return nil @@ -1040,194 +514,30 @@ public extension Api.messages { } } } -public extension Api.messages { - enum BotPreparedInlineMessage: TypeConstructorDescription { - public class Cons_botPreparedInlineMessage: TypeConstructorDescription { - public var id: String - public var expireDate: Int32 - public init(id: String, expireDate: Int32) { - self.id = id - self.expireDate = expireDate - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("botPreparedInlineMessage", [("id", ConstructorParameterDescription(self.id)), ("expireDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .botPreparedInlineMessage(let _data): - return ("botPreparedInlineMessage", [("id", ConstructorParameterDescription(_data.id)), ("expireDate", ConstructorParameterDescription(_data.expireDate))]) - } - } - - public static func parse_botPreparedInlineMessage(_ reader: BufferReader) -> BotPreparedInlineMessage? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.BotPreparedInlineMessage.botPreparedInlineMessage(Cons_botPreparedInlineMessage(id: _1!, expireDate: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum BotResults: TypeConstructorDescription { - public class Cons_botResults: TypeConstructorDescription { - 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 extension Api.contacts { + enum ContactBirthdays: TypeConstructorDescription { + public class Cons_contactBirthdays: TypeConstructorDescription { + public var contacts: [Api.ContactBirthday] 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 + public init(contacts: [Api.ContactBirthday], users: [Api.User]) { + self.contacts = contacts self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("botResults", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("switchPm", ConstructorParameterDescription(self.switchPm)), ("switchWebview", ConstructorParameterDescription(self.switchWebview)), ("results", ConstructorParameterDescription(self.results)), ("cacheTime", ConstructorParameterDescription(self.cacheTime)), ("users", ConstructorParameterDescription(self.users))]) + return ("contactBirthdays", [("contacts", ConstructorParameterDescription(self.contacts)), ("users", ConstructorParameterDescription(self.users))]) } } - case botResults(Cons_botResults) + case contactBirthdays(Cons_contactBirthdays) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .botResults(let _data): + case .contactBirthdays(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(290452237) } 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, ConstructorParameterDescription)]) { - switch self { - case .botResults(let _data): - return ("botResults", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("switchPm", ConstructorParameterDescription(_data.switchPm)), ("switchWebview", ConstructorParameterDescription(_data.switchWebview)), ("results", ConstructorParameterDescription(_data.results)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - 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 ?? 0) & Int(1 << 1) != 0 { - _3 = parseString(reader) - } - var _4: Api.InlineBotSwitchPM? - if Int(_1 ?? 0) & 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 ?? 0) & 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) - } - var _7: Int32? - _7 = reader.readInt32() - var _8: [Api.User]? - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 { - public class Cons_chatAdminsWithInvites: TypeConstructorDescription { - public var admins: [Api.ChatAdminWithInvites] - public var users: [Api.User] - public init(admins: [Api.ChatAdminWithInvites], users: [Api.User]) { - self.admins = admins - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatAdminsWithInvites", [("admins", ConstructorParameterDescription(self.admins)), ("users", ConstructorParameterDescription(self.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 { + buffer.appendInt32(Int32(_data.contacts.count)) + for item in _data.contacts { item.serialize(buffer, true) } buffer.appendInt32(481674261) @@ -1241,15 +551,15 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .chatAdminsWithInvites(let _data): - return ("chatAdminsWithInvites", [("admins", ConstructorParameterDescription(_data.admins)), ("users", ConstructorParameterDescription(_data.users))]) + case .contactBirthdays(let _data): + return ("contactBirthdays", [("contacts", ConstructorParameterDescription(_data.contacts)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_chatAdminsWithInvites(_ reader: BufferReader) -> ChatAdminsWithInvites? { - var _1: [Api.ChatAdminWithInvites]? + public static func parse_contactBirthdays(_ reader: BufferReader) -> ContactBirthdays? { + var _1: [Api.ContactBirthday]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatAdminWithInvites.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ContactBirthday.self) } var _2: [Api.User]? if let _ = reader.readInt32() { @@ -1258,7 +568,7 @@ public extension Api.messages { let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.ChatAdminsWithInvites.chatAdminsWithInvites(Cons_chatAdminsWithInvites(admins: _1!, users: _2!)) + return Api.contacts.ContactBirthdays.contactBirthdays(Cons_contactBirthdays(contacts: _1!, users: _2!)) } else { return nil @@ -1266,30 +576,120 @@ public extension Api.messages { } } } -public extension Api.messages { - enum ChatFull: TypeConstructorDescription { - public class Cons_chatFull: TypeConstructorDescription { - public var fullChat: Api.ChatFull +public extension Api.contacts { + enum Contacts: TypeConstructorDescription { + public class Cons_contacts: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("contacts", [("contacts", ConstructorParameterDescription(self.contacts)), ("savedCount", ConstructorParameterDescription(self.savedCount)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case contacts(Cons_contacts) + 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, ConstructorParameterDescription)]) { + switch self { + case .contacts(let _data): + return ("contacts", [("contacts", ConstructorParameterDescription(_data.contacts)), ("savedCount", ConstructorParameterDescription(_data.savedCount)), ("users", ConstructorParameterDescription(_data.users))]) + case .contactsNotModified: + return ("contactsNotModified", []) + } + } + + public static func parse_contacts(_ reader: BufferReader) -> Contacts? { + var _1: [Api.Contact]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Contact.self) + } + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.contacts.Contacts.contacts(Cons_contacts(contacts: _1!, savedCount: _2!, users: _3!)) + } + else { + return nil + } + } + public static func parse_contactsNotModified(_ reader: BufferReader) -> Contacts? { + return Api.contacts.Contacts.contactsNotModified + } + } +} +public extension Api.contacts { + enum Found: TypeConstructorDescription { + public class Cons_found: TypeConstructorDescription { + public var myResults: [Api.Peer] + public var results: [Api.Peer] public var chats: [Api.Chat] public var users: [Api.User] - public init(fullChat: Api.ChatFull, chats: [Api.Chat], users: [Api.User]) { - self.fullChat = fullChat + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatFull", [("fullChat", ConstructorParameterDescription(self.fullChat)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("found", [("myResults", ConstructorParameterDescription(self.myResults)), ("results", ConstructorParameterDescription(self.results)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case chatFull(Cons_chatFull) + case found(Cons_found) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .chatFull(let _data): + case .found(let _data): if boxed { - buffer.appendInt32(-438840932) + 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) } - _data.fullChat.serialize(buffer, true) buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.chats.count)) for item in _data.chats { @@ -1306,387 +706,34 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .chatFull(let _data): - return ("chatFull", [("fullChat", ConstructorParameterDescription(_data.fullChat)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .found(let _data): + return ("found", [("myResults", ConstructorParameterDescription(_data.myResults)), ("results", ConstructorParameterDescription(_data.results)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_chatFull(_ reader: BufferReader) -> ChatFull? { - var _1: Api.ChatFull? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.ChatFull - } - var _2: [Api.Chat]? + public static func parse_found(_ reader: BufferReader) -> Found? { + var _1: [Api.Peer]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) } - var _3: [Api.User]? + var _2: [Api.Peer]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.ChatFull.chatFull(Cons_chatFull(fullChat: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum ChatInviteImporters: TypeConstructorDescription { - public class Cons_chatInviteImporters: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatInviteImporters", [("count", ConstructorParameterDescription(self.count)), ("importers", ConstructorParameterDescription(self.importers)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .chatInviteImporters(let _data): - return ("chatInviteImporters", [("count", ConstructorParameterDescription(_data.count)), ("importers", ConstructorParameterDescription(_data.importers)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_chatInviteImporters(_ reader: BufferReader) -> ChatInviteImporters? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.ChatInviteImporter]? + var _3: [Api.Chat]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatInviteImporter.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } - var _3: [Api.User]? + var _4: [Api.User]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.ChatInviteImporters.chatInviteImporters(Cons_chatInviteImporters(count: _1!, importers: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum Chats: TypeConstructorDescription { - public class Cons_chats: TypeConstructorDescription { - public var chats: [Api.Chat] - public init(chats: [Api.Chat]) { - self.chats = chats - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chats", [("chats", ConstructorParameterDescription(self.chats))]) - } - } - public class Cons_chatsSlice: TypeConstructorDescription { - public var count: Int32 - public var chats: [Api.Chat] - public init(count: Int32, chats: [Api.Chat]) { - self.count = count - self.chats = chats - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("chatsSlice", [("count", ConstructorParameterDescription(self.count)), ("chats", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .chats(let _data): - return ("chats", [("chats", ConstructorParameterDescription(_data.chats))]) - case .chatsSlice(let _data): - return ("chatsSlice", [("count", ConstructorParameterDescription(_data.count)), ("chats", ConstructorParameterDescription(_data.chats))]) - } - } - - public static func parse_chats(_ reader: BufferReader) -> Chats? { - var _1: [Api.Chat]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.messages.Chats.chats(Cons_chats(chats: _1!)) - } - else { - return nil - } - } - public static func parse_chatsSlice(_ reader: BufferReader) -> Chats? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.Chats.chatsSlice(Cons_chatsSlice(count: _1!, chats: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum CheckedHistoryImportPeer: TypeConstructorDescription { - public class Cons_checkedHistoryImportPeer: TypeConstructorDescription { - public var confirmText: String - public init(confirmText: String) { - self.confirmText = confirmText - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("checkedHistoryImportPeer", [("confirmText", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .checkedHistoryImportPeer(let _data): - return ("checkedHistoryImportPeer", [("confirmText", ConstructorParameterDescription(_data.confirmText))]) - } - } - - 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(Cons_checkedHistoryImportPeer(confirmText: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum ComposedMessageWithAI: TypeConstructorDescription { - public class Cons_composedMessageWithAI: TypeConstructorDescription { - public var flags: Int32 - public var resultText: Api.TextWithEntities - public var diffText: Api.TextWithEntities? - public init(flags: Int32, resultText: Api.TextWithEntities, diffText: Api.TextWithEntities?) { - self.flags = flags - self.resultText = resultText - self.diffText = diffText - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("composedMessageWithAI", [("flags", ConstructorParameterDescription(self.flags)), ("resultText", ConstructorParameterDescription(self.resultText)), ("diffText", ConstructorParameterDescription(self.diffText))]) - } - } - case composedMessageWithAI(Cons_composedMessageWithAI) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .composedMessageWithAI(let _data): - if boxed { - buffer.appendInt32(-1864913414) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.resultText.serialize(buffer, true) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.diffText!.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .composedMessageWithAI(let _data): - return ("composedMessageWithAI", [("flags", ConstructorParameterDescription(_data.flags)), ("resultText", ConstructorParameterDescription(_data.resultText)), ("diffText", ConstructorParameterDescription(_data.diffText))]) - } - } - - public static func parse_composedMessageWithAI(_ reader: BufferReader) -> ComposedMessageWithAI? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.TextWithEntities? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - var _3: Api.TextWithEntities? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.ComposedMessageWithAI.composedMessageWithAI(Cons_composedMessageWithAI(flags: _1!, resultText: _2!, diffText: _3)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum DhConfig: TypeConstructorDescription { - public class Cons_dhConfig: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("dhConfig", [("g", ConstructorParameterDescription(self.g)), ("p", ConstructorParameterDescription(self.p)), ("version", ConstructorParameterDescription(self.version)), ("random", ConstructorParameterDescription(self.random))]) - } - } - public class Cons_dhConfigNotModified: TypeConstructorDescription { - public var random: Buffer - public init(random: Buffer) { - self.random = random - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("dhConfigNotModified", [("random", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .dhConfig(let _data): - return ("dhConfig", [("g", ConstructorParameterDescription(_data.g)), ("p", ConstructorParameterDescription(_data.p)), ("version", ConstructorParameterDescription(_data.version)), ("random", ConstructorParameterDescription(_data.random))]) - case .dhConfigNotModified(let _data): - return ("dhConfigNotModified", [("random", ConstructorParameterDescription(_data.random))]) - } - } - - public static func parse_dhConfig(_ reader: BufferReader) -> DhConfig? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Int32? - _3 = reader.readInt32() - var _4: Buffer? - _4 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.DhConfig.dhConfig(Cons_dhConfig(g: _1!, p: _2!, version: _3!, random: _4!)) - } - else { - return nil - } - } - public static func parse_dhConfigNotModified(_ reader: BufferReader) -> DhConfig? { - var _1: Buffer? - _1 = parseBytes(reader) - let _c1 = _1 != nil - if _c1 { - return Api.messages.DhConfig.dhConfigNotModified(Cons_dhConfigNotModified(random: _1!)) + return Api.contacts.Found.found(Cons_found(myResults: _1!, results: _2!, chats: _3!, users: _4!)) } else { return nil @@ -1694,3 +741,1007 @@ public extension Api.messages { } } } +public extension Api.contacts { + enum ImportedContacts: TypeConstructorDescription { + public class Cons_importedContacts: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("importedContacts", [("imported", ConstructorParameterDescription(self.imported)), ("popularInvites", ConstructorParameterDescription(self.popularInvites)), ("retryContacts", ConstructorParameterDescription(self.retryContacts)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .importedContacts(let _data): + return ("importedContacts", [("imported", ConstructorParameterDescription(_data.imported)), ("popularInvites", ConstructorParameterDescription(_data.popularInvites)), ("retryContacts", ConstructorParameterDescription(_data.retryContacts)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_importedContacts(_ reader: BufferReader) -> ImportedContacts? { + var _1: [Api.ImportedContact]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ImportedContact.self) + } + var _2: [Api.PopularContact]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PopularContact.self) + } + var _3: [Int64]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + 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 { + public class Cons_resolvedPeer: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("resolvedPeer", [("peer", ConstructorParameterDescription(self.peer)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .resolvedPeer(let _data): + return ("resolvedPeer", [("peer", ConstructorParameterDescription(_data.peer)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_resolvedPeer(_ reader: BufferReader) -> ResolvedPeer? { + var _1: Api.Peer? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Peer + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.contacts.ResolvedPeer.resolvedPeer(Cons_resolvedPeer(peer: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.contacts { + enum SponsoredPeers: TypeConstructorDescription { + public class Cons_sponsoredPeers: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sponsoredPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case sponsoredPeers(Cons_sponsoredPeers) + 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, ConstructorParameterDescription)]) { + switch self { + case .sponsoredPeers(let _data): + return ("sponsoredPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .sponsoredPeersEmpty: + return ("sponsoredPeersEmpty", []) + } + } + + public static func parse_sponsoredPeers(_ reader: BufferReader) -> SponsoredPeers? { + var _1: [Api.SponsoredPeer]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SponsoredPeer.self) + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.contacts.SponsoredPeers.sponsoredPeers(Cons_sponsoredPeers(peers: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + public static func parse_sponsoredPeersEmpty(_ reader: BufferReader) -> SponsoredPeers? { + return Api.contacts.SponsoredPeers.sponsoredPeersEmpty + } + } +} +public extension Api.contacts { + enum TopPeers: TypeConstructorDescription { + public class Cons_topPeers: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("topPeers", [("categories", ConstructorParameterDescription(self.categories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case topPeers(Cons_topPeers) + case topPeersDisabled + case topPeersNotModified + + 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, ConstructorParameterDescription)]) { + switch self { + case .topPeers(let _data): + return ("topPeers", [("categories", ConstructorParameterDescription(_data.categories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .topPeersDisabled: + return ("topPeersDisabled", []) + case .topPeersNotModified: + return ("topPeersNotModified", []) + } + } + + public static func parse_topPeers(_ reader: BufferReader) -> TopPeers? { + var _1: [Api.TopPeerCategoryPeers]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TopPeerCategoryPeers.self) + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.contacts.TopPeers.topPeers(Cons_topPeers(categories: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + public static func parse_topPeersDisabled(_ reader: BufferReader) -> TopPeers? { + return Api.contacts.TopPeers.topPeersDisabled + } + public static func parse_topPeersNotModified(_ reader: BufferReader) -> TopPeers? { + return Api.contacts.TopPeers.topPeersNotModified + } + } +} +public extension Api.fragment { + enum CollectibleInfo: TypeConstructorDescription { + public class Cons_collectibleInfo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("collectibleInfo", [("purchaseDate", ConstructorParameterDescription(self.purchaseDate)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount)), ("cryptoCurrency", ConstructorParameterDescription(self.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(self.cryptoAmount)), ("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .collectibleInfo(let _data): + return ("collectibleInfo", [("purchaseDate", ConstructorParameterDescription(_data.purchaseDate)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("cryptoCurrency", ConstructorParameterDescription(_data.cryptoCurrency)), ("cryptoAmount", ConstructorParameterDescription(_data.cryptoAmount)), ("url", ConstructorParameterDescription(_data.url))]) + } + } + + public static func parse_collectibleInfo(_ reader: BufferReader) -> CollectibleInfo? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: Int64? + _5 = reader.readInt64() + var _6: String? + _6 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_appConfig: TypeConstructorDescription { + public var hash: Int32 + public var config: Api.JSONValue + public init(hash: Int32, config: Api.JSONValue) { + self.hash = hash + self.config = config + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("appConfig", [("hash", ConstructorParameterDescription(self.hash)), ("config", ConstructorParameterDescription(self.config))]) + } + } + case appConfig(Cons_appConfig) + 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, ConstructorParameterDescription)]) { + switch self { + case .appConfig(let _data): + return ("appConfig", [("hash", ConstructorParameterDescription(_data.hash)), ("config", ConstructorParameterDescription(_data.config))]) + case .appConfigNotModified: + return ("appConfigNotModified", []) + } + } + + public static func parse_appConfig(_ reader: BufferReader) -> AppConfig? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.JSONValue? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.JSONValue + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.AppConfig.appConfig(Cons_appConfig(hash: _1!, config: _2!)) + } + else { + return nil + } + } + public static func parse_appConfigNotModified(_ reader: BufferReader) -> AppConfig? { + return Api.help.AppConfig.appConfigNotModified + } + } +} +public extension Api.help { + enum AppUpdate: TypeConstructorDescription { + public class Cons_appUpdate: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("appUpdate", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("version", ConstructorParameterDescription(self.version)), ("text", ConstructorParameterDescription(self.text)), ("entities", ConstructorParameterDescription(self.entities)), ("document", ConstructorParameterDescription(self.document)), ("url", ConstructorParameterDescription(self.url)), ("sticker", ConstructorParameterDescription(self.sticker))]) + } + } + case appUpdate(Cons_appUpdate) + 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, ConstructorParameterDescription)]) { + switch self { + case .appUpdate(let _data): + return ("appUpdate", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("version", ConstructorParameterDescription(_data.version)), ("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities)), ("document", ConstructorParameterDescription(_data.document)), ("url", ConstructorParameterDescription(_data.url)), ("sticker", ConstructorParameterDescription(_data.sticker))]) + case .noAppUpdate: + return ("noAppUpdate", []) + } + } + + public static func parse_appUpdate(_ reader: BufferReader) -> AppUpdate? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + var _4: String? + _4 = parseString(reader) + var _5: [Api.MessageEntity]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + var _6: Api.Document? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Document + } + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _7 = parseString(reader) + } + var _8: Api.Document? + if Int(_1 ?? 0) & 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 + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + public static func parse_noAppUpdate(_ reader: BufferReader) -> AppUpdate? { + return Api.help.AppUpdate.noAppUpdate + } + } +} +public extension Api.help { + enum CountriesList: TypeConstructorDescription { + public class Cons_countriesList: TypeConstructorDescription { + public var countries: [Api.help.Country] + public var hash: Int32 + public init(countries: [Api.help.Country], hash: Int32) { + self.countries = countries + self.hash = hash + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("countriesList", [("countries", ConstructorParameterDescription(self.countries)), ("hash", ConstructorParameterDescription(self.hash))]) + } + } + case countriesList(Cons_countriesList) + 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, ConstructorParameterDescription)]) { + switch self { + case .countriesList(let _data): + return ("countriesList", [("countries", ConstructorParameterDescription(_data.countries)), ("hash", ConstructorParameterDescription(_data.hash))]) + case .countriesListNotModified: + return ("countriesListNotModified", []) + } + } + + public static func parse_countriesList(_ reader: BufferReader) -> CountriesList? { + var _1: [Api.help.Country]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.help.Country.self) + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.CountriesList.countriesList(Cons_countriesList(countries: _1!, hash: _2!)) + } + else { + return nil + } + } + public static func parse_countriesListNotModified(_ reader: BufferReader) -> CountriesList? { + return Api.help.CountriesList.countriesListNotModified + } + } +} +public extension Api.help { + enum Country: TypeConstructorDescription { + public class Cons_country: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("country", [("flags", ConstructorParameterDescription(self.flags)), ("iso2", ConstructorParameterDescription(self.iso2)), ("defaultName", ConstructorParameterDescription(self.defaultName)), ("name", ConstructorParameterDescription(self.name)), ("countryCodes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .country(let _data): + return ("country", [("flags", ConstructorParameterDescription(_data.flags)), ("iso2", ConstructorParameterDescription(_data.iso2)), ("defaultName", ConstructorParameterDescription(_data.defaultName)), ("name", ConstructorParameterDescription(_data.name)), ("countryCodes", ConstructorParameterDescription(_data.countryCodes))]) + } + } + + public static func parse_country(_ reader: BufferReader) -> Country? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: String? + _3 = parseString(reader) + var _4: String? + if Int(_1 ?? 0) & 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) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_countryCode: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("countryCode", [("flags", ConstructorParameterDescription(self.flags)), ("countryCode", ConstructorParameterDescription(self.countryCode)), ("prefixes", ConstructorParameterDescription(self.prefixes)), ("patterns", ConstructorParameterDescription(self.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) + } + } + 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) + } + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .countryCode(let _data): + return ("countryCode", [("flags", ConstructorParameterDescription(_data.flags)), ("countryCode", ConstructorParameterDescription(_data.countryCode)), ("prefixes", ConstructorParameterDescription(_data.prefixes)), ("patterns", ConstructorParameterDescription(_data.patterns))]) + } + } + + 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 ?? 0) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + } + var _4: [String]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + 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 { + public class Cons_deepLinkInfo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("deepLinkInfo", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities))]) + } + } + case deepLinkInfo(Cons_deepLinkInfo) + case deepLinkInfoEmpty + + 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, ConstructorParameterDescription)]) { + switch self { + case .deepLinkInfo(let _data): + return ("deepLinkInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities))]) + 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 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.help.DeepLinkInfo.deepLinkInfo(Cons_deepLinkInfo(flags: _1!, message: _2!, entities: _3)) + } + else { + return nil + } + } + public static func parse_deepLinkInfoEmpty(_ reader: BufferReader) -> DeepLinkInfo? { + return Api.help.DeepLinkInfo.deepLinkInfoEmpty + } + } +} +public extension Api.help { + enum InviteText: TypeConstructorDescription { + public class Cons_inviteText: TypeConstructorDescription { + public var message: String + public init(message: String) { + self.message = message + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inviteText", [("message", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .inviteText(let _data): + return ("inviteText", [("message", ConstructorParameterDescription(_data.message))]) + } + } + + 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(Cons_inviteText(message: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.help { + enum PassportConfig: TypeConstructorDescription { + public class Cons_passportConfig: TypeConstructorDescription { + public var hash: Int32 + public var countriesLangs: Api.DataJSON + public init(hash: Int32, countriesLangs: Api.DataJSON) { + self.hash = hash + self.countriesLangs = countriesLangs + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passportConfig", [("hash", ConstructorParameterDescription(self.hash)), ("countriesLangs", ConstructorParameterDescription(self.countriesLangs))]) + } + } + case passportConfig(Cons_passportConfig) + 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, ConstructorParameterDescription)]) { + switch self { + case .passportConfig(let _data): + return ("passportConfig", [("hash", ConstructorParameterDescription(_data.hash)), ("countriesLangs", ConstructorParameterDescription(_data.countriesLangs))]) + case .passportConfigNotModified: + return ("passportConfigNotModified", []) + } + } + + public static func parse_passportConfig(_ reader: BufferReader) -> PassportConfig? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.DataJSON? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.PassportConfig.passportConfig(Cons_passportConfig(hash: _1!, countriesLangs: _2!)) + } + else { + return nil + } + } + public static func parse_passportConfigNotModified(_ reader: BufferReader) -> PassportConfig? { + return Api.help.PassportConfig.passportConfigNotModified + } + } +} diff --git a/submodules/TelegramApi/Sources/Api35.swift b/submodules/TelegramApi/Sources/Api35.swift index 202d0b3a10..1727a10853 100644 --- a/submodules/TelegramApi/Sources/Api35.swift +++ b/submodules/TelegramApi/Sources/Api35.swift @@ -1,29 +1,45 @@ -public extension Api.messages { - enum DialogFilters: TypeConstructorDescription { - public class Cons_dialogFilters: TypeConstructorDescription { +public extension Api.help { + enum PeerColorOption: TypeConstructorDescription { + public class Cons_peerColorOption: TypeConstructorDescription { public var flags: Int32 - public var filters: [Api.DialogFilter] - public init(flags: Int32, filters: [Api.DialogFilter]) { + 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.filters = filters + self.colorId = colorId + self.colors = colors + self.darkColors = darkColors + self.channelMinLevel = channelMinLevel + self.groupMinLevel = groupMinLevel } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("dialogFilters", [("flags", ConstructorParameterDescription(self.flags)), ("filters", ConstructorParameterDescription(self.filters))]) + return ("peerColorOption", [("flags", ConstructorParameterDescription(self.flags)), ("colorId", ConstructorParameterDescription(self.colorId)), ("colors", ConstructorParameterDescription(self.colors)), ("darkColors", ConstructorParameterDescription(self.darkColors)), ("channelMinLevel", ConstructorParameterDescription(self.channelMinLevel)), ("groupMinLevel", ConstructorParameterDescription(self.groupMinLevel))]) } } - case dialogFilters(Cons_dialogFilters) + case peerColorOption(Cons_peerColorOption) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .dialogFilters(let _data): + case .peerColorOption(let _data): if boxed { - buffer.appendInt32(718878489) + buffer.appendInt32(-1377014082) } 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) + 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 } @@ -31,22 +47,44 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .dialogFilters(let _data): - return ("dialogFilters", [("flags", ConstructorParameterDescription(_data.flags)), ("filters", ConstructorParameterDescription(_data.filters))]) + case .peerColorOption(let _data): + return ("peerColorOption", [("flags", ConstructorParameterDescription(_data.flags)), ("colorId", ConstructorParameterDescription(_data.colorId)), ("colors", ConstructorParameterDescription(_data.colors)), ("darkColors", ConstructorParameterDescription(_data.darkColors)), ("channelMinLevel", ConstructorParameterDescription(_data.channelMinLevel)), ("groupMinLevel", ConstructorParameterDescription(_data.groupMinLevel))]) } } - public static func parse_dialogFilters(_ reader: BufferReader) -> DialogFilters? { + public static func parse_peerColorOption(_ reader: BufferReader) -> PeerColorOption? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.DialogFilter]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogFilter.self) + var _2: Int32? + _2 = reader.readInt32() + var _3: Api.help.PeerColorSet? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 3) != 0 { + _5 = reader.readInt32() + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _6 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.DialogFilters.dialogFilters(Cons_dialogFilters(flags: _1!, filters: _2!)) + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.help.PeerColorOption.peerColorOption(Cons_peerColorOption(flags: _1!, colorId: _2!, colors: _3, darkColors: _4, channelMinLevel: _5, groupMinLevel: _6)) } else { return nil @@ -54,70 +92,358 @@ public extension Api.messages { } } } -public extension Api.messages { - enum Dialogs: TypeConstructorDescription { - public class Cons_dialogs: TypeConstructorDescription { - 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 extension Api.help { + enum PeerColorSet: TypeConstructorDescription { + public class Cons_peerColorProfileSet: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("dialogs", [("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("peerColorProfileSet", [("paletteColors", ConstructorParameterDescription(self.paletteColors)), ("bgColors", ConstructorParameterDescription(self.bgColors)), ("storyColors", ConstructorParameterDescription(self.storyColors))]) } } - public class Cons_dialogsNotModified: TypeConstructorDescription { - public var count: Int32 - public init(count: Int32) { - self.count = count + public class Cons_peerColorSet: TypeConstructorDescription { + public var colors: [Int32] + public init(colors: [Int32]) { + self.colors = colors } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("dialogsNotModified", [("count", ConstructorParameterDescription(self.count))]) + return ("peerColorSet", [("colors", ConstructorParameterDescription(self.colors))]) } } - public class Cons_dialogsSlice: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("dialogsSlice", [("count", ConstructorParameterDescription(self.count)), ("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case dialogs(Cons_dialogs) - case dialogsNotModified(Cons_dialogsNotModified) - case dialogsSlice(Cons_dialogsSlice) + case peerColorProfileSet(Cons_peerColorProfileSet) + case peerColorSet(Cons_peerColorSet) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .dialogs(let _data): + case .peerColorProfileSet(let _data): if boxed { - buffer.appendInt32(364538944) + buffer.appendInt32(1987928555) } buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.dialogs.count)) - for item in _data.dialogs { + 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, ConstructorParameterDescription)]) { + switch self { + case .peerColorProfileSet(let _data): + return ("peerColorProfileSet", [("paletteColors", ConstructorParameterDescription(_data.paletteColors)), ("bgColors", ConstructorParameterDescription(_data.bgColors)), ("storyColors", ConstructorParameterDescription(_data.storyColors))]) + case .peerColorSet(let _data): + return ("peerColorSet", [("colors", ConstructorParameterDescription(_data.colors))]) + } + } + + public static func parse_peerColorProfileSet(_ reader: BufferReader) -> PeerColorSet? { + var _1: [Int32]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _2: [Int32]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _3: [Int32]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.help.PeerColorSet.peerColorProfileSet(Cons_peerColorProfileSet(paletteColors: _1!, bgColors: _2!, storyColors: _3!)) + } + else { + return nil + } + } + public static func parse_peerColorSet(_ reader: BufferReader) -> PeerColorSet? { + var _1: [Int32]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.help.PeerColorSet.peerColorSet(Cons_peerColorSet(colors: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.help { + enum PeerColors: TypeConstructorDescription { + public class Cons_peerColors: TypeConstructorDescription { + public var hash: Int32 + public var colors: [Api.help.PeerColorOption] + public init(hash: Int32, colors: [Api.help.PeerColorOption]) { + self.hash = hash + self.colors = colors + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerColors", [("hash", ConstructorParameterDescription(self.hash)), ("colors", ConstructorParameterDescription(self.colors))]) + } + } + case peerColors(Cons_peerColors) + 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, ConstructorParameterDescription)]) { + switch self { + case .peerColors(let _data): + return ("peerColors", [("hash", ConstructorParameterDescription(_data.hash)), ("colors", ConstructorParameterDescription(_data.colors))]) + case .peerColorsNotModified: + return ("peerColorsNotModified", []) + } + } + + public static func parse_peerColors(_ reader: BufferReader) -> PeerColors? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.help.PeerColorOption]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.help.PeerColorOption.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.PeerColors.peerColors(Cons_peerColors(hash: _1!, colors: _2!)) + } + else { + return nil + } + } + public static func parse_peerColorsNotModified(_ reader: BufferReader) -> PeerColors? { + return Api.help.PeerColors.peerColorsNotModified + } + } +} +public extension Api.help { + enum PremiumPromo: TypeConstructorDescription { + public class Cons_premiumPromo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("premiumPromo", [("statusText", ConstructorParameterDescription(self.statusText)), ("statusEntities", ConstructorParameterDescription(self.statusEntities)), ("videoSections", ConstructorParameterDescription(self.videoSections)), ("videos", ConstructorParameterDescription(self.videos)), ("periodOptions", ConstructorParameterDescription(self.periodOptions)), ("users", ConstructorParameterDescription(self.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.messages.count)) - for item in _data.messages { + 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, ConstructorParameterDescription)]) { + switch self { + case .premiumPromo(let _data): + return ("premiumPromo", [("statusText", ConstructorParameterDescription(_data.statusText)), ("statusEntities", ConstructorParameterDescription(_data.statusEntities)), ("videoSections", ConstructorParameterDescription(_data.videoSections)), ("videos", ConstructorParameterDescription(_data.videos)), ("periodOptions", ConstructorParameterDescription(_data.periodOptions)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_premiumPromo(_ reader: BufferReader) -> PremiumPromo? { + var _1: String? + _1 = parseString(reader) + var _2: [Api.MessageEntity]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + var _3: [String]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + var _4: [Api.Document]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + var _5: [Api.PremiumSubscriptionOption]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PremiumSubscriptionOption.self) + } + var _6: [Api.User]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_promoData: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("promoData", [("flags", ConstructorParameterDescription(self.flags)), ("expires", ConstructorParameterDescription(self.expires)), ("peer", ConstructorParameterDescription(self.peer)), ("psaType", ConstructorParameterDescription(self.psaType)), ("psaMessage", ConstructorParameterDescription(self.psaMessage)), ("pendingSuggestions", ConstructorParameterDescription(self.pendingSuggestions)), ("dismissedSuggestions", ConstructorParameterDescription(self.dismissedSuggestions)), ("customPendingSuggestion", ConstructorParameterDescription(self.customPendingSuggestion)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_promoDataEmpty: TypeConstructorDescription { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("promoDataEmpty", [("expires", ConstructorParameterDescription(self.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) @@ -128,25 +454,121 @@ public extension Api.messages { item.serialize(buffer, true) } break - case .dialogsNotModified(let _data): + case .promoDataEmpty(let _data): if boxed { - buffer.appendInt32(-253500010) + buffer.appendInt32(-1728664459) } - serializeInt32(_data.count, buffer: buffer, boxed: false) + serializeInt32(_data.expires, buffer: buffer, boxed: false) break - case .dialogsSlice(let _data): + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .promoData(let _data): + return ("promoData", [("flags", ConstructorParameterDescription(_data.flags)), ("expires", ConstructorParameterDescription(_data.expires)), ("peer", ConstructorParameterDescription(_data.peer)), ("psaType", ConstructorParameterDescription(_data.psaType)), ("psaMessage", ConstructorParameterDescription(_data.psaMessage)), ("pendingSuggestions", ConstructorParameterDescription(_data.pendingSuggestions)), ("dismissedSuggestions", ConstructorParameterDescription(_data.dismissedSuggestions)), ("customPendingSuggestion", ConstructorParameterDescription(_data.customPendingSuggestion)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .promoDataEmpty(let _data): + return ("promoDataEmpty", [("expires", ConstructorParameterDescription(_data.expires))]) + } + } + + 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 ?? 0) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _5 = parseString(reader) + } + var _6: [String]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + var _7: [String]? + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self) + } + var _8: Api.PendingSuggestion? + if Int(_1 ?? 0) & 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) + } + var _10: [Api.User]? + if let _ = reader.readInt32() { + _10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _8 != nil + let _c9 = _9 != nil + let _c10 = _10 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { + 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 + } + } + public static func parse_promoDataEmpty(_ reader: BufferReader) -> PromoData? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.help.PromoData.promoDataEmpty(Cons_promoDataEmpty(expires: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.help { + enum RecentMeUrls: TypeConstructorDescription { + public class Cons_recentMeUrls: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrls", [("urls", ConstructorParameterDescription(self.urls)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case recentMeUrls(Cons_recentMeUrls) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .recentMeUrls(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(235081943) } buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.messages.count)) - for item in _data.messages { + buffer.appendInt32(Int32(_data.urls.count)) + for item in _data.urls { item.serialize(buffer, true) } buffer.appendInt32(481674261) @@ -165,80 +587,500 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .dialogs(let _data): - return ("dialogs", [("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .dialogsNotModified(let _data): - return ("dialogsNotModified", [("count", ConstructorParameterDescription(_data.count))]) - case .dialogsSlice(let _data): - return ("dialogsSlice", [("count", ConstructorParameterDescription(_data.count)), ("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .recentMeUrls(let _data): + return ("recentMeUrls", [("urls", ConstructorParameterDescription(_data.urls)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_dialogs(_ reader: BufferReader) -> Dialogs? { - var _1: [Api.Dialog]? + public static func parse_recentMeUrls(_ reader: BufferReader) -> RecentMeUrls? { + var _1: [Api.RecentMeUrl]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Dialog.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentMeUrl.self) } - var _2: [Api.Message]? + var _2: [Api.Chat]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } - var _3: [Api.Chat]? + var _3: [Api.User]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } - var _4: [Api.User]? + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.help.RecentMeUrls.recentMeUrls(Cons_recentMeUrls(urls: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.help { + enum Support: TypeConstructorDescription { + public class Cons_support: TypeConstructorDescription { + public var phoneNumber: String + public var user: Api.User + public init(phoneNumber: String, user: Api.User) { + self.phoneNumber = phoneNumber + self.user = user + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("support", [("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("user", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .support(let _data): + return ("support", [("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("user", ConstructorParameterDescription(_data.user))]) + } + } + + public static func parse_support(_ reader: BufferReader) -> Support? { + var _1: String? + _1 = parseString(reader) + var _2: Api.User? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.User + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.Support.support(Cons_support(phoneNumber: _1!, user: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.help { + enum SupportName: TypeConstructorDescription { + public class Cons_supportName: TypeConstructorDescription { + public var name: String + public init(name: String) { + self.name = name + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("supportName", [("name", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .supportName(let _data): + return ("supportName", [("name", ConstructorParameterDescription(_data.name))]) + } + } + + 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(Cons_supportName(name: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.help { + enum TermsOfService: TypeConstructorDescription { + public class Cons_termsOfService: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("termsOfService", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("text", ConstructorParameterDescription(self.text)), ("entities", ConstructorParameterDescription(self.entities)), ("minAgeConfirm", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .termsOfService(let _data): + return ("termsOfService", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities)), ("minAgeConfirm", ConstructorParameterDescription(_data.minAgeConfirm))]) + } + } + + public static func parse_termsOfService(_ reader: BufferReader) -> TermsOfService? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.DataJSON? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.DataJSON + } + var _3: String? + _3 = parseString(reader) + var _4: [Api.MessageEntity]? if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + var _5: Int32? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_termsOfServiceUpdate: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("termsOfServiceUpdate", [("expires", ConstructorParameterDescription(self.expires)), ("termsOfService", ConstructorParameterDescription(self.termsOfService))]) + } + } + public class Cons_termsOfServiceUpdateEmpty: TypeConstructorDescription { + public var expires: Int32 + public init(expires: Int32) { + self.expires = expires + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("termsOfServiceUpdateEmpty", [("expires", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .termsOfServiceUpdate(let _data): + return ("termsOfServiceUpdate", [("expires", ConstructorParameterDescription(_data.expires)), ("termsOfService", ConstructorParameterDescription(_data.termsOfService))]) + case .termsOfServiceUpdateEmpty(let _data): + return ("termsOfServiceUpdateEmpty", [("expires", ConstructorParameterDescription(_data.expires))]) + } + } + + public static func parse_termsOfServiceUpdate(_ reader: BufferReader) -> TermsOfServiceUpdate? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.help.TermsOfService? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.help.TermsOfService + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.TermsOfServiceUpdate.termsOfServiceUpdate(Cons_termsOfServiceUpdate(expires: _1!, termsOfService: _2!)) + } + else { + return nil + } + } + public static func parse_termsOfServiceUpdateEmpty(_ reader: BufferReader) -> TermsOfServiceUpdate? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.help.TermsOfServiceUpdate.termsOfServiceUpdateEmpty(Cons_termsOfServiceUpdateEmpty(expires: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.help { + enum TimezonesList: TypeConstructorDescription { + public class Cons_timezonesList: TypeConstructorDescription { + public var timezones: [Api.Timezone] + public var hash: Int32 + public init(timezones: [Api.Timezone], hash: Int32) { + self.timezones = timezones + self.hash = hash + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("timezonesList", [("timezones", ConstructorParameterDescription(self.timezones)), ("hash", ConstructorParameterDescription(self.hash))]) + } + } + case timezonesList(Cons_timezonesList) + 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, ConstructorParameterDescription)]) { + switch self { + case .timezonesList(let _data): + return ("timezonesList", [("timezones", ConstructorParameterDescription(_data.timezones)), ("hash", ConstructorParameterDescription(_data.hash))]) + case .timezonesListNotModified: + return ("timezonesListNotModified", []) + } + } + + public static func parse_timezonesList(_ reader: BufferReader) -> TimezonesList? { + var _1: [Api.Timezone]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Timezone.self) + } + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.help.TimezonesList.timezonesList(Cons_timezonesList(timezones: _1!, hash: _2!)) + } + else { + return nil + } + } + public static func parse_timezonesListNotModified(_ reader: BufferReader) -> TimezonesList? { + return Api.help.TimezonesList.timezonesListNotModified + } + } +} +public extension Api.help { + enum UserInfo: TypeConstructorDescription { + public class Cons_userInfo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userInfo", [("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("author", ConstructorParameterDescription(self.author)), ("date", ConstructorParameterDescription(self.date))]) + } + } + case userInfo(Cons_userInfo) + 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, ConstructorParameterDescription)]) { + switch self { + case .userInfo(let _data): + return ("userInfo", [("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("author", ConstructorParameterDescription(_data.author)), ("date", ConstructorParameterDescription(_data.date))]) + case .userInfoEmpty: + return ("userInfoEmpty", []) + } + } + + public static func parse_userInfo(_ reader: BufferReader) -> UserInfo? { + var _1: String? + _1 = parseString(reader) + var _2: [Api.MessageEntity]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self) + } + var _3: String? + _3 = parseString(reader) + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.help.UserInfo.userInfo(Cons_userInfo(message: _1!, entities: _2!, author: _3!, date: _4!)) + } + else { + return nil + } + } + public static func parse_userInfoEmpty(_ reader: BufferReader) -> UserInfo? { + return Api.help.UserInfo.userInfoEmpty + } + } +} +public extension Api.messages { + enum AffectedFoundMessages: TypeConstructorDescription { + public class Cons_affectedFoundMessages: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("affectedFoundMessages", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("offset", ConstructorParameterDescription(self.offset)), ("messages", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .affectedFoundMessages(let _data): + return ("affectedFoundMessages", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("offset", ConstructorParameterDescription(_data.offset)), ("messages", ConstructorParameterDescription(_data.messages))]) + } + } + + public static func parse_affectedFoundMessages(_ reader: BufferReader) -> AffectedFoundMessages? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: [Int32]? + 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 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.Dialogs.dialogs(Cons_dialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!)) - } - else { - return nil - } - } - public static func parse_dialogsNotModified(_ reader: BufferReader) -> Dialogs? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.messages.Dialogs.dialogsNotModified(Cons_dialogsNotModified(count: _1!)) - } - else { - return nil - } - } - public static func parse_dialogsSlice(_ reader: BufferReader) -> Dialogs? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Dialog]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Dialog.self) - } - var _3: [Api.Message]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.Dialogs.dialogsSlice(Cons_dialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!)) + return Api.messages.AffectedFoundMessages.affectedFoundMessages(Cons_affectedFoundMessages(pts: _1!, ptsCount: _2!, offset: _3!, messages: _4!)) } else { return nil @@ -247,265 +1089,54 @@ public extension Api.messages { } } public extension Api.messages { - enum DiscussionMessage: TypeConstructorDescription { - public class Cons_discussionMessage: TypeConstructorDescription { - 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 + enum AffectedHistory: TypeConstructorDescription { + public class Cons_affectedHistory: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("discussionMessage", [("flags", ConstructorParameterDescription(self.flags)), ("messages", ConstructorParameterDescription(self.messages)), ("maxId", ConstructorParameterDescription(self.maxId)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("affectedHistory", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("offset", ConstructorParameterDescription(self.offset))]) } } - case discussionMessage(Cons_discussionMessage) + case affectedHistory(Cons_affectedHistory) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .discussionMessage(let _data): + case .affectedHistory(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) + 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, ConstructorParameterDescription)]) { switch self { - case .discussionMessage(let _data): - return ("discussionMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("messages", ConstructorParameterDescription(_data.messages)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .affectedHistory(let _data): + return ("affectedHistory", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("offset", ConstructorParameterDescription(_data.offset))]) } } - public static func parse_discussionMessage(_ reader: BufferReader) -> DiscussionMessage? { + public static func parse_affectedHistory(_ reader: BufferReader) -> AffectedHistory? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.Message]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } + var _2: Int32? + _2 = reader.readInt32() var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = reader.readInt32() - } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - _6 = reader.readInt32() - var _7: [Api.Chat]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _8: [Api.User]? - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 { - public class Cons_emojiGameDiceInfo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("emojiGameDiceInfo", [("flags", ConstructorParameterDescription(self.flags)), ("gameHash", ConstructorParameterDescription(self.gameHash)), ("prevStake", ConstructorParameterDescription(self.prevStake)), ("currentStreak", ConstructorParameterDescription(self.currentStreak)), ("params", ConstructorParameterDescription(self.params)), ("playsLeft", ConstructorParameterDescription(self.playsLeft))]) - } - } - case emojiGameDiceInfo(Cons_emojiGameDiceInfo) - 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, ConstructorParameterDescription)]) { - switch self { - case .emojiGameDiceInfo(let _data): - return ("emojiGameDiceInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("gameHash", ConstructorParameterDescription(_data.gameHash)), ("prevStake", ConstructorParameterDescription(_data.prevStake)), ("currentStreak", ConstructorParameterDescription(_data.currentStreak)), ("params", ConstructorParameterDescription(_data.params)), ("playsLeft", ConstructorParameterDescription(_data.playsLeft))]) - case .emojiGameUnavailable: - return ("emojiGameUnavailable", []) - } - } - - public static func parse_emojiGameDiceInfo(_ reader: BufferReader) -> EmojiGameInfo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: [Int32]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.messages.EmojiGameInfo.emojiGameDiceInfo(Cons_emojiGameDiceInfo(flags: _1!, gameHash: _2!, prevStake: _3!, currentStreak: _4!, params: _5!, playsLeft: _6)) - } - else { - return nil - } - } - public static func parse_emojiGameUnavailable(_ reader: BufferReader) -> EmojiGameInfo? { - return Api.messages.EmojiGameInfo.emojiGameUnavailable - } - } -} -public extension Api.messages { - enum EmojiGameOutcome: TypeConstructorDescription { - public class Cons_emojiGameOutcome: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("emojiGameOutcome", [("seed", ConstructorParameterDescription(self.seed)), ("stakeTonAmount", ConstructorParameterDescription(self.stakeTonAmount)), ("tonAmount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .emojiGameOutcome(let _data): - return ("emojiGameOutcome", [("seed", ConstructorParameterDescription(_data.seed)), ("stakeTonAmount", ConstructorParameterDescription(_data.stakeTonAmount)), ("tonAmount", ConstructorParameterDescription(_data.tonAmount))]) - } - } - - public static func parse_emojiGameOutcome(_ reader: BufferReader) -> EmojiGameOutcome? { - var _1: Buffer? - _1 = parseBytes(reader) - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() + _3 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.EmojiGameOutcome.emojiGameOutcome(Cons_emojiGameOutcome(seed: _1!, stakeTonAmount: _2!, tonAmount: _3!)) + return Api.messages.AffectedHistory.affectedHistory(Cons_affectedHistory(pts: _1!, ptsCount: _2!, offset: _3!)) } else { return nil @@ -514,174 +1145,48 @@ public extension Api.messages { } } public extension Api.messages { - enum EmojiGroups: TypeConstructorDescription { - public class Cons_emojiGroups: TypeConstructorDescription { - public var hash: Int32 - public var groups: [Api.EmojiGroup] - public init(hash: Int32, groups: [Api.EmojiGroup]) { - self.hash = hash - self.groups = groups + enum AffectedMessages: TypeConstructorDescription { + public class Cons_affectedMessages: TypeConstructorDescription { + public var pts: Int32 + public var ptsCount: Int32 + public init(pts: Int32, ptsCount: Int32) { + self.pts = pts + self.ptsCount = ptsCount } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("emojiGroups", [("hash", ConstructorParameterDescription(self.hash)), ("groups", ConstructorParameterDescription(self.groups))]) + return ("affectedMessages", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) } } - case emojiGroups(Cons_emojiGroups) - case emojiGroupsNotModified + case affectedMessages(Cons_affectedMessages) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .emojiGroups(let _data): + case .affectedMessages(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) + buffer.appendInt32(-2066640507) } + serializeInt32(_data.pts, buffer: buffer, boxed: false) + serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .emojiGroups(let _data): - return ("emojiGroups", [("hash", ConstructorParameterDescription(_data.hash)), ("groups", ConstructorParameterDescription(_data.groups))]) - case .emojiGroupsNotModified: - return ("emojiGroupsNotModified", []) + case .affectedMessages(let _data): + return ("affectedMessages", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) } } - public static func parse_emojiGroups(_ reader: BufferReader) -> EmojiGroups? { + public static func parse_affectedMessages(_ reader: BufferReader) -> AffectedMessages? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.EmojiGroup]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EmojiGroup.self) - } + var _2: Int32? + _2 = reader.readInt32() let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.EmojiGroups.emojiGroups(Cons_emojiGroups(hash: _1!, groups: _2!)) - } - else { - return nil - } - } - public static func parse_emojiGroupsNotModified(_ reader: BufferReader) -> EmojiGroups? { - return Api.messages.EmojiGroups.emojiGroupsNotModified - } - } -} -public extension Api.messages { - enum ExportedChatInvite: TypeConstructorDescription { - public class Cons_exportedChatInvite: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedChatInvite", [("invite", ConstructorParameterDescription(self.invite)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_exportedChatInviteReplaced: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedChatInviteReplaced", [("invite", ConstructorParameterDescription(self.invite)), ("newInvite", ConstructorParameterDescription(self.newInvite)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .exportedChatInvite(let _data): - return ("exportedChatInvite", [("invite", ConstructorParameterDescription(_data.invite)), ("users", ConstructorParameterDescription(_data.users))]) - case .exportedChatInviteReplaced(let _data): - return ("exportedChatInviteReplaced", [("invite", ConstructorParameterDescription(_data.invite)), ("newInvite", ConstructorParameterDescription(_data.newInvite)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_exportedChatInvite(_ reader: BufferReader) -> ExportedChatInvite? { - var _1: Api.ExportedChatInvite? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.ExportedChatInvite.exportedChatInvite(Cons_exportedChatInvite(invite: _1!, users: _2!)) - } - else { - return nil - } - } - public static func parse_exportedChatInviteReplaced(_ reader: BufferReader) -> ExportedChatInvite? { - var _1: Api.ExportedChatInvite? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } - var _2: Api.ExportedChatInvite? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.ExportedChatInvite.exportedChatInviteReplaced(Cons_exportedChatInviteReplaced(invite: _1!, newInvite: _2!, users: _3!)) + return Api.messages.AffectedMessages.affectedMessages(Cons_affectedMessages(pts: _1!, ptsCount: _2!)) } else { return nil @@ -690,112 +1195,37 @@ public extension Api.messages { } } public extension Api.messages { - enum ExportedChatInvites: TypeConstructorDescription { - public class Cons_exportedChatInvites: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedChatInvites", [("count", ConstructorParameterDescription(self.count)), ("invites", ConstructorParameterDescription(self.invites)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .exportedChatInvites(let _data): - return ("exportedChatInvites", [("count", ConstructorParameterDescription(_data.count)), ("invites", ConstructorParameterDescription(_data.invites)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_exportedChatInvites(_ reader: BufferReader) -> ExportedChatInvites? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.ExportedChatInvite]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ExportedChatInvite.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.ExportedChatInvites.exportedChatInvites(Cons_exportedChatInvites(count: _1!, invites: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum FavedStickers: TypeConstructorDescription { - public class Cons_favedStickers: TypeConstructorDescription { + enum AllStickers: TypeConstructorDescription { + public class Cons_allStickers: TypeConstructorDescription { public var hash: Int64 - public var packs: [Api.StickerPack] - public var stickers: [Api.Document] - public init(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document]) { + public var sets: [Api.StickerSet] + public init(hash: Int64, sets: [Api.StickerSet]) { self.hash = hash - self.packs = packs - self.stickers = stickers + self.sets = sets } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("favedStickers", [("hash", ConstructorParameterDescription(self.hash)), ("packs", ConstructorParameterDescription(self.packs)), ("stickers", ConstructorParameterDescription(self.stickers))]) + return ("allStickers", [("hash", ConstructorParameterDescription(self.hash)), ("sets", ConstructorParameterDescription(self.sets))]) } } - case favedStickers(Cons_favedStickers) - case favedStickersNotModified + case allStickers(Cons_allStickers) + case allStickersNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .favedStickers(let _data): + case .allStickers(let _data): if boxed { - buffer.appendInt32(750063767) + buffer.appendInt32(-843329861) } 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 { + buffer.appendInt32(Int32(_data.sets.count)) + for item in _data.sets { item.serialize(buffer, true) } break - case .favedStickersNotModified: + case .allStickersNotModified: if boxed { - buffer.appendInt32(-1634752813) + buffer.appendInt32(-395967805) } break } @@ -803,19 +1233,149 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .favedStickers(let _data): - return ("favedStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("packs", ConstructorParameterDescription(_data.packs)), ("stickers", ConstructorParameterDescription(_data.stickers))]) - case .favedStickersNotModified: - return ("favedStickersNotModified", []) + case .allStickers(let _data): + return ("allStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("sets", ConstructorParameterDescription(_data.sets))]) + case .allStickersNotModified: + return ("allStickersNotModified", []) } } - public static func parse_favedStickers(_ reader: BufferReader) -> FavedStickers? { + public static func parse_allStickers(_ reader: BufferReader) -> AllStickers? { var _1: Int64? _1 = reader.readInt64() - var _2: [Api.StickerPack]? + var _2: [Api.StickerSet]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerPack.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSet.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.AllStickers.allStickers(Cons_allStickers(hash: _1!, sets: _2!)) + } + else { + return nil + } + } + public static func parse_allStickersNotModified(_ reader: BufferReader) -> AllStickers? { + return Api.messages.AllStickers.allStickersNotModified + } + } +} +public extension Api.messages { + enum ArchivedStickers: TypeConstructorDescription { + public class Cons_archivedStickers: TypeConstructorDescription { + public var count: Int32 + public var sets: [Api.StickerSetCovered] + public init(count: Int32, sets: [Api.StickerSetCovered]) { + self.count = count + self.sets = sets + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("archivedStickers", [("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .archivedStickers(let _data): + return ("archivedStickers", [("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets))]) + } + } + + public static func parse_archivedStickers(_ reader: BufferReader) -> ArchivedStickers? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.StickerSetCovered]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.ArchivedStickers.archivedStickers(Cons_archivedStickers(count: _1!, sets: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum AvailableEffects: TypeConstructorDescription { + public class Cons_availableEffects: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("availableEffects", [("hash", ConstructorParameterDescription(self.hash)), ("effects", ConstructorParameterDescription(self.effects)), ("documents", ConstructorParameterDescription(self.documents))]) + } + } + case availableEffects(Cons_availableEffects) + 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, ConstructorParameterDescription)]) { + switch self { + case .availableEffects(let _data): + return ("availableEffects", [("hash", ConstructorParameterDescription(_data.hash)), ("effects", ConstructorParameterDescription(_data.effects)), ("documents", ConstructorParameterDescription(_data.documents))]) + case .availableEffectsNotModified: + return ("availableEffectsNotModified", []) + } + } + + public static func parse_availableEffects(_ reader: BufferReader) -> AvailableEffects? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.AvailableEffect]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AvailableEffect.self) } var _3: [Api.Document]? if let _ = reader.readInt32() { @@ -825,1087 +1385,306 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.FavedStickers.favedStickers(Cons_favedStickers(hash: _1!, packs: _2!, stickers: _3!)) + return Api.messages.AvailableEffects.availableEffects(Cons_availableEffects(hash: _1!, effects: _2!, documents: _3!)) } else { return nil } } - public static func parse_favedStickersNotModified(_ reader: BufferReader) -> FavedStickers? { - return Api.messages.FavedStickers.favedStickersNotModified + public static func parse_availableEffectsNotModified(_ reader: BufferReader) -> AvailableEffects? { + return Api.messages.AvailableEffects.availableEffectsNotModified } } } public extension Api.messages { - enum FeaturedStickers: TypeConstructorDescription { - public class Cons_featuredStickers: TypeConstructorDescription { - 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 + enum AvailableReactions: TypeConstructorDescription { + public class Cons_availableReactions: TypeConstructorDescription { + public var hash: Int32 + public var reactions: [Api.AvailableReaction] + public init(hash: Int32, reactions: [Api.AvailableReaction]) { self.hash = hash - self.count = count - self.sets = sets - self.unread = unread - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("featuredStickers", [("flags", ConstructorParameterDescription(self.flags)), ("hash", ConstructorParameterDescription(self.hash)), ("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.sets)), ("unread", ConstructorParameterDescription(self.unread))]) - } - } - public class Cons_featuredStickersNotModified: TypeConstructorDescription { - public var count: Int32 - public init(count: Int32) { - self.count = count - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("featuredStickersNotModified", [("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .featuredStickers(let _data): - return ("featuredStickers", [("flags", ConstructorParameterDescription(_data.flags)), ("hash", ConstructorParameterDescription(_data.hash)), ("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets)), ("unread", ConstructorParameterDescription(_data.unread))]) - case .featuredStickersNotModified(let _data): - return ("featuredStickersNotModified", [("count", ConstructorParameterDescription(_data.count))]) - } - } - - public static func parse_featuredStickers(_ reader: BufferReader) -> FeaturedStickers? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: [Api.StickerSetCovered]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) - } - var _5: [Int64]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.FeaturedStickers.featuredStickers(Cons_featuredStickers(flags: _1!, hash: _2!, count: _3!, sets: _4!, unread: _5!)) - } - else { - return nil - } - } - public static func parse_featuredStickersNotModified(_ reader: BufferReader) -> FeaturedStickers? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.messages.FeaturedStickers.featuredStickersNotModified(Cons_featuredStickersNotModified(count: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum ForumTopics: TypeConstructorDescription { - public class Cons_forumTopics: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("forumTopics", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("topics", ConstructorParameterDescription(self.topics)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("pts", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .forumTopics(let _data): - return ("forumTopics", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("topics", ConstructorParameterDescription(_data.topics)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("pts", ConstructorParameterDescription(_data.pts))]) - } - } - - public static func parse_forumTopics(_ reader: BufferReader) -> ForumTopics? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.ForumTopic]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) - } - var _4: [Api.Message]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _5: [Api.Chat]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _7: Int32? - _7 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - 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 { - public class Cons_foundStickerSets: TypeConstructorDescription { - public var hash: Int64 - public var sets: [Api.StickerSetCovered] - public init(hash: Int64, sets: [Api.StickerSetCovered]) { - self.hash = hash - self.sets = sets - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("foundStickerSets", [("hash", ConstructorParameterDescription(self.hash)), ("sets", ConstructorParameterDescription(self.sets))]) - } - } - case foundStickerSets(Cons_foundStickerSets) - 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, ConstructorParameterDescription)]) { - switch self { - case .foundStickerSets(let _data): - return ("foundStickerSets", [("hash", ConstructorParameterDescription(_data.hash)), ("sets", ConstructorParameterDescription(_data.sets))]) - case .foundStickerSetsNotModified: - return ("foundStickerSetsNotModified", []) - } - } - - public static func parse_foundStickerSets(_ reader: BufferReader) -> FoundStickerSets? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.StickerSetCovered]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.FoundStickerSets.foundStickerSets(Cons_foundStickerSets(hash: _1!, sets: _2!)) - } - else { - return nil - } - } - public static func parse_foundStickerSetsNotModified(_ reader: BufferReader) -> FoundStickerSets? { - return Api.messages.FoundStickerSets.foundStickerSetsNotModified - } - } -} -public extension Api.messages { - enum FoundStickers: TypeConstructorDescription { - public class Cons_foundStickers: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("foundStickers", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("hash", ConstructorParameterDescription(self.hash)), ("stickers", ConstructorParameterDescription(self.stickers))]) - } - } - public class Cons_foundStickersNotModified: TypeConstructorDescription { - public var flags: Int32 - public var nextOffset: Int32? - public init(flags: Int32, nextOffset: Int32?) { - self.flags = flags - self.nextOffset = nextOffset - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("foundStickersNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .foundStickers(let _data): - return ("foundStickers", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("hash", ConstructorParameterDescription(_data.hash)), ("stickers", ConstructorParameterDescription(_data.stickers))]) - case .foundStickersNotModified(let _data): - return ("foundStickersNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) - } - } - - public static func parse_foundStickers(_ reader: BufferReader) -> FoundStickers? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int64? - _3 = reader.readInt64() - var _4: [Api.Document]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.messages.FoundStickers.foundStickers(Cons_foundStickers(flags: _1!, nextOffset: _2, hash: _3!, stickers: _4!)) - } - else { - return nil - } - } - public static func parse_foundStickersNotModified(_ reader: BufferReader) -> FoundStickers? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.messages.FoundStickers.foundStickersNotModified(Cons_foundStickersNotModified(flags: _1!, nextOffset: _2)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum HighScores: TypeConstructorDescription { - public class Cons_highScores: TypeConstructorDescription { - public var scores: [Api.HighScore] - public var users: [Api.User] - public init(scores: [Api.HighScore], users: [Api.User]) { - self.scores = scores - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("highScores", [("scores", ConstructorParameterDescription(self.scores)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .highScores(let _data): - return ("highScores", [("scores", ConstructorParameterDescription(_data.scores)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_highScores(_ reader: BufferReader) -> HighScores? { - var _1: [Api.HighScore]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.HighScore.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.HighScores.highScores(Cons_highScores(scores: _1!, users: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum HistoryImport: TypeConstructorDescription { - public class Cons_historyImport: TypeConstructorDescription { - public var id: Int64 - public init(id: Int64) { - self.id = id - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("historyImport", [("id", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .historyImport(let _data): - return ("historyImport", [("id", ConstructorParameterDescription(_data.id))]) - } - } - - 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(Cons_historyImport(id: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum HistoryImportParsed: TypeConstructorDescription { - public class Cons_historyImportParsed: TypeConstructorDescription { - public var flags: Int32 - public var title: String? - public init(flags: Int32, title: String?) { - self.flags = flags - self.title = title - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("historyImportParsed", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .historyImportParsed(let _data): - return ("historyImportParsed", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title))]) - } - } - - public static func parse_historyImportParsed(_ reader: BufferReader) -> HistoryImportParsed? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _2 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _2 != nil - if _c1 && _c2 { - return Api.messages.HistoryImportParsed.historyImportParsed(Cons_historyImportParsed(flags: _1!, title: _2)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum InactiveChats: TypeConstructorDescription { - public class Cons_inactiveChats: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("inactiveChats", [("dates", ConstructorParameterDescription(self.dates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .inactiveChats(let _data): - return ("inactiveChats", [("dates", ConstructorParameterDescription(_data.dates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_inactiveChats(_ reader: BufferReader) -> InactiveChats? { - var _1: [Int32]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.InactiveChats.inactiveChats(Cons_inactiveChats(dates: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - indirect enum InvitedUsers: TypeConstructorDescription { - public class Cons_invitedUsers: TypeConstructorDescription { - public var updates: Api.Updates - public var missingInvitees: [Api.MissingInvitee] - public init(updates: Api.Updates, missingInvitees: [Api.MissingInvitee]) { - self.updates = updates - self.missingInvitees = missingInvitees - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("invitedUsers", [("updates", ConstructorParameterDescription(self.updates)), ("missingInvitees", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .invitedUsers(let _data): - return ("invitedUsers", [("updates", ConstructorParameterDescription(_data.updates)), ("missingInvitees", ConstructorParameterDescription(_data.missingInvitees))]) - } - } - - public static func parse_invitedUsers(_ reader: BufferReader) -> InvitedUsers? { - var _1: Api.Updates? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Updates - } - var _2: [Api.MissingInvitee]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MissingInvitee.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.InvitedUsers.invitedUsers(Cons_invitedUsers(updates: _1!, missingInvitees: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum MessageEditData: TypeConstructorDescription { - public class Cons_messageEditData: TypeConstructorDescription { - public var flags: Int32 - public init(flags: Int32) { - self.flags = flags - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageEditData", [("flags", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messageEditData(let _data): - return ("messageEditData", [("flags", ConstructorParameterDescription(_data.flags))]) - } - } - - 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(Cons_messageEditData(flags: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum MessageReactionsList: TypeConstructorDescription { - public class Cons_messageReactionsList: TypeConstructorDescription { - 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageReactionsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("reactions", ConstructorParameterDescription(self.reactions)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) + return ("availableReactions", [("hash", ConstructorParameterDescription(self.hash)), ("reactions", ConstructorParameterDescription(self.reactions))]) } } - case messageReactionsList(Cons_messageReactionsList) + case availableReactions(Cons_availableReactions) + case availableReactionsNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .messageReactionsList(let _data): + case .availableReactions(let _data): if boxed { - buffer.appendInt32(834488621) + buffer.appendInt32(1989032621) } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt32(_data.count, buffer: buffer, boxed: false) + 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) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) + break + case .availableReactionsNotModified: + if boxed { + buffer.appendInt32(-1626924713) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .availableReactions(let _data): + return ("availableReactions", [("hash", ConstructorParameterDescription(_data.hash)), ("reactions", ConstructorParameterDescription(_data.reactions))]) + case .availableReactionsNotModified: + return ("availableReactionsNotModified", []) + } + } + + public static func parse_availableReactions(_ reader: BufferReader) -> AvailableReactions? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.AvailableReaction]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AvailableReaction.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.AvailableReactions.availableReactions(Cons_availableReactions(hash: _1!, reactions: _2!)) + } + else { + return nil + } + } + public static func parse_availableReactionsNotModified(_ reader: BufferReader) -> AvailableReactions? { + return Api.messages.AvailableReactions.availableReactionsNotModified + } + } +} +public extension Api.messages { + enum BotApp: TypeConstructorDescription { + public class Cons_botApp: TypeConstructorDescription { + public var flags: Int32 + public var app: Api.BotApp + public init(flags: Int32, app: Api.BotApp) { + self.flags = flags + self.app = app + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botApp", [("flags", ConstructorParameterDescription(self.flags)), ("app", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .botApp(let _data): + return ("botApp", [("flags", ConstructorParameterDescription(_data.flags)), ("app", ConstructorParameterDescription(_data.app))]) + } + } + + public static func parse_botApp(_ reader: BufferReader) -> BotApp? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.BotApp? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.BotApp + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.BotApp.botApp(Cons_botApp(flags: _1!, app: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum BotCallbackAnswer: TypeConstructorDescription { + public class Cons_botCallbackAnswer: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botCallbackAnswer", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("url", ConstructorParameterDescription(self.url)), ("cacheTime", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .botCallbackAnswer(let _data): + return ("botCallbackAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("url", ConstructorParameterDescription(_data.url)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime))]) + } + } + + public static func parse_botCallbackAnswer(_ reader: BufferReader) -> BotCallbackAnswer? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + var _3: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _3 = parseString(reader) + } + var _4: Int32? + _4 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + 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 { + public class Cons_botPreparedInlineMessage: TypeConstructorDescription { + public var id: String + public var expireDate: Int32 + public init(id: String, expireDate: Int32) { + self.id = id + self.expireDate = expireDate + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botPreparedInlineMessage", [("id", ConstructorParameterDescription(self.id)), ("expireDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .botPreparedInlineMessage(let _data): + return ("botPreparedInlineMessage", [("id", ConstructorParameterDescription(_data.id)), ("expireDate", ConstructorParameterDescription(_data.expireDate))]) + } + } + + public static func parse_botPreparedInlineMessage(_ reader: BufferReader) -> BotPreparedInlineMessage? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.BotPreparedInlineMessage.botPreparedInlineMessage(Cons_botPreparedInlineMessage(id: _1!, expireDate: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum BotResults: TypeConstructorDescription { + public class Cons_botResults: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botResults", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("switchPm", ConstructorParameterDescription(self.switchPm)), ("switchWebview", ConstructorParameterDescription(self.switchWebview)), ("results", ConstructorParameterDescription(self.results)), ("cacheTime", ConstructorParameterDescription(self.cacheTime)), ("users", ConstructorParameterDescription(self.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) } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .messageReactionsList(let _data): - return ("messageReactionsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) - } - } - - public static func parse_messageReactionsList(_ reader: BufferReader) -> MessageReactionsList? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.MessagePeerReaction]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessagePeerReaction.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_messageViews: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageViews", [("views", ConstructorParameterDescription(self.views)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .messageViews(let _data): - return ("messageViews", [("views", ConstructorParameterDescription(_data.views)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_messageViews(_ reader: BufferReader) -> MessageViews? { - var _1: [Api.MessageViews]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageViews.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.MessageViews.messageViews(Cons_messageViews(views: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum Messages: TypeConstructorDescription { - public class Cons_channelMessages: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("channelMessages", [("flags", ConstructorParameterDescription(self.flags)), ("pts", ConstructorParameterDescription(self.pts)), ("count", ConstructorParameterDescription(self.count)), ("offsetIdOffset", ConstructorParameterDescription(self.offsetIdOffset)), ("messages", ConstructorParameterDescription(self.messages)), ("topics", ConstructorParameterDescription(self.topics)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_messages: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messages", [("messages", ConstructorParameterDescription(self.messages)), ("topics", ConstructorParameterDescription(self.topics)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_messagesNotModified: TypeConstructorDescription { - public var count: Int32 - public init(count: Int32) { - self.count = count - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messagesNotModified", [("count", ConstructorParameterDescription(self.count))]) - } - } - public class Cons_messagesSlice: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messagesSlice", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("nextRate", ConstructorParameterDescription(self.nextRate)), ("offsetIdOffset", ConstructorParameterDescription(self.offsetIdOffset)), ("searchFlood", ConstructorParameterDescription(self.searchFlood)), ("messages", ConstructorParameterDescription(self.messages)), ("topics", ConstructorParameterDescription(self.topics)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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) + _data.switchPm!.serialize(buffer, true) } if Int(_data.flags) & Int(1 << 3) != 0 { - _data.searchFlood!.serialize(buffer, true) + _data.switchWebview!.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 { + 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 { @@ -1917,144 +1696,52 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .channelMessages(let _data): - return ("channelMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("pts", ConstructorParameterDescription(_data.pts)), ("count", ConstructorParameterDescription(_data.count)), ("offsetIdOffset", ConstructorParameterDescription(_data.offsetIdOffset)), ("messages", ConstructorParameterDescription(_data.messages)), ("topics", ConstructorParameterDescription(_data.topics)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .messages(let _data): - return ("messages", [("messages", ConstructorParameterDescription(_data.messages)), ("topics", ConstructorParameterDescription(_data.topics)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .messagesNotModified(let _data): - return ("messagesNotModified", [("count", ConstructorParameterDescription(_data.count))]) - case .messagesSlice(let _data): - return ("messagesSlice", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("nextRate", ConstructorParameterDescription(_data.nextRate)), ("offsetIdOffset", ConstructorParameterDescription(_data.offsetIdOffset)), ("searchFlood", ConstructorParameterDescription(_data.searchFlood)), ("messages", ConstructorParameterDescription(_data.messages)), ("topics", ConstructorParameterDescription(_data.topics)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .botResults(let _data): + return ("botResults", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("switchPm", ConstructorParameterDescription(_data.switchPm)), ("switchWebview", ConstructorParameterDescription(_data.switchWebview)), ("results", ConstructorParameterDescription(_data.results)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_channelMessages(_ reader: BufferReader) -> Messages? { + public static func parse_botResults(_ reader: BufferReader) -> BotResults? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = parseString(reader) + } + var _4: Api.InlineBotSwitchPM? if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt32() + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.InlineBotSwitchPM + } } - var _5: [Api.Message]? + var _5: Api.InlineBotWebView? + if Int(_1 ?? 0) & 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() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _6: [Api.ForumTopic]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) - } - var _7: [Api.Chat]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotInlineResult.self) } + var _7: Int32? + _7 = reader.readInt32() var _8: [Api.User]? if let _ = reader.readInt32() { _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - 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 - } - } - public static func parse_messages(_ reader: BufferReader) -> Messages? { - var _1: [Api.Message]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _2: [Api.ForumTopic]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.messages.Messages.messages(Cons_messages(messages: _1!, topics: _2!, chats: _3!, users: _4!)) - } - else { - return nil - } - } - public static func parse_messagesNotModified(_ reader: BufferReader) -> Messages? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.messages.Messages.messagesNotModified(Cons_messagesNotModified(count: _1!)) - } - else { - return nil - } - } - public static func parse_messagesSlice(_ reader: BufferReader) -> Messages? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt32() - } - var _5: Api.SearchPostsFlood? - if Int(_1 ?? 0) & 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) - } - var _7: [Api.ForumTopic]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) - } - var _8: [Api.Chat]? - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _9: [Api.User]? - if let _ = reader.readInt32() { - _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil let _c6 = _6 != nil let _c7 = _7 != nil let _c8 = _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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!)) + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 diff --git a/submodules/TelegramApi/Sources/Api36.swift b/submodules/TelegramApi/Sources/Api36.swift index 1670f3226a..e16cb3b45e 100644 --- a/submodules/TelegramApi/Sources/Api36.swift +++ b/submodules/TelegramApi/Sources/Api36.swift @@ -1,28 +1,32 @@ public extension Api.messages { - enum MyStickers: TypeConstructorDescription { - public class Cons_myStickers: TypeConstructorDescription { - public var count: Int32 - public var sets: [Api.StickerSetCovered] - public init(count: Int32, sets: [Api.StickerSetCovered]) { - self.count = count - self.sets = sets + enum ChatAdminsWithInvites: TypeConstructorDescription { + public class Cons_chatAdminsWithInvites: TypeConstructorDescription { + public var admins: [Api.ChatAdminWithInvites] + public var users: [Api.User] + public init(admins: [Api.ChatAdminWithInvites], users: [Api.User]) { + self.admins = admins + self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("myStickers", [("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.sets))]) + return ("chatAdminsWithInvites", [("admins", ConstructorParameterDescription(self.admins)), ("users", ConstructorParameterDescription(self.users))]) } } - case myStickers(Cons_myStickers) + case chatAdminsWithInvites(Cons_chatAdminsWithInvites) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .myStickers(let _data): + case .chatAdminsWithInvites(let _data): if boxed { - buffer.appendInt32(-83926371) + buffer.appendInt32(-1231326505) } - serializeInt32(_data.count, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.sets.count)) - for item in _data.sets { + 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 @@ -31,22 +35,24 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .myStickers(let _data): - return ("myStickers", [("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets))]) + case .chatAdminsWithInvites(let _data): + return ("chatAdminsWithInvites", [("admins", ConstructorParameterDescription(_data.admins)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_myStickers(_ reader: BufferReader) -> MyStickers? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.StickerSetCovered]? + public static func parse_chatAdminsWithInvites(_ reader: BufferReader) -> ChatAdminsWithInvites? { + var _1: [Api.ChatAdminWithInvites]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatAdminWithInvites.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.MyStickers.myStickers(Cons_myStickers(count: _1!, sets: _2!)) + return Api.messages.ChatAdminsWithInvites.chatAdminsWithInvites(Cons_chatAdminsWithInvites(admins: _1!, users: _2!)) } else { return nil @@ -55,31 +61,640 @@ public extension Api.messages { } } public extension Api.messages { - enum PeerDialogs: TypeConstructorDescription { - public class Cons_peerDialogs: TypeConstructorDescription { + enum ChatFull: TypeConstructorDescription { + public class Cons_chatFull: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatFull", [("fullChat", ConstructorParameterDescription(self.fullChat)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .chatFull(let _data): + return ("chatFull", [("fullChat", ConstructorParameterDescription(_data.fullChat)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_chatFull(_ reader: BufferReader) -> ChatFull? { + var _1: Api.ChatFull? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.ChatFull + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.ChatFull.chatFull(Cons_chatFull(fullChat: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum ChatInviteImporters: TypeConstructorDescription { + public class Cons_chatInviteImporters: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInviteImporters", [("count", ConstructorParameterDescription(self.count)), ("importers", ConstructorParameterDescription(self.importers)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .chatInviteImporters(let _data): + return ("chatInviteImporters", [("count", ConstructorParameterDescription(_data.count)), ("importers", ConstructorParameterDescription(_data.importers)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_chatInviteImporters(_ reader: BufferReader) -> ChatInviteImporters? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.ChatInviteImporter]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatInviteImporter.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.ChatInviteImporters.chatInviteImporters(Cons_chatInviteImporters(count: _1!, importers: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + indirect enum ChatInviteJoinResult: TypeConstructorDescription { + public class Cons_chatInviteJoinResultOk: TypeConstructorDescription { + public var updates: Api.Updates + public init(updates: Api.Updates) { + self.updates = updates + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInviteJoinResultOk", [("updates", ConstructorParameterDescription(self.updates))]) + } + } + public class Cons_chatInviteJoinResultWebView: TypeConstructorDescription { + public var botId: Int64 + public var url: String + public var queryId: Int64 + public var users: [Api.User] + public init(botId: Int64, url: String, queryId: Int64, users: [Api.User]) { + self.botId = botId + self.url = url + self.queryId = queryId + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInviteJoinResultWebView", [("botId", ConstructorParameterDescription(self.botId)), ("url", ConstructorParameterDescription(self.url)), ("queryId", ConstructorParameterDescription(self.queryId)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case chatInviteJoinResultOk(Cons_chatInviteJoinResultOk) + case chatInviteJoinResultWebView(Cons_chatInviteJoinResultWebView) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .chatInviteJoinResultOk(let _data): + if boxed { + buffer.appendInt32(1146512295) + } + _data.updates.serialize(buffer, true) + break + case .chatInviteJoinResultWebView(let _data): + if boxed { + buffer.appendInt32(2001452532) + } + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeString(_data.url, buffer: buffer, boxed: false) + serializeInt64(_data.queryId, 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, ConstructorParameterDescription)]) { + switch self { + case .chatInviteJoinResultOk(let _data): + return ("chatInviteJoinResultOk", [("updates", ConstructorParameterDescription(_data.updates))]) + case .chatInviteJoinResultWebView(let _data): + return ("chatInviteJoinResultWebView", [("botId", ConstructorParameterDescription(_data.botId)), ("url", ConstructorParameterDescription(_data.url)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_chatInviteJoinResultOk(_ reader: BufferReader) -> ChatInviteJoinResult? { + var _1: Api.Updates? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Updates + } + let _c1 = _1 != nil + if _c1 { + return Api.messages.ChatInviteJoinResult.chatInviteJoinResultOk(Cons_chatInviteJoinResultOk(updates: _1!)) + } + else { + return nil + } + } + public static func parse_chatInviteJoinResultWebView(_ reader: BufferReader) -> ChatInviteJoinResult? { + var _1: Int64? + _1 = reader.readInt64() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.ChatInviteJoinResult.chatInviteJoinResultWebView(Cons_chatInviteJoinResultWebView(botId: _1!, url: _2!, queryId: _3!, users: _4!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum Chats: TypeConstructorDescription { + public class Cons_chats: TypeConstructorDescription { + public var chats: [Api.Chat] + public init(chats: [Api.Chat]) { + self.chats = chats + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chats", [("chats", ConstructorParameterDescription(self.chats))]) + } + } + public class Cons_chatsSlice: TypeConstructorDescription { + public var count: Int32 + public var chats: [Api.Chat] + public init(count: Int32, chats: [Api.Chat]) { + self.count = count + self.chats = chats + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatsSlice", [("count", ConstructorParameterDescription(self.count)), ("chats", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .chats(let _data): + return ("chats", [("chats", ConstructorParameterDescription(_data.chats))]) + case .chatsSlice(let _data): + return ("chatsSlice", [("count", ConstructorParameterDescription(_data.count)), ("chats", ConstructorParameterDescription(_data.chats))]) + } + } + + public static func parse_chats(_ reader: BufferReader) -> Chats? { + var _1: [Api.Chat]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.messages.Chats.chats(Cons_chats(chats: _1!)) + } + else { + return nil + } + } + public static func parse_chatsSlice(_ reader: BufferReader) -> Chats? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.Chats.chatsSlice(Cons_chatsSlice(count: _1!, chats: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum CheckedHistoryImportPeer: TypeConstructorDescription { + public class Cons_checkedHistoryImportPeer: TypeConstructorDescription { + public var confirmText: String + public init(confirmText: String) { + self.confirmText = confirmText + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("checkedHistoryImportPeer", [("confirmText", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .checkedHistoryImportPeer(let _data): + return ("checkedHistoryImportPeer", [("confirmText", ConstructorParameterDescription(_data.confirmText))]) + } + } + + 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(Cons_checkedHistoryImportPeer(confirmText: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum ComposedMessageWithAI: TypeConstructorDescription { + public class Cons_composedMessageWithAI: TypeConstructorDescription { + public var flags: Int32 + public var resultText: Api.TextWithEntities + public var diffText: Api.TextWithEntities? + public init(flags: Int32, resultText: Api.TextWithEntities, diffText: Api.TextWithEntities?) { + self.flags = flags + self.resultText = resultText + self.diffText = diffText + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("composedMessageWithAI", [("flags", ConstructorParameterDescription(self.flags)), ("resultText", ConstructorParameterDescription(self.resultText)), ("diffText", ConstructorParameterDescription(self.diffText))]) + } + } + case composedMessageWithAI(Cons_composedMessageWithAI) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .composedMessageWithAI(let _data): + if boxed { + buffer.appendInt32(-1864913414) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.resultText.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.diffText!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .composedMessageWithAI(let _data): + return ("composedMessageWithAI", [("flags", ConstructorParameterDescription(_data.flags)), ("resultText", ConstructorParameterDescription(_data.resultText)), ("diffText", ConstructorParameterDescription(_data.diffText))]) + } + } + + public static func parse_composedMessageWithAI(_ reader: BufferReader) -> ComposedMessageWithAI? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.TextWithEntities? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + var _3: Api.TextWithEntities? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.ComposedMessageWithAI.composedMessageWithAI(Cons_composedMessageWithAI(flags: _1!, resultText: _2!, diffText: _3)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum DhConfig: TypeConstructorDescription { + public class Cons_dhConfig: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dhConfig", [("g", ConstructorParameterDescription(self.g)), ("p", ConstructorParameterDescription(self.p)), ("version", ConstructorParameterDescription(self.version)), ("random", ConstructorParameterDescription(self.random))]) + } + } + public class Cons_dhConfigNotModified: TypeConstructorDescription { + public var random: Buffer + public init(random: Buffer) { + self.random = random + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dhConfigNotModified", [("random", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .dhConfig(let _data): + return ("dhConfig", [("g", ConstructorParameterDescription(_data.g)), ("p", ConstructorParameterDescription(_data.p)), ("version", ConstructorParameterDescription(_data.version)), ("random", ConstructorParameterDescription(_data.random))]) + case .dhConfigNotModified(let _data): + return ("dhConfigNotModified", [("random", ConstructorParameterDescription(_data.random))]) + } + } + + public static func parse_dhConfig(_ reader: BufferReader) -> DhConfig? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Int32? + _3 = reader.readInt32() + var _4: Buffer? + _4 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.DhConfig.dhConfig(Cons_dhConfig(g: _1!, p: _2!, version: _3!, random: _4!)) + } + else { + return nil + } + } + public static func parse_dhConfigNotModified(_ reader: BufferReader) -> DhConfig? { + var _1: Buffer? + _1 = parseBytes(reader) + let _c1 = _1 != nil + if _c1 { + return Api.messages.DhConfig.dhConfigNotModified(Cons_dhConfigNotModified(random: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum DialogFilters: TypeConstructorDescription { + public class Cons_dialogFilters: TypeConstructorDescription { + public var flags: Int32 + public var filters: [Api.DialogFilter] + public init(flags: Int32, filters: [Api.DialogFilter]) { + self.flags = flags + self.filters = filters + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogFilters", [("flags", ConstructorParameterDescription(self.flags)), ("filters", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .dialogFilters(let _data): + return ("dialogFilters", [("flags", ConstructorParameterDescription(_data.flags)), ("filters", ConstructorParameterDescription(_data.filters))]) + } + } + + public static func parse_dialogFilters(_ reader: BufferReader) -> DialogFilters? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.DialogFilter]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogFilter.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.DialogFilters.dialogFilters(Cons_dialogFilters(flags: _1!, filters: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum Dialogs: TypeConstructorDescription { + public class Cons_dialogs: TypeConstructorDescription { 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) { + 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 - self.state = state } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerDialogs", [("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("state", ConstructorParameterDescription(self.state))]) + return ("dialogs", [("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case peerDialogs(Cons_peerDialogs) + public class Cons_dialogsNotModified: TypeConstructorDescription { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogsNotModified", [("count", ConstructorParameterDescription(self.count))]) + } + } + public class Cons_dialogsSlice: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogsSlice", [("count", ConstructorParameterDescription(self.count)), ("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case dialogs(Cons_dialogs) + case dialogsNotModified(Cons_dialogsNotModified) + case dialogsSlice(Cons_dialogsSlice) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .peerDialogs(let _data): + case .dialogs(let _data): if boxed { - buffer.appendInt32(863093588) + buffer.appendInt32(364538944) } buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.dialogs.count)) @@ -101,19 +716,54 @@ public extension Api.messages { for item in _data.users { item.serialize(buffer, true) } - _data.state.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, ConstructorParameterDescription)]) { switch self { - case .peerDialogs(let _data): - return ("peerDialogs", [("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("state", ConstructorParameterDescription(_data.state))]) + case .dialogs(let _data): + return ("dialogs", [("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .dialogsNotModified(let _data): + return ("dialogsNotModified", [("count", ConstructorParameterDescription(_data.count))]) + case .dialogsSlice(let _data): + return ("dialogsSlice", [("count", ConstructorParameterDescription(_data.count)), ("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_peerDialogs(_ reader: BufferReader) -> PeerDialogs? { + public static func parse_dialogs(_ reader: BufferReader) -> Dialogs? { var _1: [Api.Dialog]? if let _ = reader.readInt32() { _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Dialog.self) @@ -130,596 +780,34 @@ public extension Api.messages { if let _ = reader.readInt32() { _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } - var _5: Api.updates.State? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.updates.State - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_peerSettings: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerSettings", [("settings", ConstructorParameterDescription(self.settings)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerSettings(let _data): - return ("peerSettings", [("settings", ConstructorParameterDescription(_data.settings)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? { - var _1: Api.PeerSettings? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PeerSettings - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.PeerSettings.peerSettings(Cons_peerSettings(settings: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum PreparedInlineMessage: TypeConstructorDescription { - public class Cons_preparedInlineMessage: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("preparedInlineMessage", [("queryId", ConstructorParameterDescription(self.queryId)), ("result", ConstructorParameterDescription(self.result)), ("peerTypes", ConstructorParameterDescription(self.peerTypes)), ("cacheTime", ConstructorParameterDescription(self.cacheTime)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .preparedInlineMessage(let _data): - return ("preparedInlineMessage", [("queryId", ConstructorParameterDescription(_data.queryId)), ("result", ConstructorParameterDescription(_data.result)), ("peerTypes", ConstructorParameterDescription(_data.peerTypes)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_preparedInlineMessage(_ reader: BufferReader) -> PreparedInlineMessage? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.BotInlineResult? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.BotInlineResult - } - var _3: [Api.InlineQueryPeerType]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InlineQueryPeerType.self) - } - var _4: Int32? - _4 = reader.readInt32() - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_quickReplies: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("quickReplies", [("quickReplies", ConstructorParameterDescription(self.quickReplies)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case quickReplies(Cons_quickReplies) - 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, ConstructorParameterDescription)]) { - switch self { - case .quickReplies(let _data): - return ("quickReplies", [("quickReplies", ConstructorParameterDescription(_data.quickReplies)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .quickRepliesNotModified: - return ("quickRepliesNotModified", []) - } - } - - public static func parse_quickReplies(_ reader: BufferReader) -> QuickReplies? { - var _1: [Api.QuickReply]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.QuickReply.self) - } - var _2: [Api.Message]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.messages.QuickReplies.quickReplies(Cons_quickReplies(quickReplies: _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 } } - public static func parse_quickRepliesNotModified(_ reader: BufferReader) -> QuickReplies? { - return Api.messages.QuickReplies.quickRepliesNotModified - } - } -} -public extension Api.messages { - enum Reactions: TypeConstructorDescription { - public class Cons_reactions: TypeConstructorDescription { - public var hash: Int64 - public var reactions: [Api.Reaction] - public init(hash: Int64, reactions: [Api.Reaction]) { - self.hash = hash - self.reactions = reactions - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("reactions", [("hash", ConstructorParameterDescription(self.hash)), ("reactions", ConstructorParameterDescription(self.reactions))]) - } - } - case reactions(Cons_reactions) - 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, ConstructorParameterDescription)]) { - switch self { - case .reactions(let _data): - return ("reactions", [("hash", ConstructorParameterDescription(_data.hash)), ("reactions", ConstructorParameterDescription(_data.reactions))]) - case .reactionsNotModified: - return ("reactionsNotModified", []) - } - } - - public static func parse_reactions(_ reader: BufferReader) -> Reactions? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.Reaction]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Reaction.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.Reactions.reactions(Cons_reactions(hash: _1!, reactions: _2!)) - } - else { - return nil - } - } - public static func parse_reactionsNotModified(_ reader: BufferReader) -> Reactions? { - return Api.messages.Reactions.reactionsNotModified - } - } -} -public extension Api.messages { - enum RecentStickers: TypeConstructorDescription { - public class Cons_recentStickers: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("recentStickers", [("hash", ConstructorParameterDescription(self.hash)), ("packs", ConstructorParameterDescription(self.packs)), ("stickers", ConstructorParameterDescription(self.stickers)), ("dates", ConstructorParameterDescription(self.dates))]) - } - } - case recentStickers(Cons_recentStickers) - 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, ConstructorParameterDescription)]) { - switch self { - case .recentStickers(let _data): - return ("recentStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("packs", ConstructorParameterDescription(_data.packs)), ("stickers", ConstructorParameterDescription(_data.stickers)), ("dates", ConstructorParameterDescription(_data.dates))]) - case .recentStickersNotModified: - return ("recentStickersNotModified", []) - } - } - - public static func parse_recentStickers(_ reader: BufferReader) -> RecentStickers? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.StickerPack]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerPack.self) - } - var _3: [Api.Document]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - var _4: [Int32]? - 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 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.messages.RecentStickers.recentStickers(Cons_recentStickers(hash: _1!, packs: _2!, stickers: _3!, dates: _4!)) - } - else { - return nil - } - } - public static func parse_recentStickersNotModified(_ reader: BufferReader) -> RecentStickers? { - return Api.messages.RecentStickers.recentStickersNotModified - } - } -} -public extension Api.messages { - enum SavedDialogs: TypeConstructorDescription { - public class Cons_savedDialogs: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedDialogs", [("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_savedDialogsNotModified: TypeConstructorDescription { - public var count: Int32 - public init(count: Int32) { - self.count = count - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedDialogsNotModified", [("count", ConstructorParameterDescription(self.count))]) - } - } - public class Cons_savedDialogsSlice: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedDialogsSlice", [("count", ConstructorParameterDescription(self.count)), ("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .savedDialogs(let _data): - return ("savedDialogs", [("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .savedDialogsNotModified(let _data): - return ("savedDialogsNotModified", [("count", ConstructorParameterDescription(_data.count))]) - case .savedDialogsSlice(let _data): - return ("savedDialogsSlice", [("count", ConstructorParameterDescription(_data.count)), ("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_savedDialogs(_ reader: BufferReader) -> SavedDialogs? { - var _1: [Api.SavedDialog]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) - } - var _2: [Api.Message]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.messages.SavedDialogs.savedDialogs(Cons_savedDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!)) - } - else { - return nil - } - } - public static func parse_savedDialogsNotModified(_ reader: BufferReader) -> SavedDialogs? { + public static func parse_dialogsNotModified(_ reader: BufferReader) -> Dialogs? { var _1: Int32? _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.messages.SavedDialogs.savedDialogsNotModified(Cons_savedDialogsNotModified(count: _1!)) + return Api.messages.Dialogs.dialogsNotModified(Cons_dialogsNotModified(count: _1!)) } else { return nil } } - public static func parse_savedDialogsSlice(_ reader: BufferReader) -> SavedDialogs? { + public static func parse_dialogsSlice(_ reader: BufferReader) -> Dialogs? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.SavedDialog]? + var _2: [Api.Dialog]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Dialog.self) } var _3: [Api.Message]? if let _ = reader.readInt32() { @@ -739,7 +827,7 @@ public extension Api.messages { let _c4 = _4 != nil let _c5 = _5 != nil if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.messages.SavedDialogs.savedDialogsSlice(Cons_savedDialogsSlice(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 @@ -748,249 +836,54 @@ public extension Api.messages { } } public extension Api.messages { - enum SavedGifs: TypeConstructorDescription { - public class Cons_savedGifs: TypeConstructorDescription { - public var hash: Int64 - public var gifs: [Api.Document] - public init(hash: Int64, gifs: [Api.Document]) { - self.hash = hash - self.gifs = gifs - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedGifs", [("hash", ConstructorParameterDescription(self.hash)), ("gifs", ConstructorParameterDescription(self.gifs))]) - } - } - case savedGifs(Cons_savedGifs) - 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, ConstructorParameterDescription)]) { - switch self { - case .savedGifs(let _data): - return ("savedGifs", [("hash", ConstructorParameterDescription(_data.hash)), ("gifs", ConstructorParameterDescription(_data.gifs))]) - case .savedGifsNotModified: - return ("savedGifsNotModified", []) - } - } - - public static func parse_savedGifs(_ reader: BufferReader) -> SavedGifs? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.Document]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.SavedGifs.savedGifs(Cons_savedGifs(hash: _1!, gifs: _2!)) - } - else { - return nil - } - } - public static func parse_savedGifsNotModified(_ reader: BufferReader) -> SavedGifs? { - return Api.messages.SavedGifs.savedGifsNotModified - } - } -} -public extension Api.messages { - enum SavedReactionTags: TypeConstructorDescription { - public class Cons_savedReactionTags: TypeConstructorDescription { - public var tags: [Api.SavedReactionTag] - public var hash: Int64 - public init(tags: [Api.SavedReactionTag], hash: Int64) { - self.tags = tags - self.hash = hash - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedReactionTags", [("tags", ConstructorParameterDescription(self.tags)), ("hash", ConstructorParameterDescription(self.hash))]) - } - } - case savedReactionTags(Cons_savedReactionTags) - 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, ConstructorParameterDescription)]) { - switch self { - case .savedReactionTags(let _data): - return ("savedReactionTags", [("tags", ConstructorParameterDescription(_data.tags)), ("hash", ConstructorParameterDescription(_data.hash))]) - case .savedReactionTagsNotModified: - return ("savedReactionTagsNotModified", []) - } - } - - public static func parse_savedReactionTags(_ reader: BufferReader) -> SavedReactionTags? { - var _1: [Api.SavedReactionTag]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedReactionTag.self) - } - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.SavedReactionTags.savedReactionTags(Cons_savedReactionTags(tags: _1!, hash: _2!)) - } - else { - return nil - } - } - public static func parse_savedReactionTagsNotModified(_ reader: BufferReader) -> SavedReactionTags? { - return Api.messages.SavedReactionTags.savedReactionTagsNotModified - } - } -} -public extension Api.messages { - enum SearchCounter: TypeConstructorDescription { - public class Cons_searchCounter: TypeConstructorDescription { + enum DiscussionMessage: TypeConstructorDescription { + public class Cons_discussionMessage: TypeConstructorDescription { 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("searchCounter", [("flags", ConstructorParameterDescription(self.flags)), ("filter", ConstructorParameterDescription(self.filter)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .searchCounter(let _data): - return ("searchCounter", [("flags", ConstructorParameterDescription(_data.flags)), ("filter", ConstructorParameterDescription(_data.filter)), ("count", ConstructorParameterDescription(_data.count))]) - } - } - - public static func parse_searchCounter(_ reader: BufferReader) -> SearchCounter? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.MessagesFilter? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.MessagesFilter - } - var _3: Int32? - _3 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.SearchCounter.searchCounter(Cons_searchCounter(flags: _1!, filter: _2!, count: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum SearchResultsCalendar: TypeConstructorDescription { - public class Cons_searchResultsCalendar: TypeConstructorDescription { - 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 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, count: Int32, minDate: Int32, minMsgId: Int32, offsetIdOffset: Int32?, periods: [Api.SearchResultsCalendarPeriod], messages: [Api.Message], chats: [Api.Chat], 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.count = count - self.minDate = minDate - self.minMsgId = minMsgId - self.offsetIdOffset = offsetIdOffset - self.periods = periods self.messages = messages + self.maxId = maxId + self.readInboxMaxId = readInboxMaxId + self.readOutboxMaxId = readOutboxMaxId + self.unreadCount = unreadCount self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("searchResultsCalendar", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("minDate", ConstructorParameterDescription(self.minDate)), ("minMsgId", ConstructorParameterDescription(self.minMsgId)), ("offsetIdOffset", ConstructorParameterDescription(self.offsetIdOffset)), ("periods", ConstructorParameterDescription(self.periods)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("discussionMessage", [("flags", ConstructorParameterDescription(self.flags)), ("messages", ConstructorParameterDescription(self.messages)), ("maxId", ConstructorParameterDescription(self.maxId)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case searchResultsCalendar(Cons_searchResultsCalendar) + case discussionMessage(Cons_discussionMessage) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .searchResultsCalendar(let _data): + case .discussionMessage(let _data): if boxed { - buffer.appendInt32(343859772) + buffer.appendInt32(-1506535550) } 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) } + 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 { @@ -1007,51 +900,201 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .searchResultsCalendar(let _data): - return ("searchResultsCalendar", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("minDate", ConstructorParameterDescription(_data.minDate)), ("minMsgId", ConstructorParameterDescription(_data.minMsgId)), ("offsetIdOffset", ConstructorParameterDescription(_data.offsetIdOffset)), ("periods", ConstructorParameterDescription(_data.periods)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .discussionMessage(let _data): + return ("discussionMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("messages", ConstructorParameterDescription(_data.messages)), ("maxId", ConstructorParameterDescription(_data.maxId)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_searchResultsCalendar(_ reader: BufferReader) -> SearchResultsCalendar? { + public static func parse_discussionMessage(_ reader: BufferReader) -> DiscussionMessage? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() + var _2: [Api.Message]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } var _3: Int32? - _3 = reader.readInt32() + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { _5 = reader.readInt32() } - var _6: [Api.SearchResultsCalendarPeriod]? + var _6: Int32? + _6 = reader.readInt32() + var _7: [Api.Chat]? if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SearchResultsCalendarPeriod.self) + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } - var _7: [Api.Message]? + var _8: [Api.User]? if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } - var _8: [Api.Chat]? - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + return Api.messages.DiscussionMessage.discussionMessage(Cons_discussionMessage(flags: _1!, messages: _2!, maxId: _3, readInboxMaxId: _4, readOutboxMaxId: _5, unreadCount: _6!, chats: _7!, users: _8!)) } - var _9: [Api.User]? + else { + return nil + } + } + } +} +public extension Api.messages { + enum EmojiGameInfo: TypeConstructorDescription { + public class Cons_emojiGameDiceInfo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiGameDiceInfo", [("flags", ConstructorParameterDescription(self.flags)), ("gameHash", ConstructorParameterDescription(self.gameHash)), ("prevStake", ConstructorParameterDescription(self.prevStake)), ("currentStreak", ConstructorParameterDescription(self.currentStreak)), ("params", ConstructorParameterDescription(self.params)), ("playsLeft", ConstructorParameterDescription(self.playsLeft))]) + } + } + case emojiGameDiceInfo(Cons_emojiGameDiceInfo) + 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, ConstructorParameterDescription)]) { + switch self { + case .emojiGameDiceInfo(let _data): + return ("emojiGameDiceInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("gameHash", ConstructorParameterDescription(_data.gameHash)), ("prevStake", ConstructorParameterDescription(_data.prevStake)), ("currentStreak", ConstructorParameterDescription(_data.currentStreak)), ("params", ConstructorParameterDescription(_data.params)), ("playsLeft", ConstructorParameterDescription(_data.playsLeft))]) + case .emojiGameUnavailable: + return ("emojiGameUnavailable", []) + } + } + + public static func parse_emojiGameDiceInfo(_ reader: BufferReader) -> EmojiGameInfo? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: [Int32]? if let _ = reader.readInt32() { - _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = reader.readInt32() } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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!)) + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.messages.EmojiGameInfo.emojiGameDiceInfo(Cons_emojiGameDiceInfo(flags: _1!, gameHash: _2!, prevStake: _3!, currentStreak: _4!, params: _5!, playsLeft: _6)) + } + else { + return nil + } + } + public static func parse_emojiGameUnavailable(_ reader: BufferReader) -> EmojiGameInfo? { + return Api.messages.EmojiGameInfo.emojiGameUnavailable + } + } +} +public extension Api.messages { + enum EmojiGameOutcome: TypeConstructorDescription { + public class Cons_emojiGameOutcome: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiGameOutcome", [("seed", ConstructorParameterDescription(self.seed)), ("stakeTonAmount", ConstructorParameterDescription(self.stakeTonAmount)), ("tonAmount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .emojiGameOutcome(let _data): + return ("emojiGameOutcome", [("seed", ConstructorParameterDescription(_data.seed)), ("stakeTonAmount", ConstructorParameterDescription(_data.stakeTonAmount)), ("tonAmount", ConstructorParameterDescription(_data.tonAmount))]) + } + } + + public static func parse_emojiGameOutcome(_ reader: BufferReader) -> EmojiGameOutcome? { + var _1: Buffer? + _1 = parseBytes(reader) + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.EmojiGameOutcome.emojiGameOutcome(Cons_emojiGameOutcome(seed: _1!, stakeTonAmount: _2!, tonAmount: _3!)) } else { return nil @@ -1060,192 +1103,208 @@ public extension Api.messages { } } public extension Api.messages { - enum SearchResultsPositions: TypeConstructorDescription { - public class Cons_searchResultsPositions: TypeConstructorDescription { - public var count: Int32 - public var positions: [Api.SearchResultsPosition] - public init(count: Int32, positions: [Api.SearchResultsPosition]) { - self.count = count - self.positions = positions + enum EmojiGroups: TypeConstructorDescription { + public class Cons_emojiGroups: TypeConstructorDescription { + public var hash: Int32 + public var groups: [Api.EmojiGroup] + public init(hash: Int32, groups: [Api.EmojiGroup]) { + self.hash = hash + self.groups = groups } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("searchResultsPositions", [("count", ConstructorParameterDescription(self.count)), ("positions", ConstructorParameterDescription(self.positions))]) + return ("emojiGroups", [("hash", ConstructorParameterDescription(self.hash)), ("groups", ConstructorParameterDescription(self.groups))]) } } - case searchResultsPositions(Cons_searchResultsPositions) + case emojiGroups(Cons_emojiGroups) + case emojiGroupsNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .searchResultsPositions(let _data): + case .emojiGroups(let _data): if boxed { - buffer.appendInt32(1404185519) + buffer.appendInt32(-2011186869) } - serializeInt32(_data.count, buffer: buffer, boxed: false) + serializeInt32(_data.hash, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.positions.count)) - for item in _data.positions { + 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, ConstructorParameterDescription)]) { switch self { - case .searchResultsPositions(let _data): - return ("searchResultsPositions", [("count", ConstructorParameterDescription(_data.count)), ("positions", ConstructorParameterDescription(_data.positions))]) + case .emojiGroups(let _data): + return ("emojiGroups", [("hash", ConstructorParameterDescription(_data.hash)), ("groups", ConstructorParameterDescription(_data.groups))]) + case .emojiGroupsNotModified: + return ("emojiGroupsNotModified", []) } } - public static func parse_searchResultsPositions(_ reader: BufferReader) -> SearchResultsPositions? { + public static func parse_emojiGroups(_ reader: BufferReader) -> EmojiGroups? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.SearchResultsPosition]? + var _2: [Api.EmojiGroup]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SearchResultsPosition.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EmojiGroup.self) } let _c1 = _1 != nil let _c2 = _2 != nil if _c1 && _c2 { - return Api.messages.SearchResultsPositions.searchResultsPositions(Cons_searchResultsPositions(count: _1!, positions: _2!)) + return Api.messages.EmojiGroups.emojiGroups(Cons_emojiGroups(hash: _1!, groups: _2!)) } else { return nil } } + public static func parse_emojiGroupsNotModified(_ reader: BufferReader) -> EmojiGroups? { + return Api.messages.EmojiGroups.emojiGroupsNotModified + } } } public extension Api.messages { - enum SentEncryptedMessage: TypeConstructorDescription { - public class Cons_sentEncryptedFile: TypeConstructorDescription { - public var date: Int32 - public var file: Api.EncryptedFile - public init(date: Int32, file: Api.EncryptedFile) { - self.date = date - self.file = file - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentEncryptedFile", [("date", ConstructorParameterDescription(self.date)), ("file", ConstructorParameterDescription(self.file))]) - } - } - public class Cons_sentEncryptedMessage: TypeConstructorDescription { - public var date: Int32 - public init(date: Int32) { - self.date = date - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sentEncryptedMessage", [("date", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .sentEncryptedFile(let _data): - return ("sentEncryptedFile", [("date", ConstructorParameterDescription(_data.date)), ("file", ConstructorParameterDescription(_data.file))]) - case .sentEncryptedMessage(let _data): - return ("sentEncryptedMessage", [("date", ConstructorParameterDescription(_data.date))]) - } - } - - public static func parse_sentEncryptedFile(_ reader: BufferReader) -> SentEncryptedMessage? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.EncryptedFile? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.EncryptedFile - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.SentEncryptedMessage.sentEncryptedFile(Cons_sentEncryptedFile(date: _1!, file: _2!)) - } - else { - return nil - } - } - public static func parse_sentEncryptedMessage(_ reader: BufferReader) -> SentEncryptedMessage? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.messages.SentEncryptedMessage.sentEncryptedMessage(Cons_sentEncryptedMessage(date: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.messages { - enum SponsoredMessages: TypeConstructorDescription { - public class Cons_sponsoredMessages: TypeConstructorDescription { - 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] + enum ExportedChatInvite: TypeConstructorDescription { + public class Cons_exportedChatInvite: TypeConstructorDescription { + public var invite: Api.ExportedChatInvite 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 + public init(invite: Api.ExportedChatInvite, users: [Api.User]) { + self.invite = invite self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("sponsoredMessages", [("flags", ConstructorParameterDescription(self.flags)), ("postsBetween", ConstructorParameterDescription(self.postsBetween)), ("startDelay", ConstructorParameterDescription(self.startDelay)), ("betweenDelay", ConstructorParameterDescription(self.betweenDelay)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("exportedChatInvite", [("invite", ConstructorParameterDescription(self.invite)), ("users", ConstructorParameterDescription(self.users))]) } } - case sponsoredMessages(Cons_sponsoredMessages) - case sponsoredMessagesEmpty + public class Cons_exportedChatInviteReplaced: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedChatInviteReplaced", [("invite", ConstructorParameterDescription(self.invite)), ("newInvite", ConstructorParameterDescription(self.newInvite)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case exportedChatInvite(Cons_exportedChatInvite) + case exportedChatInviteReplaced(Cons_exportedChatInviteReplaced) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .sponsoredMessages(let _data): + case .exportedChatInvite(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(410107472) } + _data.invite.serialize(buffer, true) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.messages.count)) - for item in _data.messages { + 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.chats.count)) - for item in _data.chats { + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { + item.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .exportedChatInvite(let _data): + return ("exportedChatInvite", [("invite", ConstructorParameterDescription(_data.invite)), ("users", ConstructorParameterDescription(_data.users))]) + case .exportedChatInviteReplaced(let _data): + return ("exportedChatInviteReplaced", [("invite", ConstructorParameterDescription(_data.invite)), ("newInvite", ConstructorParameterDescription(_data.newInvite)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_exportedChatInvite(_ reader: BufferReader) -> ExportedChatInvite? { + var _1: Api.ExportedChatInvite? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.ExportedChatInvite.exportedChatInvite(Cons_exportedChatInvite(invite: _1!, users: _2!)) + } + else { + return nil + } + } + public static func parse_exportedChatInviteReplaced(_ reader: BufferReader) -> ExportedChatInvite? { + var _1: Api.ExportedChatInvite? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + var _2: Api.ExportedChatInvite? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ExportedChatInvite + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.ExportedChatInvite.exportedChatInviteReplaced(Cons_exportedChatInviteReplaced(invite: _1!, newInvite: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum ExportedChatInvites: TypeConstructorDescription { + public class Cons_exportedChatInvites: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedChatInvites", [("count", ConstructorParameterDescription(self.count)), ("invites", ConstructorParameterDescription(self.invites)), ("users", ConstructorParameterDescription(self.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) @@ -1254,115 +1313,78 @@ public extension Api.messages { item.serialize(buffer, true) } break - case .sponsoredMessagesEmpty: - if boxed { - buffer.appendInt32(406407439) - } - break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .sponsoredMessages(let _data): - return ("sponsoredMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("postsBetween", ConstructorParameterDescription(_data.postsBetween)), ("startDelay", ConstructorParameterDescription(_data.startDelay)), ("betweenDelay", ConstructorParameterDescription(_data.betweenDelay)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .sponsoredMessagesEmpty: - return ("sponsoredMessagesEmpty", []) + case .exportedChatInvites(let _data): + return ("exportedChatInvites", [("count", ConstructorParameterDescription(_data.count)), ("invites", ConstructorParameterDescription(_data.invites)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_sponsoredMessages(_ reader: BufferReader) -> SponsoredMessages? { + public static func parse_exportedChatInvites(_ reader: BufferReader) -> ExportedChatInvites? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() - } - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt32() - } - var _5: [Api.SponsoredMessage]? + var _2: [Api.ExportedChatInvite]? if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SponsoredMessage.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ExportedChatInvite.self) } - var _6: [Api.Chat]? + var _3: [Api.User]? if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _7: [Api.User]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.messages.SponsoredMessages.sponsoredMessages(Cons_sponsoredMessages(flags: _1!, postsBetween: _2, startDelay: _3, betweenDelay: _4, messages: _5!, chats: _6!, users: _7!)) + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.ExportedChatInvites.exportedChatInvites(Cons_exportedChatInvites(count: _1!, invites: _2!, users: _3!)) } else { return nil } } - public static func parse_sponsoredMessagesEmpty(_ reader: BufferReader) -> SponsoredMessages? { - return Api.messages.SponsoredMessages.sponsoredMessagesEmpty - } } } public extension Api.messages { - enum StickerSet: TypeConstructorDescription { - public class Cons_stickerSet: TypeConstructorDescription { - public var set: Api.StickerSet + enum FavedStickers: TypeConstructorDescription { + public class Cons_favedStickers: TypeConstructorDescription { + public var hash: Int64 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 + public var stickers: [Api.Document] + public init(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document]) { + self.hash = hash self.packs = packs - self.keywords = keywords - self.documents = documents + self.stickers = stickers } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerSet", [("set", ConstructorParameterDescription(self.set)), ("packs", ConstructorParameterDescription(self.packs)), ("keywords", ConstructorParameterDescription(self.keywords)), ("documents", ConstructorParameterDescription(self.documents))]) + return ("favedStickers", [("hash", ConstructorParameterDescription(self.hash)), ("packs", ConstructorParameterDescription(self.packs)), ("stickers", ConstructorParameterDescription(self.stickers))]) } } - case stickerSet(Cons_stickerSet) - case stickerSetNotModified + case favedStickers(Cons_favedStickers) + case favedStickersNotModified public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .stickerSet(let _data): + case .favedStickers(let _data): if boxed { - buffer.appendInt32(1846886166) + buffer.appendInt32(750063767) } - _data.set.serialize(buffer, true) + 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.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 { + buffer.appendInt32(Int32(_data.stickers.count)) + for item in _data.stickers { item.serialize(buffer, true) } break - case .stickerSetNotModified: + case .favedStickersNotModified: if boxed { - buffer.appendInt32(-738646805) + buffer.appendInt32(-1634752813) } break } @@ -1370,75 +1392,284 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .stickerSet(let _data): - return ("stickerSet", [("set", ConstructorParameterDescription(_data.set)), ("packs", ConstructorParameterDescription(_data.packs)), ("keywords", ConstructorParameterDescription(_data.keywords)), ("documents", ConstructorParameterDescription(_data.documents))]) - case .stickerSetNotModified: - return ("stickerSetNotModified", []) + case .favedStickers(let _data): + return ("favedStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("packs", ConstructorParameterDescription(_data.packs)), ("stickers", ConstructorParameterDescription(_data.stickers))]) + case .favedStickersNotModified: + return ("favedStickersNotModified", []) } } - public static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { - var _1: Api.StickerSet? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StickerSet - } + public static func parse_favedStickers(_ reader: BufferReader) -> FavedStickers? { + var _1: Int64? + _1 = reader.readInt64() var _2: [Api.StickerPack]? if let _ = reader.readInt32() { _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerPack.self) } - var _3: [Api.StickerKeyword]? + var _3: [Api.Document]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerKeyword.self) - } - var _4: [Api.Document]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.messages.StickerSet.stickerSet(Cons_stickerSet(set: _1!, packs: _2!, keywords: _3!, documents: _4!)) + if _c1 && _c2 && _c3 { + return Api.messages.FavedStickers.favedStickers(Cons_favedStickers(hash: _1!, packs: _2!, stickers: _3!)) } else { return nil } } - public static func parse_stickerSetNotModified(_ reader: BufferReader) -> StickerSet? { - return Api.messages.StickerSet.stickerSetNotModified + public static func parse_favedStickersNotModified(_ reader: BufferReader) -> FavedStickers? { + return Api.messages.FavedStickers.favedStickersNotModified } } } public extension Api.messages { - enum StickerSetInstallResult: TypeConstructorDescription { - public class Cons_stickerSetInstallResultArchive: TypeConstructorDescription { + enum FeaturedStickers: TypeConstructorDescription { + public class Cons_featuredStickers: TypeConstructorDescription { + public var flags: Int32 + public var hash: Int64 + public var count: Int32 public var sets: [Api.StickerSetCovered] - public init(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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickerSetInstallResultArchive", [("sets", ConstructorParameterDescription(self.sets))]) + return ("featuredStickers", [("flags", ConstructorParameterDescription(self.flags)), ("hash", ConstructorParameterDescription(self.hash)), ("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.sets)), ("unread", ConstructorParameterDescription(self.unread))]) } } - case stickerSetInstallResultArchive(Cons_stickerSetInstallResultArchive) - case stickerSetInstallResultSuccess + public class Cons_featuredStickersNotModified: TypeConstructorDescription { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("featuredStickersNotModified", [("count", ConstructorParameterDescription(self.count))]) + } + } + case featuredStickers(Cons_featuredStickers) + case featuredStickersNotModified(Cons_featuredStickersNotModified) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .stickerSetInstallResultArchive(let _data): + case .featuredStickers(let _data): if boxed { - buffer.appendInt32(904138920) + 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, ConstructorParameterDescription)]) { + switch self { + case .featuredStickers(let _data): + return ("featuredStickers", [("flags", ConstructorParameterDescription(_data.flags)), ("hash", ConstructorParameterDescription(_data.hash)), ("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets)), ("unread", ConstructorParameterDescription(_data.unread))]) + case .featuredStickersNotModified(let _data): + return ("featuredStickersNotModified", [("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_featuredStickers(_ reader: BufferReader) -> FeaturedStickers? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int32? + _3 = reader.readInt32() + var _4: [Api.StickerSetCovered]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + } + var _5: [Int64]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.messages.FeaturedStickers.featuredStickers(Cons_featuredStickers(flags: _1!, hash: _2!, count: _3!, sets: _4!, unread: _5!)) + } + else { + return nil + } + } + public static func parse_featuredStickersNotModified(_ reader: BufferReader) -> FeaturedStickers? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.messages.FeaturedStickers.featuredStickersNotModified(Cons_featuredStickersNotModified(count: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum ForumTopics: TypeConstructorDescription { + public class Cons_forumTopics: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("forumTopics", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("topics", ConstructorParameterDescription(self.topics)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("pts", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .forumTopics(let _data): + return ("forumTopics", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("topics", ConstructorParameterDescription(_data.topics)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("pts", ConstructorParameterDescription(_data.pts))]) + } + } + + public static func parse_forumTopics(_ reader: BufferReader) -> ForumTopics? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.ForumTopic]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) + } + var _4: [Api.Message]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _5: [Api.Chat]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _6: [Api.User]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _7: Int32? + _7 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + 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 { + public class Cons_foundStickerSets: TypeConstructorDescription { + public var hash: Int64 + public var sets: [Api.StickerSetCovered] + public init(hash: Int64, sets: [Api.StickerSetCovered]) { + self.hash = hash + self.sets = sets + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("foundStickerSets", [("hash", ConstructorParameterDescription(self.hash)), ("sets", ConstructorParameterDescription(self.sets))]) + } + } + case foundStickerSets(Cons_foundStickerSets) + 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 .stickerSetInstallResultSuccess: + case .foundStickerSetsNotModified: if boxed { - buffer.appendInt32(946083368) + buffer.appendInt32(223655517) } break } @@ -1446,52 +1677,74 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .stickerSetInstallResultArchive(let _data): - return ("stickerSetInstallResultArchive", [("sets", ConstructorParameterDescription(_data.sets))]) - case .stickerSetInstallResultSuccess: - return ("stickerSetInstallResultSuccess", []) + case .foundStickerSets(let _data): + return ("foundStickerSets", [("hash", ConstructorParameterDescription(_data.hash)), ("sets", ConstructorParameterDescription(_data.sets))]) + case .foundStickerSetsNotModified: + return ("foundStickerSetsNotModified", []) } } - public static func parse_stickerSetInstallResultArchive(_ reader: BufferReader) -> StickerSetInstallResult? { - var _1: [Api.StickerSetCovered]? + public static func parse_foundStickerSets(_ reader: BufferReader) -> FoundStickerSets? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.StickerSetCovered]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) } let _c1 = _1 != nil - if _c1 { - return Api.messages.StickerSetInstallResult.stickerSetInstallResultArchive(Cons_stickerSetInstallResultArchive(sets: _1!)) + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.FoundStickerSets.foundStickerSets(Cons_foundStickerSets(hash: _1!, sets: _2!)) } else { return nil } } - public static func parse_stickerSetInstallResultSuccess(_ reader: BufferReader) -> StickerSetInstallResult? { - return Api.messages.StickerSetInstallResult.stickerSetInstallResultSuccess + public static func parse_foundStickerSetsNotModified(_ reader: BufferReader) -> FoundStickerSets? { + return Api.messages.FoundStickerSets.foundStickerSetsNotModified } } } public extension Api.messages { - enum Stickers: TypeConstructorDescription { - public class Cons_stickers: TypeConstructorDescription { + enum FoundStickers: TypeConstructorDescription { + public class Cons_foundStickers: TypeConstructorDescription { + public var flags: Int32 + public var nextOffset: Int32? public var hash: Int64 public var stickers: [Api.Document] - public init(hash: Int64, 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stickers", [("hash", ConstructorParameterDescription(self.hash)), ("stickers", ConstructorParameterDescription(self.stickers))]) + return ("foundStickers", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("hash", ConstructorParameterDescription(self.hash)), ("stickers", ConstructorParameterDescription(self.stickers))]) } } - case stickers(Cons_stickers) - case stickersNotModified + public class Cons_foundStickersNotModified: TypeConstructorDescription { + public var flags: Int32 + public var nextOffset: Int32? + public init(flags: Int32, nextOffset: Int32?) { + self.flags = flags + self.nextOffset = nextOffset + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("foundStickersNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) + } + } + case foundStickers(Cons_foundStickers) + case foundStickersNotModified(Cons_foundStickersNotModified) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .stickers(let _data): + case .foundStickers(let _data): if boxed { - buffer.appendInt32(816245886) + 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) @@ -1500,79 +1753,13 @@ public extension Api.messages { item.serialize(buffer, true) } break - case .stickersNotModified: + case .foundStickersNotModified(let _data): if boxed { - buffer.appendInt32(-244016606) - } - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .stickers(let _data): - return ("stickers", [("hash", ConstructorParameterDescription(_data.hash)), ("stickers", ConstructorParameterDescription(_data.stickers))]) - case .stickersNotModified: - return ("stickersNotModified", []) - } - } - - public static func parse_stickers(_ reader: BufferReader) -> Stickers? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.Document]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.messages.Stickers.stickers(Cons_stickers(hash: _1!, stickers: _2!)) - } - else { - return nil - } - } - public static func parse_stickersNotModified(_ reader: BufferReader) -> Stickers? { - return Api.messages.Stickers.stickersNotModified - } - } -} -public extension Api.messages { - enum TranscribedAudio: TypeConstructorDescription { - public class Cons_transcribedAudio: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("transcribedAudio", [("flags", ConstructorParameterDescription(self.flags)), ("transcriptionId", ConstructorParameterDescription(self.transcriptionId)), ("text", ConstructorParameterDescription(self.text)), ("trialRemainsNum", ConstructorParameterDescription(self.trialRemainsNum)), ("trialRemainsUntilDate", ConstructorParameterDescription(self.trialRemainsUntilDate))]) - } - } - case transcribedAudio(Cons_transcribedAudio) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .transcribedAudio(let _data): - if boxed { - buffer.appendInt32(-809903785) + buffer.appendInt32(1611711796) } 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) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.nextOffset!, buffer: buffer, boxed: false) } break } @@ -1580,83 +1767,48 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .transcribedAudio(let _data): - return ("transcribedAudio", [("flags", ConstructorParameterDescription(_data.flags)), ("transcriptionId", ConstructorParameterDescription(_data.transcriptionId)), ("text", ConstructorParameterDescription(_data.text)), ("trialRemainsNum", ConstructorParameterDescription(_data.trialRemainsNum)), ("trialRemainsUntilDate", ConstructorParameterDescription(_data.trialRemainsUntilDate))]) + case .foundStickers(let _data): + return ("foundStickers", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("hash", ConstructorParameterDescription(_data.hash)), ("stickers", ConstructorParameterDescription(_data.stickers))]) + case .foundStickersNotModified(let _data): + return ("foundStickersNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) } } - public static func parse_transcribedAudio(_ reader: BufferReader) -> TranscribedAudio? { + public static func parse_foundStickers(_ reader: BufferReader) -> FoundStickers? { var _1: Int32? _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - _3 = parseString(reader) - var _4: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _4 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() } - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _5 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_translateResult: TypeConstructorDescription { - public var result: [Api.TextWithEntities] - public init(result: [Api.TextWithEntities]) { - self.result = result - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("translateResult", [("result", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .translateResult(let _data): - return ("translateResult", [("result", ConstructorParameterDescription(_data.result))]) - } - } - - public static func parse_translateResult(_ reader: BufferReader) -> TranslatedText? { - var _1: [Api.TextWithEntities]? + var _3: Int64? + _3 = reader.readInt64() + var _4: [Api.Document]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TextWithEntities.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) } let _c1 = _1 != nil - if _c1 { - return Api.messages.TranslatedText.translateResult(Cons_translateResult(result: _1!)) + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.FoundStickers.foundStickers(Cons_foundStickers(flags: _1!, nextOffset: _2, hash: _3!, stickers: _4!)) + } + else { + return nil + } + } + public static func parse_foundStickersNotModified(_ reader: BufferReader) -> FoundStickers? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + if _c1 && _c2 { + return Api.messages.FoundStickers.foundStickersNotModified(Cons_foundStickersNotModified(flags: _1!, nextOffset: _2)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api37.swift b/submodules/TelegramApi/Sources/Api37.swift index 1cf60883c0..64c62ba496 100644 --- a/submodules/TelegramApi/Sources/Api37.swift +++ b/submodules/TelegramApi/Sources/Api37.swift @@ -1,37 +1,373 @@ public extension Api.messages { - enum VotesList: TypeConstructorDescription { - public class Cons_votesList: TypeConstructorDescription { + enum HighScores: TypeConstructorDescription { + public class Cons_highScores: TypeConstructorDescription { + public var scores: [Api.HighScore] + public var users: [Api.User] + public init(scores: [Api.HighScore], users: [Api.User]) { + self.scores = scores + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("highScores", [("scores", ConstructorParameterDescription(self.scores)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .highScores(let _data): + return ("highScores", [("scores", ConstructorParameterDescription(_data.scores)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_highScores(_ reader: BufferReader) -> HighScores? { + var _1: [Api.HighScore]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.HighScore.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.HighScores.highScores(Cons_highScores(scores: _1!, users: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum HistoryImport: TypeConstructorDescription { + public class Cons_historyImport: TypeConstructorDescription { + public var id: Int64 + public init(id: Int64) { + self.id = id + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("historyImport", [("id", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .historyImport(let _data): + return ("historyImport", [("id", ConstructorParameterDescription(_data.id))]) + } + } + + 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(Cons_historyImport(id: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum HistoryImportParsed: TypeConstructorDescription { + public class Cons_historyImportParsed: TypeConstructorDescription { + public var flags: Int32 + public var title: String? + public init(flags: Int32, title: String?) { + self.flags = flags + self.title = title + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("historyImportParsed", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .historyImportParsed(let _data): + return ("historyImportParsed", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title))]) + } + } + + public static func parse_historyImportParsed(_ reader: BufferReader) -> HistoryImportParsed? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _2 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _2 != nil + if _c1 && _c2 { + return Api.messages.HistoryImportParsed.historyImportParsed(Cons_historyImportParsed(flags: _1!, title: _2)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum InactiveChats: TypeConstructorDescription { + public class Cons_inactiveChats: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inactiveChats", [("dates", ConstructorParameterDescription(self.dates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .inactiveChats(let _data): + return ("inactiveChats", [("dates", ConstructorParameterDescription(_data.dates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_inactiveChats(_ reader: BufferReader) -> InactiveChats? { + var _1: [Int32]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.InactiveChats.inactiveChats(Cons_inactiveChats(dates: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + indirect enum InvitedUsers: TypeConstructorDescription { + public class Cons_invitedUsers: TypeConstructorDescription { + public var updates: Api.Updates + public var missingInvitees: [Api.MissingInvitee] + public init(updates: Api.Updates, missingInvitees: [Api.MissingInvitee]) { + self.updates = updates + self.missingInvitees = missingInvitees + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("invitedUsers", [("updates", ConstructorParameterDescription(self.updates)), ("missingInvitees", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .invitedUsers(let _data): + return ("invitedUsers", [("updates", ConstructorParameterDescription(_data.updates)), ("missingInvitees", ConstructorParameterDescription(_data.missingInvitees))]) + } + } + + public static func parse_invitedUsers(_ reader: BufferReader) -> InvitedUsers? { + var _1: Api.Updates? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Updates + } + var _2: [Api.MissingInvitee]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MissingInvitee.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.InvitedUsers.invitedUsers(Cons_invitedUsers(updates: _1!, missingInvitees: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum MessageEditData: TypeConstructorDescription { + public class Cons_messageEditData: TypeConstructorDescription { + public var flags: Int32 + public init(flags: Int32) { + self.flags = flags + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEditData", [("flags", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .messageEditData(let _data): + return ("messageEditData", [("flags", ConstructorParameterDescription(_data.flags))]) + } + } + + 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(Cons_messageEditData(flags: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum MessageReactionsList: TypeConstructorDescription { + public class Cons_messageReactionsList: TypeConstructorDescription { public var flags: Int32 public var count: Int32 - public var votes: [Api.MessagePeerVote] + 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, votes: [Api.MessagePeerVote], chats: [Api.Chat], users: [Api.User], 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.votes = votes + self.reactions = reactions self.chats = chats self.users = users self.nextOffset = nextOffset } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("votesList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("votes", ConstructorParameterDescription(self.votes)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) + return ("messageReactionsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("reactions", ConstructorParameterDescription(self.reactions)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) } } - case votesList(Cons_votesList) + case messageReactionsList(Cons_messageReactionsList) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .votesList(let _data): + case .messageReactionsList(let _data): if boxed { - buffer.appendInt32(1218005070) + buffer.appendInt32(834488621) } 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 { + buffer.appendInt32(Int32(_data.reactions.count)) + for item in _data.reactions { item.serialize(buffer, true) } buffer.appendInt32(481674261) @@ -53,19 +389,19 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .votesList(let _data): - return ("votesList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("votes", ConstructorParameterDescription(_data.votes)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) + case .messageReactionsList(let _data): + return ("messageReactionsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) } } - public static func parse_votesList(_ reader: BufferReader) -> VotesList? { + public static func parse_messageReactionsList(_ reader: BufferReader) -> MessageReactionsList? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() - var _3: [Api.MessagePeerVote]? + var _3: [Api.MessagePeerReaction]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessagePeerVote.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessagePeerReaction.self) } var _4: [Api.Chat]? if let _ = reader.readInt32() { @@ -86,7 +422,7 @@ public extension Api.messages { let _c5 = _5 != nil let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.messages.VotesList.votesList(Cons_votesList(flags: _1!, count: _2!, votes: _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 @@ -95,29 +431,33 @@ public extension Api.messages { } } public extension Api.messages { - enum WebPage: TypeConstructorDescription { - public class Cons_webPage: TypeConstructorDescription { - public var webpage: Api.WebPage + enum MessageViews: TypeConstructorDescription { + public class Cons_messageViews: TypeConstructorDescription { + public var views: [Api.MessageViews] public var chats: [Api.Chat] public var users: [Api.User] - public init(webpage: Api.WebPage, chats: [Api.Chat], users: [Api.User]) { - self.webpage = webpage + public init(views: [Api.MessageViews], chats: [Api.Chat], users: [Api.User]) { + self.views = views self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPage", [("webpage", ConstructorParameterDescription(self.webpage)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("messageViews", [("views", ConstructorParameterDescription(self.views)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case webPage(Cons_webPage) + case messageViews(Cons_messageViews) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .webPage(let _data): + case .messageViews(let _data): if boxed { - buffer.appendInt32(-44166467) + buffer.appendInt32(-1228606141) + } + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.views.count)) + for item in _data.views { + item.serialize(buffer, true) } - _data.webpage.serialize(buffer, true) buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.chats.count)) for item in _data.chats { @@ -134,15 +474,15 @@ public extension Api.messages { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .webPage(let _data): - return ("webPage", [("webpage", ConstructorParameterDescription(_data.webpage)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .messageViews(let _data): + return ("messageViews", [("views", ConstructorParameterDescription(_data.views)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_webPage(_ reader: BufferReader) -> WebPage? { - var _1: Api.WebPage? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.WebPage + public static func parse_messageViews(_ reader: BufferReader) -> MessageViews? { + var _1: [Api.MessageViews]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageViews.self) } var _2: [Api.Chat]? if let _ = reader.readInt32() { @@ -156,7 +496,7 @@ public extension Api.messages { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.messages.WebPage.webPage(Cons_webPage(webpage: _1!, chats: _2!, users: _3!)) + return Api.messages.MessageViews.messageViews(Cons_messageViews(views: _1!, chats: _2!, users: _3!)) } else { return nil @@ -165,237 +505,105 @@ public extension Api.messages { } } public extension Api.messages { - indirect enum WebPagePreview: TypeConstructorDescription { - public class Cons_webPagePreview: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webPagePreview", [("media", ConstructorParameterDescription(self.media)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .webPagePreview(let _data): - return ("webPagePreview", [("media", ConstructorParameterDescription(_data.media)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_webPagePreview(_ reader: BufferReader) -> WebPagePreview? { - var _1: Api.MessageMedia? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.MessageMedia - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.messages.WebPagePreview.webPagePreview(Cons_webPagePreview(media: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum BankCardData: TypeConstructorDescription { - public class Cons_bankCardData: TypeConstructorDescription { - public var title: String - public var openUrls: [Api.BankCardOpenUrl] - public init(title: String, openUrls: [Api.BankCardOpenUrl]) { - self.title = title - self.openUrls = openUrls - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("bankCardData", [("title", ConstructorParameterDescription(self.title)), ("openUrls", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .bankCardData(let _data): - return ("bankCardData", [("title", ConstructorParameterDescription(_data.title)), ("openUrls", ConstructorParameterDescription(_data.openUrls))]) - } - } - - public static func parse_bankCardData(_ reader: BufferReader) -> BankCardData? { - var _1: String? - _1 = parseString(reader) - var _2: [Api.BankCardOpenUrl]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BankCardOpenUrl.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.payments.BankCardData.bankCardData(Cons_bankCardData(title: _1!, openUrls: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum CheckCanSendGiftResult: TypeConstructorDescription { - public class Cons_checkCanSendGiftResultFail: TypeConstructorDescription { - public var reason: Api.TextWithEntities - public init(reason: Api.TextWithEntities) { - self.reason = reason - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("checkCanSendGiftResultFail", [("reason", ConstructorParameterDescription(self.reason))]) - } - } - case checkCanSendGiftResultFail(Cons_checkCanSendGiftResultFail) - 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, ConstructorParameterDescription)]) { - switch self { - case .checkCanSendGiftResultFail(let _data): - return ("checkCanSendGiftResultFail", [("reason", ConstructorParameterDescription(_data.reason))]) - case .checkCanSendGiftResultOk: - return ("checkCanSendGiftResultOk", []) - } - } - - public static func parse_checkCanSendGiftResultFail(_ reader: BufferReader) -> CheckCanSendGiftResult? { - var _1: Api.TextWithEntities? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - let _c1 = _1 != nil - if _c1 { - return Api.payments.CheckCanSendGiftResult.checkCanSendGiftResultFail(Cons_checkCanSendGiftResultFail(reason: _1!)) - } - else { - return nil - } - } - public static func parse_checkCanSendGiftResultOk(_ reader: BufferReader) -> CheckCanSendGiftResult? { - return Api.payments.CheckCanSendGiftResult.checkCanSendGiftResultOk - } - } -} -public extension Api.payments { - enum CheckedGiftCode: TypeConstructorDescription { - public class Cons_checkedGiftCode: TypeConstructorDescription { + enum Messages: TypeConstructorDescription { + public class Cons_channelMessages: TypeConstructorDescription { 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 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, fromId: Api.Peer?, giveawayMsgId: Int32?, toId: Int64?, date: Int32, days: Int32, usedDate: Int32?, chats: [Api.Chat], 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.fromId = fromId - self.giveawayMsgId = giveawayMsgId - self.toId = toId - self.date = date - self.days = days - self.usedDate = usedDate + self.pts = pts + self.count = count + self.offsetIdOffset = offsetIdOffset + self.messages = messages + self.topics = topics self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("checkedGiftCode", [("flags", ConstructorParameterDescription(self.flags)), ("fromId", ConstructorParameterDescription(self.fromId)), ("giveawayMsgId", ConstructorParameterDescription(self.giveawayMsgId)), ("toId", ConstructorParameterDescription(self.toId)), ("date", ConstructorParameterDescription(self.date)), ("days", ConstructorParameterDescription(self.days)), ("usedDate", ConstructorParameterDescription(self.usedDate)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("channelMessages", [("flags", ConstructorParameterDescription(self.flags)), ("pts", ConstructorParameterDescription(self.pts)), ("count", ConstructorParameterDescription(self.count)), ("offsetIdOffset", ConstructorParameterDescription(self.offsetIdOffset)), ("messages", ConstructorParameterDescription(self.messages)), ("topics", ConstructorParameterDescription(self.topics)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case checkedGiftCode(Cons_checkedGiftCode) + public class Cons_messages: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messages", [("messages", ConstructorParameterDescription(self.messages)), ("topics", ConstructorParameterDescription(self.topics)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_messagesNotModified: TypeConstructorDescription { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagesNotModified", [("count", ConstructorParameterDescription(self.count))]) + } + } + public class Cons_messagesSlice: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagesSlice", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("nextRate", ConstructorParameterDescription(self.nextRate)), ("offsetIdOffset", ConstructorParameterDescription(self.offsetIdOffset)), ("searchFlood", ConstructorParameterDescription(self.searchFlood)), ("messages", ConstructorParameterDescription(self.messages)), ("topics", ConstructorParameterDescription(self.topics)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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 .checkedGiftCode(let _data): + case .channelMessages(let _data): if boxed { - buffer.appendInt32(-342343793) + buffer.appendInt32(-948520370) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 4) != 0 { - _data.fromId!.serialize(buffer, true) + 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) } - if Int(_data.flags) & Int(1 << 3) != 0 { - serializeInt32(_data.giveawayMsgId!, 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 { - 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.topics.count)) + for item in _data.topics { + item.serialize(buffer, true) } buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.chats.count)) @@ -408,94 +616,65 @@ public extension Api.payments { item.serialize(buffer, true) } break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .checkedGiftCode(let _data): - return ("checkedGiftCode", [("flags", ConstructorParameterDescription(_data.flags)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("giveawayMsgId", ConstructorParameterDescription(_data.giveawayMsgId)), ("toId", ConstructorParameterDescription(_data.toId)), ("date", ConstructorParameterDescription(_data.date)), ("days", ConstructorParameterDescription(_data.days)), ("usedDate", ConstructorParameterDescription(_data.usedDate)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_checkedGiftCode(_ reader: BufferReader) -> CheckedGiftCode? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _3 = reader.readInt32() - } - var _4: Int64? - if Int(_1 ?? 0) & 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 ?? 0) & 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) - } - var _9: [Api.User]? - if let _ = reader.readInt32() { - _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 { - public class Cons_connectedStarRefBots: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("connectedStarRefBots", [("count", ConstructorParameterDescription(self.count)), ("connectedBots", ConstructorParameterDescription(self.connectedBots)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case connectedStarRefBots(Cons_connectedStarRefBots) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .connectedStarRefBots(let _data): + case .messages(let _data): if boxed { - buffer.appendInt32(-1730811363) + 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.connectedBots.count)) - for item in _data.connectedBots { + 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) @@ -509,513 +688,39 @@ public extension Api.payments { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .connectedStarRefBots(let _data): - return ("connectedStarRefBots", [("count", ConstructorParameterDescription(_data.count)), ("connectedBots", ConstructorParameterDescription(_data.connectedBots)), ("users", ConstructorParameterDescription(_data.users))]) + case .channelMessages(let _data): + return ("channelMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("pts", ConstructorParameterDescription(_data.pts)), ("count", ConstructorParameterDescription(_data.count)), ("offsetIdOffset", ConstructorParameterDescription(_data.offsetIdOffset)), ("messages", ConstructorParameterDescription(_data.messages)), ("topics", ConstructorParameterDescription(_data.topics)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .messages(let _data): + return ("messages", [("messages", ConstructorParameterDescription(_data.messages)), ("topics", ConstructorParameterDescription(_data.topics)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .messagesNotModified(let _data): + return ("messagesNotModified", [("count", ConstructorParameterDescription(_data.count))]) + case .messagesSlice(let _data): + return ("messagesSlice", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("nextRate", ConstructorParameterDescription(_data.nextRate)), ("offsetIdOffset", ConstructorParameterDescription(_data.offsetIdOffset)), ("searchFlood", ConstructorParameterDescription(_data.searchFlood)), ("messages", ConstructorParameterDescription(_data.messages)), ("topics", ConstructorParameterDescription(_data.topics)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_connectedStarRefBots(_ reader: BufferReader) -> ConnectedStarRefBots? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.ConnectedBotStarRef]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ConnectedBotStarRef.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.payments.ConnectedStarRefBots.connectedStarRefBots(Cons_connectedStarRefBots(count: _1!, connectedBots: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum ExportedInvoice: TypeConstructorDescription { - public class Cons_exportedInvoice: TypeConstructorDescription { - public var url: String - public init(url: String) { - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedInvoice", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .exportedInvoice(let _data): - return ("exportedInvoice", [("url", ConstructorParameterDescription(_data.url))]) - } - } - - 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(Cons_exportedInvoice(url: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum GiveawayInfo: TypeConstructorDescription { - public class Cons_giveawayInfo: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("giveawayInfo", [("flags", ConstructorParameterDescription(self.flags)), ("startDate", ConstructorParameterDescription(self.startDate)), ("joinedTooEarlyDate", ConstructorParameterDescription(self.joinedTooEarlyDate)), ("adminDisallowedChatId", ConstructorParameterDescription(self.adminDisallowedChatId)), ("disallowedCountry", ConstructorParameterDescription(self.disallowedCountry))]) - } - } - public class Cons_giveawayInfoResults: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("giveawayInfoResults", [("flags", ConstructorParameterDescription(self.flags)), ("startDate", ConstructorParameterDescription(self.startDate)), ("giftCodeSlug", ConstructorParameterDescription(self.giftCodeSlug)), ("starsPrize", ConstructorParameterDescription(self.starsPrize)), ("finishDate", ConstructorParameterDescription(self.finishDate)), ("winnersCount", ConstructorParameterDescription(self.winnersCount)), ("activatedCount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .giveawayInfo(let _data): - return ("giveawayInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("joinedTooEarlyDate", ConstructorParameterDescription(_data.joinedTooEarlyDate)), ("adminDisallowedChatId", ConstructorParameterDescription(_data.adminDisallowedChatId)), ("disallowedCountry", ConstructorParameterDescription(_data.disallowedCountry))]) - case .giveawayInfoResults(let _data): - return ("giveawayInfoResults", [("flags", ConstructorParameterDescription(_data.flags)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("giftCodeSlug", ConstructorParameterDescription(_data.giftCodeSlug)), ("starsPrize", ConstructorParameterDescription(_data.starsPrize)), ("finishDate", ConstructorParameterDescription(_data.finishDate)), ("winnersCount", ConstructorParameterDescription(_data.winnersCount)), ("activatedCount", ConstructorParameterDescription(_data.activatedCount))]) - } - } - - public static func parse_giveawayInfo(_ reader: BufferReader) -> GiveawayInfo? { + public static func parse_channelMessages(_ reader: BufferReader) -> Messages? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() var _3: Int32? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() - } - var _4: Int64? + _3 = reader.readInt32() + var _4: Int32? if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = reader.readInt64() + _4 = reader.readInt32() } - var _5: String? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.payments.GiveawayInfo.giveawayInfo(Cons_giveawayInfo(flags: _1!, startDate: _2!, joinedTooEarlyDate: _3, adminDisallowedChatId: _4, disallowedCountry: _5)) - } - else { - return nil - } - } - public static func parse_giveawayInfoResults(_ reader: BufferReader) -> GiveawayInfo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _3 = parseString(reader) - } - var _4: Int64? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 2) != 0 { - _7 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - 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 { - public class Cons_paymentForm: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentForm", [("flags", ConstructorParameterDescription(self.flags)), ("formId", ConstructorParameterDescription(self.formId)), ("botId", ConstructorParameterDescription(self.botId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("providerId", ConstructorParameterDescription(self.providerId)), ("url", ConstructorParameterDescription(self.url)), ("nativeProvider", ConstructorParameterDescription(self.nativeProvider)), ("nativeParams", ConstructorParameterDescription(self.nativeParams)), ("additionalMethods", ConstructorParameterDescription(self.additionalMethods)), ("savedInfo", ConstructorParameterDescription(self.savedInfo)), ("savedCredentials", ConstructorParameterDescription(self.savedCredentials)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_paymentFormStarGift: TypeConstructorDescription { - public var formId: Int64 - public var invoice: Api.Invoice - public init(formId: Int64, invoice: Api.Invoice) { - self.formId = formId - self.invoice = invoice - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentFormStarGift", [("formId", ConstructorParameterDescription(self.formId)), ("invoice", ConstructorParameterDescription(self.invoice))]) - } - } - public class Cons_paymentFormStars: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentFormStars", [("flags", ConstructorParameterDescription(self.flags)), ("formId", ConstructorParameterDescription(self.formId)), ("botId", ConstructorParameterDescription(self.botId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("users", ConstructorParameterDescription(self.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(_data.additionalMethods!.count)) - for item in _data.additionalMethods! { - item.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(_data.savedCredentials!.count)) - for item in _data.savedCredentials! { - item.serialize(buffer, true) - } - } - 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, ConstructorParameterDescription)]) { - switch self { - case .paymentForm(let _data): - return ("paymentForm", [("flags", ConstructorParameterDescription(_data.flags)), ("formId", ConstructorParameterDescription(_data.formId)), ("botId", ConstructorParameterDescription(_data.botId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("providerId", ConstructorParameterDescription(_data.providerId)), ("url", ConstructorParameterDescription(_data.url)), ("nativeProvider", ConstructorParameterDescription(_data.nativeProvider)), ("nativeParams", ConstructorParameterDescription(_data.nativeParams)), ("additionalMethods", ConstructorParameterDescription(_data.additionalMethods)), ("savedInfo", ConstructorParameterDescription(_data.savedInfo)), ("savedCredentials", ConstructorParameterDescription(_data.savedCredentials)), ("users", ConstructorParameterDescription(_data.users))]) - case .paymentFormStarGift(let _data): - return ("paymentFormStarGift", [("formId", ConstructorParameterDescription(_data.formId)), ("invoice", ConstructorParameterDescription(_data.invoice))]) - case .paymentFormStars(let _data): - return ("paymentFormStars", [("flags", ConstructorParameterDescription(_data.flags)), ("formId", ConstructorParameterDescription(_data.formId)), ("botId", ConstructorParameterDescription(_data.botId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_paymentForm(_ reader: BufferReader) -> PaymentForm? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Api.WebDocument? - if Int(_1 ?? 0) & 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 - } - var _8: Int64? - _8 = reader.readInt64() - var _9: String? - _9 = parseString(reader) - var _10: String? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _10 = parseString(reader) - } - var _11: Api.DataJSON? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentSavedCredentials.self) - } - } - var _15: [Api.User]? + var _5: [Api.Message]? if let _ = reader.readInt32() { - _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _13 != nil - let _c14 = (Int(_1 ?? 0) & 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(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!)) + var _6: [Api.ForumTopic]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) } - else { - return nil - } - } - public static func parse_paymentFormStarGift(_ reader: BufferReader) -> PaymentForm? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Api.Invoice? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Invoice - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.payments.PaymentForm.paymentFormStarGift(Cons_paymentFormStarGift(formId: _1!, invoice: _2!)) - } - else { - return nil - } - } - public static func parse_paymentFormStars(_ reader: BufferReader) -> PaymentForm? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Api.WebDocument? - if Int(_1 ?? 0) & 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 + var _7: [Api.Chat]? + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) } var _8: [Api.User]? if let _ = reader.readInt32() { @@ -1024,1204 +729,26 @@ public extension Api.payments { let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil - let _c4 = _4 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _6 != nil + let _c6 = _6 != nil let _c7 = _7 != nil let _c8 = _8 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.payments.PaymentForm.paymentFormStars(Cons_paymentFormStars(flags: _1!, formId: _2!, botId: _3!, title: _4!, description: _5!, photo: _6, invoice: _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 } } - } -} -public extension Api.payments { - enum PaymentReceipt: TypeConstructorDescription { - public class Cons_paymentReceipt: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentReceipt", [("flags", ConstructorParameterDescription(self.flags)), ("date", ConstructorParameterDescription(self.date)), ("botId", ConstructorParameterDescription(self.botId)), ("providerId", ConstructorParameterDescription(self.providerId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("info", ConstructorParameterDescription(self.info)), ("shipping", ConstructorParameterDescription(self.shipping)), ("tipAmount", ConstructorParameterDescription(self.tipAmount)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("credentialsTitle", ConstructorParameterDescription(self.credentialsTitle)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_paymentReceiptStars: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentReceiptStars", [("flags", ConstructorParameterDescription(self.flags)), ("date", ConstructorParameterDescription(self.date)), ("botId", ConstructorParameterDescription(self.botId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("transactionId", ConstructorParameterDescription(self.transactionId)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .paymentReceipt(let _data): - return ("paymentReceipt", [("flags", ConstructorParameterDescription(_data.flags)), ("date", ConstructorParameterDescription(_data.date)), ("botId", ConstructorParameterDescription(_data.botId)), ("providerId", ConstructorParameterDescription(_data.providerId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("info", ConstructorParameterDescription(_data.info)), ("shipping", ConstructorParameterDescription(_data.shipping)), ("tipAmount", ConstructorParameterDescription(_data.tipAmount)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("credentialsTitle", ConstructorParameterDescription(_data.credentialsTitle)), ("users", ConstructorParameterDescription(_data.users))]) - case .paymentReceiptStars(let _data): - return ("paymentReceiptStars", [("flags", ConstructorParameterDescription(_data.flags)), ("date", ConstructorParameterDescription(_data.date)), ("botId", ConstructorParameterDescription(_data.botId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("transactionId", ConstructorParameterDescription(_data.transactionId)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_paymentReceipt(_ reader: BufferReader) -> PaymentReceipt? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - var _4: Int64? - _4 = reader.readInt64() - var _5: String? - _5 = parseString(reader) - var _6: String? - _6 = parseString(reader) - var _7: Api.WebDocument? - if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.ShippingOption - } - } - var _11: Int64? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _11 = reader.readInt64() - } - var _12: String? - _12 = parseString(reader) - var _13: Int64? - _13 = reader.readInt64() - var _14: String? - _14 = parseString(reader) - var _15: [Api.User]? + public static func parse_messages(_ reader: BufferReader) -> Messages? { + var _1: [Api.Message]? if let _ = reader.readInt32() { - _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil - let _c8 = _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _11 != nil - let _c12 = _12 != nil - let _c13 = _13 != nil - 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(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 - } - } - public static func parse_paymentReceiptStars(_ reader: BufferReader) -> PaymentReceipt? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int64? - _3 = reader.readInt64() - var _4: String? - _4 = parseString(reader) - var _5: String? - _5 = parseString(reader) - var _6: Api.WebDocument? - if Int(_1 ?? 0) & 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 - } - var _8: String? - _8 = parseString(reader) - var _9: Int64? - _9 = reader.readInt64() - var _10: String? - _10 = parseString(reader) - var _11: [Api.User]? + var _2: [Api.ForumTopic]? if let _ = reader.readInt32() { - _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - 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(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 { - public class Cons_paymentResult: TypeConstructorDescription { - public var updates: Api.Updates - public init(updates: Api.Updates) { - self.updates = updates - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentResult", [("updates", ConstructorParameterDescription(self.updates))]) - } - } - public class Cons_paymentVerificationNeeded: TypeConstructorDescription { - public var url: String - public init(url: String) { - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("paymentVerificationNeeded", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .paymentResult(let _data): - return ("paymentResult", [("updates", ConstructorParameterDescription(_data.updates))]) - case .paymentVerificationNeeded(let _data): - return ("paymentVerificationNeeded", [("url", ConstructorParameterDescription(_data.url))]) - } - } - - public static func parse_paymentResult(_ reader: BufferReader) -> PaymentResult? { - var _1: Api.Updates? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Updates - } - let _c1 = _1 != nil - if _c1 { - return Api.payments.PaymentResult.paymentResult(Cons_paymentResult(updates: _1!)) - } - else { - return nil - } - } - public static func parse_paymentVerificationNeeded(_ reader: BufferReader) -> PaymentResult? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.payments.PaymentResult.paymentVerificationNeeded(Cons_paymentVerificationNeeded(url: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum ResaleStarGifts: TypeConstructorDescription { - public class Cons_resaleStarGifts: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("resaleStarGifts", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("gifts", ConstructorParameterDescription(self.gifts)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("attributes", ConstructorParameterDescription(self.attributes)), ("attributesHash", ConstructorParameterDescription(self.attributesHash)), ("chats", ConstructorParameterDescription(self.chats)), ("counters", ConstructorParameterDescription(self.counters)), ("users", ConstructorParameterDescription(self.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(_data.attributes!.count)) - for item in _data.attributes! { - item.serialize(buffer, true) - } - } - 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(_data.counters!.count)) - for item in _data.counters! { - 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, ConstructorParameterDescription)]) { - switch self { - case .resaleStarGifts(let _data): - return ("resaleStarGifts", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("gifts", ConstructorParameterDescription(_data.gifts)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("attributes", ConstructorParameterDescription(_data.attributes)), ("attributesHash", ConstructorParameterDescription(_data.attributesHash)), ("chats", ConstructorParameterDescription(_data.chats)), ("counters", ConstructorParameterDescription(_data.counters)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_resaleStarGifts(_ reader: BufferReader) -> ResaleStarGifts? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.StarGift]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGift.self) - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: [Api.StarGiftAttribute]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) - } - } - var _6: Int64? - if Int(_1 ?? 0) & 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 ?? 0) & 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) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil - let _c7 = _7 != nil - let _c8 = (Int(_1 ?? 0) & 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(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 { - public class Cons_savedInfo: TypeConstructorDescription { - public var flags: Int32 - public var savedInfo: Api.PaymentRequestedInfo? - public init(flags: Int32, savedInfo: Api.PaymentRequestedInfo?) { - self.flags = flags - self.savedInfo = savedInfo - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("savedInfo", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .savedInfo(let _data): - return ("savedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("savedInfo", ConstructorParameterDescription(_data.savedInfo))]) - } - } - - public static func parse_savedInfo(_ reader: BufferReader) -> SavedInfo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.PaymentRequestedInfo? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil - if _c1 && _c2 { - return Api.payments.SavedInfo.savedInfo(Cons_savedInfo(flags: _1!, savedInfo: _2)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum SavedStarGifts: TypeConstructorDescription { - public class Cons_savedStarGifts: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedStarGifts", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("chatNotificationsEnabled", ConstructorParameterDescription(self.chatNotificationsEnabled)), ("gifts", ConstructorParameterDescription(self.gifts)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .savedStarGifts(let _data): - return ("savedStarGifts", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("chatNotificationsEnabled", ConstructorParameterDescription(_data.chatNotificationsEnabled)), ("gifts", ConstructorParameterDescription(_data.gifts)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - 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 ?? 0) & 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 ?? 0) & 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) - } - var _7: [Api.User]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - 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 { - public class Cons_starGiftActiveAuctions: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftActiveAuctions", [("auctions", ConstructorParameterDescription(self.auctions)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats))]) - } - } - case starGiftActiveAuctions(Cons_starGiftActiveAuctions) - 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, ConstructorParameterDescription)]) { - switch self { - case .starGiftActiveAuctions(let _data): - return ("starGiftActiveAuctions", [("auctions", ConstructorParameterDescription(_data.auctions)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) - case .starGiftActiveAuctionsNotModified: - return ("starGiftActiveAuctionsNotModified", []) - } - } - - public static func parse_starGiftActiveAuctions(_ reader: BufferReader) -> StarGiftActiveAuctions? { - var _1: [Api.StarGiftActiveAuctionState]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftActiveAuctionState.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.payments.StarGiftActiveAuctions.starGiftActiveAuctions(Cons_starGiftActiveAuctions(auctions: _1!, users: _2!, chats: _3!)) - } - else { - return nil - } - } - public static func parse_starGiftActiveAuctionsNotModified(_ reader: BufferReader) -> StarGiftActiveAuctions? { - return Api.payments.StarGiftActiveAuctions.starGiftActiveAuctionsNotModified - } - } -} -public extension Api.payments { - enum StarGiftAuctionAcquiredGifts: TypeConstructorDescription { - public class Cons_starGiftAuctionAcquiredGifts: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionAcquiredGifts", [("gifts", ConstructorParameterDescription(self.gifts)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAuctionAcquiredGifts(let _data): - return ("starGiftAuctionAcquiredGifts", [("gifts", ConstructorParameterDescription(_data.gifts)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) - } - } - - public static func parse_starGiftAuctionAcquiredGifts(_ reader: BufferReader) -> StarGiftAuctionAcquiredGifts? { - var _1: [Api.StarGiftAuctionAcquiredGift]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAuctionAcquiredGift.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.payments.StarGiftAuctionAcquiredGifts.starGiftAuctionAcquiredGifts(Cons_starGiftAuctionAcquiredGifts(gifts: _1!, users: _2!, chats: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum StarGiftAuctionState: TypeConstructorDescription { - public class Cons_starGiftAuctionState: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftAuctionState", [("gift", ConstructorParameterDescription(self.gift)), ("state", ConstructorParameterDescription(self.state)), ("userState", ConstructorParameterDescription(self.userState)), ("timeout", ConstructorParameterDescription(self.timeout)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftAuctionState(let _data): - return ("starGiftAuctionState", [("gift", ConstructorParameterDescription(_data.gift)), ("state", ConstructorParameterDescription(_data.state)), ("userState", ConstructorParameterDescription(_data.userState)), ("timeout", ConstructorParameterDescription(_data.timeout)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) - } - } - - public static func parse_starGiftAuctionState(_ reader: BufferReader) -> StarGiftAuctionState? { - var _1: Api.StarGift? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _2: Api.StarGiftAuctionState? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionState - } - var _3: Api.StarGiftAuctionUserState? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionUserState - } - var _4: Int32? - _4 = reader.readInt32() - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: [Api.Chat]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_starGiftCollections: TypeConstructorDescription { - public var collections: [Api.StarGiftCollection] - public init(collections: [Api.StarGiftCollection]) { - self.collections = collections - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftCollections", [("collections", ConstructorParameterDescription(self.collections))]) - } - } - case starGiftCollections(Cons_starGiftCollections) - 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, ConstructorParameterDescription)]) { - switch self { - case .starGiftCollections(let _data): - return ("starGiftCollections", [("collections", ConstructorParameterDescription(_data.collections))]) - case .starGiftCollectionsNotModified: - return ("starGiftCollectionsNotModified", []) - } - } - - public static func parse_starGiftCollections(_ reader: BufferReader) -> StarGiftCollections? { - var _1: [Api.StarGiftCollection]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftCollection.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.payments.StarGiftCollections.starGiftCollections(Cons_starGiftCollections(collections: _1!)) - } - else { - return nil - } - } - public static func parse_starGiftCollectionsNotModified(_ reader: BufferReader) -> StarGiftCollections? { - return Api.payments.StarGiftCollections.starGiftCollectionsNotModified - } - } -} -public extension Api.payments { - enum StarGiftUpgradeAttributes: TypeConstructorDescription { - public class Cons_starGiftUpgradeAttributes: TypeConstructorDescription { - public var attributes: [Api.StarGiftAttribute] - public init(attributes: [Api.StarGiftAttribute]) { - self.attributes = attributes - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftUpgradeAttributes", [("attributes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftUpgradeAttributes(let _data): - return ("starGiftUpgradeAttributes", [("attributes", ConstructorParameterDescription(_data.attributes))]) - } - } - - public static func parse_starGiftUpgradeAttributes(_ reader: BufferReader) -> StarGiftUpgradeAttributes? { - var _1: [Api.StarGiftAttribute]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.payments.StarGiftUpgradeAttributes.starGiftUpgradeAttributes(Cons_starGiftUpgradeAttributes(attributes: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum StarGiftUpgradePreview: TypeConstructorDescription { - public class Cons_starGiftUpgradePreview: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftUpgradePreview", [("sampleAttributes", ConstructorParameterDescription(self.sampleAttributes)), ("prices", ConstructorParameterDescription(self.prices)), ("nextPrices", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftUpgradePreview(let _data): - return ("starGiftUpgradePreview", [("sampleAttributes", ConstructorParameterDescription(_data.sampleAttributes)), ("prices", ConstructorParameterDescription(_data.prices)), ("nextPrices", ConstructorParameterDescription(_data.nextPrices))]) - } - } - - public static func parse_starGiftUpgradePreview(_ reader: BufferReader) -> StarGiftUpgradePreview? { - var _1: [Api.StarGiftAttribute]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) - } - var _2: [Api.StarGiftUpgradePrice]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftUpgradePrice.self) - } - var _3: [Api.StarGiftUpgradePrice]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftUpgradePrice.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.payments.StarGiftUpgradePreview.starGiftUpgradePreview(Cons_starGiftUpgradePreview(sampleAttributes: _1!, prices: _2!, nextPrices: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum StarGiftWithdrawalUrl: TypeConstructorDescription { - public class Cons_starGiftWithdrawalUrl: TypeConstructorDescription { - public var url: String - public init(url: String) { - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGiftWithdrawalUrl", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starGiftWithdrawalUrl(let _data): - return ("starGiftWithdrawalUrl", [("url", ConstructorParameterDescription(_data.url))]) - } - } - - 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(Cons_starGiftWithdrawalUrl(url: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum StarGifts: TypeConstructorDescription { - public class Cons_starGifts: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starGifts", [("hash", ConstructorParameterDescription(self.hash)), ("gifts", ConstructorParameterDescription(self.gifts)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case starGifts(Cons_starGifts) - 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, ConstructorParameterDescription)]) { - switch self { - case .starGifts(let _data): - return ("starGifts", [("hash", ConstructorParameterDescription(_data.hash)), ("gifts", ConstructorParameterDescription(_data.gifts)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .starGiftsNotModified: - return ("starGiftsNotModified", []) - } - } - - public static func parse_starGifts(_ reader: BufferReader) -> StarGifts? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.StarGift]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGift.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) } var _3: [Api.Chat]? if let _ = reader.readInt32() { @@ -2236,14 +763,1190 @@ public extension Api.payments { let _c3 = _3 != nil let _c4 = _4 != nil if _c1 && _c2 && _c3 && _c4 { - return Api.payments.StarGifts.starGifts(Cons_starGifts(hash: _1!, gifts: _2!, chats: _3!, users: _4!)) + return Api.messages.Messages.messages(Cons_messages(messages: _1!, topics: _2!, chats: _3!, users: _4!)) } else { return nil } } - public static func parse_starGiftsNotModified(_ reader: BufferReader) -> StarGifts? { - return Api.payments.StarGifts.starGiftsNotModified + public static func parse_messagesNotModified(_ reader: BufferReader) -> Messages? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.messages.Messages.messagesNotModified(Cons_messagesNotModified(count: _1!)) + } + else { + return nil + } + } + public static func parse_messagesSlice(_ reader: BufferReader) -> Messages? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = reader.readInt32() + } + var _5: Api.SearchPostsFlood? + if Int(_1 ?? 0) & 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) + } + var _7: [Api.ForumTopic]? + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ForumTopic.self) + } + var _8: [Api.Chat]? + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _9: [Api.User]? + if let _ = reader.readInt32() { + _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 { + public class Cons_myStickers: TypeConstructorDescription { + public var count: Int32 + public var sets: [Api.StickerSetCovered] + public init(count: Int32, sets: [Api.StickerSetCovered]) { + self.count = count + self.sets = sets + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("myStickers", [("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .myStickers(let _data): + return ("myStickers", [("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets))]) + } + } + + public static func parse_myStickers(_ reader: BufferReader) -> MyStickers? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.StickerSetCovered]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.MyStickers.myStickers(Cons_myStickers(count: _1!, sets: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum PeerDialogs: TypeConstructorDescription { + public class Cons_peerDialogs: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerDialogs", [("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("state", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .peerDialogs(let _data): + return ("peerDialogs", [("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("state", ConstructorParameterDescription(_data.state))]) + } + } + + public static func parse_peerDialogs(_ reader: BufferReader) -> PeerDialogs? { + var _1: [Api.Dialog]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Dialog.self) + } + var _2: [Api.Message]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _5: Api.updates.State? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.updates.State + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_peerSettings: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerSettings", [("settings", ConstructorParameterDescription(self.settings)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .peerSettings(let _data): + return ("peerSettings", [("settings", ConstructorParameterDescription(_data.settings)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? { + var _1: Api.PeerSettings? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PeerSettings + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.PeerSettings.peerSettings(Cons_peerSettings(settings: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum PreparedInlineMessage: TypeConstructorDescription { + public class Cons_preparedInlineMessage: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("preparedInlineMessage", [("queryId", ConstructorParameterDescription(self.queryId)), ("result", ConstructorParameterDescription(self.result)), ("peerTypes", ConstructorParameterDescription(self.peerTypes)), ("cacheTime", ConstructorParameterDescription(self.cacheTime)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .preparedInlineMessage(let _data): + return ("preparedInlineMessage", [("queryId", ConstructorParameterDescription(_data.queryId)), ("result", ConstructorParameterDescription(_data.result)), ("peerTypes", ConstructorParameterDescription(_data.peerTypes)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_preparedInlineMessage(_ reader: BufferReader) -> PreparedInlineMessage? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.BotInlineResult? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.BotInlineResult + } + var _3: [Api.InlineQueryPeerType]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InlineQueryPeerType.self) + } + var _4: Int32? + _4 = reader.readInt32() + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_quickReplies: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("quickReplies", [("quickReplies", ConstructorParameterDescription(self.quickReplies)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case quickReplies(Cons_quickReplies) + 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, ConstructorParameterDescription)]) { + switch self { + case .quickReplies(let _data): + return ("quickReplies", [("quickReplies", ConstructorParameterDescription(_data.quickReplies)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .quickRepliesNotModified: + return ("quickRepliesNotModified", []) + } + } + + public static func parse_quickReplies(_ reader: BufferReader) -> QuickReplies? { + var _1: [Api.QuickReply]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.QuickReply.self) + } + var _2: [Api.Message]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.QuickReplies.quickReplies(Cons_quickReplies(quickReplies: _1!, messages: _2!, chats: _3!, users: _4!)) + } + else { + return nil + } + } + public static func parse_quickRepliesNotModified(_ reader: BufferReader) -> QuickReplies? { + return Api.messages.QuickReplies.quickRepliesNotModified + } + } +} +public extension Api.messages { + enum Reactions: TypeConstructorDescription { + public class Cons_reactions: TypeConstructorDescription { + public var hash: Int64 + public var reactions: [Api.Reaction] + public init(hash: Int64, reactions: [Api.Reaction]) { + self.hash = hash + self.reactions = reactions + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reactions", [("hash", ConstructorParameterDescription(self.hash)), ("reactions", ConstructorParameterDescription(self.reactions))]) + } + } + case reactions(Cons_reactions) + 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, ConstructorParameterDescription)]) { + switch self { + case .reactions(let _data): + return ("reactions", [("hash", ConstructorParameterDescription(_data.hash)), ("reactions", ConstructorParameterDescription(_data.reactions))]) + case .reactionsNotModified: + return ("reactionsNotModified", []) + } + } + + public static func parse_reactions(_ reader: BufferReader) -> Reactions? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.Reaction]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Reaction.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.Reactions.reactions(Cons_reactions(hash: _1!, reactions: _2!)) + } + else { + return nil + } + } + public static func parse_reactionsNotModified(_ reader: BufferReader) -> Reactions? { + return Api.messages.Reactions.reactionsNotModified + } + } +} +public extension Api.messages { + enum RecentStickers: TypeConstructorDescription { + public class Cons_recentStickers: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentStickers", [("hash", ConstructorParameterDescription(self.hash)), ("packs", ConstructorParameterDescription(self.packs)), ("stickers", ConstructorParameterDescription(self.stickers)), ("dates", ConstructorParameterDescription(self.dates))]) + } + } + case recentStickers(Cons_recentStickers) + 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, ConstructorParameterDescription)]) { + switch self { + case .recentStickers(let _data): + return ("recentStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("packs", ConstructorParameterDescription(_data.packs)), ("stickers", ConstructorParameterDescription(_data.stickers)), ("dates", ConstructorParameterDescription(_data.dates))]) + case .recentStickersNotModified: + return ("recentStickersNotModified", []) + } + } + + public static func parse_recentStickers(_ reader: BufferReader) -> RecentStickers? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.StickerPack]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerPack.self) + } + var _3: [Api.Document]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + var _4: [Int32]? + 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 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.RecentStickers.recentStickers(Cons_recentStickers(hash: _1!, packs: _2!, stickers: _3!, dates: _4!)) + } + else { + return nil + } + } + public static func parse_recentStickersNotModified(_ reader: BufferReader) -> RecentStickers? { + return Api.messages.RecentStickers.recentStickersNotModified + } + } +} +public extension Api.messages { + enum SavedDialogs: TypeConstructorDescription { + public class Cons_savedDialogs: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedDialogs", [("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_savedDialogsNotModified: TypeConstructorDescription { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedDialogsNotModified", [("count", ConstructorParameterDescription(self.count))]) + } + } + public class Cons_savedDialogsSlice: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedDialogsSlice", [("count", ConstructorParameterDescription(self.count)), ("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .savedDialogs(let _data): + return ("savedDialogs", [("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .savedDialogsNotModified(let _data): + return ("savedDialogsNotModified", [("count", ConstructorParameterDescription(_data.count))]) + case .savedDialogsSlice(let _data): + return ("savedDialogsSlice", [("count", ConstructorParameterDescription(_data.count)), ("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_savedDialogs(_ reader: BufferReader) -> SavedDialogs? { + var _1: [Api.SavedDialog]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) + } + var _2: [Api.Message]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.SavedDialogs.savedDialogs(Cons_savedDialogs(dialogs: _1!, messages: _2!, chats: _3!, users: _4!)) + } + else { + return nil + } + } + public static func parse_savedDialogsNotModified(_ reader: BufferReader) -> SavedDialogs? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.messages.SavedDialogs.savedDialogsNotModified(Cons_savedDialogsNotModified(count: _1!)) + } + else { + return nil + } + } + public static func parse_savedDialogsSlice(_ reader: BufferReader) -> SavedDialogs? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.SavedDialog]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedDialog.self) + } + var _3: [Api.Message]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.messages.SavedDialogs.savedDialogsSlice(Cons_savedDialogsSlice(count: _1!, dialogs: _2!, messages: _3!, chats: _4!, users: _5!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum SavedGifs: TypeConstructorDescription { + public class Cons_savedGifs: TypeConstructorDescription { + public var hash: Int64 + public var gifs: [Api.Document] + public init(hash: Int64, gifs: [Api.Document]) { + self.hash = hash + self.gifs = gifs + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedGifs", [("hash", ConstructorParameterDescription(self.hash)), ("gifs", ConstructorParameterDescription(self.gifs))]) + } + } + case savedGifs(Cons_savedGifs) + 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, ConstructorParameterDescription)]) { + switch self { + case .savedGifs(let _data): + return ("savedGifs", [("hash", ConstructorParameterDescription(_data.hash)), ("gifs", ConstructorParameterDescription(_data.gifs))]) + case .savedGifsNotModified: + return ("savedGifsNotModified", []) + } + } + + public static func parse_savedGifs(_ reader: BufferReader) -> SavedGifs? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.Document]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.SavedGifs.savedGifs(Cons_savedGifs(hash: _1!, gifs: _2!)) + } + else { + return nil + } + } + public static func parse_savedGifsNotModified(_ reader: BufferReader) -> SavedGifs? { + return Api.messages.SavedGifs.savedGifsNotModified + } + } +} +public extension Api.messages { + enum SavedReactionTags: TypeConstructorDescription { + public class Cons_savedReactionTags: TypeConstructorDescription { + public var tags: [Api.SavedReactionTag] + public var hash: Int64 + public init(tags: [Api.SavedReactionTag], hash: Int64) { + self.tags = tags + self.hash = hash + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedReactionTags", [("tags", ConstructorParameterDescription(self.tags)), ("hash", ConstructorParameterDescription(self.hash))]) + } + } + case savedReactionTags(Cons_savedReactionTags) + 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, ConstructorParameterDescription)]) { + switch self { + case .savedReactionTags(let _data): + return ("savedReactionTags", [("tags", ConstructorParameterDescription(_data.tags)), ("hash", ConstructorParameterDescription(_data.hash))]) + case .savedReactionTagsNotModified: + return ("savedReactionTagsNotModified", []) + } + } + + public static func parse_savedReactionTags(_ reader: BufferReader) -> SavedReactionTags? { + var _1: [Api.SavedReactionTag]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedReactionTag.self) + } + var _2: Int64? + _2 = reader.readInt64() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.SavedReactionTags.savedReactionTags(Cons_savedReactionTags(tags: _1!, hash: _2!)) + } + else { + return nil + } + } + public static func parse_savedReactionTagsNotModified(_ reader: BufferReader) -> SavedReactionTags? { + return Api.messages.SavedReactionTags.savedReactionTagsNotModified + } + } +} +public extension Api.messages { + enum SearchCounter: TypeConstructorDescription { + public class Cons_searchCounter: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchCounter", [("flags", ConstructorParameterDescription(self.flags)), ("filter", ConstructorParameterDescription(self.filter)), ("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .searchCounter(let _data): + return ("searchCounter", [("flags", ConstructorParameterDescription(_data.flags)), ("filter", ConstructorParameterDescription(_data.filter)), ("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_searchCounter(_ reader: BufferReader) -> SearchCounter? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.MessagesFilter? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.MessagesFilter + } + var _3: Int32? + _3 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.SearchCounter.searchCounter(Cons_searchCounter(flags: _1!, filter: _2!, count: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum SearchResultsCalendar: TypeConstructorDescription { + public class Cons_searchResultsCalendar: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchResultsCalendar", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("minDate", ConstructorParameterDescription(self.minDate)), ("minMsgId", ConstructorParameterDescription(self.minMsgId)), ("offsetIdOffset", ConstructorParameterDescription(self.offsetIdOffset)), ("periods", ConstructorParameterDescription(self.periods)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .searchResultsCalendar(let _data): + return ("searchResultsCalendar", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("minDate", ConstructorParameterDescription(_data.minDate)), ("minMsgId", ConstructorParameterDescription(_data.minMsgId)), ("offsetIdOffset", ConstructorParameterDescription(_data.offsetIdOffset)), ("periods", ConstructorParameterDescription(_data.periods)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_searchResultsCalendar(_ reader: BufferReader) -> SearchResultsCalendar? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + if Int(_1 ?? 0) & 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) + } + var _7: [Api.Message]? + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _8: [Api.Chat]? + if let _ = reader.readInt32() { + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _9: [Api.User]? + if let _ = reader.readInt32() { + _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 { + public class Cons_searchResultsPositions: TypeConstructorDescription { + public var count: Int32 + public var positions: [Api.SearchResultsPosition] + public init(count: Int32, positions: [Api.SearchResultsPosition]) { + self.count = count + self.positions = positions + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchResultsPositions", [("count", ConstructorParameterDescription(self.count)), ("positions", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .searchResultsPositions(let _data): + return ("searchResultsPositions", [("count", ConstructorParameterDescription(_data.count)), ("positions", ConstructorParameterDescription(_data.positions))]) + } + } + + public static func parse_searchResultsPositions(_ reader: BufferReader) -> SearchResultsPositions? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.SearchResultsPosition]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SearchResultsPosition.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.SearchResultsPositions.searchResultsPositions(Cons_searchResultsPositions(count: _1!, positions: _2!)) + } + else { + return nil + } } } } diff --git a/submodules/TelegramApi/Sources/Api38.swift b/submodules/TelegramApi/Sources/Api38.swift index dbd5ef3cd2..d364c7d0be 100644 --- a/submodules/TelegramApi/Sources/Api38.swift +++ b/submodules/TelegramApi/Sources/Api38.swift @@ -1,162 +1,77 @@ -public extension Api.payments { - enum StarsRevenueAdsAccountUrl: TypeConstructorDescription { - public class Cons_starsRevenueAdsAccountUrl: TypeConstructorDescription { - public var url: String - public init(url: String) { - self.url = url +public extension Api.messages { + enum SentEncryptedMessage: TypeConstructorDescription { + public class Cons_sentEncryptedFile: TypeConstructorDescription { + public var date: Int32 + public var file: Api.EncryptedFile + public init(date: Int32, file: Api.EncryptedFile) { + self.date = date + self.file = file } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsRevenueAdsAccountUrl", [("url", ConstructorParameterDescription(self.url))]) + return ("sentEncryptedFile", [("date", ConstructorParameterDescription(self.date)), ("file", ConstructorParameterDescription(self.file))]) } } - case starsRevenueAdsAccountUrl(Cons_starsRevenueAdsAccountUrl) + public class Cons_sentEncryptedMessage: TypeConstructorDescription { + public var date: Int32 + public init(date: Int32) { + self.date = date + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentEncryptedMessage", [("date", ConstructorParameterDescription(self.date))]) + } + } + case sentEncryptedFile(Cons_sentEncryptedFile) + case sentEncryptedMessage(Cons_sentEncryptedMessage) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starsRevenueAdsAccountUrl(let _data): + case .sentEncryptedFile(let _data): if boxed { - buffer.appendInt32(961445665) + buffer.appendInt32(-1802240206) } - serializeString(_data.url, buffer: buffer, boxed: false) + 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, ConstructorParameterDescription)]) { switch self { - case .starsRevenueAdsAccountUrl(let _data): - return ("starsRevenueAdsAccountUrl", [("url", ConstructorParameterDescription(_data.url))]) + case .sentEncryptedFile(let _data): + return ("sentEncryptedFile", [("date", ConstructorParameterDescription(_data.date)), ("file", ConstructorParameterDescription(_data.file))]) + case .sentEncryptedMessage(let _data): + return ("sentEncryptedMessage", [("date", ConstructorParameterDescription(_data.date))]) } } - 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(Cons_starsRevenueAdsAccountUrl(url: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum StarsRevenueStats: TypeConstructorDescription { - public class Cons_starsRevenueStats: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsRevenueStats", [("flags", ConstructorParameterDescription(self.flags)), ("topHoursGraph", ConstructorParameterDescription(self.topHoursGraph)), ("revenueGraph", ConstructorParameterDescription(self.revenueGraph)), ("status", ConstructorParameterDescription(self.status)), ("usdRate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starsRevenueStats(let _data): - return ("starsRevenueStats", [("flags", ConstructorParameterDescription(_data.flags)), ("topHoursGraph", ConstructorParameterDescription(_data.topHoursGraph)), ("revenueGraph", ConstructorParameterDescription(_data.revenueGraph)), ("status", ConstructorParameterDescription(_data.status)), ("usdRate", ConstructorParameterDescription(_data.usdRate))]) - } - } - - public static func parse_starsRevenueStats(_ reader: BufferReader) -> StarsRevenueStats? { + public static func parse_sentEncryptedFile(_ reader: BufferReader) -> SentEncryptedMessage? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.StatsGraph? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - } - var _3: Api.StatsGraph? + var _2: Api.EncryptedFile? if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StatsGraph + _2 = Api.parse(reader, signature: signature) as? Api.EncryptedFile } - var _4: Api.StarsRevenueStatus? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StarsRevenueStatus - } - var _5: Double? - _5 = reader.readDouble() let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.payments.StarsRevenueStats.starsRevenueStats(Cons_starsRevenueStats(flags: _1!, topHoursGraph: _2, revenueGraph: _3!, status: _4!, usdRate: _5!)) + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.SentEncryptedMessage.sentEncryptedFile(Cons_sentEncryptedFile(date: _1!, file: _2!)) } else { return nil } } - } -} -public extension Api.payments { - enum StarsRevenueWithdrawalUrl: TypeConstructorDescription { - public class Cons_starsRevenueWithdrawalUrl: TypeConstructorDescription { - public var url: String - public init(url: String) { - self.url = url - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsRevenueWithdrawalUrl", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .starsRevenueWithdrawalUrl(let _data): - return ("starsRevenueWithdrawalUrl", [("url", ConstructorParameterDescription(_data.url))]) - } - } - - public static func parse_starsRevenueWithdrawalUrl(_ reader: BufferReader) -> StarsRevenueWithdrawalUrl? { - var _1: String? - _1 = parseString(reader) + public static func parse_sentEncryptedMessage(_ reader: BufferReader) -> SentEncryptedMessage? { + var _1: Int32? + _1 = reader.readInt32() let _c1 = _1 != nil if _c1 { - return Api.payments.StarsRevenueWithdrawalUrl.starsRevenueWithdrawalUrl(Cons_starsRevenueWithdrawalUrl(url: _1!)) + return Api.messages.SentEncryptedMessage.sentEncryptedMessage(Cons_sentEncryptedMessage(date: _1!)) } else { return nil @@ -164,66 +79,873 @@ public extension Api.payments { } } } -public extension Api.payments { - enum StarsStatus: TypeConstructorDescription { - public class Cons_starsStatus: TypeConstructorDescription { +public extension Api.messages { + enum SponsoredMessages: TypeConstructorDescription { + public class Cons_sponsoredMessages: TypeConstructorDescription { 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 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, balance: Api.StarsAmount, subscriptions: [Api.StarsSubscription]?, subscriptionsNextOffset: String?, subscriptionsMissingBalance: Int64?, history: [Api.StarsTransaction]?, nextOffset: String?, chats: [Api.Chat], 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.balance = balance - self.subscriptions = subscriptions - self.subscriptionsNextOffset = subscriptionsNextOffset - self.subscriptionsMissingBalance = subscriptionsMissingBalance - self.history = history - self.nextOffset = nextOffset + self.postsBetween = postsBetween + self.startDelay = startDelay + self.betweenDelay = betweenDelay + self.messages = messages self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("starsStatus", [("flags", ConstructorParameterDescription(self.flags)), ("balance", ConstructorParameterDescription(self.balance)), ("subscriptions", ConstructorParameterDescription(self.subscriptions)), ("subscriptionsNextOffset", ConstructorParameterDescription(self.subscriptionsNextOffset)), ("subscriptionsMissingBalance", ConstructorParameterDescription(self.subscriptionsMissingBalance)), ("history", ConstructorParameterDescription(self.history)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("sponsoredMessages", [("flags", ConstructorParameterDescription(self.flags)), ("postsBetween", ConstructorParameterDescription(self.postsBetween)), ("startDelay", ConstructorParameterDescription(self.startDelay)), ("betweenDelay", ConstructorParameterDescription(self.betweenDelay)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case starsStatus(Cons_starsStatus) + case sponsoredMessages(Cons_sponsoredMessages) + case sponsoredMessagesEmpty public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .starsStatus(let _data): + case .sponsoredMessages(let _data): if boxed { - buffer.appendInt32(1822222573) + buffer.appendInt32(-2464403) } serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.balance.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.postsBetween!, buffer: buffer, boxed: false) + } if Int(_data.flags) & Int(1 << 1) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.subscriptions!.count)) - for item in _data.subscriptions! { - item.serialize(buffer, true) - } + serializeInt32(_data.startDelay!, buffer: buffer, boxed: false) } if Int(_data.flags) & Int(1 << 2) != 0 { - serializeString(_data.subscriptionsNextOffset!, buffer: buffer, boxed: false) + serializeInt32(_data.betweenDelay!, buffer: buffer, boxed: false) } - if Int(_data.flags) & Int(1 << 4) != 0 { - serializeInt64(_data.subscriptionsMissingBalance!, 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 << 3) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.history!.count)) - for item in _data.history! { - 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, ConstructorParameterDescription)]) { + switch self { + case .sponsoredMessages(let _data): + return ("sponsoredMessages", [("flags", ConstructorParameterDescription(_data.flags)), ("postsBetween", ConstructorParameterDescription(_data.postsBetween)), ("startDelay", ConstructorParameterDescription(_data.startDelay)), ("betweenDelay", ConstructorParameterDescription(_data.betweenDelay)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .sponsoredMessagesEmpty: + return ("sponsoredMessagesEmpty", []) + } + } + + public static func parse_sponsoredMessages(_ reader: BufferReader) -> SponsoredMessages? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = reader.readInt32() + } + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + var _4: Int32? + if Int(_1 ?? 0) & 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) + } + var _6: [Api.Chat]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _7: [Api.User]? + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.messages.SponsoredMessages.sponsoredMessages(Cons_sponsoredMessages(flags: _1!, postsBetween: _2, startDelay: _3, betweenDelay: _4, messages: _5!, chats: _6!, users: _7!)) + } + else { + return nil + } + } + public static func parse_sponsoredMessagesEmpty(_ reader: BufferReader) -> SponsoredMessages? { + return Api.messages.SponsoredMessages.sponsoredMessagesEmpty + } + } +} +public extension Api.messages { + enum StickerSet: TypeConstructorDescription { + public class Cons_stickerSet: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSet", [("set", ConstructorParameterDescription(self.set)), ("packs", ConstructorParameterDescription(self.packs)), ("keywords", ConstructorParameterDescription(self.keywords)), ("documents", ConstructorParameterDescription(self.documents))]) + } + } + case stickerSet(Cons_stickerSet) + 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, ConstructorParameterDescription)]) { + switch self { + case .stickerSet(let _data): + return ("stickerSet", [("set", ConstructorParameterDescription(_data.set)), ("packs", ConstructorParameterDescription(_data.packs)), ("keywords", ConstructorParameterDescription(_data.keywords)), ("documents", ConstructorParameterDescription(_data.documents))]) + case .stickerSetNotModified: + return ("stickerSetNotModified", []) + } + } + + public static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { + var _1: Api.StickerSet? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StickerSet + } + var _2: [Api.StickerPack]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerPack.self) + } + var _3: [Api.StickerKeyword]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerKeyword.self) + } + var _4: [Api.Document]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.messages.StickerSet.stickerSet(Cons_stickerSet(set: _1!, packs: _2!, keywords: _3!, documents: _4!)) + } + else { + return nil + } + } + public static func parse_stickerSetNotModified(_ reader: BufferReader) -> StickerSet? { + return Api.messages.StickerSet.stickerSetNotModified + } + } +} +public extension Api.messages { + enum StickerSetInstallResult: TypeConstructorDescription { + public class Cons_stickerSetInstallResultArchive: TypeConstructorDescription { + public var sets: [Api.StickerSetCovered] + public init(sets: [Api.StickerSetCovered]) { + self.sets = sets + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetInstallResultArchive", [("sets", ConstructorParameterDescription(self.sets))]) + } + } + case stickerSetInstallResultArchive(Cons_stickerSetInstallResultArchive) + 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, ConstructorParameterDescription)]) { + switch self { + case .stickerSetInstallResultArchive(let _data): + return ("stickerSetInstallResultArchive", [("sets", ConstructorParameterDescription(_data.sets))]) + case .stickerSetInstallResultSuccess: + return ("stickerSetInstallResultSuccess", []) + } + } + + public static func parse_stickerSetInstallResultArchive(_ reader: BufferReader) -> StickerSetInstallResult? { + var _1: [Api.StickerSetCovered]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.messages.StickerSetInstallResult.stickerSetInstallResultArchive(Cons_stickerSetInstallResultArchive(sets: _1!)) + } + else { + return nil + } + } + public static func parse_stickerSetInstallResultSuccess(_ reader: BufferReader) -> StickerSetInstallResult? { + return Api.messages.StickerSetInstallResult.stickerSetInstallResultSuccess + } + } +} +public extension Api.messages { + enum Stickers: TypeConstructorDescription { + public class Cons_stickers: TypeConstructorDescription { + public var hash: Int64 + public var stickers: [Api.Document] + public init(hash: Int64, stickers: [Api.Document]) { + self.hash = hash + self.stickers = stickers + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickers", [("hash", ConstructorParameterDescription(self.hash)), ("stickers", ConstructorParameterDescription(self.stickers))]) + } + } + case stickers(Cons_stickers) + 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, ConstructorParameterDescription)]) { + switch self { + case .stickers(let _data): + return ("stickers", [("hash", ConstructorParameterDescription(_data.hash)), ("stickers", ConstructorParameterDescription(_data.stickers))]) + case .stickersNotModified: + return ("stickersNotModified", []) + } + } + + public static func parse_stickers(_ reader: BufferReader) -> Stickers? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.Document]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.messages.Stickers.stickers(Cons_stickers(hash: _1!, stickers: _2!)) + } + else { + return nil + } + } + public static func parse_stickersNotModified(_ reader: BufferReader) -> Stickers? { + return Api.messages.Stickers.stickersNotModified + } + } +} +public extension Api.messages { + enum TranscribedAudio: TypeConstructorDescription { + public class Cons_transcribedAudio: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("transcribedAudio", [("flags", ConstructorParameterDescription(self.flags)), ("transcriptionId", ConstructorParameterDescription(self.transcriptionId)), ("text", ConstructorParameterDescription(self.text)), ("trialRemainsNum", ConstructorParameterDescription(self.trialRemainsNum)), ("trialRemainsUntilDate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .transcribedAudio(let _data): + return ("transcribedAudio", [("flags", ConstructorParameterDescription(_data.flags)), ("transcriptionId", ConstructorParameterDescription(_data.transcriptionId)), ("text", ConstructorParameterDescription(_data.text)), ("trialRemainsNum", ConstructorParameterDescription(_data.trialRemainsNum)), ("trialRemainsUntilDate", ConstructorParameterDescription(_data.trialRemainsUntilDate))]) + } + } + + public static func parse_transcribedAudio(_ reader: BufferReader) -> TranscribedAudio? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: String? + _3 = parseString(reader) + var _4: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_translateResult: TypeConstructorDescription { + public var result: [Api.TextWithEntities] + public init(result: [Api.TextWithEntities]) { + self.result = result + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("translateResult", [("result", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .translateResult(let _data): + return ("translateResult", [("result", ConstructorParameterDescription(_data.result))]) + } + } + + public static func parse_translateResult(_ reader: BufferReader) -> TranslatedText? { + var _1: [Api.TextWithEntities]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.TextWithEntities.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.messages.TranslatedText.translateResult(Cons_translateResult(result: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + enum VotesList: TypeConstructorDescription { + public class Cons_votesList: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("votesList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("votes", ConstructorParameterDescription(self.votes)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .votesList(let _data): + return ("votesList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("votes", ConstructorParameterDescription(_data.votes)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) + } + } + + public static func parse_votesList(_ reader: BufferReader) -> VotesList? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.MessagePeerVote]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessagePeerVote.self) + } + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_webPage: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPage", [("webpage", ConstructorParameterDescription(self.webpage)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .webPage(let _data): + return ("webPage", [("webpage", ConstructorParameterDescription(_data.webpage)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_webPage(_ reader: BufferReader) -> WebPage? { + var _1: Api.WebPage? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.WebPage + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.WebPage.webPage(Cons_webPage(webpage: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.messages { + indirect enum WebPagePreview: TypeConstructorDescription { + public class Cons_webPagePreview: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPagePreview", [("media", ConstructorParameterDescription(self.media)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .webPagePreview(let _data): + return ("webPagePreview", [("media", ConstructorParameterDescription(_data.media)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_webPagePreview(_ reader: BufferReader) -> WebPagePreview? { + var _1: Api.MessageMedia? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.MessageMedia + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.messages.WebPagePreview.webPagePreview(Cons_webPagePreview(media: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum BankCardData: TypeConstructorDescription { + public class Cons_bankCardData: TypeConstructorDescription { + public var title: String + public var openUrls: [Api.BankCardOpenUrl] + public init(title: String, openUrls: [Api.BankCardOpenUrl]) { + self.title = title + self.openUrls = openUrls + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("bankCardData", [("title", ConstructorParameterDescription(self.title)), ("openUrls", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .bankCardData(let _data): + return ("bankCardData", [("title", ConstructorParameterDescription(_data.title)), ("openUrls", ConstructorParameterDescription(_data.openUrls))]) + } + } + + public static func parse_bankCardData(_ reader: BufferReader) -> BankCardData? { + var _1: String? + _1 = parseString(reader) + var _2: [Api.BankCardOpenUrl]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BankCardOpenUrl.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.payments.BankCardData.bankCardData(Cons_bankCardData(title: _1!, openUrls: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum CheckCanSendGiftResult: TypeConstructorDescription { + public class Cons_checkCanSendGiftResultFail: TypeConstructorDescription { + public var reason: Api.TextWithEntities + public init(reason: Api.TextWithEntities) { + self.reason = reason + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("checkCanSendGiftResultFail", [("reason", ConstructorParameterDescription(self.reason))]) + } + } + case checkCanSendGiftResultFail(Cons_checkCanSendGiftResultFail) + 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, ConstructorParameterDescription)]) { + switch self { + case .checkCanSendGiftResultFail(let _data): + return ("checkCanSendGiftResultFail", [("reason", ConstructorParameterDescription(_data.reason))]) + case .checkCanSendGiftResultOk: + return ("checkCanSendGiftResultOk", []) + } + } + + public static func parse_checkCanSendGiftResultFail(_ reader: BufferReader) -> CheckCanSendGiftResult? { + var _1: Api.TextWithEntities? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + let _c1 = _1 != nil + if _c1 { + return Api.payments.CheckCanSendGiftResult.checkCanSendGiftResultFail(Cons_checkCanSendGiftResultFail(reason: _1!)) + } + else { + return nil + } + } + public static func parse_checkCanSendGiftResultOk(_ reader: BufferReader) -> CheckCanSendGiftResult? { + return Api.payments.CheckCanSendGiftResult.checkCanSendGiftResultOk + } + } +} +public extension Api.payments { + enum CheckedGiftCode: TypeConstructorDescription { + public class Cons_checkedGiftCode: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("checkedGiftCode", [("flags", ConstructorParameterDescription(self.flags)), ("fromId", ConstructorParameterDescription(self.fromId)), ("giveawayMsgId", ConstructorParameterDescription(self.giveawayMsgId)), ("toId", ConstructorParameterDescription(self.toId)), ("date", ConstructorParameterDescription(self.date)), ("days", ConstructorParameterDescription(self.days)), ("usedDate", ConstructorParameterDescription(self.usedDate)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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 { @@ -240,41 +962,35 @@ public extension Api.payments { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .starsStatus(let _data): - return ("starsStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("balance", ConstructorParameterDescription(_data.balance)), ("subscriptions", ConstructorParameterDescription(_data.subscriptions)), ("subscriptionsNextOffset", ConstructorParameterDescription(_data.subscriptionsNextOffset)), ("subscriptionsMissingBalance", ConstructorParameterDescription(_data.subscriptionsMissingBalance)), ("history", ConstructorParameterDescription(_data.history)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .checkedGiftCode(let _data): + return ("checkedGiftCode", [("flags", ConstructorParameterDescription(_data.flags)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("giveawayMsgId", ConstructorParameterDescription(_data.giveawayMsgId)), ("toId", ConstructorParameterDescription(_data.toId)), ("date", ConstructorParameterDescription(_data.date)), ("days", ConstructorParameterDescription(_data.days)), ("usedDate", ConstructorParameterDescription(_data.usedDate)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_starsStatus(_ reader: BufferReader) -> StarsStatus? { + public static func parse_checkedGiftCode(_ reader: BufferReader) -> CheckedGiftCode? { var _1: Int32? _1 = reader.readInt32() - var _2: Api.StarsAmount? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - var _3: [Api.StarsSubscription]? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsSubscription.self) - } - } - var _4: String? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _4 = parseString(reader) - } - var _5: Int64? + var _2: Api.Peer? if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = reader.readInt64() - } - var _6: [Api.StarsTransaction]? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsTransaction.self) + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer } } - var _7: String? + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _3 = reader.readInt32() + } + var _4: Int64? if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _7 = parseString(reader) + _4 = reader.readInt64() + } + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _7 = reader.readInt32() } var _8: [Api.Chat]? if let _ = reader.readInt32() { @@ -285,16 +1001,16 @@ public extension Api.payments { _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil let _c8 = _8 != nil let _c9 = _9 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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!)) + 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 @@ -303,37 +1019,32 @@ public extension Api.payments { } } public extension Api.payments { - enum SuggestedStarRefBots: TypeConstructorDescription { - public class Cons_suggestedStarRefBots: TypeConstructorDescription { - public var flags: Int32 + enum ConnectedStarRefBots: TypeConstructorDescription { + public class Cons_connectedStarRefBots: TypeConstructorDescription { public var count: Int32 - public var suggestedBots: [Api.StarRefProgram] + public var connectedBots: [Api.ConnectedBotStarRef] 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 + public init(count: Int32, connectedBots: [Api.ConnectedBotStarRef], users: [Api.User]) { self.count = count - self.suggestedBots = suggestedBots + self.connectedBots = connectedBots self.users = users - self.nextOffset = nextOffset } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("suggestedStarRefBots", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("suggestedBots", ConstructorParameterDescription(self.suggestedBots)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) + return ("connectedStarRefBots", [("count", ConstructorParameterDescription(self.count)), ("connectedBots", ConstructorParameterDescription(self.connectedBots)), ("users", ConstructorParameterDescription(self.users))]) } } - case suggestedStarRefBots(Cons_suggestedStarRefBots) + case connectedStarRefBots(Cons_connectedStarRefBots) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .suggestedStarRefBots(let _data): + case .connectedStarRefBots(let _data): if boxed { - buffer.appendInt32(-1261053863) + buffer.appendInt32(-1730811363) } - 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 { + buffer.appendInt32(Int32(_data.connectedBots.count)) + for item in _data.connectedBots { item.serialize(buffer, true) } buffer.appendInt32(481674261) @@ -341,8 +1052,161 @@ public extension Api.payments { 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, ConstructorParameterDescription)]) { + switch self { + case .connectedStarRefBots(let _data): + return ("connectedStarRefBots", [("count", ConstructorParameterDescription(_data.count)), ("connectedBots", ConstructorParameterDescription(_data.connectedBots)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_connectedStarRefBots(_ reader: BufferReader) -> ConnectedStarRefBots? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.ConnectedBotStarRef]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ConnectedBotStarRef.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.payments.ConnectedStarRefBots.connectedStarRefBots(Cons_connectedStarRefBots(count: _1!, connectedBots: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum ExportedInvoice: TypeConstructorDescription { + public class Cons_exportedInvoice: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedInvoice", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .exportedInvoice(let _data): + return ("exportedInvoice", [("url", ConstructorParameterDescription(_data.url))]) + } + } + + 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(Cons_exportedInvoice(url: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum GiveawayInfo: TypeConstructorDescription { + public class Cons_giveawayInfo: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("giveawayInfo", [("flags", ConstructorParameterDescription(self.flags)), ("startDate", ConstructorParameterDescription(self.startDate)), ("joinedTooEarlyDate", ConstructorParameterDescription(self.joinedTooEarlyDate)), ("adminDisallowedChatId", ConstructorParameterDescription(self.adminDisallowedChatId)), ("disallowedCountry", ConstructorParameterDescription(self.disallowedCountry))]) + } + } + public class Cons_giveawayInfoResults: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("giveawayInfoResults", [("flags", ConstructorParameterDescription(self.flags)), ("startDate", ConstructorParameterDescription(self.startDate)), ("giftCodeSlug", ConstructorParameterDescription(self.giftCodeSlug)), ("starsPrize", ConstructorParameterDescription(self.starsPrize)), ("finishDate", ConstructorParameterDescription(self.finishDate)), ("winnersCount", ConstructorParameterDescription(self.winnersCount)), ("activatedCount", ConstructorParameterDescription(self.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 } @@ -350,1458 +1214,72 @@ public extension Api.payments { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .suggestedStarRefBots(let _data): - return ("suggestedStarRefBots", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("suggestedBots", ConstructorParameterDescription(_data.suggestedBots)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) + case .giveawayInfo(let _data): + return ("giveawayInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("joinedTooEarlyDate", ConstructorParameterDescription(_data.joinedTooEarlyDate)), ("adminDisallowedChatId", ConstructorParameterDescription(_data.adminDisallowedChatId)), ("disallowedCountry", ConstructorParameterDescription(_data.disallowedCountry))]) + case .giveawayInfoResults(let _data): + return ("giveawayInfoResults", [("flags", ConstructorParameterDescription(_data.flags)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("giftCodeSlug", ConstructorParameterDescription(_data.giftCodeSlug)), ("starsPrize", ConstructorParameterDescription(_data.starsPrize)), ("finishDate", ConstructorParameterDescription(_data.finishDate)), ("winnersCount", ConstructorParameterDescription(_data.winnersCount)), ("activatedCount", ConstructorParameterDescription(_data.activatedCount))]) } } - public static func parse_suggestedStarRefBots(_ reader: BufferReader) -> SuggestedStarRefBots? { + public static func parse_giveawayInfo(_ reader: BufferReader) -> GiveawayInfo? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() - var _3: [Api.StarRefProgram]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarRefProgram.self) + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = reader.readInt64() } var _5: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if Int(_1 ?? 0) & Int(1 << 4) != 0 { _5 = parseString(reader) } let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_uniqueStarGift: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("uniqueStarGift", [("gift", ConstructorParameterDescription(self.gift)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .uniqueStarGift(let _data): - return ("uniqueStarGift", [("gift", ConstructorParameterDescription(_data.gift)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_uniqueStarGift(_ reader: BufferReader) -> UniqueStarGift? { - var _1: Api.StarGift? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StarGift - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.payments.UniqueStarGift.uniqueStarGift(Cons_uniqueStarGift(gift: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.payments { - enum UniqueStarGiftValueInfo: TypeConstructorDescription { - public class Cons_uniqueStarGiftValueInfo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("uniqueStarGiftValueInfo", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("value", ConstructorParameterDescription(self.value)), ("initialSaleDate", ConstructorParameterDescription(self.initialSaleDate)), ("initialSaleStars", ConstructorParameterDescription(self.initialSaleStars)), ("initialSalePrice", ConstructorParameterDescription(self.initialSalePrice)), ("lastSaleDate", ConstructorParameterDescription(self.lastSaleDate)), ("lastSalePrice", ConstructorParameterDescription(self.lastSalePrice)), ("floorPrice", ConstructorParameterDescription(self.floorPrice)), ("averagePrice", ConstructorParameterDescription(self.averagePrice)), ("listedCount", ConstructorParameterDescription(self.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(self.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .uniqueStarGiftValueInfo(let _data): - return ("uniqueStarGiftValueInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("value", ConstructorParameterDescription(_data.value)), ("initialSaleDate", ConstructorParameterDescription(_data.initialSaleDate)), ("initialSaleStars", ConstructorParameterDescription(_data.initialSaleStars)), ("initialSalePrice", ConstructorParameterDescription(_data.initialSalePrice)), ("lastSaleDate", ConstructorParameterDescription(_data.lastSaleDate)), ("lastSalePrice", ConstructorParameterDescription(_data.lastSalePrice)), ("floorPrice", ConstructorParameterDescription(_data.floorPrice)), ("averagePrice", ConstructorParameterDescription(_data.averagePrice)), ("listedCount", ConstructorParameterDescription(_data.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(_data.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(_data.fragmentListedUrl))]) - } - } - - public static func parse_uniqueStarGiftValueInfo(_ reader: BufferReader) -> UniqueStarGiftValueInfo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Int64? - _3 = reader.readInt64() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int64? - _5 = reader.readInt64() - var _6: Int64? - _6 = reader.readInt64() - var _7: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _7 = reader.readInt32() - } - var _8: Int64? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _8 = reader.readInt64() - } - var _9: Int64? - if Int(_1 ?? 0) & Int(1 << 2) != 0 { - _9 = reader.readInt64() - } - var _10: Int64? - if Int(_1 ?? 0) & Int(1 << 3) != 0 { - _10 = reader.readInt64() - } - var _11: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _11 = reader.readInt32() - } - var _12: Int32? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _12 = reader.readInt32() - } - var _13: String? - if Int(_1 ?? 0) & Int(1 << 5) != 0 { - _13 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil - let _c8 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _10 != nil - let _c11 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _11 != nil - let _c12 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _12 != nil - let _c13 = (Int(_1 ?? 0) & 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(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 { - public class Cons_validatedRequestedInfo: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("validatedRequestedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("shippingOptions", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .validatedRequestedInfo(let _data): - return ("validatedRequestedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("shippingOptions", ConstructorParameterDescription(_data.shippingOptions))]) - } - } - - public static func parse_validatedRequestedInfo(_ reader: BufferReader) -> ValidatedRequestedInfo? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _2 = parseString(reader) - } - var _3: [Api.ShippingOption]? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.payments.ValidatedRequestedInfo.validatedRequestedInfo(Cons_validatedRequestedInfo(flags: _1!, id: _2, shippingOptions: _3)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum ExportedGroupCallInvite: TypeConstructorDescription { - public class Cons_exportedGroupCallInvite: TypeConstructorDescription { - public var link: String - public init(link: String) { - self.link = link - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("exportedGroupCallInvite", [("link", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .exportedGroupCallInvite(let _data): - return ("exportedGroupCallInvite", [("link", ConstructorParameterDescription(_data.link))]) - } - } - - 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(Cons_exportedGroupCallInvite(link: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum GroupCall: TypeConstructorDescription { - public class Cons_groupCall: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("groupCall", [("call", ConstructorParameterDescription(self.call)), ("participants", ConstructorParameterDescription(self.participants)), ("participantsNextOffset", ConstructorParameterDescription(self.participantsNextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .groupCall(let _data): - return ("groupCall", [("call", ConstructorParameterDescription(_data.call)), ("participants", ConstructorParameterDescription(_data.participants)), ("participantsNextOffset", ConstructorParameterDescription(_data.participantsNextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_groupCall(_ reader: BufferReader) -> GroupCall? { - var _1: Api.GroupCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.GroupCall - } - var _2: [Api.GroupCallParticipant]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) - } - var _3: String? - _3 = parseString(reader) - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_groupCallStars: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("groupCallStars", [("totalStars", ConstructorParameterDescription(self.totalStars)), ("topDonors", ConstructorParameterDescription(self.topDonors)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .groupCallStars(let _data): - return ("groupCallStars", [("totalStars", ConstructorParameterDescription(_data.totalStars)), ("topDonors", ConstructorParameterDescription(_data.topDonors)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_groupCallStars(_ reader: BufferReader) -> GroupCallStars? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.GroupCallDonor]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallDonor.self) - } - var _3: [Api.Chat]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _4: [Api.User]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - 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 { - public class Cons_groupCallStreamChannels: TypeConstructorDescription { - public var channels: [Api.GroupCallStreamChannel] - public init(channels: [Api.GroupCallStreamChannel]) { - self.channels = channels - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("groupCallStreamChannels", [("channels", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .groupCallStreamChannels(let _data): - return ("groupCallStreamChannels", [("channels", ConstructorParameterDescription(_data.channels))]) - } - } - - public static func parse_groupCallStreamChannels(_ reader: BufferReader) -> GroupCallStreamChannels? { - var _1: [Api.GroupCallStreamChannel]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallStreamChannel.self) - } - let _c1 = _1 != nil - if _c1 { - return Api.phone.GroupCallStreamChannels.groupCallStreamChannels(Cons_groupCallStreamChannels(channels: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum GroupCallStreamRtmpUrl: TypeConstructorDescription { - public class Cons_groupCallStreamRtmpUrl: TypeConstructorDescription { - public var url: String - public var key: String - public init(url: String, key: String) { - self.url = url - self.key = key - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("groupCallStreamRtmpUrl", [("url", ConstructorParameterDescription(self.url)), ("key", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .groupCallStreamRtmpUrl(let _data): - return ("groupCallStreamRtmpUrl", [("url", ConstructorParameterDescription(_data.url)), ("key", ConstructorParameterDescription(_data.key))]) - } - } - - public static func parse_groupCallStreamRtmpUrl(_ reader: BufferReader) -> GroupCallStreamRtmpUrl? { - var _1: String? - _1 = parseString(reader) - var _2: String? - _2 = parseString(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.phone.GroupCallStreamRtmpUrl.groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl(url: _1!, key: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum GroupParticipants: TypeConstructorDescription { - public class Cons_groupParticipants: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("groupParticipants", [("count", ConstructorParameterDescription(self.count)), ("participants", ConstructorParameterDescription(self.participants)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("version", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .groupParticipants(let _data): - return ("groupParticipants", [("count", ConstructorParameterDescription(_data.count)), ("participants", ConstructorParameterDescription(_data.participants)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("version", ConstructorParameterDescription(_data.version))]) - } - } - - public static func parse_groupParticipants(_ reader: BufferReader) -> GroupParticipants? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.GroupCallParticipant]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) - } - var _3: String? - _3 = parseString(reader) - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.phone.GroupParticipants.groupParticipants(Cons_groupParticipants(count: _1!, participants: _2!, nextOffset: _3!, chats: _4!, users: _5!, version: _6!)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum JoinAsPeers: TypeConstructorDescription { - public class Cons_joinAsPeers: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("joinAsPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .joinAsPeers(let _data): - return ("joinAsPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_joinAsPeers(_ reader: BufferReader) -> JoinAsPeers? { - var _1: [Api.Peer]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.phone.JoinAsPeers.joinAsPeers(Cons_joinAsPeers(peers: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.phone { - enum PhoneCall: TypeConstructorDescription { - public class Cons_phoneCall: TypeConstructorDescription { - public var phoneCall: Api.PhoneCall - public var users: [Api.User] - public init(phoneCall: Api.PhoneCall, users: [Api.User]) { - self.phoneCall = phoneCall - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("phoneCall", [("phoneCall", ConstructorParameterDescription(self.phoneCall)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .phoneCall(let _data): - return ("phoneCall", [("phoneCall", ConstructorParameterDescription(_data.phoneCall)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { - var _1: Api.PhoneCall? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PhoneCall - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.phone.PhoneCall.phoneCall(Cons_phoneCall(phoneCall: _1!, users: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.photos { - enum Photo: TypeConstructorDescription { - public class Cons_photo: TypeConstructorDescription { - public var photo: Api.Photo - public var users: [Api.User] - public init(photo: Api.Photo, users: [Api.User]) { - self.photo = photo - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photo", [("photo", ConstructorParameterDescription(self.photo)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .photo(let _data): - return ("photo", [("photo", ConstructorParameterDescription(_data.photo)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_photo(_ reader: BufferReader) -> Photo? { - var _1: Api.Photo? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.Photo - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.photos.Photo.photo(Cons_photo(photo: _1!, users: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.photos { - enum Photos: TypeConstructorDescription { - public class Cons_photos: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photos", [("photos", ConstructorParameterDescription(self.photos)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_photosSlice: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("photosSlice", [("count", ConstructorParameterDescription(self.count)), ("photos", ConstructorParameterDescription(self.photos)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .photos(let _data): - return ("photos", [("photos", ConstructorParameterDescription(_data.photos)), ("users", ConstructorParameterDescription(_data.users))]) - case .photosSlice(let _data): - return ("photosSlice", [("count", ConstructorParameterDescription(_data.count)), ("photos", ConstructorParameterDescription(_data.photos)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_photos(_ reader: BufferReader) -> Photos? { - var _1: [Api.Photo]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.photos.Photos.photos(Cons_photos(photos: _1!, users: _2!)) - } - else { - return nil - } - } - public static func parse_photosSlice(_ reader: BufferReader) -> Photos? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.Photo]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.photos.Photos.photosSlice(Cons_photosSlice(count: _1!, photos: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.premium { - enum BoostsList: TypeConstructorDescription { - public class Cons_boostsList: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("boostsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("boosts", ConstructorParameterDescription(self.boosts)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .boostsList(let _data): - return ("boostsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("boosts", ConstructorParameterDescription(_data.boosts)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_boostsList(_ reader: BufferReader) -> BoostsList? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.Boost]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Boost.self) - } - var _4: String? - if Int(_1 ?? 0) & 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) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_boostsStatus: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("boostsStatus", [("flags", ConstructorParameterDescription(self.flags)), ("level", ConstructorParameterDescription(self.level)), ("currentLevelBoosts", ConstructorParameterDescription(self.currentLevelBoosts)), ("boosts", ConstructorParameterDescription(self.boosts)), ("giftBoosts", ConstructorParameterDescription(self.giftBoosts)), ("nextLevelBoosts", ConstructorParameterDescription(self.nextLevelBoosts)), ("premiumAudience", ConstructorParameterDescription(self.premiumAudience)), ("boostUrl", ConstructorParameterDescription(self.boostUrl)), ("prepaidGiveaways", ConstructorParameterDescription(self.prepaidGiveaways)), ("myBoostSlots", ConstructorParameterDescription(self.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(_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, ConstructorParameterDescription)]) { - switch self { - case .boostsStatus(let _data): - return ("boostsStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("level", ConstructorParameterDescription(_data.level)), ("currentLevelBoosts", ConstructorParameterDescription(_data.currentLevelBoosts)), ("boosts", ConstructorParameterDescription(_data.boosts)), ("giftBoosts", ConstructorParameterDescription(_data.giftBoosts)), ("nextLevelBoosts", ConstructorParameterDescription(_data.nextLevelBoosts)), ("premiumAudience", ConstructorParameterDescription(_data.premiumAudience)), ("boostUrl", ConstructorParameterDescription(_data.boostUrl)), ("prepaidGiveaways", ConstructorParameterDescription(_data.prepaidGiveaways)), ("myBoostSlots", ConstructorParameterDescription(_data.myBoostSlots))]) - } - } - - public static func parse_boostsStatus(_ reader: BufferReader) -> BoostsStatus? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - if Int(_1 ?? 0) & Int(1 << 4) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = reader.readInt32() - } - var _7: Api.StatsPercentValue? - if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 3) != 0 { - if let _ = reader.readInt32() { - _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrepaidGiveaway.self) - } - } - var _10: [Int32]? - if Int(_1 ?? 0) & 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 - let _c4 = _4 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _9 != nil - let _c10 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _10 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { - 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)) + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.payments.GiveawayInfo.giveawayInfo(Cons_giveawayInfo(flags: _1!, startDate: _2!, joinedTooEarlyDate: _3, adminDisallowedChatId: _4, disallowedCountry: _5)) } else { return nil } } - } -} -public extension Api.premium { - enum MyBoosts: TypeConstructorDescription { - public class Cons_myBoosts: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("myBoosts", [("myBoosts", ConstructorParameterDescription(self.myBoosts)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .myBoosts(let _data): - return ("myBoosts", [("myBoosts", ConstructorParameterDescription(_data.myBoosts)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_myBoosts(_ reader: BufferReader) -> MyBoosts? { - var _1: [Api.MyBoost]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MyBoost.self) - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.premium.MyBoosts.myBoosts(Cons_myBoosts(myBoosts: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.smsjobs { - enum EligibilityToJoin: TypeConstructorDescription { - public class Cons_eligibleToJoin: TypeConstructorDescription { - public var termsUrl: String - public var monthlySentSms: Int32 - public init(termsUrl: String, monthlySentSms: Int32) { - self.termsUrl = termsUrl - self.monthlySentSms = monthlySentSms - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("eligibleToJoin", [("termsUrl", ConstructorParameterDescription(self.termsUrl)), ("monthlySentSms", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .eligibleToJoin(let _data): - return ("eligibleToJoin", [("termsUrl", ConstructorParameterDescription(_data.termsUrl)), ("monthlySentSms", ConstructorParameterDescription(_data.monthlySentSms))]) - } - } - - public static func parse_eligibleToJoin(_ reader: BufferReader) -> EligibilityToJoin? { - var _1: String? - _1 = parseString(reader) - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.smsjobs.EligibilityToJoin.eligibleToJoin(Cons_eligibleToJoin(termsUrl: _1!, monthlySentSms: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.smsjobs { - enum Status: TypeConstructorDescription { - public class Cons_status: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("status", [("flags", ConstructorParameterDescription(self.flags)), ("recentSent", ConstructorParameterDescription(self.recentSent)), ("recentSince", ConstructorParameterDescription(self.recentSince)), ("recentRemains", ConstructorParameterDescription(self.recentRemains)), ("totalSent", ConstructorParameterDescription(self.totalSent)), ("totalSince", ConstructorParameterDescription(self.totalSince)), ("lastGiftSlug", ConstructorParameterDescription(self.lastGiftSlug)), ("termsUrl", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .status(let _data): - return ("status", [("flags", ConstructorParameterDescription(_data.flags)), ("recentSent", ConstructorParameterDescription(_data.recentSent)), ("recentSince", ConstructorParameterDescription(_data.recentSince)), ("recentRemains", ConstructorParameterDescription(_data.recentRemains)), ("totalSent", ConstructorParameterDescription(_data.totalSent)), ("totalSince", ConstructorParameterDescription(_data.totalSince)), ("lastGiftSlug", ConstructorParameterDescription(_data.lastGiftSlug)), ("termsUrl", ConstructorParameterDescription(_data.termsUrl))]) - } - } - - public static func parse_status(_ reader: BufferReader) -> Status? { + public static func parse_giveawayInfoResults(_ reader: BufferReader) -> GiveawayInfo? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() + var _3: String? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _3 = parseString(reader) + } + var _4: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _4 = reader.readInt64() + } var _5: Int32? _5 = reader.readInt32() var _6: Int32? _6 = reader.readInt32() - var _7: String? - if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _7 = parseString(reader) + var _7: Int32? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _7 = reader.readInt32() } - var _8: String? - _8 = parseString(reader) let _c1 = _1 != nil let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _4 != nil let _c5 = _5 != nil let _c6 = _6 != nil - let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil - let _c8 = _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.smsjobs.Status.status(Cons_status(flags: _1!, recentSent: _2!, recentSince: _3!, recentRemains: _4!, totalSent: _5!, totalSince: _6!, lastGiftSlug: _7, termsUrl: _8!)) + let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.payments.GiveawayInfo.giveawayInfoResults(Cons_giveawayInfoResults(flags: _1!, startDate: _2!, giftCodeSlug: _3, starsPrize: _4, finishDate: _5!, winnersCount: _6!, activatedCount: _7)) } else { return nil @@ -1809,303 +1287,149 @@ public extension Api.smsjobs { } } } -public extension Api.stats { - enum BroadcastStats: TypeConstructorDescription { - public class Cons_broadcastStats: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("broadcastStats", [("period", ConstructorParameterDescription(self.period)), ("followers", ConstructorParameterDescription(self.followers)), ("viewsPerPost", ConstructorParameterDescription(self.viewsPerPost)), ("sharesPerPost", ConstructorParameterDescription(self.sharesPerPost)), ("reactionsPerPost", ConstructorParameterDescription(self.reactionsPerPost)), ("viewsPerStory", ConstructorParameterDescription(self.viewsPerStory)), ("sharesPerStory", ConstructorParameterDescription(self.sharesPerStory)), ("reactionsPerStory", ConstructorParameterDescription(self.reactionsPerStory)), ("enabledNotifications", ConstructorParameterDescription(self.enabledNotifications)), ("growthGraph", ConstructorParameterDescription(self.growthGraph)), ("followersGraph", ConstructorParameterDescription(self.followersGraph)), ("muteGraph", ConstructorParameterDescription(self.muteGraph)), ("topHoursGraph", ConstructorParameterDescription(self.topHoursGraph)), ("interactionsGraph", ConstructorParameterDescription(self.interactionsGraph)), ("ivInteractionsGraph", ConstructorParameterDescription(self.ivInteractionsGraph)), ("viewsBySourceGraph", ConstructorParameterDescription(self.viewsBySourceGraph)), ("newFollowersBySourceGraph", ConstructorParameterDescription(self.newFollowersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(self.languagesGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.reactionsByEmotionGraph)), ("storyInteractionsGraph", ConstructorParameterDescription(self.storyInteractionsGraph)), ("storyReactionsByEmotionGraph", ConstructorParameterDescription(self.storyReactionsByEmotionGraph)), ("recentPostsInteractions", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .broadcastStats(let _data): - return ("broadcastStats", [("period", ConstructorParameterDescription(_data.period)), ("followers", ConstructorParameterDescription(_data.followers)), ("viewsPerPost", ConstructorParameterDescription(_data.viewsPerPost)), ("sharesPerPost", ConstructorParameterDescription(_data.sharesPerPost)), ("reactionsPerPost", ConstructorParameterDescription(_data.reactionsPerPost)), ("viewsPerStory", ConstructorParameterDescription(_data.viewsPerStory)), ("sharesPerStory", ConstructorParameterDescription(_data.sharesPerStory)), ("reactionsPerStory", ConstructorParameterDescription(_data.reactionsPerStory)), ("enabledNotifications", ConstructorParameterDescription(_data.enabledNotifications)), ("growthGraph", ConstructorParameterDescription(_data.growthGraph)), ("followersGraph", ConstructorParameterDescription(_data.followersGraph)), ("muteGraph", ConstructorParameterDescription(_data.muteGraph)), ("topHoursGraph", ConstructorParameterDescription(_data.topHoursGraph)), ("interactionsGraph", ConstructorParameterDescription(_data.interactionsGraph)), ("ivInteractionsGraph", ConstructorParameterDescription(_data.ivInteractionsGraph)), ("viewsBySourceGraph", ConstructorParameterDescription(_data.viewsBySourceGraph)), ("newFollowersBySourceGraph", ConstructorParameterDescription(_data.newFollowersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(_data.languagesGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph)), ("storyInteractionsGraph", ConstructorParameterDescription(_data.storyInteractionsGraph)), ("storyReactionsByEmotionGraph", ConstructorParameterDescription(_data.storyReactionsByEmotionGraph)), ("recentPostsInteractions", ConstructorParameterDescription(_data.recentPostsInteractions))]) - } - } - - public static func parse_broadcastStats(_ reader: BufferReader) -> BroadcastStats? { - var _1: Api.StatsDateRangeDays? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StatsDateRangeDays - } - var _2: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev - } - var _3: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev - } - var _4: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev - } - var _5: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev - } - var _6: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev - } - var _7: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev - } - var _8: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev - } - var _9: Api.StatsPercentValue? - if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.StatsPercentValue - } - var _10: Api.StatsGraph? - if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _11: Api.StatsGraph? - if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _12: Api.StatsGraph? - if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _13: Api.StatsGraph? - if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _14: Api.StatsGraph? - if let signature = reader.readInt32() { - _14 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _15: Api.StatsGraph? - if let signature = reader.readInt32() { - _15 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _16: Api.StatsGraph? - if let signature = reader.readInt32() { - _16 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _17: Api.StatsGraph? - if let signature = reader.readInt32() { - _17 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _18: Api.StatsGraph? - if let signature = reader.readInt32() { - _18 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _19: Api.StatsGraph? - if let signature = reader.readInt32() { - _19 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _20: Api.StatsGraph? - if let signature = reader.readInt32() { - _20 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _21: Api.StatsGraph? - if let signature = reader.readInt32() { - _21 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _22: [Api.PostInteractionCounters]? - if let _ = reader.readInt32() { - _22 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PostInteractionCounters.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = _9 != nil - let _c10 = _10 != nil - let _c11 = _11 != nil - let _c12 = _12 != nil - let _c13 = _13 != nil - let _c14 = _14 != nil - let _c15 = _15 != nil - let _c16 = _16 != nil - let _c17 = _17 != nil - let _c18 = _18 != nil - let _c19 = _19 != nil - let _c20 = _20 != nil - 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(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 { - public class Cons_megagroupStats: TypeConstructorDescription { - 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 extension Api.payments { + enum PaymentForm: TypeConstructorDescription { + public class Cons_paymentForm: TypeConstructorDescription { + 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(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 + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("megagroupStats", [("period", ConstructorParameterDescription(self.period)), ("members", ConstructorParameterDescription(self.members)), ("messages", ConstructorParameterDescription(self.messages)), ("viewers", ConstructorParameterDescription(self.viewers)), ("posters", ConstructorParameterDescription(self.posters)), ("growthGraph", ConstructorParameterDescription(self.growthGraph)), ("membersGraph", ConstructorParameterDescription(self.membersGraph)), ("newMembersBySourceGraph", ConstructorParameterDescription(self.newMembersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(self.languagesGraph)), ("messagesGraph", ConstructorParameterDescription(self.messagesGraph)), ("actionsGraph", ConstructorParameterDescription(self.actionsGraph)), ("topHoursGraph", ConstructorParameterDescription(self.topHoursGraph)), ("weekdaysGraph", ConstructorParameterDescription(self.weekdaysGraph)), ("topPosters", ConstructorParameterDescription(self.topPosters)), ("topAdmins", ConstructorParameterDescription(self.topAdmins)), ("topInviters", ConstructorParameterDescription(self.topInviters)), ("users", ConstructorParameterDescription(self.users))]) + return ("paymentForm", [("flags", ConstructorParameterDescription(self.flags)), ("formId", ConstructorParameterDescription(self.formId)), ("botId", ConstructorParameterDescription(self.botId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("providerId", ConstructorParameterDescription(self.providerId)), ("url", ConstructorParameterDescription(self.url)), ("nativeProvider", ConstructorParameterDescription(self.nativeProvider)), ("nativeParams", ConstructorParameterDescription(self.nativeParams)), ("additionalMethods", ConstructorParameterDescription(self.additionalMethods)), ("savedInfo", ConstructorParameterDescription(self.savedInfo)), ("savedCredentials", ConstructorParameterDescription(self.savedCredentials)), ("users", ConstructorParameterDescription(self.users))]) } } - case megagroupStats(Cons_megagroupStats) + public class Cons_paymentFormStarGift: TypeConstructorDescription { + public var formId: Int64 + public var invoice: Api.Invoice + public init(formId: Int64, invoice: Api.Invoice) { + self.formId = formId + self.invoice = invoice + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentFormStarGift", [("formId", ConstructorParameterDescription(self.formId)), ("invoice", ConstructorParameterDescription(self.invoice))]) + } + } + public class Cons_paymentFormStars: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentFormStars", [("flags", ConstructorParameterDescription(self.flags)), ("formId", ConstructorParameterDescription(self.formId)), ("botId", ConstructorParameterDescription(self.botId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case paymentForm(Cons_paymentForm) + case paymentFormStarGift(Cons_paymentFormStarGift) + case paymentFormStars(Cons_paymentFormStars) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .megagroupStats(let _data): + case .paymentForm(let _data): if boxed { - buffer.appendInt32(-276825834) + buffer.appendInt32(-1610250415) } - _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) + 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(_data.additionalMethods!.count)) + for item in _data.additionalMethods! { + item.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(_data.savedCredentials!.count)) + for item in _data.savedCredentials! { + item.serialize(buffer, true) + } } buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.topAdmins.count)) - for item in _data.topAdmins { + buffer.appendInt32(Int32(_data.users.count)) + for item in _data.users { item.serialize(buffer, true) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.topInviters.count)) - for item in _data.topInviters { - 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 { @@ -2117,79 +1441,339 @@ public extension Api.stats { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .megagroupStats(let _data): - return ("megagroupStats", [("period", ConstructorParameterDescription(_data.period)), ("members", ConstructorParameterDescription(_data.members)), ("messages", ConstructorParameterDescription(_data.messages)), ("viewers", ConstructorParameterDescription(_data.viewers)), ("posters", ConstructorParameterDescription(_data.posters)), ("growthGraph", ConstructorParameterDescription(_data.growthGraph)), ("membersGraph", ConstructorParameterDescription(_data.membersGraph)), ("newMembersBySourceGraph", ConstructorParameterDescription(_data.newMembersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(_data.languagesGraph)), ("messagesGraph", ConstructorParameterDescription(_data.messagesGraph)), ("actionsGraph", ConstructorParameterDescription(_data.actionsGraph)), ("topHoursGraph", ConstructorParameterDescription(_data.topHoursGraph)), ("weekdaysGraph", ConstructorParameterDescription(_data.weekdaysGraph)), ("topPosters", ConstructorParameterDescription(_data.topPosters)), ("topAdmins", ConstructorParameterDescription(_data.topAdmins)), ("topInviters", ConstructorParameterDescription(_data.topInviters)), ("users", ConstructorParameterDescription(_data.users))]) + case .paymentForm(let _data): + return ("paymentForm", [("flags", ConstructorParameterDescription(_data.flags)), ("formId", ConstructorParameterDescription(_data.formId)), ("botId", ConstructorParameterDescription(_data.botId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("providerId", ConstructorParameterDescription(_data.providerId)), ("url", ConstructorParameterDescription(_data.url)), ("nativeProvider", ConstructorParameterDescription(_data.nativeProvider)), ("nativeParams", ConstructorParameterDescription(_data.nativeParams)), ("additionalMethods", ConstructorParameterDescription(_data.additionalMethods)), ("savedInfo", ConstructorParameterDescription(_data.savedInfo)), ("savedCredentials", ConstructorParameterDescription(_data.savedCredentials)), ("users", ConstructorParameterDescription(_data.users))]) + case .paymentFormStarGift(let _data): + return ("paymentFormStarGift", [("formId", ConstructorParameterDescription(_data.formId)), ("invoice", ConstructorParameterDescription(_data.invoice))]) + case .paymentFormStars(let _data): + return ("paymentFormStars", [("flags", ConstructorParameterDescription(_data.flags)), ("formId", ConstructorParameterDescription(_data.formId)), ("botId", ConstructorParameterDescription(_data.botId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_megagroupStats(_ reader: BufferReader) -> MegagroupStats? { - var _1: Api.StatsDateRangeDays? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StatsDateRangeDays + public static func parse_paymentForm(_ reader: BufferReader) -> PaymentForm? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: Api.WebDocument? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WebDocument + } } - var _2: Api.StatsAbsValueAndPrev? + var _7: Api.Invoice? if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + _7 = Api.parse(reader, signature: signature) as? Api.Invoice } - var _3: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + var _8: Int64? + _8 = reader.readInt64() + var _9: String? + _9 = parseString(reader) + var _10: String? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _10 = parseString(reader) } - var _4: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + var _11: Api.DataJSON? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.DataJSON + } } - var _5: Api.StatsAbsValueAndPrev? - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + var _12: [Api.PaymentFormMethod]? + if Int(_1 ?? 0) & Int(1 << 6) != 0 { + if let _ = reader.readInt32() { + _12 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentFormMethod.self) + } } - var _6: Api.StatsGraph? - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.StatsGraph + var _13: Api.PaymentRequestedInfo? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } } - var _7: Api.StatsGraph? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.StatsGraph + var _14: [Api.PaymentSavedCredentials]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PaymentSavedCredentials.self) + } } - var _8: Api.StatsGraph? - if let signature = reader.readInt32() { - _8 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _9: Api.StatsGraph? - if let signature = reader.readInt32() { - _9 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _10: Api.StatsGraph? - if let signature = reader.readInt32() { - _10 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _11: Api.StatsGraph? - if let signature = reader.readInt32() { - _11 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _12: Api.StatsGraph? - if let signature = reader.readInt32() { - _12 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _13: Api.StatsGraph? - if let signature = reader.readInt32() { - _13 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _14: [Api.StatsGroupTopPoster]? + var _15: [Api.User]? if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StatsGroupTopPoster.self) + _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } - var _15: [Api.StatsGroupTopAdmin]? - if let _ = reader.readInt32() { - _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StatsGroupTopAdmin.self) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 6) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _13 != nil + let _c14 = (Int(_1 ?? 0) & 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(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!)) } - var _16: [Api.StatsGroupTopInviter]? - if let _ = reader.readInt32() { - _16 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StatsGroupTopInviter.self) + else { + return nil } - var _17: [Api.User]? + } + public static func parse_paymentFormStarGift(_ reader: BufferReader) -> PaymentForm? { + var _1: Int64? + _1 = reader.readInt64() + var _2: Api.Invoice? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Invoice + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.payments.PaymentForm.paymentFormStarGift(Cons_paymentFormStarGift(formId: _1!, invoice: _2!)) + } + else { + return nil + } + } + public static func parse_paymentFormStars(_ reader: BufferReader) -> PaymentForm? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int64? + _2 = reader.readInt64() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: Api.WebDocument? + if Int(_1 ?? 0) & 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 + } + var _8: [Api.User]? if let _ = reader.readInt32() { - _17 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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 + } + } + } +} +public extension Api.payments { + enum PaymentReceipt: TypeConstructorDescription { + public class Cons_paymentReceipt: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentReceipt", [("flags", ConstructorParameterDescription(self.flags)), ("date", ConstructorParameterDescription(self.date)), ("botId", ConstructorParameterDescription(self.botId)), ("providerId", ConstructorParameterDescription(self.providerId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("info", ConstructorParameterDescription(self.info)), ("shipping", ConstructorParameterDescription(self.shipping)), ("tipAmount", ConstructorParameterDescription(self.tipAmount)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("credentialsTitle", ConstructorParameterDescription(self.credentialsTitle)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_paymentReceiptStars: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentReceiptStars", [("flags", ConstructorParameterDescription(self.flags)), ("date", ConstructorParameterDescription(self.date)), ("botId", ConstructorParameterDescription(self.botId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("transactionId", ConstructorParameterDescription(self.transactionId)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .paymentReceipt(let _data): + return ("paymentReceipt", [("flags", ConstructorParameterDescription(_data.flags)), ("date", ConstructorParameterDescription(_data.date)), ("botId", ConstructorParameterDescription(_data.botId)), ("providerId", ConstructorParameterDescription(_data.providerId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("info", ConstructorParameterDescription(_data.info)), ("shipping", ConstructorParameterDescription(_data.shipping)), ("tipAmount", ConstructorParameterDescription(_data.tipAmount)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("credentialsTitle", ConstructorParameterDescription(_data.credentialsTitle)), ("users", ConstructorParameterDescription(_data.users))]) + case .paymentReceiptStars(let _data): + return ("paymentReceiptStars", [("flags", ConstructorParameterDescription(_data.flags)), ("date", ConstructorParameterDescription(_data.date)), ("botId", ConstructorParameterDescription(_data.botId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("transactionId", ConstructorParameterDescription(_data.transactionId)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_paymentReceipt(_ reader: BufferReader) -> PaymentReceipt? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: Int64? + _4 = reader.readInt64() + var _5: String? + _5 = parseString(reader) + var _6: String? + _6 = parseString(reader) + var _7: Api.WebDocument? + if Int(_1 ?? 0) & 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 ?? 0) & 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 ?? 0) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.ShippingOption + } + } + var _11: Int64? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _11 = reader.readInt64() + } + var _12: String? + _12 = parseString(reader) + var _13: Int64? + _13 = reader.readInt64() + var _14: String? + _14 = parseString(reader) + var _15: [Api.User]? + if let _ = reader.readInt32() { + _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil @@ -2197,19 +1781,66 @@ public extension Api.stats { let _c4 = _4 != nil let _c5 = _5 != nil let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil + let _c8 = _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _11 != nil + let _c12 = _12 != nil + let _c13 = _13 != nil + 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(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 + } + } + public static func parse_paymentReceiptStars(_ reader: BufferReader) -> PaymentReceipt? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int64? + _3 = reader.readInt64() + var _4: String? + _4 = parseString(reader) + var _5: String? + _5 = parseString(reader) + var _6: Api.WebDocument? + if Int(_1 ?? 0) & 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 + } + var _8: String? + _8 = parseString(reader) + var _9: Int64? + _9 = reader.readInt64() + var _10: String? + _10 = parseString(reader) + var _11: [Api.User]? + if let _ = reader.readInt32() { + _11 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _6 != nil let _c7 = _7 != nil let _c8 = _8 != nil let _c9 = _9 != nil let _c10 = _10 != nil let _c11 = _11 != nil - let _c12 = _12 != nil - let _c13 = _13 != nil - let _c14 = _14 != nil - let _c15 = _15 != nil - 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(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!)) + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 { + 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 @@ -2217,99 +1848,74 @@ public extension Api.stats { } } } -public extension Api.stats { - enum MessageStats: TypeConstructorDescription { - public class Cons_messageStats: TypeConstructorDescription { - public var viewsGraph: Api.StatsGraph - public var reactionsByEmotionGraph: Api.StatsGraph - public init(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) { - self.viewsGraph = viewsGraph - self.reactionsByEmotionGraph = reactionsByEmotionGraph +public extension Api.payments { + indirect enum PaymentResult: TypeConstructorDescription { + public class Cons_paymentResult: TypeConstructorDescription { + public var updates: Api.Updates + public init(updates: Api.Updates) { + self.updates = updates } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("messageStats", [("viewsGraph", ConstructorParameterDescription(self.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.reactionsByEmotionGraph))]) + return ("paymentResult", [("updates", ConstructorParameterDescription(self.updates))]) } } - case messageStats(Cons_messageStats) + public class Cons_paymentVerificationNeeded: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentVerificationNeeded", [("url", ConstructorParameterDescription(self.url))]) + } + } + case paymentResult(Cons_paymentResult) + case paymentVerificationNeeded(Cons_paymentVerificationNeeded) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .messageStats(let _data): + case .paymentResult(let _data): if boxed { - buffer.appendInt32(2145983508) + buffer.appendInt32(1314881805) } - _data.viewsGraph.serialize(buffer, true) - _data.reactionsByEmotionGraph.serialize(buffer, true) + _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, ConstructorParameterDescription)]) { switch self { - case .messageStats(let _data): - return ("messageStats", [("viewsGraph", ConstructorParameterDescription(_data.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph))]) + case .paymentResult(let _data): + return ("paymentResult", [("updates", ConstructorParameterDescription(_data.updates))]) + case .paymentVerificationNeeded(let _data): + return ("paymentVerificationNeeded", [("url", ConstructorParameterDescription(_data.url))]) } } - public static func parse_messageStats(_ reader: BufferReader) -> MessageStats? { - var _1: Api.StatsGraph? + public static func parse_paymentResult(_ reader: BufferReader) -> PaymentResult? { + var _1: Api.Updates? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _2: Api.StatsGraph? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.stats.MessageStats.messageStats(Cons_messageStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.stats { - enum PollStats: TypeConstructorDescription { - public class Cons_pollStats: TypeConstructorDescription { - public var votesGraph: Api.StatsGraph - public init(votesGraph: Api.StatsGraph) { - self.votesGraph = votesGraph - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("pollStats", [("votesGraph", ConstructorParameterDescription(self.votesGraph))]) - } - } - case pollStats(Cons_pollStats) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .pollStats(let _data): - if boxed { - buffer.appendInt32(697941741) - } - _data.votesGraph.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - switch self { - case .pollStats(let _data): - return ("pollStats", [("votesGraph", ConstructorParameterDescription(_data.votesGraph))]) - } - } - - public static func parse_pollStats(_ reader: BufferReader) -> PollStats? { - var _1: Api.StatsGraph? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StatsGraph + _1 = Api.parse(reader, signature: signature) as? Api.Updates } let _c1 = _1 != nil if _c1 { - return Api.stats.PollStats.pollStats(Cons_pollStats(votesGraph: _1!)) + return Api.payments.PaymentResult.paymentResult(Cons_paymentResult(updates: _1!)) + } + else { + return nil + } + } + public static func parse_paymentVerificationNeeded(_ reader: BufferReader) -> PaymentResult? { + var _1: String? + _1 = parseString(reader) + let _c1 = _1 != nil + if _c1 { + return Api.payments.PaymentResult.paymentVerificationNeeded(Cons_paymentVerificationNeeded(url: _1!)) } else { return nil @@ -2317,50 +1923,73 @@ public extension Api.stats { } } } -public extension Api.stats { - enum PublicForwards: TypeConstructorDescription { - public class Cons_publicForwards: TypeConstructorDescription { +public extension Api.payments { + enum ResaleStarGifts: TypeConstructorDescription { + public class Cons_resaleStarGifts: TypeConstructorDescription { public var flags: Int32 public var count: Int32 - public var forwards: [Api.PublicForward] + 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, forwards: [Api.PublicForward], nextOffset: String?, chats: [Api.Chat], 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.forwards = forwards + self.gifts = gifts self.nextOffset = nextOffset + self.attributes = attributes + self.attributesHash = attributesHash self.chats = chats + self.counters = counters self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("publicForwards", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("forwards", ConstructorParameterDescription(self.forwards)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("resaleStarGifts", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("gifts", ConstructorParameterDescription(self.gifts)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("attributes", ConstructorParameterDescription(self.attributes)), ("attributesHash", ConstructorParameterDescription(self.attributesHash)), ("chats", ConstructorParameterDescription(self.chats)), ("counters", ConstructorParameterDescription(self.counters)), ("users", ConstructorParameterDescription(self.users))]) } } - case publicForwards(Cons_publicForwards) + case resaleStarGifts(Cons_resaleStarGifts) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .publicForwards(let _data): + case .resaleStarGifts(let _data): if boxed { - buffer.appendInt32(-1828487648) + buffer.appendInt32(-1803939105) } 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 { + 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(_data.attributes!.count)) + for item in _data.attributes! { + item.serialize(buffer, true) + } + } + 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(_data.counters!.count)) + for item in _data.counters! { + item.serialize(buffer, true) + } + } buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.users.count)) for item in _data.users { @@ -2372,40 +2001,59 @@ public extension Api.stats { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .publicForwards(let _data): - return ("publicForwards", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .resaleStarGifts(let _data): + return ("resaleStarGifts", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("gifts", ConstructorParameterDescription(_data.gifts)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("attributes", ConstructorParameterDescription(_data.attributes)), ("attributesHash", ConstructorParameterDescription(_data.attributesHash)), ("chats", ConstructorParameterDescription(_data.chats)), ("counters", ConstructorParameterDescription(_data.counters)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_publicForwards(_ reader: BufferReader) -> PublicForwards? { + public static func parse_resaleStarGifts(_ reader: BufferReader) -> ResaleStarGifts? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() - var _3: [Api.PublicForward]? + var _3: [Api.StarGift]? if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PublicForward.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGift.self) } var _4: String? if Int(_1 ?? 0) & 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) + var _5: [Api.StarGiftAttribute]? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) + } } - var _6: [Api.User]? + var _6: Int64? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _6 = reader.readInt64() + } + var _7: [Api.Chat]? if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _8: [Api.StarGiftAttributeCounter]? + if Int(_1 ?? 0) & 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) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.stats.PublicForwards.publicForwards(Cons_publicForwards(flags: _1!, count: _2!, forwards: _3!, nextOffset: _4, chats: _5!, users: _6!)) + let _c5 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = _7 != nil + let _c8 = (Int(_1 ?? 0) & 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(Cons_resaleStarGifts(flags: _1!, count: _2!, gifts: _3!, nextOffset: _4, attributes: _5, attributesHash: _6, chats: _7!, counters: _8, users: _9!)) } else { return nil @@ -2413,53 +2061,55 @@ public extension Api.stats { } } } -public extension Api.stats { - enum StoryStats: TypeConstructorDescription { - public class Cons_storyStats: TypeConstructorDescription { - public var viewsGraph: Api.StatsGraph - public var reactionsByEmotionGraph: Api.StatsGraph - public init(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) { - self.viewsGraph = viewsGraph - self.reactionsByEmotionGraph = reactionsByEmotionGraph +public extension Api.payments { + enum SavedInfo: TypeConstructorDescription { + public class Cons_savedInfo: TypeConstructorDescription { + public var flags: Int32 + public var savedInfo: Api.PaymentRequestedInfo? + public init(flags: Int32, savedInfo: Api.PaymentRequestedInfo?) { + self.flags = flags + self.savedInfo = savedInfo } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyStats", [("viewsGraph", ConstructorParameterDescription(self.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.reactionsByEmotionGraph))]) + return ("savedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("savedInfo", ConstructorParameterDescription(self.savedInfo))]) } } - case storyStats(Cons_storyStats) + case savedInfo(Cons_savedInfo) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .storyStats(let _data): + case .savedInfo(let _data): if boxed { - buffer.appendInt32(1355613820) + buffer.appendInt32(-74456004) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.savedInfo!.serialize(buffer, true) } - _data.viewsGraph.serialize(buffer, true) - _data.reactionsByEmotionGraph.serialize(buffer, true) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .storyStats(let _data): - return ("storyStats", [("viewsGraph", ConstructorParameterDescription(_data.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph))]) + case .savedInfo(let _data): + return ("savedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("savedInfo", ConstructorParameterDescription(_data.savedInfo))]) } } - public static func parse_storyStats(_ reader: BufferReader) -> StoryStats? { - var _1: Api.StatsGraph? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.StatsGraph - } - var _2: Api.StatsGraph? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.StatsGraph + public static func parse_savedInfo(_ reader: BufferReader) -> SavedInfo? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.PaymentRequestedInfo? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.PaymentRequestedInfo + } } let _c1 = _1 != nil - let _c2 = _2 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil if _c1 && _c2 { - return Api.stats.StoryStats.storyStats(Cons_storyStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!)) + return Api.payments.SavedInfo.savedInfo(Cons_savedInfo(flags: _1!, savedInfo: _2)) } else { return nil @@ -2467,172 +2117,3 @@ public extension Api.stats { } } } -public extension Api.stickers { - enum SuggestedShortName: TypeConstructorDescription { - public class Cons_suggestedShortName: TypeConstructorDescription { - public var shortName: String - public init(shortName: String) { - self.shortName = shortName - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("suggestedShortName", [("shortName", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .suggestedShortName(let _data): - return ("suggestedShortName", [("shortName", ConstructorParameterDescription(_data.shortName))]) - } - } - - 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(Cons_suggestedShortName(shortName: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.storage { - enum FileType: TypeConstructorDescription { - case fileGif - case fileJpeg - case fileMov - case fileMp3 - case fileMp4 - case filePartial - case filePdf - 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, ConstructorParameterDescription)]) { - switch self { - case .fileGif: - return ("fileGif", []) - case .fileJpeg: - return ("fileJpeg", []) - case .fileMov: - return ("fileMov", []) - case .fileMp3: - return ("fileMp3", []) - case .fileMp4: - return ("fileMp4", []) - case .filePartial: - return ("filePartial", []) - case .filePdf: - return ("filePdf", []) - case .filePng: - return ("filePng", []) - case .fileUnknown: - return ("fileUnknown", []) - case .fileWebp: - return ("fileWebp", []) - } - } - - public static func parse_fileGif(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.fileGif - } - public static func parse_fileJpeg(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.fileJpeg - } - public static func parse_fileMov(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.fileMov - } - public static func parse_fileMp3(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.fileMp3 - } - public static func parse_fileMp4(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.fileMp4 - } - public static func parse_filePartial(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.filePartial - } - public static func parse_filePdf(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.filePdf - } - public static func parse_filePng(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.filePng - } - public static func parse_fileUnknown(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.fileUnknown - } - public static func parse_fileWebp(_ reader: BufferReader) -> FileType? { - return Api.storage.FileType.fileWebp - } - } -} diff --git a/submodules/TelegramApi/Sources/Api39.swift b/submodules/TelegramApi/Sources/Api39.swift index e7194b40ee..68cb43d755 100644 --- a/submodules/TelegramApi/Sources/Api39.swift +++ b/submodules/TelegramApi/Sources/Api39.swift @@ -1,291 +1,42 @@ -public extension Api.stories { - enum Albums: TypeConstructorDescription { - public class Cons_albums: TypeConstructorDescription { - public var hash: Int64 - public var albums: [Api.StoryAlbum] - public init(hash: Int64, albums: [Api.StoryAlbum]) { - self.hash = hash - self.albums = albums - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("albums", [("hash", ConstructorParameterDescription(self.hash)), ("albums", ConstructorParameterDescription(self.albums))]) - } - } - case albums(Cons_albums) - 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, ConstructorParameterDescription)]) { - switch self { - case .albums(let _data): - return ("albums", [("hash", ConstructorParameterDescription(_data.hash)), ("albums", ConstructorParameterDescription(_data.albums))]) - case .albumsNotModified: - return ("albumsNotModified", []) - } - } - - public static func parse_albums(_ reader: BufferReader) -> Albums? { - var _1: Int64? - _1 = reader.readInt64() - var _2: [Api.StoryAlbum]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryAlbum.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.stories.Albums.albums(Cons_albums(hash: _1!, albums: _2!)) - } - else { - return nil - } - } - public static func parse_albumsNotModified(_ reader: BufferReader) -> Albums? { - return Api.stories.Albums.albumsNotModified - } - } -} -public extension Api.stories { - enum AllStories: TypeConstructorDescription { - public class Cons_allStories: TypeConstructorDescription { +public extension Api.payments { + enum SavedStarGifts: TypeConstructorDescription { + public class Cons_savedStarGifts: TypeConstructorDescription { 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("allStories", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("state", ConstructorParameterDescription(self.state)), ("peerStories", ConstructorParameterDescription(self.peerStories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("stealthMode", ConstructorParameterDescription(self.stealthMode))]) - } - } - public class Cons_allStoriesNotModified: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("allStoriesNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("state", ConstructorParameterDescription(self.state)), ("stealthMode", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .allStories(let _data): - return ("allStories", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("state", ConstructorParameterDescription(_data.state)), ("peerStories", ConstructorParameterDescription(_data.peerStories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) - case .allStoriesNotModified(let _data): - return ("allStoriesNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("state", ConstructorParameterDescription(_data.state)), ("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) - } - } - - public static func parse_allStories(_ reader: BufferReader) -> AllStories? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - var _4: [Api.PeerStories]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerStories.self) - } - var _5: [Api.Chat]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _7: Api.StoriesStealthMode? - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.StoriesStealthMode - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.stories.AllStories.allStories(Cons_allStories(flags: _1!, count: _2!, state: _3!, peerStories: _4!, chats: _5!, users: _6!, stealthMode: _7!)) - } - else { - return nil - } - } - public static func parse_allStoriesNotModified(_ reader: BufferReader) -> AllStories? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Api.StoriesStealthMode? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.StoriesStealthMode - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.stories.AllStories.allStoriesNotModified(Cons_allStoriesNotModified(flags: _1!, state: _2!, stealthMode: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.stories { - enum CanSendStoryCount: TypeConstructorDescription { - public class Cons_canSendStoryCount: TypeConstructorDescription { - public var countRemains: Int32 - public init(countRemains: Int32) { - self.countRemains = countRemains - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("canSendStoryCount", [("countRemains", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .canSendStoryCount(let _data): - return ("canSendStoryCount", [("countRemains", ConstructorParameterDescription(_data.countRemains))]) - } - } - - 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(Cons_canSendStoryCount(countRemains: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.stories { - enum FoundStories: TypeConstructorDescription { - public class Cons_foundStories: TypeConstructorDescription { - public var flags: Int32 - public var count: Int32 - public var stories: [Api.FoundStory] + 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, stories: [Api.FoundStory], nextOffset: String?, chats: [Api.Chat], 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.stories = stories + self.chatNotificationsEnabled = chatNotificationsEnabled + self.gifts = gifts self.nextOffset = nextOffset self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("foundStories", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("stories", ConstructorParameterDescription(self.stories)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("savedStarGifts", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("chatNotificationsEnabled", ConstructorParameterDescription(self.chatNotificationsEnabled)), ("gifts", ConstructorParameterDescription(self.gifts)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case foundStories(Cons_foundStories) + case savedStarGifts(Cons_savedStarGifts) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .foundStories(let _data): + case .savedStarGifts(let _data): if boxed { - buffer.appendInt32(-488736969) + 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.stories.count)) - for item in _data.stories { + buffer.appendInt32(Int32(_data.gifts.count)) + for item in _data.gifts { item.serialize(buffer, true) } if Int(_data.flags) & Int(1 << 0) != 0 { @@ -307,647 +58,29 @@ public extension Api.stories { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .foundStories(let _data): - return ("foundStories", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("stories", ConstructorParameterDescription(_data.stories)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .savedStarGifts(let _data): + return ("savedStarGifts", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("chatNotificationsEnabled", ConstructorParameterDescription(_data.chatNotificationsEnabled)), ("gifts", ConstructorParameterDescription(_data.gifts)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_foundStories(_ reader: BufferReader) -> FoundStories? { + public static func parse_savedStarGifts(_ reader: BufferReader) -> SavedStarGifts? { var _1: Int32? _1 = reader.readInt32() var _2: Int32? _2 = reader.readInt32() - var _3: [Api.FoundStory]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FoundStory.self) - } - var _4: String? - if Int(_1 ?? 0) & 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) - } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.stories.FoundStories.foundStories(Cons_foundStories(flags: _1!, count: _2!, stories: _3!, nextOffset: _4, chats: _5!, users: _6!)) - } - else { - return nil - } - } - } -} -public extension Api.stories { - enum PeerStories: TypeConstructorDescription { - public class Cons_peerStories: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("peerStories", [("stories", ConstructorParameterDescription(self.stories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .peerStories(let _data): - return ("peerStories", [("stories", ConstructorParameterDescription(_data.stories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_peerStories(_ reader: BufferReader) -> PeerStories? { - var _1: Api.PeerStories? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.PeerStories - } - var _2: [Api.Chat]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _3: [Api.User]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.stories.PeerStories.peerStories(Cons_peerStories(stories: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} -public extension Api.stories { - enum Stories: TypeConstructorDescription { - public class Cons_stories: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("stories", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("stories", ConstructorParameterDescription(self.stories)), ("pinnedToTop", ConstructorParameterDescription(self.pinnedToTop)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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(_data.pinnedToTop!.count)) - for item in _data.pinnedToTop! { - 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, ConstructorParameterDescription)]) { - switch self { - case .stories(let _data): - return ("stories", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("stories", ConstructorParameterDescription(_data.stories)), ("pinnedToTop", ConstructorParameterDescription(_data.pinnedToTop)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_stories(_ reader: BufferReader) -> Stories? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.StoryItem]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryItem.self) - } - var _4: [Int32]? - if Int(_1 ?? 0) & 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) - } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_storyReactionsList: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyReactionsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("reactions", ConstructorParameterDescription(self.reactions)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .storyReactionsList(let _data): - return ("storyReactionsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) - } - } - - public static func parse_storyReactionsList(_ reader: BufferReader) -> StoryReactionsList? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: [Api.StoryReaction]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryReaction.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _6 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - 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 { - public class Cons_storyViews: TypeConstructorDescription { - public var views: [Api.StoryViews] - public var users: [Api.User] - public init(views: [Api.StoryViews], users: [Api.User]) { - self.views = views - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyViews", [("views", ConstructorParameterDescription(self.views)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .storyViews(let _data): - return ("storyViews", [("views", ConstructorParameterDescription(_data.views)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_storyViews(_ reader: BufferReader) -> StoryViews? { - var _1: [Api.StoryViews]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryViews.self) - } - var _2: [Api.User]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.stories.StoryViews.storyViews(Cons_storyViews(views: _1!, users: _2!)) - } - else { - return nil - } - } - } -} -public extension Api.stories { - enum StoryViewsList: TypeConstructorDescription { - public class Cons_storyViewsList: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("storyViewsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("viewsCount", ConstructorParameterDescription(self.viewsCount)), ("forwardsCount", ConstructorParameterDescription(self.forwardsCount)), ("reactionsCount", ConstructorParameterDescription(self.reactionsCount)), ("views", ConstructorParameterDescription(self.views)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .storyViewsList(let _data): - return ("storyViewsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("viewsCount", ConstructorParameterDescription(_data.viewsCount)), ("forwardsCount", ConstructorParameterDescription(_data.forwardsCount)), ("reactionsCount", ConstructorParameterDescription(_data.reactionsCount)), ("views", ConstructorParameterDescription(_data.views)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) - } - } - - public static func parse_storyViewsList(_ reader: BufferReader) -> StoryViewsList? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - var _6: [Api.StoryView]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryView.self) - } - var _7: [Api.Chat]? - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _8: [Api.User]? - if let _ = reader.readInt32() { - _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _9: String? - if Int(_1 ?? 0) & Int(1 << 0) != 0 { - _9 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = _7 != nil - let _c8 = _8 != nil - let _c9 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - 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 { - public class Cons_channelDifference: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("channelDifference", [("flags", ConstructorParameterDescription(self.flags)), ("pts", ConstructorParameterDescription(self.pts)), ("timeout", ConstructorParameterDescription(self.timeout)), ("newMessages", ConstructorParameterDescription(self.newMessages)), ("otherUpdates", ConstructorParameterDescription(self.otherUpdates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) - } - } - public class Cons_channelDifferenceEmpty: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("channelDifferenceEmpty", [("flags", ConstructorParameterDescription(self.flags)), ("pts", ConstructorParameterDescription(self.pts)), ("timeout", ConstructorParameterDescription(self.timeout))]) - } - } - public class Cons_channelDifferenceTooLong: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("channelDifferenceTooLong", [("flags", ConstructorParameterDescription(self.flags)), ("timeout", ConstructorParameterDescription(self.timeout)), ("dialog", ConstructorParameterDescription(self.dialog)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .channelDifference(let _data): - return ("channelDifference", [("flags", ConstructorParameterDescription(_data.flags)), ("pts", ConstructorParameterDescription(_data.pts)), ("timeout", ConstructorParameterDescription(_data.timeout)), ("newMessages", ConstructorParameterDescription(_data.newMessages)), ("otherUpdates", ConstructorParameterDescription(_data.otherUpdates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - case .channelDifferenceEmpty(let _data): - return ("channelDifferenceEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("pts", ConstructorParameterDescription(_data.pts)), ("timeout", ConstructorParameterDescription(_data.timeout))]) - case .channelDifferenceTooLong(let _data): - return ("channelDifferenceTooLong", [("flags", ConstructorParameterDescription(_data.flags)), ("timeout", ConstructorParameterDescription(_data.timeout)), ("dialog", ConstructorParameterDescription(_data.dialog)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) - } - } - - public static func parse_channelDifference(_ reader: BufferReader) -> ChannelDifference? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? + var _3: Api.Bool? if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } } - var _4: [Api.Message]? + var _4: [Api.SavedStarGift]? if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedStarGift.self) } - var _5: [Api.Update]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) + var _5: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _5 = parseString(reader) } var _6: [Api.Chat]? if let _ = reader.readInt32() { @@ -961,66 +94,886 @@ public extension Api.updates { let _c2 = _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil let _c4 = _4 != nil - let _c5 = _5 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil let _c6 = _6 != nil let _c7 = _7 != nil if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.updates.ChannelDifference.channelDifference(Cons_channelDifference(flags: _1!, pts: _2!, timeout: _3, newMessages: _4!, otherUpdates: _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 static func parse_channelDifferenceEmpty(_ reader: BufferReader) -> ChannelDifference? { + } +} +public extension Api.payments { + enum StarGiftActiveAuctions: TypeConstructorDescription { + public class Cons_starGiftActiveAuctions: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftActiveAuctions", [("auctions", ConstructorParameterDescription(self.auctions)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats))]) + } + } + case starGiftActiveAuctions(Cons_starGiftActiveAuctions) + 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, ConstructorParameterDescription)]) { + switch self { + case .starGiftActiveAuctions(let _data): + return ("starGiftActiveAuctions", [("auctions", ConstructorParameterDescription(_data.auctions)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) + case .starGiftActiveAuctionsNotModified: + return ("starGiftActiveAuctionsNotModified", []) + } + } + + public static func parse_starGiftActiveAuctions(_ reader: BufferReader) -> StarGiftActiveAuctions? { + var _1: [Api.StarGiftActiveAuctionState]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftActiveAuctionState.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.payments.StarGiftActiveAuctions.starGiftActiveAuctions(Cons_starGiftActiveAuctions(auctions: _1!, users: _2!, chats: _3!)) + } + else { + return nil + } + } + public static func parse_starGiftActiveAuctionsNotModified(_ reader: BufferReader) -> StarGiftActiveAuctions? { + return Api.payments.StarGiftActiveAuctions.starGiftActiveAuctionsNotModified + } + } +} +public extension Api.payments { + enum StarGiftAuctionAcquiredGifts: TypeConstructorDescription { + public class Cons_starGiftAuctionAcquiredGifts: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAuctionAcquiredGifts", [("gifts", ConstructorParameterDescription(self.gifts)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftAuctionAcquiredGifts(let _data): + return ("starGiftAuctionAcquiredGifts", [("gifts", ConstructorParameterDescription(_data.gifts)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) + } + } + + public static func parse_starGiftAuctionAcquiredGifts(_ reader: BufferReader) -> StarGiftAuctionAcquiredGifts? { + var _1: [Api.StarGiftAuctionAcquiredGift]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAuctionAcquiredGift.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.payments.StarGiftAuctionAcquiredGifts.starGiftAuctionAcquiredGifts(Cons_starGiftAuctionAcquiredGifts(gifts: _1!, users: _2!, chats: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum StarGiftAuctionState: TypeConstructorDescription { + public class Cons_starGiftAuctionState: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAuctionState", [("gift", ConstructorParameterDescription(self.gift)), ("state", ConstructorParameterDescription(self.state)), ("userState", ConstructorParameterDescription(self.userState)), ("timeout", ConstructorParameterDescription(self.timeout)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftAuctionState(let _data): + return ("starGiftAuctionState", [("gift", ConstructorParameterDescription(_data.gift)), ("state", ConstructorParameterDescription(_data.state)), ("userState", ConstructorParameterDescription(_data.userState)), ("timeout", ConstructorParameterDescription(_data.timeout)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) + } + } + + public static func parse_starGiftAuctionState(_ reader: BufferReader) -> StarGiftAuctionState? { + var _1: Api.StarGift? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StarGift + } + var _2: Api.StarGiftAuctionState? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionState + } + var _3: Api.StarGiftAuctionUserState? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StarGiftAuctionUserState + } + var _4: Int32? + _4 = reader.readInt32() + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: [Api.Chat]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_starGiftCollections: TypeConstructorDescription { + public var collections: [Api.StarGiftCollection] + public init(collections: [Api.StarGiftCollection]) { + self.collections = collections + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftCollections", [("collections", ConstructorParameterDescription(self.collections))]) + } + } + case starGiftCollections(Cons_starGiftCollections) + 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, ConstructorParameterDescription)]) { + switch self { + case .starGiftCollections(let _data): + return ("starGiftCollections", [("collections", ConstructorParameterDescription(_data.collections))]) + case .starGiftCollectionsNotModified: + return ("starGiftCollectionsNotModified", []) + } + } + + public static func parse_starGiftCollections(_ reader: BufferReader) -> StarGiftCollections? { + var _1: [Api.StarGiftCollection]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftCollection.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.payments.StarGiftCollections.starGiftCollections(Cons_starGiftCollections(collections: _1!)) + } + else { + return nil + } + } + public static func parse_starGiftCollectionsNotModified(_ reader: BufferReader) -> StarGiftCollections? { + return Api.payments.StarGiftCollections.starGiftCollectionsNotModified + } + } +} +public extension Api.payments { + enum StarGiftUpgradeAttributes: TypeConstructorDescription { + public class Cons_starGiftUpgradeAttributes: TypeConstructorDescription { + public var attributes: [Api.StarGiftAttribute] + public init(attributes: [Api.StarGiftAttribute]) { + self.attributes = attributes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftUpgradeAttributes", [("attributes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftUpgradeAttributes(let _data): + return ("starGiftUpgradeAttributes", [("attributes", ConstructorParameterDescription(_data.attributes))]) + } + } + + public static func parse_starGiftUpgradeAttributes(_ reader: BufferReader) -> StarGiftUpgradeAttributes? { + var _1: [Api.StarGiftAttribute]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.payments.StarGiftUpgradeAttributes.starGiftUpgradeAttributes(Cons_starGiftUpgradeAttributes(attributes: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum StarGiftUpgradePreview: TypeConstructorDescription { + public class Cons_starGiftUpgradePreview: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftUpgradePreview", [("sampleAttributes", ConstructorParameterDescription(self.sampleAttributes)), ("prices", ConstructorParameterDescription(self.prices)), ("nextPrices", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftUpgradePreview(let _data): + return ("starGiftUpgradePreview", [("sampleAttributes", ConstructorParameterDescription(_data.sampleAttributes)), ("prices", ConstructorParameterDescription(_data.prices)), ("nextPrices", ConstructorParameterDescription(_data.nextPrices))]) + } + } + + public static func parse_starGiftUpgradePreview(_ reader: BufferReader) -> StarGiftUpgradePreview? { + var _1: [Api.StarGiftAttribute]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftAttribute.self) + } + var _2: [Api.StarGiftUpgradePrice]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftUpgradePrice.self) + } + var _3: [Api.StarGiftUpgradePrice]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGiftUpgradePrice.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.payments.StarGiftUpgradePreview.starGiftUpgradePreview(Cons_starGiftUpgradePreview(sampleAttributes: _1!, prices: _2!, nextPrices: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum StarGiftWithdrawalUrl: TypeConstructorDescription { + public class Cons_starGiftWithdrawalUrl: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftWithdrawalUrl", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starGiftWithdrawalUrl(let _data): + return ("starGiftWithdrawalUrl", [("url", ConstructorParameterDescription(_data.url))]) + } + } + + 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(Cons_starGiftWithdrawalUrl(url: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum StarGifts: TypeConstructorDescription { + public class Cons_starGifts: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGifts", [("hash", ConstructorParameterDescription(self.hash)), ("gifts", ConstructorParameterDescription(self.gifts)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + case starGifts(Cons_starGifts) + 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, ConstructorParameterDescription)]) { + switch self { + case .starGifts(let _data): + return ("starGifts", [("hash", ConstructorParameterDescription(_data.hash)), ("gifts", ConstructorParameterDescription(_data.gifts)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .starGiftsNotModified: + return ("starGiftsNotModified", []) + } + } + + public static func parse_starGifts(_ reader: BufferReader) -> StarGifts? { var _1: Int32? _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? + var _2: [Api.StarGift]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarGift.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.payments.StarGifts.starGifts(Cons_starGifts(hash: _1!, gifts: _2!, chats: _3!, users: _4!)) + } + else { + return nil + } + } + public static func parse_starGiftsNotModified(_ reader: BufferReader) -> StarGifts? { + return Api.payments.StarGifts.starGiftsNotModified + } + } +} +public extension Api.payments { + enum StarsRevenueAdsAccountUrl: TypeConstructorDescription { + public class Cons_starsRevenueAdsAccountUrl: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsRevenueAdsAccountUrl", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsRevenueAdsAccountUrl(let _data): + return ("starsRevenueAdsAccountUrl", [("url", ConstructorParameterDescription(_data.url))]) + } + } + + 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(Cons_starsRevenueAdsAccountUrl(url: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum StarsRevenueStats: TypeConstructorDescription { + public class Cons_starsRevenueStats: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsRevenueStats", [("flags", ConstructorParameterDescription(self.flags)), ("topHoursGraph", ConstructorParameterDescription(self.topHoursGraph)), ("revenueGraph", ConstructorParameterDescription(self.revenueGraph)), ("status", ConstructorParameterDescription(self.status)), ("usdRate", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsRevenueStats(let _data): + return ("starsRevenueStats", [("flags", ConstructorParameterDescription(_data.flags)), ("topHoursGraph", ConstructorParameterDescription(_data.topHoursGraph)), ("revenueGraph", ConstructorParameterDescription(_data.revenueGraph)), ("status", ConstructorParameterDescription(_data.status)), ("usdRate", ConstructorParameterDescription(_data.usdRate))]) + } + } + + public static func parse_starsRevenueStats(_ reader: BufferReader) -> StarsRevenueStats? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StatsGraph? + if Int(_1 ?? 0) & 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 + } + var _4: Api.StarsRevenueStatus? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StarsRevenueStatus + } + var _5: Double? + _5 = reader.readDouble() + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_starsRevenueWithdrawalUrl: TypeConstructorDescription { + public var url: String + public init(url: String) { + self.url = url + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsRevenueWithdrawalUrl", [("url", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .starsRevenueWithdrawalUrl(let _data): + return ("starsRevenueWithdrawalUrl", [("url", ConstructorParameterDescription(_data.url))]) + } + } + + 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(Cons_starsRevenueWithdrawalUrl(url: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.payments { + enum StarsStatus: TypeConstructorDescription { + public class Cons_starsStatus: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsStatus", [("flags", ConstructorParameterDescription(self.flags)), ("balance", ConstructorParameterDescription(self.balance)), ("subscriptions", ConstructorParameterDescription(self.subscriptions)), ("subscriptionsNextOffset", ConstructorParameterDescription(self.subscriptionsNextOffset)), ("subscriptionsMissingBalance", ConstructorParameterDescription(self.subscriptionsMissingBalance)), ("history", ConstructorParameterDescription(self.history)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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(_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(_data.history!.count)) + for item in _data.history! { + 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, ConstructorParameterDescription)]) { + switch self { + case .starsStatus(let _data): + return ("starsStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("balance", ConstructorParameterDescription(_data.balance)), ("subscriptions", ConstructorParameterDescription(_data.subscriptions)), ("subscriptionsNextOffset", ConstructorParameterDescription(_data.subscriptionsNextOffset)), ("subscriptionsMissingBalance", ConstructorParameterDescription(_data.subscriptionsMissingBalance)), ("history", ConstructorParameterDescription(_data.history)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_starsStatus(_ reader: BufferReader) -> StarsStatus? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.StarsAmount? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + var _3: [Api.StarsSubscription]? if Int(_1 ?? 0) & Int(1 << 1) != 0 { - _3 = reader.readInt32() + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsSubscription.self) + } + } + var _4: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _4 = parseString(reader) + } + var _5: Int64? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _5 = reader.readInt64() + } + var _6: [Api.StarsTransaction]? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsTransaction.self) + } + } + var _7: String? + if Int(_1 ?? 0) & 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) + } + var _9: [Api.User]? + if let _ = reader.readInt32() { + _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.updates.ChannelDifference.channelDifferenceEmpty(Cons_channelDifferenceEmpty(flags: _1!, pts: _2!, timeout: _3)) - } - else { - return nil - } - } - public static func parse_channelDifferenceTooLong(_ reader: BufferReader) -> ChannelDifference? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1 ?? 0) & 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 - } - var _4: [Api.Message]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _5: [Api.Chat]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _6: [Api.User]? - if let _ = reader.readInt32() { - _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - let _c1 = _1 != nil - let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.updates.ChannelDifference.channelDifferenceTooLong(Cons_channelDifferenceTooLong(flags: _1!, timeout: _2, dialog: _3!, messages: _4!, chats: _5!, users: _6!)) + let _c4 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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 @@ -1028,673 +981,83 @@ public extension Api.updates { } } } -public extension Api.updates { - enum Difference: TypeConstructorDescription { - public class Cons_difference: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("difference", [("newMessages", ConstructorParameterDescription(self.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(self.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(self.otherUpdates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("state", ConstructorParameterDescription(self.state))]) - } - } - public class Cons_differenceEmpty: TypeConstructorDescription { - public var date: Int32 - public var seq: Int32 - public init(date: Int32, seq: Int32) { - self.date = date - self.seq = seq - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("differenceEmpty", [("date", ConstructorParameterDescription(self.date)), ("seq", ConstructorParameterDescription(self.seq))]) - } - } - public class Cons_differenceSlice: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("differenceSlice", [("newMessages", ConstructorParameterDescription(self.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(self.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(self.otherUpdates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("intermediateState", ConstructorParameterDescription(self.intermediateState))]) - } - } - public class Cons_differenceTooLong: TypeConstructorDescription { - public var pts: Int32 - public init(pts: Int32) { - self.pts = pts - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("differenceTooLong", [("pts", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .difference(let _data): - return ("difference", [("newMessages", ConstructorParameterDescription(_data.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(_data.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(_data.otherUpdates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("state", ConstructorParameterDescription(_data.state))]) - case .differenceEmpty(let _data): - return ("differenceEmpty", [("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq))]) - case .differenceSlice(let _data): - return ("differenceSlice", [("newMessages", ConstructorParameterDescription(_data.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(_data.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(_data.otherUpdates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("intermediateState", ConstructorParameterDescription(_data.intermediateState))]) - case .differenceTooLong(let _data): - return ("differenceTooLong", [("pts", ConstructorParameterDescription(_data.pts))]) - } - } - - public static func parse_difference(_ reader: BufferReader) -> Difference? { - var _1: [Api.Message]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _2: [Api.EncryptedMessage]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EncryptedMessage.self) - } - var _3: [Api.Update]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: Api.updates.State? - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.updates.State - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.updates.Difference.difference(Cons_difference(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, state: _6!)) - } - else { - return nil - } - } - public static func parse_differenceEmpty(_ reader: BufferReader) -> Difference? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.updates.Difference.differenceEmpty(Cons_differenceEmpty(date: _1!, seq: _2!)) - } - else { - return nil - } - } - public static func parse_differenceSlice(_ reader: BufferReader) -> Difference? { - var _1: [Api.Message]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) - } - var _2: [Api.EncryptedMessage]? - if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EncryptedMessage.self) - } - var _3: [Api.Update]? - if let _ = reader.readInt32() { - _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) - } - var _4: [Api.Chat]? - if let _ = reader.readInt32() { - _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) - } - var _5: [Api.User]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) - } - var _6: Api.updates.State? - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.updates.State - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.updates.Difference.differenceSlice(Cons_differenceSlice(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, intermediateState: _6!)) - } - else { - return nil - } - } - public static func parse_differenceTooLong(_ reader: BufferReader) -> Difference? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.updates.Difference.differenceTooLong(Cons_differenceTooLong(pts: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.updates { - enum State: TypeConstructorDescription { - public class Cons_state: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("state", [("pts", ConstructorParameterDescription(self.pts)), ("qts", ConstructorParameterDescription(self.qts)), ("date", ConstructorParameterDescription(self.date)), ("seq", ConstructorParameterDescription(self.seq)), ("unreadCount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .state(let _data): - return ("state", [("pts", ConstructorParameterDescription(_data.pts)), ("qts", ConstructorParameterDescription(_data.qts)), ("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount))]) - } - } - - public static func parse_state(_ reader: BufferReader) -> State? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - _4 = reader.readInt32() - var _5: Int32? - _5 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_cdnFile: TypeConstructorDescription { - public var bytes: Buffer - public init(bytes: Buffer) { - self.bytes = bytes - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("cdnFile", [("bytes", ConstructorParameterDescription(self.bytes))]) - } - } - public class Cons_cdnFileReuploadNeeded: TypeConstructorDescription { - public var requestToken: Buffer - public init(requestToken: Buffer) { - self.requestToken = requestToken - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("cdnFileReuploadNeeded", [("requestToken", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .cdnFile(let _data): - return ("cdnFile", [("bytes", ConstructorParameterDescription(_data.bytes))]) - case .cdnFileReuploadNeeded(let _data): - return ("cdnFileReuploadNeeded", [("requestToken", ConstructorParameterDescription(_data.requestToken))]) - } - } - - 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(Cons_cdnFile(bytes: _1!)) - } - else { - return nil - } - } - public static func parse_cdnFileReuploadNeeded(_ reader: BufferReader) -> CdnFile? { - var _1: Buffer? - _1 = parseBytes(reader) - let _c1 = _1 != nil - if _c1 { - return Api.upload.CdnFile.cdnFileReuploadNeeded(Cons_cdnFileReuploadNeeded(requestToken: _1!)) - } - else { - return nil - } - } - } -} -public extension Api.upload { - enum File: TypeConstructorDescription { - public class Cons_file: TypeConstructorDescription { - 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("file", [("type", ConstructorParameterDescription(self.type)), ("mtime", ConstructorParameterDescription(self.mtime)), ("bytes", ConstructorParameterDescription(self.bytes))]) - } - } - public class Cons_fileCdnRedirect: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("fileCdnRedirect", [("dcId", ConstructorParameterDescription(self.dcId)), ("fileToken", ConstructorParameterDescription(self.fileToken)), ("encryptionKey", ConstructorParameterDescription(self.encryptionKey)), ("encryptionIv", ConstructorParameterDescription(self.encryptionIv)), ("fileHashes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .file(let _data): - return ("file", [("type", ConstructorParameterDescription(_data.type)), ("mtime", ConstructorParameterDescription(_data.mtime)), ("bytes", ConstructorParameterDescription(_data.bytes))]) - case .fileCdnRedirect(let _data): - return ("fileCdnRedirect", [("dcId", ConstructorParameterDescription(_data.dcId)), ("fileToken", ConstructorParameterDescription(_data.fileToken)), ("encryptionKey", ConstructorParameterDescription(_data.encryptionKey)), ("encryptionIv", ConstructorParameterDescription(_data.encryptionIv)), ("fileHashes", ConstructorParameterDescription(_data.fileHashes))]) - } - } - - public static func parse_file(_ reader: BufferReader) -> File? { - var _1: Api.storage.FileType? - if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.storage.FileType - } - var _2: Int32? - _2 = reader.readInt32() - var _3: Buffer? - _3 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - if _c1 && _c2 && _c3 { - return Api.upload.File.file(Cons_file(type: _1!, mtime: _2!, bytes: _3!)) - } - else { - return nil - } - } - public static func parse_fileCdnRedirect(_ reader: BufferReader) -> File? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Buffer? - _2 = parseBytes(reader) - var _3: Buffer? - _3 = parseBytes(reader) - var _4: Buffer? - _4 = parseBytes(reader) - var _5: [Api.FileHash]? - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_webFile: TypeConstructorDescription { - 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 - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("webFile", [("size", ConstructorParameterDescription(self.size)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("fileType", ConstructorParameterDescription(self.fileType)), ("mtime", ConstructorParameterDescription(self.mtime)), ("bytes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { - switch self { - case .webFile(let _data): - return ("webFile", [("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("fileType", ConstructorParameterDescription(_data.fileType)), ("mtime", ConstructorParameterDescription(_data.mtime)), ("bytes", ConstructorParameterDescription(_data.bytes))]) - } - } - - public static func parse_webFile(_ reader: BufferReader) -> WebFile? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - _2 = parseString(reader) - var _3: Api.storage.FileType? - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.storage.FileType - } - var _4: Int32? - _4 = reader.readInt32() - var _5: Buffer? - _5 = parseBytes(reader) - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - 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 { - public class Cons_savedMusic: TypeConstructorDescription { +public extension Api.payments { + enum SuggestedStarRefBots: TypeConstructorDescription { + public class Cons_suggestedStarRefBots: TypeConstructorDescription { + public var flags: Int32 public var count: Int32 - public var documents: [Api.Document] - public init(count: Int32, documents: [Api.Document]) { + 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.documents = documents + self.suggestedBots = suggestedBots + self.users = users + self.nextOffset = nextOffset } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedMusic", [("count", ConstructorParameterDescription(self.count)), ("documents", ConstructorParameterDescription(self.documents))]) + return ("suggestedStarRefBots", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("suggestedBots", ConstructorParameterDescription(self.suggestedBots)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) } } - public class Cons_savedMusicNotModified: TypeConstructorDescription { - public var count: Int32 - public init(count: Int32) { - self.count = count - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("savedMusicNotModified", [("count", ConstructorParameterDescription(self.count))]) - } - } - case savedMusic(Cons_savedMusic) - case savedMusicNotModified(Cons_savedMusicNotModified) + case suggestedStarRefBots(Cons_suggestedStarRefBots) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .savedMusic(let _data): + case .suggestedStarRefBots(let _data): if boxed { - buffer.appendInt32(883094167) + buffer.appendInt32(-1261053863) } + serializeInt32(_data.flags, buffer: buffer, boxed: false) serializeInt32(_data.count, buffer: buffer, boxed: false) buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.documents.count)) - for item in _data.documents { + buffer.appendInt32(Int32(_data.suggestedBots.count)) + for item in _data.suggestedBots { item.serialize(buffer, true) } - break - case .savedMusicNotModified(let _data): - if boxed { - buffer.appendInt32(-477656412) + 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) } - serializeInt32(_data.count, buffer: buffer, boxed: false) break } } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .savedMusic(let _data): - return ("savedMusic", [("count", ConstructorParameterDescription(_data.count)), ("documents", ConstructorParameterDescription(_data.documents))]) - case .savedMusicNotModified(let _data): - return ("savedMusicNotModified", [("count", ConstructorParameterDescription(_data.count))]) + case .suggestedStarRefBots(let _data): + return ("suggestedStarRefBots", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("suggestedBots", ConstructorParameterDescription(_data.suggestedBots)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) } } - public static func parse_savedMusic(_ reader: BufferReader) -> SavedMusic? { + public static func parse_suggestedStarRefBots(_ reader: BufferReader) -> SuggestedStarRefBots? { var _1: Int32? _1 = reader.readInt32() - var _2: [Api.Document]? + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.StarRefProgram]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarRefProgram.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _5 = parseString(reader) } let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.users.SavedMusic.savedMusic(Cons_savedMusic(count: _1!, documents: _2!)) - } - else { - return nil - } - } - public static func parse_savedMusicNotModified(_ reader: BufferReader) -> SavedMusic? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.users.SavedMusic.savedMusicNotModified(Cons_savedMusicNotModified(count: _1!)) + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.payments.SuggestedStarRefBots.suggestedStarRefBots(Cons_suggestedStarRefBots(flags: _1!, count: _2!, suggestedBots: _3!, users: _4!, nextOffset: _5)) } else { return nil @@ -1702,30 +1065,30 @@ public extension Api.users { } } } -public extension Api.users { - enum UserFull: TypeConstructorDescription { - public class Cons_userFull: TypeConstructorDescription { - public var fullUser: Api.UserFull +public extension Api.payments { + enum UniqueStarGift: TypeConstructorDescription { + public class Cons_uniqueStarGift: TypeConstructorDescription { + public var gift: Api.StarGift public var chats: [Api.Chat] public var users: [Api.User] - public init(fullUser: Api.UserFull, chats: [Api.Chat], users: [Api.User]) { - self.fullUser = fullUser + public init(gift: Api.StarGift, chats: [Api.Chat], users: [Api.User]) { + self.gift = gift self.chats = chats self.users = users } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("userFull", [("fullUser", ConstructorParameterDescription(self.fullUser)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + return ("uniqueStarGift", [("gift", ConstructorParameterDescription(self.gift)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } - case userFull(Cons_userFull) + case uniqueStarGift(Cons_uniqueStarGift) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .userFull(let _data): + case .uniqueStarGift(let _data): if boxed { - buffer.appendInt32(997004590) + buffer.appendInt32(1097619176) } - _data.fullUser.serialize(buffer, true) + _data.gift.serialize(buffer, true) buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.chats.count)) for item in _data.chats { @@ -1742,15 +1105,15 @@ public extension Api.users { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .userFull(let _data): - return ("userFull", [("fullUser", ConstructorParameterDescription(_data.fullUser)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .uniqueStarGift(let _data): + return ("uniqueStarGift", [("gift", ConstructorParameterDescription(_data.gift)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_userFull(_ reader: BufferReader) -> UserFull? { - var _1: Api.UserFull? + public static func parse_uniqueStarGift(_ reader: BufferReader) -> UniqueStarGift? { + var _1: Api.StarGift? if let signature = reader.readInt32() { - _1 = Api.parse(reader, signature: signature) as? Api.UserFull + _1 = Api.parse(reader, signature: signature) as? Api.StarGift } var _2: [Api.Chat]? if let _ = reader.readInt32() { @@ -1764,7 +1127,7 @@ public extension Api.users { let _c2 = _2 != nil let _c3 = _3 != nil if _c1 && _c2 && _c3 { - return Api.users.UserFull.userFull(Cons_userFull(fullUser: _1!, chats: _2!, users: _3!)) + return Api.payments.UniqueStarGift.uniqueStarGift(Cons_uniqueStarGift(gift: _1!, chats: _2!, users: _3!)) } else { return nil @@ -1772,48 +1135,303 @@ public extension Api.users { } } } -public extension Api.users { - enum Users: TypeConstructorDescription { - public class Cons_users: TypeConstructorDescription { - public var users: [Api.User] - public init(users: [Api.User]) { - self.users = users +public extension Api.payments { + enum UniqueStarGiftValueInfo: TypeConstructorDescription { + public class Cons_uniqueStarGiftValueInfo: TypeConstructorDescription { + 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 } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("users", [("users", ConstructorParameterDescription(self.users))]) + return ("uniqueStarGiftValueInfo", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("value", ConstructorParameterDescription(self.value)), ("initialSaleDate", ConstructorParameterDescription(self.initialSaleDate)), ("initialSaleStars", ConstructorParameterDescription(self.initialSaleStars)), ("initialSalePrice", ConstructorParameterDescription(self.initialSalePrice)), ("lastSaleDate", ConstructorParameterDescription(self.lastSaleDate)), ("lastSalePrice", ConstructorParameterDescription(self.lastSalePrice)), ("floorPrice", ConstructorParameterDescription(self.floorPrice)), ("averagePrice", ConstructorParameterDescription(self.averagePrice)), ("listedCount", ConstructorParameterDescription(self.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(self.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(self.fragmentListedUrl))]) } } - public class Cons_usersSlice: TypeConstructorDescription { - public var count: Int32 - public var users: [Api.User] - public init(count: Int32, users: [Api.User]) { - self.count = count - self.users = users - } - public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("usersSlice", [("count", ConstructorParameterDescription(self.count)), ("users", ConstructorParameterDescription(self.users))]) - } - } - case users(Cons_users) - case usersSlice(Cons_usersSlice) + case uniqueStarGiftValueInfo(Cons_uniqueStarGiftValueInfo) public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { switch self { - case .users(let _data): + case .uniqueStarGiftValueInfo(let _data): if boxed { - buffer.appendInt32(1658259128) + buffer.appendInt32(1362093126) } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) + 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 - case .usersSlice(let _data): + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .uniqueStarGiftValueInfo(let _data): + return ("uniqueStarGiftValueInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("value", ConstructorParameterDescription(_data.value)), ("initialSaleDate", ConstructorParameterDescription(_data.initialSaleDate)), ("initialSaleStars", ConstructorParameterDescription(_data.initialSaleStars)), ("initialSalePrice", ConstructorParameterDescription(_data.initialSalePrice)), ("lastSaleDate", ConstructorParameterDescription(_data.lastSaleDate)), ("lastSalePrice", ConstructorParameterDescription(_data.lastSalePrice)), ("floorPrice", ConstructorParameterDescription(_data.floorPrice)), ("averagePrice", ConstructorParameterDescription(_data.averagePrice)), ("listedCount", ConstructorParameterDescription(_data.listedCount)), ("fragmentListedCount", ConstructorParameterDescription(_data.fragmentListedCount)), ("fragmentListedUrl", ConstructorParameterDescription(_data.fragmentListedUrl))]) + } + } + + public static func parse_uniqueStarGiftValueInfo(_ reader: BufferReader) -> UniqueStarGiftValueInfo? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Int64? + _3 = reader.readInt64() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int64? + _5 = reader.readInt64() + var _6: Int64? + _6 = reader.readInt64() + var _7: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _7 = reader.readInt32() + } + var _8: Int64? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _8 = reader.readInt64() + } + var _9: Int64? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _9 = reader.readInt64() + } + var _10: Int64? + if Int(_1 ?? 0) & Int(1 << 3) != 0 { + _10 = reader.readInt64() + } + var _11: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _11 = reader.readInt32() + } + var _12: Int32? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _12 = reader.readInt32() + } + var _13: String? + if Int(_1 ?? 0) & Int(1 << 5) != 0 { + _13 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _7 != nil + let _c8 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _10 != nil + let _c11 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _11 != nil + let _c12 = (Int(_1 ?? 0) & Int(1 << 5) == 0) || _12 != nil + let _c13 = (Int(_1 ?? 0) & 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(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 { + public class Cons_validatedRequestedInfo: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("validatedRequestedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("shippingOptions", ConstructorParameterDescription(self.shippingOptions))]) + } + } + case validatedRequestedInfo(Cons_validatedRequestedInfo) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .validatedRequestedInfo(let _data): if boxed { - buffer.appendInt32(828000628) + 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, ConstructorParameterDescription)]) { + switch self { + case .validatedRequestedInfo(let _data): + return ("validatedRequestedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("shippingOptions", ConstructorParameterDescription(_data.shippingOptions))]) + } + } + + public static func parse_validatedRequestedInfo(_ reader: BufferReader) -> ValidatedRequestedInfo? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _2 = parseString(reader) + } + var _3: [Api.ShippingOption]? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.payments.ValidatedRequestedInfo.validatedRequestedInfo(Cons_validatedRequestedInfo(flags: _1!, id: _2, shippingOptions: _3)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum ExportedGroupCallInvite: TypeConstructorDescription { + public class Cons_exportedGroupCallInvite: TypeConstructorDescription { + public var link: String + public init(link: String) { + self.link = link + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedGroupCallInvite", [("link", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .exportedGroupCallInvite(let _data): + return ("exportedGroupCallInvite", [("link", ConstructorParameterDescription(_data.link))]) + } + } + + 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(Cons_exportedGroupCallInvite(link: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum GroupCall: TypeConstructorDescription { + public class Cons_groupCall: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCall", [("call", ConstructorParameterDescription(self.call)), ("participants", ConstructorParameterDescription(self.participants)), ("participantsNextOffset", ConstructorParameterDescription(self.participantsNextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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) } - serializeInt32(_data.count, buffer: buffer, boxed: false) buffer.appendInt32(481674261) buffer.appendInt32(Int32(_data.users.count)) for item in _data.users { @@ -1825,37 +1443,698 @@ public extension Api.users { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .users(let _data): - return ("users", [("users", ConstructorParameterDescription(_data.users))]) - case .usersSlice(let _data): - return ("usersSlice", [("count", ConstructorParameterDescription(_data.count)), ("users", ConstructorParameterDescription(_data.users))]) + case .groupCall(let _data): + return ("groupCall", [("call", ConstructorParameterDescription(_data.call)), ("participants", ConstructorParameterDescription(_data.participants)), ("participantsNextOffset", ConstructorParameterDescription(_data.participantsNextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } - public static func parse_users(_ reader: BufferReader) -> Users? { - var _1: [Api.User]? + public static func parse_groupCall(_ reader: BufferReader) -> GroupCall? { + var _1: Api.GroupCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.GroupCall + } + var _2: [Api.GroupCallParticipant]? if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) } - let _c1 = _1 != nil - if _c1 { - return Api.users.Users.users(Cons_users(users: _1!)) - } - else { - return nil - } - } - public static func parse_usersSlice(_ reader: BufferReader) -> Users? { - var _1: Int32? - _1 = reader.readInt32() - var _2: [Api.User]? + var _3: String? + _3 = parseString(reader) + var _4: [Api.Chat]? if let _ = reader.readInt32() { - _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } let _c1 = _1 != nil let _c2 = _2 != nil - if _c1 && _c2 { - return Api.users.Users.usersSlice(Cons_usersSlice(count: _1!, users: _2!)) + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_groupCallStars: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallStars", [("totalStars", ConstructorParameterDescription(self.totalStars)), ("topDonors", ConstructorParameterDescription(self.topDonors)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .groupCallStars(let _data): + return ("groupCallStars", [("totalStars", ConstructorParameterDescription(_data.totalStars)), ("topDonors", ConstructorParameterDescription(_data.topDonors)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_groupCallStars(_ reader: BufferReader) -> GroupCallStars? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.GroupCallDonor]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallDonor.self) + } + var _3: [Api.Chat]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _4: [Api.User]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + if _c1 && _c2 && _c3 && _c4 { + 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 { + public class Cons_groupCallStreamChannels: TypeConstructorDescription { + public var channels: [Api.GroupCallStreamChannel] + public init(channels: [Api.GroupCallStreamChannel]) { + self.channels = channels + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallStreamChannels", [("channels", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .groupCallStreamChannels(let _data): + return ("groupCallStreamChannels", [("channels", ConstructorParameterDescription(_data.channels))]) + } + } + + public static func parse_groupCallStreamChannels(_ reader: BufferReader) -> GroupCallStreamChannels? { + var _1: [Api.GroupCallStreamChannel]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallStreamChannel.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.phone.GroupCallStreamChannels.groupCallStreamChannels(Cons_groupCallStreamChannels(channels: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum GroupCallStreamRtmpUrl: TypeConstructorDescription { + public class Cons_groupCallStreamRtmpUrl: TypeConstructorDescription { + public var url: String + public var key: String + public init(url: String, key: String) { + self.url = url + self.key = key + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallStreamRtmpUrl", [("url", ConstructorParameterDescription(self.url)), ("key", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .groupCallStreamRtmpUrl(let _data): + return ("groupCallStreamRtmpUrl", [("url", ConstructorParameterDescription(_data.url)), ("key", ConstructorParameterDescription(_data.key))]) + } + } + + public static func parse_groupCallStreamRtmpUrl(_ reader: BufferReader) -> GroupCallStreamRtmpUrl? { + var _1: String? + _1 = parseString(reader) + var _2: String? + _2 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.phone.GroupCallStreamRtmpUrl.groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl(url: _1!, key: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum GroupParticipants: TypeConstructorDescription { + public class Cons_groupParticipants: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupParticipants", [("count", ConstructorParameterDescription(self.count)), ("participants", ConstructorParameterDescription(self.participants)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("version", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .groupParticipants(let _data): + return ("groupParticipants", [("count", ConstructorParameterDescription(_data.count)), ("participants", ConstructorParameterDescription(_data.participants)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("version", ConstructorParameterDescription(_data.version))]) + } + } + + public static func parse_groupParticipants(_ reader: BufferReader) -> GroupParticipants? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.GroupCallParticipant]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipant.self) + } + var _3: String? + _3 = parseString(reader) + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: Int32? + _6 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.phone.GroupParticipants.groupParticipants(Cons_groupParticipants(count: _1!, participants: _2!, nextOffset: _3!, chats: _4!, users: _5!, version: _6!)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum JoinAsPeers: TypeConstructorDescription { + public class Cons_joinAsPeers: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("joinAsPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .joinAsPeers(let _data): + return ("joinAsPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_joinAsPeers(_ reader: BufferReader) -> JoinAsPeers? { + var _1: [Api.Peer]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.phone.JoinAsPeers.joinAsPeers(Cons_joinAsPeers(peers: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.phone { + enum PhoneCall: TypeConstructorDescription { + public class Cons_phoneCall: TypeConstructorDescription { + public var phoneCall: Api.PhoneCall + public var users: [Api.User] + public init(phoneCall: Api.PhoneCall, users: [Api.User]) { + self.phoneCall = phoneCall + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCall", [("phoneCall", ConstructorParameterDescription(self.phoneCall)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .phoneCall(let _data): + return ("phoneCall", [("phoneCall", ConstructorParameterDescription(_data.phoneCall)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { + var _1: Api.PhoneCall? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.PhoneCall + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.phone.PhoneCall.phoneCall(Cons_phoneCall(phoneCall: _1!, users: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.photos { + enum Photo: TypeConstructorDescription { + public class Cons_photo: TypeConstructorDescription { + public var photo: Api.Photo + public var users: [Api.User] + public init(photo: Api.Photo, users: [Api.User]) { + self.photo = photo + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photo", [("photo", ConstructorParameterDescription(self.photo)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .photo(let _data): + return ("photo", [("photo", ConstructorParameterDescription(_data.photo)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_photo(_ reader: BufferReader) -> Photo? { + var _1: Api.Photo? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.Photo + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.photos.Photo.photo(Cons_photo(photo: _1!, users: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.photos { + enum Photos: TypeConstructorDescription { + public class Cons_photos: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photos", [("photos", ConstructorParameterDescription(self.photos)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_photosSlice: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photosSlice", [("count", ConstructorParameterDescription(self.count)), ("photos", ConstructorParameterDescription(self.photos)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .photos(let _data): + return ("photos", [("photos", ConstructorParameterDescription(_data.photos)), ("users", ConstructorParameterDescription(_data.users))]) + case .photosSlice(let _data): + return ("photosSlice", [("count", ConstructorParameterDescription(_data.count)), ("photos", ConstructorParameterDescription(_data.photos)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_photos(_ reader: BufferReader) -> Photos? { + var _1: [Api.Photo]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self) + } + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.photos.Photos.photos(Cons_photos(photos: _1!, users: _2!)) + } + else { + return nil + } + } + public static func parse_photosSlice(_ reader: BufferReader) -> Photos? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Photo]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Photo.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.photos.Photos.photosSlice(Cons_photosSlice(count: _1!, photos: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.premium { + enum BoostsList: TypeConstructorDescription { + public class Cons_boostsList: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("boostsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("boosts", ConstructorParameterDescription(self.boosts)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .boostsList(let _data): + return ("boostsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("boosts", ConstructorParameterDescription(_data.boosts)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_boostsList(_ reader: BufferReader) -> BoostsList? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.Boost]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Boost.self) + } + var _4: String? + if Int(_1 ?? 0) & 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) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.premium.BoostsList.boostsList(Cons_boostsList(flags: _1!, count: _2!, boosts: _3!, nextOffset: _4, users: _5!)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api4.swift b/submodules/TelegramApi/Sources/Api4.swift index c6f42117da..340a6ebf9d 100644 --- a/submodules/TelegramApi/Sources/Api4.swift +++ b/submodules/TelegramApi/Sources/Api4.swift @@ -1450,7 +1450,8 @@ public extension Api { 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?) { + public var guardBotId: Int64? + 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?, guardBotId: Int64?) { self.flags = flags self.flags2 = flags2 self.id = id @@ -1498,9 +1499,10 @@ public extension Api { self.stargiftsCount = stargiftsCount self.sendPaidMessagesStars = sendPaidMessagesStars self.mainTab = mainTab + self.guardBotId = guardBotId } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("channelFull", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("about", ConstructorParameterDescription(self.about)), ("participantsCount", ConstructorParameterDescription(self.participantsCount)), ("adminsCount", ConstructorParameterDescription(self.adminsCount)), ("kickedCount", ConstructorParameterDescription(self.kickedCount)), ("bannedCount", ConstructorParameterDescription(self.bannedCount)), ("onlineCount", ConstructorParameterDescription(self.onlineCount)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("chatPhoto", ConstructorParameterDescription(self.chatPhoto)), ("notifySettings", ConstructorParameterDescription(self.notifySettings)), ("exportedInvite", ConstructorParameterDescription(self.exportedInvite)), ("botInfo", ConstructorParameterDescription(self.botInfo)), ("migratedFromChatId", ConstructorParameterDescription(self.migratedFromChatId)), ("migratedFromMaxId", ConstructorParameterDescription(self.migratedFromMaxId)), ("pinnedMsgId", ConstructorParameterDescription(self.pinnedMsgId)), ("stickerset", ConstructorParameterDescription(self.stickerset)), ("availableMinId", ConstructorParameterDescription(self.availableMinId)), ("folderId", ConstructorParameterDescription(self.folderId)), ("linkedChatId", ConstructorParameterDescription(self.linkedChatId)), ("location", ConstructorParameterDescription(self.location)), ("slowmodeSeconds", ConstructorParameterDescription(self.slowmodeSeconds)), ("slowmodeNextSendDate", ConstructorParameterDescription(self.slowmodeNextSendDate)), ("statsDc", ConstructorParameterDescription(self.statsDc)), ("pts", ConstructorParameterDescription(self.pts)), ("call", ConstructorParameterDescription(self.call)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod)), ("pendingSuggestions", ConstructorParameterDescription(self.pendingSuggestions)), ("groupcallDefaultJoinAs", ConstructorParameterDescription(self.groupcallDefaultJoinAs)), ("themeEmoticon", ConstructorParameterDescription(self.themeEmoticon)), ("requestsPending", ConstructorParameterDescription(self.requestsPending)), ("recentRequesters", ConstructorParameterDescription(self.recentRequesters)), ("defaultSendAs", ConstructorParameterDescription(self.defaultSendAs)), ("availableReactions", ConstructorParameterDescription(self.availableReactions)), ("reactionsLimit", ConstructorParameterDescription(self.reactionsLimit)), ("stories", ConstructorParameterDescription(self.stories)), ("wallpaper", ConstructorParameterDescription(self.wallpaper)), ("boostsApplied", ConstructorParameterDescription(self.boostsApplied)), ("boostsUnrestrict", ConstructorParameterDescription(self.boostsUnrestrict)), ("emojiset", ConstructorParameterDescription(self.emojiset)), ("botVerification", ConstructorParameterDescription(self.botVerification)), ("stargiftsCount", ConstructorParameterDescription(self.stargiftsCount)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars)), ("mainTab", ConstructorParameterDescription(self.mainTab))]) + return ("channelFull", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("about", ConstructorParameterDescription(self.about)), ("participantsCount", ConstructorParameterDescription(self.participantsCount)), ("adminsCount", ConstructorParameterDescription(self.adminsCount)), ("kickedCount", ConstructorParameterDescription(self.kickedCount)), ("bannedCount", ConstructorParameterDescription(self.bannedCount)), ("onlineCount", ConstructorParameterDescription(self.onlineCount)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("chatPhoto", ConstructorParameterDescription(self.chatPhoto)), ("notifySettings", ConstructorParameterDescription(self.notifySettings)), ("exportedInvite", ConstructorParameterDescription(self.exportedInvite)), ("botInfo", ConstructorParameterDescription(self.botInfo)), ("migratedFromChatId", ConstructorParameterDescription(self.migratedFromChatId)), ("migratedFromMaxId", ConstructorParameterDescription(self.migratedFromMaxId)), ("pinnedMsgId", ConstructorParameterDescription(self.pinnedMsgId)), ("stickerset", ConstructorParameterDescription(self.stickerset)), ("availableMinId", ConstructorParameterDescription(self.availableMinId)), ("folderId", ConstructorParameterDescription(self.folderId)), ("linkedChatId", ConstructorParameterDescription(self.linkedChatId)), ("location", ConstructorParameterDescription(self.location)), ("slowmodeSeconds", ConstructorParameterDescription(self.slowmodeSeconds)), ("slowmodeNextSendDate", ConstructorParameterDescription(self.slowmodeNextSendDate)), ("statsDc", ConstructorParameterDescription(self.statsDc)), ("pts", ConstructorParameterDescription(self.pts)), ("call", ConstructorParameterDescription(self.call)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod)), ("pendingSuggestions", ConstructorParameterDescription(self.pendingSuggestions)), ("groupcallDefaultJoinAs", ConstructorParameterDescription(self.groupcallDefaultJoinAs)), ("themeEmoticon", ConstructorParameterDescription(self.themeEmoticon)), ("requestsPending", ConstructorParameterDescription(self.requestsPending)), ("recentRequesters", ConstructorParameterDescription(self.recentRequesters)), ("defaultSendAs", ConstructorParameterDescription(self.defaultSendAs)), ("availableReactions", ConstructorParameterDescription(self.availableReactions)), ("reactionsLimit", ConstructorParameterDescription(self.reactionsLimit)), ("stories", ConstructorParameterDescription(self.stories)), ("wallpaper", ConstructorParameterDescription(self.wallpaper)), ("boostsApplied", ConstructorParameterDescription(self.boostsApplied)), ("boostsUnrestrict", ConstructorParameterDescription(self.boostsUnrestrict)), ("emojiset", ConstructorParameterDescription(self.emojiset)), ("botVerification", ConstructorParameterDescription(self.botVerification)), ("stargiftsCount", ConstructorParameterDescription(self.stargiftsCount)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars)), ("mainTab", ConstructorParameterDescription(self.mainTab)), ("guardBotId", ConstructorParameterDescription(self.guardBotId))]) } } public class Cons_chatFull: TypeConstructorDescription { @@ -1553,7 +1555,7 @@ public extension Api { switch self { case .channelFull(let _data): if boxed { - buffer.appendInt32(-455036259) + buffer.appendInt32(-1605464774) } serializeInt32(_data.flags, buffer: buffer, boxed: false) serializeInt32(_data.flags2, buffer: buffer, boxed: false) @@ -1686,6 +1688,9 @@ public extension Api { if Int(_data.flags2) & Int(1 << 22) != 0 { _data.mainTab!.serialize(buffer, true) } + if Int(_data.flags2) & Int(1 << 23) != 0 { + serializeInt64(_data.guardBotId!, buffer: buffer, boxed: false) + } break case .chatFull(let _data): if boxed { @@ -1750,7 +1755,7 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelFull(let _data): - return ("channelFull", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("about", ConstructorParameterDescription(_data.about)), ("participantsCount", ConstructorParameterDescription(_data.participantsCount)), ("adminsCount", ConstructorParameterDescription(_data.adminsCount)), ("kickedCount", ConstructorParameterDescription(_data.kickedCount)), ("bannedCount", ConstructorParameterDescription(_data.bannedCount)), ("onlineCount", ConstructorParameterDescription(_data.onlineCount)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("chatPhoto", ConstructorParameterDescription(_data.chatPhoto)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings)), ("exportedInvite", ConstructorParameterDescription(_data.exportedInvite)), ("botInfo", ConstructorParameterDescription(_data.botInfo)), ("migratedFromChatId", ConstructorParameterDescription(_data.migratedFromChatId)), ("migratedFromMaxId", ConstructorParameterDescription(_data.migratedFromMaxId)), ("pinnedMsgId", ConstructorParameterDescription(_data.pinnedMsgId)), ("stickerset", ConstructorParameterDescription(_data.stickerset)), ("availableMinId", ConstructorParameterDescription(_data.availableMinId)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("linkedChatId", ConstructorParameterDescription(_data.linkedChatId)), ("location", ConstructorParameterDescription(_data.location)), ("slowmodeSeconds", ConstructorParameterDescription(_data.slowmodeSeconds)), ("slowmodeNextSendDate", ConstructorParameterDescription(_data.slowmodeNextSendDate)), ("statsDc", ConstructorParameterDescription(_data.statsDc)), ("pts", ConstructorParameterDescription(_data.pts)), ("call", ConstructorParameterDescription(_data.call)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod)), ("pendingSuggestions", ConstructorParameterDescription(_data.pendingSuggestions)), ("groupcallDefaultJoinAs", ConstructorParameterDescription(_data.groupcallDefaultJoinAs)), ("themeEmoticon", ConstructorParameterDescription(_data.themeEmoticon)), ("requestsPending", ConstructorParameterDescription(_data.requestsPending)), ("recentRequesters", ConstructorParameterDescription(_data.recentRequesters)), ("defaultSendAs", ConstructorParameterDescription(_data.defaultSendAs)), ("availableReactions", ConstructorParameterDescription(_data.availableReactions)), ("reactionsLimit", ConstructorParameterDescription(_data.reactionsLimit)), ("stories", ConstructorParameterDescription(_data.stories)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper)), ("boostsApplied", ConstructorParameterDescription(_data.boostsApplied)), ("boostsUnrestrict", ConstructorParameterDescription(_data.boostsUnrestrict)), ("emojiset", ConstructorParameterDescription(_data.emojiset)), ("botVerification", ConstructorParameterDescription(_data.botVerification)), ("stargiftsCount", ConstructorParameterDescription(_data.stargiftsCount)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars)), ("mainTab", ConstructorParameterDescription(_data.mainTab))]) + return ("channelFull", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("about", ConstructorParameterDescription(_data.about)), ("participantsCount", ConstructorParameterDescription(_data.participantsCount)), ("adminsCount", ConstructorParameterDescription(_data.adminsCount)), ("kickedCount", ConstructorParameterDescription(_data.kickedCount)), ("bannedCount", ConstructorParameterDescription(_data.bannedCount)), ("onlineCount", ConstructorParameterDescription(_data.onlineCount)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("chatPhoto", ConstructorParameterDescription(_data.chatPhoto)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings)), ("exportedInvite", ConstructorParameterDescription(_data.exportedInvite)), ("botInfo", ConstructorParameterDescription(_data.botInfo)), ("migratedFromChatId", ConstructorParameterDescription(_data.migratedFromChatId)), ("migratedFromMaxId", ConstructorParameterDescription(_data.migratedFromMaxId)), ("pinnedMsgId", ConstructorParameterDescription(_data.pinnedMsgId)), ("stickerset", ConstructorParameterDescription(_data.stickerset)), ("availableMinId", ConstructorParameterDescription(_data.availableMinId)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("linkedChatId", ConstructorParameterDescription(_data.linkedChatId)), ("location", ConstructorParameterDescription(_data.location)), ("slowmodeSeconds", ConstructorParameterDescription(_data.slowmodeSeconds)), ("slowmodeNextSendDate", ConstructorParameterDescription(_data.slowmodeNextSendDate)), ("statsDc", ConstructorParameterDescription(_data.statsDc)), ("pts", ConstructorParameterDescription(_data.pts)), ("call", ConstructorParameterDescription(_data.call)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod)), ("pendingSuggestions", ConstructorParameterDescription(_data.pendingSuggestions)), ("groupcallDefaultJoinAs", ConstructorParameterDescription(_data.groupcallDefaultJoinAs)), ("themeEmoticon", ConstructorParameterDescription(_data.themeEmoticon)), ("requestsPending", ConstructorParameterDescription(_data.requestsPending)), ("recentRequesters", ConstructorParameterDescription(_data.recentRequesters)), ("defaultSendAs", ConstructorParameterDescription(_data.defaultSendAs)), ("availableReactions", ConstructorParameterDescription(_data.availableReactions)), ("reactionsLimit", ConstructorParameterDescription(_data.reactionsLimit)), ("stories", ConstructorParameterDescription(_data.stories)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper)), ("boostsApplied", ConstructorParameterDescription(_data.boostsApplied)), ("boostsUnrestrict", ConstructorParameterDescription(_data.boostsUnrestrict)), ("emojiset", ConstructorParameterDescription(_data.emojiset)), ("botVerification", ConstructorParameterDescription(_data.botVerification)), ("stargiftsCount", ConstructorParameterDescription(_data.stargiftsCount)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars)), ("mainTab", ConstructorParameterDescription(_data.mainTab)), ("guardBotId", ConstructorParameterDescription(_data.guardBotId))]) case .chatFull(let _data): return ("chatFull", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("about", ConstructorParameterDescription(_data.about)), ("participants", ConstructorParameterDescription(_data.participants)), ("chatPhoto", ConstructorParameterDescription(_data.chatPhoto)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings)), ("exportedInvite", ConstructorParameterDescription(_data.exportedInvite)), ("botInfo", ConstructorParameterDescription(_data.botInfo)), ("pinnedMsgId", ConstructorParameterDescription(_data.pinnedMsgId)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("call", ConstructorParameterDescription(_data.call)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod)), ("groupcallDefaultJoinAs", ConstructorParameterDescription(_data.groupcallDefaultJoinAs)), ("themeEmoticon", ConstructorParameterDescription(_data.themeEmoticon)), ("requestsPending", ConstructorParameterDescription(_data.requestsPending)), ("recentRequesters", ConstructorParameterDescription(_data.recentRequesters)), ("availableReactions", ConstructorParameterDescription(_data.availableReactions)), ("reactionsLimit", ConstructorParameterDescription(_data.reactionsLimit))]) } @@ -1957,6 +1962,10 @@ public extension Api { _47 = Api.parse(reader, signature: signature) as? Api.ProfileTab } } + var _48: Int64? + if Int(_2 ?? 0) & Int(1 << 23) != 0 { + _48 = reader.readInt64() + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil @@ -2004,8 +2013,9 @@ public extension Api { let _c45 = (Int(_2 ?? 0) & Int(1 << 18) == 0) || _45 != nil let _c46 = (Int(_2 ?? 0) & Int(1 << 21) == 0) || _46 != nil let _c47 = (Int(_2 ?? 0) & 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(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)) + let _c48 = (Int(_2 ?? 0) & Int(1 << 23) == 0) || _48 != 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 && _c48 { + 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, guardBotId: _48)) } else { return nil diff --git a/submodules/TelegramApi/Sources/Api40.swift b/submodules/TelegramApi/Sources/Api40.swift index 27a36a3d77..275cb9603c 100644 --- a/submodules/TelegramApi/Sources/Api40.swift +++ b/submodules/TelegramApi/Sources/Api40.swift @@ -1,14001 +1,1967 @@ -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", ConstructorParameterDescription(botId)), ("scope", ConstructorParameterDescription(scope)), ("publicKey", ConstructorParameterDescription(publicKey)), ("valueHashes", ConstructorParameterDescription(valueHashes)), ("credentials", ConstructorParameterDescription(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 +public extension Api.premium { + enum BoostsStatus: TypeConstructorDescription { + public class Cons_boostsStatus: TypeConstructorDescription { + 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 } - 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", ConstructorParameterDescription(flags)), ("hash", ConstructorParameterDescription(hash)), ("encryptedRequestsDisabled", ConstructorParameterDescription(encryptedRequestsDisabled)), ("callRequestsDisabled", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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 confirmBotConnection(botId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1743593320) - botId.serialize(buffer, true) - return (FunctionDescription(name: "account.confirmBotConnection", parameters: [("botId", ConstructorParameterDescription(botId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - 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", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("boostsStatus", [("flags", ConstructorParameterDescription(self.flags)), ("level", ConstructorParameterDescription(self.level)), ("currentLevelBoosts", ConstructorParameterDescription(self.currentLevelBoosts)), ("boosts", ConstructorParameterDescription(self.boosts)), ("giftBoosts", ConstructorParameterDescription(self.giftBoosts)), ("nextLevelBoosts", ConstructorParameterDescription(self.nextLevelBoosts)), ("premiumAudience", ConstructorParameterDescription(self.premiumAudience)), ("boostUrl", ConstructorParameterDescription(self.boostUrl)), ("prepaidGiveaways", ConstructorParameterDescription(self.prepaidGiveaways)), ("myBoostSlots", ConstructorParameterDescription(self.myBoostSlots))]) } } - return (FunctionDescription(name: "account.createTheme", parameters: [("flags", ConstructorParameterDescription(flags)), ("slug", ConstructorParameterDescription(slug)), ("title", ConstructorParameterDescription(title)), ("document", ConstructorParameterDescription(document)), ("settings", ConstructorParameterDescription(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 + 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(_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 } - 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", ConstructorParameterDescription(flags)), ("reason", ConstructorParameterDescription(reason)), ("password", ConstructorParameterDescription(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 + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .boostsStatus(let _data): + return ("boostsStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("level", ConstructorParameterDescription(_data.level)), ("currentLevelBoosts", ConstructorParameterDescription(_data.currentLevelBoosts)), ("boosts", ConstructorParameterDescription(_data.boosts)), ("giftBoosts", ConstructorParameterDescription(_data.giftBoosts)), ("nextLevelBoosts", ConstructorParameterDescription(_data.nextLevelBoosts)), ("premiumAudience", ConstructorParameterDescription(_data.premiumAudience)), ("boostUrl", ConstructorParameterDescription(_data.boostUrl)), ("prepaidGiveaways", ConstructorParameterDescription(_data.prepaidGiveaways)), ("myBoostSlots", ConstructorParameterDescription(_data.myBoostSlots))]) } - 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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + + public static func parse_boostsStatus(_ reader: BufferReader) -> BoostsStatus? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + if Int(_1 ?? 0) & Int(1 << 4) != 0 { + _5 = reader.readInt32() } - return result - }) + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = reader.readInt32() + } + var _7: Api.StatsPercentValue? + if Int(_1 ?? 0) & 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 ?? 0) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PrepaidGiveaway.self) + } + } + var _10: [Int32]? + if Int(_1 ?? 0) & 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 + let _c4 = _4 != nil + let _c5 = (Int(_1 ?? 0) & Int(1 << 4) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + let _c8 = _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 3) == 0) || _9 != nil + let _c10 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _10 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 { + 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.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", ConstructorParameterDescription(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 +public extension Api.premium { + enum MyBoosts: TypeConstructorDescription { + public class Cons_myBoosts: TypeConstructorDescription { + 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 } - 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", ConstructorParameterDescription(slug)), ("link", ConstructorParameterDescription(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 + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("myBoosts", [("myBoosts", ConstructorParameterDescription(self.myBoosts)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } - 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", ConstructorParameterDescription(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 + } + 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 } - 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 + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .myBoosts(let _data): + return ("myBoosts", [("myBoosts", ConstructorParameterDescription(_data.myBoosts)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } - 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]? + } + + public static func parse_myBoosts(_ reader: BufferReader) -> MyBoosts? { + var _1: [Api.MyBoost]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MyBoost.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", ConstructorParameterDescription(botId)), ("scope", ConstructorParameterDescription(scope)), ("publicKey", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(wallpapers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.WallPaper]? in - let reader = BufferReader(buffer) - var result: [Api.WallPaper]? + var _2: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.WallPaper.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(types))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SecureValue]? in - let reader = BufferReader(buffer) - var result: [Api.SecureValue]? + var _3: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SecureValue.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.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", ConstructorParameterDescription(format)), ("theme", ConstructorParameterDescription(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 + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.premium.MyBoosts.myBoosts(Cons_myBoosts(myBoosts: _1!, chats: _2!, users: _3!)) } - 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", ConstructorParameterDescription(format)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(password)), ("period", ConstructorParameterDescription(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", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("fileMaxSize", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("theme", ConstructorParameterDescription(theme)), ("format", ConstructorParameterDescription(format)), ("baseTheme", ConstructorParameterDescription(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", ConstructorParameterDescription(wallpaper)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("tokenType", ConstructorParameterDescription(tokenType)), ("token", ConstructorParameterDescription(token)), ("appSandbox", ConstructorParameterDescription(appSandbox)), ("secret", ConstructorParameterDescription(secret)), ("otherUids", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("reason", ConstructorParameterDescription(reason)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("photoId", ConstructorParameterDescription(photoId)), ("reason", ConstructorParameterDescription(reason)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("afterId", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(value)), ("secureSecretId", ConstructorParameterDescription(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", ConstructorParameterDescription(theme)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(wallpaper)), ("unsave", ConstructorParameterDescription(unsave)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(hash)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(purpose)), ("email", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(key)), ("rules", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("paused", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(username)), ("active", ConstructorParameterDescription(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", ConstructorParameterDescription(tokenType)), ("token", ConstructorParameterDescription(token)), ("otherUids", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("birthday", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("intro", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("address", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("businessWorkHours", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("color", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("rights", ConstructorParameterDescription(rights)), ("bot", ConstructorParameterDescription(bot)), ("recipients", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(password)), ("newSettings", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("firstName", ConstructorParameterDescription(firstName)), ("lastName", ConstructorParameterDescription(lastName)), ("about", ConstructorParameterDescription(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", ConstructorParameterDescription(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) + else { + return nil } } - return (FunctionDescription(name: "account.updateTheme", parameters: [("flags", ConstructorParameterDescription(flags)), ("format", ConstructorParameterDescription(format)), ("theme", ConstructorParameterDescription(theme)), ("slug", ConstructorParameterDescription(slug)), ("title", ConstructorParameterDescription(title)), ("document", ConstructorParameterDescription(document)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(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 +public extension Api.smsjobs { + enum EligibilityToJoin: TypeConstructorDescription { + public class Cons_eligibleToJoin: TypeConstructorDescription { + public var termsUrl: String + public var monthlySentSms: Int32 + public init(termsUrl: String, monthlySentSms: Int32) { + self.termsUrl = termsUrl + self.monthlySentSms = monthlySentSms } - 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", ConstructorParameterDescription(file)), ("fileName", ConstructorParameterDescription(fileName)), ("mimeType", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("file", ConstructorParameterDescription(file)), ("thumb", ConstructorParameterDescription(thumb)), ("fileName", ConstructorParameterDescription(fileName)), ("mimeType", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("file", ConstructorParameterDescription(file)), ("mimeType", ConstructorParameterDescription(mimeType)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(purpose)), ("verification", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(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.aicompose { - static func createTone(flags: Int32, emojiId: Int64, title: String, prompt: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1252538643) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeInt64(emojiId, buffer: buffer, boxed: false) - serializeString(title, buffer: buffer, boxed: false) - serializeString(prompt, buffer: buffer, boxed: false) - return (FunctionDescription(name: "aicompose.createTone", parameters: [("flags", ConstructorParameterDescription(flags)), ("emojiId", ConstructorParameterDescription(emojiId)), ("title", ConstructorParameterDescription(title)), ("prompt", ConstructorParameterDescription(prompt))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AiComposeTone? in - let reader = BufferReader(buffer) - var result: Api.AiComposeTone? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.AiComposeTone - } - return result - }) - } -} -public extension Api.functions.aicompose { - static func deleteTone(tone: Api.InputAiComposeTone) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-583454358) - tone.serialize(buffer, true) - return (FunctionDescription(name: "aicompose.deleteTone", parameters: [("tone", ConstructorParameterDescription(tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool - } - return result - }) - } -} -public extension Api.functions.aicompose { - static func getTone(tone: Api.InputAiComposeTone) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1293370877) - tone.serialize(buffer, true) - return (FunctionDescription(name: "aicompose.getTone", parameters: [("tone", ConstructorParameterDescription(tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.aicompose.Tones? in - let reader = BufferReader(buffer) - var result: Api.aicompose.Tones? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.aicompose.Tones - } - return result - }) - } -} -public extension Api.functions.aicompose { - static func getToneExample(tone: Api.InputAiComposeTone, num: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-776688876) - tone.serialize(buffer, true) - serializeInt32(num, buffer: buffer, boxed: false) - return (FunctionDescription(name: "aicompose.getToneExample", parameters: [("tone", ConstructorParameterDescription(tone)), ("num", ConstructorParameterDescription(num))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AiComposeToneExample? in - let reader = BufferReader(buffer) - var result: Api.AiComposeToneExample? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.AiComposeToneExample - } - return result - }) - } -} -public extension Api.functions.aicompose { - static func getTones(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1412066815) - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "aicompose.getTones", parameters: [("hash", ConstructorParameterDescription(hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.aicompose.Tones? in - let reader = BufferReader(buffer) - var result: Api.aicompose.Tones? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.aicompose.Tones - } - return result - }) - } -} -public extension Api.functions.aicompose { - static func saveTone(tone: Api.InputAiComposeTone, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(394447793) - tone.serialize(buffer, true) - unsave.serialize(buffer, true) - return (FunctionDescription(name: "aicompose.saveTone", parameters: [("tone", ConstructorParameterDescription(tone)), ("unsave", ConstructorParameterDescription(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.aicompose { - static func updateTone(flags: Int32, tone: Api.InputAiComposeTone, displayAuthor: Api.Bool?, emojiId: Int64?, title: String?, prompt: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1875128487) - serializeInt32(flags, buffer: buffer, boxed: false) - tone.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 { - displayAuthor!.serialize(buffer, true) - } - if Int(flags) & Int(1 << 1) != 0 { - serializeInt64(emojiId!, 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(prompt!, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "aicompose.updateTone", parameters: [("flags", ConstructorParameterDescription(flags)), ("tone", ConstructorParameterDescription(tone)), ("displayAuthor", ConstructorParameterDescription(displayAuthor)), ("emojiId", ConstructorParameterDescription(emojiId)), ("title", ConstructorParameterDescription(title)), ("prompt", ConstructorParameterDescription(prompt))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AiComposeTone? in - let reader = BufferReader(buffer) - var result: Api.AiComposeTone? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.AiComposeTone - } - 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", ConstructorParameterDescription(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", ConstructorParameterDescription(permAuthKeyId)), ("nonce", ConstructorParameterDescription(nonce)), ("expiresAt", ConstructorParameterDescription(expiresAt)), ("encryptedMessage", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("formId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("exceptIds", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("credential", ConstructorParameterDescription(credential)), ("fromDcId", ConstructorParameterDescription(fromDcId)), ("fromAuthKeyId", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("bytes", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("apiId", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("botAuthToken", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("webAuthToken", ConstructorParameterDescription(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", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(flags)), ("code", ConstructorParameterDescription(code)), ("newSettings", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("mnc", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("safetyNetToken", ConstructorParameterDescription(safetyNetToken)), ("playIntegrityToken", ConstructorParameterDescription(playIntegrityToken)), ("iosPushSecret", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("reason", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("apiId", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(phoneCode)), ("emailVerification", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("firstName", ConstructorParameterDescription(firstName)), ("lastName", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("media", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(queryId)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("fileName", ConstructorParameterDescription(fileName)), ("url", ConstructorParameterDescription(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 checkUsername(username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-2014174821) - serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.checkUsername", parameters: [("username", ConstructorParameterDescription(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.bots { - static func createBot(flags: Int32, name: String, username: String, managerId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-441352405) - serializeInt32(flags, buffer: buffer, boxed: false) - serializeString(name, buffer: buffer, boxed: false) - serializeString(username, buffer: buffer, boxed: false) - managerId.serialize(buffer, true) - return (FunctionDescription(name: "bots.createBot", parameters: [("flags", ConstructorParameterDescription(flags)), ("name", ConstructorParameterDescription(name)), ("username", ConstructorParameterDescription(username)), ("managerId", ConstructorParameterDescription(managerId))]), 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.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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("media", ConstructorParameterDescription(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 editAccessSettings(flags: Int32, bot: Api.InputUser, addUsers: [Api.InputUser]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(830553304) - serializeInt32(flags, buffer: buffer, boxed: false) - bot.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(addUsers!.count)) - for item in addUsers! { - item.serialize(buffer, true) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("eligibleToJoin", [("termsUrl", ConstructorParameterDescription(self.termsUrl)), ("monthlySentSms", ConstructorParameterDescription(self.monthlySentSms))]) } } - return (FunctionDescription(name: "bots.editAccessSettings", parameters: [("flags", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("addUsers", ConstructorParameterDescription(addUsers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - var result: Api.Bool? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.Bool + 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 } - return result - }) + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .eligibleToJoin(let _data): + return ("eligibleToJoin", [("termsUrl", ConstructorParameterDescription(_data.termsUrl)), ("monthlySentSms", ConstructorParameterDescription(_data.monthlySentSms))]) + } + } + + public static func parse_eligibleToJoin(_ reader: BufferReader) -> EligibilityToJoin? { + var _1: String? + _1 = parseString(reader) + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.smsjobs.EligibilityToJoin.eligibleToJoin(Cons_eligibleToJoin(termsUrl: _1!, monthlySentSms: _2!)) + } + else { + return nil + } + } } } -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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("media", ConstructorParameterDescription(media)), ("newMedia", ConstructorParameterDescription(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 +public extension Api.smsjobs { + enum Status: TypeConstructorDescription { + public class Cons_status: TypeConstructorDescription { + 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 } - return result - }) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("status", [("flags", ConstructorParameterDescription(self.flags)), ("recentSent", ConstructorParameterDescription(self.recentSent)), ("recentSince", ConstructorParameterDescription(self.recentSince)), ("recentRemains", ConstructorParameterDescription(self.recentRemains)), ("totalSent", ConstructorParameterDescription(self.totalSent)), ("totalSince", ConstructorParameterDescription(self.totalSince)), ("lastGiftSlug", ConstructorParameterDescription(self.lastGiftSlug)), ("termsUrl", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .status(let _data): + return ("status", [("flags", ConstructorParameterDescription(_data.flags)), ("recentSent", ConstructorParameterDescription(_data.recentSent)), ("recentSince", ConstructorParameterDescription(_data.recentSince)), ("recentRemains", ConstructorParameterDescription(_data.recentRemains)), ("totalSent", ConstructorParameterDescription(_data.totalSent)), ("totalSince", ConstructorParameterDescription(_data.totalSince)), ("lastGiftSlug", ConstructorParameterDescription(_data.lastGiftSlug)), ("termsUrl", ConstructorParameterDescription(_data.termsUrl))]) + } + } + + public static func parse_status(_ reader: BufferReader) -> Status? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: Int32? + _6 = reader.readInt32() + var _7: String? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _7 = parseString(reader) + } + var _8: String? + _8 = parseString(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _7 != nil + let _c8 = _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + 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.functions.bots { - static func exportBotToken(bot: Api.InputUser, revoke: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1123182101) - bot.serialize(buffer, true) - revoke.serialize(buffer, true) - return (FunctionDescription(name: "bots.exportBotToken", parameters: [("bot", ConstructorParameterDescription(bot)), ("revoke", ConstructorParameterDescription(revoke))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.ExportedBotToken? in - let reader = BufferReader(buffer) - var result: Api.bots.ExportedBotToken? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.bots.ExportedBotToken +public extension Api.stats { + enum BroadcastStats: TypeConstructorDescription { + public class Cons_broadcastStats: TypeConstructorDescription { + 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 } - return result - }) - } -} -public extension Api.functions.bots { - static func getAccessSettings(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(557339555) - bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.getAccessSettings", parameters: [("bot", ConstructorParameterDescription(bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.AccessSettings? in - let reader = BufferReader(buffer) - var result: Api.bots.AccessSettings? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.bots.AccessSettings + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("broadcastStats", [("period", ConstructorParameterDescription(self.period)), ("followers", ConstructorParameterDescription(self.followers)), ("viewsPerPost", ConstructorParameterDescription(self.viewsPerPost)), ("sharesPerPost", ConstructorParameterDescription(self.sharesPerPost)), ("reactionsPerPost", ConstructorParameterDescription(self.reactionsPerPost)), ("viewsPerStory", ConstructorParameterDescription(self.viewsPerStory)), ("sharesPerStory", ConstructorParameterDescription(self.sharesPerStory)), ("reactionsPerStory", ConstructorParameterDescription(self.reactionsPerStory)), ("enabledNotifications", ConstructorParameterDescription(self.enabledNotifications)), ("growthGraph", ConstructorParameterDescription(self.growthGraph)), ("followersGraph", ConstructorParameterDescription(self.followersGraph)), ("muteGraph", ConstructorParameterDescription(self.muteGraph)), ("topHoursGraph", ConstructorParameterDescription(self.topHoursGraph)), ("interactionsGraph", ConstructorParameterDescription(self.interactionsGraph)), ("ivInteractionsGraph", ConstructorParameterDescription(self.ivInteractionsGraph)), ("viewsBySourceGraph", ConstructorParameterDescription(self.viewsBySourceGraph)), ("newFollowersBySourceGraph", ConstructorParameterDescription(self.newFollowersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(self.languagesGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.reactionsByEmotionGraph)), ("storyInteractionsGraph", ConstructorParameterDescription(self.storyInteractionsGraph)), ("storyReactionsByEmotionGraph", ConstructorParameterDescription(self.storyReactionsByEmotionGraph)), ("recentPostsInteractions", ConstructorParameterDescription(self.recentPostsInteractions))]) } - 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]? + } + 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, ConstructorParameterDescription)]) { + switch self { + case .broadcastStats(let _data): + return ("broadcastStats", [("period", ConstructorParameterDescription(_data.period)), ("followers", ConstructorParameterDescription(_data.followers)), ("viewsPerPost", ConstructorParameterDescription(_data.viewsPerPost)), ("sharesPerPost", ConstructorParameterDescription(_data.sharesPerPost)), ("reactionsPerPost", ConstructorParameterDescription(_data.reactionsPerPost)), ("viewsPerStory", ConstructorParameterDescription(_data.viewsPerStory)), ("sharesPerStory", ConstructorParameterDescription(_data.sharesPerStory)), ("reactionsPerStory", ConstructorParameterDescription(_data.reactionsPerStory)), ("enabledNotifications", ConstructorParameterDescription(_data.enabledNotifications)), ("growthGraph", ConstructorParameterDescription(_data.growthGraph)), ("followersGraph", ConstructorParameterDescription(_data.followersGraph)), ("muteGraph", ConstructorParameterDescription(_data.muteGraph)), ("topHoursGraph", ConstructorParameterDescription(_data.topHoursGraph)), ("interactionsGraph", ConstructorParameterDescription(_data.interactionsGraph)), ("ivInteractionsGraph", ConstructorParameterDescription(_data.ivInteractionsGraph)), ("viewsBySourceGraph", ConstructorParameterDescription(_data.viewsBySourceGraph)), ("newFollowersBySourceGraph", ConstructorParameterDescription(_data.newFollowersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(_data.languagesGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph)), ("storyInteractionsGraph", ConstructorParameterDescription(_data.storyInteractionsGraph)), ("storyReactionsByEmotionGraph", ConstructorParameterDescription(_data.storyReactionsByEmotionGraph)), ("recentPostsInteractions", ConstructorParameterDescription(_data.recentPostsInteractions))]) + } + } + + public static func parse_broadcastStats(_ reader: BufferReader) -> BroadcastStats? { + var _1: Api.StatsDateRangeDays? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StatsDateRangeDays + } + var _2: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _3: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _4: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _5: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _6: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _7: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _8: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _9: Api.StatsPercentValue? + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.StatsPercentValue + } + var _10: Api.StatsGraph? + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _11: Api.StatsGraph? + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _12: Api.StatsGraph? + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _13: Api.StatsGraph? + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _14: Api.StatsGraph? + if let signature = reader.readInt32() { + _14 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _15: Api.StatsGraph? + if let signature = reader.readInt32() { + _15 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _16: Api.StatsGraph? + if let signature = reader.readInt32() { + _16 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _17: Api.StatsGraph? + if let signature = reader.readInt32() { + _17 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _18: Api.StatsGraph? + if let signature = reader.readInt32() { + _18 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _19: Api.StatsGraph? + if let signature = reader.readInt32() { + _19 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _20: Api.StatsGraph? + if let signature = reader.readInt32() { + _20 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _21: Api.StatsGraph? + if let signature = reader.readInt32() { + _21 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _22: [Api.PostInteractionCounters]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + _22 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PostInteractionCounters.self) } - return result - }) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = _10 != nil + let _c11 = _11 != nil + let _c12 = _12 != nil + let _c13 = _13 != nil + let _c14 = _14 != nil + let _c15 = _15 != nil + let _c16 = _16 != nil + let _c17 = _17 != nil + let _c18 = _18 != nil + let _c19 = _19 != nil + let _c20 = _20 != nil + 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(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.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", ConstructorParameterDescription(scope)), ("langCode", ConstructorParameterDescription(langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotCommand]? in - let reader = BufferReader(buffer) - var result: [Api.BotCommand]? +public extension Api.stats { + enum MegagroupStats: TypeConstructorDescription { + public class Cons_megagroupStats: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("megagroupStats", [("period", ConstructorParameterDescription(self.period)), ("members", ConstructorParameterDescription(self.members)), ("messages", ConstructorParameterDescription(self.messages)), ("viewers", ConstructorParameterDescription(self.viewers)), ("posters", ConstructorParameterDescription(self.posters)), ("growthGraph", ConstructorParameterDescription(self.growthGraph)), ("membersGraph", ConstructorParameterDescription(self.membersGraph)), ("newMembersBySourceGraph", ConstructorParameterDescription(self.newMembersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(self.languagesGraph)), ("messagesGraph", ConstructorParameterDescription(self.messagesGraph)), ("actionsGraph", ConstructorParameterDescription(self.actionsGraph)), ("topHoursGraph", ConstructorParameterDescription(self.topHoursGraph)), ("weekdaysGraph", ConstructorParameterDescription(self.weekdaysGraph)), ("topPosters", ConstructorParameterDescription(self.topPosters)), ("topAdmins", ConstructorParameterDescription(self.topAdmins)), ("topInviters", ConstructorParameterDescription(self.topInviters)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .megagroupStats(let _data): + return ("megagroupStats", [("period", ConstructorParameterDescription(_data.period)), ("members", ConstructorParameterDescription(_data.members)), ("messages", ConstructorParameterDescription(_data.messages)), ("viewers", ConstructorParameterDescription(_data.viewers)), ("posters", ConstructorParameterDescription(_data.posters)), ("growthGraph", ConstructorParameterDescription(_data.growthGraph)), ("membersGraph", ConstructorParameterDescription(_data.membersGraph)), ("newMembersBySourceGraph", ConstructorParameterDescription(_data.newMembersBySourceGraph)), ("languagesGraph", ConstructorParameterDescription(_data.languagesGraph)), ("messagesGraph", ConstructorParameterDescription(_data.messagesGraph)), ("actionsGraph", ConstructorParameterDescription(_data.actionsGraph)), ("topHoursGraph", ConstructorParameterDescription(_data.topHoursGraph)), ("weekdaysGraph", ConstructorParameterDescription(_data.weekdaysGraph)), ("topPosters", ConstructorParameterDescription(_data.topPosters)), ("topAdmins", ConstructorParameterDescription(_data.topAdmins)), ("topInviters", ConstructorParameterDescription(_data.topInviters)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_megagroupStats(_ reader: BufferReader) -> MegagroupStats? { + var _1: Api.StatsDateRangeDays? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StatsDateRangeDays + } + var _2: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _3: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _4: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _5: Api.StatsAbsValueAndPrev? + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.StatsAbsValueAndPrev + } + var _6: Api.StatsGraph? + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _7: Api.StatsGraph? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _8: Api.StatsGraph? + if let signature = reader.readInt32() { + _8 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _9: Api.StatsGraph? + if let signature = reader.readInt32() { + _9 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _10: Api.StatsGraph? + if let signature = reader.readInt32() { + _10 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _11: Api.StatsGraph? + if let signature = reader.readInt32() { + _11 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _12: Api.StatsGraph? + if let signature = reader.readInt32() { + _12 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _13: Api.StatsGraph? + if let signature = reader.readInt32() { + _13 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _14: [Api.StatsGroupTopPoster]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self) + _14 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StatsGroupTopPoster.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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotPreviewMedia]? in - let reader = BufferReader(buffer) - var result: [Api.BotPreviewMedia]? + var _15: [Api.StatsGroupTopAdmin]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotPreviewMedia.self) + _15 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StatsGroupTopAdmin.self) } - return result - }) - } -} -public extension Api.functions.bots { - static func getRequestedWebViewButton(bot: Api.InputUser, webappReqId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1088047117) - bot.serialize(buffer, true) - serializeString(webappReqId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getRequestedWebViewButton", parameters: [("bot", ConstructorParameterDescription(bot)), ("webappReqId", ConstructorParameterDescription(webappReqId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.KeyboardButton? in - let reader = BufferReader(buffer) - var result: Api.KeyboardButton? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.KeyboardButton - } - 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", ConstructorParameterDescription(bot)), ("customMethod", ConstructorParameterDescription(customMethod)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("order", ConstructorParameterDescription(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 requestWebViewButton(userId: Api.InputUser, button: Api.KeyboardButton) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(832742238) - userId.serialize(buffer, true) - button.serialize(buffer, true) - return (FunctionDescription(name: "bots.requestWebViewButton", parameters: [("userId", ConstructorParameterDescription(userId)), ("button", ConstructorParameterDescription(button))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.RequestedButton? in - let reader = BufferReader(buffer) - var result: Api.bots.RequestedButton? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.bots.RequestedButton - } - 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", ConstructorParameterDescription(scope)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(customMethod)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(scope)), ("langCode", ConstructorParameterDescription(langCode)), ("commands", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("name", ConstructorParameterDescription(name)), ("about", ConstructorParameterDescription(about)), ("description", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("button", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("peer", ConstructorParameterDescription(peer)), ("customDescription", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("username", ConstructorParameterDescription(username)), ("active", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("commissionPermille", ConstructorParameterDescription(commissionPermille)), ("durationMonths", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("emojiStatus", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("query", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("username", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("title", ConstructorParameterDescription(title)), ("about", ConstructorParameterDescription(about)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("address", ConstructorParameterDescription(address)), ("ttlPeriod", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(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(flags: Int32, channel: Api.InputChannel, userId: Api.InputUser, adminRights: Api.ChatAdminRights, rank: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1701270168) - serializeInt32(flags, buffer: buffer, boxed: false) - channel.serialize(buffer, true) - userId.serialize(buffer, true) - adminRights.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 { - serializeString(rank!, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "channels.editAdmin", parameters: [("flags", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("userId", ConstructorParameterDescription(userId)), ("adminRights", ConstructorParameterDescription(adminRights)), ("rank", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(participant)), ("bannedRights", ConstructorParameterDescription(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 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", ConstructorParameterDescription(channel)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("address", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("photo", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("q", ConstructorParameterDescription(q)), ("eventsFilter", ConstructorParameterDescription(eventsFilter)), ("admins", ConstructorParameterDescription(admins)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 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 - }) - } -} -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", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("filter", ConstructorParameterDescription(filter)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("users", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(participant)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("restricted", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("hashtag", ConstructorParameterDescription(hashtag)), ("query", ConstructorParameterDescription(query)), ("offsetRate", ConstructorParameterDescription(offsetRate)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(limit)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("boosts", ConstructorParameterDescription(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", ConstructorParameterDescription(broadcast)), ("group", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("stickerset", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("tab", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("stickerset", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(enabled)), ("tabs", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("seconds", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("username", ConstructorParameterDescription(username)), ("active", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("color", ConstructorParameterDescription(color)), ("backgroundEmojiId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("emojiStatus", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("sendPaidMessagesStars", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("username", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("slug", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("chatlist", ConstructorParameterDescription(chatlist)), ("slug", ConstructorParameterDescription(slug)), ("title", ConstructorParameterDescription(title)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("title", ConstructorParameterDescription(title)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Peer]? in - let reader = BufferReader(buffer) - var result: [Api.Peer]? + var _16: [Api.StatsGroupTopInviter]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Peer.self) + _16 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StatsGroupTopInviter.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", ConstructorParameterDescription(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", ConstructorParameterDescription(slug)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("firstName", ConstructorParameterDescription(firstName)), ("lastName", ConstructorParameterDescription(lastName)), ("phone", ConstructorParameterDescription(phone)), ("note", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 - }) - } -} -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 - }) - } -} -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", ConstructorParameterDescription(flags)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? + var _17: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + _17 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.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", ConstructorParameterDescription(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 + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = _9 != nil + let _c10 = _10 != nil + let _c11 = _11 != nil + let _c12 = _12 != nil + let _c13 = _13 != nil + let _c14 = _14 != nil + let _c15 = _15 != nil + 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(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 } - 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", ConstructorParameterDescription(flags)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("selfExpires", ConstructorParameterDescription(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]? +public extension Api.stats { + enum MessageStats: TypeConstructorDescription { + public class Cons_messageStats: TypeConstructorDescription { + public var viewsGraph: Api.StatsGraph + public var reactionsByEmotionGraph: Api.StatsGraph + public init(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) { + self.viewsGraph = viewsGraph + self.reactionsByEmotionGraph = reactionsByEmotionGraph + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageStats", [("viewsGraph", ConstructorParameterDescription(self.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .messageStats(let _data): + return ("messageStats", [("viewsGraph", ConstructorParameterDescription(_data.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph))]) + } + } + + public static func parse_messageStats(_ reader: BufferReader) -> MessageStats? { + var _1: Api.StatsGraph? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _2: Api.StatsGraph? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.stats.MessageStats.messageStats(Cons_messageStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.stats { + enum PollStats: TypeConstructorDescription { + public class Cons_pollStats: TypeConstructorDescription { + public var votesGraph: Api.StatsGraph + public init(votesGraph: Api.StatsGraph) { + self.votesGraph = votesGraph + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pollStats", [("votesGraph", ConstructorParameterDescription(self.votesGraph))]) + } + } + case pollStats(Cons_pollStats) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .pollStats(let _data): + if boxed { + buffer.appendInt32(697941741) + } + _data.votesGraph.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .pollStats(let _data): + return ("pollStats", [("votesGraph", ConstructorParameterDescription(_data.votesGraph))]) + } + } + + public static func parse_pollStats(_ reader: BufferReader) -> PollStats? { + var _1: Api.StatsGraph? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + let _c1 = _1 != nil + if _c1 { + return Api.stats.PollStats.pollStats(Cons_pollStats(votesGraph: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.stats { + enum PublicForwards: TypeConstructorDescription { + public class Cons_publicForwards: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("publicForwards", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("forwards", ConstructorParameterDescription(self.forwards)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .publicForwards(let _data): + return ("publicForwards", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_publicForwards(_ reader: BufferReader) -> PublicForwards? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.PublicForward]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.SavedContact.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PublicForward.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", ConstructorParameterDescription(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 + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) } - 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]? + var _5: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ContactStatus.self) + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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", ConstructorParameterDescription(flags)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(category)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("username", ConstructorParameterDescription(username)), ("referer", ConstructorParameterDescription(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", ConstructorParameterDescription(q)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("note", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("suggestion", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("message", ConstructorParameterDescription(message)), ("entities", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 - }) - } -} -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 - }) - } -} -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", ConstructorParameterDescription(langCode)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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 - }) - } -} -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 - }) - } -} -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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 - }) - } -} -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 - }) - } -} -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", ConstructorParameterDescription(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 - }) - } -} -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 - }) - } -} -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 - }) - } -} -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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(pendingUpdatesCount)), ("message", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(langCode)), ("fromVersion", ConstructorParameterDescription(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", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(langPack))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackLanguage]? in - let reader = BufferReader(buffer) - var result: [Api.LangPackLanguage]? + var _6: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.LangPackLanguage.self) + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) } - return result - }) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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.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) +public extension Api.stats { + enum StoryStats: TypeConstructorDescription { + public class Cons_storyStats: TypeConstructorDescription { + public var viewsGraph: Api.StatsGraph + public var reactionsByEmotionGraph: Api.StatsGraph + public init(viewsGraph: Api.StatsGraph, reactionsByEmotionGraph: Api.StatsGraph) { + self.viewsGraph = viewsGraph + self.reactionsByEmotionGraph = reactionsByEmotionGraph + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyStats", [("viewsGraph", ConstructorParameterDescription(self.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.reactionsByEmotionGraph))]) + } } - return (FunctionDescription(name: "langpack.getStrings", parameters: [("langPack", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(langCode)), ("keys", ConstructorParameterDescription(keys))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackString]? in - let reader = BufferReader(buffer) - var result: [Api.LangPackString]? + 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, ConstructorParameterDescription)]) { + switch self { + case .storyStats(let _data): + return ("storyStats", [("viewsGraph", ConstructorParameterDescription(_data.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph))]) + } + } + + public static func parse_storyStats(_ reader: BufferReader) -> StoryStats? { + var _1: Api.StatsGraph? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + var _2: Api.StatsGraph? + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.StatsGraph + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.stats.StoryStats.storyStats(Cons_storyStats(viewsGraph: _1!, reactionsByEmotionGraph: _2!)) + } + else { + return nil + } + } + } +} +public extension Api.stickers { + enum SuggestedShortName: TypeConstructorDescription { + public class Cons_suggestedShortName: TypeConstructorDescription { + public var shortName: String + public init(shortName: String) { + self.shortName = shortName + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("suggestedShortName", [("shortName", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .suggestedShortName(let _data): + return ("suggestedShortName", [("shortName", ConstructorParameterDescription(_data.shortName))]) + } + } + + 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(Cons_suggestedShortName(shortName: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.storage { + enum FileType: TypeConstructorDescription { + case fileGif + case fileJpeg + case fileMov + case fileMp3 + case fileMp4 + case filePartial + case filePdf + 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, ConstructorParameterDescription)]) { + switch self { + case .fileGif: + return ("fileGif", []) + case .fileJpeg: + return ("fileJpeg", []) + case .fileMov: + return ("fileMov", []) + case .fileMp3: + return ("fileMp3", []) + case .fileMp4: + return ("fileMp4", []) + case .filePartial: + return ("filePartial", []) + case .filePdf: + return ("filePdf", []) + case .filePng: + return ("filePng", []) + case .fileUnknown: + return ("fileUnknown", []) + case .fileWebp: + return ("fileWebp", []) + } + } + + public static func parse_fileGif(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.fileGif + } + public static func parse_fileJpeg(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.fileJpeg + } + public static func parse_fileMov(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.fileMov + } + public static func parse_fileMp3(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.fileMp3 + } + public static func parse_fileMp4(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.fileMp4 + } + public static func parse_filePartial(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.filePartial + } + public static func parse_filePdf(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.filePdf + } + public static func parse_filePng(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.filePng + } + public static func parse_fileUnknown(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.fileUnknown + } + public static func parse_fileWebp(_ reader: BufferReader) -> FileType? { + return Api.storage.FileType.fileWebp + } + } +} +public extension Api.stories { + enum Albums: TypeConstructorDescription { + public class Cons_albums: TypeConstructorDescription { + public var hash: Int64 + public var albums: [Api.StoryAlbum] + public init(hash: Int64, albums: [Api.StoryAlbum]) { + self.hash = hash + self.albums = albums + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("albums", [("hash", ConstructorParameterDescription(self.hash)), ("albums", ConstructorParameterDescription(self.albums))]) + } + } + case albums(Cons_albums) + 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, ConstructorParameterDescription)]) { + switch self { + case .albums(let _data): + return ("albums", [("hash", ConstructorParameterDescription(_data.hash)), ("albums", ConstructorParameterDescription(_data.albums))]) + case .albumsNotModified: + return ("albumsNotModified", []) + } + } + + public static func parse_albums(_ reader: BufferReader) -> Albums? { + var _1: Int64? + _1 = reader.readInt64() + var _2: [Api.StoryAlbum]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.LangPackString.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryAlbum.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", ConstructorParameterDescription(peer)), ("gB", ConstructorParameterDescription(gB)), ("keyFingerprint", ConstructorParameterDescription(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 + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.stories.Albums.albums(Cons_albums(hash: _1!, albums: _2!)) } - return result - }) - } -} -public extension Api.functions.messages { - static func acceptUrlAuth(flags: Int32, peer: Api.InputPeer?, msgId: Int32?, buttonId: Int32?, url: String?, matchCode: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1738797278) - 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) - } - if Int(flags) & Int(1 << 4) != 0 { - serializeString(matchCode!, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.acceptUrlAuth", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("buttonId", ConstructorParameterDescription(buttonId)), ("url", ConstructorParameterDescription(url)), ("matchCode", ConstructorParameterDescription(matchCode))]), 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", ConstructorParameterDescription(chatId)), ("userId", ConstructorParameterDescription(userId)), ("fwdLimit", ConstructorParameterDescription(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 addPollAnswer(peer: Api.InputPeer, msgId: Int32, answer: Api.PollAnswer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(431770477) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - answer.serialize(buffer, true) - return (FunctionDescription(name: "messages.addPollAnswer", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("answer", ConstructorParameterDescription(answer))]), 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 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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("list", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 checkUrlAuthMatchCode(url: String, matchCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-911967477) - serializeString(url, buffer: buffer, boxed: false) - serializeString(matchCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkUrlAuthMatchCode", parameters: [("url", ConstructorParameterDescription(url)), ("matchCode", ConstructorParameterDescription(matchCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - 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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("randomId", ConstructorParameterDescription(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 composeMessageWithAI(flags: Int32, text: Api.TextWithEntities, translateToLang: String?, tone: Api.InputAiComposeTone?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-622017143) - serializeInt32(flags, buffer: buffer, boxed: false) - text.serialize(buffer, true) - if Int(flags) & Int(1 << 1) != 0 { - serializeString(translateToLang!, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 2) != 0 { - tone!.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.composeMessageWithAI", parameters: [("flags", ConstructorParameterDescription(flags)), ("text", ConstructorParameterDescription(text)), ("translateToLang", ConstructorParameterDescription(translateToLang)), ("tone", ConstructorParameterDescription(tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ComposedMessageWithAI? in - let reader = BufferReader(buffer) - var result: Api.messages.ComposedMessageWithAI? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.ComposedMessageWithAI - } - 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", ConstructorParameterDescription(flags)), ("users", ConstructorParameterDescription(users)), ("title", ConstructorParameterDescription(title)), ("ttlPeriod", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("title", ConstructorParameterDescription(title)), ("iconColor", ConstructorParameterDescription(iconColor)), ("iconEmojiId", ConstructorParameterDescription(iconEmojiId)), ("randomId", ConstructorParameterDescription(randomId)), ("sendAs", ConstructorParameterDescription(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 declineUrlAuth(url: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(893610940) - serializeString(url, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.declineUrlAuth", parameters: [("url", ConstructorParameterDescription(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.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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("chatId", ConstructorParameterDescription(chatId)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(maxId)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(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 deleteParticipantReaction(peer: Api.InputPeer, msgId: Int32, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-474482644) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - participant.serialize(buffer, true) - return (FunctionDescription(name: "messages.deleteParticipantReaction", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("participant", ConstructorParameterDescription(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.messages { - static func deleteParticipantReactions(peer: Api.InputPeer, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1598550792) - peer.serialize(buffer, true) - participant.serialize(buffer, true) - return (FunctionDescription(name: "messages.deleteParticipantReactions", parameters: [("peer", ConstructorParameterDescription(peer)), ("participant", ConstructorParameterDescription(participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - 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 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", ConstructorParameterDescription(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 deletePollAnswer(peer: Api.InputPeer, msgId: Int32, option: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1400568411) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeBytes(option, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deletePollAnswer", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("option", ConstructorParameterDescription(option))]), 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 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", ConstructorParameterDescription(shortcutId)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("adminId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(maxId)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("chatId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("about", ConstructorParameterDescription(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", ConstructorParameterDescription(chatId)), ("userId", ConstructorParameterDescription(userId)), ("isAdmin", ConstructorParameterDescription(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 editChatCreator(peer: Api.InputPeer, userId: Api.InputUser, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-146556841) - peer.serialize(buffer, true) - userId.serialize(buffer, true) - password.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatCreator", parameters: [("peer", ConstructorParameterDescription(peer)), ("userId", ConstructorParameterDescription(userId)), ("password", ConstructorParameterDescription(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.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", ConstructorParameterDescription(peer)), ("bannedRights", ConstructorParameterDescription(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 editChatParticipantRank(peer: Api.InputPeer, participant: Api.InputPeer, rank: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1609616720) - peer.serialize(buffer, true) - participant.serialize(buffer, true) - serializeString(rank, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editChatParticipantRank", parameters: [("peer", ConstructorParameterDescription(peer)), ("participant", ConstructorParameterDescription(participant)), ("rank", ConstructorParameterDescription(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.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", ConstructorParameterDescription(chatId)), ("photo", ConstructorParameterDescription(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", ConstructorParameterDescription(chatId)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(link)), ("expireDate", ConstructorParameterDescription(expireDate)), ("usageLimit", ConstructorParameterDescription(usageLimit)), ("requestNeeded", ConstructorParameterDescription(requestNeeded)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("text", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topicId", ConstructorParameterDescription(topicId)), ("title", ConstructorParameterDescription(title)), ("iconEmojiId", ConstructorParameterDescription(iconEmojiId)), ("closed", ConstructorParameterDescription(closed)), ("hidden", ConstructorParameterDescription(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) + else { + return nil } } - return (FunctionDescription(name: "messages.editInlineBotMessage", parameters: [("flags", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("message", ConstructorParameterDescription(message)), ("media", ConstructorParameterDescription(media)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(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 static func parse_albumsNotModified(_ reader: BufferReader) -> Albums? { + return Api.stories.Albums.albumsNotModified + } } } -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) +public extension Api.stories { + enum AllStories: TypeConstructorDescription { + public class Cons_allStories: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("allStories", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("state", ConstructorParameterDescription(self.state)), ("peerStories", ConstructorParameterDescription(self.peerStories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("stealthMode", ConstructorParameterDescription(self.stealthMode))]) } } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("message", ConstructorParameterDescription(message)), ("media", ConstructorParameterDescription(media)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(entities)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("quickReplyShortcutId", ConstructorParameterDescription(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 + public class Cons_allStoriesNotModified: TypeConstructorDescription { + 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 } - 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", ConstructorParameterDescription(shortcutId)), ("shortcut", ConstructorParameterDescription(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 + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("allStoriesNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("state", ConstructorParameterDescription(self.state)), ("stealthMode", ConstructorParameterDescription(self.stealthMode))]) } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("expireDate", ConstructorParameterDescription(expireDate)), ("usageLimit", ConstructorParameterDescription(usageLimit)), ("title", ConstructorParameterDescription(title)), ("subscriptionPricing", ConstructorParameterDescription(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 + 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 } - 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", ConstructorParameterDescription(id)), ("unfave", ConstructorParameterDescription(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 + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .allStories(let _data): + return ("allStories", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("state", ConstructorParameterDescription(_data.state)), ("peerStories", ConstructorParameterDescription(_data.peerStories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) + case .allStoriesNotModified(let _data): + return ("allStoriesNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("state", ConstructorParameterDescription(_data.state)), ("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) } - 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", ConstructorParameterDescription(flags)), ("fromPeer", ConstructorParameterDescription(fromPeer)), ("id", ConstructorParameterDescription(id)), ("randomId", ConstructorParameterDescription(randomId)), ("toPeer", ConstructorParameterDescription(toPeer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("replyTo", ConstructorParameterDescription(replyTo)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("videoTimestamp", ConstructorParameterDescription(videoTimestamp)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("suggestedPost", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StickerSetCovered]? in - let reader = BufferReader(buffer) - var result: [Api.StickerSetCovered]? + + public static func parse_allStories(_ reader: BufferReader) -> AllStories? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + var _4: [Api.PeerStories]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PeerStories.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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(app)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("data", ConstructorParameterDescription(data)), ("password", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(link)), ("q", ConstructorParameterDescription(q)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetUser", ConstructorParameterDescription(offsetUser)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("maxId", ConstructorParameterDescription(maxId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(documentId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Document]? in - let reader = BufferReader(buffer) - var result: [Api.Document]? + var _5: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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", ConstructorParameterDescription(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", ConstructorParameterDescription(version)), ("randomLength", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.DialogPeer]? in - let reader = BufferReader(buffer) - var result: [Api.DialogPeer]? + var _6: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogPeer.self) + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _7: Api.StoriesStealthMode? + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.StoriesStealthMode + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.stories.AllStories.allStories(Cons_allStories(flags: _1!, count: _2!, state: _3!, peerStories: _4!, chats: _5!, users: _6!, stealthMode: _7!)) + } + else { + return nil } - 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", ConstructorParameterDescription(flags)), ("folderId", ConstructorParameterDescription(folderId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Dialogs? in - let reader = BufferReader(buffer) - var result: Api.messages.Dialogs? + public static func parse_allStoriesNotModified(_ reader: BufferReader) -> AllStories? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Api.StoriesStealthMode? if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.Dialogs + _3 = Api.parse(reader, signature: signature) as? Api.StoriesStealthMode } - 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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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 + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.stories.AllStories.allStoriesNotModified(Cons_allStoriesNotModified(flags: _1!, state: _2!, stealthMode: _3!)) } - 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", ConstructorParameterDescription(sha256)), ("size", ConstructorParameterDescription(size)), ("mimeType", ConstructorParameterDescription(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 + else { + return nil } - 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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(langCode)), ("fromVersion", ConstructorParameterDescription(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", ConstructorParameterDescription(langCodes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.EmojiLanguage]? in - let reader = BufferReader(buffer) - var result: [Api.EmojiLanguage]? + } +} +public extension Api.stories { + enum CanSendStoryCount: TypeConstructorDescription { + public class Cons_canSendStoryCount: TypeConstructorDescription { + public var countRemains: Int32 + public init(countRemains: Int32) { + self.countRemains = countRemains + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("canSendStoryCount", [("countRemains", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .canSendStoryCount(let _data): + return ("canSendStoryCount", [("countRemains", ConstructorParameterDescription(_data.countRemains))]) + } + } + + 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(Cons_canSendStoryCount(countRemains: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.stories { + enum FoundStories: TypeConstructorDescription { + public class Cons_foundStories: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("foundStories", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("stories", ConstructorParameterDescription(self.stories)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .foundStories(let _data): + return ("foundStories", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("stories", ConstructorParameterDescription(_data.stories)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_foundStories(_ reader: BufferReader) -> FoundStories? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.FoundStory]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.EmojiLanguage.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FoundStory.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", ConstructorParameterDescription(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 + var _4: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _4 = parseString(reader) } - 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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("adminId", ConstructorParameterDescription(adminId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetLink", ConstructorParameterDescription(offsetLink)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FactCheck]? in - let reader = BufferReader(buffer) - var result: [Api.FactCheck]? + var _5: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.FactCheck.self) + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("q", ConstructorParameterDescription(q)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetTopic", ConstructorParameterDescription(offsetTopic)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("topics", ConstructorParameterDescription(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", ConstructorParameterDescription(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 getFutureChatCreatorAfterLeave(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(998051494) - peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getFutureChatCreatorAfterLeave", parameters: [("peer", ConstructorParameterDescription(peer))]), 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.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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("peer", ConstructorParameterDescription(peer)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("query", ConstructorParameterDescription(query)), ("offset", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("reaction", ConstructorParameterDescription(reaction)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReadParticipantDate]? in - let reader = BufferReader(buffer) - var result: [Api.ReadParticipantDate]? + var _6: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReadParticipantDate.self) + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.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", ConstructorParameterDescription(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 + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.stories.FoundStories.foundStories(Cons_foundStories(flags: _1!, count: _2!, stories: _3!, nextOffset: _4, chats: _5!, users: _6!)) } - 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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("increment", ConstructorParameterDescription(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", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 getPersonalChannelHistory(userId: Api.InputUser, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1442515350) - userId.serialize(buffer, true) - 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.getPersonalChannelHistory", parameters: [("userId", ConstructorParameterDescription(userId)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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 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", ConstructorParameterDescription(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, pollHash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-308026565) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - serializeInt64(pollHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPollResults", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("pollHash", ConstructorParameterDescription(pollHash))]), 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("option", ConstructorParameterDescription(option)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(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) + else { + return nil } } - serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getQuickReplyMessages", parameters: [("flags", ConstructorParameterDescription(flags)), ("shortcutId", ConstructorParameterDescription(shortcutId)), ("id", ConstructorParameterDescription(id)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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 +public extension Api.stories { + enum PeerStories: TypeConstructorDescription { + public class Cons_peerStories: TypeConstructorDescription { + 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 } - 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", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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 + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerStories", [("stories", ConstructorParameterDescription(self.stories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } - 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", ConstructorParameterDescription(flags)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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 + 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 } - 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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("ids", ConstructorParameterDescription(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 + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .peerStories(let _data): + return ("peerStories", [("stories", ConstructorParameterDescription(_data.stories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } - 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", ConstructorParameterDescription(hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedGifs? in - let reader = BufferReader(buffer) - var result: Api.messages.SavedGifs? + } + + public static func parse_peerStories(_ reader: BufferReader) -> PeerStories? { + var _1: Api.PeerStories? if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.messages.SavedGifs + _1 = Api.parse(reader, signature: signature) as? Api.PeerStories } - 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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("filters", ConstructorParameterDescription(filters))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.messages.SearchCounter]? in - let reader = BufferReader(buffer) - var result: [Api.messages.SearchCounter]? + var _2: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.messages.SearchCounter.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("filter", ConstructorParameterDescription(filter)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("filter", ConstructorParameterDescription(filter)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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]? + var _3: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageRange.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.stories.PeerStories.peerStories(Cons_peerStories(stories: _1!, chats: _2!, users: _3!)) + } + else { + return nil } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("hash", ConstructorParameterDescription(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 +public extension Api.stories { + enum Stories: TypeConstructorDescription { + public class Cons_stories: TypeConstructorDescription { + 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 } - 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", ConstructorParameterDescription(emoticon)), ("hash", ConstructorParameterDescription(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 + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stories", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("stories", ConstructorParameterDescription(self.stories)), ("pinnedToTop", ConstructorParameterDescription(self.pinnedToTop)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } - 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]? + } + 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(_data.pinnedToTop!.count)) + for item in _data.pinnedToTop! { + 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, ConstructorParameterDescription)]) { + switch self { + case .stories(let _data): + return ("stories", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("stories", ConstructorParameterDescription(_data.stories)), ("pinnedToTop", ConstructorParameterDescription(_data.pinnedToTop)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_stories(_ reader: BufferReader) -> Stories? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.StoryItem]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.DialogFilterSuggested.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryItem.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", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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 + var _4: [Int32]? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(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 getUnreadPollVotes(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(1126722802) - 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.getUnreadPollVotes", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(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", ConstructorParameterDescription(url)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("message", ConstructorParameterDescription(message)), ("entities", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("file", ConstructorParameterDescription(file)), ("mediaCount", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("archived", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(bot)), ("queryId", ConstructorParameterDescription(queryId)), ("replyTo", ConstructorParameterDescription(replyTo)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("transcriptionId", ConstructorParameterDescription(transcriptionId)), ("good", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("readMaxId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("maxDate", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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 readPollVotes(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(388019416) - 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.readPollVotes", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(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 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("savedPeerId", ConstructorParameterDescription(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", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReceivedNotifyMessage]? in - let reader = BufferReader(buffer) - var result: [Api.ReceivedNotifyMessage]? + var _5: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ReceivedNotifyMessage.self) + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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", ConstructorParameterDescription(maxQts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in - let reader = BufferReader(buffer) - var result: [Int64]? + var _6: [Api.User]? 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", ConstructorParameterDescription(flags)), ("folderId", ConstructorParameterDescription(folderId)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("option", ConstructorParameterDescription(option)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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 reportMusicListen(id: Api.InputDocument, listenedDuration: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-574826471) - id.serialize(buffer, true) - serializeInt32(listenedDuration, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.reportMusicListen", parameters: [("id", ConstructorParameterDescription(id)), ("listenedDuration", ConstructorParameterDescription(listenedDuration))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - 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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("reactionPeer", ConstructorParameterDescription(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 reportReadMetrics(peer: Api.InputPeer, metrics: [Api.InputMessageReadMetric]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1080542694) - peer.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(metrics.count)) - for item in metrics { - item.serialize(buffer, true) - } - return (FunctionDescription(name: "messages.reportReadMetrics", parameters: [("peer", ConstructorParameterDescription(peer)), ("metrics", ConstructorParameterDescription(metrics))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - 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", ConstructorParameterDescription(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", ConstructorParameterDescription(randomId)), ("option", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("app", ConstructorParameterDescription(app)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("randomId", ConstructorParameterDescription(randomId)), ("gA", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(bot)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("url", ConstructorParameterDescription(url)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(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?, inAppOrigin: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1991456356) - 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) - } - if Int(flags) & Int(1 << 3) != 0 { - serializeString(inAppOrigin!, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.requestUrlAuth", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("buttonId", ConstructorParameterDescription(buttonId)), ("url", ConstructorParameterDescription(url)), ("inAppOrigin", ConstructorParameterDescription(inAppOrigin))]), 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(bot)), ("url", ConstructorParameterDescription(url)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(platform)), ("replyTo", ConstructorParameterDescription(replyTo)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("replyTo", ConstructorParameterDescription(replyTo)), ("peer", ConstructorParameterDescription(peer)), ("message", ConstructorParameterDescription(message)), ("entities", ConstructorParameterDescription(entities)), ("media", ConstructorParameterDescription(media)), ("effect", ConstructorParameterDescription(effect)), ("suggestedPost", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("result", ConstructorParameterDescription(result)), ("userId", ConstructorParameterDescription(userId)), ("peerTypes", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("q", ConstructorParameterDescription(q)), ("fromId", ConstructorParameterDescription(fromId)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("savedReaction", ConstructorParameterDescription(savedReaction)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("filter", ConstructorParameterDescription(filter)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(maxDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(emoticon)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("q", ConstructorParameterDescription(q)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("folderId", ConstructorParameterDescription(folderId)), ("q", ConstructorParameterDescription(q)), ("filter", ConstructorParameterDescription(filter)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(maxDate)), ("offsetRate", ConstructorParameterDescription(offsetRate)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(q)), ("filter", ConstructorParameterDescription(filter)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("q", ConstructorParameterDescription(q)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("q", ConstructorParameterDescription(q)), ("emoticon", ConstructorParameterDescription(emoticon)), ("langCode", ConstructorParameterDescription(langCode)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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(flags: Int32, peer: Api.InputPeer, msgId: Int32?, webappReqId: String?, buttonId: Int32, requestedPeers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1818030759) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 { - serializeInt32(msgId!, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 1) != 0 { - serializeString(webappReqId!, 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: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("webappReqId", ConstructorParameterDescription(webappReqId)), ("buttonId", ConstructorParameterDescription(buttonId)), ("requestedPeers", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("data", ConstructorParameterDescription(data)), ("file", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("randomId", ConstructorParameterDescription(randomId)), ("queryId", ConstructorParameterDescription(queryId)), ("id", ConstructorParameterDescription(id)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("media", ConstructorParameterDescription(media)), ("message", ConstructorParameterDescription(message)), ("randomId", ConstructorParameterDescription(randomId)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(entities)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("suggestedPost", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("message", ConstructorParameterDescription(message)), ("randomId", ConstructorParameterDescription(randomId)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(entities)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("suggestedPost", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("multiMedia", ConstructorParameterDescription(multiMedia)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("count", ConstructorParameterDescription(count)), ("randomId", ConstructorParameterDescription(randomId)), ("`private`", ConstructorParameterDescription(`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", ConstructorParameterDescription(peer)), ("shortcutId", ConstructorParameterDescription(shortcutId)), ("id", ConstructorParameterDescription(id)), ("randomId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("reaction", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("randomId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("options", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("randomId", ConstructorParameterDescription(randomId)), ("buttonText", ConstructorParameterDescription(buttonText)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(botQueryId)), ("result", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("message", ConstructorParameterDescription(message)), ("url", ConstructorParameterDescription(url)), ("cacheTime", ConstructorParameterDescription(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 setBotGuestChatResult(queryId: Int64, result: Api.InputBotInlineResult) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(86706395) - serializeInt64(queryId, buffer: buffer, boxed: false) - result.serialize(buffer, true) - return (FunctionDescription(name: "messages.setBotGuestChatResult", parameters: [("queryId", ConstructorParameterDescription(queryId)), ("result", ConstructorParameterDescription(result))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in - let reader = BufferReader(buffer) - 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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("error", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("error", ConstructorParameterDescription(error)), ("shippingOptions", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("availableReactions", ConstructorParameterDescription(availableReactions)), ("reactionsLimit", ConstructorParameterDescription(reactionsLimit)), ("paidEnabled", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("theme", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("wallpaper", ConstructorParameterDescription(wallpaper)), ("settings", ConstructorParameterDescription(settings)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("typing", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(userId)), ("score", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("period", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("results", ConstructorParameterDescription(results)), ("cacheTime", ConstructorParameterDescription(cacheTime)), ("nextOffset", ConstructorParameterDescription(nextOffset)), ("switchPm", ConstructorParameterDescription(switchPm)), ("switchWebview", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(userId)), ("score", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("action", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("startParam", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("importId", ConstructorParameterDescription(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?, tone: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1413754042) - 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) - } - if Int(flags) & Int(1 << 2) != 0 { - serializeString(tone!, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.summarizeText", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("toLang", ConstructorParameterDescription(toLang)), ("tone", ConstructorParameterDescription(tone))]), 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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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(flags: Int32, peer: Api.InputPeer, enabled: Api.Bool, requestMsgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1308091851) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - enabled.serialize(buffer, true) - if Int(flags) & Int(1 << 0) != 0 { - serializeInt32(requestMsgId!, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.toggleNoForwards", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("enabled", ConstructorParameterDescription(enabled)), ("requestMsgId", ConstructorParameterDescription(requestMsgId))]), 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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("`private`", ConstructorParameterDescription(`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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stickersets", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("rejectComment", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("completed", ConstructorParameterDescription(completed)), ("incompleted", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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, tone: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1511079099) - 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) - if Int(flags) & Int(1 << 2) != 0 { - serializeString(tone!, buffer: buffer, boxed: false) - } - return (FunctionDescription(name: "messages.translateText", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("text", ConstructorParameterDescription(text)), ("toLang", ConstructorParameterDescription(toLang)), ("tone", ConstructorParameterDescription(tone))]), 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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("savedPeerId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("filter", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("topicId", ConstructorParameterDescription(topicId)), ("pinned", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("reaction", ConstructorParameterDescription(reaction)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("file", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("importId", ConstructorParameterDescription(importId)), ("fileName", ConstructorParameterDescription(fileName)), ("media", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("businessConnectionId", ConstructorParameterDescription(businessConnectionId)), ("peer", ConstructorParameterDescription(peer)), ("media", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(receipt)), ("purpose", ConstructorParameterDescription(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", ConstructorParameterDescription(receipt)), ("purpose", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("chargeId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("subscriptionId", ConstructorParameterDescription(subscriptionId)), ("canceled", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("title", ConstructorParameterDescription(title)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("collectionId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("subscriptionId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetLink", ConstructorParameterDescription(offsetLink)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(giftId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("invoice", ConstructorParameterDescription(invoice)), ("themeParams", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("boostPeer", ConstructorParameterDescription(boostPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.PremiumGiftCodeOption]? in - let reader = BufferReader(buffer) - var result: [Api.PremiumGiftCodeOption]? + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_storyReactionsList: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyReactionsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("reactions", ConstructorParameterDescription(self.reactions)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .storyReactionsList(let _data): + return ("storyReactionsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("reactions", ConstructorParameterDescription(_data.reactions)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) + } + } + + public static func parse_storyReactionsList(_ reader: BufferReader) -> StoryReactionsList? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: [Api.StoryReaction]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.PremiumGiftCodeOption.self) + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryReaction.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", ConstructorParameterDescription(flags)), ("attributesHash", ConstructorParameterDescription(attributesHash)), ("giftId", ConstructorParameterDescription(giftId)), ("attributes", ConstructorParameterDescription(attributes)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("collectionId", ConstructorParameterDescription(collectionId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(auction)), ("version", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(stargift)), ("password", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsGiftOption]? in - let reader = BufferReader(buffer) - var result: [Api.StarsGiftOption]? + var _4: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiftOption.self) + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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]? + var _5: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsGiveawayOption.self) + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.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", ConstructorParameterDescription(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 + var _6: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _6 = parseString(reader) } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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 + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.stories.StoryReactionsList.storyReactionsList(Cons_storyReactionsList(flags: _1!, count: _2!, reactions: _3!, chats: _4!, users: _5!, nextOffset: _6)) + } + else { + return nil } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("amount", ConstructorParameterDescription(amount)), ("password", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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 +public extension Api.stories { + enum StoryViews: TypeConstructorDescription { + public class Cons_storyViews: TypeConstructorDescription { + public var views: [Api.StoryViews] + public var users: [Api.User] + public init(views: [Api.StoryViews], users: [Api.User]) { + self.views = views + self.users = users } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(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 + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViews", [("views", ConstructorParameterDescription(self.views)), ("users", ConstructorParameterDescription(self.users))]) } - 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]? + } + 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, ConstructorParameterDescription)]) { + switch self { + case .storyViews(let _data): + return ("storyViews", [("views", ConstructorParameterDescription(_data.views)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_storyViews(_ reader: BufferReader) -> StoryViews? { + var _1: [Api.StoryViews]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.StarsTopupOption.self) + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryViews.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", ConstructorParameterDescription(flags)), ("subscriptionId", ConstructorParameterDescription(subscriptionId)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("giveawayId", ConstructorParameterDescription(giveawayId)), ("purpose", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("chargeId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("offerMsgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("formId", ConstructorParameterDescription(formId)), ("invoice", ConstructorParameterDescription(invoice)), ("requestedInfoId", ConstructorParameterDescription(requestedInfoId)), ("shippingOptionId", ConstructorParameterDescription(shippingOptionId)), ("credentials", ConstructorParameterDescription(credentials)), ("tipAmount", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("slug", ConstructorParameterDescription(slug)), ("price", ConstructorParameterDescription(price)), ("duration", ConstructorParameterDescription(duration)), ("randomId", ConstructorParameterDescription(randomId)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(formId)), ("invoice", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(stargift)), ("toId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("collectionId", ConstructorParameterDescription(collectionId)), ("title", ConstructorParameterDescription(title)), ("deleteStargift", ConstructorParameterDescription(deleteStargift)), ("addStargift", ConstructorParameterDescription(addStargift)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(stargift)), ("resellAmount", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("invoice", ConstructorParameterDescription(invoice)), ("info", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("gB", ConstructorParameterDescription(gB)), ("`protocol`", ConstructorParameterDescription(`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", ConstructorParameterDescription(call)), ("sources", ConstructorParameterDescription(sources))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? + var _2: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.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", ConstructorParameterDescription(peer)), ("gA", ConstructorParameterDescription(gA)), ("keyFingerprint", ConstructorParameterDescription(keyFingerprint)), ("`protocol`", ConstructorParameterDescription(`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 + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.stories.StoryViews.storyViews(Cons_storyViews(views: _1!, users: _2!)) + } + else { + return nil } - 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) + } +} +public extension Api.stories { + enum StoryViewsList: TypeConstructorDescription { + public class Cons_storyViewsList: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViewsList", [("flags", ConstructorParameterDescription(self.flags)), ("count", ConstructorParameterDescription(self.count)), ("viewsCount", ConstructorParameterDescription(self.viewsCount)), ("forwardsCount", ConstructorParameterDescription(self.forwardsCount)), ("reactionsCount", ConstructorParameterDescription(self.reactionsCount)), ("views", ConstructorParameterDescription(self.views)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) + } } - if Int(flags) & Int(1 << 3) != 0 { - params!.serialize(buffer, true) + 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 + } } - return (FunctionDescription(name: "phone.createConferenceCall", parameters: [("flags", ConstructorParameterDescription(flags)), ("randomId", ConstructorParameterDescription(randomId)), ("publicKey", ConstructorParameterDescription(publicKey)), ("block", ConstructorParameterDescription(block)), ("params", ConstructorParameterDescription(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 + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .storyViewsList(let _data): + return ("storyViewsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("viewsCount", ConstructorParameterDescription(_data.viewsCount)), ("forwardsCount", ConstructorParameterDescription(_data.forwardsCount)), ("reactionsCount", ConstructorParameterDescription(_data.reactionsCount)), ("views", ConstructorParameterDescription(_data.views)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) } - 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("title", ConstructorParameterDescription(title)), ("scheduleDate", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("ids", ConstructorParameterDescription(ids)), ("block", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("messages", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("participant", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("duration", ConstructorParameterDescription(duration)), ("reason", ConstructorParameterDescription(reason)), ("connectionId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("participant", ConstructorParameterDescription(participant)), ("muted", ConstructorParameterDescription(muted)), ("volume", ConstructorParameterDescription(volume)), ("raiseHand", ConstructorParameterDescription(raiseHand)), ("videoStopped", ConstructorParameterDescription(videoStopped)), ("videoPaused", ConstructorParameterDescription(videoPaused)), ("presentationPaused", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(call)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("subChainId", ConstructorParameterDescription(subChainId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("revoke", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("ids", ConstructorParameterDescription(ids)), ("sources", ConstructorParameterDescription(sources)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("users", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("joinAs", ConstructorParameterDescription(joinAs)), ("inviteHash", ConstructorParameterDescription(inviteHash)), ("publicKey", ConstructorParameterDescription(publicKey)), ("block", ConstructorParameterDescription(block)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("source", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("randomId", ConstructorParameterDescription(randomId)), ("gAHash", ConstructorParameterDescription(gAHash)), ("`protocol`", ConstructorParameterDescription(`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", ConstructorParameterDescription(peer)), ("debug", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("file", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("joinAs", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("block", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("encryptedMessage", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("randomId", ConstructorParameterDescription(randomId)), ("message", ConstructorParameterDescription(message)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("rating", ConstructorParameterDescription(rating)), ("comment", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("title", ConstructorParameterDescription(title)), ("videoPortrait", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("joinMuted", ConstructorParameterDescription(joinMuted)), ("messagesEnabled", ConstructorParameterDescription(messagesEnabled)), ("sendPaidMessagesStars", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("subscribed", ConstructorParameterDescription(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", ConstructorParameterDescription(id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in - let reader = BufferReader(buffer) - var result: [Int64]? + + public static func parse_storyViewsList(_ reader: BufferReader) -> StoryViewsList? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + var _6: [Api.StoryView]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self) + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryView.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", ConstructorParameterDescription(userId)), ("offset", ConstructorParameterDescription(offset)), ("maxId", ConstructorParameterDescription(maxId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("file", ConstructorParameterDescription(file)), ("video", ConstructorParameterDescription(video)), ("videoStartTs", ConstructorParameterDescription(videoStartTs)), ("videoEmojiMarkup", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("file", ConstructorParameterDescription(file)), ("video", ConstructorParameterDescription(video)), ("videoStartTs", ConstructorParameterDescription(videoStartTs)), ("videoEmojiMarkup", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("slots", ConstructorParameterDescription(slots)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(peer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("jobId", ConstructorParameterDescription(jobId)), ("error", ConstructorParameterDescription(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", ConstructorParameterDescription(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 - }) - } -} -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 - }) - } -} -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 - }) - } -} -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 - }) - } -} -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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("msgId", ConstructorParameterDescription(msgId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("msgId", ConstructorParameterDescription(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 getPollStats(flags: Int32, peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1031931288) - serializeInt32(flags, buffer: buffer, boxed: false) - peer.serialize(buffer, true) - serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getPollStats", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PollStats? in - let reader = BufferReader(buffer) - var result: Api.stats.PollStats? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.stats.PollStats - } - 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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("token", ConstructorParameterDescription(token)), ("x", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("sticker", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("sticker", ConstructorParameterDescription(sticker)), ("emoji", ConstructorParameterDescription(emoji)), ("maskCoords", ConstructorParameterDescription(maskCoords)), ("keywords", ConstructorParameterDescription(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", ConstructorParameterDescription(sticker)), ("position", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("title", ConstructorParameterDescription(title)), ("shortName", ConstructorParameterDescription(shortName)), ("thumb", ConstructorParameterDescription(thumb)), ("stickers", ConstructorParameterDescription(stickers)), ("software", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(sticker)), ("newSticker", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stickerset", ConstructorParameterDescription(stickerset)), ("thumb", ConstructorParameterDescription(thumb)), ("thumbDocumentId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("title", ConstructorParameterDescription(title)), ("stories", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("albumId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in - let reader = BufferReader(buffer) - var result: [Int32]? + var _7: [Api.Chat]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.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]?, music: Api.InputDocument?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(744728363) - 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) - } - } - if Int(flags) & Int(1 << 4) != 0 { - music!.serialize(buffer, true) - } - return (FunctionDescription(name: "stories.editStory", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("media", ConstructorParameterDescription(media)), ("mediaAreas", ConstructorParameterDescription(mediaAreas)), ("caption", ConstructorParameterDescription(caption)), ("entities", ConstructorParameterDescription(entities)), ("privacyRules", ConstructorParameterDescription(privacyRules)), ("music", ConstructorParameterDescription(music))]), 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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("albumId", ConstructorParameterDescription(albumId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(flags)), ("state", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.RecentStory]? in - let reader = BufferReader(buffer) - var result: [Api.RecentStory]? + var _8: [Api.User]? if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentStory.self) + _8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.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", ConstructorParameterDescription(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 + var _9: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _9 = parseString(reader) } - 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", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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 + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + let _c8 = _8 != nil + let _c9 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + 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)) } - 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", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("reaction", ConstructorParameterDescription(reaction)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("q", ConstructorParameterDescription(q)), ("id", ConstructorParameterDescription(id)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("option", ConstructorParameterDescription(option)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("hashtag", ConstructorParameterDescription(hashtag)), ("area", ConstructorParameterDescription(area)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("storyId", ConstructorParameterDescription(storyId)), ("reaction", ConstructorParameterDescription(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]?, music: Api.InputDocument?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(-1885443944) - 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) + else { + return nil } } - 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) - } - } - if Int(flags) & Int(1 << 9) != 0 { - music!.serialize(buffer, true) - } - return (FunctionDescription(name: "stories.sendStory", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("media", ConstructorParameterDescription(media)), ("mediaAreas", ConstructorParameterDescription(mediaAreas)), ("caption", ConstructorParameterDescription(caption)), ("entities", ConstructorParameterDescription(entities)), ("privacyRules", ConstructorParameterDescription(privacyRules)), ("randomId", ConstructorParameterDescription(randomId)), ("period", ConstructorParameterDescription(period)), ("fwdFromId", ConstructorParameterDescription(fwdFromId)), ("fwdFromStory", ConstructorParameterDescription(fwdFromStory)), ("albums", ConstructorParameterDescription(albums)), ("music", ConstructorParameterDescription(music))]), 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("caption", ConstructorParameterDescription(caption)), ("entities", ConstructorParameterDescription(entities)), ("privacyRules", ConstructorParameterDescription(privacyRules)), ("randomId", ConstructorParameterDescription(randomId)), ("messagesEnabled", ConstructorParameterDescription(messagesEnabled)), ("sendPaidMessagesStars", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hidden", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("pinned", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("albumId", ConstructorParameterDescription(albumId)), ("title", ConstructorParameterDescription(title)), ("deleteStories", ConstructorParameterDescription(deleteStories)), ("addStories", ConstructorParameterDescription(addStories)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("filter", ConstructorParameterDescription(filter)), ("pts", ConstructorParameterDescription(pts)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("pts", ConstructorParameterDescription(pts)), ("ptsLimit", ConstructorParameterDescription(ptsLimit)), ("ptsTotalLimit", ConstructorParameterDescription(ptsTotalLimit)), ("date", ConstructorParameterDescription(date)), ("qts", ConstructorParameterDescription(qts)), ("qtsLimit", ConstructorParameterDescription(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 - }) - } -} -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", ConstructorParameterDescription(fileToken)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(fileToken)), ("offset", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("location", ConstructorParameterDescription(location)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(location)), ("offset", ConstructorParameterDescription(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", ConstructorParameterDescription(location)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(fileToken)), ("requestToken", ConstructorParameterDescription(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", ConstructorParameterDescription(fileId)), ("filePart", ConstructorParameterDescription(filePart)), ("fileTotalParts", ConstructorParameterDescription(fileTotalParts)), ("bytes", ConstructorParameterDescription(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", ConstructorParameterDescription(fileId)), ("filePart", ConstructorParameterDescription(filePart)), ("bytes", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("documents", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("errors", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("birthday", ConstructorParameterDescription(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/Api41.swift b/submodules/TelegramApi/Sources/Api41.swift new file mode 100644 index 0000000000..8b6e86504c --- /dev/null +++ b/submodules/TelegramApi/Sources/Api41.swift @@ -0,0 +1,1071 @@ +public extension Api.updates { + indirect enum ChannelDifference: TypeConstructorDescription { + public class Cons_channelDifference: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelDifference", [("flags", ConstructorParameterDescription(self.flags)), ("pts", ConstructorParameterDescription(self.pts)), ("timeout", ConstructorParameterDescription(self.timeout)), ("newMessages", ConstructorParameterDescription(self.newMessages)), ("otherUpdates", ConstructorParameterDescription(self.otherUpdates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_channelDifferenceEmpty: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelDifferenceEmpty", [("flags", ConstructorParameterDescription(self.flags)), ("pts", ConstructorParameterDescription(self.pts)), ("timeout", ConstructorParameterDescription(self.timeout))]) + } + } + public class Cons_channelDifferenceTooLong: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelDifferenceTooLong", [("flags", ConstructorParameterDescription(self.flags)), ("timeout", ConstructorParameterDescription(self.timeout)), ("dialog", ConstructorParameterDescription(self.dialog)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .channelDifference(let _data): + return ("channelDifference", [("flags", ConstructorParameterDescription(_data.flags)), ("pts", ConstructorParameterDescription(_data.pts)), ("timeout", ConstructorParameterDescription(_data.timeout)), ("newMessages", ConstructorParameterDescription(_data.newMessages)), ("otherUpdates", ConstructorParameterDescription(_data.otherUpdates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + case .channelDifferenceEmpty(let _data): + return ("channelDifferenceEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("pts", ConstructorParameterDescription(_data.pts)), ("timeout", ConstructorParameterDescription(_data.timeout))]) + case .channelDifferenceTooLong(let _data): + return ("channelDifferenceTooLong", [("flags", ConstructorParameterDescription(_data.flags)), ("timeout", ConstructorParameterDescription(_data.timeout)), ("dialog", ConstructorParameterDescription(_data.dialog)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + 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 ?? 0) & 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) + } + var _5: [Api.Update]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) + } + var _6: [Api.Chat]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _7: [Api.User]? + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.updates.ChannelDifference.channelDifference(Cons_channelDifference(flags: _1!, pts: _2!, timeout: _3, newMessages: _4!, otherUpdates: _5!, chats: _6!, users: _7!)) + } + else { + return nil + } + } + public static func parse_channelDifferenceEmpty(_ reader: BufferReader) -> ChannelDifference? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _3 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.updates.ChannelDifference.channelDifferenceEmpty(Cons_channelDifferenceEmpty(flags: _1!, pts: _2!, timeout: _3)) + } + else { + return nil + } + } + public static func parse_channelDifferenceTooLong(_ reader: BufferReader) -> ChannelDifference? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + if Int(_1 ?? 0) & 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 + } + var _4: [Api.Message]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _5: [Api.Chat]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _6: [Api.User]? + if let _ = reader.readInt32() { + _6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + 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 { + public class Cons_difference: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("difference", [("newMessages", ConstructorParameterDescription(self.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(self.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(self.otherUpdates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("state", ConstructorParameterDescription(self.state))]) + } + } + public class Cons_differenceEmpty: TypeConstructorDescription { + public var date: Int32 + public var seq: Int32 + public init(date: Int32, seq: Int32) { + self.date = date + self.seq = seq + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("differenceEmpty", [("date", ConstructorParameterDescription(self.date)), ("seq", ConstructorParameterDescription(self.seq))]) + } + } + public class Cons_differenceSlice: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("differenceSlice", [("newMessages", ConstructorParameterDescription(self.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(self.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(self.otherUpdates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users)), ("intermediateState", ConstructorParameterDescription(self.intermediateState))]) + } + } + public class Cons_differenceTooLong: TypeConstructorDescription { + public var pts: Int32 + public init(pts: Int32) { + self.pts = pts + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("differenceTooLong", [("pts", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .difference(let _data): + return ("difference", [("newMessages", ConstructorParameterDescription(_data.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(_data.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(_data.otherUpdates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("state", ConstructorParameterDescription(_data.state))]) + case .differenceEmpty(let _data): + return ("differenceEmpty", [("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq))]) + case .differenceSlice(let _data): + return ("differenceSlice", [("newMessages", ConstructorParameterDescription(_data.newMessages)), ("newEncryptedMessages", ConstructorParameterDescription(_data.newEncryptedMessages)), ("otherUpdates", ConstructorParameterDescription(_data.otherUpdates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("intermediateState", ConstructorParameterDescription(_data.intermediateState))]) + case .differenceTooLong(let _data): + return ("differenceTooLong", [("pts", ConstructorParameterDescription(_data.pts))]) + } + } + + public static func parse_difference(_ reader: BufferReader) -> Difference? { + var _1: [Api.Message]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _2: [Api.EncryptedMessage]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EncryptedMessage.self) + } + var _3: [Api.Update]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) + } + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: Api.updates.State? + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.updates.State + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.updates.Difference.difference(Cons_difference(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, state: _6!)) + } + else { + return nil + } + } + public static func parse_differenceEmpty(_ reader: BufferReader) -> Difference? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.updates.Difference.differenceEmpty(Cons_differenceEmpty(date: _1!, seq: _2!)) + } + else { + return nil + } + } + public static func parse_differenceSlice(_ reader: BufferReader) -> Difference? { + var _1: [Api.Message]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Message.self) + } + var _2: [Api.EncryptedMessage]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.EncryptedMessage.self) + } + var _3: [Api.Update]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Update.self) + } + var _4: [Api.Chat]? + if let _ = reader.readInt32() { + _4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _5: [Api.User]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + var _6: Api.updates.State? + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.updates.State + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.updates.Difference.differenceSlice(Cons_differenceSlice(newMessages: _1!, newEncryptedMessages: _2!, otherUpdates: _3!, chats: _4!, users: _5!, intermediateState: _6!)) + } + else { + return nil + } + } + public static func parse_differenceTooLong(_ reader: BufferReader) -> Difference? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.updates.Difference.differenceTooLong(Cons_differenceTooLong(pts: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.updates { + enum State: TypeConstructorDescription { + public class Cons_state: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("state", [("pts", ConstructorParameterDescription(self.pts)), ("qts", ConstructorParameterDescription(self.qts)), ("date", ConstructorParameterDescription(self.date)), ("seq", ConstructorParameterDescription(self.seq)), ("unreadCount", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .state(let _data): + return ("state", [("pts", ConstructorParameterDescription(_data.pts)), ("qts", ConstructorParameterDescription(_data.qts)), ("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount))]) + } + } + + public static func parse_state(_ reader: BufferReader) -> State? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: Int32? + _3 = reader.readInt32() + var _4: Int32? + _4 = reader.readInt32() + var _5: Int32? + _5 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_cdnFile: TypeConstructorDescription { + public var bytes: Buffer + public init(bytes: Buffer) { + self.bytes = bytes + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("cdnFile", [("bytes", ConstructorParameterDescription(self.bytes))]) + } + } + public class Cons_cdnFileReuploadNeeded: TypeConstructorDescription { + public var requestToken: Buffer + public init(requestToken: Buffer) { + self.requestToken = requestToken + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("cdnFileReuploadNeeded", [("requestToken", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .cdnFile(let _data): + return ("cdnFile", [("bytes", ConstructorParameterDescription(_data.bytes))]) + case .cdnFileReuploadNeeded(let _data): + return ("cdnFileReuploadNeeded", [("requestToken", ConstructorParameterDescription(_data.requestToken))]) + } + } + + 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(Cons_cdnFile(bytes: _1!)) + } + else { + return nil + } + } + public static func parse_cdnFileReuploadNeeded(_ reader: BufferReader) -> CdnFile? { + var _1: Buffer? + _1 = parseBytes(reader) + let _c1 = _1 != nil + if _c1 { + return Api.upload.CdnFile.cdnFileReuploadNeeded(Cons_cdnFileReuploadNeeded(requestToken: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.upload { + enum File: TypeConstructorDescription { + public class Cons_file: TypeConstructorDescription { + 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 func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("file", [("type", ConstructorParameterDescription(self.type)), ("mtime", ConstructorParameterDescription(self.mtime)), ("bytes", ConstructorParameterDescription(self.bytes))]) + } + } + public class Cons_fileCdnRedirect: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("fileCdnRedirect", [("dcId", ConstructorParameterDescription(self.dcId)), ("fileToken", ConstructorParameterDescription(self.fileToken)), ("encryptionKey", ConstructorParameterDescription(self.encryptionKey)), ("encryptionIv", ConstructorParameterDescription(self.encryptionIv)), ("fileHashes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .file(let _data): + return ("file", [("type", ConstructorParameterDescription(_data.type)), ("mtime", ConstructorParameterDescription(_data.mtime)), ("bytes", ConstructorParameterDescription(_data.bytes))]) + case .fileCdnRedirect(let _data): + return ("fileCdnRedirect", [("dcId", ConstructorParameterDescription(_data.dcId)), ("fileToken", ConstructorParameterDescription(_data.fileToken)), ("encryptionKey", ConstructorParameterDescription(_data.encryptionKey)), ("encryptionIv", ConstructorParameterDescription(_data.encryptionIv)), ("fileHashes", ConstructorParameterDescription(_data.fileHashes))]) + } + } + + public static func parse_file(_ reader: BufferReader) -> File? { + var _1: Api.storage.FileType? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.storage.FileType + } + var _2: Int32? + _2 = reader.readInt32() + var _3: Buffer? + _3 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.upload.File.file(Cons_file(type: _1!, mtime: _2!, bytes: _3!)) + } + else { + return nil + } + } + public static func parse_fileCdnRedirect(_ reader: BufferReader) -> File? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Buffer? + _2 = parseBytes(reader) + var _3: Buffer? + _3 = parseBytes(reader) + var _4: Buffer? + _4 = parseBytes(reader) + var _5: [Api.FileHash]? + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.FileHash.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_webFile: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webFile", [("size", ConstructorParameterDescription(self.size)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("fileType", ConstructorParameterDescription(self.fileType)), ("mtime", ConstructorParameterDescription(self.mtime)), ("bytes", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .webFile(let _data): + return ("webFile", [("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("fileType", ConstructorParameterDescription(_data.fileType)), ("mtime", ConstructorParameterDescription(_data.mtime)), ("bytes", ConstructorParameterDescription(_data.bytes))]) + } + } + + public static func parse_webFile(_ reader: BufferReader) -> WebFile? { + var _1: Int32? + _1 = reader.readInt32() + var _2: String? + _2 = parseString(reader) + var _3: Api.storage.FileType? + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.storage.FileType + } + var _4: Int32? + _4 = reader.readInt32() + var _5: Buffer? + _5 = parseBytes(reader) + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + 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 { + public class Cons_savedMusic: TypeConstructorDescription { + public var count: Int32 + public var documents: [Api.Document] + public init(count: Int32, documents: [Api.Document]) { + self.count = count + self.documents = documents + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedMusic", [("count", ConstructorParameterDescription(self.count)), ("documents", ConstructorParameterDescription(self.documents))]) + } + } + public class Cons_savedMusicNotModified: TypeConstructorDescription { + public var count: Int32 + public init(count: Int32) { + self.count = count + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedMusicNotModified", [("count", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .savedMusic(let _data): + return ("savedMusic", [("count", ConstructorParameterDescription(_data.count)), ("documents", ConstructorParameterDescription(_data.documents))]) + case .savedMusicNotModified(let _data): + return ("savedMusicNotModified", [("count", ConstructorParameterDescription(_data.count))]) + } + } + + public static func parse_savedMusic(_ reader: BufferReader) -> SavedMusic? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.Document]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.users.SavedMusic.savedMusic(Cons_savedMusic(count: _1!, documents: _2!)) + } + else { + return nil + } + } + public static func parse_savedMusicNotModified(_ reader: BufferReader) -> SavedMusic? { + var _1: Int32? + _1 = reader.readInt32() + let _c1 = _1 != nil + if _c1 { + return Api.users.SavedMusic.savedMusicNotModified(Cons_savedMusicNotModified(count: _1!)) + } + else { + return nil + } + } + } +} +public extension Api.users { + enum UserFull: TypeConstructorDescription { + public class Cons_userFull: TypeConstructorDescription { + 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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userFull", [("fullUser", ConstructorParameterDescription(self.fullUser)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .userFull(let _data): + return ("userFull", [("fullUser", ConstructorParameterDescription(_data.fullUser)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_userFull(_ reader: BufferReader) -> UserFull? { + var _1: Api.UserFull? + if let signature = reader.readInt32() { + _1 = Api.parse(reader, signature: signature) as? Api.UserFull + } + var _2: [Api.Chat]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self) + } + var _3: [Api.User]? + if let _ = reader.readInt32() { + _3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + if _c1 && _c2 && _c3 { + return Api.users.UserFull.userFull(Cons_userFull(fullUser: _1!, chats: _2!, users: _3!)) + } + else { + return nil + } + } + } +} +public extension Api.users { + enum Users: TypeConstructorDescription { + public class Cons_users: TypeConstructorDescription { + public var users: [Api.User] + public init(users: [Api.User]) { + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("users", [("users", ConstructorParameterDescription(self.users))]) + } + } + public class Cons_usersSlice: TypeConstructorDescription { + public var count: Int32 + public var users: [Api.User] + public init(count: Int32, users: [Api.User]) { + self.count = count + self.users = users + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("usersSlice", [("count", ConstructorParameterDescription(self.count)), ("users", ConstructorParameterDescription(self.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, ConstructorParameterDescription)]) { + switch self { + case .users(let _data): + return ("users", [("users", ConstructorParameterDescription(_data.users))]) + case .usersSlice(let _data): + return ("usersSlice", [("count", ConstructorParameterDescription(_data.count)), ("users", ConstructorParameterDescription(_data.users))]) + } + } + + public static func parse_users(_ reader: BufferReader) -> Users? { + var _1: [Api.User]? + if let _ = reader.readInt32() { + _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + if _c1 { + return Api.users.Users.users(Cons_users(users: _1!)) + } + else { + return nil + } + } + public static func parse_usersSlice(_ reader: BufferReader) -> Users? { + var _1: Int32? + _1 = reader.readInt32() + var _2: [Api.User]? + if let _ = reader.readInt32() { + _2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + if _c1 && _c2 { + return Api.users.Users.usersSlice(Cons_usersSlice(count: _1!, users: _2!)) + } + else { + return nil + } + } + } +} diff --git a/submodules/TelegramApi/Sources/Api42.swift b/submodules/TelegramApi/Sources/Api42.swift new file mode 100644 index 0000000000..ebd500eb5b --- /dev/null +++ b/submodules/TelegramApi/Sources/Api42.swift @@ -0,0 +1,14093 @@ +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", ConstructorParameterDescription(botId)), ("scope", ConstructorParameterDescription(scope)), ("publicKey", ConstructorParameterDescription(publicKey)), ("valueHashes", ConstructorParameterDescription(valueHashes)), ("credentials", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("hash", ConstructorParameterDescription(hash)), ("encryptedRequestsDisabled", ConstructorParameterDescription(encryptedRequestsDisabled)), ("callRequestsDisabled", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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 confirmBotConnection(botId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1743593320) + botId.serialize(buffer, true) + return (FunctionDescription(name: "account.confirmBotConnection", parameters: [("botId", ConstructorParameterDescription(botId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("slug", ConstructorParameterDescription(slug)), ("title", ConstructorParameterDescription(title)), ("document", ConstructorParameterDescription(document)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("reason", ConstructorParameterDescription(reason)), ("password", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 deleteWebBrowserSettingsExceptions() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2036304291) + return (FunctionDescription(name: "account.deleteWebBrowserSettingsExceptions", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WebBrowserSettings? in + let reader = BufferReader(buffer) + var result: Api.account.WebBrowserSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.WebBrowserSettings + } + 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", ConstructorParameterDescription(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", ConstructorParameterDescription(slug)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(botId)), ("scope", ConstructorParameterDescription(scope)), ("publicKey", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(format)), ("theme", ConstructorParameterDescription(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", ConstructorParameterDescription(format)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(password)), ("period", ConstructorParameterDescription(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", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 getWebBrowserSettings(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1449482088) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.getWebBrowserSettings", parameters: [("hash", ConstructorParameterDescription(hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WebBrowserSettings? in + let reader = BufferReader(buffer) + var result: Api.account.WebBrowserSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.WebBrowserSettings + } + 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", ConstructorParameterDescription(flags)), ("fileMaxSize", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("theme", ConstructorParameterDescription(theme)), ("format", ConstructorParameterDescription(format)), ("baseTheme", ConstructorParameterDescription(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", ConstructorParameterDescription(wallpaper)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("tokenType", ConstructorParameterDescription(tokenType)), ("token", ConstructorParameterDescription(token)), ("appSandbox", ConstructorParameterDescription(appSandbox)), ("secret", ConstructorParameterDescription(secret)), ("otherUids", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("reason", ConstructorParameterDescription(reason)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("photoId", ConstructorParameterDescription(photoId)), ("reason", ConstructorParameterDescription(reason)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("afterId", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(value)), ("secureSecretId", ConstructorParameterDescription(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", ConstructorParameterDescription(theme)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(wallpaper)), ("unsave", ConstructorParameterDescription(unsave)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(hash)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(purpose)), ("email", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(key)), ("rules", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("paused", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(username)), ("active", ConstructorParameterDescription(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 toggleWebBrowserSettingsException(flags: Int32, openExternalBrowser: Api.Bool?, url: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(755631473) + serializeInt32(flags, buffer: buffer, boxed: false) + if Int(flags) & Int(1 << 0) != 0 { + openExternalBrowser!.serialize(buffer, true) + } + serializeString(url, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.toggleWebBrowserSettingsException", parameters: [("flags", ConstructorParameterDescription(flags)), ("openExternalBrowser", ConstructorParameterDescription(openExternalBrowser)), ("url", ConstructorParameterDescription(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.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", ConstructorParameterDescription(tokenType)), ("token", ConstructorParameterDescription(token)), ("otherUids", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("birthday", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("intro", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("address", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("businessWorkHours", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("color", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("rights", ConstructorParameterDescription(rights)), ("bot", ConstructorParameterDescription(bot)), ("recipients", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(password)), ("newSettings", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("firstName", ConstructorParameterDescription(firstName)), ("lastName", ConstructorParameterDescription(lastName)), ("about", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("format", ConstructorParameterDescription(format)), ("theme", ConstructorParameterDescription(theme)), ("slug", ConstructorParameterDescription(slug)), ("title", ConstructorParameterDescription(title)), ("document", ConstructorParameterDescription(document)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(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 updateWebBrowserSettings(flags: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1696627970) + serializeInt32(flags, buffer: buffer, boxed: false) + return (FunctionDescription(name: "account.updateWebBrowserSettings", parameters: [("flags", ConstructorParameterDescription(flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WebBrowserSettings? in + let reader = BufferReader(buffer) + var result: Api.account.WebBrowserSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.account.WebBrowserSettings + } + 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", ConstructorParameterDescription(file)), ("fileName", ConstructorParameterDescription(fileName)), ("mimeType", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("file", ConstructorParameterDescription(file)), ("thumb", ConstructorParameterDescription(thumb)), ("fileName", ConstructorParameterDescription(fileName)), ("mimeType", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("file", ConstructorParameterDescription(file)), ("mimeType", ConstructorParameterDescription(mimeType)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(purpose)), ("verification", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(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.aicompose { + static func createTone(flags: Int32, emojiId: Int64, title: String, prompt: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1252538643) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeInt64(emojiId, buffer: buffer, boxed: false) + serializeString(title, buffer: buffer, boxed: false) + serializeString(prompt, buffer: buffer, boxed: false) + return (FunctionDescription(name: "aicompose.createTone", parameters: [("flags", ConstructorParameterDescription(flags)), ("emojiId", ConstructorParameterDescription(emojiId)), ("title", ConstructorParameterDescription(title)), ("prompt", ConstructorParameterDescription(prompt))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AiComposeTone? in + let reader = BufferReader(buffer) + var result: Api.AiComposeTone? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.AiComposeTone + } + return result + }) + } +} +public extension Api.functions.aicompose { + static func deleteTone(tone: Api.InputAiComposeTone) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-583454358) + tone.serialize(buffer, true) + return (FunctionDescription(name: "aicompose.deleteTone", parameters: [("tone", ConstructorParameterDescription(tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + var result: Api.Bool? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.Bool + } + return result + }) + } +} +public extension Api.functions.aicompose { + static func getTone(tone: Api.InputAiComposeTone) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1293370877) + tone.serialize(buffer, true) + return (FunctionDescription(name: "aicompose.getTone", parameters: [("tone", ConstructorParameterDescription(tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.aicompose.Tones? in + let reader = BufferReader(buffer) + var result: Api.aicompose.Tones? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.aicompose.Tones + } + return result + }) + } +} +public extension Api.functions.aicompose { + static func getToneExample(tone: Api.InputAiComposeTone, num: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-776688876) + tone.serialize(buffer, true) + serializeInt32(num, buffer: buffer, boxed: false) + return (FunctionDescription(name: "aicompose.getToneExample", parameters: [("tone", ConstructorParameterDescription(tone)), ("num", ConstructorParameterDescription(num))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AiComposeToneExample? in + let reader = BufferReader(buffer) + var result: Api.AiComposeToneExample? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.AiComposeToneExample + } + return result + }) + } +} +public extension Api.functions.aicompose { + static func getTones(hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1412066815) + serializeInt64(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "aicompose.getTones", parameters: [("hash", ConstructorParameterDescription(hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.aicompose.Tones? in + let reader = BufferReader(buffer) + var result: Api.aicompose.Tones? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.aicompose.Tones + } + return result + }) + } +} +public extension Api.functions.aicompose { + static func saveTone(tone: Api.InputAiComposeTone, unsave: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(394447793) + tone.serialize(buffer, true) + unsave.serialize(buffer, true) + return (FunctionDescription(name: "aicompose.saveTone", parameters: [("tone", ConstructorParameterDescription(tone)), ("unsave", ConstructorParameterDescription(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.aicompose { + static func updateTone(flags: Int32, tone: Api.InputAiComposeTone, displayAuthor: Api.Bool?, emojiId: Int64?, title: String?, prompt: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1875128487) + serializeInt32(flags, buffer: buffer, boxed: false) + tone.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + displayAuthor!.serialize(buffer, true) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeInt64(emojiId!, 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(prompt!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "aicompose.updateTone", parameters: [("flags", ConstructorParameterDescription(flags)), ("tone", ConstructorParameterDescription(tone)), ("displayAuthor", ConstructorParameterDescription(displayAuthor)), ("emojiId", ConstructorParameterDescription(emojiId)), ("title", ConstructorParameterDescription(title)), ("prompt", ConstructorParameterDescription(prompt))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AiComposeTone? in + let reader = BufferReader(buffer) + var result: Api.AiComposeTone? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.AiComposeTone + } + 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", ConstructorParameterDescription(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", ConstructorParameterDescription(permAuthKeyId)), ("nonce", ConstructorParameterDescription(nonce)), ("expiresAt", ConstructorParameterDescription(expiresAt)), ("encryptedMessage", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("formId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("exceptIds", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("credential", ConstructorParameterDescription(credential)), ("fromDcId", ConstructorParameterDescription(fromDcId)), ("fromAuthKeyId", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("bytes", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("apiId", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("botAuthToken", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("webAuthToken", ConstructorParameterDescription(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", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(flags)), ("code", ConstructorParameterDescription(code)), ("newSettings", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("mnc", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("safetyNetToken", ConstructorParameterDescription(safetyNetToken)), ("playIntegrityToken", ConstructorParameterDescription(playIntegrityToken)), ("iosPushSecret", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("reason", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(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", ConstructorParameterDescription(phoneNumber)), ("apiId", ConstructorParameterDescription(apiId)), ("apiHash", ConstructorParameterDescription(apiHash)), ("settings", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("phoneCode", ConstructorParameterDescription(phoneCode)), ("emailVerification", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("phoneNumber", ConstructorParameterDescription(phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(phoneCodeHash)), ("firstName", ConstructorParameterDescription(firstName)), ("lastName", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("media", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(queryId)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("fileName", ConstructorParameterDescription(fileName)), ("url", ConstructorParameterDescription(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 checkUsername(username: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-2014174821) + serializeString(username, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.checkUsername", parameters: [("username", ConstructorParameterDescription(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.bots { + static func createBot(flags: Int32, name: String, username: String, managerId: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-441352405) + serializeInt32(flags, buffer: buffer, boxed: false) + serializeString(name, buffer: buffer, boxed: false) + serializeString(username, buffer: buffer, boxed: false) + managerId.serialize(buffer, true) + return (FunctionDescription(name: "bots.createBot", parameters: [("flags", ConstructorParameterDescription(flags)), ("name", ConstructorParameterDescription(name)), ("username", ConstructorParameterDescription(username)), ("managerId", ConstructorParameterDescription(managerId))]), 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.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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("media", ConstructorParameterDescription(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 editAccessSettings(flags: Int32, bot: Api.InputUser, addUsers: [Api.InputUser]?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(830553304) + serializeInt32(flags, buffer: buffer, boxed: false) + bot.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(addUsers!.count)) + for item in addUsers! { + item.serialize(buffer, true) + } + } + return (FunctionDescription(name: "bots.editAccessSettings", parameters: [("flags", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("addUsers", ConstructorParameterDescription(addUsers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("media", ConstructorParameterDescription(media)), ("newMedia", ConstructorParameterDescription(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 exportBotToken(bot: Api.InputUser, revoke: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1123182101) + bot.serialize(buffer, true) + revoke.serialize(buffer, true) + return (FunctionDescription(name: "bots.exportBotToken", parameters: [("bot", ConstructorParameterDescription(bot)), ("revoke", ConstructorParameterDescription(revoke))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.ExportedBotToken? in + let reader = BufferReader(buffer) + var result: Api.bots.ExportedBotToken? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.bots.ExportedBotToken + } + return result + }) + } +} +public extension Api.functions.bots { + static func getAccessSettings(bot: Api.InputUser) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(557339555) + bot.serialize(buffer, true) + return (FunctionDescription(name: "bots.getAccessSettings", parameters: [("bot", ConstructorParameterDescription(bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.AccessSettings? in + let reader = BufferReader(buffer) + var result: Api.bots.AccessSettings? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.bots.AccessSettings + } + 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 + }) + } +} +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", ConstructorParameterDescription(scope)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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 getRequestedWebViewButton(bot: Api.InputUser, webappReqId: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1088047117) + bot.serialize(buffer, true) + serializeString(webappReqId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "bots.getRequestedWebViewButton", parameters: [("bot", ConstructorParameterDescription(bot)), ("webappReqId", ConstructorParameterDescription(webappReqId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.KeyboardButton? in + let reader = BufferReader(buffer) + var result: Api.KeyboardButton? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.KeyboardButton + } + 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", ConstructorParameterDescription(bot)), ("customMethod", ConstructorParameterDescription(customMethod)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("order", ConstructorParameterDescription(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 requestWebViewButton(userId: Api.InputUser, button: Api.KeyboardButton) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(832742238) + userId.serialize(buffer, true) + button.serialize(buffer, true) + return (FunctionDescription(name: "bots.requestWebViewButton", parameters: [("userId", ConstructorParameterDescription(userId)), ("button", ConstructorParameterDescription(button))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.RequestedButton? in + let reader = BufferReader(buffer) + var result: Api.bots.RequestedButton? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.bots.RequestedButton + } + 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", ConstructorParameterDescription(scope)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(customMethod)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(scope)), ("langCode", ConstructorParameterDescription(langCode)), ("commands", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("langCode", ConstructorParameterDescription(langCode)), ("name", ConstructorParameterDescription(name)), ("about", ConstructorParameterDescription(about)), ("description", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("button", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("peer", ConstructorParameterDescription(peer)), ("customDescription", ConstructorParameterDescription(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 setJoinChatResults(queryId: Int64, result: Api.JoinChatBotResult) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-417708016) + serializeInt64(queryId, buffer: buffer, boxed: false) + result.serialize(buffer, true) + return (FunctionDescription(name: "bots.setJoinChatResults", parameters: [("queryId", ConstructorParameterDescription(queryId)), ("result", ConstructorParameterDescription(result))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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", ConstructorParameterDescription(bot)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("username", ConstructorParameterDescription(username)), ("active", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("commissionPermille", ConstructorParameterDescription(commissionPermille)), ("durationMonths", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("emojiStatus", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("query", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("username", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("title", ConstructorParameterDescription(title)), ("about", ConstructorParameterDescription(about)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("address", ConstructorParameterDescription(address)), ("ttlPeriod", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(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(flags: Int32, channel: Api.InputChannel, userId: Api.InputUser, adminRights: Api.ChatAdminRights, rank: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1701270168) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + userId.serialize(buffer, true) + adminRights.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeString(rank!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "channels.editAdmin", parameters: [("flags", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("userId", ConstructorParameterDescription(userId)), ("adminRights", ConstructorParameterDescription(adminRights)), ("rank", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(participant)), ("bannedRights", ConstructorParameterDescription(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 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", ConstructorParameterDescription(channel)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("address", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("photo", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("q", ConstructorParameterDescription(q)), ("eventsFilter", ConstructorParameterDescription(eventsFilter)), ("admins", ConstructorParameterDescription(admins)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 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 + }) + } +} +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", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("filter", ConstructorParameterDescription(filter)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("users", ConstructorParameterDescription(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(2137660962) + channel.serialize(buffer, true) + return (FunctionDescription(name: "channels.joinChannel", parameters: [("channel", ConstructorParameterDescription(channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatInviteJoinResult? in + let reader = BufferReader(buffer) + var result: Api.messages.ChatInviteJoinResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ChatInviteJoinResult + } + 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", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("participant", ConstructorParameterDescription(participant)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("restricted", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("hashtag", ConstructorParameterDescription(hashtag)), ("query", ConstructorParameterDescription(query)), ("offsetRate", ConstructorParameterDescription(offsetRate)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(limit)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("boosts", ConstructorParameterDescription(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", ConstructorParameterDescription(broadcast)), ("group", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("stickerset", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("tab", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("stickerset", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(enabled)), ("tabs", ConstructorParameterDescription(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(flags: Int32, channel: Api.InputChannel, enabled: Api.Bool, guardBot: Api.InputUser?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(248260120) + serializeInt32(flags, buffer: buffer, boxed: false) + channel.serialize(buffer, true) + enabled.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + guardBot!.serialize(buffer, true) + } + return (FunctionDescription(name: "channels.toggleJoinRequest", parameters: [("flags", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(enabled)), ("guardBot", ConstructorParameterDescription(guardBot))]), 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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("seconds", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("username", ConstructorParameterDescription(username)), ("active", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("color", ConstructorParameterDescription(color)), ("backgroundEmojiId", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("emojiStatus", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("sendPaidMessagesStars", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("username", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("slug", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("chatlist", ConstructorParameterDescription(chatlist)), ("slug", ConstructorParameterDescription(slug)), ("title", ConstructorParameterDescription(title)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("title", ConstructorParameterDescription(title)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(slug)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(chatlist)), ("peers", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("firstName", ConstructorParameterDescription(firstName)), ("lastName", ConstructorParameterDescription(lastName)), ("phone", ConstructorParameterDescription(phone)), ("note", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + }) + } +} +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 + }) + } +} +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", ConstructorParameterDescription(flags)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("selfExpires", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(flags)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(category)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("username", ConstructorParameterDescription(username)), ("referer", ConstructorParameterDescription(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", ConstructorParameterDescription(q)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("note", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("suggestion", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("message", ConstructorParameterDescription(message)), ("entities", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + }) + } +} +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 + }) + } +} +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", ConstructorParameterDescription(langCode)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + }) + } +} +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 + }) + } +} +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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + }) + } +} +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 + }) + } +} +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", ConstructorParameterDescription(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 + }) + } +} +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 + }) + } +} +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 + }) + } +} +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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(pendingUpdatesCount)), ("message", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(langCode)), ("fromVersion", ConstructorParameterDescription(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", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(langPack)), ("langCode", ConstructorParameterDescription(langCode)), ("keys", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("gB", ConstructorParameterDescription(gB)), ("keyFingerprint", ConstructorParameterDescription(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?, matchCode: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1738797278) + 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) + } + if Int(flags) & Int(1 << 4) != 0 { + serializeString(matchCode!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.acceptUrlAuth", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("buttonId", ConstructorParameterDescription(buttonId)), ("url", ConstructorParameterDescription(url)), ("matchCode", ConstructorParameterDescription(matchCode))]), 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", ConstructorParameterDescription(chatId)), ("userId", ConstructorParameterDescription(userId)), ("fwdLimit", ConstructorParameterDescription(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 addPollAnswer(peer: Api.InputPeer, msgId: Int32, answer: Api.PollAnswer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(431770477) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + answer.serialize(buffer, true) + return (FunctionDescription(name: "messages.addPollAnswer", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("answer", ConstructorParameterDescription(answer))]), 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 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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("list", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 checkUrlAuthMatchCode(url: String, matchCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-911967477) + serializeString(url, buffer: buffer, boxed: false) + serializeString(matchCode, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.checkUrlAuthMatchCode", parameters: [("url", ConstructorParameterDescription(url)), ("matchCode", ConstructorParameterDescription(matchCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("randomId", ConstructorParameterDescription(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 composeMessageWithAI(flags: Int32, text: Api.TextWithEntities, translateToLang: String?, tone: Api.InputAiComposeTone?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-622017143) + serializeInt32(flags, buffer: buffer, boxed: false) + text.serialize(buffer, true) + if Int(flags) & Int(1 << 1) != 0 { + serializeString(translateToLang!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 2) != 0 { + tone!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.composeMessageWithAI", parameters: [("flags", ConstructorParameterDescription(flags)), ("text", ConstructorParameterDescription(text)), ("translateToLang", ConstructorParameterDescription(translateToLang)), ("tone", ConstructorParameterDescription(tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ComposedMessageWithAI? in + let reader = BufferReader(buffer) + var result: Api.messages.ComposedMessageWithAI? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ComposedMessageWithAI + } + 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", ConstructorParameterDescription(flags)), ("users", ConstructorParameterDescription(users)), ("title", ConstructorParameterDescription(title)), ("ttlPeriod", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("title", ConstructorParameterDescription(title)), ("iconColor", ConstructorParameterDescription(iconColor)), ("iconEmojiId", ConstructorParameterDescription(iconEmojiId)), ("randomId", ConstructorParameterDescription(randomId)), ("sendAs", ConstructorParameterDescription(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 declineUrlAuth(url: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(893610940) + serializeString(url, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.declineUrlAuth", parameters: [("url", ConstructorParameterDescription(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.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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("chatId", ConstructorParameterDescription(chatId)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(maxId)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(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 deleteParticipantReaction(peer: Api.InputPeer, msgId: Int32, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-474482644) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + participant.serialize(buffer, true) + return (FunctionDescription(name: "messages.deleteParticipantReaction", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("participant", ConstructorParameterDescription(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.messages { + static func deleteParticipantReactions(peer: Api.InputPeer, participant: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1598550792) + peer.serialize(buffer, true) + participant.serialize(buffer, true) + return (FunctionDescription(name: "messages.deleteParticipantReactions", parameters: [("peer", ConstructorParameterDescription(peer)), ("participant", ConstructorParameterDescription(participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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 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", ConstructorParameterDescription(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 deletePollAnswer(peer: Api.InputPeer, msgId: Int32, option: Buffer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1400568411) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeBytes(option, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.deletePollAnswer", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("option", ConstructorParameterDescription(option))]), 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 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", ConstructorParameterDescription(shortcutId)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("adminId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(maxId)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("chatId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("about", ConstructorParameterDescription(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", ConstructorParameterDescription(chatId)), ("userId", ConstructorParameterDescription(userId)), ("isAdmin", ConstructorParameterDescription(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 editChatCreator(peer: Api.InputPeer, userId: Api.InputUser, password: Api.InputCheckPasswordSRP) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-146556841) + peer.serialize(buffer, true) + userId.serialize(buffer, true) + password.serialize(buffer, true) + return (FunctionDescription(name: "messages.editChatCreator", parameters: [("peer", ConstructorParameterDescription(peer)), ("userId", ConstructorParameterDescription(userId)), ("password", ConstructorParameterDescription(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.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", ConstructorParameterDescription(peer)), ("bannedRights", ConstructorParameterDescription(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 editChatParticipantRank(peer: Api.InputPeer, participant: Api.InputPeer, rank: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1609616720) + peer.serialize(buffer, true) + participant.serialize(buffer, true) + serializeString(rank, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.editChatParticipantRank", parameters: [("peer", ConstructorParameterDescription(peer)), ("participant", ConstructorParameterDescription(participant)), ("rank", ConstructorParameterDescription(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.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", ConstructorParameterDescription(chatId)), ("photo", ConstructorParameterDescription(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", ConstructorParameterDescription(chatId)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(link)), ("expireDate", ConstructorParameterDescription(expireDate)), ("usageLimit", ConstructorParameterDescription(usageLimit)), ("requestNeeded", ConstructorParameterDescription(requestNeeded)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("text", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topicId", ConstructorParameterDescription(topicId)), ("title", ConstructorParameterDescription(title)), ("iconEmojiId", ConstructorParameterDescription(iconEmojiId)), ("closed", ConstructorParameterDescription(closed)), ("hidden", ConstructorParameterDescription(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]?, richMessage: Api.InputRichMessage?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1541162159) + 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) + } + } + if Int(flags) & Int(1 << 23) != 0 { + richMessage!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.editInlineBotMessage", parameters: [("flags", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("message", ConstructorParameterDescription(message)), ("media", ConstructorParameterDescription(media)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(entities)), ("richMessage", ConstructorParameterDescription(richMessage))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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?, richMessage: Api.InputRichMessage?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1324947860) + 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) + } + if Int(flags) & Int(1 << 23) != 0 { + richMessage!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.editMessage", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("message", ConstructorParameterDescription(message)), ("media", ConstructorParameterDescription(media)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(entities)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("quickReplyShortcutId", ConstructorParameterDescription(quickReplyShortcutId)), ("richMessage", ConstructorParameterDescription(richMessage))]), 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", ConstructorParameterDescription(shortcutId)), ("shortcut", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("expireDate", ConstructorParameterDescription(expireDate)), ("usageLimit", ConstructorParameterDescription(usageLimit)), ("title", ConstructorParameterDescription(title)), ("subscriptionPricing", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("unfave", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("fromPeer", ConstructorParameterDescription(fromPeer)), ("id", ConstructorParameterDescription(id)), ("randomId", ConstructorParameterDescription(randomId)), ("toPeer", ConstructorParameterDescription(toPeer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("replyTo", ConstructorParameterDescription(replyTo)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("videoTimestamp", ConstructorParameterDescription(videoTimestamp)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("suggestedPost", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(app)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("data", ConstructorParameterDescription(data)), ("password", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(link)), ("q", ConstructorParameterDescription(q)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetUser", ConstructorParameterDescription(offsetUser)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("maxId", ConstructorParameterDescription(maxId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(version)), ("randomLength", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("folderId", ConstructorParameterDescription(folderId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(sha256)), ("size", ConstructorParameterDescription(size)), ("mimeType", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(langCode)), ("fromVersion", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("adminId", ConstructorParameterDescription(adminId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetLink", ConstructorParameterDescription(offsetLink)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("q", ConstructorParameterDescription(q)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetTopic", ConstructorParameterDescription(offsetTopic)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("topics", ConstructorParameterDescription(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", ConstructorParameterDescription(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 getFutureChatCreatorAfterLeave(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(998051494) + peer.serialize(buffer, true) + return (FunctionDescription(name: "messages.getFutureChatCreatorAfterLeave", parameters: [("peer", ConstructorParameterDescription(peer))]), 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.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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("peer", ConstructorParameterDescription(peer)), ("geoPoint", ConstructorParameterDescription(geoPoint)), ("query", ConstructorParameterDescription(query)), ("offset", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("reaction", ConstructorParameterDescription(reaction)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("increment", ConstructorParameterDescription(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", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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 getPersonalChannelHistory(userId: Api.InputUser, limit: Int32, maxId: Int32, minId: Int32, hash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1442515350) + userId.serialize(buffer, true) + 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.getPersonalChannelHistory", parameters: [("userId", ConstructorParameterDescription(userId)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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 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", ConstructorParameterDescription(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, pollHash: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-308026565) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + serializeInt64(pollHash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.getPollResults", parameters: [("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("pollHash", ConstructorParameterDescription(pollHash))]), 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("option", ConstructorParameterDescription(option)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("shortcutId", ConstructorParameterDescription(shortcutId)), ("id", ConstructorParameterDescription(id)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("ids", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("filters", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("filter", ConstructorParameterDescription(filter)), ("offsetId", ConstructorParameterDescription(offsetId)), ("offsetDate", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("filter", ConstructorParameterDescription(filter)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(emoticon)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(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 getUnreadPollVotes(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(1126722802) + 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.getUnreadPollVotes", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(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", ConstructorParameterDescription(url)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("message", ConstructorParameterDescription(message)), ("entities", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(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(-560905362) + serializeString(hash, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.importChatInvite", parameters: [("hash", ConstructorParameterDescription(hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatInviteJoinResult? in + let reader = BufferReader(buffer) + var result: Api.messages.ChatInviteJoinResult? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.messages.ChatInviteJoinResult + } + 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", ConstructorParameterDescription(peer)), ("file", ConstructorParameterDescription(file)), ("mediaCount", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("archived", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("parentPeer", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(bot)), ("queryId", ConstructorParameterDescription(queryId)), ("replyTo", ConstructorParameterDescription(replyTo)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("transcriptionId", ConstructorParameterDescription(transcriptionId)), ("good", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("readMaxId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("maxDate", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(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", ConstructorParameterDescription(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 readPollVotes(flags: Int32, peer: Api.InputPeer, topMsgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(388019416) + 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.readPollVotes", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(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 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("savedPeerId", ConstructorParameterDescription(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", ConstructorParameterDescription(parentPeer)), ("peer", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("folderId", ConstructorParameterDescription(folderId)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("option", ConstructorParameterDescription(option)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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 reportMusicListen(id: Api.InputDocument, listenedDuration: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-574826471) + id.serialize(buffer, true) + serializeInt32(listenedDuration, buffer: buffer, boxed: false) + return (FunctionDescription(name: "messages.reportMusicListen", parameters: [("id", ConstructorParameterDescription(id)), ("listenedDuration", ConstructorParameterDescription(listenedDuration))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("reactionPeer", ConstructorParameterDescription(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 reportReadMetrics(peer: Api.InputPeer, metrics: [Api.InputMessageReadMetric]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1080542694) + peer.serialize(buffer, true) + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(metrics.count)) + for item in metrics { + item.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.reportReadMetrics", parameters: [("peer", ConstructorParameterDescription(peer)), ("metrics", ConstructorParameterDescription(metrics))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + let reader = BufferReader(buffer) + 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", ConstructorParameterDescription(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", ConstructorParameterDescription(randomId)), ("option", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("app", ConstructorParameterDescription(app)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("randomId", ConstructorParameterDescription(randomId)), ("gA", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(bot)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("url", ConstructorParameterDescription(url)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(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?, inAppOrigin: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1991456356) + 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) + } + if Int(flags) & Int(1 << 3) != 0 { + serializeString(inAppOrigin!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.requestUrlAuth", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("buttonId", ConstructorParameterDescription(buttonId)), ("url", ConstructorParameterDescription(url)), ("inAppOrigin", ConstructorParameterDescription(inAppOrigin))]), 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(bot)), ("url", ConstructorParameterDescription(url)), ("startParam", ConstructorParameterDescription(startParam)), ("themeParams", ConstructorParameterDescription(themeParams)), ("platform", ConstructorParameterDescription(platform)), ("replyTo", ConstructorParameterDescription(replyTo)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("replyTo", ConstructorParameterDescription(replyTo)), ("peer", ConstructorParameterDescription(peer)), ("message", ConstructorParameterDescription(message)), ("entities", ConstructorParameterDescription(entities)), ("media", ConstructorParameterDescription(media)), ("effect", ConstructorParameterDescription(effect)), ("suggestedPost", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("result", ConstructorParameterDescription(result)), ("userId", ConstructorParameterDescription(userId)), ("peerTypes", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("unsave", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("q", ConstructorParameterDescription(q)), ("fromId", ConstructorParameterDescription(fromId)), ("savedPeerId", ConstructorParameterDescription(savedPeerId)), ("savedReaction", ConstructorParameterDescription(savedReaction)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("filter", ConstructorParameterDescription(filter)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(maxDate)), ("offsetId", ConstructorParameterDescription(offsetId)), ("addOffset", ConstructorParameterDescription(addOffset)), ("limit", ConstructorParameterDescription(limit)), ("maxId", ConstructorParameterDescription(maxId)), ("minId", ConstructorParameterDescription(minId)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(emoticon)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("q", ConstructorParameterDescription(q)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("folderId", ConstructorParameterDescription(folderId)), ("q", ConstructorParameterDescription(q)), ("filter", ConstructorParameterDescription(filter)), ("minDate", ConstructorParameterDescription(minDate)), ("maxDate", ConstructorParameterDescription(maxDate)), ("offsetRate", ConstructorParameterDescription(offsetRate)), ("offsetPeer", ConstructorParameterDescription(offsetPeer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(q)), ("filter", ConstructorParameterDescription(filter)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("q", ConstructorParameterDescription(q)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("q", ConstructorParameterDescription(q)), ("emoticon", ConstructorParameterDescription(emoticon)), ("langCode", ConstructorParameterDescription(langCode)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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(flags: Int32, peer: Api.InputPeer, msgId: Int32?, webappReqId: String?, buttonId: Int32, requestedPeers: [Api.InputPeer]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(1818030759) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(msgId!, buffer: buffer, boxed: false) + } + if Int(flags) & Int(1 << 1) != 0 { + serializeString(webappReqId!, 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: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("webappReqId", ConstructorParameterDescription(webappReqId)), ("buttonId", ConstructorParameterDescription(buttonId)), ("requestedPeers", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("data", ConstructorParameterDescription(data)), ("file", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("randomId", ConstructorParameterDescription(randomId)), ("queryId", ConstructorParameterDescription(queryId)), ("id", ConstructorParameterDescription(id)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("media", ConstructorParameterDescription(media)), ("message", ConstructorParameterDescription(message)), ("randomId", ConstructorParameterDescription(randomId)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(entities)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("suggestedPost", ConstructorParameterDescription(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?, richMessage: Api.InputRichMessage?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-17526942) + 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) + } + if Int(flags) & Int(1 << 23) != 0 { + richMessage!.serialize(buffer, true) + } + return (FunctionDescription(name: "messages.sendMessage", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("message", ConstructorParameterDescription(message)), ("randomId", ConstructorParameterDescription(randomId)), ("replyMarkup", ConstructorParameterDescription(replyMarkup)), ("entities", ConstructorParameterDescription(entities)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("scheduleRepeatPeriod", ConstructorParameterDescription(scheduleRepeatPeriod)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("suggestedPost", ConstructorParameterDescription(suggestedPost)), ("richMessage", ConstructorParameterDescription(richMessage))]), 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("multiMedia", ConstructorParameterDescription(multiMedia)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("sendAs", ConstructorParameterDescription(sendAs)), ("quickReplyShortcut", ConstructorParameterDescription(quickReplyShortcut)), ("effect", ConstructorParameterDescription(effect)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("count", ConstructorParameterDescription(count)), ("randomId", ConstructorParameterDescription(randomId)), ("`private`", ConstructorParameterDescription(`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", ConstructorParameterDescription(peer)), ("shortcutId", ConstructorParameterDescription(shortcutId)), ("id", ConstructorParameterDescription(id)), ("randomId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("reaction", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("replyTo", ConstructorParameterDescription(replyTo)), ("randomId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("options", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("randomId", ConstructorParameterDescription(randomId)), ("buttonText", ConstructorParameterDescription(buttonText)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(botQueryId)), ("result", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("message", ConstructorParameterDescription(message)), ("url", ConstructorParameterDescription(url)), ("cacheTime", ConstructorParameterDescription(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 setBotGuestChatResult(queryId: Int64, result: Api.InputBotInlineResult) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1192163613) + serializeInt64(queryId, buffer: buffer, boxed: false) + result.serialize(buffer, true) + return (FunctionDescription(name: "messages.setBotGuestChatResult", parameters: [("queryId", ConstructorParameterDescription(queryId)), ("result", ConstructorParameterDescription(result))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.InputBotInlineMessageID? in + let reader = BufferReader(buffer) + var result: Api.InputBotInlineMessageID? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessageID + } + 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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("error", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("error", ConstructorParameterDescription(error)), ("shippingOptions", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("availableReactions", ConstructorParameterDescription(availableReactions)), ("reactionsLimit", ConstructorParameterDescription(reactionsLimit)), ("paidEnabled", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("theme", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("wallpaper", ConstructorParameterDescription(wallpaper)), ("settings", ConstructorParameterDescription(settings)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("typing", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(userId)), ("score", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("period", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("queryId", ConstructorParameterDescription(queryId)), ("results", ConstructorParameterDescription(results)), ("cacheTime", ConstructorParameterDescription(cacheTime)), ("nextOffset", ConstructorParameterDescription(nextOffset)), ("switchPm", ConstructorParameterDescription(switchPm)), ("switchWebview", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("userId", ConstructorParameterDescription(userId)), ("score", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("action", ConstructorParameterDescription(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", ConstructorParameterDescription(bot)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("startParam", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("importId", ConstructorParameterDescription(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?, tone: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1413754042) + 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) + } + if Int(flags) & Int(1 << 2) != 0 { + serializeString(tone!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.summarizeText", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("toLang", ConstructorParameterDescription(toLang)), ("tone", ConstructorParameterDescription(tone))]), 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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("enabled", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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(flags: Int32, peer: Api.InputPeer, enabled: Api.Bool, requestMsgId: Int32?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1308091851) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + enabled.serialize(buffer, true) + if Int(flags) & Int(1 << 0) != 0 { + serializeInt32(requestMsgId!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.toggleNoForwards", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("enabled", ConstructorParameterDescription(enabled)), ("requestMsgId", ConstructorParameterDescription(requestMsgId))]), 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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("`private`", ConstructorParameterDescription(`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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stickersets", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("scheduleDate", ConstructorParameterDescription(scheduleDate)), ("rejectComment", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId)), ("completed", ConstructorParameterDescription(completed)), ("incompleted", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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, tone: String?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1511079099) + 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) + if Int(flags) & Int(1 << 2) != 0 { + serializeString(tone!, buffer: buffer, boxed: false) + } + return (FunctionDescription(name: "messages.translateText", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("text", ConstructorParameterDescription(text)), ("toLang", ConstructorParameterDescription(toLang)), ("tone", ConstructorParameterDescription(tone))]), 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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("topMsgId", ConstructorParameterDescription(topMsgId)), ("savedPeerId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("id", ConstructorParameterDescription(id)), ("filter", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("topicId", ConstructorParameterDescription(topicId)), ("pinned", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("reaction", ConstructorParameterDescription(reaction)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("file", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("importId", ConstructorParameterDescription(importId)), ("fileName", ConstructorParameterDescription(fileName)), ("media", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("businessConnectionId", ConstructorParameterDescription(businessConnectionId)), ("peer", ConstructorParameterDescription(peer)), ("media", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(receipt)), ("purpose", ConstructorParameterDescription(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", ConstructorParameterDescription(receipt)), ("purpose", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("chargeId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("subscriptionId", ConstructorParameterDescription(subscriptionId)), ("canceled", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("title", ConstructorParameterDescription(title)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("collectionId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("link", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("subscriptionId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("bot", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offsetDate", ConstructorParameterDescription(offsetDate)), ("offsetLink", ConstructorParameterDescription(offsetLink)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(giftId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("invoice", ConstructorParameterDescription(invoice)), ("themeParams", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("boostPeer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("attributesHash", ConstructorParameterDescription(attributesHash)), ("giftId", ConstructorParameterDescription(giftId)), ("attributes", ConstructorParameterDescription(attributes)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("collectionId", ConstructorParameterDescription(collectionId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(auction)), ("version", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(stargift)), ("password", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("amount", ConstructorParameterDescription(amount)), ("password", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(flags)), ("subscriptionId", ConstructorParameterDescription(subscriptionId)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("giveawayId", ConstructorParameterDescription(giveawayId)), ("purpose", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("chargeId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("offerMsgId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("formId", ConstructorParameterDescription(formId)), ("invoice", ConstructorParameterDescription(invoice)), ("requestedInfoId", ConstructorParameterDescription(requestedInfoId)), ("shippingOptionId", ConstructorParameterDescription(shippingOptionId)), ("credentials", ConstructorParameterDescription(credentials)), ("tipAmount", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("slug", ConstructorParameterDescription(slug)), ("price", ConstructorParameterDescription(price)), ("duration", ConstructorParameterDescription(duration)), ("randomId", ConstructorParameterDescription(randomId)), ("allowPaidStars", ConstructorParameterDescription(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", ConstructorParameterDescription(formId)), ("invoice", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(stargift)), ("toId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("collectionId", ConstructorParameterDescription(collectionId)), ("title", ConstructorParameterDescription(title)), ("deleteStargift", ConstructorParameterDescription(deleteStargift)), ("addStargift", ConstructorParameterDescription(addStargift)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(stargift)), ("resellAmount", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stargift", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("invoice", ConstructorParameterDescription(invoice)), ("info", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("gB", ConstructorParameterDescription(gB)), ("`protocol`", ConstructorParameterDescription(`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", ConstructorParameterDescription(call)), ("sources", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("gA", ConstructorParameterDescription(gA)), ("keyFingerprint", ConstructorParameterDescription(keyFingerprint)), ("`protocol`", ConstructorParameterDescription(`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", ConstructorParameterDescription(flags)), ("randomId", ConstructorParameterDescription(randomId)), ("publicKey", ConstructorParameterDescription(publicKey)), ("block", ConstructorParameterDescription(block)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("randomId", ConstructorParameterDescription(randomId)), ("title", ConstructorParameterDescription(title)), ("scheduleDate", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("ids", ConstructorParameterDescription(ids)), ("block", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("messages", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("participant", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("duration", ConstructorParameterDescription(duration)), ("reason", ConstructorParameterDescription(reason)), ("connectionId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("participant", ConstructorParameterDescription(participant)), ("muted", ConstructorParameterDescription(muted)), ("volume", ConstructorParameterDescription(volume)), ("raiseHand", ConstructorParameterDescription(raiseHand)), ("videoStopped", ConstructorParameterDescription(videoStopped)), ("videoPaused", ConstructorParameterDescription(videoPaused)), ("presentationPaused", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(call)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("subChainId", ConstructorParameterDescription(subChainId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("revoke", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("ids", ConstructorParameterDescription(ids)), ("sources", ConstructorParameterDescription(sources)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("users", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("joinAs", ConstructorParameterDescription(joinAs)), ("inviteHash", ConstructorParameterDescription(inviteHash)), ("publicKey", ConstructorParameterDescription(publicKey)), ("block", ConstructorParameterDescription(block)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("params", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("source", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("randomId", ConstructorParameterDescription(randomId)), ("gAHash", ConstructorParameterDescription(gAHash)), ("`protocol`", ConstructorParameterDescription(`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", ConstructorParameterDescription(peer)), ("debug", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("file", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("joinAs", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("block", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("encryptedMessage", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("randomId", ConstructorParameterDescription(randomId)), ("message", ConstructorParameterDescription(message)), ("allowPaidStars", ConstructorParameterDescription(allowPaidStars)), ("sendAs", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("data", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("rating", ConstructorParameterDescription(rating)), ("comment", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("title", ConstructorParameterDescription(title)), ("videoPortrait", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("call", ConstructorParameterDescription(call)), ("joinMuted", ConstructorParameterDescription(joinMuted)), ("messagesEnabled", ConstructorParameterDescription(messagesEnabled)), ("sendPaidMessagesStars", ConstructorParameterDescription(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", ConstructorParameterDescription(call)), ("subscribed", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(userId)), ("offset", ConstructorParameterDescription(offset)), ("maxId", ConstructorParameterDescription(maxId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("file", ConstructorParameterDescription(file)), ("video", ConstructorParameterDescription(video)), ("videoStartTs", ConstructorParameterDescription(videoStartTs)), ("videoEmojiMarkup", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("bot", ConstructorParameterDescription(bot)), ("file", ConstructorParameterDescription(file)), ("video", ConstructorParameterDescription(video)), ("videoStartTs", ConstructorParameterDescription(videoStartTs)), ("videoEmojiMarkup", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("slots", ConstructorParameterDescription(slots)), ("peer", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(peer)), ("userId", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("jobId", ConstructorParameterDescription(jobId)), ("error", ConstructorParameterDescription(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", ConstructorParameterDescription(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 + }) + } +} +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 + }) + } +} +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 + }) + } +} +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 + }) + } +} +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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(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", ConstructorParameterDescription(channel)), ("msgId", ConstructorParameterDescription(msgId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("msgId", ConstructorParameterDescription(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 getPollStats(flags: Int32, peer: Api.InputPeer, msgId: Int32) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1031931288) + serializeInt32(flags, buffer: buffer, boxed: false) + peer.serialize(buffer, true) + serializeInt32(msgId, buffer: buffer, boxed: false) + return (FunctionDescription(name: "stats.getPollStats", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("msgId", ConstructorParameterDescription(msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PollStats? in + let reader = BufferReader(buffer) + var result: Api.stats.PollStats? + if let signature = reader.readInt32() { + result = Api.parse(reader, signature: signature) as? Api.stats.PollStats + } + 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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("token", ConstructorParameterDescription(token)), ("x", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("sticker", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("sticker", ConstructorParameterDescription(sticker)), ("emoji", ConstructorParameterDescription(emoji)), ("maskCoords", ConstructorParameterDescription(maskCoords)), ("keywords", ConstructorParameterDescription(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", ConstructorParameterDescription(sticker)), ("position", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("userId", ConstructorParameterDescription(userId)), ("title", ConstructorParameterDescription(title)), ("shortName", ConstructorParameterDescription(shortName)), ("thumb", ConstructorParameterDescription(thumb)), ("stickers", ConstructorParameterDescription(stickers)), ("software", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(stickerset)), ("title", ConstructorParameterDescription(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", ConstructorParameterDescription(sticker)), ("newSticker", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("stickerset", ConstructorParameterDescription(stickerset)), ("thumb", ConstructorParameterDescription(thumb)), ("thumbDocumentId", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("title", ConstructorParameterDescription(title)), ("stories", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("albumId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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]?, music: Api.InputDocument?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(744728363) + 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) + } + } + if Int(flags) & Int(1 << 4) != 0 { + music!.serialize(buffer, true) + } + return (FunctionDescription(name: "stories.editStory", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("media", ConstructorParameterDescription(media)), ("mediaAreas", ConstructorParameterDescription(mediaAreas)), ("caption", ConstructorParameterDescription(caption)), ("entities", ConstructorParameterDescription(entities)), ("privacyRules", ConstructorParameterDescription(privacyRules)), ("music", ConstructorParameterDescription(music))]), 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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("albumId", ConstructorParameterDescription(albumId)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hash", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(flags)), ("state", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("offsetId", ConstructorParameterDescription(offsetId)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("reaction", ConstructorParameterDescription(reaction)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("q", ConstructorParameterDescription(q)), ("id", ConstructorParameterDescription(id)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("maxId", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("option", ConstructorParameterDescription(option)), ("message", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("hashtag", ConstructorParameterDescription(hashtag)), ("area", ConstructorParameterDescription(area)), ("peer", ConstructorParameterDescription(peer)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("storyId", ConstructorParameterDescription(storyId)), ("reaction", ConstructorParameterDescription(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]?, music: Api.InputDocument?) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { + let buffer = Buffer() + buffer.appendInt32(-1885443944) + 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) + } + } + if Int(flags) & Int(1 << 9) != 0 { + music!.serialize(buffer, true) + } + return (FunctionDescription(name: "stories.sendStory", parameters: [("flags", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("media", ConstructorParameterDescription(media)), ("mediaAreas", ConstructorParameterDescription(mediaAreas)), ("caption", ConstructorParameterDescription(caption)), ("entities", ConstructorParameterDescription(entities)), ("privacyRules", ConstructorParameterDescription(privacyRules)), ("randomId", ConstructorParameterDescription(randomId)), ("period", ConstructorParameterDescription(period)), ("fwdFromId", ConstructorParameterDescription(fwdFromId)), ("fwdFromStory", ConstructorParameterDescription(fwdFromStory)), ("albums", ConstructorParameterDescription(albums)), ("music", ConstructorParameterDescription(music))]), 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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("caption", ConstructorParameterDescription(caption)), ("entities", ConstructorParameterDescription(entities)), ("privacyRules", ConstructorParameterDescription(privacyRules)), ("randomId", ConstructorParameterDescription(randomId)), ("messagesEnabled", ConstructorParameterDescription(messagesEnabled)), ("sendPaidMessagesStars", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("hidden", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(id)), ("pinned", ConstructorParameterDescription(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", ConstructorParameterDescription(peer)), ("id", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("peer", ConstructorParameterDescription(peer)), ("albumId", ConstructorParameterDescription(albumId)), ("title", ConstructorParameterDescription(title)), ("deleteStories", ConstructorParameterDescription(deleteStories)), ("addStories", ConstructorParameterDescription(addStories)), ("order", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("channel", ConstructorParameterDescription(channel)), ("filter", ConstructorParameterDescription(filter)), ("pts", ConstructorParameterDescription(pts)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("pts", ConstructorParameterDescription(pts)), ("ptsLimit", ConstructorParameterDescription(ptsLimit)), ("ptsTotalLimit", ConstructorParameterDescription(ptsTotalLimit)), ("date", ConstructorParameterDescription(date)), ("qts", ConstructorParameterDescription(qts)), ("qtsLimit", ConstructorParameterDescription(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 + }) + } +} +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", ConstructorParameterDescription(fileToken)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(fileToken)), ("offset", ConstructorParameterDescription(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", ConstructorParameterDescription(flags)), ("location", ConstructorParameterDescription(location)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(location)), ("offset", ConstructorParameterDescription(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", ConstructorParameterDescription(location)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(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", ConstructorParameterDescription(fileToken)), ("requestToken", ConstructorParameterDescription(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", ConstructorParameterDescription(fileId)), ("filePart", ConstructorParameterDescription(filePart)), ("fileTotalParts", ConstructorParameterDescription(fileTotalParts)), ("bytes", ConstructorParameterDescription(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", ConstructorParameterDescription(fileId)), ("filePart", ConstructorParameterDescription(filePart)), ("bytes", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("offset", ConstructorParameterDescription(offset)), ("limit", ConstructorParameterDescription(limit)), ("hash", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("documents", ConstructorParameterDescription(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", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("errors", ConstructorParameterDescription(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", ConstructorParameterDescription(id)), ("birthday", ConstructorParameterDescription(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 a8463caf27..8d300cd9e7 100644 --- a/submodules/TelegramApi/Sources/Api5.swift +++ b/submodules/TelegramApi/Sources/Api5.swift @@ -1094,14 +1094,20 @@ public extension Api { 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) { + public var device: String? + public var date: Int32? + public var location: String? + public init(flags: Int32, botId: Int64, recipients: Api.BusinessBotRecipients, rights: Api.BusinessBotRights, device: String?, date: Int32?, location: String?) { self.flags = flags self.botId = botId self.recipients = recipients self.rights = rights + self.device = device + self.date = date + self.location = location } public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { - return ("connectedBot", [("flags", ConstructorParameterDescription(self.flags)), ("botId", ConstructorParameterDescription(self.botId)), ("recipients", ConstructorParameterDescription(self.recipients)), ("rights", ConstructorParameterDescription(self.rights))]) + return ("connectedBot", [("flags", ConstructorParameterDescription(self.flags)), ("botId", ConstructorParameterDescription(self.botId)), ("recipients", ConstructorParameterDescription(self.recipients)), ("rights", ConstructorParameterDescription(self.rights)), ("device", ConstructorParameterDescription(self.device)), ("date", ConstructorParameterDescription(self.date)), ("location", ConstructorParameterDescription(self.location))]) } } case connectedBot(Cons_connectedBot) @@ -1110,12 +1116,21 @@ public extension Api { switch self { case .connectedBot(let _data): if boxed { - buffer.appendInt32(-849058964) + buffer.appendInt32(54448129) } serializeInt32(_data.flags, buffer: buffer, boxed: false) serializeInt64(_data.botId, buffer: buffer, boxed: false) _data.recipients.serialize(buffer, true) _data.rights.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.device!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.date!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + serializeString(_data.location!, buffer: buffer, boxed: false) + } break } } @@ -1123,7 +1138,7 @@ public extension Api { public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .connectedBot(let _data): - return ("connectedBot", [("flags", ConstructorParameterDescription(_data.flags)), ("botId", ConstructorParameterDescription(_data.botId)), ("recipients", ConstructorParameterDescription(_data.recipients)), ("rights", ConstructorParameterDescription(_data.rights))]) + return ("connectedBot", [("flags", ConstructorParameterDescription(_data.flags)), ("botId", ConstructorParameterDescription(_data.botId)), ("recipients", ConstructorParameterDescription(_data.recipients)), ("rights", ConstructorParameterDescription(_data.rights)), ("device", ConstructorParameterDescription(_data.device)), ("date", ConstructorParameterDescription(_data.date)), ("location", ConstructorParameterDescription(_data.location))]) } } @@ -1140,12 +1155,27 @@ public extension Api { if let signature = reader.readInt32() { _4 = Api.parse(reader, signature: signature) as? Api.BusinessBotRights } + var _5: String? + if Int(_1 ?? 0) & Int(1 << 0) != 0 { + _5 = parseString(reader) + } + var _6: Int32? + if Int(_1 ?? 0) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } + var _7: String? + if Int(_1 ?? 0) & Int(1 << 2) != 0 { + _7 = parseString(reader) + } let _c1 = _1 != nil let _c2 = _2 != nil let _c3 = _3 != nil let _c4 = _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.ConnectedBot.connectedBot(Cons_connectedBot(flags: _1!, botId: _2!, recipients: _3!, rights: _4!)) + let _c5 = (Int(_1 ?? 0) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1 ?? 0) & Int(1 << 1) == 0) || _6 != nil + let _c7 = (Int(_1 ?? 0) & Int(1 << 2) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.ConnectedBot.connectedBot(Cons_connectedBot(flags: _1!, botId: _2!, recipients: _3!, rights: _4!, device: _5, date: _6, location: _7)) } else { return nil diff --git a/submodules/TelegramCore/Sources/Account/AccountManager.swift b/submodules/TelegramCore/Sources/Account/AccountManager.swift index e9ea0821e5..334e675922 100644 --- a/submodules/TelegramCore/Sources/Account/AccountManager.swift +++ b/submodules/TelegramCore/Sources/Account/AccountManager.swift @@ -103,6 +103,7 @@ private var declaredEncodables: Void = { declareEncodable(InlineBotMessageAttribute.self, f: { InlineBotMessageAttribute(decoder: $0) }) declareEncodable(InlineBusinessBotMessageAttribute.self, f: { InlineBusinessBotMessageAttribute(decoder: $0) }) declareEncodable(TextEntitiesMessageAttribute.self, f: { TextEntitiesMessageAttribute(decoder: $0) }) + declareEncodable(RichTextMessageAttribute.self, f: { RichTextMessageAttribute(decoder: $0) }) declareEncodable(ReplyMessageAttribute.self, f: { ReplyMessageAttribute(decoder: $0) }) declareEncodable(QuotedReplyMessageAttribute.self, f: { QuotedReplyMessageAttribute(decoder: $0) }) declareEncodable(ReplyStoryAttribute.self, f: { ReplyStoryAttribute(decoder: $0) }) diff --git a/submodules/TelegramCore/Sources/ApiUtils/InstantPage.swift b/submodules/TelegramCore/Sources/ApiUtils/InstantPage.swift index 7030b2176a..aa9da4abc3 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/InstantPage.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/InstantPage.swift @@ -48,38 +48,128 @@ extension InstantPageListItem { self = .blocks(blocks.map({ InstantPageBlock(apiBlock: $0) }), num) } } + + func apiInputPageListItem() -> Api.PageListItem { + switch self { + case let .text(value, _): + return .pageListItemText(Api.PageListItem.Cons_pageListItemText(flags: 0, text: value.apiRichText())) + case let .blocks(blocks, _): + return .pageListItemBlocks(Api.PageListItem.Cons_pageListItemBlocks(flags: 0, blocks: blocks.compactMap { $0.apiInputBlock() })) + case .unknown: + return .pageListItemText(Api.PageListItem.Cons_pageListItemText(flags: 0, text: .textPlain(Api.RichText.Cons_textPlain(text: "")))) + } + } + + func apiInputPageOrderedListItem() -> Api.InputPageListOrderedItem { + switch self { + case let .text(value, num): + var flags: Int32 = 0 + + var inputNum: Int32? + if let num, let numValue = Int32(num) { + inputNum = numValue + flags |= (1 << 2) + } + + return .inputPageListOrderedItemText(Api.InputPageListOrderedItem.Cons_inputPageListOrderedItemText(flags: flags, text: value.apiRichText(), value: inputNum, type: nil)) + case let .blocks(blocks, num): + var flags: Int32 = 0 + + var inputNum: Int32? + if let num, let numValue = Int32(num) { + inputNum = numValue + flags |= (1 << 2) + } + + return .inputPageListOrderedItemBlocks(Api.InputPageListOrderedItem.Cons_inputPageListOrderedItemBlocks(flags: flags, blocks: blocks.compactMap { $0.apiInputBlock() }, value: inputNum, type: nil)) + case .unknown: + return .inputPageListOrderedItemText(Api.InputPageListOrderedItem.Cons_inputPageListOrderedItemText(flags: 0, text: .textPlain(Api.RichText.Cons_textPlain(text: "")), value: nil, type: nil)) + } + } } extension InstantPageTableCell { convenience init(apiTableCell: Api.PageTableCell) { switch apiTableCell { - case let .pageTableCell(pageTableCellData): - let (flags, text, colspan, rowspan) = (pageTableCellData.flags, pageTableCellData.text, pageTableCellData.colspan, pageTableCellData.rowspan) - var alignment = TableHorizontalAlignment.left - if (flags & (1 << 3)) != 0 { - alignment = .center - } else if (flags & (1 << 4)) != 0 { - alignment = .right - } - var verticalAlignment = TableVerticalAlignment.top - if (flags & (1 << 5)) != 0 { - verticalAlignment = .middle - } else if (flags & (1 << 6)) != 0 { - verticalAlignment = .bottom - } - self.init(text: text != nil ? RichText(apiText: text!) : nil, header: (flags & (1 << 0)) != 0, alignment: alignment, verticalAlignment: verticalAlignment, colspan: colspan ?? 0, rowspan: rowspan ?? 0) + case let .pageTableCell(pageTableCellData): + let (flags, text, colspan, rowspan) = (pageTableCellData.flags, pageTableCellData.text, pageTableCellData.colspan, pageTableCellData.rowspan) + var alignment = TableHorizontalAlignment.left + if (flags & (1 << 3)) != 0 { + alignment = .center + } else if (flags & (1 << 4)) != 0 { + alignment = .right + } + var verticalAlignment = TableVerticalAlignment.top + if (flags & (1 << 5)) != 0 { + verticalAlignment = .middle + } else if (flags & (1 << 6)) != 0 { + verticalAlignment = .bottom + } + self.init(text: text != nil ? RichText(apiText: text!) : nil, header: (flags & (1 << 0)) != 0, alignment: alignment, verticalAlignment: verticalAlignment, colspan: colspan ?? 0, rowspan: rowspan ?? 0) } } + + func inputPageTableCell() -> Api.PageTableCell { + var flags: Int32 = 0 + + switch self.alignment { + case .left: + break + case .center: + flags |= (1 << 3) + case .right: + flags |= (1 << 4) + } + + switch self.verticalAlignment { + case .top: + break + case .middle: + flags |= (1 << 5) + case .bottom: + flags |= (1 << 6) + } + + if self.header { + flags |= (1 << 0) + } + + var inputText: Api.RichText? + if let text = self.text { + inputText = text.apiRichText() + if inputText != nil { + flags |= (1 << 7) + } + } + + var inputColspan: Int32? + if self.colspan != 0 { + inputColspan = self.colspan + flags |= (1 << 1) + } + + var inputRowspan: Int32? + if self.rowspan != 0 { + inputRowspan = self.rowspan + flags |= (1 << 2) + } + + return .pageTableCell(Api.PageTableCell.Cons_pageTableCell(flags: flags, text: inputText, colspan: inputColspan, rowspan: inputRowspan)) + } } extension InstantPageTableRow { convenience init(apiTableRow: Api.PageTableRow) { switch apiTableRow { - case let .pageTableRow(pageTableRowData): - let cells = pageTableRowData.cells - self.init(cells: cells.map({ InstantPageTableCell(apiTableCell: $0) })) + case let .pageTableRow(pageTableRowData): + let cells = pageTableRowData.cells + self.init(cells: cells.map({ InstantPageTableCell(apiTableCell: $0) })) } } + + func inputPageTableRow() -> Api.PageTableRow { + return .pageTableRow(Api.PageTableRow.Cons_pageTableRow(cells: self.cells.map { $0.inputPageTableCell() })) + } } extension InstantPageRelatedArticle { @@ -198,6 +288,104 @@ extension InstantPageBlock { default: self = .unsupported } + case let .pageBlockHeading1(pageBlockHeading1): + self = .heading(text: RichText(apiText: pageBlockHeading1.text), level: 1) + case let .pageBlockHeading2(pageBlockHeading2): + self = .heading(text: RichText(apiText: pageBlockHeading2.text), level: 2) + case let .pageBlockHeading3(pageBlockHeading3): + self = .heading(text: RichText(apiText: pageBlockHeading3.text), level: 3) + case let .pageBlockHeading4(pageBlockHeading4): + self = .heading(text: RichText(apiText: pageBlockHeading4.text), level: 4) + case let .pageBlockHeading5(pageBlockHeading5): + self = .heading(text: RichText(apiText: pageBlockHeading5.text), level: 5) + case let .pageBlockHeading6(pageBlockHeading6): + self = .heading(text: RichText(apiText: pageBlockHeading6.text), level: 6) + case let .pageBlockMath(pageBlockMath): + self = .formula(latex: pageBlockMath.source) + case .inputPageBlockPhoto, .inputPageBlockVideo, .inputPageBlockAudio, .inputPageBlockMap, .inputPageBlockOrderedList: + self = .unsupported + } + } + + func apiInputBlock() -> Api.PageBlock? { + switch self { + case .unsupported, .title, .subtitle, .kicker, .header, .subheader, .cover, .channelBanner, .authorDate, .relatedArticles, .webEmbed, .postEmbed: + return nil + case let .heading(text, level): + let block: Api.PageBlock + switch level { + case 0, 1: + block = .pageBlockHeading1(Api.PageBlock.Cons_pageBlockHeading1(text: text.apiRichText())) + case 2: + block = .pageBlockHeading2(Api.PageBlock.Cons_pageBlockHeading2(text: text.apiRichText())) + case 3: + block = .pageBlockHeading3(Api.PageBlock.Cons_pageBlockHeading3(text: text.apiRichText())) + case 4: + block = .pageBlockHeading4(Api.PageBlock.Cons_pageBlockHeading4(text: text.apiRichText())) + case 5: + block = .pageBlockHeading5(Api.PageBlock.Cons_pageBlockHeading5(text: text.apiRichText())) + default: + block = .pageBlockHeading6(Api.PageBlock.Cons_pageBlockHeading6(text: text.apiRichText())) + } + return block + case let .formula(latex): + return .pageBlockMath(Api.PageBlock.Cons_pageBlockMath(source: latex)) + case let .paragraph(value): + return .pageBlockParagraph(Api.PageBlock.Cons_pageBlockParagraph(text: value.apiRichText())) + case let .preformatted(text, language): + return .pageBlockPreformatted(Api.PageBlock.Cons_pageBlockPreformatted(text: text.apiRichText(), language: language ?? "")) + case let .footer(value): + return .pageBlockFooter(Api.PageBlock.Cons_pageBlockFooter(text: value.apiRichText())) + case .divider: + return .pageBlockDivider + case let .anchor(value): + return .pageBlockAnchor(Api.PageBlock.Cons_pageBlockAnchor(name: value)) + case let .list(items, ordered): + if ordered { + return .inputPageBlockOrderedList(Api.PageBlock.Cons_inputPageBlockOrderedList(flags: 0, items: items.map { $0.apiInputPageOrderedListItem() }, start: nil, type: nil)) + } else { + return .pageBlockList(Api.PageBlock.Cons_pageBlockList(items: items.map { $0.apiInputPageListItem() })) + } + case let .blockQuote(text, caption): + return .pageBlockBlockquote(Api.PageBlock.Cons_pageBlockBlockquote(text: text.apiRichText(), caption: caption.apiRichText())) + case let .pullQuote(text, caption): + return .pageBlockPullquote(Api.PageBlock.Cons_pageBlockPullquote(text: text.apiRichText(), caption: caption.apiRichText())) + case let .image(id, caption, url, _): + //TODO:localize + let _ = id + assertionFailure() + return .inputPageBlockPhoto(Api.PageBlock.Cons_inputPageBlockPhoto(flags: 0, photo: .inputPhotoEmpty, caption: .pageCaption(Api.PageCaption.Cons_pageCaption(text: caption.text.apiRichText(), credit: caption.credit.apiRichText())), url: url)) + case let .video(id, caption, autoplay, loop): + //TODO:localize + let _ = autoplay + let _ = loop + let _ = id + assertionFailure() + return .inputPageBlockVideo(Api.PageBlock.Cons_inputPageBlockVideo(flags: 0, video: .inputDocumentEmpty, caption: .pageCaption(Api.PageCaption.Cons_pageCaption(text: caption.text.apiRichText(), credit: caption.credit.apiRichText())))) + case let .audio(id, caption): + let _ = id + return .inputPageBlockAudio(Api.PageBlock.Cons_inputPageBlockAudio(audio: .inputDocumentEmpty, caption: .pageCaption(Api.PageCaption.Cons_pageCaption(text: caption.text.apiRichText(), credit: caption.credit.apiRichText())))) + case let .collage(items, caption): + return .pageBlockCollage(Api.PageBlock.Cons_pageBlockCollage(items: items.compactMap { $0.apiInputBlock() }, caption: .pageCaption(Api.PageCaption.Cons_pageCaption(text: caption.text.apiRichText(), credit: caption.credit.apiRichText())))) + case let .slideshow(items, caption): + return .pageBlockSlideshow(Api.PageBlock.Cons_pageBlockSlideshow(items: items.compactMap { $0.apiInputBlock() }, caption: .pageCaption(Api.PageCaption.Cons_pageCaption(text: caption.text.apiRichText(), credit: caption.credit.apiRichText())))) + case let .table(title, rows, bordered, striped): + var flags: Int32 = 0 + if bordered { + flags |= (1 << 0) + } + if striped { + flags |= (1 << 1) + } + return .pageBlockTable(Api.PageBlock.Cons_pageBlockTable(flags: flags, title: title.apiRichText(), rows: rows.map { $0.inputPageTableRow() })) + case let .details(title, blocks, expanded): + var flags: Int32 = 0 + if expanded { + flags |= (1 << 0) + } + return .pageBlockDetails(Api.PageBlock.Cons_pageBlockDetails(flags: flags, blocks: blocks.compactMap { $0.apiInputBlock() }, title: title.apiRichText())) + case let .map(latitude, longitude, zoom, dimensions, caption): + return .inputPageBlockMap(Api.PageBlock.Cons_inputPageBlockMap(geo: .inputGeoPoint(Api.InputGeoPoint.Cons_inputGeoPoint(flags: 0, lat: latitude, long: longitude, accuracyRadius: nil)), zoom: zoom, w: dimensions.width, h: dimensions.height, caption: .pageCaption(Api.PageCaption.Cons_pageCaption(text: caption.text.apiRichText(), credit: caption.credit.apiRichText())))) } } } @@ -212,15 +400,15 @@ extension InstantPage { let url: String let views: Int32? switch apiPage { - case let .page(pageData): - let (flags, pageUrl, pageBlocks, pagePhotos, pageDocuments, pageViews) = (pageData.flags, pageData.url, pageData.blocks, pageData.photos, pageData.documents, pageData.views) - url = pageUrl - blocks = pageBlocks - photos = pagePhotos - files = pageDocuments - isComplete = (flags & (1 << 0)) == 0 - rtl = (flags & (1 << 1)) != 0 - views = pageViews + case let .page(pageData): + let (flags, pageUrl, pageBlocks, pagePhotos, pageDocuments, pageViews) = (pageData.flags, pageData.url, pageData.blocks, pageData.photos, pageData.documents, pageData.views) + url = pageUrl + blocks = pageBlocks + photos = pagePhotos + files = pageDocuments + isComplete = (flags & (1 << 0)) == 0 + rtl = (flags & (1 << 1)) != 0 + views = pageViews } var media: [MediaId: Media] = [:] for photo in photos { diff --git a/submodules/TelegramCore/Sources/ApiUtils/RichText.swift b/submodules/TelegramCore/Sources/ApiUtils/RichText.swift index 1bb3c1d9c8..7c4cc87bf3 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/RichText.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/RichText.swift @@ -6,53 +6,102 @@ import TelegramApi extension RichText { init(apiText: Api.RichText) { switch apiText { - case .textEmpty: - self = .empty - case let .textPlain(textPlainData): - let text = textPlainData.text - self = .plain(text) - case let .textBold(textBoldData): - let text = textBoldData.text - self = .bold(RichText(apiText: text)) - case let .textItalic(textItalicData): - let text = textItalicData.text - self = .italic(RichText(apiText: text)) - case let .textUnderline(textUnderlineData): - let text = textUnderlineData.text - self = .underline(RichText(apiText: text)) - case let .textStrike(textStrikeData): - let text = textStrikeData.text - self = .strikethrough(RichText(apiText: text)) - case let .textFixed(textFixedData): - let text = textFixedData.text - self = .fixed(RichText(apiText: text)) - case let .textUrl(textUrlData): - let (text, url, webpageId) = (textUrlData.text, textUrlData.url, textUrlData.webpageId) - self = .url(text: RichText(apiText: text), url: url, webpageId: webpageId == 0 ? nil : MediaId(namespace: Namespaces.Media.CloudWebpage, id: webpageId)) - case let .textEmail(textEmailData): - let (text, email) = (textEmailData.text, textEmailData.email) - self = .email(text: RichText(apiText: text), email: email) - case let .textConcat(textConcatData): - let texts = textConcatData.texts - self = .concat(texts.map({ RichText(apiText: $0) })) - case let .textSubscript(textSubscriptData): - let text = textSubscriptData.text - self = .subscript(RichText(apiText: text)) - case let .textSuperscript(textSuperscriptData): - let text = textSuperscriptData.text - self = .superscript(RichText(apiText: text)) - case let .textMarked(textMarkedData): - let text = textMarkedData.text - self = .marked(RichText(apiText: text)) - case let .textPhone(textPhoneData): - let (text, phone) = (textPhoneData.text, textPhoneData.phone) - self = .phone(text: RichText(apiText: text), phone: phone) - case let .textImage(textImageData): - let (documentId, w, h) = (textImageData.documentId, textImageData.w, textImageData.h) - self = .image(id: MediaId(namespace: Namespaces.Media.CloudFile, id: documentId), dimensions: PixelDimensions(width: w, height: h)) - case let .textAnchor(textAnchorData): - let (text, name) = (textAnchorData.text, textAnchorData.name) - self = .anchor(text: RichText(apiText: text), name: name) + case .textEmpty: + self = .empty + case let .textPlain(textPlainData): + let text = textPlainData.text + self = .plain(text) + case let .textBold(textBoldData): + let text = textBoldData.text + self = .bold(RichText(apiText: text)) + case let .textItalic(textItalicData): + let text = textItalicData.text + self = .italic(RichText(apiText: text)) + case let .textUnderline(textUnderlineData): + let text = textUnderlineData.text + self = .underline(RichText(apiText: text)) + case let .textStrike(textStrikeData): + let text = textStrikeData.text + self = .strikethrough(RichText(apiText: text)) + case let .textFixed(textFixedData): + let text = textFixedData.text + self = .fixed(RichText(apiText: text)) + case let .textUrl(textUrlData): + let (text, url, webpageId) = (textUrlData.text, textUrlData.url, textUrlData.webpageId) + self = .url(text: RichText(apiText: text), url: url, webpageId: webpageId == 0 ? nil : MediaId(namespace: Namespaces.Media.CloudWebpage, id: webpageId)) + case let .textEmail(textEmailData): + let (text, email) = (textEmailData.text, textEmailData.email) + self = .email(text: RichText(apiText: text), email: email) + case let .textConcat(textConcatData): + let texts = textConcatData.texts + self = .concat(texts.map({ RichText(apiText: $0) })) + case let .textSubscript(textSubscriptData): + let text = textSubscriptData.text + self = .subscript(RichText(apiText: text)) + case let .textSuperscript(textSuperscriptData): + let text = textSuperscriptData.text + self = .superscript(RichText(apiText: text)) + case let .textMarked(textMarkedData): + let text = textMarkedData.text + self = .marked(RichText(apiText: text)) + case let .textPhone(textPhoneData): + let (text, phone) = (textPhoneData.text, textPhoneData.phone) + self = .phone(text: RichText(apiText: text), phone: phone) + case let .textImage(textImageData): + let (documentId, w, h) = (textImageData.documentId, textImageData.w, textImageData.h) + self = .image(id: MediaId(namespace: Namespaces.Media.CloudFile, id: documentId), dimensions: PixelDimensions(width: w, height: h)) + case let .textAnchor(textAnchorData): + let (text, name) = (textAnchorData.text, textAnchorData.name) + self = .anchor(text: RichText(apiText: text), name: name) + case .inputTextImage: + self = .plain("") + case .textCustomEmoji: + //TODO:localize + self = .plain("") + case let .textMath(textMath): + self = .formula(latex: textMath.source) + } + } + + func apiRichText() -> Api.RichText { + switch self { + case .empty: + return .textPlain(Api.RichText.Cons_textPlain(text: "")) + case let .plain(value): + return .textPlain(Api.RichText.Cons_textPlain(text: value)) + case let .bold(value): + return .textBold(Api.RichText.Cons_textBold(text: value.apiRichText())) + case let .italic(value): + return .textItalic(Api.RichText.Cons_textItalic(text: value.apiRichText())) + case let .underline(value): + return .textUnderline(Api.RichText.Cons_textUnderline(text: value.apiRichText())) + case let .strikethrough(value): + return .textStrike(Api.RichText.Cons_textStrike(text: value.apiRichText())) + case let .fixed(value): + return .textFixed(Api.RichText.Cons_textFixed(text: value.apiRichText())) + case let .url(text, url, webpageId): + return .textUrl(Api.RichText.Cons_textUrl(text: text.apiRichText(), url: url, webpageId: webpageId?.id ?? 0)) + case let .email(text, email): + return .textEmail(Api.RichText.Cons_textEmail(text: text.apiRichText(), email: email)) + case let .concat(values): + return .textConcat(Api.RichText.Cons_textConcat(texts: values.map { $0.apiRichText() })) + case let .`subscript`(value): + return .textSubscript(Api.RichText.Cons_textSubscript(text: value.apiRichText())) + case let .superscript(value): + return .textSuperscript(Api.RichText.Cons_textSuperscript(text: value.apiRichText())) + case let .marked(value): + return .textMarked(Api.RichText.Cons_textMarked(text: value.apiRichText())) + case let .phone(text, phone): + return .textPhone(Api.RichText.Cons_textPhone(text: text.apiRichText(), phone: phone)) + case let .image(id, dimensions): + //TODO:localize + let _ = id + assertionFailure() + return .inputTextImage(Api.RichText.Cons_inputTextImage(document: .inputDocumentEmpty, w: dimensions.width, h: dimensions.height)) + case let .anchor(text, name): + return .textAnchor(Api.RichText.Cons_textAnchor(text: text.apiRichText(), name: name)) + case let .formula(latex): + return .textMath(Api.RichText.Cons_textMath(source: latex)) } } } diff --git a/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift b/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift index 30e939643c..4b66a95aa6 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift @@ -848,7 +848,7 @@ extension StoreMessage { convenience init?(apiMessage: Api.Message, accountPeerId: PeerId, peerIsForum: Bool, namespace: MessageId.Namespace = Namespaces.Message.Cloud) { switch apiMessage { case let .message(messageData): - let (flags, flags2, id, fromId, boosts, rank, chatPeerId, savedPeerId, fwdFrom, viaBotId, viaBusinessBotId, guestChatViaFrom, replyTo, date, message, media, replyMarkup, entities, views, forwards, replies, editDate, postAuthor, groupingId, reactions, restrictionReason, ttlPeriod, quickReplyShortcutId, messageEffectId, factCheck, reportDeliveryUntilDate, paidMessageStars, suggestedPost, scheduledRepeatPeriod, summaryFromLanguage) = (messageData.flags, messageData.flags2, messageData.id, messageData.fromId, messageData.fromBoostsApplied, messageData.fromRank, messageData.peerId, messageData.savedPeerId, messageData.fwdFrom, messageData.viaBotId, messageData.viaBusinessBotId, messageData.guestchatViaFrom, messageData.replyTo, messageData.date, messageData.message, messageData.media, messageData.replyMarkup, messageData.entities, messageData.views, messageData.forwards, messageData.replies, messageData.editDate, messageData.postAuthor, messageData.groupedId, messageData.reactions, messageData.restrictionReason, messageData.ttlPeriod, messageData.quickReplyShortcutId, messageData.effect, messageData.factcheck, messageData.reportDeliveryUntilDate, messageData.paidMessageStars, messageData.suggestedPost, messageData.scheduleRepeatPeriod, messageData.summaryFromLanguage) + let (flags, flags2, id, fromId, boosts, rank, chatPeerId, savedPeerId, fwdFrom, viaBotId, viaBusinessBotId, guestChatViaFrom, replyTo, date, message, media, replyMarkup, entities, views, forwards, replies, editDate, postAuthor, groupingId, reactions, restrictionReason, ttlPeriod, quickReplyShortcutId, messageEffectId, factCheck, reportDeliveryUntilDate, paidMessageStars, suggestedPost, scheduledRepeatPeriod, summaryFromLanguage) = (messageData.flags, messageData.flags2, messageData.id, messageData.fromId, messageData.fromBoostsApplied, messageData.fromRank, messageData.peerId, messageData.savedPeerId, messageData.fwdFrom, messageData.viaBotId, messageData.viaBusinessBotId, messageData.guestchatViaFrom, messageData.replyTo, messageData.date, messageData.message, messageData.media, messageData.replyMarkup, messageData.entities, messageData.views, messageData.forwards, messageData.replies, messageData.editDate, messageData.postAuthor, messageData.groupedId, messageData.reactions, messageData.restrictionReason, messageData.ttlPeriod, messageData.quickReplyShortcutId, messageData.effect, messageData.factcheck, messageData.reportDeliveryUntilDate, messageData.paidMessageStars, messageData.suggestedPost, messageData.scheduleRepeatPeriod, messageData.summaryFromLanguage) var attributes: [MessageAttribute] = [] if (flags2 & (1 << 4)) != 0 { @@ -1133,7 +1133,7 @@ extension StoreMessage { } var entitiesAttribute: TextEntitiesMessageAttribute? - if let entities = entities, !entities.isEmpty { + if let entities, !entities.isEmpty { let attribute = TextEntitiesMessageAttribute(entities: messageTextEntitiesFromApiEntities(entities)) entitiesAttribute = attribute attributes.append(attribute) @@ -1155,6 +1155,10 @@ extension StoreMessage { attributes.append(attribute) } } + + if let richMessage = messageData.richMessage { + attributes.append(RichTextMessageAttribute(apiRichMessage: richMessage)) + } if (flags & (1 << 19)) != 0 { attributes.append(ContentRequiresValidationMessageAttribute()) diff --git a/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift b/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift index 13fdd45ad0..417d0f8810 100644 --- a/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift +++ b/submodules/TelegramCore/Sources/PendingMessages/EnqueueMessage.swift @@ -255,6 +255,8 @@ private func filterMessageAttributesForOutgoingMessage(_ attributes: [MessageAtt switch attribute { case _ as TextEntitiesMessageAttribute: return true + case _ as RichTextMessageAttribute: + return true case _ as InlineBotMessageAttribute: return true case _ as OutgoingMessageInfoAttribute: @@ -306,6 +308,8 @@ private func filterMessageAttributesForForwardedMessage(_ attributes: [MessageAt switch attribute { case _ as TextEntitiesMessageAttribute: return true + case _ as RichTextMessageAttribute: + return true case _ as InlineBotMessageAttribute: return true case _ as NotificationInfoMessageAttribute: diff --git a/submodules/TelegramCore/Sources/PendingMessages/PendingUpdateMessageManager.swift b/submodules/TelegramCore/Sources/PendingMessages/PendingUpdateMessageManager.swift index a2f1fafa5a..beaef4f937 100644 --- a/submodules/TelegramCore/Sources/PendingMessages/PendingUpdateMessageManager.swift +++ b/submodules/TelegramCore/Sources/PendingMessages/PendingUpdateMessageManager.swift @@ -64,7 +64,7 @@ private final class PendingUpdateMessageManagerImpl { } } - func add(messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?, disableUrlPreview: Bool) { + func add(messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, richText: RichTextMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?, disableUrlPreview: Bool) { if let context = self.contexts[messageId] { self.contexts.removeValue(forKey: messageId) context.disposable.dispose() @@ -75,7 +75,7 @@ private final class PendingUpdateMessageManagerImpl { self.contexts[messageId] = context let queue = self.queue - disposable.set((requestEditMessage(accountPeerId: self.stateManager.accountPeerId, postbox: self.postbox, network: self.network, stateManager: self.stateManager, transformOutgoingMessageMedia: self.transformOutgoingMessageMedia, messageMediaPreuploadManager: self.messageMediaPreuploadManager, mediaReferenceRevalidationContext: self.mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: nil, invertMediaAttribute: invertMediaAttribute) + disposable.set((requestEditMessage(accountPeerId: self.stateManager.accountPeerId, postbox: self.postbox, network: self.network, stateManager: self.stateManager, transformOutgoingMessageMedia: self.transformOutgoingMessageMedia, messageMediaPreuploadManager: self.messageMediaPreuploadManager, mediaReferenceRevalidationContext: self.mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, richText: richText, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: nil, invertMediaAttribute: invertMediaAttribute) |> deliverOn(self.queue)).start(next: { [weak self, weak context] value in queue.async { guard let strongSelf = self, let initialContext = context else { @@ -163,9 +163,9 @@ public final class PendingUpdateMessageManager { }) } - public func add(messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute? = nil, invertMediaAttribute: InvertMediaMessageAttribute? = nil, disableUrlPreview: Bool = false) { + public func add(messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, richText: RichTextMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute? = nil, invertMediaAttribute: InvertMediaMessageAttribute? = nil, disableUrlPreview: Bool = false) { self.impl.with { impl in - impl.add(messageId: messageId, text: text, media: media, entities: entities, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertMediaAttribute, disableUrlPreview: disableUrlPreview) + impl.add(messageId: messageId, text: text, media: media, entities: entities, richText: richText, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertMediaAttribute, disableUrlPreview: disableUrlPreview) } } diff --git a/submodules/TelegramCore/Sources/PendingMessages/RequestEditMessage.swift b/submodules/TelegramCore/Sources/PendingMessages/RequestEditMessage.swift index 18a6c194a2..d0f555d1a4 100644 --- a/submodules/TelegramCore/Sources/PendingMessages/RequestEditMessage.swift +++ b/submodules/TelegramCore/Sources/PendingMessages/RequestEditMessage.swift @@ -27,15 +27,15 @@ public enum RequestEditMessageError { case invalidGrouping } -func _internal_requestEditMessage(account: Account, messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, disableUrlPreview: Bool, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?) -> Signal { - return requestEditMessage(accountPeerId: account.peerId, postbox: account.postbox, network: account.network, stateManager: account.stateManager, transformOutgoingMessageMedia: account.transformOutgoingMessageMedia, messageMediaPreuploadManager: account.messageMediaPreuploadManager, mediaReferenceRevalidationContext: account.mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, invertMediaAttribute: invertMediaAttribute) +func _internal_requestEditMessage(account: Account, messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, richText: RichTextMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, disableUrlPreview: Bool, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?) -> Signal { + return requestEditMessage(accountPeerId: account.peerId, postbox: account.postbox, network: account.network, stateManager: account.stateManager, transformOutgoingMessageMedia: account.transformOutgoingMessageMedia, messageMediaPreuploadManager: account.messageMediaPreuploadManager, mediaReferenceRevalidationContext: account.mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, richText: richText, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, invertMediaAttribute: invertMediaAttribute) } -func requestEditMessage(accountPeerId: PeerId, postbox: Postbox, network: Network, stateManager: AccountStateManager, transformOutgoingMessageMedia: TransformOutgoingMessageMedia?, messageMediaPreuploadManager: MessageMediaPreuploadManager, mediaReferenceRevalidationContext: MediaReferenceRevalidationContext, messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, disableUrlPreview: Bool, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?) -> Signal { - return requestEditMessageInternal(accountPeerId: accountPeerId, postbox: postbox, network: network, stateManager: stateManager, transformOutgoingMessageMedia: transformOutgoingMessageMedia, messageMediaPreuploadManager: messageMediaPreuploadManager, mediaReferenceRevalidationContext: mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertMediaAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, forceReupload: false) +func requestEditMessage(accountPeerId: PeerId, postbox: Postbox, network: Network, stateManager: AccountStateManager, transformOutgoingMessageMedia: TransformOutgoingMessageMedia?, messageMediaPreuploadManager: MessageMediaPreuploadManager, mediaReferenceRevalidationContext: MediaReferenceRevalidationContext, messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, richText: RichTextMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, disableUrlPreview: Bool, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?) -> Signal { + return requestEditMessageInternal(accountPeerId: accountPeerId, postbox: postbox, network: network, stateManager: stateManager, transformOutgoingMessageMedia: transformOutgoingMessageMedia, messageMediaPreuploadManager: messageMediaPreuploadManager, mediaReferenceRevalidationContext: mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, richText: richText, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertMediaAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, forceReupload: false) |> `catch` { error -> Signal in if case .invalidReference = error { - return requestEditMessageInternal(accountPeerId: accountPeerId, postbox: postbox, network: network, stateManager: stateManager, transformOutgoingMessageMedia: transformOutgoingMessageMedia, messageMediaPreuploadManager: messageMediaPreuploadManager, mediaReferenceRevalidationContext: mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertMediaAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, forceReupload: true) + return requestEditMessageInternal(accountPeerId: accountPeerId, postbox: postbox, network: network, stateManager: stateManager, transformOutgoingMessageMedia: transformOutgoingMessageMedia, messageMediaPreuploadManager: messageMediaPreuploadManager, mediaReferenceRevalidationContext: mediaReferenceRevalidationContext, messageId: messageId, text: text, media: media, entities: entities, richText: richText, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertMediaAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, forceReupload: true) } else { return .fail(error) } @@ -50,7 +50,7 @@ func requestEditMessage(accountPeerId: PeerId, postbox: Postbox, network: Networ } } -private func requestEditMessageInternal(accountPeerId: PeerId, postbox: Postbox, network: Network, stateManager: AccountStateManager, transformOutgoingMessageMedia: TransformOutgoingMessageMedia?, messageMediaPreuploadManager: MessageMediaPreuploadManager, mediaReferenceRevalidationContext: MediaReferenceRevalidationContext, messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?, disableUrlPreview: Bool, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute?, forceReupload: Bool) -> Signal { +private func requestEditMessageInternal(accountPeerId: PeerId, postbox: Postbox, network: Network, stateManager: AccountStateManager, transformOutgoingMessageMedia: TransformOutgoingMessageMedia?, messageMediaPreuploadManager: MessageMediaPreuploadManager, mediaReferenceRevalidationContext: MediaReferenceRevalidationContext, messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, richText: RichTextMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute?, invertMediaAttribute: InvertMediaMessageAttribute?, disableUrlPreview: Bool, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute?, forceReupload: Bool) -> Signal { let uploadedMedia: Signal switch media { case .keep: @@ -146,15 +146,21 @@ private func requestEditMessageInternal(accountPeerId: PeerId, postbox: Postbox, } |> mapError { _ -> RequestEditMessageInternalError in } |> mapToSignal { peer, message, associatedPeers -> Signal in - if let peer = peer, let message = message, let inputPeer = apiInputPeer(peer) { + if let peer, let message, let inputPeer = apiInputPeer(peer) { var flags: Int32 = 1 << 11 var apiEntities: [Api.MessageEntity]? - if let entities = entities { + if let entities { apiEntities = apiTextAttributeEntities(entities, associatedPeers: associatedPeers) flags |= Int32(1 << 3) } + var apiRichMessage: Api.InputRichMessage? + if let richText { + apiRichMessage = richText.apiInputRichMessage() + flags |= Int32(1 << 23) + } + if disableUrlPreview { flags |= Int32(1 << 1) } @@ -201,7 +207,7 @@ private func requestEditMessageInternal(accountPeerId: PeerId, postbox: Postbox, flags |= Int32(1 << 17) } - return network.request(Api.functions.messages.editMessage(flags: flags, peer: inputPeer, id: messageId.id, message: text, media: inputMedia, replyMarkup: nil, entities: apiEntities, scheduleDate: effectiveScheduleTime, scheduleRepeatPeriod: effectiveScheduleRepeatPeriod, quickReplyShortcutId: quickReplyShortcutId)) + return network.request(Api.functions.messages.editMessage(flags: flags, peer: inputPeer, id: messageId.id, message: text, media: inputMedia, replyMarkup: nil, entities: apiEntities, scheduleDate: effectiveScheduleTime, scheduleRepeatPeriod: effectiveScheduleRepeatPeriod, quickReplyShortcutId: quickReplyShortcutId, richMessage: apiRichMessage)) |> map { result -> Api.Updates? in return result } @@ -429,7 +435,7 @@ func _internal_requestEditLiveLocation(postbox: Postbox, network: Network, state inputMedia = .inputMediaGeoLive(.init(flags: 1 << 0, geoPoint: .inputGeoPoint(.init(flags: 0, lat: media.latitude, long: media.longitude, accuracyRadius: nil)), heading: nil, period: nil, proximityNotificationRadius: nil)) } - return network.request(Api.functions.messages.editMessage(flags: 1 << 14, peer: inputPeer, id: messageId.id, message: nil, media: inputMedia, replyMarkup: nil, entities: nil, scheduleDate: nil, scheduleRepeatPeriod: nil, quickReplyShortcutId: nil)) + return network.request(Api.functions.messages.editMessage(flags: 1 << 14, peer: inputPeer, id: messageId.id, message: nil, media: inputMedia, replyMarkup: nil, entities: nil, scheduleDate: nil, scheduleRepeatPeriod: nil, quickReplyShortcutId: nil, richMessage: nil)) |> map(Optional.init) |> `catch` { _ -> Signal in return .single(nil) diff --git a/submodules/TelegramCore/Sources/PendingMessages/StandaloneSendMessage.swift b/submodules/TelegramCore/Sources/PendingMessages/StandaloneSendMessage.swift index 2cf6b25d25..79256e6c48 100644 --- a/submodules/TelegramCore/Sources/PendingMessages/StandaloneSendMessage.swift +++ b/submodules/TelegramCore/Sources/PendingMessages/StandaloneSendMessage.swift @@ -366,6 +366,7 @@ private func sendUploadedMessageContent( var uniqueId: Int64 = 0 var forwardSourceInfoAttribute: ForwardSourceInfoAttribute? var messageEntities: [Api.MessageEntity]? + var apiRichMessage: Api.InputRichMessage? var replyMessageId: Int32? var topMsgId: Int32? var monoforumPeerId: Api.InputPeer? @@ -442,6 +443,9 @@ private func sendUploadedMessageContent( allowPaidStars = attribute.stars.value } else if let attribute = attribute as? SuggestedPostMessageAttribute { suggestedPost = attribute.apiSuggestedPost(fixMinTime: Int32(Date().timeIntervalSince1970 + 10)) + } else if let attribute = attribute as? RichTextMessageAttribute { + apiRichMessage = attribute.apiInputRichMessage() + flags |= Int32(1 << 23) } } @@ -512,7 +516,7 @@ private func sendUploadedMessageContent( flags |= 1 << 22 } - sendMessageRequest = network.requestWithAdditionalInfo(Api.functions.messages.sendMessage(flags: flags, peer: inputPeer, replyTo: replyTo, message: text, randomId: uniqueId, replyMarkup: nil, entities: messageEntities, scheduleDate: scheduleTime, scheduleRepeatPeriod: scheduleRepeatPeriod, sendAs: sendAsInputPeer, quickReplyShortcut: nil, effect: nil, allowPaidStars: allowPaidStars, suggestedPost: suggestedPost), info: .acknowledgement, tag: dependencyTag) + sendMessageRequest = network.requestWithAdditionalInfo(Api.functions.messages.sendMessage(flags: flags, peer: inputPeer, replyTo: replyTo, message: text, randomId: uniqueId, replyMarkup: nil, entities: messageEntities, scheduleDate: scheduleTime, scheduleRepeatPeriod: scheduleRepeatPeriod, sendAs: sendAsInputPeer, quickReplyShortcut: nil, effect: nil, allowPaidStars: allowPaidStars, suggestedPost: suggestedPost, richMessage: apiRichMessage), info: .acknowledgement, tag: dependencyTag) case let .media(inputMedia, text): if bubbleUpEmojiOrStickersets { flags |= Int32(1 << 15) @@ -692,6 +696,7 @@ private func sendMessageContent(account: Account, peerId: PeerId, attributes: [M var uniqueId: Int64 = Int64.random(in: Int64.min ... Int64.max) //var forwardSourceInfoAttribute: ForwardSourceInfoAttribute? var messageEntities: [Api.MessageEntity]? + var apiRichMessage: Api.InputRichMessage? var replyMessageId: Int32? var replyToStoryId: StoryId? var scheduleTime: Int32? @@ -731,6 +736,9 @@ private func sendMessageContent(account: Account, peerId: PeerId, attributes: [M allowPaidStars = attribute.stars.value } else if let attribute = attribute as? SuggestedPostMessageAttribute { suggestedPost = attribute.apiSuggestedPost(fixMinTime: Int32(Date().timeIntervalSince1970 + 10)) + } else if let attribute = attribute as? RichTextMessageAttribute { + apiRichMessage = attribute.apiInputRichMessage() + flags |= Int32(1 << 23) } } @@ -767,7 +775,7 @@ private func sendMessageContent(account: Account, peerId: PeerId, attributes: [M replyTo = .inputReplyToMessage(.init(flags: flags, replyToMsgId: threadId, topMsgId: threadId, replyToPeerId: nil, quoteText: nil, quoteEntities: nil, quoteOffset: nil, monoforumPeerId: nil, todoItemId: nil, pollOption: nil)) } - sendMessageRequest = account.network.request(Api.functions.messages.sendMessage(flags: flags, peer: inputPeer, replyTo: replyTo, message: text, randomId: uniqueId, replyMarkup: nil, entities: messageEntities, scheduleDate: scheduleTime, scheduleRepeatPeriod: scheduleRepeatPeriod, sendAs: sendAsInputPeer, quickReplyShortcut: nil, effect: nil, allowPaidStars: allowPaidStars, suggestedPost: nil)) + sendMessageRequest = account.network.request(Api.functions.messages.sendMessage(flags: flags, peer: inputPeer, replyTo: replyTo, message: text, randomId: uniqueId, replyMarkup: nil, entities: messageEntities, scheduleDate: scheduleTime, scheduleRepeatPeriod: scheduleRepeatPeriod, sendAs: sendAsInputPeer, quickReplyShortcut: nil, effect: nil, allowPaidStars: allowPaidStars, suggestedPost: nil, richMessage: apiRichMessage)) |> `catch` { _ -> Signal in return .complete() } diff --git a/submodules/TelegramCore/Sources/State/PendingMessageManager.swift b/submodules/TelegramCore/Sources/State/PendingMessageManager.swift index 951b02d2c4..8fe99f1e7d 100644 --- a/submodules/TelegramCore/Sources/State/PendingMessageManager.swift +++ b/submodules/TelegramCore/Sources/State/PendingMessageManager.swift @@ -1720,6 +1720,7 @@ public final class PendingMessageManager { var uniqueId: Int64 = 0 var forwardSourceInfoAttribute: ForwardSourceInfoAttribute? var messageEntities: [Api.MessageEntity]? + var apiRichMessage: Api.InputRichMessage? var replyMessageId: Int32? var replyPeerId: PeerId? var replyQuote: EngineMessageReplyQuote? @@ -1803,6 +1804,9 @@ public final class PendingMessageManager { allowPaidStars = attribute.stars.value } else if let attribute = attribute as? SuggestedPostMessageAttribute { suggestedPost = attribute.apiSuggestedPost(fixMinTime: Int32(Date().timeIntervalSince1970 + 10)) + } else if let attribute = attribute as? RichTextMessageAttribute { + apiRichMessage = attribute.apiInputRichMessage() + flags |= Int32(1 << 23) } } @@ -1928,7 +1932,7 @@ public final class PendingMessageManager { flags |= 1 << 22 } - sendMessageRequest = network.requestWithAdditionalInfo(Api.functions.messages.sendMessage(flags: flags, peer: inputPeer, replyTo: replyTo, message: message.text, randomId: uniqueId, replyMarkup: nil, entities: messageEntities, scheduleDate: scheduleTime, scheduleRepeatPeriod: scheduleRepeatPeriod, sendAs: sendAsInputPeer, quickReplyShortcut: quickReplyShortcut, effect: messageEffectId, allowPaidStars: allowPaidStars, suggestedPost: suggestedPost), info: .acknowledgement, tag: dependencyTag) + sendMessageRequest = network.requestWithAdditionalInfo(Api.functions.messages.sendMessage(flags: flags, peer: inputPeer, replyTo: replyTo, message: message.text, randomId: uniqueId, replyMarkup: nil, entities: messageEntities, scheduleDate: scheduleTime, scheduleRepeatPeriod: scheduleRepeatPeriod, sendAs: sendAsInputPeer, quickReplyShortcut: quickReplyShortcut, effect: messageEffectId, allowPaidStars: allowPaidStars, suggestedPost: suggestedPost, richMessage: apiRichMessage), info: .acknowledgement, tag: dependencyTag) case let .media(inputMedia, text): if bubbleUpEmojiOrStickersets { flags |= Int32(1 << 15) diff --git a/submodules/TelegramCore/Sources/State/Serialization.swift b/submodules/TelegramCore/Sources/State/Serialization.swift index 832c5530cc..f18e05b294 100644 --- a/submodules/TelegramCore/Sources/State/Serialization.swift +++ b/submodules/TelegramCore/Sources/State/Serialization.swift @@ -260,7 +260,7 @@ public class BoxedMessage: NSObject { public class Serialization: NSObject, MTSerialization { public func currentLayer() -> UInt { - return 225 + return 227 } public func parseMessage(_ data: Data!) -> Any! { diff --git a/submodules/TelegramCore/Sources/State/UpdateMessageService.swift b/submodules/TelegramCore/Sources/State/UpdateMessageService.swift index 3a7916a82e..7de0a48a34 100644 --- a/submodules/TelegramCore/Sources/State/UpdateMessageService.swift +++ b/submodules/TelegramCore/Sources/State/UpdateMessageService.swift @@ -62,7 +62,7 @@ class UpdateMessageService: NSObject, MTMessageService { } case let .updateShortChatMessage(updateShortChatMessageData): let (flags, id, fromId, chatId, message, pts, ptsCount, date, fwdFrom, viaBotId, replyHeader, entities, ttlPeriod) = (updateShortChatMessageData.flags, updateShortChatMessageData.id, updateShortChatMessageData.fromId, updateShortChatMessageData.chatId, updateShortChatMessageData.message, updateShortChatMessageData.pts, updateShortChatMessageData.ptsCount, updateShortChatMessageData.date, updateShortChatMessageData.fwdFrom, updateShortChatMessageData.viaBotId, updateShortChatMessageData.replyTo, updateShortChatMessageData.entities, updateShortChatMessageData.ttlPeriod) - let generatedMessage = Api.Message.message(.init(flags: flags, flags2: 0, id: id, fromId: .peerUser(.init(userId: fromId)), fromBoostsApplied: nil, fromRank: nil, peerId: Api.Peer.peerChat(.init(chatId: chatId)), savedPeerId: nil, fwdFrom: fwdFrom, viaBotId: viaBotId, viaBusinessBotId: nil, guestchatViaFrom: nil, replyTo: replyHeader, date: date, message: message, media: Api.MessageMedia.messageMediaEmpty, replyMarkup: nil, entities: entities, views: nil, forwards: nil, replies: nil, editDate: nil, postAuthor: nil, groupedId: nil, reactions: nil, restrictionReason: nil, ttlPeriod: ttlPeriod, quickReplyShortcutId: nil, effect: nil, factcheck: nil, reportDeliveryUntilDate: nil, paidMessageStars: nil, suggestedPost: nil, scheduleRepeatPeriod: nil, summaryFromLanguage: nil)) + let generatedMessage = Api.Message.message(.init(flags: flags, flags2: 0, id: id, fromId: .peerUser(.init(userId: fromId)), fromBoostsApplied: nil, fromRank: nil, peerId: Api.Peer.peerChat(.init(chatId: chatId)), savedPeerId: nil, fwdFrom: fwdFrom, viaBotId: viaBotId, viaBusinessBotId: nil, guestchatViaFrom: nil, replyTo: replyHeader, date: date, message: message, media: Api.MessageMedia.messageMediaEmpty, replyMarkup: nil, entities: entities, views: nil, forwards: nil, replies: nil, editDate: nil, postAuthor: nil, groupedId: nil, reactions: nil, restrictionReason: nil, ttlPeriod: ttlPeriod, quickReplyShortcutId: nil, effect: nil, factcheck: nil, reportDeliveryUntilDate: nil, paidMessageStars: nil, suggestedPost: nil, scheduleRepeatPeriod: nil, summaryFromLanguage: nil, richMessage: nil)) let update = Api.Update.updateNewMessage(.init(message: generatedMessage, pts: pts, ptsCount: ptsCount)) let groups = groupUpdates([update], users: [], chats: [], date: date, seqRange: nil) if groups.count != 0 { @@ -79,7 +79,7 @@ class UpdateMessageService: NSObject, MTMessageService { let generatedPeerId = Api.Peer.peerUser(.init(userId: userId)) - let generatedMessage = Api.Message.message(.init(flags: flags, flags2: 0, id: id, fromId: generatedFromId, fromBoostsApplied: nil, fromRank: nil, peerId: generatedPeerId, savedPeerId: nil, fwdFrom: fwdFrom, viaBotId: viaBotId, viaBusinessBotId: nil, guestchatViaFrom: nil, replyTo: replyHeader, date: date, message: message, media: Api.MessageMedia.messageMediaEmpty, replyMarkup: nil, entities: entities, views: nil, forwards: nil, replies: nil, editDate: nil, postAuthor: nil, groupedId: nil, reactions: nil, restrictionReason: nil, ttlPeriod: ttlPeriod, quickReplyShortcutId: nil, effect: nil, factcheck: nil, reportDeliveryUntilDate: nil, paidMessageStars: nil, suggestedPost: nil, scheduleRepeatPeriod: nil, summaryFromLanguage: nil)) + let generatedMessage = Api.Message.message(.init(flags: flags, flags2: 0, id: id, fromId: generatedFromId, fromBoostsApplied: nil, fromRank: nil, peerId: generatedPeerId, savedPeerId: nil, fwdFrom: fwdFrom, viaBotId: viaBotId, viaBusinessBotId: nil, guestchatViaFrom: nil, replyTo: replyHeader, date: date, message: message, media: Api.MessageMedia.messageMediaEmpty, replyMarkup: nil, entities: entities, views: nil, forwards: nil, replies: nil, editDate: nil, postAuthor: nil, groupedId: nil, reactions: nil, restrictionReason: nil, ttlPeriod: ttlPeriod, quickReplyShortcutId: nil, effect: nil, factcheck: nil, reportDeliveryUntilDate: nil, paidMessageStars: nil, suggestedPost: nil, scheduleRepeatPeriod: nil, summaryFromLanguage: nil, richMessage: nil)) let update = Api.Update.updateNewMessage(.init(message: generatedMessage, pts: pts, ptsCount: ptsCount)) let groups = groupUpdates([update], users: [], chats: [], date: date, seqRange: nil) if groups.count != 0 { diff --git a/submodules/TelegramCore/Sources/SyncCore/SyncCore_RichTextMessageAttribute.swift b/submodules/TelegramCore/Sources/SyncCore/SyncCore_RichTextMessageAttribute.swift new file mode 100644 index 0000000000..ffc7d657d2 --- /dev/null +++ b/submodules/TelegramCore/Sources/SyncCore/SyncCore_RichTextMessageAttribute.swift @@ -0,0 +1,90 @@ +import Foundation +import Postbox +import TelegramApi + +public class RichTextMessageAttribute: MessageAttribute, Equatable { + public let instantPage: InstantPage + + public var associatedPeerIds: [PeerId] { + /*var result: [PeerId] = [] + for entity in entities { + switch entity.type { + case let .TextMention(peerId): + result.append(peerId) + default: + break + } + } + return result*/ + return [] + } + + public var associatedMediaIds: [MediaId] { + /*var result: [MediaId] = [] + for entity in self.entities { + switch entity.type { + case let .CustomEmoji(_, fileId): + result.append(MediaId(namespace: Namespaces.Media.CloudFile, id: fileId)) + default: + break + } + } + if result.isEmpty { + return result + } else { + return Array(Set(result)) + }*/ + return [] + } + + public init(instantPage: InstantPage) { + self.instantPage = instantPage + } + + required public init(decoder: PostboxDecoder) { + self.instantPage = decoder.decodeObjectForKey("instantPage", decoder: { InstantPage(decoder: $0) }) as! InstantPage + } + + public func encode(_ encoder: PostboxEncoder) { + encoder.encodeObject(self.instantPage, forKey: "instantPage") + } + + public static func ==(lhs: RichTextMessageAttribute, rhs: RichTextMessageAttribute) -> Bool { + return lhs.instantPage == rhs.instantPage + } +} + +extension RichTextMessageAttribute { + convenience init(apiRichMessage: Api.RichMessage) { + switch apiRichMessage { + case let .richMessage(richMessage): + var media: [MediaId: Media] = [:] + for photo in richMessage.photos { + if let image = telegramMediaImageFromApiPhoto(photo), let id = image.id { + media[id] = image + } + } + for file in richMessage.documents { + if let file = telegramMediaFileFromApiDocument(file, altDocuments: []), let id = file.id { + media[id] = file + } + } + let isRtl = (richMessage.flags & (1 << 0)) != 0 + let isPartial = (richMessage.flags & (1 << 1)) != 0 + let instantPage = InstantPage(blocks: richMessage.blocks.map({ InstantPageBlock(apiBlock: $0) }), media: media, isComplete: !isPartial, rtl: isRtl, url: "", views: nil) + self.init(instantPage: instantPage) + } + } + + func apiInputRichMessage() -> Api.InputRichMessage { + var flags: Int32 = 0 + if self.instantPage.rtl { + flags |= (1 << 0) + } + + return Api.InputRichMessage.inputRichMessage(Api.InputRichMessage.Cons_inputRichMessage( + flags: flags, + blocks: self.instantPage.blocks.compactMap { $0.apiInputBlock() } + )) + } +} diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/Message.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/Message.swift index dc79e2a281..16dc9d92e2 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/Message.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/Message.swift @@ -72,6 +72,9 @@ public final class EngineMessage: Equatable { public var text: String { return self.impl.text } + public var richText: RichTextMessageAttribute? { + return self.impl.richText + } public var attributes: [Attribute] { return self.impl.attributes } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/Polls.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/Polls.swift index a1a87ca53f..f3597a1d1b 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/Polls.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/Polls.swift @@ -270,7 +270,7 @@ func _internal_requestClosePoll(postbox: Postbox, network: Network, stateManager pollMediaFlags |= 1 << 1 } - return network.request(Api.functions.messages.editMessage(flags: flags, peer: inputPeer, id: messageId.id, message: nil, media: .inputMediaPoll(.init(flags: pollMediaFlags, poll: .poll(.init(id: poll.pollId.id, flags: pollFlags, question: .textWithEntities(.init(text: poll.text, entities: apiEntitiesFromMessageTextEntities(poll.textEntities, associatedPeers: SimpleDictionary()))), answers: poll.options.map({ $0.apiOption }), closePeriod: poll.deadlineTimeout, closeDate: poll.deadlineDate, countriesIso2: poll.countries, hash: 0)), correctAnswers: correctAnswersIndices, attachedMedia: nil, solution: mappedSolution, solutionEntities: mappedSolutionEntities, solutionMedia: nil)), replyMarkup: nil, entities: nil, scheduleDate: nil, scheduleRepeatPeriod: nil, quickReplyShortcutId: nil)) + return network.request(Api.functions.messages.editMessage(flags: flags, peer: inputPeer, id: messageId.id, message: nil, media: .inputMediaPoll(.init(flags: pollMediaFlags, poll: .poll(.init(id: poll.pollId.id, flags: pollFlags, question: .textWithEntities(.init(text: poll.text, entities: apiEntitiesFromMessageTextEntities(poll.textEntities, associatedPeers: SimpleDictionary()))), answers: poll.options.map({ $0.apiOption }), closePeriod: poll.deadlineTimeout, closeDate: poll.deadlineDate, countriesIso2: poll.countries, hash: 0)), correctAnswers: correctAnswersIndices, attachedMedia: nil, solution: mappedSolution, solutionEntities: mappedSolutionEntities, solutionMedia: nil)), replyMarkup: nil, entities: nil, scheduleDate: nil, scheduleRepeatPeriod: nil, quickReplyShortcutId: nil, richMessage: nil)) |> map(Optional.init) |> `catch` { _ -> Signal in return .single(nil) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift index 553cf4a3b9..caba903fda 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift @@ -202,8 +202,8 @@ public extension TelegramEngine { return _internal_clearAuthorHistory(account: self.account, peerId: peerId, memberId: memberId) } - public func requestEditMessage(messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute? = nil, invertMediaAttribute: InvertMediaMessageAttribute? = nil, disableUrlPreview: Bool = false, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute? = nil) -> Signal { - return _internal_requestEditMessage(account: self.account, messageId: messageId, text: text, media: media, entities: entities, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, invertMediaAttribute: invertMediaAttribute) + public func requestEditMessage(messageId: MessageId, text: String, media: RequestEditMessageMedia, entities: TextEntitiesMessageAttribute?, richText: RichTextMessageAttribute?, inlineStickers: [MediaId: Media], webpagePreviewAttribute: WebpagePreviewMessageAttribute? = nil, invertMediaAttribute: InvertMediaMessageAttribute? = nil, disableUrlPreview: Bool = false, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute? = nil) -> Signal { + return _internal_requestEditMessage(account: self.account, messageId: messageId, text: text, media: media, entities: entities, richText: richText, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, disableUrlPreview: disableUrlPreview, scheduleInfoAttribute: scheduleInfoAttribute, invertMediaAttribute: invertMediaAttribute) } public func requestEditLiveLocation(messageId: MessageId, stop: Bool, coordinate: (latitude: Double, longitude: Double, accuracyRadius: Int32?)?, heading: Int32?, proximityNotificationRadius: Int32?, extendPeriod: Int32?) -> Signal { diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChannelSendRestriction.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChannelSendRestriction.swift index 20f562dfe8..f44f397269 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChannelSendRestriction.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChannelSendRestriction.swift @@ -39,7 +39,7 @@ func _internal_toggleChannelJoinRequest(postbox: Postbox, network: Network, acco guard let peer = peer, let inputChannel = apiInputChannel(peer) else { return .fail(.generic) } - return network.request(Api.functions.channels.toggleJoinRequest(channel: inputChannel, enabled: enabled ? .boolTrue : .boolFalse)) + return network.request(Api.functions.channels.toggleJoinRequest(flags: 0, channel: inputChannel, enabled: enabled ? .boolTrue : .boolFalse, guardBot: nil)) |> `catch` { _ -> Signal in return .fail(.generic) } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinChannel.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinChannel.swift index c1bfd309f7..e2ad2571f0 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinChannel.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinChannel.swift @@ -18,7 +18,7 @@ func _internal_joinChannel(account: Account, peerId: PeerId, hash: String?) -> S |> castError(JoinChannelError.self) |> mapToSignal { peer -> Signal in - let request: Signal + let request: Signal if let hash = hash { request = account.network.request(Api.functions.messages.importChatInvite(hash: hash)) } else if let inputChannel = apiInputChannel(peer) { @@ -40,54 +40,57 @@ func _internal_joinChannel(account: Account, peerId: PeerId, hash: String?) -> S return .generic } } - |> mapToSignal { updates -> Signal in - account.stateManager.addUpdates(updates) - - let channels = updates.chats.compactMap { parseTelegramGroupOrChannel(chat: $0) }.compactMap(apiInputChannel) - - if let inputChannel = channels.first { - return account.network.request(Api.functions.channels.getParticipant(channel: inputChannel, participant: .inputPeerSelf)) - |> map(Optional.init) - |> `catch` { _ -> Signal in - return .single(nil) - } - |> mapToSignal { result -> Signal in - guard let result = result else { - return .fail(.generic) + |> mapToSignal { result -> Signal in + switch result { + case let .chatInviteJoinResultOk(result): + account.stateManager.addUpdates(result.updates) + + let channels = result.updates.chats.compactMap { parseTelegramGroupOrChannel(chat: $0) }.compactMap(apiInputChannel) + + if let inputChannel = channels.first { + return account.network.request(Api.functions.channels.getParticipant(channel: inputChannel, participant: .inputPeerSelf)) + |> map(Optional.init) + |> `catch` { _ -> Signal in + return .single(nil) } - return account.postbox.transaction { transaction -> RenderedChannelParticipant? in - var peers: [EnginePeer.Id: EnginePeer] = [:] - var presences: [PeerId: PeerPresence] = [:] - guard let peer = transaction.getPeer(account.peerId) else { - return nil + |> mapToSignal { result -> Signal in + guard let result = result else { + return .fail(.generic) } - peers[account.peerId] = EnginePeer(peer) - if let presence = transaction.getPeerPresence(peerId: account.peerId) { - presences[account.peerId] = presence - } - let updatedParticipant: ChannelParticipant - switch result { - case let .channelParticipant(channelParticipantData): - let participant = channelParticipantData.participant - updatedParticipant = ChannelParticipant(apiParticipant: participant) - } - if case let .member(_, _, maybeAdminInfo, _, _, _) = updatedParticipant { - if let adminInfo = maybeAdminInfo { - if let peer = transaction.getPeer(adminInfo.promotedBy) { - peers[peer.id] = EnginePeer(peer) + return account.postbox.transaction { transaction -> RenderedChannelParticipant? in + var peers: [EnginePeer.Id: EnginePeer] = [:] + var presences: [PeerId: PeerPresence] = [:] + guard let peer = transaction.getPeer(account.peerId) else { + return nil + } + peers[account.peerId] = EnginePeer(peer) + if let presence = transaction.getPeerPresence(peerId: account.peerId) { + presences[account.peerId] = presence + } + let updatedParticipant: ChannelParticipant + switch result { + case let .channelParticipant(channelParticipantData): + let participant = channelParticipantData.participant + updatedParticipant = ChannelParticipant(apiParticipant: participant) + } + if case let .member(_, _, maybeAdminInfo, _, _, _) = updatedParticipant { + if let adminInfo = maybeAdminInfo { + if let peer = transaction.getPeer(adminInfo.promotedBy) { + peers[peer.id] = EnginePeer(peer) + } } } + + return RenderedChannelParticipant(participant: updatedParticipant, peer: EnginePeer(peer), peers: peers, presences: presences) } - - return RenderedChannelParticipant(participant: updatedParticipant, peer: EnginePeer(peer), peers: peers, presences: presences) + |> castError(JoinChannelError.self) } - |> castError(JoinChannelError.self) + } else { + return .fail(.generic) } - } else { + case .chatInviteJoinResultWebView: return .fail(.generic) } - - } |> afterCompleted { if hash == nil { diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinLink.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinLink.swift index e54c34896d..e7c9482b4c 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinLink.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/JoinLink.swift @@ -80,21 +80,26 @@ func _internal_joinChatInteractively(with hash: String, account: Account) -> Sig } } } - |> mapToSignal { updates -> Signal in - account.stateManager.addUpdates(updates) - if let peerId = apiUpdatesGroups(updates).first?.peerId { - return account.postbox.multiplePeersView([peerId]) - |> castError(JoinLinkError.self) - |> filter { view in - return view.peers[peerId] != nil + |> mapToSignal { result -> Signal in + switch result { + case let .chatInviteJoinResultOk(result): + account.stateManager.addUpdates(result.updates) + if let peerId = apiUpdatesGroups(result.updates).first?.peerId { + return account.postbox.multiplePeersView([peerId]) + |> castError(JoinLinkError.self) + |> filter { view in + return view.peers[peerId] != nil + } + |> take(1) + |> map { _ in + return peerId + } + |> timeout(5.0, queue: Queue.concurrentDefaultQueue(), alternate: .single(nil) |> castError(JoinLinkError.self)) } - |> take(1) - |> map { _ in - return peerId - } - |> timeout(5.0, queue: Queue.concurrentDefaultQueue(), alternate: .single(nil) |> castError(JoinLinkError.self)) + return .single(nil) + case .chatInviteJoinResultWebView: + return .fail(.generic) } - return .single(nil) } } diff --git a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift index c072041592..3d1ae582e7 100644 --- a/submodules/TelegramCore/Sources/Utils/MessageUtils.swift +++ b/submodules/TelegramCore/Sources/Utils/MessageUtils.swift @@ -652,6 +652,17 @@ public extension Message { } } +public extension Message { + var richText: RichTextMessageAttribute? { + for attribute in self.attributes { + if let attribute = attribute as? RichTextMessageAttribute { + return attribute + } + } + return nil + } +} + public func _internal_parseMediaAttachment(data: Data) -> Media? { guard let object = Api.parse(Buffer(buffer: MemoryBuffer(data: data))) else { return nil diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift index 31131d774c..6c9fae402a 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageBubbleItemNode/Sources/ChatMessageBubbleItemNode.swift @@ -383,11 +383,7 @@ private func contentNodeMessagesAndClassesForItem(_ item: ChatMessageItem) -> ([ if let attribute = message.attributes.first(where: { $0 is WebpagePreviewMessageAttribute }) as? WebpagePreviewMessageAttribute, attribute.leadingPreview { result.insert((message, ChatMessageWebpageBubbleContentNode.self, itemAttributes, BubbleItemAttributes(isAttachment: false, neighborType: .text, neighborSpacing: .default)), at: addedPriceInfo ? 1 : 0) } else { - if content.instantPage != nil && item.context.sharedContext.immediateExperimentalUISettings.debugRichText { - result.append((message, ChatMessageRichDataBubbleContentNode.self, itemAttributes, BubbleItemAttributes(isAttachment: false, neighborType: .text, neighborSpacing: .default))) - } else { - result.append((message, ChatMessageWebpageBubbleContentNode.self, itemAttributes, BubbleItemAttributes(isAttachment: false, neighborType: .text, neighborSpacing: .default))) - } + result.append((message, ChatMessageWebpageBubbleContentNode.self, itemAttributes, BubbleItemAttributes(isAttachment: false, neighborType: .text, neighborSpacing: .default))) } needReactions = false } @@ -395,6 +391,18 @@ private func contentNodeMessagesAndClassesForItem(_ item: ChatMessageItem) -> ([ } } + var richText: RichTextMessageAttribute? + for attribute in item.message.attributes { + if let attribute = attribute as? RichTextMessageAttribute { + richText = attribute + break + } + } + + if richText != nil { + result.append((message, ChatMessageRichDataBubbleContentNode.self, itemAttributes, BubbleItemAttributes(isAttachment: false, neighborType: .text, neighborSpacing: .default))) + } + if message.adAttribute != nil { result.removeAll() @@ -1627,9 +1635,12 @@ public class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewI let chatLocationPeerId: PeerId = item.chatLocation.peerId ?? item.content.firstMessage.id.peerId var isInlinePage = false - if item.context.sharedContext.immediateExperimentalUISettings.debugRichText, let webpage = item.message.media.first(where: { $0 is TelegramMediaWebpage }) as? TelegramMediaWebpage, case let .Loaded(content) = webpage.content, content.instantPage != nil { - allowFullWidth = true - isInlinePage = true + for attribute in item.message.attributes { + if attribute is RichTextMessageAttribute { + allowFullWidth = true + isInlinePage = true + break + } } do { diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageRichDataBubbleContentNode/Sources/ChatMessageRichDataBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageRichDataBubbleContentNode/Sources/ChatMessageRichDataBubbleContentNode.swift index 5ac8eb5fbc..3c9b113a7c 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageRichDataBubbleContentNode/Sources/ChatMessageRichDataBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageRichDataBubbleContentNode/Sources/ChatMessageRichDataBubbleContentNode.swift @@ -463,7 +463,7 @@ public class ChatMessageRichDataBubbleContentNode: ChatMessageBubbleContentNode let pageView = self.ensurePageView() pageView.update(layout: pageLayout, theme: pageTheme, animation: animation) pageView.frame = CGRect( - origin: .zero, + origin: CGPoint(x: -1.0, y: 0.0), size: pageLayout.contentSize ) } else { diff --git a/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift b/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift index 19bf329003..4da30fbab9 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift @@ -2292,7 +2292,7 @@ extension ChatControllerImpl { let currentWebpagePreviewAttribute = currentMessage.webpagePreviewAttribute ?? WebpagePreviewMessageAttribute(leadingPreview: false, forceLargeMedia: nil, isManuallyAdded: true, isSafe: false) if currentMessage.text != text.string || currentEntities != entities || updatingMedia || webpagePreviewAttribute != currentWebpagePreviewAttribute || disableUrlPreview { - strongSelf.context.account.pendingUpdateMessageManager.add(messageId: editMessage.messageId, text: text.string, media: media, entities: entitiesAttribute, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertedMediaAttribute, disableUrlPreview: disableUrlPreview) + strongSelf.context.account.pendingUpdateMessageManager.add(messageId: editMessage.messageId, text: text.string, media: media, entities: entitiesAttribute, richText: nil, inlineStickers: inlineStickers, webpagePreviewAttribute: webpagePreviewAttribute, invertMediaAttribute: invertedMediaAttribute, disableUrlPreview: disableUrlPreview) } } diff --git a/submodules/TelegramUI/Sources/Chat/ChatControllerOpenTodoContextMenu.swift b/submodules/TelegramUI/Sources/Chat/ChatControllerOpenTodoContextMenu.swift index 1046ef1307..363fd5a46a 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatControllerOpenTodoContextMenu.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatControllerOpenTodoContextMenu.swift @@ -231,6 +231,7 @@ extension ChatControllerImpl { text: "", media: .update(.standalone(media: updatedTodo)), entities: nil, + richText: nil, inlineStickers: [:] ).start() }))) diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index f15c0d78a2..072e45985b 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -4175,13 +4175,15 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G strongSelf.presentScheduleTimePicker(selectedTime: message.timestamp, selectedRepeatPeriod: message._asMessage().scheduleRepeatPeriod, completion: { [weak self] time, repeatPeriod in if let strongSelf = self { var entities: TextEntitiesMessageAttribute? + var richText: RichTextMessageAttribute? for attribute in message.attributes { if let attribute = attribute as? TextEntitiesMessageAttribute { entities = attribute - break + } else if let attribute = attribute as? RichTextMessageAttribute { + richText = attribute } } - strongSelf.editMessageDisposable.set((strongSelf.context.engine.messages.requestEditMessage(messageId: messageId, text: message.text, media: .keep, entities: entities, inlineStickers: [:], webpagePreviewAttribute: nil, disableUrlPreview: false, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute(scheduleTime: time, repeatPeriod: repeatPeriod)) |> deliverOnMainQueue).startStrict(next: { result in + strongSelf.editMessageDisposable.set((strongSelf.context.engine.messages.requestEditMessage(messageId: messageId, text: message.text, media: .keep, entities: entities, richText: richText, inlineStickers: [:], webpagePreviewAttribute: nil, disableUrlPreview: false, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute(scheduleTime: time, repeatPeriod: repeatPeriod)) |> deliverOnMainQueue).startStrict(next: { result in }, error: { error in })) } diff --git a/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift b/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift index 2d4623d38f..778b109a5d 100644 --- a/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift +++ b/submodules/TelegramUI/Sources/ChatControllerAdminBanUsers.swift @@ -519,14 +519,16 @@ extension ChatControllerImpl { return } var entities: TextEntitiesMessageAttribute? + var richText: RichTextMessageAttribute? for attribute in message.attributes { if let attribute = attribute as? TextEntitiesMessageAttribute { entities = attribute - break + } else if let attribute = attribute as? RichTextMessageAttribute { + richText = attribute } } let scheduleTime = message.timestamp + repeatAttribute.repeatPeriod - self.editMessageDisposable.set((self.context.engine.messages.requestEditMessage(messageId: message.id, text: message.text, media: .keep, entities: entities, inlineStickers: [:], webpagePreviewAttribute: nil, disableUrlPreview: false, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute(scheduleTime: scheduleTime, repeatPeriod: repeatAttribute.repeatPeriod)) |> deliverOnMainQueue).startStrict(next: { result in + self.editMessageDisposable.set((self.context.engine.messages.requestEditMessage(messageId: message.id, text: message.text, media: .keep, entities: entities, richText: richText, inlineStickers: [:], webpagePreviewAttribute: nil, disableUrlPreview: false, scheduleInfoAttribute: OutgoingScheduleInfoMessageAttribute(scheduleTime: scheduleTime, repeatPeriod: repeatAttribute.repeatPeriod)) |> deliverOnMainQueue).startStrict(next: { result in }, error: { error in })) }), diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index d69d16cb1a..46bdf3cb6f 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -67,6 +67,7 @@ import PresentationDataUtils import TextProcessingScreen import Pasteboard import UndoUI +import BrowserUI final class VideoNavigationControllerDropContentItem: NavigationControllerDropContentItem { let itemNode: OverlayMediaItemNode @@ -4856,44 +4857,51 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { } } - for text in breakChatInputText(trimChatInputText(inputText)) { - if text.length != 0 { - var attributes: [MessageAttribute] = [] - let entities: [MessageTextEntity] - if case let .customChatContents(customChatContents) = self.chatPresentationInterfaceState.subject, case .businessLinkSetup = customChatContents.kind { - entities = generateChatInputTextEntities(text, generateLinks: false) - } else { - entities = generateTextEntities(text.string, enabledTypes: .all, currentEntities: generateChatInputTextEntities(text, maxAnimatedEmojisInText: 0)) - } - if !entities.isEmpty { - attributes.append(TextEntitiesMessageAttribute(entities: entities)) - } - - if let urlPreview = self.chatPresentationInterfaceState.urlPreview { - if self.chatPresentationInterfaceState.interfaceState.composeDisableUrlPreviews.contains(urlPreview.url) { - attributes.append(OutgoingContentInfoMessageAttribute(flags: [.disableLinkPreviews])) + if self.context.sharedContext.immediateExperimentalUISettings.debugRichText, let attribute = inputRichTextAttributeFromText(context: self.context, text: inputText.string) { + var attributes: [MessageAttribute] = [] + attributes.append(attribute) + messages.append(.message(text: "", attributes: attributes, inlineStickers: [:], mediaReference: nil, threadId: self.chatLocation.threadId, replyToMessageId: self.chatPresentationInterfaceState.interfaceState.replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])) + mediaReference = nil + } else { + for text in breakChatInputText(trimChatInputText(inputText)) { + if text.length != 0 { + var attributes: [MessageAttribute] = [] + let entities: [MessageTextEntity] + if case let .customChatContents(customChatContents) = self.chatPresentationInterfaceState.subject, case .businessLinkSetup = customChatContents.kind { + entities = generateChatInputTextEntities(text, generateLinks: false) } else { - attributes.append(WebpagePreviewMessageAttribute(leadingPreview: !urlPreview.positionBelowText, forceLargeMedia: urlPreview.largeMedia, isManuallyAdded: true, isSafe: false)) + entities = generateTextEntities(text.string, enabledTypes: .all, currentEntities: generateChatInputTextEntities(text, maxAnimatedEmojisInText: 0)) } - } - - var bubbleUpEmojiOrStickersets: [ItemCollectionId] = [] - for entity in entities { - if case let .CustomEmoji(_, fileId) = entity.type { - if let packId = bubbleUpEmojiOrStickersetsById[fileId] { - if !bubbleUpEmojiOrStickersets.contains(packId) { - bubbleUpEmojiOrStickersets.append(packId) + if !entities.isEmpty { + attributes.append(TextEntitiesMessageAttribute(entities: entities)) + } + + if let urlPreview = self.chatPresentationInterfaceState.urlPreview { + if self.chatPresentationInterfaceState.interfaceState.composeDisableUrlPreviews.contains(urlPreview.url) { + attributes.append(OutgoingContentInfoMessageAttribute(flags: [.disableLinkPreviews])) + } else { + attributes.append(WebpagePreviewMessageAttribute(leadingPreview: !urlPreview.positionBelowText, forceLargeMedia: urlPreview.largeMedia, isManuallyAdded: true, isSafe: false)) + } + } + + var bubbleUpEmojiOrStickersets: [ItemCollectionId] = [] + for entity in entities { + if case let .CustomEmoji(_, fileId) = entity.type { + if let packId = bubbleUpEmojiOrStickersetsById[fileId] { + if !bubbleUpEmojiOrStickersets.contains(packId) { + bubbleUpEmojiOrStickersets.append(packId) + } } } } + + if bubbleUpEmojiOrStickersets.count > 1 { + bubbleUpEmojiOrStickersets.removeAll() + } + + messages.append(.message(text: text.string, attributes: attributes, inlineStickers: inlineStickers, mediaReference: mediaReference, threadId: self.chatLocation.threadId, replyToMessageId: self.chatPresentationInterfaceState.interfaceState.replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: bubbleUpEmojiOrStickersets)) + mediaReference = nil } - - if bubbleUpEmojiOrStickersets.count > 1 { - bubbleUpEmojiOrStickersets.removeAll() - } - - messages.append(.message(text: text.string, attributes: attributes, inlineStickers: inlineStickers, mediaReference: mediaReference, threadId: self.chatLocation.threadId, replyToMessageId: self.chatPresentationInterfaceState.interfaceState.replyMessageSubject?.subjectModel, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: bubbleUpEmojiOrStickersets)) - mediaReference = nil } } diff --git a/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift b/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift index 65bd61e2bf..d8c4dea9aa 100644 --- a/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift +++ b/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift @@ -2257,6 +2257,7 @@ extension ChatControllerImpl { text: "", media: .update(.standalone(media: todo)), entities: nil, + richText: nil, inlineStickers: [:] ).start() } else {