mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Refactor constructor use sites for types 460-479 to struct pattern
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
1f4b520b1b
commit
5e4cbec07a
26 changed files with 454 additions and 100 deletions
|
|
@ -289,7 +289,27 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum BotResults: TypeConstructorDescription {
|
||||
case botResults(flags: Int32, queryId: Int64, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, switchWebview: Api.InlineBotWebView?, results: [Api.BotInlineResult], cacheTime: Int32, users: [Api.User])
|
||||
public class Cons_botResults {
|
||||
public var flags: Int32
|
||||
public var queryId: Int64
|
||||
public var nextOffset: String?
|
||||
public var switchPm: Api.InlineBotSwitchPM?
|
||||
public var switchWebview: Api.InlineBotWebView?
|
||||
public var results: [Api.BotInlineResult]
|
||||
public var cacheTime: Int32
|
||||
public var users: [Api.User]
|
||||
public init(flags: Int32, queryId: Int64, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, switchWebview: Api.InlineBotWebView?, results: [Api.BotInlineResult], cacheTime: Int32, users: [Api.User]) {
|
||||
self.flags = flags
|
||||
self.queryId = queryId
|
||||
self.nextOffset = nextOffset
|
||||
self.switchPm = switchPm
|
||||
self.switchWebview = switchWebview
|
||||
self.results = results
|
||||
self.cacheTime = cacheTime
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case botResults(Cons_botResults)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -318,7 +338,15 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum ChatAdminsWithInvites: TypeConstructorDescription {
|
||||
case chatAdminsWithInvites(admins: [Api.ChatAdminWithInvites], users: [Api.User])
|
||||
public class Cons_chatAdminsWithInvites {
|
||||
public var admins: [Api.ChatAdminWithInvites]
|
||||
public var users: [Api.User]
|
||||
public init(admins: [Api.ChatAdminWithInvites], users: [Api.User]) {
|
||||
self.admins = admins
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case chatAdminsWithInvites(Cons_chatAdminsWithInvites)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -347,7 +375,17 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum ChatFull: TypeConstructorDescription {
|
||||
case chatFull(fullChat: Api.ChatFull, chats: [Api.Chat], users: [Api.User])
|
||||
public class Cons_chatFull {
|
||||
public var fullChat: Api.ChatFull
|
||||
public var chats: [Api.Chat]
|
||||
public var users: [Api.User]
|
||||
public init(fullChat: Api.ChatFull, chats: [Api.Chat], users: [Api.User]) {
|
||||
self.fullChat = fullChat
|
||||
self.chats = chats
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case chatFull(Cons_chatFull)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -376,7 +414,17 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum ChatInviteImporters: TypeConstructorDescription {
|
||||
case chatInviteImporters(count: Int32, importers: [Api.ChatInviteImporter], users: [Api.User])
|
||||
public class Cons_chatInviteImporters {
|
||||
public var count: Int32
|
||||
public var importers: [Api.ChatInviteImporter]
|
||||
public var users: [Api.User]
|
||||
public init(count: Int32, importers: [Api.ChatInviteImporter], users: [Api.User]) {
|
||||
self.count = count
|
||||
self.importers = importers
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case chatInviteImporters(Cons_chatInviteImporters)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -405,8 +453,22 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum Chats: TypeConstructorDescription {
|
||||
case chats(chats: [Api.Chat])
|
||||
case chatsSlice(count: Int32, chats: [Api.Chat])
|
||||
public class Cons_chats {
|
||||
public var chats: [Api.Chat]
|
||||
public init(chats: [Api.Chat]) {
|
||||
self.chats = chats
|
||||
}
|
||||
}
|
||||
public class Cons_chatsSlice {
|
||||
public var count: Int32
|
||||
public var chats: [Api.Chat]
|
||||
public init(count: Int32, chats: [Api.Chat]) {
|
||||
self.count = count
|
||||
self.chats = chats
|
||||
}
|
||||
}
|
||||
case chats(Cons_chats)
|
||||
case chatsSlice(Cons_chatsSlice)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -442,7 +504,13 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum CheckedHistoryImportPeer: TypeConstructorDescription {
|
||||
case checkedHistoryImportPeer(confirmText: String)
|
||||
public class Cons_checkedHistoryImportPeer {
|
||||
public var confirmText: String
|
||||
public init(confirmText: String) {
|
||||
self.confirmText = confirmText
|
||||
}
|
||||
}
|
||||
case checkedHistoryImportPeer(Cons_checkedHistoryImportPeer)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -471,8 +539,26 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum DhConfig: TypeConstructorDescription {
|
||||
case dhConfig(g: Int32, p: Buffer, version: Int32, random: Buffer)
|
||||
case dhConfigNotModified(random: Buffer)
|
||||
public class Cons_dhConfig {
|
||||
public var g: Int32
|
||||
public var p: Buffer
|
||||
public var version: Int32
|
||||
public var random: Buffer
|
||||
public init(g: Int32, p: Buffer, version: Int32, random: Buffer) {
|
||||
self.g = g
|
||||
self.p = p
|
||||
self.version = version
|
||||
self.random = random
|
||||
}
|
||||
}
|
||||
public class Cons_dhConfigNotModified {
|
||||
public var random: Buffer
|
||||
public init(random: Buffer) {
|
||||
self.random = random
|
||||
}
|
||||
}
|
||||
case dhConfig(Cons_dhConfig)
|
||||
case dhConfigNotModified(Cons_dhConfigNotModified)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -508,7 +594,15 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum DialogFilters: TypeConstructorDescription {
|
||||
case dialogFilters(flags: Int32, filters: [Api.DialogFilter])
|
||||
public class Cons_dialogFilters {
|
||||
public var flags: Int32
|
||||
public var filters: [Api.DialogFilter]
|
||||
public init(flags: Int32, filters: [Api.DialogFilter]) {
|
||||
self.flags = flags
|
||||
self.filters = filters
|
||||
}
|
||||
}
|
||||
case dialogFilters(Cons_dialogFilters)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -537,9 +631,41 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum Dialogs: TypeConstructorDescription {
|
||||
case dialogs(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User])
|
||||
case dialogsNotModified(count: Int32)
|
||||
case dialogsSlice(count: Int32, dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User])
|
||||
public class Cons_dialogs {
|
||||
public var dialogs: [Api.Dialog]
|
||||
public var messages: [Api.Message]
|
||||
public var chats: [Api.Chat]
|
||||
public var users: [Api.User]
|
||||
public init(dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) {
|
||||
self.dialogs = dialogs
|
||||
self.messages = messages
|
||||
self.chats = chats
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
public class Cons_dialogsNotModified {
|
||||
public var count: Int32
|
||||
public init(count: Int32) {
|
||||
self.count = count
|
||||
}
|
||||
}
|
||||
public class Cons_dialogsSlice {
|
||||
public var count: Int32
|
||||
public var dialogs: [Api.Dialog]
|
||||
public var messages: [Api.Message]
|
||||
public var chats: [Api.Chat]
|
||||
public var users: [Api.User]
|
||||
public init(count: Int32, dialogs: [Api.Dialog], messages: [Api.Message], chats: [Api.Chat], users: [Api.User]) {
|
||||
self.count = count
|
||||
self.dialogs = dialogs
|
||||
self.messages = messages
|
||||
self.chats = chats
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case dialogs(Cons_dialogs)
|
||||
case dialogsNotModified(Cons_dialogsNotModified)
|
||||
case dialogsSlice(Cons_dialogsSlice)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -582,7 +708,27 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum DiscussionMessage: TypeConstructorDescription {
|
||||
case discussionMessage(flags: Int32, messages: [Api.Message], maxId: Int32?, readInboxMaxId: Int32?, readOutboxMaxId: Int32?, unreadCount: Int32, chats: [Api.Chat], users: [Api.User])
|
||||
public class Cons_discussionMessage {
|
||||
public var flags: Int32
|
||||
public var messages: [Api.Message]
|
||||
public var maxId: Int32?
|
||||
public var readInboxMaxId: Int32?
|
||||
public var readOutboxMaxId: Int32?
|
||||
public var unreadCount: Int32
|
||||
public var chats: [Api.Chat]
|
||||
public var users: [Api.User]
|
||||
public init(flags: Int32, messages: [Api.Message], maxId: Int32?, readInboxMaxId: Int32?, readOutboxMaxId: Int32?, unreadCount: Int32, chats: [Api.Chat], users: [Api.User]) {
|
||||
self.flags = flags
|
||||
self.messages = messages
|
||||
self.maxId = maxId
|
||||
self.readInboxMaxId = readInboxMaxId
|
||||
self.readOutboxMaxId = readOutboxMaxId
|
||||
self.unreadCount = unreadCount
|
||||
self.chats = chats
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case discussionMessage(Cons_discussionMessage)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -611,7 +757,23 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum EmojiGameInfo: TypeConstructorDescription {
|
||||
case emojiGameDiceInfo(flags: Int32, gameHash: String, prevStake: Int64, currentStreak: Int32, params: [Int32], playsLeft: Int32?)
|
||||
public class Cons_emojiGameDiceInfo {
|
||||
public var flags: Int32
|
||||
public var gameHash: String
|
||||
public var prevStake: Int64
|
||||
public var currentStreak: Int32
|
||||
public var params: [Int32]
|
||||
public var playsLeft: Int32?
|
||||
public init(flags: Int32, gameHash: String, prevStake: Int64, currentStreak: Int32, params: [Int32], playsLeft: Int32?) {
|
||||
self.flags = flags
|
||||
self.gameHash = gameHash
|
||||
self.prevStake = prevStake
|
||||
self.currentStreak = currentStreak
|
||||
self.params = params
|
||||
self.playsLeft = playsLeft
|
||||
}
|
||||
}
|
||||
case emojiGameDiceInfo(Cons_emojiGameDiceInfo)
|
||||
case emojiGameUnavailable
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
|
|
@ -648,7 +810,17 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum EmojiGameOutcome: TypeConstructorDescription {
|
||||
case emojiGameOutcome(seed: Buffer, stakeTonAmount: Int64, tonAmount: Int64)
|
||||
public class Cons_emojiGameOutcome {
|
||||
public var seed: Buffer
|
||||
public var stakeTonAmount: Int64
|
||||
public var tonAmount: Int64
|
||||
public init(seed: Buffer, stakeTonAmount: Int64, tonAmount: Int64) {
|
||||
self.seed = seed
|
||||
self.stakeTonAmount = stakeTonAmount
|
||||
self.tonAmount = tonAmount
|
||||
}
|
||||
}
|
||||
case emojiGameOutcome(Cons_emojiGameOutcome)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -677,7 +849,15 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum EmojiGroups: TypeConstructorDescription {
|
||||
case emojiGroups(hash: Int32, groups: [Api.EmojiGroup])
|
||||
public class Cons_emojiGroups {
|
||||
public var hash: Int32
|
||||
public var groups: [Api.EmojiGroup]
|
||||
public init(hash: Int32, groups: [Api.EmojiGroup]) {
|
||||
self.hash = hash
|
||||
self.groups = groups
|
||||
}
|
||||
}
|
||||
case emojiGroups(Cons_emojiGroups)
|
||||
case emojiGroupsNotModified
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
|
|
@ -714,8 +894,26 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum ExportedChatInvite: TypeConstructorDescription {
|
||||
case exportedChatInvite(invite: Api.ExportedChatInvite, users: [Api.User])
|
||||
case exportedChatInviteReplaced(invite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite, users: [Api.User])
|
||||
public class Cons_exportedChatInvite {
|
||||
public var invite: Api.ExportedChatInvite
|
||||
public var users: [Api.User]
|
||||
public init(invite: Api.ExportedChatInvite, users: [Api.User]) {
|
||||
self.invite = invite
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
public class Cons_exportedChatInviteReplaced {
|
||||
public var invite: Api.ExportedChatInvite
|
||||
public var newInvite: Api.ExportedChatInvite
|
||||
public var users: [Api.User]
|
||||
public init(invite: Api.ExportedChatInvite, newInvite: Api.ExportedChatInvite, users: [Api.User]) {
|
||||
self.invite = invite
|
||||
self.newInvite = newInvite
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case exportedChatInvite(Cons_exportedChatInvite)
|
||||
case exportedChatInviteReplaced(Cons_exportedChatInviteReplaced)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -751,7 +949,17 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum ExportedChatInvites: TypeConstructorDescription {
|
||||
case exportedChatInvites(count: Int32, invites: [Api.ExportedChatInvite], users: [Api.User])
|
||||
public class Cons_exportedChatInvites {
|
||||
public var count: Int32
|
||||
public var invites: [Api.ExportedChatInvite]
|
||||
public var users: [Api.User]
|
||||
public init(count: Int32, invites: [Api.ExportedChatInvite], users: [Api.User]) {
|
||||
self.count = count
|
||||
self.invites = invites
|
||||
self.users = users
|
||||
}
|
||||
}
|
||||
case exportedChatInvites(Cons_exportedChatInvites)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
|
|||
|
|
@ -1,6 +1,16 @@
|
|||
public extension Api.messages {
|
||||
enum FavedStickers: TypeConstructorDescription {
|
||||
case favedStickers(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document])
|
||||
public class Cons_favedStickers {
|
||||
public var hash: Int64
|
||||
public var packs: [Api.StickerPack]
|
||||
public var stickers: [Api.Document]
|
||||
public init(hash: Int64, packs: [Api.StickerPack], stickers: [Api.Document]) {
|
||||
self.hash = hash
|
||||
self.packs = packs
|
||||
self.stickers = stickers
|
||||
}
|
||||
}
|
||||
case favedStickers(Cons_favedStickers)
|
||||
case favedStickersNotModified
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
|
|
@ -37,8 +47,28 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum FeaturedStickers: TypeConstructorDescription {
|
||||
case featuredStickers(flags: Int32, hash: Int64, count: Int32, sets: [Api.StickerSetCovered], unread: [Int64])
|
||||
case featuredStickersNotModified(count: Int32)
|
||||
public class Cons_featuredStickers {
|
||||
public var flags: Int32
|
||||
public var hash: Int64
|
||||
public var count: Int32
|
||||
public var sets: [Api.StickerSetCovered]
|
||||
public var unread: [Int64]
|
||||
public init(flags: Int32, hash: Int64, count: Int32, sets: [Api.StickerSetCovered], unread: [Int64]) {
|
||||
self.flags = flags
|
||||
self.hash = hash
|
||||
self.count = count
|
||||
self.sets = sets
|
||||
self.unread = unread
|
||||
}
|
||||
}
|
||||
public class Cons_featuredStickersNotModified {
|
||||
public var count: Int32
|
||||
public init(count: Int32) {
|
||||
self.count = count
|
||||
}
|
||||
}
|
||||
case featuredStickers(Cons_featuredStickers)
|
||||
case featuredStickersNotModified(Cons_featuredStickersNotModified)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -74,7 +104,25 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum ForumTopics: TypeConstructorDescription {
|
||||
case forumTopics(flags: Int32, count: Int32, topics: [Api.ForumTopic], messages: [Api.Message], chats: [Api.Chat], users: [Api.User], pts: Int32)
|
||||
public class Cons_forumTopics {
|
||||
public var flags: Int32
|
||||
public var count: Int32
|
||||
public var topics: [Api.ForumTopic]
|
||||
public var messages: [Api.Message]
|
||||
public var chats: [Api.Chat]
|
||||
public var users: [Api.User]
|
||||
public var pts: Int32
|
||||
public init(flags: Int32, count: Int32, topics: [Api.ForumTopic], messages: [Api.Message], chats: [Api.Chat], users: [Api.User], pts: Int32) {
|
||||
self.flags = flags
|
||||
self.count = count
|
||||
self.topics = topics
|
||||
self.messages = messages
|
||||
self.chats = chats
|
||||
self.users = users
|
||||
self.pts = pts
|
||||
}
|
||||
}
|
||||
case forumTopics(Cons_forumTopics)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
@ -103,7 +151,15 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum FoundStickerSets: TypeConstructorDescription {
|
||||
case foundStickerSets(hash: Int64, sets: [Api.StickerSetCovered])
|
||||
public class Cons_foundStickerSets {
|
||||
public var hash: Int64
|
||||
public var sets: [Api.StickerSetCovered]
|
||||
public init(hash: Int64, sets: [Api.StickerSetCovered]) {
|
||||
self.hash = hash
|
||||
self.sets = sets
|
||||
}
|
||||
}
|
||||
case foundStickerSets(Cons_foundStickerSets)
|
||||
case foundStickerSetsNotModified
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
|
|
@ -140,8 +196,28 @@ public extension Api.messages {
|
|||
}
|
||||
public extension Api.messages {
|
||||
enum FoundStickers: TypeConstructorDescription {
|
||||
case foundStickers(flags: Int32, nextOffset: Int32?, hash: Int64, stickers: [Api.Document])
|
||||
case foundStickersNotModified(flags: Int32, nextOffset: Int32?)
|
||||
public class Cons_foundStickers {
|
||||
public var flags: Int32
|
||||
public var nextOffset: Int32?
|
||||
public var hash: Int64
|
||||
public var stickers: [Api.Document]
|
||||
public init(flags: Int32, nextOffset: Int32?, hash: Int64, stickers: [Api.Document]) {
|
||||
self.flags = flags
|
||||
self.nextOffset = nextOffset
|
||||
self.hash = hash
|
||||
self.stickers = stickers
|
||||
}
|
||||
}
|
||||
public class Cons_foundStickersNotModified {
|
||||
public var flags: Int32
|
||||
public var nextOffset: Int32?
|
||||
public init(flags: Int32, nextOffset: Int32?) {
|
||||
self.flags = flags
|
||||
self.nextOffset = nextOffset
|
||||
}
|
||||
}
|
||||
case foundStickers(Cons_foundStickers)
|
||||
case foundStickersNotModified(Cons_foundStickersNotModified)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
#if DEBUG
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue