diff --git a/Telegram/SiriIntents/IntentContacts.swift b/Telegram/SiriIntents/IntentContacts.swift index bc9e10590c..0db69b3a2a 100644 --- a/Telegram/SiriIntents/IntentContacts.swift +++ b/Telegram/SiriIntents/IntentContacts.swift @@ -96,16 +96,23 @@ private func matchPhoneNumbers(_ lhs: String, _ rhs: String) -> Bool { func matchingCloudContacts(postbox: Postbox, contacts: [MatchingDeviceContact]) -> Signal<[(String, TelegramUser)], NoError> { return postbox.transaction { transaction -> [(String, TelegramUser)] in var result: [(String, TelegramUser)] = [] + var matchingIds = Set() outer: for peerId in transaction.getContactPeerIds() { if let peer = transaction.getPeer(peerId) as? TelegramUser { for contact in contacts { if let contactPeerId = contact.peerId, contactPeerId == peerId { - result.append((contact.stableId, peer)) + if !matchingIds.contains(peer.id) { + matchingIds.insert(peer.id) + result.append((contact.stableId, peer)) + } continue outer } else if let peerPhoneNumber = peer.phone { for contactPhoneNumber in contact.phoneNumbers { if matchPhoneNumbers(contactPhoneNumber, peerPhoneNumber) { - result.append((contact.stableId, peer)) + if !matchingIds.contains(peer.id) { + matchingIds.insert(peer.id) + result.append((contact.stableId, peer)) + } continue outer } } @@ -113,6 +120,15 @@ func matchingCloudContacts(postbox: Postbox, contacts: [MatchingDeviceContact]) } } } + for contact in contacts { + if let peerId = contact.peerId, let peer = transaction.getPeer(peerId) as? TelegramUser { + if !matchingIds.contains(peer.id) { + matchingIds.insert(peer.id) + result.append((contact.stableId, peer)) + } + } + } + return result } } diff --git a/build-system/SwiftTL/Package.swift b/build-system/SwiftTL/Package.swift new file mode 100644 index 0000000000..09227b92c4 --- /dev/null +++ b/build-system/SwiftTL/Package.swift @@ -0,0 +1,15 @@ +// swift-tools-version:5.5 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "SwiftTL", + dependencies: [ + ], + targets: [ + .executableTarget( + name: "SwiftTL", + dependencies: []), + ] +) diff --git a/build-system/SwiftTL/README.md b/build-system/SwiftTL/README.md new file mode 100644 index 0000000000..215ff5fe98 --- /dev/null +++ b/build-system/SwiftTL/README.md @@ -0,0 +1,3 @@ +# SwiftTL + + diff --git a/build-system/SwiftTL/Sources/SwiftTL/CodeGeneration.swift b/build-system/SwiftTL/Sources/SwiftTL/CodeGeneration.swift new file mode 100644 index 0000000000..2e3c43482e --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/CodeGeneration.swift @@ -0,0 +1,986 @@ +import Foundation + +private let reservedIdentifiers: [String] = [ + "protocol", + "private" +] + +private extension String { + var camelCased: String { + var result = "" + + var capitalizeNext = false + for c in self { + if c == "_" { + capitalizeNext = true + } else { + if capitalizeNext { + capitalizeNext = false + result.append(c.uppercased()) + } else { + result.append(c) + } + } + } + + return result + } + + var camelCasedAndEscaped: String { + var result = self.camelCased + + if reservedIdentifiers.contains(result) { + result = "`\(result)`" + } + + return result + } +} + +private struct CodeWriter { + private var code: String = "" + private var indentLevel: Int = 0 + private let indentString: String = " " + + private var currentIndent: String { + String(repeating: indentString, count: indentLevel) + } + + mutating func indent() { + indentLevel += 1 + } + + mutating func dedent() { + indentLevel = max(0, indentLevel - 1) + } + + mutating func line(_ text: String = "") { + if text.isEmpty { + code += "\n" + } else { + code += currentIndent + text + "\n" + } + } + + mutating func lines(_ text: String) { + for line in text.split(separator: "\n", omittingEmptySubsequences: false) { + if line.isEmpty { + code += "\n" + } else { + code += currentIndent + line + "\n" + } + } + } + + func output() -> String { + return code + } +} + +/*private extension QualifiedName { + var camelCased: String { + if let namespace = self.namespace { + return "\(namespace).\(self.value.camelCased)" + } else { + return self.value.camelCased + } + } +}*/ + +private func typeReferenceRepresentation(_ type: Resolver.TypeReference) -> String { + switch type { + case .int32: + return "Int32" + case .int64: + return "Int64" + case .int256: + return "Int256" + case .double: + return "Double" + case .bytes: + return "Buffer" + case .string: + return "String" + case .bool: + return "Bool" + case .boolTrue: + return "bool" + case let .bareVector(elementType): + return "[\(typeReferenceRepresentation(elementType))]" + case let .boxedVector(elementType): + return "[\(typeReferenceRepresentation(elementType))]" + case let .bareConstructor(typeName, _): + return "Api.\(typeName)" + case let .boxedType(typeName): + return "Api.\(typeName)" + } +} + +private extension Resolver.SumType { + func hasDirectReference(to otherTypes: [Resolver.SumType], typeMap: [QualifiedName: Resolver.SumType]) throws -> Bool { + for (_, constructor) in self.constructors { + for argument in constructor.arguments { + switch argument.type { + case .int32: + break + case .int64: + break + case .int256: + break + case .double: + break + case .bytes: + break + case .string: + break + case .bool: + break + case .boolTrue: + break + case .bareVector: + break + case .boxedVector: + break + case .bareConstructor(let typeName, _), .boxedType(let typeName): + for otherType in otherTypes { + if typeName == otherType.name { + return true + } + } + + guard let referencedType = typeMap[typeName] else { + throw CodeGenerator.CodeGenerationError(text: "Type \(typeName) not found") + } + + var mergedTypes = otherTypes + if !mergedTypes.contains(where: { $0.name == self.name }) { + mergedTypes.append(self) + } + + if try referencedType.hasDirectReference(to: mergedTypes, typeMap: typeMap) { + return true + } + } + } + } + + return false + } +} + +private extension Sequence where Iterator.Element: Hashable { + func unique() -> [Iterator.Element] { + var seen: Set = [] + return filter { seen.insert($0).inserted } + } +} + +enum CodeGenerator { + struct CodeGenerationError: Error, CustomStringConvertible { + var text: String + + var description: String { + return self.text + } + } + + static func generate(types: [Resolver.SumType], functions: [Resolver.Function], constructorOrder: [(typeName: QualifiedName, constructorName: String)], typeOrder: [(types: [(typeName: QualifiedName, constructorNames: [String])], functions: [QualifiedName])], stubFunctions: Bool = false) throws -> [String: String] { + var files: [String: String] = [:] + + var functions = functions + functions.append(Resolver.Function(name: QualifiedName(namespace: "help", value: "test"), id: UInt32(bitPattern: -1058929929), arguments: [], result: .boxedType(QualifiedName(namespace: nil, value: "Bool")))) + + files["Api0.swift"] = try generateMainFile(types: types, functions: functions, constructorOrder: constructorOrder) + + for index in 0 ..< typeOrder.count { + files["Api\(index + 1).swift"] = try generateImplFile(types: types, functions: functions, typeOrder: typeOrder[index], stubFunctions: stubFunctions) + } + + return files + } + + private static func generateMainFile(types: [Resolver.SumType], functions: [Resolver.Function], constructorOrder: [(typeName: QualifiedName, constructorName: String)]) throws -> String { + var writer = CodeWriter() + + writer.line() + + var namespaces = Set() + for type in types { + if let namespace = type.name.namespace { + namespaces.insert(namespace) + } + } + + var functionNamespaces = Set() + for function in functions { + if let namespace = function.name.namespace { + functionNamespaces.insert(namespace) + } + } + + writer.line("public enum Api {") + writer.indent() + for namespace in namespaces.sorted(by: { $0 < $1 }) { + writer.line("public enum \(namespace) {}") + } + writer.line("public enum functions {") + writer.indent() + for namespace in functionNamespaces.sorted(by: { $0 < $1 }) { + writer.line("public enum \(namespace) {}") + } + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("}") + + writer.line() + + var typeMap: [QualifiedName: Resolver.SumType] = [:] + for type in types { + typeMap[type.name] = type + } + + writer.line("fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {") + writer.indent() + writer.line("var dict: [Int32 : (BufferReader) -> Any?] = [:]") + writer.line("dict[-1471112230] = { return $0.readInt32() }") + writer.line("dict[570911930] = { return $0.readInt64() }") + writer.line("dict[571523412] = { return $0.readDouble() }") + writer.line("dict[0x0929C32F] = { return parseInt256($0) }") + writer.line("dict[-1255641564] = { return parseString($0) }") + + for (typeName, constructorName) in constructorOrder { + guard let type = typeMap[typeName] else { + throw CodeGenerationError(text: "Type \(typeName) not found") + } + + var found = false + for (_, constructor) in type.constructors { + if constructor.name.value == constructorName { + found = true + writer.line("dict[\(Int32(bitPattern: constructor.id))] = { return Api.\(type.name).parse_\(constructor.name.value)($0) }") + break + } + } + + if !found { + throw CodeGenerationError(text: "Constructor \(constructorName) not found") + } + } + + writer.line("return dict") + writer.dedent() + writer.line("}()") + + writer.line() + + writer.line("public extension Api {") + writer.indent() + + writer.line("static func parse(_ buffer: Buffer) -> Any? {") + writer.indent() + writer.line("let reader = BufferReader(buffer)") + writer.line("if let signature = reader.readInt32() {") + writer.indent() + writer.line("return parse(reader, signature: signature)") + writer.dedent() + writer.line("}") + writer.line("return nil") + writer.dedent() + writer.line("}") + + writer.line() + + writer.line("static func parse(_ reader: BufferReader, signature: Int32) -> Any? {") + writer.indent() + writer.line("if let parser = parsers[signature] {") + writer.indent() + writer.line("return parser(reader)") + writer.dedent() + writer.line("} else {") + writer.indent() + writer.line("telegramApiLog(\"Type constructor \\(String(UInt32(bitPattern: signature), radix: 16, uppercase: false)) not found\")") + writer.line("return nil") + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("}") + + writer.line() + + writer.line("static func parseVector(_ reader: BufferReader, elementSignature: Int32, elementType: T.Type) -> [T]? {") + writer.indent() + writer.line("if let count = reader.readInt32() {") + writer.indent() + writer.line("var array = [T]()") + writer.line("var i: Int32 = 0") + writer.line("while i < count {") + writer.indent() + writer.line("var signature = elementSignature") + writer.line("if elementSignature == 0 {") + writer.indent() + writer.line("if let unboxedSignature = reader.readInt32() {") + writer.indent() + writer.line("signature = unboxedSignature") + writer.dedent() + writer.line("} else {") + writer.indent() + writer.line("return nil") + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("}") + writer.line("if elementType == Buffer.self {") + writer.indent() + writer.line("if let item = parseBytes(reader) as? T {") + writer.indent() + writer.line("array.append(item)") + writer.dedent() + writer.line("} else {") + writer.indent() + writer.line("return nil") + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("} else {") + writer.indent() + writer.line("if let item = Api.parse(reader, signature: signature) as? T {") + writer.indent() + writer.line("array.append(item)") + writer.dedent() + writer.line("} else {") + writer.indent() + writer.line("return nil") + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("}") + writer.line("i += 1") + writer.dedent() + writer.line("}") + writer.line("return array") + writer.dedent() + writer.line("}") + writer.line("return nil") + writer.dedent() + writer.line("}") + + writer.line() + + writer.line("static func serializeObject(_ object: Any, buffer: Buffer, boxed: Swift.Bool) {") + writer.indent() + writer.line("switch object {") + + let typeOrder = constructorOrder.map(\.typeName).unique() + + for typeName in typeOrder { + guard let type = typeMap[typeName] else { + throw CodeGenerationError(text: "Type \(typeName) not found") + } + + writer.line("case let _1 as Api.\(type.name):") + writer.indent() + writer.line("_1.serialize(buffer, boxed)") + writer.dedent() + } + + writer.line("default:") + writer.indent() + writer.line("break") + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("}") + + writer.dedent() + writer.line("}") + + return writer.output() + } + + private static func generateImplFile(types: [Resolver.SumType], functions: [Resolver.Function], typeOrder: (types: [(typeName: QualifiedName, constructorNames: [String])], functions: [QualifiedName]), stubFunctions: Bool) throws -> String { + var writer = CodeWriter() + + var typeMap: [QualifiedName: Resolver.SumType] = [:] + for type in types { + typeMap[type.name] = type + } + + for (typeName, constructorNames) in typeOrder.types { + writer.line("public extension Api\(typeName.namespace.flatMap { "." + $0 } ?? "") {") + writer.indent() + + guard let type = typeMap[typeName] else { + throw CodeGenerationError(text: "Type \(typeName) not found") + } + + let indirectPrefix = try type.hasDirectReference(to: [type], typeMap: typeMap) ? "indirect " : "" + writer.line("\(indirectPrefix)enum \(typeName.value): TypeConstructorDescription {") + writer.indent() + + var sortedConstructors: [Resolver.SumType.Constructor] = [] + for constructorName in constructorNames { + var foundConstructor: Resolver.SumType.Constructor? + for (_, constructor) in type.constructors { + if constructor.name.value == constructorName { + foundConstructor = constructor + break + } + } + guard let constructor = foundConstructor else { + throw CodeGenerationError(text: "Constructor \(constructorName) -> \(typeName) not found") + } + sortedConstructors.append(constructor) + } + + let useStructPattern = true + + if useStructPattern { + for constructor in sortedConstructors { + var fieldsString = "" + var initParamsString = "" + var initBodyString = "" + var descriptionFieldsString = "" + + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + let fieldName = argument.name.camelCasedAndEscaped + let fieldType = typeReferenceRepresentation(argument.type) + (argument.condition != nil ? "?" : "") + + if !fieldsString.isEmpty { + fieldsString.append("\n") + } + fieldsString.append("public var \(fieldName): \(fieldType)") + + if !initParamsString.isEmpty { + initParamsString.append(", ") + } + initParamsString.append("\(fieldName): \(fieldType)") + + if !initBodyString.isEmpty { + initBodyString.append("\n") + } + initBodyString.append("self.\(fieldName) = \(fieldName)") + + if !descriptionFieldsString.isEmpty { + descriptionFieldsString.append(", ") + } + descriptionFieldsString.append("(\"\(fieldName)\", ConstructorParameterDescription(self.\(fieldName)))") + } + + if !fieldsString.isEmpty { + writer.line("public class Cons_\(constructor.name.value): TypeConstructorDescription {") + writer.indent() + writer.lines(fieldsString) + writer.line("public init(\(initParamsString)) {") + writer.indent() + writer.lines(initBodyString) + writer.dedent() + writer.line("}") + writer.line("public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {") + writer.indent() + writer.line("return (\"\(constructor.name.value)\", [\(descriptionFieldsString)])") + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("}") + } + } + } + + for constructor in sortedConstructors { + let hasFields = constructor.arguments.contains { if case .boolTrue = $0.type { return false } else { return true } } + + if useStructPattern && hasFields { + writer.line("case \(constructor.name.value)(Cons_\(constructor.name.value))") + } else { + var argumentsString = "" + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + if !argumentsString.isEmpty { + argumentsString.append(", ") + } + + argumentsString.append(argument.name.camelCased) + argumentsString.append(": ") + argumentsString.append(typeReferenceRepresentation(argument.type)) + if argument.condition != nil { + argumentsString.append("?") + } + } + + writer.line("case \(constructor.name.value)\(argumentsString.isEmpty ? "" : "(\(argumentsString))")") + } + } + + writer.line() + writer.line("public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {") + writer.indent() + if stubFunctions { + writer.line("#if DEBUG") + writer.line("preconditionFailure()") + writer.line("#else") + writer.line("error") + writer.line("#endif") + } else { + writer.line("switch self {") + + for constructor in sortedConstructors { + let hasFields = constructor.arguments.contains { if case .boolTrue = $0.type { return false } else { return true } } + + if useStructPattern && hasFields { + writer.line("case .\(constructor.name.value)(let _data):") + writer.indent() + writer.line("if boxed {") + writer.indent() + writer.line("buffer.appendInt32(\(Int32(bitPattern: constructor.id)))") + writer.dedent() + writer.line("}") + + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + var argumentAccessor = "_data.\(argument.name.camelCasedAndEscaped)" + if let condition = argument.condition { + writer.line("if Int(_data.\(condition.fieldName.camelCasedAndEscaped)) & Int(1 << \(condition.bitIndex)) != 0 {") + writer.indent() + argumentAccessor.append("!") + generateFieldSerialization(writer: &writer, argument: argument, argumentAccessor: argumentAccessor) + writer.dedent() + writer.line("}") + } else { + generateFieldSerialization(writer: &writer, argument: argument, argumentAccessor: argumentAccessor) + } + } + writer.line("break") + writer.dedent() + } else { + var argumentsString = "" + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + if !argumentsString.isEmpty { + argumentsString.append(", ") + } + + argumentsString.append("let ") + argumentsString.append(argument.name.camelCasedAndEscaped) + } + + writer.line("case .\(constructor.name.value)\(argumentsString.isEmpty ? "" : "(\(argumentsString))"):") + writer.indent() + writer.line("if boxed {") + writer.indent() + writer.line("buffer.appendInt32(\(Int32(bitPattern: constructor.id)))") + writer.dedent() + writer.line("}") + + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + var argumentAccessor = "\(argument.name.camelCasedAndEscaped)" + if let condition = argument.condition { + writer.line("if Int(\(condition.fieldName)) & Int(1 << \(condition.bitIndex)) != 0 {") + writer.indent() + argumentAccessor.append("!") + generateFieldSerialization(writer: &writer, argument: argument, argumentAccessor: argumentAccessor) + writer.dedent() + writer.line("}") + } else { + generateFieldSerialization(writer: &writer, argument: argument, argumentAccessor: argumentAccessor) + } + } + writer.line("break") + writer.dedent() + } + } + + writer.line("}") + } // end if !stubFunctions + writer.dedent() + writer.line("}") + + writer.line() + writer.line("public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {") + writer.indent() + if stubFunctions { + writer.line("#if DEBUG") + writer.line("preconditionFailure()") + writer.line("#else") + writer.line("error") + writer.line("#endif") + } else { + writer.line("switch self {") + + for constructor in sortedConstructors { + let hasFields = constructor.arguments.contains { if case .boolTrue = $0.type { return false } else { return true } } + + if useStructPattern && hasFields { + var argumentSerializationString = "" + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + if !argumentSerializationString.isEmpty { + argumentSerializationString.append(", ") + } + argumentSerializationString.append("(\"\(argument.name.camelCasedAndEscaped)\", ConstructorParameterDescription(_data.\(argument.name.camelCasedAndEscaped)))") + } + + writer.line("case .\(constructor.name.value)(let _data):") + writer.indent() + writer.line("return (\"\(constructor.name.value)\", [\(argumentSerializationString)])") + writer.dedent() + } else { + var argumentsString = "" + var argumentSerializationString = "" + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + if !argumentsString.isEmpty { + argumentsString.append(", ") + } + if !argumentSerializationString.isEmpty { + argumentSerializationString.append(", ") + } + + argumentsString.append("let ") + argumentsString.append(argument.name.camelCasedAndEscaped) + + argumentSerializationString.append("(\"\(argument.name.camelCasedAndEscaped)\", \(argument.name.camelCasedAndEscaped) as Any)") + } + + writer.line("case .\(constructor.name.value)\(argumentsString.isEmpty ? "" : "(\(argumentsString))"):") + writer.indent() + writer.line("return (\"\(constructor.name.value)\", [\(argumentSerializationString)])") + writer.dedent() + } + } + + writer.line("}") + } // end if !stubFunctions for descriptionFields + writer.dedent() + writer.line("}") + + writer.line() + + for constructor in sortedConstructors { + writer.line("public static func parse_\(constructor.name.value)(_ reader: BufferReader) -> \(typeName.value)? {") + writer.indent() + if stubFunctions { + writer.line("#if DEBUG") + writer.line("preconditionFailure()") + writer.line("#else") + writer.line("error") + writer.line("#endif") + } else { + + if constructor.arguments.contains(where: { if case .boolTrue = $0.type { return false } else { return true } }) { + var argumentIndex = 0 + var argumentCheckString = "" + var argumentCollectionString = "" + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + writer.line("var _\(argumentIndex + 1): \(typeReferenceRepresentation(argument.type))?") + + if let condition = argument.condition { + guard let fieldIndex = constructor.arguments.filter({ if case .boolTrue = $0.type { return false } else { return true } }).firstIndex(where: { $0.name == condition.fieldName }) else { + throw CodeGenerationError(text: "Condition field \(condition.fieldName) not found") + } + + writer.line("if Int(_\(fieldIndex + 1)!) & Int(1 << \(condition.bitIndex)) != 0 {") + writer.indent() + try generateFieldParsing(writer: &writer, typeMap: typeMap, argument: argument, argumentAccessor: "_\(argumentIndex + 1)") + writer.dedent() + writer.line("}") + } else { + try generateFieldParsing(writer: &writer, typeMap: typeMap, argument: argument, argumentAccessor: "_\(argumentIndex + 1)") + } + + if !argumentCheckString.isEmpty { + argumentCheckString.append(" && ") + } + argumentCheckString.append("_c\(argumentIndex + 1)") + + if !argumentCollectionString.isEmpty { + argumentCollectionString.append(", ") + } + argumentCollectionString.append("\(argument.name.camelCased): _\(argumentIndex + 1)") + if argument.condition == nil { + argumentCollectionString.append("!") + } + + argumentIndex += 1 + } + + var checkIndex = 0 + for argument in constructor.arguments { + if case .boolTrue = argument.type { + continue + } + + if let condition = argument.condition { + guard let fieldIndex = constructor.arguments.filter({ if case .boolTrue = $0.type { return false } else { return true } }).firstIndex(where: { $0.name == condition.fieldName }) else { + throw CodeGenerationError(text: "Condition field \(condition.fieldName) not found") + } + + writer.line("let _c\(checkIndex + 1) = (Int(_\(fieldIndex + 1)!) & Int(1 << \(condition.bitIndex)) == 0) || _\(checkIndex + 1) != nil") + } else { + writer.line("let _c\(checkIndex + 1) = _\(checkIndex + 1) != nil") + } + + checkIndex += 1 + } + + writer.line("if \(argumentCheckString) {") + writer.indent() + if useStructPattern && !argumentCollectionString.isEmpty { + writer.line("return Api.\(typeName).\(constructor.name.value)(Cons_\(constructor.name.value)(\(argumentCollectionString)))") + } else { + writer.line("return Api.\(typeName).\(constructor.name.value)\(argumentCollectionString.isEmpty ? "" : "(\(argumentCollectionString))")") + } + writer.dedent() + writer.line("}") + writer.line("else {") + writer.indent() + writer.line("return nil") + writer.dedent() + writer.line("}") + } else { + writer.line("return Api.\(typeName).\(constructor.name.value)") + } + + } // end if !stubFunctions + writer.dedent() + writer.line("}") + } + + writer.dedent() + writer.line("}") + writer.dedent() + writer.line("}") + } + + if !typeOrder.functions.isEmpty { + for functionName in typeOrder.functions { + writer.line("public extension Api.functions\(functionName.namespace.flatMap { "." + $0 } ?? "") {") + writer.indent() + + var foundFunction: Resolver.Function? + for function in functions { + if function.name == functionName { + foundFunction = function + break + } + } + guard let function = foundFunction else { + throw CodeGenerationError(text: "Function \(functionName) not found") + } + + var argumentsString = "" + for argument in function.arguments { + if case .boolTrue = argument.type { + continue + } + + if !argumentsString.isEmpty { + argumentsString.append(", ") + } + + argumentsString.append(argument.name.camelCasedAndEscaped) + argumentsString.append(": ") + argumentsString.append(typeReferenceRepresentation(argument.type)) + if argument.condition != nil { + argumentsString.append("?") + } + } + + writer.line("static func \(function.name.value)(\(argumentsString)) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<\(typeReferenceRepresentation(function.result))>) {") + writer.indent() + writer.line("let buffer = Buffer()") + writer.line("buffer.appendInt32(\(Int32(bitPattern: function.id)))") + + var argumentSerializationString = "" + for argument in function.arguments { + if case .boolTrue = argument.type { + continue + } + + var argumentAccessor = "\(argument.name.camelCasedAndEscaped)" + if let condition = argument.condition { + guard let _ = function.arguments.filter({ if case .boolTrue = $0.type { return false } else { return true } }).firstIndex(where: { $0.name == condition.fieldName }) else { + throw CodeGenerationError(text: "Condition field \(condition.fieldName) not found") + } + + writer.line("if Int(\(condition.fieldName)) & Int(1 << \(condition.bitIndex)) != 0 {") + writer.indent() + argumentAccessor.append("!") + generateFieldSerialization(writer: &writer, argument: argument, argumentAccessor: argumentAccessor) + writer.dedent() + writer.line("}") + } else { + generateFieldSerialization(writer: &writer, argument: argument, argumentAccessor: argumentAccessor) + } + + if !argumentSerializationString.isEmpty { + argumentSerializationString.append(", ") + } + + argumentSerializationString.append("(\"\(argument.name.camelCasedAndEscaped)\", ConstructorParameterDescription(\(argument.name.camelCasedAndEscaped)))") + } + + writer.line("return (FunctionDescription(name: \"\(function.name)\", parameters: [\(argumentSerializationString)]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> \(typeReferenceRepresentation(function.result))? in") + writer.indent() + writer.line("let reader = BufferReader(buffer)") + writer.line("var result: \(typeReferenceRepresentation(function.result))?") + + try generateFieldParsing(writer: &writer, typeMap: typeMap, argument: Resolver.Argument(name: "result", type: function.result, condition: nil), argumentAccessor: "result") + + writer.line("return result") + writer.dedent() + writer.line("})") + + writer.dedent() + writer.line("}") + + writer.dedent() + writer.line("}") + } + } + + return writer.output() + } + + private static func generateFieldSerialization(writer: inout CodeWriter, argument: Resolver.Argument, argumentAccessor: String) { + switch argument.type { + case .int32: + writer.line("serializeInt32(\(argumentAccessor), buffer: buffer, boxed: false)") + case .int64: + writer.line("serializeInt64(\(argumentAccessor), buffer: buffer, boxed: false)") + case .int256: + writer.line("serializeInt256(\(argumentAccessor), buffer: buffer, boxed: false)") + case .double: + writer.line("serializeDouble(\(argumentAccessor), buffer: buffer, boxed: false)") + case .bytes: + writer.line("serializeBytes(\(argumentAccessor), buffer: buffer, boxed: false)") + case .string: + writer.line("serializeString(\(argumentAccessor), buffer: buffer, boxed: false)") + case .bool: + preconditionFailure() + case .boolTrue: + preconditionFailure() + case .bareVector(let elementType), .boxedVector(let elementType): + if case .boxedVector = argument.type { + writer.line("buffer.appendInt32(481674261)") + } + writer.line("buffer.appendInt32(Int32(\(argumentAccessor).count))") + writer.line("for item in \(argumentAccessor) {") + writer.indent() + generateFieldSerialization(writer: &writer, argument: Resolver.Argument(name: "item", type: elementType, condition: nil), argumentAccessor: "item") + writer.dedent() + writer.line("}") + case .bareConstructor: + writer.line("\(argumentAccessor).serialize(buffer, false)") + case .boxedType: + writer.line("\(argumentAccessor).serialize(buffer, true)") + } + } + + private static func generateFieldParsing(writer: inout CodeWriter, typeMap: [QualifiedName: Resolver.SumType], argument: Resolver.Argument, argumentAccessor: String) throws { + switch argument.type { + case .int32: + writer.line("\(argumentAccessor) = reader.readInt32()") + case .int64: + writer.line("\(argumentAccessor) = reader.readInt64()") + case .int256: + writer.line("\(argumentAccessor) = parseInt256(reader)") + case .double: + writer.line("\(argumentAccessor) = reader.readDouble()") + case .bytes: + writer.line("\(argumentAccessor) = parseBytes(reader)") + case .string: + writer.line("\(argumentAccessor) = parseString(reader)") + case .bool: + preconditionFailure() + case .boolTrue: + preconditionFailure() + case .bareVector(let elementType), .boxedVector(let elementType): + var elementSignature: Int32 = 0 + + switch elementType { + case .int32: + elementSignature = -1471112230 + case .int64: + elementSignature = 570911930 + case .int256: + elementSignature = 0x0929C32F + case .double: + elementSignature = 571523412 + case .bytes: + elementSignature = -1255641564 + case .string: + elementSignature = -1255641564 + case .bool: + elementSignature = 0 + case .boolTrue: + elementSignature = 0 + case .bareVector: + elementSignature = 0 + case .boxedVector: + elementSignature = 0 + case let .bareConstructor(typeName, name): + guard let type = typeMap[typeName] else { + throw CodeGenerationError(text: "Type \(typeName) not found") + } + guard let constructor = type.constructors[name] else { + throw CodeGenerationError(text: "Type \(typeName) not found") + } + elementSignature = Int32(bitPattern: constructor.id) + case .boxedType: + elementSignature = 0 + } + + if case .boxedVector = argument.type { + writer.line("if let _ = reader.readInt32() {") + writer.indent() + writer.line("\(argumentAccessor) = Api.parseVector(reader, elementSignature: \(elementSignature), elementType: \(typeReferenceRepresentation(elementType)).self)") + writer.dedent() + writer.line("}") + } else { + writer.line("\(argumentAccessor) = Api.parseVector(reader, elementSignature: \(elementSignature), elementType: \(typeReferenceRepresentation(elementType)).self)") + } + case let .bareConstructor(typeName, name): + guard let type = typeMap[typeName] else { + throw CodeGenerationError(text: "Type \(typeName) not found") + } + guard let constructor = type.constructors[name] else { + throw CodeGenerationError(text: "Type \(typeName) not found") + } + writer.line("\(argumentAccessor) = Api.parse(reader, signature: \(Int32(bitPattern: constructor.id)) as? \(typeReferenceRepresentation(argument.type))") + case .boxedType: + writer.line("if let signature = reader.readInt32() {") + writer.indent() + writer.line("\(argumentAccessor) = Api.parse(reader, signature: signature) as? \(typeReferenceRepresentation(argument.type))") + writer.dedent() + writer.line("}") + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/DescriptionParsing.swift b/build-system/SwiftTL/Sources/SwiftTL/DescriptionParsing.swift new file mode 100644 index 0000000000..e3b12d3a42 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/DescriptionParsing.swift @@ -0,0 +1,228 @@ +import Foundation + +enum DescriptionParser { + enum TypeReferenceDescription { + case generic(name: String, argumentType: QualifiedName) + case type(name: QualifiedName) + } + + struct ArgumentDescription { + struct ConditionDescription { + var fieldName: String + var bitIndex: Int + } + + var name: String + var type: TypeReferenceDescription + var condition: ConditionDescription? + } + + struct ConstructorDescription { + var name: QualifiedName + var explicitId: UInt32? + var arguments: [ArgumentDescription] + var type: TypeReferenceDescription + } + + static func parse(data: String) throws -> (constructors: [ConstructorDescription], functions: [ConstructorDescription]) { + let lines = data.components(separatedBy: "\n") + + var typeLines: [String] = [] + var functionLines: [String] = [] + + let skipPrefixes: [String] = [ + //"boolFalse#bc799737 = Bool;", + //"boolTrue#997275b5 = Bool;", + "true#3fedd339 = True;", + "vector#1cb5c415 {t:Type} # [ t ] = Vector t;", + "error#c4b9f9bb code:int text:string = Error;", + "null#56730bcc = Null;" + ] + + let skipContains: [String] = [ + "{X:Type}" + ] + + var isParsingFunctions = false + loop: for line in lines { + if line.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).isEmpty { + // skip + } else if line == "---functions---" { + isParsingFunctions = true + } else { + for string in skipPrefixes { + if line.hasPrefix(string) { + continue loop + } + } + + for string in skipContains { + if line.contains(string) { + continue loop + } + } + + if isParsingFunctions { + functionLines.append(line) + } else { + typeLines.append(line) + } + } + } + + var constructors: [ConstructorDescription] = [] + var functions: [ConstructorDescription] = [] + + for line in typeLines { + do { + let constructor = try self.parseConstructor(string: line) + constructors.append(constructor) + } catch let e { + print("Error while parsing line:\n\(line)\n") + print("\(e)") + + throw e + } + } + + for line in functionLines { + do { + let constructor = try parseConstructor(string: line) + functions.append(constructor) + } catch let e { + print("Error while parsing line:\n\(line)\n") + print("\(e)") + + throw e + } + } + + return (constructors, functions) + } + + private static func parseConstructor(string: String) throws -> ConstructorDescription { + let parseIdentifier = Parse { + Prefix(minLength: 1, while: { $0.isLetter || $0.isNumber || $0 == "_" }) + }.map { String($0) } + + let parseConditionDescription = Parse { + parseIdentifier + "." + Int.parser(of: Substring.self) + "?" + }.map { fieldName, bitIndex -> ArgumentDescription.ConditionDescription in + ArgumentDescription.ConditionDescription(fieldName: fieldName, bitIndex: bitIndex) + } + + let parseQualifiedName = Parse { + parseIdentifier + Optionally { + "." + parseIdentifier + } + }.map { first, second -> QualifiedName in + if let second = second { + return QualifiedName(namespace: first, value: second) + } else { + return QualifiedName(namespace: nil, value: first) + } + } + + let parseGenericTypeReference = Parse { + parseIdentifier + "<" + parseQualifiedName + ">" + }.map { name, argumentType -> TypeReferenceDescription in + return .generic(name: name, argumentType: argumentType) + } + + let parseDirectTypeReference = Parse { + parseQualifiedName + }.map { name -> TypeReferenceDescription in + return .type(name: name) + } + + let parseFlagsTypeReference = Parse { + "#" + }.map { () -> TypeReferenceDescription in + return .type(name: QualifiedName(namespace: nil, value: "int")) + } + + let parseTypeReference = Parse { + OneOf { + parseFlagsTypeReference + parseGenericTypeReference + parseDirectTypeReference + } + } + + let parseArgument = Parse { + parseIdentifier + ":" + Optionally { + parseConditionDescription + } + parseTypeReference + }.map { name, condition, type -> ArgumentDescription in + return ArgumentDescription(name: name, type: type, condition: condition) + } + + let parseExplicitId = Parse { + "#" + Prefix { $0.isHexDigit } + }.map { UInt32($0, radix: 16)! } + + let optionalExplicitId = Optionally { + parseExplicitId + } + + let manyArguments = Many { + parseArgument + } separator: { + Whitespace() + } + + let nameAndConstructor = Parse { + parseQualifiedName + optionalExplicitId + Whitespace() + }.map { name, explicitId, _ -> (name: QualifiedName, explicitId: UInt32?) in + return (name, explicitId) + } + + let typeSeparator = Parse { + Whitespace() + "=" + Whitespace() + } + + let trailerParser = Parse { + Whitespace() + ";" + Whitespace() + End() + }.map { _ -> Void in + } + + let parseConstructor = Parse { + nameAndConstructor + manyArguments + typeSeparator + parseTypeReference + trailerParser + }.map { nameAndConstructor, arguments, _, type -> ConstructorDescription in + return ConstructorDescription( + name: nameAndConstructor.name, + explicitId: nameAndConstructor.explicitId, + arguments: arguments, + type: type + ) + } + + var data = string[...] + let result = try parseConstructor.parse(&data) + + return result + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/LegacyOrderParser.swift b/build-system/SwiftTL/Sources/SwiftTL/LegacyOrderParser.swift new file mode 100644 index 0000000000..4a4feb1570 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/LegacyOrderParser.swift @@ -0,0 +1,128 @@ +import Foundation + +enum LegacyOrderParser { + struct LegacyOrderParsingError: Error, CustomStringConvertible { + var text: String + + var description: String { + return self.text + } + } + + static func parseConstructorOrder(data: String) throws -> [(typeName: QualifiedName, constructorName: String)] { + let lines = data.split(separator: "\n") + + var result: [(typeName: QualifiedName, constructorName: String)] = [] + + for line in lines { + if let startRange = line.range(of: " = { return Api."), let endRange = line.range(of: "($0) }", options: [.backwards], range: nil) { + let parseString = line[startRange.upperBound ..< endRange.lowerBound] + let components = parseString.components(separatedBy: ".parse_") + if components.count != 2 { + continue + } + + result.append((QualifiedName(string: components[0]), components[1])) + } + } + + return result + } + + static func parseTypeOrder(data: String) throws -> (types: [(typeName: QualifiedName, constructorNames: [String])], functions: [QualifiedName]) { + var resultTypes: [(typeName: QualifiedName, constructorNames: [String])] = [] + var resultFunctions: [QualifiedName] = [] + + let namespaces = data.components(separatedBy: "public extension Api {\n") + + enum ParseSection { + case types + case functions + } + + for namespaceData in namespaces { + if namespaceData.isEmpty { + continue + } + guard let firstNewline = namespaceData.range(of: "\n") else { + throw LegacyOrderParsingError(text: "No newline in the beginning of the namespace section") + } + let namespaceName: String? + let namespaceContentData: String + let parseSection: ParseSection + if let prefixRange = namespaceData.range(of: " public enum ", options: [], range: namespaceData.startIndex ..< firstNewline.lowerBound), prefixRange.lowerBound == namespaceData.startIndex { + namespaceName = nil + namespaceContentData = namespaceData + parseSection = .types + } else if let prefixRange = namespaceData.range(of: " indirect public enum ", options: [], range: namespaceData.startIndex ..< firstNewline.lowerBound), prefixRange.lowerBound == namespaceData.startIndex { + namespaceName = nil + namespaceContentData = namespaceData + parseSection = .types + } else if let prefixRange = namespaceData.range(of: " public struct functions {", options: [], range: namespaceData.startIndex ..< firstNewline.lowerBound), prefixRange.upperBound == firstNewline.lowerBound { + namespaceName = nil + namespaceContentData = namespaceData + parseSection = .functions + } else { + guard let prefixRange = namespaceData.range(of: "public struct ", options: [], range: namespaceData.startIndex ..< firstNewline.lowerBound), prefixRange.lowerBound == namespaceData.startIndex else { + throw LegacyOrderParsingError(text: "Missing header prefix in the beginning of the namespace section") + } + guard let trailerRange = namespaceData.range(of: " {", options: [], range: prefixRange.upperBound ..< firstNewline.lowerBound) else { + throw LegacyOrderParsingError(text: "Missing trailing suffix in the beginning of the namespace section") + } + namespaceName = String(namespaceData[prefixRange.upperBound ..< trailerRange.lowerBound]) + namespaceContentData = String(namespaceData[firstNewline.upperBound...]) + parseSection = .types + } + + let namespaceContentLines = namespaceContentData.split(separator: "\n") + + switch parseSection { + case .types: + var currentType: (typeName: QualifiedName, constructorNames: [String])? + for line in namespaceContentLines { + if let typePrefixRange = line.range(of: " public enum "), typePrefixRange.lowerBound == line.startIndex, let typeSuffixRange = line.range(of: ": TypeConstructorDescription {"), typeSuffixRange.upperBound == line.endIndex { + let typeName = String(line[typePrefixRange.upperBound ..< typeSuffixRange.lowerBound]) + if let currentType = currentType { + resultTypes.append(currentType) + } + currentType = (QualifiedName(namespace: namespaceName, value: typeName), []) + } else if let typePrefixRange = line.range(of: " indirect public enum "), typePrefixRange.lowerBound == line.startIndex, let typeSuffixRange = line.range(of: ": TypeConstructorDescription {"), typeSuffixRange.upperBound == line.endIndex { + let typeName = String(line[typePrefixRange.upperBound ..< typeSuffixRange.lowerBound]) + if let currentType = currentType { + resultTypes.append(currentType) + } + currentType = (QualifiedName(namespace: namespaceName, value: typeName), []) + } else if currentType != nil, let constructorPrefixRange = line.range(of: " case "), constructorPrefixRange.lowerBound == line.startIndex { + let constructorName: String + if let bracketRange = line.range(of: "(") { + constructorName = String(line[constructorPrefixRange.upperBound ..< bracketRange.lowerBound]) + } else { + constructorName = String(line[constructorPrefixRange.upperBound...]) + } + currentType?.constructorNames.append(constructorName) + } + } + if let currentType = currentType { + resultTypes.append(currentType) + } + case .functions: + var currentNamespace: String? + for line in namespaceContentLines { + if let namespacePrefixRange = line.range(of: " public struct "), namespacePrefixRange.lowerBound == line.startIndex, let namespaceSuffixRange = line.range(of: " {"), namespaceSuffixRange.upperBound == line.endIndex { + currentNamespace = String(line[namespacePrefixRange.upperBound ..< namespaceSuffixRange.lowerBound]) + } else if let functionPrefixRange = line.range(of: " public static func "), functionPrefixRange.lowerBound == line.startIndex { + let functionName: String + if let bracketRange = line.range(of: "(") { + functionName = String(line[functionPrefixRange.upperBound ..< bracketRange.lowerBound]) + } else { + functionName = String(line[functionPrefixRange.upperBound...]) + } + resultFunctions.append(QualifiedName(namespace: currentNamespace, value: functionName)) + } + } + } + } + + return (resultTypes, resultFunctions) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/OneOfBuilder.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/OneOfBuilder.swift new file mode 100644 index 0000000000..e5f15c6843 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/OneOfBuilder.swift @@ -0,0 +1,146 @@ +/// A custom parameter attribute that constructs parsers from closures. The constructed parser +/// runs each parser in the closure, one after another, till one succeeds with an output. +/// +/// The ``OneOf`` parser acts as an entry point into `@OneOfBuilder` syntax where you can list +/// all of the parsers you want to try. For example, to parse a currency symbol into an enum +/// of supported currencies: +/// +/// ```swift +/// enum Currency { case eur, gbp, usd } +/// let currency = OneOf { +/// "€".map { Currency.eur } +/// "£".map { Currency.gbp } +/// "$".map { Currency.usd } +/// } +/// let money = Parse { currency; Int.parser() } +/// +/// try currency.parse("$100") // (.usd, 100) +/// ``` +@resultBuilder +public enum OneOfBuilder { + /// Provides support for `for`-`in` loops in ``OneOfBuilder`` blocks. + /// + /// Useful for building up a parser from a dynamic source, like for a case-iterable enum: + /// + /// ```swift + /// enum Role: String, CaseIterable { + /// case admin + /// case guest + /// case member + /// } + /// + /// let roleParser = Parse { + /// for role in Role.allCases { + /// status.rawValue.map { role } + /// } + /// } + /// ``` + @inlinable + public static func buildArray

(_ parsers: [P]) -> Parsers.OneOfMany

{ + .init(parsers) + } + + /// Provides support for specifying a parser in ``OneOfBuilder`` blocks. + @inlinable + static public func buildBlock(_ parser: P) -> P { + parser + } + + /// Provides support for `if`-`else` statements in ``OneOfBuilder`` blocks, producing a + /// conditional parser for the `if` branch. + /// + /// ```swift + /// OneOf { + /// if useLegacyParser { + /// LegacyParser() + /// } else { + /// NewParser() + /// } + /// } + /// ``` + @inlinable + public static func buildEither( + first parser: TrueParser + ) -> Parsers.Conditional { + .first(parser) + } + + /// Provides support for `if`-`else` statements in ``OneOfBuilder`` blocks, producing a + /// conditional parser for the `if` branch. + /// + /// ```swift + /// OneOf { + /// if useLegacyParser { + /// LegacyParser() + /// } else { + /// NewParser() + /// } + /// } + /// ``` + @inlinable + public static func buildEither( + second parser: FalseParser + ) -> Parsers.Conditional { + .second(parser) + } + + /// Provides support for `if` statements in ``OneOfBuilder`` blocks, producing an optional parser. + /// + /// ```swift + /// let whitespace = OneOf { + /// if shouldParseNewlines { + /// "\r\n" + /// "\r" + /// "\n" + /// } + /// + /// " " + /// "\t" + /// } + /// ``` + @inlinable + public static func buildIf

(_ parser: P?) -> OptionalOneOf

{ + .init(wrapped: parser) + } + + /// Provides support for `if #available` statements in ``OneOfBuilder`` blocks, producing an + /// optional parser. + @inlinable + public static func buildLimitedAvailability

(_ parser: P?) -> OptionalOneOf

{ + .init(wrapped: parser) + } + + /// A parser that parses output from an optional parser. + /// + /// You won't typically construct this parser directly, but instead will use standard `if` + /// statements in a ``OneOfBuilder`` block to automatically build optional parsers: + /// + /// ```swift + /// let whitespace = OneOf { + /// if shouldParseNewlines { + /// "\r\n" + /// "\r" + /// "\n" + /// } + /// + /// " " + /// "\t" + /// } + /// ``` + public struct OptionalOneOf: Parser { + @usableFromInline + let wrapped: Wrapped? + + @usableFromInline + init(wrapped: Wrapped?) { + self.wrapped = wrapped + } + + @inlinable + public func parse(_ input: inout Wrapped.Input) throws -> Wrapped.Output { + guard let wrapped = self.wrapped + else { throw ParsingError.manyFailed([], at: input) } + return try wrapped.parse(&input) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/ParserBuilder.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/ParserBuilder.swift new file mode 100644 index 0000000000..b351e1ad26 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/ParserBuilder.swift @@ -0,0 +1,103 @@ +/// A custom parameter attribute that constructs parsers from closures. The constructed parser +/// runs a number of parsers, one after the other, and accumulates their outputs. +/// +/// The ``Parse`` parser acts as an entry point into `@ParserBuilder` syntax, where you can list +/// all of the parsers you want to run. For example, to parse two comma-separated integers: +/// +/// ```swift +/// try Parse { +/// Int.parser() +/// "," +/// Int.parser() +/// } +/// .parse("123,456") // (123, 456) +/// ``` +@resultBuilder +public enum ParserBuilder { + /// Provides support for specifying a parser in ``ParserBuilder`` blocks. + @inlinable + public static func buildBlock(_ parser: P) -> P { + parser + } + + /// Provides support for `if`-`else` statements in ``ParserBuilder`` blocks, producing a + /// conditional parser for the `if` branch. + /// + /// ```swift + /// Parse { + /// "Hello" + /// if shouldParseComma { + /// ", " + /// } else { + /// " " + /// } + /// Rest() + /// } + /// ``` + @inlinable + public static func buildEither( + first parser: TrueParser + ) -> Parsers.Conditional { + .first(parser) + } + + /// Provides support for `if`-`else` statements in ``ParserBuilder`` blocks, producing a + /// conditional parser for the `else` branch. + /// + /// ```swift + /// Parse { + /// "Hello" + /// if shouldParseComma { + /// ", " + /// } else { + /// " " + /// } + /// Rest() + /// } + /// ``` + @inlinable + public static func buildEither( + second parser: FalseParser + ) -> Parsers.Conditional { + .second(parser) + } + + /// Provides support for `if` statements in ``ParserBuilder`` blocks, producing an optional + /// parser. + @inlinable + public static func buildIf(_ parser: P?) -> P? { + parser + } + + /// Provides support for `if` statements in ``ParserBuilder`` blocks, producing a void parser for + /// a given void parser. + /// + /// ```swift + /// Parse { + /// "Hello" + /// if shouldParseComma { + /// "," + /// } + /// " " + /// Rest() + /// } + /// ``` + @inlinable + public static func buildIf

(_ parser: P?) -> Parsers.OptionalVoid

{ + .init(wrapped: parser) + } + + /// Provides support for `if #available` statements in ``ParserBuilder`` blocks, producing an + /// optional parser. + @inlinable + public static func buildLimitedAvailability(_ parser: P?) -> P? { + parser + } + + /// Provides support for `if #available` statements in ``ParserBuilder`` blocks, producing a void + /// parser for a given void parser. + @inlinable + public static func buildLimitedAvailability

(_ parser: P?) -> Parsers.OptionalVoid

{ + .init(wrapped: parser) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/Variadics.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/Variadics.swift new file mode 100644 index 0000000000..af4ae282f1 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Builders/Variadics.swift @@ -0,0 +1,6317 @@ +// BEGIN AUTO-GENERATED CONTENT + +extension ParserBuilder { + public struct ZipOO: Parser + where + P0.Input == P1.Input + { + public let p0: P0, p1: P1 + + @inlinable public init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + return (o0, o1) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipOO { + ParserBuilder.ZipOO(p0, p1) + } +} + +extension ParserBuilder { + public struct ZipOV: Parser + where + P0.Input == P1.Input, + P1.Output == Void + { + public let p0: P0, p1: P1 + + @inlinable public init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + return o0 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipOV { + ParserBuilder.ZipOV(p0, p1) + } +} + +extension ParserBuilder { + public struct ZipVO: Parser + where + P0.Input == P1.Input, + P0.Output == Void + { + public let p0: P0, p1: P1 + + @inlinable public init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + return o1 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipVO { + ParserBuilder.ZipVO(p0, p1) + } +} + +extension ParserBuilder { + public struct ZipVV: Parser + where + P0.Input == P1.Input, + P0.Output == Void, + P1.Output == Void + { + public let p0: P0, p1: P1 + + @inlinable public init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows { + do { + try p0.parse(&input) + try p1.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> ParserBuilder.ZipVV { + ParserBuilder.ZipVV(p0, p1) + } +} + +extension ParserBuilder { + public struct ZipOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + return (o0, o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipOOO { + ParserBuilder.ZipOOO(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipOOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + return (o0, o1) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipOOV { + ParserBuilder.ZipOOV(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipOVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + return (o0, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipOVO { + ParserBuilder.ZipOVO(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipOVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + return o0 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipOVV { + ParserBuilder.ZipOVV(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P0.Output == Void + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + return (o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipVOO { + ParserBuilder.ZipVOO(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipVOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P0.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + return o1 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipVOV { + ParserBuilder.ZipVOV(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipVVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P0.Output == Void, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P2.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + return o2 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipVVO { + ParserBuilder.ZipVVO(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipVVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> ParserBuilder.ZipVVV { + ParserBuilder.ZipVVV(p0, p1, p2) + } +} + +extension ParserBuilder { + public struct ZipOOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + return (o0, o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOOOO { + ParserBuilder.ZipOOOO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOOOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + return (o0, o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOOOV { + ParserBuilder.ZipOOOV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOOVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + return (o0, o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOOVO { + ParserBuilder.ZipOOVO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOOVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + return (o0, o1) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOOVV { + ParserBuilder.ZipOOVV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + return (o0, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOVOO { + ParserBuilder.ZipOVOO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOVOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + return (o0, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOVOV { + ParserBuilder.ZipOVOV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOVVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + return (o0, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOVVO { + ParserBuilder.ZipOVVO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOVVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + return o0 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipOVVV { + ParserBuilder.ZipOVVV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + return (o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVOOO { + ParserBuilder.ZipVOOO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVOOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + return (o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVOOV { + ParserBuilder.ZipVOOV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVOVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + return (o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVOVO { + ParserBuilder.ZipVOVO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVOVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + return o1 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVOVV { + ParserBuilder.ZipVOVV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + return (o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVVOO { + ParserBuilder.ZipVVOO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVVOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P2.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + return o2 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVVOV { + ParserBuilder.ZipVVOV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVVVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P3.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + return o3 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVVVO { + ParserBuilder.ZipVVVO(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipVVVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> ParserBuilder.ZipVVVV { + ParserBuilder.ZipVVVV(p0, p1, p2, p3) + } +} + +extension ParserBuilder { + public struct ZipOOOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o1, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOOOO { + ParserBuilder.ZipOOOOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOOOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return (o0, o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOOOV { + ParserBuilder.ZipOOOOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOOVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o1, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOOVO { + ParserBuilder.ZipOOOVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOOVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + return (o0, o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOOVV { + ParserBuilder.ZipOOOVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o1, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOVOO { + ParserBuilder.ZipOOVOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOVOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return (o0, o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOVOV { + ParserBuilder.ZipOOVOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOVVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o1, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOVVO { + ParserBuilder.ZipOOVVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOVVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + return (o0, o1) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOOVVV { + ParserBuilder.ZipOOVVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVOOO { + ParserBuilder.ZipOVOOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVOOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return (o0, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVOOV { + ParserBuilder.ZipOVOOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVOVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVOVO { + ParserBuilder.ZipOVOVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVOVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + return (o0, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVOVV { + ParserBuilder.ZipOVOVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVVOO { + ParserBuilder.ZipOVVOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVVOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return (o0, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVVOV { + ParserBuilder.ZipOVVOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVVVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o0, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVVVO { + ParserBuilder.ZipOVVVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOVVVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + return o0 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipOVVVV { + ParserBuilder.ZipOVVVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o1, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOOOO { + ParserBuilder.ZipVOOOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOOOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return (o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOOOV { + ParserBuilder.ZipVOOOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOOVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o1, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOOVO { + ParserBuilder.ZipVOOVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOOVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + return (o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOOVV { + ParserBuilder.ZipVOOVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o1, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOVOO { + ParserBuilder.ZipVOVOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOVOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return (o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOVOV { + ParserBuilder.ZipVOVOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOVVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o1, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOVVO { + ParserBuilder.ZipVOVVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVOVVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + return o1 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVOVVV { + ParserBuilder.ZipVOVVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVOOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVOOO { + ParserBuilder.ZipVVOOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVOOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return (o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVOOV { + ParserBuilder.ZipVVOOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVOVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P4.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVOVO { + ParserBuilder.ZipVVOVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVOVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P2.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + return o2 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVOVV { + ParserBuilder.ZipVVOVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVVOO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + return (o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVVOO { + ParserBuilder.ZipVVVOO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVVOV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P3.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + return o3 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVVOV { + ParserBuilder.ZipVVVOV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVVVO: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P4.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + return o4 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVVVO { + ParserBuilder.ZipVVVVO(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipVVVVV: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> ParserBuilder.ZipVVVVV { + ParserBuilder.ZipVVVVV(p0, p1, p2, p3, p4) + } +} + +extension ParserBuilder { + public struct ZipOOOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOOOO { + ParserBuilder.ZipOOOOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o1, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOOOV { + ParserBuilder.ZipOOOOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOOVO { + ParserBuilder.ZipOOOOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o0, o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOOVV { + ParserBuilder.ZipOOOOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOVOO { + ParserBuilder.ZipOOOVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o1, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOVOV { + ParserBuilder.ZipOOOVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOVVO { + ParserBuilder.ZipOOOVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o0, o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOOVVV { + ParserBuilder.ZipOOOVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVOOO { + ParserBuilder.ZipOOVOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o1, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVOOV { + ParserBuilder.ZipOOVOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVOVO { + ParserBuilder.ZipOOVOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o0, o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVOVV { + ParserBuilder.ZipOOVOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVVOO { + ParserBuilder.ZipOOVVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o1, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVVOV { + ParserBuilder.ZipOOVVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o1, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVVVO { + ParserBuilder.ZipOOVVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOOVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P1.Output + ) { + do { + let o0 = try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o0, o1) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOOVVVV { + ParserBuilder.ZipOOVVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOOOO { + ParserBuilder.ZipOVOOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOOOV { + ParserBuilder.ZipOVOOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOOVO { + ParserBuilder.ZipOVOOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o0, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOOVV { + ParserBuilder.ZipOVOOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOVOO { + ParserBuilder.ZipOVOVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOVOV { + ParserBuilder.ZipOVOVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOVVO { + ParserBuilder.ZipOVOVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P2.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o0, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVOVVV { + ParserBuilder.ZipOVOVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVOOO { + ParserBuilder.ZipOVVOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVOOV { + ParserBuilder.ZipOVVOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVOVO { + ParserBuilder.ZipOVVOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P3.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o0, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVOVV { + ParserBuilder.ZipOVVOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P4.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVVOO { + ParserBuilder.ZipOVVVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P4.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o0, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVVOV { + ParserBuilder.ZipOVVVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P0.Output, + P5.Output + ) { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o0, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVVVO { + ParserBuilder.ZipOVVVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipOVVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + do { + let o0 = try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return o0 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipOVVVVV { + ParserBuilder.ZipOVVVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output, + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOOOO { + ParserBuilder.ZipVOOOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o1, o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOOOV { + ParserBuilder.ZipVOOOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOOVO { + ParserBuilder.ZipVOOOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P3.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o1, o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOOVV { + ParserBuilder.ZipVOOOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOVOO { + ParserBuilder.ZipVOOVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o1, o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOVOV { + ParserBuilder.ZipVOOVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOVVO { + ParserBuilder.ZipVOOVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P2.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o1, o2) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOOVVV { + ParserBuilder.ZipVOOVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output, + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVOOO { + ParserBuilder.ZipVOVOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o1, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVOOV { + ParserBuilder.ZipVOVOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVOVO { + ParserBuilder.ZipVOVOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P3.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o1, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVOVV { + ParserBuilder.ZipVOVOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVVOO { + ParserBuilder.ZipVOVVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P4.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o1, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVVOV { + ParserBuilder.ZipVOVVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P1.Output, + P5.Output + ) { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o1, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVVVO { + ParserBuilder.ZipVOVVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVOVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P1.Output { + do { + try p0.parse(&input) + let o1 = try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return o1 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVOVVVV { + ParserBuilder.ZipVOVVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output, + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o2, o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOOOO { + ParserBuilder.ZipVVOOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o2, o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOOOV { + ParserBuilder.ZipVVOOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o2, o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOOVO { + ParserBuilder.ZipVVOOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P3.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return (o2, o3) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOOVV { + ParserBuilder.ZipVVOOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o2, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOVOO { + ParserBuilder.ZipVVOVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P4.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o2, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOVOV { + ParserBuilder.ZipVVOVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P2.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o2, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOVVO { + ParserBuilder.ZipVVOVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVOVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P2.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + let o2 = try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return o2 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVOVVV { + ParserBuilder.ZipVVOVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVOOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P3.Output, + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o3, o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVOOO { + ParserBuilder.ZipVVVOOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVOOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P3.Output, + P4.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return (o3, o4) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVOOV { + ParserBuilder.ZipVVVOOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVOVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P3.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o3, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVOVO { + ParserBuilder.ZipVVVOVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVOVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P3.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + let o3 = try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + return o3 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVOVV { + ParserBuilder.ZipVVVOVV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVVOO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> ( + P4.Output, + P5.Output + ) { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + let o5 = try p5.parse(&input) + return (o4, o5) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVOO { + ParserBuilder.ZipVVVVOO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVVOV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P4.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + let o4 = try p4.parse(&input) + try p5.parse(&input) + return o4 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVOV { + ParserBuilder.ZipVVVVOV(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVVVO: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P5.Output { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + let o5 = try p5.parse(&input) + return o5 + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVVO { + ParserBuilder.ZipVVVVVO(p0, p1, p2, p3, p4, p5) + } +} + +extension ParserBuilder { + public struct ZipVVVVVV: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == Void, + P1.Output == Void, + P2.Output == Void, + P3.Output == Void, + P4.Output == Void, + P5.Output == Void + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows { + do { + try p0.parse(&input) + try p1.parse(&input) + try p2.parse(&input) + try p3.parse(&input) + try p4.parse(&input) + try p5.parse(&input) + } catch { throw ParsingError.wrap(error, at: input) } + } + } +} + +extension ParserBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> ParserBuilder.ZipVVVVVV { + ParserBuilder.ZipVVVVVV(p0, p1, p2, p3, p4, p5) + } +} + +extension OneOfBuilder { + public struct OneOf2: Parser + where + P0.Input == P1.Input, + P0.Output == P1.Output + { + public let p0: P0, p1: P1 + + @inlinable public init(_ p0: P0, _ p1: P1) { + self.p0 = p0 + self.p1 = p1 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + throw ParsingError.manyFailed( + [e0, e1], at: input + ) + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1 + ) -> OneOfBuilder.OneOf2 { + OneOfBuilder.OneOf2(p0, p1) + } +} + +extension OneOfBuilder { + public struct OneOf3: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P0.Output == P1.Output, + P1.Output == P2.Output + { + public let p0: P0, p1: P1, p2: P2 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + throw ParsingError.manyFailed( + [e0, e1, e2], at: input + ) + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2 + ) -> OneOfBuilder.OneOf3 { + OneOfBuilder.OneOf3(p0, p1, p2) + } +} + +extension OneOfBuilder { + public struct OneOf4: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3], at: input + ) + } + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3 + ) -> OneOfBuilder.OneOf4 { + OneOfBuilder.OneOf4(p0, p1, p2, p3) + } +} + +extension OneOfBuilder { + public struct OneOf5: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4], at: input + ) + } + } + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4 + ) -> OneOfBuilder.OneOf5 { + OneOfBuilder.OneOf5(p0, p1, p2, p3, p4) + } +} + +extension OneOfBuilder { + public struct OneOf6: + Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5], at: input + ) + } + } + } + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5 + ) -> OneOfBuilder.OneOf6 { + OneOfBuilder.OneOf6(p0, p1, p2, p3, p4, p5) + } +} + +extension OneOfBuilder { + public struct OneOf7< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6 + + @inlinable public init(_ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + do { + input = original + return try self.p6.parse(&input) + } catch let e6 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6], at: input + ) + } + } + } + } + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6 + ) -> OneOfBuilder.OneOf7 { + OneOfBuilder.OneOf7(p0, p1, p2, p3, p4, p5, p6) + } +} + +extension OneOfBuilder { + public struct OneOf8< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, P7: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P6.Input == P7.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output, + P6.Output == P7.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7 + + @inlinable public init( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7 + ) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + self.p7 = p7 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + do { + input = original + return try self.p6.parse(&input) + } catch let e6 { + do { + input = original + return try self.p7.parse(&input) + } catch let e7 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6, e7], at: input + ) + } + } + } + } + } + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7 + ) -> OneOfBuilder.OneOf8 { + OneOfBuilder.OneOf8(p0, p1, p2, p3, p4, p5, p6, p7) + } +} + +extension OneOfBuilder { + public struct OneOf9< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, P7: Parser, + P8: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P6.Input == P7.Input, + P7.Input == P8.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output, + P6.Output == P7.Output, + P7.Output == P8.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8 + + @inlinable public init( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8 + ) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + self.p7 = p7 + self.p8 = p8 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + do { + input = original + return try self.p6.parse(&input) + } catch let e6 { + do { + input = original + return try self.p7.parse(&input) + } catch let e7 { + do { + input = original + return try self.p8.parse(&input) + } catch let e8 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6, e7, e8], at: input + ) + } + } + } + } + } + } + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8 + ) -> OneOfBuilder.OneOf9 { + OneOfBuilder.OneOf9(p0, p1, p2, p3, p4, p5, p6, p7, p8) + } +} + +extension OneOfBuilder { + public struct OneOf10< + P0: Parser, P1: Parser, P2: Parser, P3: Parser, P4: Parser, P5: Parser, P6: Parser, P7: Parser, + P8: Parser, P9: Parser + >: Parser + where + P0.Input == P1.Input, + P1.Input == P2.Input, + P2.Input == P3.Input, + P3.Input == P4.Input, + P4.Input == P5.Input, + P5.Input == P6.Input, + P6.Input == P7.Input, + P7.Input == P8.Input, + P8.Input == P9.Input, + P0.Output == P1.Output, + P1.Output == P2.Output, + P2.Output == P3.Output, + P3.Output == P4.Output, + P4.Output == P5.Output, + P5.Output == P6.Output, + P6.Output == P7.Output, + P7.Output == P8.Output, + P8.Output == P9.Output + { + public let p0: P0, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9 + + @inlinable public init( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8, + _ p9: P9 + ) { + self.p0 = p0 + self.p1 = p1 + self.p2 = p2 + self.p3 = p3 + self.p4 = p4 + self.p5 = p5 + self.p6 = p6 + self.p7 = p7 + self.p8 = p8 + self.p9 = p9 + } + + @inlinable public func parse(_ input: inout P0.Input) rethrows -> P0.Output { + let original = input + do { return try self.p0.parse(&input) } catch let e0 { + do { + input = original + return try self.p1.parse(&input) + } catch let e1 { + do { + input = original + return try self.p2.parse(&input) + } catch let e2 { + do { + input = original + return try self.p3.parse(&input) + } catch let e3 { + do { + input = original + return try self.p4.parse(&input) + } catch let e4 { + do { + input = original + return try self.p5.parse(&input) + } catch let e5 { + do { + input = original + return try self.p6.parse(&input) + } catch let e6 { + do { + input = original + return try self.p7.parse(&input) + } catch let e7 { + do { + input = original + return try self.p8.parse(&input) + } catch let e8 { + do { + input = original + return try self.p9.parse(&input) + } catch let e9 { + throw ParsingError.manyFailed( + [e0, e1, e2, e3, e4, e5, e6, e7, e8, e9], at: input + ) + } + } + } + } + } + } + } + } + } + } + } + } +} + +extension OneOfBuilder { + @inlinable public static func buildBlock( + _ p0: P0, _ p1: P1, _ p2: P2, _ p3: P3, _ p4: P4, _ p5: P5, _ p6: P6, _ p7: P7, _ p8: P8, + _ p9: P9 + ) -> OneOfBuilder.OneOf10 { + OneOfBuilder.OneOf10(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9) + } +} + +// END AUTO-GENERATED CONTENT diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Backtracking.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Backtracking.md new file mode 100644 index 0000000000..a1dc02e5d7 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Backtracking.md @@ -0,0 +1,132 @@ +# Backtracking + +Learn what backtracking is, how it affects the performance of your parsers, and how to avoid it when +unnecessary. + +## Overview + +Backtracking is the process of restoring an input to its original value when parsing fails. While it +can be very useful, backtracking can lead to more complicated parser logic than necessary, and +backtracking too often can lead to performance issues. For this reason, most parsers are not +required to backtrack, and can therefore fail _and_ still consume from the input. + +The primary way to make use of backtracking in your parsers is through the ``OneOf`` parser, which +tries many parsers on an input and chooses the first that succeeds. This allows you to try many +parsers on the same input, regardless of how much each parser consumes: + +```swift +enum Currency { case eur, gbp, usd } + +let currency = OneOf { + "€".map { Currency.eur } + "£".map { Currency.gbp } + "$".map { Currency.usd } +} +``` + +## When to backtrack in your parsers? + +If you only use the parsers and operators that ship with this library, and in particular you do not +create custom conformances to the ``Parser`` protocol, then you never need to worry about explicitly +backtracking your input because it will be handled for you automatically. The primary way to allow +for backtracking is via the ``OneOf`` parser, but there are a few other parsers that also backtrack +internally. + +One such example is the ``Optionally`` parser, which transforms any parser into one that cannot fail +by catching any thrown errors and returning `nil`: + +```swift +let parser = Parse { + "Hello," + Optionally { " "; Bool.parser() } + " world!" +} + +try parser.parse("Hello, world!") // nil +try parser.parse("Hello, true world!") // true +``` + +If the parser captured inside ``Optionally`` fails then it backtracks the input to its state before +the parser ran. In particular, if the `Bool.parser()` fails then it will make sure to undo +consuming the leading space " " so that later parsers can try. + +Another example of a parser that internally backtracks is the ``Parser/replaceError(with:)`` +operator, which coalesces any error thrown by a parser into a default output value: + +```swift +let parser = Parse { + "Hello," + Optionally { " "; Bool.parser() } + .replaceError(with: false) + " world!" +} + +try parser.parse("Hello, world!") // false +try parser.parse("Hello, true world!") // true +``` + +It backtracks the input to its original value when the parser fails so that later parsers can try. + +The only time you need to worry about explicitly backtracking input is when making your own +``Parser`` conformances. As a general rule of thumb, if your parser recovers from all failures +in the `parse` method then it should backtrack the input to its state before the error was thrown. +This is exactly how ``OneOf``, ``Optionally`` and ``Parser/replaceError(with:)`` work. + +## Performance + +If used naively, backtracking can lead to less performant parsing code. For example, if we wanted to +parse two integers from a string that were separated by either a dash "-" or slash "/", then we +could write this as: + +```swift +OneOf { + Parse { Int.parser(); "-"; Int.parser() } // 1️⃣ + Parse { Int.parser(); "/"; Int.parser() } // 2️⃣ +} +``` + +However, parsing slash-separated integers is not going to be performant because it will first run +the entire 1️⃣ parser until it fails, then backtrack to the beginning, and run the 2️⃣ parser. In +particular, the first integer will get parsed twice, unnecessarily repeating that work. + +On the other hand, we can factor out the common work of the parser and localize the backtracking +``OneOf`` work to make a much more performant parser: + +```swift +Parse { + Int.parser() + OneOf { "-"; "/" } + Int.parser() +} +``` + +We can even write a benchmark to measure the performance difference: + +```swift +let first = OneOf { + Parse { Int.parser(); "-"; Int.parser() } + Parse { Int.parser(); "/"; Int.parser() } +} +benchmark("First") { + precondition(try! first.parse("100/200") == (100, 200)) +} +let second = Parse { + Int.parser() + OneOf { "-"; "/" } + Int.parser() +} +benchmark("Second") { + precondition(try! second.parse("100/200") == (100, 200)) +} +``` + +Running this produces the following results: + +``` +name time std iterations +---------------------------------------- +First 1500.000 ns ± 19.75 % 856753 +Second 917.000 ns ± 15.89 % 1000000 +``` + +The second parser takes only 60% of the time to run that the first parser does. diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Design.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Design.md new file mode 100644 index 0000000000..4b5a80e785 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Design.md @@ -0,0 +1,131 @@ +# Design + +Learn how the library is designed, including its use of protocols, result builders and operators. + +## Protocol + +The design of the library is largely inspired by the Swift standard library and Apple's Combine +framework. A parser is represented as a protocol that many types conform to, and then parser +transformations (also known as "combinators") are methods that return concrete types conforming to +the parser protocol. + +For example, to parse all the characters from the beginning of a substring until you encounter a +comma you can use the `Prefix` parser: + +```swift +let parser = Prefix { $0 != "," } + +var input = "Hello,World"[...] +try parser.parse(&input) // "Hello" +input // ",World" +``` + +The type of this parser is: + +```swift +Prefix +``` + +We can `.map` on this parser in order to transform its output, which in this case is the string +"Hello": + +```swift +let parser = Prefix { $0 != "," } +.map { $0 + "!!!" } + +var input = "Hello,World"[...] +try parser.parse(&input) // "Hello!!!" +input // ",World" +``` + +The type of this parser is now: + +```swift +Parsers.Map, Substring> +``` + +Notice that the type of the parser encodes the operations that we performed. This adds a bit of +complexity when using these types, but comes with some performance benefits because Swift can +usually inline and optimize away the creation of those nested types. + +## Result Builders + +The library takes advantage of Swift's `@resultBuilder` feature to make constructing complex parsers +as fluent as possible, and should be reminiscent of how views are constructed in SwiftUI. The main +entry point into building a parser is the `Parse` builder: + +```swift +Parse { + +} +``` + +In this builder block you can specify parsers that will be run one after another. For example, if +you wanted to parse an integer, then a comma, and then a boolean from a string, you can simply do: + +```swift +Parse { + Int.parser() + "," + Bool.parser() +} +``` + +Note that the `String` type conforms to the ``Parser`` protocol, and represents a parser that +consumes that exact string from the beginning of an input if it matches, and otherwise fails. + +Many of the parsers and operators that come with the library are configured with parser builders +to maximize readability of the parsers. For example, to parse accounting syntax of numbers, where +parenthesized numbers are negative, we can use the ``OneOf`` parser builder: + +```swift +let digits = Prefix { $0 >= "0" && $0 <= "9" }.compactMap(Int.init) + +let accountingNumber = OneOf { + digits + + Parse { + "("; digits; ")" + } + .map { -$0 } +} + +try accountingNumber.parse("100") // 100 +try accountingNumber.parse("(100)") // -100 +``` + +## Operators + +Parser operators (also called "combinators") are methods defined on the ``Parser`` protocol that +return a parser. For example, the ``Parser/map(_:)`` operator is a method that returns something +called a ``Parsers/Map``: + +```swift +extension Parser { + public func map( + _ transform: @escaping (Output) -> NewOutput + ) -> Parsers.Map { + .init(upstream: self, transform: transform) + } +} +``` + +And ``Parsers/Map`` is a dedicated type that implements the logic of the map operation. In +particular, in runs the upstream parser and then transforms its output: + +```swift +extension Parsers { + public struct Map: Parser { + public let upstream: Upstream + public let transform: (Upstream.Output) -> NewOutput + + public func parse(_ input: inout Upstream.Input) rethrows -> NewOutput { + self.transform(try self.upstream.parse(&input)) + } + } +} +``` + +Types that conform to the ``Parser`` protocol but are not constructed directly, and instead are +constructed via operators, are housed in the ``Parsers`` type. It's just an empty enum that +serves as a namespace for such parsers. diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/ErrorMessages.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/ErrorMessages.md new file mode 100644 index 0000000000..15733c3146 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/ErrorMessages.md @@ -0,0 +1,239 @@ +# Error messages + +Learn how the library reports parsing errors and how to integrate your own custom error messages +into parsers. + +## Overview + +When a parser fails it throws an error containing information about what went wrong. The actual +error thrown by the parsers shipped with this library is internal, and so it should be considered +opaque. To get a human-readable debug description of the error message you can stringify the error. +For example, the following `UInt8` parser fails to parse a string that would cause it to overflow: + +```swift +do { + var input = "1234 Hello"[...] + let number = try UInt8.parser().parse(&input)) +} catch { + print(error) + + // error: failed to process "UInt8" + // --> input:1:1-4 + // 1 | 1234 Hello + // | ^^^^ overflowed 255 +} +``` + +When the ``OneOf`` parser is used and fails, there are multiple errors that can be shown. ``OneOf`` +prioritizes the error messages based on which parser got the furthest along. For example, consider +a parser that can parse accounting style of numbers, i.e. plain numbers are considered positive +and numbers in parentheses are considered negative: + +```swift +let digits = Prefix { $0 >= "0" && $0 <= "9" }.compactMap(Int.init) + +let accountingNumber = OneOf { + digits + + Parse { + "("; digits; ")" + } + .map { -$0 } +} + +try accountingNumber.parse("100") // 100 +try accountingNumber.parse("(100)") // -100 +``` + +If we try parsing something erroneous, such as "(100]", we get multiple error messages, but the +second parser's error shows first since it was able to get the furthest: + +```swift +do { + try accountingNumber.parse("(100]") +} catch { + print(error) + + // error: multiple failures occurred + // + // error: unexpected input + // --> input:1:5 + // 1 | (100] + // | ^ expected ")" + // + // error: unexpected input + // --> input:1:1 + // 1 | (100] + // | ^ expected integer +} +``` + +## Improving error messages + +The quality of error messages emitted by a parser can depend on the manner in which the parser was +constructed. Some parser operators are powerful and convenient, but can cause the quality of error +messaging to degrade. + +For example, we could construct a parser that consumes a single uncommented line from an input +(_i.e._, a line that does not begin with "//") by using ``Parser/compactMap(_:)`` to check the line +for a prefix: + +```swift +let uncommentedLine = Prefix { $0 != "\n" } + .compactMap { $0.starts(with: "//") ? nil : $0 } + +try uncommentedLine.parse("// let x = 1") + +// error: failed to process "Substring" from "// let x = 1" +// --> input:1:1-12 +// 1 | // let x = 1 +// | ^^^^^^^^^^^^ +``` + +However, when this parser fails it can only highlight the entire line as having a problem because +it cannot know that the only thing that failed was that the first two characters were slashes. + +We can rewrite this parser in a different, but equivalent, way by using the ``Not`` parser to first +confirm that the line does not begin with "//", and then consume the entire line: + +```swift +let uncommentedLine = Parse { + Not { "//" } + Prefix { $0 != "\n" } +} + +try uncommentedLine.parse("// let x = 1") + +// error: unexpected input +// --> input:1:1-2 +// 1 | // let x = 1 +// | ^^ expected not to be processed +``` + +This provides better error messaging because ``Not`` knows exactly what matched that we did not want +to match, and so it can highlight those specific characters. + +When using the `Many` parser you can improve error messaging by supplying a "terminator" parser, +which is an optional argument. The terminator parser is run after the element and separator +parsers have consumed as much as they can, and allows you to assert on exactly what is left +afterwards. + +For example, if a parser is run on an input that has a typo in the last row of data, and a +terminator is not specified, the parser will succeed without consuming that last row and we won't +know what went wrong: + +```swift +struct User { + var id: Int + var name: String + var isAdmin: Bool +} + +let user = Parse(User.init(id:name:isAdmin:)) { + Int.parser() + "," + Prefix { $0 != "," }.map(String.init) + "," + Bool.parser() +} + +let users = Many { + user +} separator: { + "\n" +} + +var input = """ +1,Blob,true +2,Blob Jr.,false +3,Blob Sr.,tru +"""[...] + +let output = try users.parse(&input) +output.count // 2 +input // "\n3,Blob Sr.,tru" +``` + +However, by adding a terminator to this `users` parser an error will be throw that points to the +exact spot where the typo occurred: + +```swift +let users = Many { + user +} separator: { + "\n" +} terminator: { + End() +} + +let output = try users.parse(&input) + +// error: unexpected input +// --> input:3:11 +// 3 | 3,Blob Jr,tru +// | ^ expected "true" or "false" +``` + +## Throwing your own errors + +Although the error type thrown by the parsers that ship in this library is currently internal, and +so should be thought of as opaque, it is still possible to throw your own errors. Your errors will +automatically be reformatted and contextualized to show exactly where the error occurred. + +For example, suppose we wanted a parser that only parsed the digits 0-9 from the beginning of a +string and transformed it into an integer. This is subtly different from `Int.parser()` which +supports negative numbers, exponential formatting, and more. + +Constructing a `Digits` parser is easy enough, and we can introduce a custom struct error for +customizing the message displayed: + +```swift +struct DigitsError: Error { + let message = "Expected a prefix of digits 0-9" +} + +struct Digits: Parser { + func parse(_ input: inout Substring) throws -> Int { + let digits = input.prefix { $0 >= "0" && $0 <= "9" } + guard let output = Int(digits) + else { + throw DigitsError() + } + input.removeFirst(digits.count) + return output + } +} +``` + +If we swap out the `Int.parser()` for a `Digits` parser in `user`: + +```swift +let user = Parse(User.init) { + Digits() + "," + Prefix { $0 != "," }.map(String.init) + "," + Bool.parser() +} +``` + +And we introduce an incorrect value into the input: + +```swift +let input = """ +1,Blob,true +-2,Blob Jr.,false +3,Blob Sr.,true +"""[...] +``` + +Then when running the parser we get a nice error message that shows exactly what went wrong: + +```swift +try user.parse(&input) + +// error: DigitsError(message: "Expected a prefix of digits 0-9") +// --> input:2:1 +// 2 | -2,Blob Sr,false +// | ^ +``` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/GettingStarted.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/GettingStarted.md new file mode 100644 index 0000000000..f98f41fbb7 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/GettingStarted.md @@ -0,0 +1,303 @@ +# Getting Started + +Learn how to integrate Parsing into your project and write your first parser. + +## Adding Parsing as a dependency + +To use the Parsing library in a SwiftPM project, add it to the dependencies of your Package.swift +and specify the `Parsing` product in any targets that need access to the library: + +```swift +let package = Package( + dependencies: [ + .package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.7.0"), + ], + targets: [ + .target( + name: "", + dependencies: [.product(name: "Parsing", package: "swift-parsing")] + ) + ] +) +``` + +## Your first parser + +Suppose you have a string that holds some user data that you want to parse into an array of `User`s: + +```swift +let input = """ + 1,Blob,true + 2,Blob Jr.,false + 3,Blob Sr.,true + """ + +struct User { + var id: Int + var name: String + var isAdmin: Bool +} +``` + +A naive approach to this would be a nested use of `.split(separator:)`, and then a little bit of +extra work to convert strings into integers and booleans: + +```swift +let users = input + .split(separator: "\n") + .compactMap { row -> User? in + let fields = row.split(separator: ",") + guard + fields.count == 3, + let id = Int(fields[0]), + let isAdmin = Bool(String(fields[2])) + else { return nil } + + return User(id: id, name: String(fields[1]), isAdmin: isAdmin) + } +``` + +Not only is this code a little messy, but it is also inefficient since we are allocating arrays for +the `.split` and then just immediately throwing away those values. + +It would be more straightforward and efficient to instead describe how to consume bits from the +beginning of the input and convert that into users. This is what this parser library excels at 😄. + +We can start by describing what it means to parse a single row, first by parsing an integer off the +front of the string, and then parsing a comma. We can do this by using the ``Parse`` type, which acts +as an entry point into describing a list of parsers that you want to run one after the other to +consume from an input: + +```swift +let user = Parse { + Int.parser() + "," +} +``` + +Already this can consume the leading integer and comma from the beginning of the input: + +```swift +// Use a mutable substring to verify what is consumed +var input = input[...] + +try user.parse(&input) // 1 +input // "Blob,true\n2,Blob Jr.,false\n3,Blob Sr.,true" +``` + +Next we want to take everything up until the next comma for the user's name, and then consume the +comma: + +```swift +let user = Parse { + Int.parser() + "," + Prefix { $0 != "," } + "," +} +``` + +And then we want to take the boolean at the end of the row for the user's admin status: + +```swift +let user = Parse { + Int.parser() + "," + Prefix { $0 != "," } + "," + Bool.parser() +} +``` + +Currently this will parse a tuple `(Int, Substring, Bool)` from the input, and we can `.map` on +that to turn it into a `User`: + +```swift +let user = Parse { + Int.parser() + "," + Prefix { $0 != "," } + "," + Bool.parser() +} +.map { User(id: $0, name: String($1), isAdmin: $2) } +``` + +To make the data we are parsing to more prominent, we can instead pass the transform closure as the +first argument to `Parse`: + +```swift +let user = Parse { + User(id: $0, name: String($1), isAdmin: $2) +} with: { + Int.parser() + "," + Prefix { $0 != "," } + "," + Bool.parser() +} +``` + +Or we can pass the `User` initializer to `Parse` in a point-free style by first transforming the +`Prefix` parser's output from a `Substring` to a `String`: + +```swift +let user = Parse(User.init(id:name:isAdmin:)) { + Int.parser() + "," + Prefix { $0 != "," }.map(String.init) + "," + Bool.parser() +} +``` + +That is enough to parse a single user from the input string, leaving behind a newline and the final +two users: + +```swift +try user.parse(&input) // User(id: 1, name: "Blob", isAdmin: true) +input // "\n2,Blob Jr.,false\n3,Blob Sr.,true" +``` + +To parse multiple users from the input we can use the `Many` parser to run the user parser many +times: + +```swift +let users = Many { + user +} separator: { + "\n" +} + +try users.parse(&input) // [User(id: 1, name: "Blob", isAdmin: true), ...] +input // "" +``` + +Now this parser can process an entire document of users, and the code is simpler and more +straightforward than the version that uses `.split` and `.compactMap`. + +Even better, it's more performant. We've written [benchmarks][benchmarks-readme] for these two +styles of parsing, and the `.split`-style of parsing is more than twice as slow: + +``` +name time std iterations +------------------------------------------------------------------ +README Example.Parser: Substring 3426.000 ns ± 63.40 % 385395 +README Example.Ad hoc 7631.000 ns ± 47.01 % 169332 +``` + +Further, if you are willing write your parsers against `UTF8View` instead of `Substring`, you can +eke out even more performance, more than doubling the speed: + +``` +name time std iterations +------------------------------------------------------------------ +README Example.Parser: Substring 3693.000 ns ± 81.76 % 349763 +README Example.Parser: UTF8 1272.000 ns ± 128.16 % 999150 +README Example.Ad hoc 8504.000 ns ± 59.59 % 151417 +``` + +See the article for more info on how to write parsers against different +string abstraction levels. + +We can also compare these times to a tool that Apple's Foundation gives us: `Scanner`. It's a type +that allows you to consume from the beginning of strings in order to produce values, and provides +a nicer API than using `.split`: + +```swift +var users: [User] = [] +while scanner.currentIndex != input.endIndex { + guard + let id = scanner.scanInt(), + let _ = scanner.scanString(","), + let name = scanner.scanUpToString(","), + let _ = scanner.scanString(","), + let isAdmin = scanner.scanBool() + else { break } + + users.append(User(id: id, name: name, isAdmin: isAdmin)) + _ = scanner.scanString("\n") +} +``` + +However, the `Scanner` style of parsing is more than 5 times as slow as the substring parser written +written above, and more than 15 times slower than the UTF-8 parser: + +``` +name time std iterations +------------------------------------------------------------------- +README Example.Parser: Substring 3481.000 ns ± 65.04 % 376525 +README Example.Parser: UTF8 1207.000 ns ± 110.96 % 1000000 +README Example.Ad hoc 8029.000 ns ± 44.44 % 163719 +README Example.Scanner 19786.000 ns ± 35.26 % 62125 +``` + +Not only are parsers built with the library more succinct and many times more performant than ad hoc +parsers, but they can also be easier to evolve to accommodate more features. For example, right now +our parser does not work correctly when the user's name contains a comma, such as "Blob, Esq.": + +```swift +try user.parse("1,Blob, Esq.,true") + +// error: unexpected input +// --> input:1:8 +// 1 | 1,Blob, Esq.,true +// | ^ expected "true" or "false" +``` + +The problem is that we are using the comma as a reserved identifier for delineating between fields, +and so a field cannot contain a comma. We can enhance the CSV format to allow for quoting fields +so that they can contain quotes: + +``` +1,"Blob, Esq.",true +``` + +To parse quoted fields we can first try parsing a quote, then everything up to the next quote, and +then the trailing quote: + +```swift +let quotedField = Parse { + "\"" + Prefix { $0 != "\"" } + "\"" +} +``` + +And then to parse a field, in general, we can first try parsing a quoted field, and if that fails we +will just take everything until the next comma. We can do this using the ``OneOf`` parser, which +allows us to run multiple parsers on the same input, and it will take the first that succeeds: + +```swift +let field = OneOf { + quotedField + Prefix { $0 != "," } +} +.map(String.init) +``` + +We can use this parser in the `user` parser, and now it properly handles quoted and non-quoted +fields: + +```swift +let user = Parse(User.init) { + Int.parser() + "," + field + "," + Bool.parser() +} + +try user.parse("1,\"Blob, Esq.\",true") // User(id: 1, name: "Blob, Esq.", admin: true) +``` + +It was quite straightforward to improve the `user` parser to handle quoted fields. Doing the same +with our ad hoc `split`/`compactMap` parser, and even the `Scanner`-based parser, would be a lot +more difficult. + +That's the basics of parsing a simple string format, but there's a lot more operators and tricks to +learn in order to performantly parse larger inputs. View the [benchmarks][benchmarks] for examples +of real-life parsing scenarios. + +[benchmarks-readme]: https://github.com/pointfreeco/swift-parsing/blob/main/Sources/swift-parsing-benchmark/ReadmeExample.swift +[benchmarks]: https://github.com/pointfreeco/swift-parsing/tree/main/Sources/swift-parsing-benchmark diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Bool.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Bool.md new file mode 100644 index 0000000000..c82b31103e --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Bool.md @@ -0,0 +1,69 @@ +# Bool + +A parser that consumes a Boolean value from the beginning of a string. + +This parser only recognizes the literal `"true"` and `"false"` sequence of characters: + +```swift +// Parses "true": +var input = "true Hello"[...] +try Bool.parser().parse(&input) // true +input // " Hello" + +// Parses "false": +input = "false Hello"[...] +try Bool.parser().parse(&input) // false +input // " Hello" + +// Otherwise fails: +input = "1 Hello"[...] +try Bool.parser().parse(&input) + +// error: unexpected input +// --> input:1:1 +// 1 | 1 Hello +// ^ expected "true" or "false" +``` + +The `Bool.parser()` method is overloaded to work on a variety of string representations in order +to be as efficient as possible, including `Substring`, `UTF8View`, and more general collections of +UTF-8 code units (see for more info). + +Typically Swift can choose the correct overload by using type inference based on what other parsers +you are combining `Bool.parser()` with. For example, if you use `Bool.parser()` with a +`Substring` parser, say the literal `","` parser (see for more information), Swift +will choose the overload that works on substrings: + +```swift +let parser = Parse { + Bool.parser() + "," + Bool.parser() +} + +try parser.parse("true,false") // (true, false) +``` + +On the other hand, if `Bool.parser()` is used in a context where the input type cannot be inferred, +then you will get an compiler error: + +```swift +let parser = Parse { + Bool.parser() + Bool.parser() // 🛑 Ambiguous use of 'parser(of:)' +} + +try parser.parse("truefalse") +``` + +To fix this you can force one of the boolean parsers to be the `Substring` parser, and then the +other will figure it out via type inference: + +```swift +let parser = Parse { + Bool.parser(of: Substring.self) + Bool.parser() // ✅ +} + +try parser.parse("truefalse") +``` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/CaseIterable.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/CaseIterable.md new file mode 100644 index 0000000000..120687a49b --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/CaseIterable.md @@ -0,0 +1,73 @@ +# CaseIterable + +A parser that consumes a case-iterable, raw representable value from the beginning of a string. + +Given a type that conforms to `CaseIterable` and `RawRepresentable` with a `RawValue` of `String` +or `Int`, we can incrementally parse a value of it. + +Notably, raw enumerations that conform to `CaseIterable` meet this criteria, so cases of the +following type can be parsed with no extra work: + +```swift +enum Role: String, CaseIterable { + case admin + case guest + case member +} + +try Parse { + Int.parser() + "," + Role.parser() +} +.parse("123,member") // (123, .member) +``` + +This also works with raw enumerations that are backed by integers: + +```swift +enum Role: Int, CaseIterable { + case admin = 1 + case guest = 2 + case member = 3 +} + +try Parse { + Int.parser() + "," + Role.parser() +} +.parse("123,1") // (123, .admin) +``` + +The `parser()` method on `CaseIterable` is overloaded to work on a variety of string representations +in order to be as efficient as possible, including `Substring`, `UTF8View`, and more general +collections of UTF-8 code units (see for more info). + +Typically Swift can choose the correct overload by using type inference based on what other parsers +you are combining `parser()` with. For example, if you use `Role.parser()` with a +`Substring` parser, like the literal "," parser in the above examples, Swift +will choose the overload that works on substrings. + +On the other hand, if `Role.parser()` is used in a context where the input type cannot be inferred, +then you will get an compiler error: + +```swift +let parser = Parse { + Int.parser() + Role.parser() // 🛑 Ambiguous use of 'parser(of:)' +} + +try parser.parse("123member") +``` + +To fix this you can force one of the parsers to be the `Substring` parser, and then the +other will figure it out via type inference: + +```swift +let parser = Parse { + Int.parser(of: Substring.self) + Role.parser() +} + +try parser.parse("123member") // (123, .member) diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/CharacterSet.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/CharacterSet.md new file mode 100644 index 0000000000..f271a5e496 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/CharacterSet.md @@ -0,0 +1,14 @@ +# CharacterSet + +A parser that consumes the characters contained in a `CharacterSet` from the beginning of a string. + +For example: + +```swift +Parse { + CharacterSet.alphanumerics + CharacterSet.punctuationCharacters + CharacterSet.alphanumerics +} +.parse("Hello...World") // ("Hello", "...", "World") +``` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Float.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Float.md new file mode 100644 index 0000000000..b4a7d1422c --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Float.md @@ -0,0 +1,66 @@ +# Float + +A parser that consumes a floating-point number from the beginning of a string. + +Supports any type that conforms to `BinaryFloatingPoint` and `LosslessStringConvertible`. This +includes `Double`, `Float`, `Float16`, and `Float80`. + +Parses the same format parsed by `LosslessStringConvertible.init(_:)` on `BinaryFloatingPoint`. + +```swift +var input = "123.45 Hello world"[...] +try Double.parser().parse(&input) // 123.45 +input // " Hello world" + +input = "-123. Hello world"[...] +try Double.parser().parse(&input) // -123.0 +input // " Hello world" + + +input = "123.123E+2 Hello world"[...] +try Double.parser().parse(&input) // 12312.3 +input // " Hello world" +``` + +The `parser()` static method is overloaded to work on a variety of string representations in order +to be as efficient as possible, including `Substring`, `UTF8View`, and generally collections of +UTF-8 code units (see for more info). + +Typically Swift can choose the correct overload by using type inference based on what other parsers +you are combining `parser()` with. For example, if you use `Double.parser()` with a `Substring` +parser, say the literal `","` parser (see for more information), Swift will choose the +overload that works on substrings: + +```swift +let parser = Parse { + Double.parser() + "," + Double.parser() +} + +try parser.parse("1,-2") // (1.0, -2.0) +``` + +On the other hand, if `Double.parser()` is used in a context where the input type cannot be +inferred, then you will get an compiler error: + +```swift +let parser = Parse { + Double.parser() + Double.parser() // 🛑 Ambiguous use of 'parser(of:)' +} + +try parser.parse(".1.2") +``` + +To fix this you can force one of the double parsers to be the `Substring` parser, and then the +other will figure it out via type inference: + +```swift +let parser = Parse { + Double.parser(of: Substring.self) + Double.parser() // ✅ +} + +try parser.parse(".1.2") // (0.1, 0.2) +``` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Int.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Int.md new file mode 100644 index 0000000000..d462d43684 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/Int.md @@ -0,0 +1,84 @@ +# Int + +A parser that consumes an integer from the beginning of a string. + +Supports any type that conforms to `FixedWidthInteger`. This includes `Int`, `UInt`, `UInt8`, and +many more. + +Parses the same format parsed by `FixedWidthInteger.init(_:radix:)`. + +```swift +var input = "123 Hello world"[...] +try Int.parser().parse(&input) // 123 +input // " Hello world" + +input = "-123 Hello world" +try Int.parser().parse(&input) // -123 +input // " Hello world" +``` + +This parser fails when it does not find an integer at the beginning of the collection: + +```swift +var input = "+Hello"[...] +let number = try Int.parser().parse(&input) +// error: unexpected input +// --> input:1:2 +// 1 | +Hello +// | ^ expected integer +``` + +And it fails when the digits extracted from the beginning of the collection would cause the +integer type to overflow: + +```swift +var input = "9999999999999999999 Hello"[...] +let number = try Int.parser().parse(&input) +// error: failed to process "Int" +// --> input:1:1-19 +// 1 | 9999999999999999999 Hello +// | ^^^^^^^^^^^^^^^^^^^ overflowed 9223372036854775807 +``` + +The static `parser()` method is overloaded to work on a variety of string representations in order +to be as efficient as possible, including `Substring`, `UTF8View`, and generally collections of +UTF-8 code units (see for more info). + +Typically Swift can choose the correct overload by using type inference based on what other parsers +you are combining `parser()` with. For example, if you use `Int.parser()` with a `Substring` parser, +say the literal `","` parser (see for more information), Swift will choose the overload +that works on substrings: + +```swift +let parser = Parse { + Int.parser() + "," + Int.parser() +} + +try parser.parse("123,456") // (123, 456) +``` + +On the other hand, if `Int.parser()` is used in a context where the input type cannot be inferred, +then you will get an compiler error: + +```swift +let parser = Parse { + Int.parser() // 🛑 Ambiguous use of 'parser(of:radix:)' + Bool.parser() +} + +try parser.parse("123true") +``` + +To fix this you can force one of the parsers to be the `Substring` parser, and then the +other will figure it out via type inference: + +```swift +let parser = Parse { + Int.parser() // ✅ + Bool.parser(of: Substring.self) +} + +try parser.parse("123true") // (123, true) +``` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/String.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/String.md new file mode 100644 index 0000000000..2d7324c23a --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/String.md @@ -0,0 +1,38 @@ +# String + +A parser that consumes a string literal from the beginning of a string. + +Many of Swift's string types conform to the ``Parser`` protocol, which allows you to use string types +directly in a parser. For example, to parse two integers separated by a comma we can do: + +```swift +try Parse { + Int.parser() + "," + Int.parser() +} +.parse("123,456") // (123, 456) +``` + +The string `","` acts as a parser that consumes a comma from the beginning of an input and fails +if the input does not start with a comma. + +Swift's other string representations also conform to ``Parser``, such as `UnicodeScalarView` +and `UTF8View`. This allows you to consume strings from the beginning of an input in a more +efficient manner than is possible with `Substring` (see for more info). + +For example, we can conver the above parser to work on the level of `UTF8View`s, which is a +collection of UTF-8 code units: + +```swift +try Parse { + Int.parser() + ",".utf8 + Int.parser() +} +.parse("123,456") // (123, 456) +``` + +Here `",".utf8` is a `String.UTF8View`, which conforms to the ``Parser`` protocol. Also, by type +inference, Swift is choosing the overload of `Int.parser()` that now works on `UTF8View`s rather +than `Substring`s. See for more info. diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/UUID.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/UUID.md new file mode 100644 index 0000000000..cad158c388 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/Parsers/UUID.md @@ -0,0 +1,15 @@ +# UUID + +A parser that consumes a `UUID` value from the beginning of a string. + +For example: + +```swift +try Parse { + UUID.parser() + "," + Bool.parser() +} +.parse("deadbeef-dead-beef-dead-beefdeadbeef,true") +// (DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF, true) +``` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/StringAbstractions.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/StringAbstractions.md new file mode 100644 index 0000000000..8ba2c45550 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Articles/StringAbstractions.md @@ -0,0 +1,183 @@ +# String Abstractions + +Learn how to write parsers on different levels of string abstractions, giving you the ability to +trade performance for correctness where needed. + +## Levels of abstraction + +The parsers in the library do not work on `String`s directly, and instead operate on _views_ into a +string, such as `Substring`, `UnicodeScalarView` and `UTF8View`. Each of these types represents a +particular kind of "view" into some subset of a string, which means they are cheap to copy around, +and it makes consuming elements from the beginning and end of the string very efficient since only +their start and end index need to be mutated to point to different parts of the string. + +However, there are tradeoffs to using each type: + + * `Substring`, like `String`, is a collection of `Character`s, which are extended grapheme + clusters that most closely represents a single visual character one can see on the screen. This + type is easy to use and hides a lot of the complexities of UTF8 from you (such as multiple byte + sequences that represent the same visual character), and as such it is less efficient to use. + Its elements are variable width, which means scanning its elements is an O(n) operation. + + * `UnicodeScalarView` is a collection of unicode scalars represented by the `Unicode.Scalar` type. + Unicode scalars are 21-bit, and so not variable width like `Substring`, which makes scanning + `UnicodeScalarView`s more efficient, but at the cost of some additional complexity in the API. + + For example, complex elements that can be represented by a single `Character`, such as "🇺🇸", + are represented by multiple `Unicode.Scalar` elements, "🇺" and "🇸". When put together they + form the single extended grapheme cluster of the flag character. + + Further, some `Character`s have multiple representations as collections of unicode scalars. For + example, an "e" with an accute accent only has one visual representation, yet there are two + different sequences of unicode scalars that can represent that character: + + ```swift + Array("é".unicodeScalars) // [233] + Array("é".unicodeScalars) // [101, 769] + ``` + + You can't tell from looking at the character, but the first "é" is a single unicode scalar + called a "LATIN SMALL LETTER E WITH ACUTE" and the second "é" is two scalars, one just a plain + "e" and the second a "COMBINING ACUTE ACCENT". Importantly, these two accented e's are equal as + `Character`s but unequal as `UnicodeScalarView`s: + + ```swift + let e1 = "\u{00E9}" + let e2 = "e\u{0301}" + e1 == e2 // true + e1.unicodeScalars.elementsEqual(e2.unicodeScalars) // false + ``` + + So, when parsing on the level of `UnicodeScalarView` you have to be aware of these subtleties in + order to form a correct parser. + + * `UTF8View` is a collection of `Unicode.UTF8.CodeUnit`s, which is just a typealias for `UInt8`, + _i.e._, a single byte. This is an even lower-level representation of strings than + `UnicodeScalarView`, and scanning these collections is quite efficient, but at the cost of even + more complexity. + + For example, the non-ASCII characters described above have an even more complex representation + has UTF8 bytes: + + ```swift + Array("é".utf8) // [195, 169] + Array("é".utf8) // [101, 204, 129] + Array("🇺🇸".utf8) // [240, 159, 135, 186, 240, 159, 135, 184] + ``` + + * There's even `ArraySlice`, which is just a raw collection of bytes. This can be even more + efficient to parse than `UTF8View` because it does not require representing a valid UTF-8 + string, but then you have no guarantees that you can losslessly convert it back into a `String`. + +## Mixing and matching abstraction levels + +It is possible to plug together parsers that work on different abstraction levels so that you can +decide where you want to trade correctness for performance and vice-versa. + +For example, suppose you have an enum representing a few cities that you want to parse a string +into: + +```swift +enum City { + case losAngeles + case newYork + case sanJose +} + +let city = OneOf { + "Los Angeles".map { City.losAngeles } + "New York".map { City.newYork } + "San José".map { City.sanJose } +} +``` + +For the most part this parser could work on the level of UTF-8 because it is mostly dealing with +plain ASCII characters for which there are not multiple ways of representing the same visual +character. The only exception is "San José", which has an accented "e" that can be represented +by two different sequences of bytes. + +The `Substring` abstraction is hiding those details from us because this parser will happily parse +both representations of "San José" from a string: + +```swift +city.parse("San Jos\u{00E9}") // ✅ +city.parse("San Jose\u{0301}") // ✅ +``` + +But, if we naively convert this parser to work on the level of `UTF8View`: + +```swift +let city = OneOf { + "Los Angeles".utf8.map { City.losAngeles } + "New York".utf8.map { City.newYork } + "San José".utf8.map { City.sanJose } +} +``` + +We have accidentally introduced a bug into the parser in which it recognizes one version of +"San José", but not the other: + +```swift +city.parse("San Jos\u{00E9}".utf8) // ✅ +city.parse("San Jose\u{0301}".utf8) // ❌ +``` + +One way to fix this would be to add another case to the `OneOf` for this alternate representation +of "San José": + +```swift +let city = OneOf { + "Los Angeles".utf8.map { City.losAngeles } + "New York".utf8.map { City.newYork } + "San Jos\u{00E9}".utf8.map { City.sanJose } + "San Jose\u{0301}".utf8.map { City.sanJose } +} + +city.parse("San Jos\u{00E9}".utf8) // ✅ +city.parse("San Jose\u{0301}".utf8) // ✅ +``` + +This does work, but you are now responsible for understanding the ins and outs of UTF-8 +normalization. UTF-8 is incredibly complex and Swift does a lot of work to hide that complexity +from you. + +However, there's no need to parse everything on the level of `Substring` just because this one +parser needs to. We can parse everything on the level of `UTF8View` and then parse just "San José" +on the level of `Substring`. We do this by using the ``FromSubstring`` parser, which allows us to +temporarily leave the `UTF8View` world to work in the `Substring` world: + +```swift +let city = OneOf { + "Los Angeles".utf8.map { City.losAngeles } + "New York".utf8.map { City.newYork } + FromSubstring { "San José" }.map { City.sanJose } +} + +city.parse("San Jos\u{00E9}".utf8) // ✅ +city.parse("San Jose\u{0301}".utf8) // ✅ +``` + +This will run the "San José" parser on the level of `Substring`, meaning it will handle all the +complexities of UTF8 normalization so that we don't have to think about it. + +If we want to be _really_ pedantic we can even decide to parse only the "é" character on the +level of `Substring` and leave everything else to `UTF8View`: + +```swift +let city = OneOf { + "Los Angeles".utf8.map { City.losAngeles } + "New York".utf8.map { City.newYork } + Parse { + "San Jos".utf8 + FromSubstring { "é" } + } + .map { City.sanJose } +} + +city.parse("San Jos\u{00E9}".utf8) // ✅ +city.parse("San Jose\u{0301}".utf8) // ✅ +``` + +We don't necessarily recommend being this pedantic in general, at least not without benchmarking to +make sure it is worth it. But it does demonstrate how you can be very precise with which abstraction +levels you want to work on. diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/OneOf.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/OneOf.md new file mode 100644 index 0000000000..5277095132 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/OneOf.md @@ -0,0 +1,7 @@ +# ``Parsing/OneOf`` + +## Topics + +### Builder + +- ``OneOfBuilder`` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/Parse.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/Parse.md new file mode 100644 index 0000000000..7ab44618b1 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/Parse.md @@ -0,0 +1,7 @@ +# ``Parsing/Parse`` + +## Topics + +### Builder + +- ``ParserBuilder`` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/Parser.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/Parser.md new file mode 100644 index 0000000000..5d26068fca --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Extensions/Parser.md @@ -0,0 +1,68 @@ +# ``Parsing/Parser`` + +## Topics + +### Diving deeper + +* +* +* +* +* + +### Running a parser + +All of the ways to run a parser on an input. + +- ``parse(_:)-717qw`` +- ``parse(_:)-6h1d0`` +- ``parse(_:)-2wzcq`` + +### Common parsers + +Some of the most commonly used parsers in the library. Use these parsers with operators in order +to build complex parsers from simpler pieces. + +- +- +- +- +- +- +- +- ``Parse`` +- ``OneOf`` +- ``Many`` +- ``Prefix`` +- ``PrefixThrough`` +- ``PrefixUpTo`` +- ``Optionally`` +- ``Always`` +- ``End`` +- ``Rest`` +- ``Fail`` +- ``FromSubstring`` +- ``FromUTF8View`` +- ``FromUnicodeScalarView`` +- ``First`` +- ``Skip`` +- ``Lazy`` +- ``Newline`` +- ``Whitespace`` +- ``AnyParser`` +- ``Peek`` +- ``Not`` +- ``StartsWith`` +- ``Stream`` + +### Parser operators + +- ``map(_:)`` +- ``flatMap(_:)`` +- ``compactMap(_:)`` +- ``filter(_:)`` +- ``pipe(_:)`` +- ``pullback(_:)`` +- ``replaceError(with:)`` +- ``eraseToAnyParser()`` +- ``pipe(_:)`` diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Parsing.md b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Parsing.md new file mode 100644 index 0000000000..86c104bed2 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Documentation.docc/Parsing.md @@ -0,0 +1,106 @@ +# ``Parsing`` + +A library for turning nebulous data into well-structured data, with a focus on composition, +performance, generality, and ergonomics. + +## Additional Resources + +- [GitHub Repo](https://github.com/pointfreeco/swift-parsing/) +- [Discussions](https://github.com/pointfreeco/swift-parsing/discussions) +- [Point-Free Videos](https://www.pointfree.co/collections/parsing) + +## Overview + +Parsing with this library is performed by listing out many small parsers that describe how to +incrementally consume small bits from the beginning of an input string. For example, suppose you +have a string that holds some user data that you want to parse into an array of `User`s: + +```swift +var input = """ +1,Blob,true +2,Blob Jr.,false +3,Blob Sr.,true +""" + +struct User { + var id: Int + var name: String + var isAdmin: Bool +} +``` + +A parser can be constructed for transforming the input string into an array of users in succinct +and fluent API: + +```swift +let user = Parse(User.init) { + Int.parser() + "," + Prefix { $0 != "," }.map(String.init) + "," + Bool.parser() +} + +let users = Many { + user +} separator: { + "\n" +} terminator: { + End() +} + +try users.parse(input) // [User(id: 1, name: "Blob", isAdmin: true), ...] +``` + +This says that to parse a user we: + +* Parse and consume an integer from the beginning of the input +* then a comma +* then everything up to the next comma +* then another comma +* and finally a boolean. + +And to parse an entire array of users we: + +* Run the `user` parser many times +* between each invocation of `user` we run the separator parser to consume a newline +* and once the `user` and separator parsers have consumed all they can we run the terminator +parser to verify there is no more input to consume. + +Further, if the input is malformed, like say we mistyped one of the booleans, then the parser emits +an error that describes exactly what went wrong: + +```swift +var input = """ +1,Blob,true +2,Blob Jr.,false +3,Blob Sr.,tru +""" + +try users.parse(input) + +// error: unexpected input +// --> input:3:11 +// 3 | 3,Blob Jr,tru +// | ^ expected "true" or "false" +``` + +That's the basics of parsing a simple string format, but there are a lot more operators and tricks +to learn in order to performantly parse larger inputs. + +## Topics + +### Articles + +* +* +* +* +* + +## See Also + +The collecton of videos from [Point-Free](https://www.pointfree.co) that dive deep into the +development of the Parsing library. + +* [Point-Free Videos](https://www.pointfree.co/collections/parsing) diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Internal/Breakpoint.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Internal/Breakpoint.swift new file mode 100644 index 0000000000..f4159e4070 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Internal/Breakpoint.swift @@ -0,0 +1,34 @@ +#if canImport(Darwin) + import Darwin +#endif + +/// Raises a debug breakpoint if a debugger is attached. +@inline(__always) +@usableFromInline +func breakpoint(_ message: @autoclosure () -> String = "") { + #if canImport(Darwin) + // https://github.com/bitstadium/HockeySDK-iOS/blob/c6e8d1e940299bec0c0585b1f7b86baf3b17fc82/Classes/BITHockeyHelper.m#L346-L370 + var name: [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()] + var info: kinfo_proc = kinfo_proc() + var info_size = MemoryLayout.size + + let isDebuggerAttached = + sysctl(&name, 4, &info, &info_size, nil, 0) != -1 + && info.kp_proc.p_flag & P_TRACED != 0 + + if isDebuggerAttached { + fputs( + """ + \(message()) + + Caught debug breakpoint. Type "continue" ("c") to resume execution. + + """, + stderr + ) + raise(SIGTRAP) + } + #else + assertionFailure(message()) + #endif +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Internal/Deprecations.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Internal/Deprecations.swift new file mode 100644 index 0000000000..33ec7a80c6 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Internal/Deprecations.swift @@ -0,0 +1,4 @@ +// NB: Deprecated after 0.6.0 + +@available(*, deprecated, renamed: "Parsers.Conditional") +public typealias Conditional = Parsers.Conditional diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parser.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parser.swift new file mode 100644 index 0000000000..f97da8b7e0 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parser.swift @@ -0,0 +1,204 @@ +/// Declares a type that can incrementally parse an `Output` value from an `Input` value. +/// +/// A parser attempts to parse a nebulous piece of data, represented by the `Input` associated type, +/// into something more well-structured, represented by the `Output` associated type. The parser +/// implements the ``parse(_:)-76tcw`` method, which is handed an `inout Input`, and its job is to +/// turn this into an `Output` if possible, or throw an error if it cannot. +/// +/// The argument of the ``parse(_:)-76tcw`` function is `inout` because a parser will usually +/// consume some of the input in order to produce an output. For example, we can use an +/// `Int.parser()` parser to extract an integer from the beginning of a substring and consume that +/// portion of the string: +/// +/// ```swift +/// var input: Substring = "123 Hello world" +/// +/// try Int.parser().parse(&input) // 123 +/// input // " Hello world" +/// ``` +/// +/// Note that this parser works on `Substring` rather than `String` because substrings expose +/// efficient ways of removing characters from its beginning. Substrings are "views" into a string, +/// specified by start and end indices. Operations like `removeFirst`, `removeLast` and others can +/// be implemented efficiently on substrings because they simply move the start and end indices, +/// whereas their implementation on strings must make a copy of the string with the characters +/// removed. +@rethrows public protocol Parser { + /// The type of values this parser parses from. + associatedtype Input + + /// The type of values parsed by this parser. + associatedtype Output + + /// Attempts to parse a nebulous piece of data into something more well-structured. Typically + /// you only call this from other `Parser` conformances, not when you want to parse a concrete + /// input. + /// + /// - Parameter input: A nebulous, mutable piece of data to be incrementally parsed. + /// - Returns: A more well-structured value parsed from the given input. + func parse(_ input: inout Input) throws -> Output +} + +extension Parser { + /// Parse an input value into an output. This method is more ergonomic to use than + /// ``parse(_:)-76tcw`` because the input does not need to be inout. + /// + /// Rather than having to create a mutable input value and feed it to the ``parse(_:)-76tcw`` + /// method like this: + /// + /// ```swift + /// var input = ... + /// let output = try parser.parse(&input) + /// ``` + /// + /// You can just feed the input directly: + /// + /// ```swift + /// let output = try parser.parse(input) + /// ``` + /// + /// - Parameter input: A nebulous piece of data to be parsed. + /// - Returns: A more well-structured value parsed from the given input. + @inlinable + public func parse(_ input: Input) rethrows -> Output { + var input = input + return try self.parse(&input) + } + + /// Parse a collection into an output using a parser that works on the collection's `SubSequence`. + /// This method is more ergnomic to use than ``parse(_:)-76tcw`` because it accepts a + /// collection directly rather than its subsequence, and the input does not need to be `inout`. + /// + /// Rather than having to create a mutable subsequence value, such as a `Substring`, and feed it + /// to the ``parse(_:)-76tcw`` method like this: + /// + /// ```swift + /// var input = "123,true"[...] + /// let output = try Parse { + /// Int.parser() + /// "," + /// Bool.parser() + /// } + /// .parse(&input) // (123, true) + /// ``` + /// + /// You can just feed a plain `String` input directly: + /// + /// ```swift + /// let output = try Parse { + /// Int.parser() + /// "," + /// Bool.parser() + /// } + /// .parse("123,true") // (123, true) + /// ``` + /// + /// This method will fail if the parser does not consume the entirety of the input. + /// For example: + /// + /// ```swift + /// let output = try Parse { + /// Int.parser() + /// "," + /// Bool.parser() + /// } + /// .parse("123,true ") + /// + /// // error: unexpected input + /// // --> input:1:9 + /// // 1 | 123,true␣␣␣␣ + /// // | ^ expected end of input + /// ``` + /// + /// > Tip: If your input can have trailing whitespace that you would like to consume and discard + /// > you can do so like this: + /// > ```swift + /// > let output = try Parse { + /// > Int.parser() + /// > ",".utf8 + /// > Bool.parser() + /// > Skip { Whitespace() } + /// > } + /// > .parse("123,true ") // (123, true) + /// > ``` + /// + /// - Parameter input: A nebulous collection of data to be parsed. + /// - Returns: A more well-structured value parsed from the given input. + @inlinable + public func parse(_ input: C) rethrows -> Output + where Input == C.SubSequence { + try Parse { + self + End() + }.parse(input[...]) + } + + /// Parse a `String` into an output using a UTF-8 parser. This method is more ergnomic to use + /// than ``parse(_:)-76tcw`` because it accepts a plain string rather than a collection of + /// UTF-8 code units, and the input does not need to be `inout`. + /// + /// Rather than having to create a mutable UTF-8 value and feed it to the ``parse(_:)-76tcw`` + /// method like this: + /// + /// ```swift + /// var input = "123,true"[...].utf8 + /// let output = try Parse { + /// Int.parser() + /// ",".utf8 + /// Bool.parser() + /// } + /// .parse(&input) // (123, true) + /// ``` + /// + /// You can just feed a plain `String` input directly: + /// + /// ```swift + /// let output = try Parse { + /// Int.parser() + /// ",".utf8 + /// Bool.parser() + /// } + /// .parse("123,true") // (123, true) + /// ``` + /// + /// This method will fail if the parser does not consume the entirety of the input. + /// For example: + /// + /// ```swift + /// let output = try Parse { + /// Int.parser() + /// ",".utf8 + /// Bool.parser() + /// } + /// .parse("123,true ") + /// + /// // error: unexpected input + /// // --> input:1:9 + /// // 1 | 123,true␣␣␣␣ + /// // | ^ expected end of input + /// ``` + /// + /// > Tip: If your input can have trailing whitespace that you would like to consume and discard + /// > you can do so like this: + /// > ```swift + /// > let output = try Parse { + /// > Int.parser() + /// > ",".utf8 + /// > Bool.parser() + /// > Skip { Whitespace() } + /// > } + /// > .parse("123,true ") // (123, true) + /// > ``` + /// + /// - Parameter input: A nebulous collection of data to be parsed. + /// - Returns: A more well-structured value parsed from the given input. + @_disfavoredOverload + @inlinable + public func parse(_ input: S) rethrows -> Output + where Input == S.SubSequence.UTF8View { + try Parse { + self + End() + }.parse(input[...].utf8) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Always.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Always.swift new file mode 100644 index 0000000000..1ad8727a48 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Always.swift @@ -0,0 +1,101 @@ +/// A parser that always succeeds with the given value, and does not consume any input. +/// +/// While not very useful on its own, the `Always` parser can be helpful when combined with other +/// parsers or operators. +/// +/// When its `Output` is `Void`, it can be used as a "no-op" parser of sorts and be plugged into +/// other parser operations. For example, the ``Many`` parser can be configured with separator and +/// terminator parsers: +/// +/// ```swift +/// Many { +/// Int.parser() +/// } separator: { +/// "," +/// } terminator: { +/// End() +/// } +/// ``` +/// +/// But also exposes initializers that omit these parsers when there is no separator or terminator +/// to be parsed: +/// +/// ```swift +/// Many { +/// Prefix { $0 != "\n" } +/// "\n" +/// } +/// ``` +/// +/// To support this, `Many` plugs `Always` into each omitted parser. As a simplified +/// example: +/// +/// ```swift +/// struct Many: Parser +/// where Separator.Input == Element.Input, Terminator.Input == Element.Input { +/// ... +/// } +/// +/// extension Many where Separator == Always, Terminator == Always { +/// init(@ParserBuilder element: () -> Element) { +/// self.element = element() +/// self.separator = Always(()) +/// self.terminator = Always(()) +/// } +/// } +/// ``` +/// +/// This means the previous example is equivalent to: +/// +/// ```swift +/// Many { +/// Prefix { $0 != "\n" } +/// "\n" +/// } separator: { +/// Always(()) +/// } terminator: { +/// Always(()) +/// } +/// ``` +/// +/// > Note: While `Always` can be used as the last alternative of a ``OneOf`` to specify a default +/// > output, the resulting parser will be throwing. Instead, prefer ``Parser/replaceError(with:)``, +/// > which returns a non-throwing parser. +public struct Always: Parser { + public let output: Output + + @inlinable + public init(_ output: Output) { + self.output = output + } + + @inlinable + public func parse(_ input: inout Input) -> Output { + self.output + } + + @inlinable + public func map( + _ transform: @escaping (Output) -> NewOutput + ) -> Always { + .init(transform(self.output)) + } +} + +extension Always where Input == Substring { + @inlinable + public init(_ output: Output) { + self.output = output + } +} + +extension Always where Input == Substring.UTF8View { + @inlinable + public init(_ output: Output) { + self.output = output + } +} + +extension Parsers { + public typealias Always = SwiftTL.Always // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/AnyParser.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/AnyParser.swift new file mode 100644 index 0000000000..a1804d8dc8 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/AnyParser.swift @@ -0,0 +1,63 @@ +extension Parser { + /// Wraps this parser with a type eraser. + /// + /// This form of _type erasure_ preserves abstraction across API boundaries, such as different + /// modules. + /// + /// When you expose your composed parsers as the ``AnyParser`` type, you can change the underlying + /// implementation over time without affecting existing clients. + /// + /// Equivalent to passing `self` to `AnyParser.init(_:)`. + /// + /// - Returns: An ``AnyParser`` wrapping this publisher. + @inlinable + public func eraseToAnyParser() -> AnyParser { + .init(self) + } +} + +/// A type-erased parser of `Output` from `Input`. +/// +/// This parser forwards its ``parse(_:)`` method to an arbitrary underlying parser having the same +/// `Input` and `Output` types, hiding the specifics of the underlying ``Parser``. +/// +/// Use ``AnyParser`` to wrap a parser whose type has details you don't want to expose across API +/// boundaries, such as different modules. When you use type erasure this way, you can change the +/// underlying parser over time without affecting existing clients. +public struct AnyParser: Parser { + @usableFromInline + let parser: (inout Input) throws -> Output + + /// Creates a type-erasing parser to wrap the given parser. + /// + /// Equivalent to calling ``Parser/eraseToAnyParser()`` on the parser. + /// + /// - Parameter parser: A parser to wrap with a type eraser. + @inlinable + public init(_ parser: P) where P.Input == Input, P.Output == Output { + self.init(parser.parse) + } + + /// Creates a parser that wraps the given closure in its ``parse(_:)`` method. + /// + /// - Parameter parse: A closure that attempts to parse an output from an input. `parse` is + /// executed each time the ``parse(_:)`` method is called on the resulting parser. + @inlinable + public init(_ parse: @escaping (inout Input) throws -> Output) { + self.parser = parse + } + + @inlinable + public func parse(_ input: inout Input) throws -> Output { + try self.parser(&input) + } + + @inlinable + public func eraseToAnyParser() -> Self { + self + } +} + +extension Parsers { + public typealias AnyParser = SwiftTL.AnyParser // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Bool.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Bool.swift new file mode 100644 index 0000000000..a3897bbbb2 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Bool.swift @@ -0,0 +1,78 @@ +extension Bool { + /// A parser that consumes a Boolean value from the beginning of a collection of UTF-8 code units. + /// + /// See for more information about this parser. + /// + /// - Parameter inputType: The collection type of UTF-8 code units to parse. + /// - Returns: A parser that consumes a Boolean value from the beginning of a collection of UTF-8 + /// code units. + @inlinable + public static func parser( + of inputType: Input.Type = Input.self + ) -> Parsers.BoolParser { + .init() + } + + /// A parser that consumes a Boolean value from the beginning of a substring's UTF-8 view. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is + /// `Substring.UTF8View`. + /// + /// See for more information about this parser. + /// + /// - Parameter inputType: The `Substring.UTF8View` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a Boolean value from the beginning of a substring's UTF-8 + /// view. + @inlinable + public static func parser( + of inputType: Substring.UTF8View.Type = Substring.UTF8View.self + ) -> Parsers.BoolParser { + .init() + } + + /// A parser that consumes a Boolean value from the beginning of a substring. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is `Substring`. + /// + /// See for more information about this parser. + /// + /// - Parameter inputType: The `Substring` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a Boolean value from the beginning of a substring. + @inlinable + public static func parser( + of inputType: Substring.Type = Substring.self + ) -> FromUTF8View> { + .init { Parsers.BoolParser() } + } +} + +extension Parsers { + /// A parser that consumes a Boolean value from the beginning of a collection of UTF-8 code units. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// `Bool.parser()`, which constructs this type. + /// + /// See for more information about this parser. + public struct BoolParser: Parser + where + Input.SubSequence == Input, + Input.Element == UTF8.CodeUnit + { + @inlinable + public init() {} + + @inlinable + public func parse(_ input: inout Input) throws -> Bool { + if input.starts(with: [116, 114, 117, 101] /*"true".utf8*/) { + input.removeFirst(4) + return true + } else if input.starts(with: [102, 97, 108, 115, 101] /*"false".utf8*/) { + input.removeFirst(5) + return false + } + throw ParsingError.expectedInput("\"true\" or \"false\"", at: input) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CaseIterableRawRepresentable.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CaseIterableRawRepresentable.swift new file mode 100644 index 0000000000..1c1eec3165 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CaseIterableRawRepresentable.swift @@ -0,0 +1,143 @@ +extension CaseIterable where Self: RawRepresentable, RawValue == Int { + /// A parser that consumes a case-iterable, raw representable value from the beginning of a + /// collection of a substring. + /// + /// See for more info. + /// + /// - Parameter inputType: The `Substring` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a case-iterable, raw representable value from the beginning + /// of a substring. + @inlinable + public static func parser( + of inputType: Substring.Type = Substring.self + ) -> Parsers.CaseIterableRawRepresentableParser { + .init(toPrefix: { String($0) }, areEquivalent: ==) + } + + /// A parser that consumes a case-iterable, raw representable value from the beginning of a + /// collection of a substring's UTF-8 view. + /// + /// See for more info. + /// + /// - Parameter inputType: The `Substring.UTF8View` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a case-iterable, raw representable value from the beginning + /// of a substring's UTF-8 view. + @inlinable + public static func parser( + of inputType: Substring.UTF8View.Type = Substring.UTF8View.self + ) -> Parsers.CaseIterableRawRepresentableParser { + .init(toPrefix: { String($0).utf8 }, areEquivalent: ==) + } + + /// A parser that consumes a case-iterable, raw representable value from the beginning of a + /// collection of UTF-8 code units. + /// + /// - Parameter inputType: The collection type of UTF-8 code units to parse. + /// - Returns: A parser that consumes a case-iterable, raw representable value from the beginning + /// of a collection of UTF-8 code units. + @inlinable + public static func parser( + of inputType: Input.Type = Input.self + ) -> Parsers.CaseIterableRawRepresentableParser + where + Input.SubSequence == Input, + Input.Element == UTF8.CodeUnit + { + .init(toPrefix: { String($0).utf8 }, areEquivalent: ==) + } +} + +extension CaseIterable where Self: RawRepresentable, RawValue == String { + /// A parser that consumes a case-iterable, raw representable value from the beginning of a + /// collection of a substring. + /// + /// See for more info. + /// + /// - Parameter inputType: The `Substring` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a case-iterable, raw representable value from the beginning + /// of a substring. + @inlinable + public static func parser( + of inputType: Substring.Type = Substring.self + ) -> Parsers.CaseIterableRawRepresentableParser { + .init(toPrefix: { $0 }, areEquivalent: ==) + } + + /// A parser that consumes a case-iterable, raw representable value from the beginning of a + /// collection of a substring's UTF-8 view. + /// + /// See for more info. + /// + /// - Parameter inputType: The `Substring.UTF8View` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a case-iterable, raw representable value from the beginning + /// of a substring's UTF-8 view. + @inlinable + public static func parser( + of inputType: Substring.UTF8View.Type = Substring.UTF8View.self + ) -> Parsers.CaseIterableRawRepresentableParser { + .init(toPrefix: { $0.utf8 }, areEquivalent: ==) + } + + /// A parser that consumes a case-iterable, raw representable value from the beginning of a + /// collection of UTF-8 code units. + /// + /// - Parameter inputType: The collection type of UTF-8 code units to parse. + /// - Returns: A parser that consumes a case-iterable, raw representable value from the beginning + /// of a collection of UTF-8 code units. + @inlinable + public static func parser( + of inputType: Input.Type = Input.self + ) -> Parsers.CaseIterableRawRepresentableParser + where + Input.SubSequence == Input, + Input.Element == UTF8.CodeUnit + { + .init(toPrefix: { $0.utf8 }, areEquivalent: ==) + } +} + +extension Parsers { + public struct CaseIterableRawRepresentableParser< + Input: Collection, Output: CaseIterable & RawRepresentable, Prefix: Collection + >: Parser + where + Input.SubSequence == Input, + Output.RawValue: Comparable, + Prefix.Element == Input.Element + { + @usableFromInline + let cases: [(case: Output, prefix: Prefix, count: Int)] + + @usableFromInline + let areEquivalent: (Input.Element, Input.Element) -> Bool + + @usableFromInline + init( + toPrefix: @escaping (Output.RawValue) -> Prefix, + areEquivalent: @escaping (Input.Element, Input.Element) -> Bool + ) { + self.areEquivalent = areEquivalent + self.cases = Output.allCases + .map { + let prefix = toPrefix($0.rawValue) + return ($0, prefix, prefix.count) + } + .sorted(by: { $0.count > $1.count }) + } + + @inlinable + public func parse(_ input: inout Input) throws -> Output { + for (`case`, prefix, count) in self.cases { + if input.starts(with: prefix, by: self.areEquivalent) { + input.removeFirst(count) + return `case` + } + } + throw ParsingError.expectedInput("case of \"\(Output.self)\"", at: input) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CharacterSet.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CharacterSet.swift new file mode 100644 index 0000000000..26e4a5cff0 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CharacterSet.swift @@ -0,0 +1,10 @@ +import Foundation + +extension CharacterSet: Parser { + @inlinable + public func parse(_ input: inout Substring) -> Substring { + let output = input.unicodeScalars.prefix(while: self.contains) + input.unicodeScalars.removeFirst(output.count) + return Substring(output) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CompactMap.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CompactMap.swift new file mode 100644 index 0000000000..430682bb83 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/CompactMap.swift @@ -0,0 +1,78 @@ +extension Parser { + /// Returns a parser that outputs the non-`nil` result of calling the given closure with the + /// output of this parser. + /// + /// This method is similar to `Sequence.compactMap` in the Swift standard library, as well as + /// `Publisher.compactMap` in the Combine framework. + /// + /// ```swift + /// let evenParser = Int.parser().compactMap { $0.isMultiple(of: 2) } + /// + /// var input = "124 hello world"[...] + /// try evenParser.parse(&input) // 124 + /// input // " hello world" + /// ``` + /// + /// This parser fails when the provided closure returns `nil`. For example, the following parser tries + /// to convert two characters into a hex digit, but fails to do so because `"GG"` is not a valid + /// hex number: + /// + /// ```swift + /// var input = "GG0000"[...] + /// let hex = try Prefix(2).compactMap { Int(String($0), radix: 16) }.parse(&input) + /// // error: failed to process "Int" from "GG" + /// // --> input:1:1-2 + /// // 1 | GG0000 + /// // | ^^ + /// ``` + /// + /// - Parameter transform: A closure that accepts output of this parser as its argument and + /// returns an optional value. + /// - Returns: A parser that outputs the non-`nil` result of calling the given transformation + /// with the output of this parser. + @_disfavoredOverload + @inlinable + public func compactMap( + _ transform: @escaping (Output) -> NewOutput? + ) -> Parsers.CompactMap { + .init(upstream: self, transform: transform) + } +} + +extension Parsers { + /// A parser that outputs the non-`nil` result of calling the given transformation with the output + /// of its upstream parser. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the ``Parser/compactMap(_:)`` operation, which constructs this type. + public struct CompactMap: Parser { + public let upstream: Upstream + public let transform: (Upstream.Output) -> Output? + + @inlinable + public init( + upstream: Upstream, + transform: @escaping (Upstream.Output) -> Output? + ) { + self.upstream = upstream + self.transform = transform + } + + @inlinable + public func parse(_ input: inout Upstream.Input) throws -> Output { + let original = input + let output = try self.upstream.parse(&input) + guard let newOutput = self.transform(output) + else { + throw ParsingError.failed( + summary: """ + failed to process "\(Output.self)" from \(formatValue(output)) + """, + from: original, + to: input + ) + } + return newOutput + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Conditional.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Conditional.swift new file mode 100644 index 0000000000..2eb505037d --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Conditional.swift @@ -0,0 +1,49 @@ +extension Parsers { + /// A parser that can parse output from two types of parsers. + /// + /// This parser is useful for situations where you want to run one of two different parsers based on + /// a condition, which typically would force you to perform ``Parser/eraseToAnyParser()`` and incur + /// a performance penalty. + /// + /// For example, you can use this parser in a ``Parser/flatMap(_:)`` operation to use the parsed + /// output to determine what parser to run next: + /// + /// ```swift + /// versionParser.flatMap { version in + /// version == "2.0" + /// ? Conditional.first(V2Parser()) + /// : Conditional.second(LegacyParser()) + /// } + /// ``` + /// + /// You won't typically construct this parser directly, but instead will use standard `if`-`else` + /// statements in a parser builder to automatically build conditional parsers: + /// + /// ```swift + /// versionParser.flatMap { version in + /// if version == "2.0" { + /// V2Parser() + /// } else { + /// LegacyParser() + /// } + /// } + /// ``` + public enum Conditional: Parser + where + First.Input == Second.Input, + First.Output == Second.Output + { + case first(First) + case second(Second) + + @inlinable + public func parse(_ input: inout First.Input) rethrows -> First.Output { + switch self { + case let .first(first): + return try first.parse(&input) + case let .second(second): + return try second.parse(&input) + } + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/End.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/End.swift new file mode 100644 index 0000000000..6c3c051231 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/End.swift @@ -0,0 +1,54 @@ +/// A parser that succeeds if the input is empty, and fails otherwise. +/// +/// Useful as a final parser in a long sequence of parsers to guarantee that all input has been +/// consumed. +/// +/// ```swift +/// let parser = Parse { +/// "Hello, " +/// Prefix { $0 != "!" } +/// "!" +/// End() // NB: All input should be consumed. +/// } +/// +/// var input = "Hello, Blob!"[...] +/// try parser.parse(&input) // "Blob" +/// ``` +/// +/// This parser will fail if there are input elements that have not been consumed: +/// +/// ```swift +/// input = "Hello, Blob!!" +/// try parser.parse(&input) +/// // error: unexpected input +/// // --> input:1:13 +/// // 1 | Hello, Blob!! +/// // | ^ expected end of input +/// ``` +public struct End: Parser { + @inlinable + public init() {} + + @inlinable + public func parse(_ input: inout Input) throws { + guard input.isEmpty else { + throw ParsingError.expectedInput("end of input", at: input) + } + } +} + +extension End where Input == Substring { + @_disfavoredOverload + @inlinable + public init() {} +} + +/*extension End where Input == Substring.UTF8View { + @_disfavoredOverload + @inlinable + public init() {} +}*/ + +extension Parsers { + public typealias End = SwiftTL.End // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Fail.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Fail.swift new file mode 100644 index 0000000000..b661a22b3a --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Fail.swift @@ -0,0 +1,72 @@ +/// A parser that always fails, no matter the input. +/// +/// While not very useful on its own, this parser can be helpful when combined with other parsers or +/// operators. +/// +/// For example, it can be used to conditionally causing parsing to fail when used with +/// ``Parser/flatMap(_:)``: +/// +/// ```swift +/// struct OddFailure: Error {} +/// +/// let evens = Int.parser().flatMap { +/// if $0.isMultiple(of: 2) { +/// Always($0) +/// } else { +/// Fail(throwing: OddFailure()) +/// } +/// } +/// +/// try evens.parse("42") // 42 +/// +/// try evens.parse("123") +/// // error: OddFailure() +/// // --> input:1:1-3 +/// // 1 | 123 +/// // | ^^^ +/// ``` +public struct Fail: Parser { + @usableFromInline + let error: Error + + /// Creates a parser that throws an error when it runs. + /// + /// - Parameter error: An error to throw when the parser is run. + @inlinable + public init(throwing error: Error) { + self.error = error + } + + @inlinable + public func parse(_ input: inout Input) throws -> Output { + switch self.error { + case is ParsingError: + throw self.error + default: + throw ParsingError.wrap(self.error, at: input) + } + } +} + +extension Fail { + /// Creates a parser that throws an error when it runs. + @inlinable + public init() { + self.init(throwing: DefaultError()) + } + + @usableFromInline + struct DefaultError: Error, CustomDebugStringConvertible { + @usableFromInline + init() {} + + @usableFromInline + var debugDescription: String { + "failed" + } + } +} + +extension Parsers { + public typealias Fail = SwiftTL.Fail // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Filter.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Filter.swift new file mode 100644 index 0000000000..3be532821b --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Filter.swift @@ -0,0 +1,61 @@ +extension Parser { + /// Returns a parser that filters output from this parser when its output does not satisfy the + /// given predicate. + /// + /// This method is similar to `Sequence.filter` in the Swift standard library, as well as + /// `Publisher.filter` in the Combine framework. + /// + /// This parser fails if the predicate is not satisfied on the output of the upstream parser. For example, + /// the following parser consumes only even integers and so fails when an odd integer is used: + /// + /// ```swift + /// var input = "43 Hello, world!"[...] + /// let number = try Int.parser().filter { $0.isMultiple(of: 2) }.parse(&input) + /// // error: processed value 43 failed to satisfy predicate + /// // --> input:1:1-2 + /// // 1 | 43 Hello, world! + /// // | ^^ processed input + /// ``` + /// + /// - Parameter predicate: A closure that takes an output from this parser and returns a Boolean + /// value indicating whether the output should be returned. + /// - Returns: A parser that filters its output. + @_disfavoredOverload + @inlinable + public func filter(_ predicate: @escaping (Output) -> Bool) -> Parsers.Filter { + .init(upstream: self, predicate: predicate) + } +} + +extension Parsers { + /// A parser that filters the output of an upstream parser when it does not satisfy a predicate. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the ``Parser/filter(_:)`` operation, which constructs this type. + public struct Filter: Parser { + public let upstream: Upstream + public let predicate: (Upstream.Output) -> Bool + + @inlinable + public init(upstream: Upstream, predicate: @escaping (Upstream.Output) -> Bool) { + self.upstream = upstream + self.predicate = predicate + } + + @inlinable + public func parse(_ input: inout Upstream.Input) throws -> Upstream.Output { + let original = input + let output = try self.upstream.parse(&input) + guard self.predicate(output) + else { + throw ParsingError.failed( + summary: "processed value \(formatValue(output)) failed to satisfy predicate", + label: "processed input", + from: original, + to: input + ) + } + return output + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/First.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/First.swift new file mode 100644 index 0000000000..34713e73fb --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/First.swift @@ -0,0 +1,52 @@ +/// A parser that consumes the first element from a collection. +/// +/// This parser is named after `Sequence.first`, and attempts to parse the first element from a +/// collection of input by calling this property under the hood. +/// +/// For example, it can parse the leading character off a substring: +/// +/// ```swift +/// var input = "Hello"[...] +/// try First().parse(&input) // "H" +/// input // "ello" +/// ``` +/// +/// This parser fails if the input collection is empty: +/// +/// ```swift +/// input = "" +/// try First().parse(&input) +/// // error: unexpected input +/// // --> input:1:1 +/// // 1 | +/// // | ^ expected element +/// ``` +public struct First: Parser where Input.SubSequence == Input { + @inlinable + public init() {} + + @inlinable + public func parse(_ input: inout Input) throws -> Input.Element { + guard let first = input.first else { + throw ParsingError.expectedInput("element", at: input) + } + input.removeFirst() + return first + } +} + +extension First where Input == Substring { + @_disfavoredOverload + @inlinable + public init() {} +} + +extension First where Input == Substring.UTF8View { + @_disfavoredOverload + @inlinable + public init() {} +} + +extension Parsers { + public typealias First = SwiftTL.First // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FlatMap.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FlatMap.swift new file mode 100644 index 0000000000..c64ef1480b --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FlatMap.swift @@ -0,0 +1,52 @@ +extension Parser { + /// Returns a parser that transforms the output of this parser into a new parser. + /// + /// This method is similar to `Sequence.flatMap`, `Optional.flatMap`, and `Result.flatMap` in the + /// Swift standard library, as well as `Publisher.flatMap` in the Combine framework. + /// + /// - Parameter transform: A closure that transforms values of this parser's output and returns a + /// new parser. + /// - Returns: A parser that transforms output from an upstream parser into a new parser. + @inlinable + public func flatMap( + @ParserBuilder _ transform: @escaping (Output) -> NewParser + ) -> Parsers.FlatMap { + .init(upstream: self, transform: transform) + } +} + +extension Parsers { + /// A parser that transforms the output of another parser into a new parser. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the ``Parser/flatMap(_:)`` operation, which constructs this type. + public struct FlatMap: Parser + where NewParser.Input == Upstream.Input { + public let upstream: Upstream + public let transform: (Upstream.Output) -> NewParser + + @inlinable + public init(upstream: Upstream, transform: @escaping (Upstream.Output) -> NewParser) { + self.upstream = upstream + self.transform = transform + } + + @inlinable + public func parse(_ input: inout Upstream.Input) rethrows -> NewParser.Output { + let original = input + do { + return try self.transform(self.upstream.parse(&input)).parse(&input) + } catch let ParsingError.failed(reason, context) { + throw ParsingError.failed( + reason, + .init( + originalInput: original, + remainingInput: input, + debugDescription: context.debugDescription, + underlyingError: ParsingError.failed(reason, context) + ) + ) + } + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Float.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Float.swift new file mode 100644 index 0000000000..1b475dc7eb --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Float.swift @@ -0,0 +1,172 @@ +extension BinaryFloatingPoint where Self: LosslessStringConvertible { + /// A parser that consumes a floating-point number from the beginning of a collection of UTF-8 + /// code units. + /// + /// See for more information about this parser. + /// + /// - Parameter inputType: The collection type of UTF-8 code units to parse. + /// - Returns: A parser that consumes a floating-point number from the beginning of a collection + /// of UTF-8 code units. + @inlinable + public static func parser( + of inputType: Input.Type = Input.self + ) -> Parsers.FloatParser { + .init() + } + + /// A parser that consumes a floating-point number from the beginning of a substring's UTF-8 view. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is + /// `Substring.UTF8View`. + /// + /// See for more information about this parser. + /// + /// - Parameter inputType: The `Substring.UTF8View` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a floating-point number from the beginning of a substring's + /// UTF-8 view. + @_disfavoredOverload + @inlinable + public static func parser( + of inputType: Substring.UTF8View.Type = Substring.UTF8View.self + ) -> Parsers.FloatParser { + .init() + } + + /// A parser that consumes a floating-point number from the beginning of a substring. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is `Substring`. + /// + /// See for more information about this parser. + /// + /// - Parameter inputType: The `Substring` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a floating-point number from the beginning of a substring. + @_disfavoredOverload + @inlinable + public static func parser( + of inputType: Substring.Type = Substring.self + ) -> FromUTF8View> { + .init { Parsers.FloatParser() } + } +} + +extension Parsers { + /// A parser that consumes a floating-point number from the beginning of a collection of UTF-8 + /// code units. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the static `parser()` method on the `BinaryFloatingPoint` of your choice, e.g., + /// `Double.parser()`, `Float80.parser()`, etc., all of which construct this type. + /// + /// See for more information about this parser. + public struct FloatParser: Parser + where + Input.SubSequence == Input, + Input.Element == UTF8.CodeUnit, + Output: LosslessStringConvertible + { + @inlinable + public init() {} + + @inlinable + public func parse(_ input: inout Input) throws -> Output { + let original = input + let s = input.parseFloat() + guard let n = Output(String(decoding: s, as: UTF8.self)) + else { + throw ParsingError.expectedInput("\(Output.self)".lowercased(), from: original, to: input) + } + return n + } + } +} + +extension UTF8.CodeUnit { + @usableFromInline + var isDigit: Bool { + (.init(ascii: "0") ... .init(ascii: "9")).contains(self) + } + + @usableFromInline + var isHexDigit: Bool { + (.init(ascii: "0") ... .init(ascii: "9")).contains(self) + || (.init(ascii: "a") ... .init(ascii: "f")).contains(self) + || (.init(ascii: "A") ... .init(ascii: "F")).contains(self) + } + + @usableFromInline + var isSign: Bool { + self == .init(ascii: "-") || self == .init(ascii: "+") + } +} + +extension Collection where SubSequence == Self, Element == UTF8.CodeUnit { + @inlinable + @inline(__always) + mutating func parseFloat() -> SubSequence { + let original = self + if self.first?.isSign == true { + self.removeFirst() + } + if self.first == .init(ascii: "0") + && (self.dropFirst().first == .init(ascii: "x") + || self.dropFirst().first == .init(ascii: "X")) + { + self.removeFirst(2) + let integer = self.prefix(while: { $0.isHexDigit }) + self.removeFirst(integer.count) + if self.first == .init(ascii: ".") { + let fractional = + self + .dropFirst() + .prefix(while: { $0.isHexDigit }) + self.removeFirst(1 + fractional.count) + } + if self.first == .init(ascii: "p") || self.first == .init(ascii: "P") { + var n = 1 + if self.dropFirst().first?.isSign == true { n += 1 } + let exponent = + self + .dropFirst(n) + .prefix(while: { $0.isHexDigit }) + guard !exponent.isEmpty else { return original[..(_ other: S) -> Bool + where S.Element == Element { + self.elementsEqual(other, by: { $0 == $1 || $0 + 32 == $1 }) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromSubstring.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromSubstring.swift new file mode 100644 index 0000000000..0101fb1018 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromSubstring.swift @@ -0,0 +1,72 @@ +/// A parser that transforms a parser on `Substring` into a parser on another view. +/// +/// The `FromSubstring` operator allows you to mix and match representation levels of strings +/// so that you can maximize how much you parse on the faster, but more complex, lower level +/// representations and then switch to slower, but safer, higher level representations for +/// when you need that power. +/// +/// For example, to parse "café" as a collection of UTF8 code units you must be careful to parse +/// both representations of "é": +/// +/// ```swift +/// OneOf { +/// "caf\u{00E9}".utf8 // LATIN SMALL LETTER E WITH ACUTE +/// "cafe\u{0301}".utf8 // E + COMBINING ACUTE ACCENT +/// } +/// ``` +/// +/// Alternatively, you can parse the ASCII characters of "caf" as UTF8 code units, and then +/// switch to the higher level substring representation to parse "é" so that you don't have +/// to worry about UTF8 normalization: +/// +/// ```swift +/// Parse { +/// "caf".utf8 +/// +/// // Parse any recognized "é" character, including: +/// // - LATIN SMALL LETTER E WITH ACUTE ("\u{00E9}") +/// // - E + COMBINING ACUTE ACCENT ("e\u{0301}") +/// FromSubstring { "é" } +/// } +/// ``` +public struct FromSubstring: Parser +where SubstringParser.Input == Substring { + public let substringParser: SubstringParser + public let toSubstring: (Input) -> Substring + public let fromSubstring: (Substring) -> Input + + @inlinable + public func parse(_ input: inout Input) rethrows -> SubstringParser.Output { + var substring = self.toSubstring(input) + defer { input = self.fromSubstring(substring) } + return try self.substringParser.parse(&substring) + } +} + +extension FromSubstring where Input == ArraySlice { + @inlinable + public init(@ParserBuilder _ build: () -> SubstringParser) { + self.substringParser = build() + self.toSubstring = { Substring(decoding: $0, as: UTF8.self) } + self.fromSubstring = { ArraySlice($0.utf8) } + } +} + +extension FromSubstring where Input == Substring.UnicodeScalarView { + @_disfavoredOverload + @inlinable + public init(@ParserBuilder _ build: () -> SubstringParser) { + self.substringParser = build() + self.toSubstring = Substring.init + self.fromSubstring = \.unicodeScalars + } +} + +extension FromSubstring where Input == Substring.UTF8View { + @inlinable + public init(@ParserBuilder _ build: () -> SubstringParser) { + self.substringParser = build() + self.toSubstring = Substring.init + self.fromSubstring = \.utf8 + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromUTF8View.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromUTF8View.swift new file mode 100644 index 0000000000..e5d05ed571 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromUTF8View.swift @@ -0,0 +1,32 @@ +public struct FromUTF8View: Parser +where UTF8Parser.Input == Substring.UTF8View { + public let utf8Parser: UTF8Parser + public let toUTF8: (Input) -> Substring.UTF8View + public let fromUTF8: (Substring.UTF8View) -> Input + + @inlinable + public func parse(_ input: inout Input) rethrows -> UTF8Parser.Output { + var utf8 = self.toUTF8(input) + defer { input = self.fromUTF8(utf8) } + return try self.utf8Parser.parse(&utf8) + } +} + +extension FromUTF8View where Input == Substring { + @inlinable + public init(@ParserBuilder _ build: () -> UTF8Parser) { + self.utf8Parser = build() + self.toUTF8 = \.utf8 + self.fromUTF8 = Substring.init + } +} + +extension FromUTF8View where Input == Substring.UnicodeScalarView { + @_disfavoredOverload + @inlinable + public init(@ParserBuilder _ build: () -> UTF8Parser) { + self.utf8Parser = build() + self.toUTF8 = { Substring($0).utf8 } + self.fromUTF8 = { Substring($0).unicodeScalars } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromUnicodeScalarView.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromUnicodeScalarView.swift new file mode 100644 index 0000000000..4662d25a66 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/FromUnicodeScalarView.swift @@ -0,0 +1,42 @@ +/// A parser that transforms a parser on `Substring.UnicodeScalarView` into a parser on another +/// view. +public struct FromUnicodeScalarView: Parser +where UnicodeScalarsParser.Input == Substring.UnicodeScalarView { + public let unicodeScalarsParser: UnicodeScalarsParser + public let toUnicodeScalars: (Input) -> Substring.UnicodeScalarView + public let fromUnicodeScalars: (Substring.UnicodeScalarView) -> Input + + @inlinable + public func parse(_ input: inout Input) rethrows -> UnicodeScalarsParser.Output { + var unicodeScalars = self.toUnicodeScalars(input) + defer { input = self.fromUnicodeScalars(unicodeScalars) } + return try self.unicodeScalarsParser.parse(&unicodeScalars) + } +} + +extension FromUnicodeScalarView where Input == ArraySlice { + @inlinable + public init(@ParserBuilder _ build: () -> UnicodeScalarsParser) { + self.unicodeScalarsParser = build() + self.toUnicodeScalars = { Substring(decoding: $0, as: UTF8.self).unicodeScalars } + self.fromUnicodeScalars = { ArraySlice(Substring($0).utf8) } + } +} + +extension FromUnicodeScalarView where Input == Substring { + @inlinable + public init(@ParserBuilder _ build: () -> UnicodeScalarsParser) { + self.unicodeScalarsParser = build() + self.toUnicodeScalars = \.unicodeScalars + self.fromUnicodeScalars = Substring.init + } +} + +extension FromUnicodeScalarView where Input == Substring.UTF8View { + @inlinable + public init(@ParserBuilder _ build: () -> UnicodeScalarsParser) { + self.unicodeScalarsParser = build() + self.toUnicodeScalars = { Substring($0).unicodeScalars } + self.fromUnicodeScalars = { Substring($0).utf8 } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Int.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Int.swift new file mode 100644 index 0000000000..7f93998e1f --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Int.swift @@ -0,0 +1,163 @@ +extension FixedWidthInteger { + /// A parser that consumes an integer (with an optional leading `+` or `-` sign for signed integer + /// types) from the beginning of a collection of UTF-8 code units. + /// + /// See for more information about this parser. + /// + /// - Parameters: + /// - inputType: The collection type of UTF-8 code units to parse. + /// - radix: The radix, or base, to use for converting text to an integer value. `radix` must be + /// in the range `2...36`. + /// - Returns: A parser that consumes an integer from the beginning of a collection of UTF-8 code + /// units. + @inlinable + public static func parser( + of inputType: Input.Type = Input.self, + radix: Int = 10 + ) -> Parsers.IntParser { + .init(radix: radix) + } + + /// A parser that consumes an integer (with an optional leading `+` or `-` sign for signed integer + /// types) from the beginning of a collection of UTF-8 code units. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is + /// `Substring.UTF8View`. + /// + /// See for more information about this parser. + /// + /// - Parameters: + /// - inputType: The `Substring.UTF8View` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - radix: The radix, or base, to use for converting text to an integer value. `radix` must be + /// in the range `2...36`. + /// - Returns: A parser that consumes an integer from the beginning of a substring's UTF-8 view. + @_disfavoredOverload + @inlinable + public static func parser( + of inputType: Substring.UTF8View.Type = Substring.UTF8View.self, + radix: Int = 10 + ) -> Parsers.IntParser { + .init(radix: radix) + } + + /// A parser that consumes an integer (with an optional leading `+` or `-` sign for signed integer + /// types) from the beginning of a collection of UTF-8 code units. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is `Substring`. + /// + /// See for more information about this parser. + /// + /// - Parameters: + /// - inputType: The `Substring` type. This parameter is included to mirror the interface that + /// parses any collection of UTF-8 code units. + /// - radix: The radix, or base, to use for converting text to an integer value. `radix` must be + /// in the range `2...36`. + /// - Returns: A parser that consumes an integer from the beginning of a substring. + @_disfavoredOverload + @inlinable + public static func parser( + of inputType: Substring.Type = Substring.self, + radix: Int = 10 + ) -> FromUTF8View> { + .init { Parsers.IntParser(radix: radix) } + } +} + +extension Parsers { + /// A parser that consumes an integer (with an optional leading `+` or `-` sign for signed integer + /// types) from the beginning of a collection of UTF8 code units. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the static `parser()` method on the `FixedWidthInteger` of your choice, e.g. `Int.parser()`, + /// `UInt8.parser()`, etc., all of which construct this type. + /// + /// See for more information about this parser. + public struct IntParser: Parser + where + Input.SubSequence == Input, + Input.Element == UTF8.CodeUnit + { + /// The radix, or base, to use for converting text to an integer value. + public let radix: Int + + @inlinable + public init(radix: Int = 10) { + precondition((2...36).contains(radix), "Radix not in range 2...36") + self.radix = radix + } + + @inlinable + public func parse(_ input: inout Input) throws -> Output { + @inline(__always) + func digit(for n: UTF8.CodeUnit) -> Output? { + let output: Output + switch n { + case .init(ascii: "0") ... .init(ascii: "9"): + output = Output(n - .init(ascii: "0")) + case .init(ascii: "A") ... .init(ascii: "Z"): + output = Output(n - .init(ascii: "A") + 10) + case .init(ascii: "a") ... .init(ascii: "z"): + output = Output(n - .init(ascii: "a") + 10) + default: + return nil + } + return output < self.radix ? output : nil + } + var length = 0 + var iterator = input.makeIterator() + guard let first = iterator.next() else { + throw ParsingError.expectedInput("integer", at: input) + } + let isPositive: Bool + let parsedSign: Bool + var overflow = false + var output: Output + switch (Output.isSigned, first) { + case (true, .init(ascii: "-")): + parsedSign = true + isPositive = false + output = 0 + case (true, .init(ascii: "+")): + parsedSign = true + isPositive = true + output = 0 + case let (_, n): + guard let n = digit(for: n) else { + throw ParsingError.expectedInput("integer", at: input) + } + parsedSign = false + isPositive = true + output = n + } + let original = input + input.removeFirst() + length += 1 + let radix = Output(self.radix) + while let next = iterator.next(), let n = digit(for: next) { + input.removeFirst() + (output, overflow) = output.multipliedReportingOverflow(by: radix) + func overflowError() -> Error { + ParsingError.failed( + summary: "failed to process \"\(Output.self)\"", + label: "overflowed \(Output.max)", + from: original, + to: input + ) + } + guard !overflow else { throw overflowError() } + (output, overflow) = + isPositive + ? output.addingReportingOverflow(n) + : output.subtractingReportingOverflow(n) + guard !overflow else { throw overflowError() } + length += 1 + } + guard length > (parsedSign ? 1 : 0) + else { + throw ParsingError.expectedInput("integer", at: input) + } + return output + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Lazy.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Lazy.swift new file mode 100644 index 0000000000..0edb408488 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Lazy.swift @@ -0,0 +1,27 @@ +/// A parser that waits for a call to its ``parse(_:)`` method before running the given closure to +/// create a parser for the given input. +public final class Lazy: Parser { + @usableFromInline + internal var lazyParser: LazyParser? + + public let createParser: () -> LazyParser + + @inlinable + public init(@ParserBuilder createParser: @escaping () -> LazyParser) { + self.createParser = createParser + } + + @inlinable + public func parse(_ input: inout LazyParser.Input) rethrows -> LazyParser.Output { + guard let parser = self.lazyParser else { + let parser = self.createParser() + self.lazyParser = parser + return try parser.parse(&input) + } + return try parser.parse(&input) + } +} + +extension Parsers { + public typealias Lazy = SwiftTL.Lazy // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Literal.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Literal.swift new file mode 100644 index 0000000000..311ce06232 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Literal.swift @@ -0,0 +1,39 @@ +extension Array: Parser where Element: Equatable { + @inlinable + public func parse(_ input: inout ArraySlice) throws { + guard input.starts(with: self) else { + throw ParsingError.expectedInput(self.debugDescription, at: input) + } + input.removeFirst(self.count) + } +} + +extension String: Parser { + @inlinable + public func parse(_ input: inout Substring) throws { + guard input.starts(with: self) else { + throw ParsingError.expectedInput(self.debugDescription, at: input) + } + input.removeFirst(self.count) + } +} + +extension String.UnicodeScalarView: Parser { + @inlinable + public func parse(_ input: inout Substring.UnicodeScalarView) throws { + guard input.starts(with: self) else { + throw ParsingError.expectedInput(String(self).debugDescription, at: input) + } + input.removeFirst(self.count) + } +} + +extension String.UTF8View: Parser { + @inlinable + public func parse(_ input: inout Substring.UTF8View) throws { + guard input.starts(with: self) else { + throw ParsingError.expectedInput(String(self).debugDescription, at: input) + } + input.removeFirst(self.count) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Many.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Many.swift new file mode 100644 index 0000000000..c74ab7b6e7 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Many.swift @@ -0,0 +1,353 @@ +import Foundation + +/// A parser that attempts to run another parser as many times as specified, accumulating the result +/// of the outputs. +/// +/// For example, given a comma-separated string of numbers, one could parse out an array of +/// integers: +/// +/// ```swift +/// let intsParser = Many { +/// Int.parser() +/// } separator: { +/// "," +/// } +/// +/// var input = "1,2,3"[...] +/// try intsParser.parse(&input) // [1, 2, 3] +/// input // "" +/// ``` +/// +/// In addition to an element and separator parser, a "terminator" parser that is run after the element +/// parser has run as many times as possible. This can be useful for proving that the `Many` parser has +/// consumed everything you expect: +/// +/// ```swift +/// let intsParser = Many { +/// Int.parser() +/// } separator: { +/// "," +/// } terminator: { +/// "---" +/// } +/// +/// var input = "1,2,3---"[...] +/// try intsParser.parse(&input) // [1, 2, 3] +/// input // "" +/// ``` +/// +/// The outputs of the element parser do not need to be accumulated in an array. More generally one can +/// specify a closure that customizes how outputs are accumulated, much like `Sequence.reduce(into:_)`. We +/// could, for example, sum the numbers as we parse them instead of accumulating each value in an array: +/// +/// ```swift +/// let sumParser = Many(into: 0, +=) { +/// Int.parser() +/// } separator: { +/// "," +/// } +/// +/// var input = "1,2,3"[...] +/// try sumParser.parse(&input) // 6 +/// input // "" +/// ``` +/// +/// This parser fails if the terminator parser fails. For example, if we required our comma-separated +/// integer parser to be terminated by `"---"`, but we parsed a list that contained a non-integer we would +/// get an error: +/// +/// ```swift +/// let intsParser = Many { +/// Int.parser() +/// } separator: { +/// "," +/// } terminator: { +/// "---" +/// } +/// var input = "1,2,Hello---"[...] +/// try intsParser.parse(&input) +/// // error: unexpected input +/// // --> input:1:5 +/// // 1 | 1,2,Hello--- +/// // | ^ expected integer +/// ``` +public struct Many: Parser +where + Separator.Input == Element.Input, + Terminator.Input == Element.Input +{ + public let element: Element + public let initialResult: Result + public let maximum: Int + public let minimum: Int + public let separator: Separator + public let terminator: Terminator + public let updateAccumulatingResult: (inout Result, Element.Output) throws -> Void + + /// Initializes a parser that attempts to run the given parser at least and at most the given + /// number of times, accumulating the outputs into a result with a given closure. + /// + /// - Parameters: + /// - initialResult: The value to use as the initial accumulating value. + /// - minimum: The minimum number of times to run this parser and consider parsing to be + /// successful. + /// - maximum: The maximum number of times to run this parser before returning the output. + /// - updateAccumulatingResult: A closure that updates the accumulating result with each output + /// of the element parser. + /// - element: A parser to run multiple times to accumulate into a result. + /// - separator: A parser that consumes input between each parsed output. + @inlinable + public init( + into initialResult: Result, + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + _ updateAccumulatingResult: @escaping (inout Result, Element.Output) throws -> Void, + @ParserBuilder element: () -> Element, + @ParserBuilder separator: () -> Separator, + @ParserBuilder terminator: () -> Terminator + ) { + self.element = element() + self.initialResult = initialResult + self.maximum = maximum + self.minimum = minimum + self.separator = separator() + self.terminator = terminator() + self.updateAccumulatingResult = updateAccumulatingResult + } + + @inlinable + public func parse(_ input: inout Element.Input) throws -> Result { + var rest = input + var previous = input + var result = self.initialResult + var count = 0 + var loopError: Error? + while count < self.maximum { + let output: Element.Output + do { + output = try self.element.parse(&input) + } catch { + loopError = error + break + } + defer { previous = input } + count += 1 + do { + try self.updateAccumulatingResult(&result, output) + } catch { + throw ParsingError.failed( + "", + .init( + originalInput: previous, remainingInput: input, debugDescription: "\(error)", + underlyingError: error) + ) + } + rest = input + do { + _ = try self.separator.parse(&input) + } catch { + loopError = error + break + } + if memcmp(&input, &previous, MemoryLayout.size) == 0 { + throw ParsingError.failed( + "expected input to be consumed", + .init(remainingInput: input, debugDescription: "infinite loop", underlyingError: nil) + ) + } + } + input = rest + do { + _ = try self.terminator.parse(&input) + } catch { + if let loopError = loopError { + throw ParsingError.manyFailed([loopError, error], at: input) + } else { + throw error + } + } + guard count >= self.minimum else { + let atLeast = self.minimum - count + throw ParsingError.expectedInput( + """ + \(atLeast) \(count == 0 ? "" : "more ")value\(atLeast == 1 ? "" : "s") of \ + "\(Element.Output.self)" + """, + at: rest + ) + } + return result + } +} + +extension Many where Separator == Always, Terminator == Always { + /// Initializes a parser that attempts to run the given parser at least and at most the given + /// number of times, accumulating the outputs into a result with a given closure. + /// + /// - Parameters: + /// - initialResult: The value to use as the initial accumulating value. + /// - minimum: The minimum number of times to run this parser and consider parsing to be + /// successful. + /// - maximum: The maximum number of times to run this parser before returning the output. + /// - updateAccumulatingResult: A closure that updates the accumulating result with each output + /// of the element parser. + /// - element: A parser to run multiple times to accumulate into a result. + @inlinable + public init( + into initialResult: Result, + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + _ updateAccumulatingResult: @escaping (inout Result, Element.Output) throws -> Void, + @ParserBuilder element: () -> Element + ) { + self.element = element() + self.initialResult = initialResult + self.maximum = maximum + self.minimum = minimum + self.separator = .init(()) + self.terminator = .init(()) + self.updateAccumulatingResult = updateAccumulatingResult + } +} + +extension Many where Separator == Always { + @inlinable + public init( + into initialResult: Result, + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + _ updateAccumulatingResult: @escaping (inout Result, Element.Output) throws -> Void, + @ParserBuilder element: () -> Element, + @ParserBuilder terminator: () -> Terminator + ) { + self.element = element() + self.initialResult = initialResult + self.maximum = maximum + self.minimum = minimum + self.separator = .init(()) + self.terminator = terminator() + self.updateAccumulatingResult = updateAccumulatingResult + } +} + +extension Many where Terminator == Always { + @inlinable + public init( + into initialResult: Result, + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + _ updateAccumulatingResult: @escaping (inout Result, Element.Output) throws -> Void, + @ParserBuilder element: () -> Element, + @ParserBuilder separator: () -> Separator + ) { + self.element = element() + self.initialResult = initialResult + self.maximum = maximum + self.minimum = minimum + self.separator = separator() + self.terminator = .init(()) + self.updateAccumulatingResult = updateAccumulatingResult + } +} + +extension Many where Result == [Element.Output] { + /// Initializes a parser that attempts to run the given parser at least and at most the given + /// number of times, accumulating the outputs in an array. + /// + /// - Parameters: + /// - minimum: The minimum number of times to run this parser and consider parsing to be + /// successful. + /// - maximum: The maximum number of times to run this parser before returning the output. + /// - element: A parser to run multiple times to accumulate into an array. + /// - separator: A parser that consumes input between each parsed output. + @inlinable + public init( + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + @ParserBuilder element: () -> Element, + @ParserBuilder separator: () -> Separator, + @ParserBuilder terminator: () -> Terminator + ) { + self.init( + into: [], + atLeast: minimum, + atMost: maximum, + { $0.append($1) }, + element: element, + separator: separator, + terminator: terminator + ) + } +} + +extension Many +where + Result == [Element.Output], + Separator == Always, + Terminator == Always +{ + /// Initializes a parser that attempts to run the given parser at least and at most the given + /// number of times, accumulating the outputs in an array. + /// + /// - Parameters: + /// - minimum: The minimum number of times to run this parser and consider parsing to be + /// successful. + /// - maximum: The maximum number of times to run this parser before returning the output. + /// - element: A parser to run multiple times to accumulate into an array. + @inlinable + public init( + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + @ParserBuilder element: () -> Element + ) { + self.init( + into: [], + atLeast: minimum, + atMost: maximum, + { $0.append($1) }, + element: element + ) + } +} + +extension Many where Result == [Element.Output], Separator == Always { + @inlinable + public init( + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + @ParserBuilder element: () -> Element, + @ParserBuilder terminator: () -> Terminator + ) { + self.init( + into: [], + atLeast: minimum, + atMost: maximum, + { $0.append($1) }, + element: element, + terminator: terminator + ) + } +} + +extension Many where Result == [Element.Output], Terminator == Always { + @inlinable + public init( + atLeast minimum: Int = 0, + atMost maximum: Int = .max, + @ParserBuilder element: () -> Element, + @ParserBuilder separator: () -> Separator + ) { + self.init( + into: [], + atLeast: minimum, + atMost: maximum, + { $0.append($1) }, + element: element, + separator: separator + ) + } +} + +extension Parsers { + public typealias Many = SwiftTL.Many // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Map.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Map.swift new file mode 100644 index 0000000000..11e136d0bf --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Map.swift @@ -0,0 +1,42 @@ +extension Parser { + /// Returns a parser that transforms the output of this parser with a given closure. + /// + /// This method is similar to `Sequence.map`, `Optional.map`, and `Result.map` in the Swift + /// standard library, as well as `Publisher.map` in the Combine framework. + /// + /// - Parameter transform: A closure that transforms values of this parser's output. + /// - Returns: A parser of transformed outputs. + @_disfavoredOverload + @inlinable + public func map( + _ transform: @escaping (Output) -> NewOutput + ) -> Parsers.Map { + .init(upstream: self, transform: transform) + } +} + +extension Parsers { + /// A parser that transforms the output of another parser with a given closure. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the ``Parser/map(_:)`` operation, which constructs this type. + public struct Map: Parser { + /// The parser from which this parser receives output. + public let upstream: Upstream + + /// The closure that transforms output from the upstream parser. + public let transform: (Upstream.Output) -> NewOutput + + @inlinable + public init(upstream: Upstream, transform: @escaping (Upstream.Output) -> NewOutput) { + self.upstream = upstream + self.transform = transform + } + + @inlinable + @inline(__always) + public func parse(_ input: inout Upstream.Input) rethrows -> NewOutput { + self.transform(try self.upstream.parse(&input)) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Newline.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Newline.swift new file mode 100644 index 0000000000..79dc955625 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Newline.swift @@ -0,0 +1,70 @@ +/// A parser that consumes a single newline from the beginning of the input. +/// +/// - Note: This parser only consumes a line feed (`"\n"`) or a carriage returns with line feed +/// (`"\r\n"`). If you need richer support that covers all unicode newline characters, use a +/// ``Prefix`` parser that operates on the `Substring` level with a predicate that consumes a +/// single newline: +/// +/// ```swift +/// Prefix(1) { $0.isNewline } +/// ``` +/// It will consume both line feeds (`"\n"`) and carriage returns with line feeds (`"\r\n"`). +public struct Newline: Parser +where + Input.SubSequence == Input, + Bytes.SubSequence == Bytes, + Bytes.Element == UTF8.CodeUnit +{ + @usableFromInline + let toBytes: (Input) -> Bytes + + @usableFromInline + let fromBytes: (Bytes) -> Input + + @inlinable + public func parse(_ input: inout Input) throws { + var bytes = self.toBytes(input) + if bytes.first == .init(ascii: "\n") { + bytes.removeFirst() + } else if bytes.first == .init(ascii: "\r"), bytes.dropFirst().first == .init(ascii: "\n") { + bytes.removeFirst(2) + } else { + throw ParsingError.expectedInput(#""\n" or "\r\n""#, at: input) + } + input = self.fromBytes(bytes) + } +} + +// NB: Swift 5.5.2 on Linux and Windows fails to build with a simpler `Bytes == Input` constraint +extension Newline where Bytes == Input.SubSequence, Bytes.SubSequence == Input { + @inlinable + public init() { + self.toBytes = { $0 } + self.fromBytes = { $0 } + } +} + +extension Newline where Input == Substring, Bytes == Substring.UTF8View { + @_disfavoredOverload + @inlinable + public init() { + self.toBytes = { $0.utf8 } + self.fromBytes = Substring.init + } +} + +extension Newline where Input == Substring.UTF8View, Bytes == Input { + @_disfavoredOverload + @inlinable + public init() { self.init() } +} + +extension Newline where Input == ArraySlice, Bytes == Input { + @_disfavoredOverload + @inlinable + public init() { self.init() } +} + +extension Parsers { + public typealias Newline = SwiftTL.Newline // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Not.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Not.swift new file mode 100644 index 0000000000..f1d3b04b61 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Not.swift @@ -0,0 +1,42 @@ +/// A parser that succeeds if the given parser fails, and does not consume any input. +/// +/// For example, to parse a line from an input that does not start with "//" one can do: +/// +/// ```swift +/// let uncommentedLine = Parse { +/// Not { "//" } +/// PrefixUpTo("\n") +/// } +/// +/// try uncommentedLine.parse("let x = 1") // ✅ "let x = 1" +/// +/// try uncommentedLine.parse("// let x = 1") // ❌ +/// // error: unexpected input +/// // --> input:1:1-2 +/// // 1 | // let x = 1 +/// // | ^^ expected not to be processed +/// ``` +public struct Not: Parser { + public let upstream: Upstream + + /// Creates a parser that succeeds if the given parser fails, and does not consume any input. + /// + /// - Parameter build: A parser that causes this parser to fail if it succeeds, or succeed if it + /// fails. + @inlinable + public init(@ParserBuilder _ build: () -> Upstream) { + self.upstream = build() + } + + @inlinable + public func parse(_ input: inout Upstream.Input) throws { + let original = input + do { + _ = try self.upstream.parse(&input) + } catch { + input = original + return + } + throw ParsingError.expectedInput("not to be processed", from: original, to: input) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/OneOf.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/OneOf.swift new file mode 100644 index 0000000000..e25f631df0 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/OneOf.swift @@ -0,0 +1,166 @@ +/// A parser that attempts to run a number of parsers till one succeeds. +/// +/// Use this parser to list out a number of parsers in a ``OneOfBuilder`` result builder block. +/// +/// The following example uses ``OneOf`` to parse an enum value. To do so, it spells out a list of +/// parsers to `OneOf`, one for each case: +/// +/// ```swift +/// enum Currency { case eur, gbp, usd } +/// +/// let currency = OneOf { +/// "€".map { Currency.eur } +/// "£".map { Currency.gbp } +/// "$".map { Currency.usd } +/// } +/// ``` +/// +/// This parser fails if every parser inside fails: +/// +/// ```swift +/// var input = "London, Hello!"[...] +/// try OneOf { "New York"; "Berlin" }.parse(&input) +/// +/// // error: multiple failures occurred +/// // +/// // error: unexpected input +/// // --> input:1:1 +/// // 1 | London, Hello! +/// // | ^ expected "New York" +/// // | ^ expected "Berlin" +/// ``` +/// +/// If you are parsing input that should coalesce into some default, avoid using a final ``Always`` +/// parser, and instead opt for a trailing ``replaceError(with:)``, which returns a parser that +/// cannot fail: +/// +/// ```swift +/// enum Currency { case eur, gbp, usd, unknown } +/// +/// let currency = OneOf { +/// "€".map { Currency.eur } +/// "£".map { Currency.gbp } +/// "$".map { Currency.usd } +/// } +/// .replaceError(with: Currency.unknown) +/// +/// currency.parse("$") // Currency.usd +/// currency.parse("฿") // Currency.unknown +/// ``` +/// +/// ## Specificity +/// +/// The order of the parsers in the above ``OneOf`` does not matter because each of "€", "£" and "$" +/// are mutually exclusive, i.e. at most one will succeed on any given input. +/// +/// However, that is not always true, and when the parsers are not mutually exclusive (i.e. multiple +/// can succeed on a given input) you must order them from most specific to least specific. That is, +/// the first parser should succeed on the fewest number of inputs and the last parser should +/// succeed on the most number of inputs. +/// +/// For example, suppose you wanted to parse a simple CSV format into a doubly-nested array of +/// strings, and the fields in the CSV are allowed to contain commas themselves as long as they +/// are quoted: +/// +/// ```swift +/// let input = #""" +/// lastName,firstName +/// McBlob,Blob +/// "McBlob, Esq.",Blob Jr. +/// "McBlob, MD",Blob Sr. +/// """# +/// ``` +/// +/// Here we have a list of last and first names separated by a comma, and some of the last names are +/// quoted because they contain commas. +/// +/// In order to safely parse this we must first try parsing a field as a quoted field, and then only +/// if that fails we can parse a plain field that takes everything up until the next comma or +/// newline: +/// +/// ```swift +/// let quotedField = Parse { +/// "\"" +/// Prefix { $0 != "\"" } +/// "\"" +/// } +/// let plainField = Prefix { $0 != "," && $0 != "\n" } +/// +/// let field = OneOf { +/// quotedField +/// plainField +/// } +/// ``` +/// +/// Then we can parse many fields to form an array of fields making up a line, and then parse many +/// lines to make up a full, doubly-nested array for the CSV: +/// +/// ```swift +/// let line = Many { field } separator: { "," } +/// let csv = Many { line } separator: { "\n" } +/// ``` +/// +/// Running this parser on the input shows that it properly isolates each field of the CSV, even +/// fields that are quoted and contain a comma: +/// +/// ```swift +/// XCTAssertEqual( +/// try csv.parse(input), +/// [ +/// ["lastName", "firstName"], +/// ["McBlob", "Blob"], +/// ["McBlob, Esq.", "Blob Jr."], +/// ["McBlob, MD", "Blob Sr."], +/// ] +/// ) +/// // ✅ +/// ``` +/// +/// The reason this parser works is because the `quotedField` and `plainField` parsers are listed in +/// a very specific order inside the `OneOf`: +/// +/// ```swift +/// let field = OneOf { +/// quotedField +/// plainField +/// } +/// ``` +/// +/// The `quotedField` parser is a _more_ specific parser in that it will succeed on fewer inputs +/// than the `plainField` parser does. For example: +/// +/// ```swift +/// try quotedField.parse("Blob Jr.") // ❌ +/// try plainField.parse("Blob Jr.") // ✅ +/// ``` +/// +/// Whereas the `plainField` parser will happily succeed on anything the `quotedField` parser will +/// succeed on: +/// +/// ```swift +/// try quotedField.parse("\"Blob, Esq\"") // ✅ +/// try plainField.parse("\"Blob, Esq\"") // ✅ +/// ``` +/// +/// For this reason the `quotedField` parser must be listed first so that it can try its logic +/// first, which succeeds less frequently, before then trying the `plainField` parser, which +/// succeeds more often. +/// +/// ## Backtracking +/// +/// The ``OneOf`` parser is the primary tool for introducing backtracking into your parsers, +/// which means to undo the consumption of a parser when it fails. For more information, see the +/// article . +public struct OneOf: Parser where Parsers: Parser { + public let parsers: Parsers + + @inlinable + public init(@OneOfBuilder _ build: () -> Parsers) { + self.parsers = build() + } + + @inlinable + public func parse(_ input: inout Parsers.Input) rethrows -> Parsers.Output { + try self.parsers.parse(&input) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/OneOfMany.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/OneOfMany.swift new file mode 100644 index 0000000000..1f7a072bb2 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/OneOfMany.swift @@ -0,0 +1,47 @@ +extension Parsers { + /// A parser that attempts to run a number of parsers till one succeeds. + /// + /// You will not typically need to interact with this type directly. Instead you will usually loop + /// over each parser in a builder block: + /// + /// ```swift + /// enum Role: String, CaseIterable { + /// case admin + /// case guest + /// case member + /// } + /// + /// let roleParser = OneOf { + /// for role in Role.allCases { + /// status.rawValue.map { role } + /// } + /// } + /// ``` + public struct OneOfMany: Parser { + public let parsers: [Parsers] + + @inlinable + public init(_ parsers: [Parsers]) { + self.parsers = parsers + } + + @inlinable + @inline(__always) + public func parse(_ input: inout Parsers.Input) throws -> Parsers.Output { + let original = input + var count = self.parsers.count + var errors: [Error] = [] + errors.reserveCapacity(count) + for parser in self.parsers { + do { + return try parser.parse(&input) + } catch { + count -= 1 + if count > 0 { input = original } + errors.append(error) + } + } + throw ParsingError.manyFailed(errors, at: original) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Optional.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Optional.swift new file mode 100644 index 0000000000..4a57102a48 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Optional.swift @@ -0,0 +1,40 @@ +extension Optional: Parser where Wrapped: Parser { + public func parse(_ input: inout Wrapped.Input) rethrows -> Wrapped.Output? { + guard let self = self + else { return nil } + + return try self.parse(&input) + } +} + +extension Parsers { + /// A parser that attempts to run a given void parser, succeeding with void. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// `if` statements in parser builder blocks: + /// + /// ```swift + /// Parse { + /// "Hello" + /// if useComma { + /// "," + /// } + /// " " + /// Rest() + /// } + /// ``` + public struct OptionalVoid: Parser where Wrapped.Output == Void { + let wrapped: Wrapped? + + public init(wrapped: Wrapped?) { + self.wrapped = wrapped + } + + public func parse(_ input: inout Wrapped.Input) rethrows { + guard let wrapped = self.wrapped + else { return } + + try wrapped.parse(&input) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Optionally.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Optionally.swift new file mode 100644 index 0000000000..5cc3b13ebc --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Optionally.swift @@ -0,0 +1,53 @@ +/// A parser that runs the given parser and succeeds with `nil` if it fails. +/// +/// Use this parser when you are parsing into an output data model that contains `nil`. +/// +/// When the wrapped parser fails ``Optionally`` will backtrack any consumption of the input so +/// that later parsers can attempt to parser the input: +/// +/// ```swift +/// let parser = Parse { +/// "Hello," +/// Optionally { " "; Bool.parser() } +/// " world!" +/// } +/// +/// try parser.parse("Hello, world!") // nil 1️⃣ +/// try parser.parse("Hello, true world!") // true +/// ``` +/// +/// If ``Optionally`` did not backtrack then 1️⃣ would fail because it would consume a space, +/// causing the `" world!"` parser to fail since there is no longer any space to consume. +/// Read the article to learn more about how backtracking works. +/// +/// If you are optionally parsing input that should coalesce into some default, you can skip the +/// optionality and instead use ``replaceError(with:)`` with a default: +/// +/// ```swift +/// Optionally { Int.parser() } +/// .map { $0 ?? 0 } +/// +/// // vs. +/// +/// Int.parser() +/// .replaceError(with: 0) +/// ``` +public struct Optionally: Parser { + public let wrapped: Wrapped + + @inlinable + public init(@ParserBuilder _ build: () -> Wrapped) { + self.wrapped = build() + } + + @inlinable + public func parse(_ input: inout Wrapped.Input) -> Wrapped.Output? { + let original = input + do { + return try self.wrapped.parse(&input) + } catch { + input = original + return nil + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Parse.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Parse.swift new file mode 100644 index 0000000000..7bb0ad6a87 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Parse.swift @@ -0,0 +1,51 @@ +/// A parser that attempts to run a number of parsers to accumulate their outputs. +/// +/// A general entry point into ``ParserBuilder`` syntax, which can be used to build complex parsers +/// from simpler ones. +/// +/// ```swift +/// let point = Parse { +/// "(" +/// Int.parser() +/// "," +/// Int.parser() +/// ")" +/// } +/// +/// try point.parse("(2,-4)") // (2, -4) +/// +/// try point.parse("(42,blob)") +/// // error: unexpected input +/// // --> input:1:5 +/// // 1 | (42,blob) +/// // | ^ expected integer +/// ``` +public struct Parse: Parser { + public let parsers: Parsers + + @inlinable + public init(@ParserBuilder _ build: () -> Parsers) { + self.parsers = build() + } + + @inlinable + public init( + _ transform: @escaping (Upstream.Output) -> NewOutput, + @ParserBuilder with build: () -> Upstream + ) where Parsers == SwiftTL.Parsers.Map { + self.parsers = build().map(transform) + } + + @inlinable + public init( + _ output: NewOutput, + @ParserBuilder with build: () -> Upstream + ) where Upstream.Output == Void, Parsers == SwiftTL.Parsers.Map { + self.parsers = build().map { output } + } + + @inlinable + public func parse(_ input: inout Parsers.Input) rethrows -> Parsers.Output { + try self.parsers.parse(&input) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Parsers.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Parsers.swift new file mode 100644 index 0000000000..bde927063a --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Parsers.swift @@ -0,0 +1,6 @@ +/// A namespace for types that serve as parsers. +/// +/// The various operators defined as extensions on ``Parser`` implement their functionality as +/// classes or structures that extend this enumeration. For example, the ``Parser/map(_:)`` operator +/// returns a ``Map`` parser. +public enum Parsers {} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Peek.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Peek.swift new file mode 100644 index 0000000000..cb6504ad22 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Peek.swift @@ -0,0 +1,43 @@ +/// A parser that runs the given parser, but does not consume any input. +/// +/// It lets the upstream parser "peek" into the input without consuming it. +/// +/// For example, identifiers (variables, functions, etc.) in Swift allow the first character to be a +/// letter or underscore, but not a digit, but subsequent characters can be digits. _E.g._, `foo123` +/// is a valid identifier, but `123foo` is not. We can create an identifier parser by using `Peek` +/// to first check if the input starts with a letter or underscore, and if it does, return the +/// remainder of the input up to the first character that is not a letter, a digit, or an +/// underscore. +/// +/// ```swift +/// let identifier = Parse { +/// Peek { Prefix(1) { $0.isLetter || $0 == "_" } } +/// Prefix { $0.isNumber || $0.isLetter || $0 == "_" } +/// } +/// +/// try identifier.parse("foo123") // ✅ "foo123" +/// try identifier.parse("_foo123") // ✅ "_foo123" +/// try identifier.parse("1_foo123") // ❌ +/// // error: unexpected input +/// // --> input:1:1 +/// // 1 | 1_foo123 +/// // | ^ expected 1 element satisfying predicate +/// ``` +public struct Peek: Parser { + public let upstream: Upstream + + /// Construct a parser that runs the given parser, but does not consume any input. + /// + /// - Parameter build: A parser this parser wants to inspect. + @inlinable + public init(@ParserBuilder _ build: () -> Upstream) { + self.upstream = build() + } + + @inlinable + public func parse(_ input: inout Upstream.Input) rethrows { + let original = input + _ = try self.upstream.parse(&input) + input = original + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Pipe.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Pipe.swift new file mode 100644 index 0000000000..6c0b0107cf --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Pipe.swift @@ -0,0 +1,76 @@ +extension Parser { + /// Returns a parser that runs this parser, pipes its output into the given parser, and returns + /// the output of the given parser. + /// + /// For example, we can try to parse an integer of exactly 4 digits by piping the output of + /// ``Prefix`` into an `Int.parser()`: + /// + /// ```swift + /// let year = Prefix(4).pipe { Int.parser() } + /// + /// try year.parse("2022") // 2022 + /// try year.parse("0123") // 123 + /// ``` + /// + /// This parser fails if either the upstream or downstream parser fails. For example: + /// + /// ```swift + /// try year.parse("123") + /// // error: unexpected input + /// // --> input:1:4 + /// // 1 | 123 + /// // | ^ expected 1 more element + /// + /// try year.parse("fail!") + /// // error: unexpected input + /// // --> input:1:1-4 + /// // 1 | fail! + /// // | ^^^^ pipe: expected integer + /// ``` + /// + /// - Parameter downstream: A parser that parses the output of this parser. + /// - Returns: A parser that pipes this parser's output into another parser. @inlinable + public func pipe( + @ParserBuilder _ build: () -> Downstream + ) -> Parsers.Pipe { + .init(upstream: self, downstream: build()) + } +} + +extension Parsers { + /// A parser that runs this parser, pipes its output into the given parser, and returns the output + /// of the given parser. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the ``Parser/pipe(_:)`` operation, which constructs this type. + public struct Pipe: Parser + where Upstream.Output == Downstream.Input { + public let upstream: Upstream + public let downstream: Downstream + + @inlinable + public init(upstream: Upstream, downstream: Downstream) { + self.upstream = upstream + self.downstream = downstream + } + + @inlinable + public func parse(_ input: inout Upstream.Input) rethrows -> Downstream.Output { + let original = input + var downstreamInput = try self.upstream.parse(&input) + do { + return try self.downstream.parse(&downstreamInput) + } catch let ParsingError.failed(reason, context) { + throw ParsingError.failed( + "pipe: \(reason)", + .init( + originalInput: original, + remainingInput: input, + debugDescription: context.debugDescription, + underlyingError: ParsingError.failed(reason, context) + ) + ) + } + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Prefix.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Prefix.swift new file mode 100644 index 0000000000..ad3460b28e --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Prefix.swift @@ -0,0 +1,286 @@ +/// A parser that consumes a subsequence from the beginning of its input. +/// +/// This parser is named after `Sequence.prefix`, which it uses under the hood to consume a number +/// of elements and return them as output. It can be configured with minimum and maximum lengths, +/// as well as a predicate. +/// +/// For example, to parse as many numbers off the beginning of a substring: +/// +/// ```swift +/// var input = "123 hello world"[...] +/// try Prefix { $0.isNumber }.parse(&input) // "123" +/// input // " Hello world" +/// ``` +/// +/// If you wanted this parser to fail if _no_ numbers are consumed, you could introduce a minimum +/// length. +/// +/// ```swift +/// var input = "No numbers here"[...] +/// try Prefix(1...) { $0.isNumber }.parse(&input) +/// // error: unexpected input +/// // --> input:1:1 +/// // 1 | No numbers here +/// // | ^ expected 1 element satisfying predicate +/// ``` +/// +/// If a predicate is not provided, the parser will simply consume the prefix within the minimum and +/// maximum lengths provided: +/// +/// ```swift +/// var input = "Lorem ipsum dolor"[...] +/// try Prefix(2).parse(&input) // "Lo" +/// input // "rem ipsum dolor" +/// ``` +public struct Prefix: Parser where Input.SubSequence == Input { + public let maxLength: Int? + public let minLength: Int + public let predicate: ((Input.Element) -> Bool)? + + /// Initializes a parser that consumes a subsequence from the beginning of its input. + /// + /// - Parameters: + /// - minLength: The minimum number of elements to consume for parsing to be considered + /// successful. + /// - maxLength: The maximum number of elements to consume before the parser will return its + /// output. + /// - predicate: A closure that takes an element of the input sequence as its argument and + /// returns `true` if the element should be included or `false` if it should be excluded. Once + /// the predicate returns `false` it will not be called again. + @inlinable + public init( + minLength: Int = 0, + maxLength: Int? = nil, + while predicate: @escaping (Input.Element) -> Bool + ) { + self.minLength = minLength + self.maxLength = maxLength + self.predicate = predicate + } + + /// Initializes a parser that consumes a subsequence from the beginning of its input. + /// + /// ```swift + /// try Prefix(2...4, while: \.isNumber).parse("123456") // "1234" + /// try Prefix(2...4, while: \.isNumber).parse("123") // "123" + /// + /// try Prefix(2...4, while: \.isNumber).parse("1") + /// // error: unexpected input + /// // --> input:1:1 + /// // 1 | 1 + /// // | ^ expected 1 more element satisfying predicate + /// ``` + /// + /// - Parameters: + /// - length: A closed range that provides a minimum number and maximum of elements to consume + /// for parsing to be considered successful. + /// - predicate: An optional closure that takes an element of the input sequence as its argument + /// and returns `true` if the element should be included or `false` if it should be excluded. + /// Once the predicate returns `false` it will not be called again. + @inlinable + public init( + _ length: ClosedRange, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.minLength = length.lowerBound + self.maxLength = length.upperBound + self.predicate = predicate + } + + /// Initializes a parser that consumes a subsequence from the beginning of its input. + /// + /// ```swift + /// try Prefix(4, while: \.isNumber).parse("123456") // "1234" + /// + /// try Prefix(4, while: \.isNumber).parse("123") + /// // error: unexpected input + /// // --> input:1:1 + /// // 1 | 123 + /// // | ^ expected 1 more element satisfying predicate + /// ``` + /// + /// - Parameters: + /// - length: An exact number of elements to consume for parsing to be considered successful. + /// - predicate: An optional closure that takes an element of the input sequence as its argument + /// and returns `true` if the element should be included or `false` if it should be excluded. + /// Once the predicate returns `false` it will not be called again. + @inlinable + public init( + _ length: Int, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.minLength = length + self.maxLength = length + self.predicate = predicate + } + + /// Initializes a parser that consumes a subsequence from the beginning of its input. + /// + /// ``` swift + /// try Prefix(4..., while: \.isNumber).parse("123456") // "123456" + /// + /// try Prefix(4..., while: \.isNumber).parse("123") + /// // error: unexpected input + /// // --> input:1:1 + /// // 1 | 123 + /// // | ^ expected 1 more element satisfying predicate + /// ``` + /// + /// - Parameters: + /// - length: A partial range that provides a minimum number of elements to consume for + /// parsing to be considered successful. + /// - predicate: An optional closure that takes an element of the input sequence as its argument + /// and returns `true` if the element should be included or `false` if it should be excluded. + /// Once the predicate returns `false` it will not be called again. + @inlinable + public init( + _ length: PartialRangeFrom, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.minLength = length.lowerBound + self.maxLength = nil + self.predicate = predicate + } + + /// Initializes a parser that consumes a subsequence from the beginning of its input. + /// + /// ```swift + /// try Prefix(...4, while: \.isNumber).parse("123456") // "1234" + /// try Prefix(...4, while: \.isNumber).parse("123") // "123" + /// ``` + /// + /// - Parameters: + /// - length: A partial, inclusive range that provides a maximum number of elements to consume. + /// - predicate: An optional closure that takes an element of the input sequence as its argument + /// and returns `true` if the element should be included or `false` if it should be excluded. + /// Once the predicate returns `false` it will not be called again. + @inlinable + public init( + _ length: PartialRangeThrough, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.minLength = 0 + self.maxLength = length.upperBound + self.predicate = predicate + } + + @inlinable + @inline(__always) + public func parse(_ input: inout Input) throws -> Input { + var prefix = maxLength.map(input.prefix) ?? input + prefix = predicate.map { prefix.prefix(while: $0) } ?? prefix + let count = prefix.count + input.removeFirst(count) + guard count >= self.minLength else { + let atLeast = self.minLength - count + throw ParsingError.expectedInput( + """ + \(self.minLength - count) \(count == 0 ? "" : "more ")element\(atLeast == 1 ? "" : "s")\ + \(predicate == nil ? "" : " satisfying predicate") + """, + at: input + ) + } + return prefix + } +} + +extension Prefix where Input == Substring { + @_disfavoredOverload + @inlinable + public init( + minLength: Int = 0, + maxLength: Int? = nil, + while predicate: @escaping (Input.Element) -> Bool + ) { + self.init(minLength: minLength, maxLength: maxLength, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: ClosedRange, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: Int, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: PartialRangeFrom, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: PartialRangeThrough, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } +} + +extension Prefix where Input == Substring.UTF8View { + @_disfavoredOverload + @inlinable + public init( + minLength: Int = 0, + maxLength: Int? = nil, + while predicate: @escaping (Input.Element) -> Bool + ) { + self.init(minLength: minLength, maxLength: maxLength, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: ClosedRange, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: Int, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: PartialRangeFrom, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } + + @_disfavoredOverload + @inlinable + public init( + _ length: PartialRangeThrough, + while predicate: ((Input.Element) -> Bool)? = nil + ) { + self.init(length, while: predicate) + } +} + +extension Parsers { + public typealias Prefix = SwiftTL.Prefix // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/PrefixThrough.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/PrefixThrough.swift new file mode 100644 index 0000000000..e5261a9049 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/PrefixThrough.swift @@ -0,0 +1,73 @@ +/// A parser that consumes a subsequence from the beginning of its input through a given sequence of +/// elements. +/// +/// This parser is named after `Sequence.prefix(through:)`, and uses similar logic under the hood to +/// consume and return input through a particular subsequence. +/// +/// ```swift +/// let lineParser = PrefixThrough("\n") +/// +/// var input = "Hello\nworld\n"[...] +/// try line.parse(&input) // "Hello\n" +/// input // "world\n" +/// ``` +public struct PrefixThrough: Parser where Input.SubSequence == Input { + public let possibleMatch: Input + public let areEquivalent: (Input.Element, Input.Element) -> Bool + + @inlinable + public init( + _ possibleMatch: Input, + by areEquivalent: @escaping (Input.Element, Input.Element) -> Bool + ) { + self.possibleMatch = possibleMatch + self.areEquivalent = areEquivalent + } + + @inlinable + @inline(__always) + public func parse(_ input: inout Input) throws -> Input { + guard let first = self.possibleMatch.first else { return self.possibleMatch } + let count = self.possibleMatch.count + let original = input + while let index = input.firstIndex(where: { self.areEquivalent(first, $0) }) { + input = input[index...] + if input.count >= count, + zip(input[index...], self.possibleMatch).allSatisfy(self.areEquivalent) + { + let index = input.index(index, offsetBy: count) + input = input[index...] + return original[..: Parser where Input.SubSequence == Input { + public let possibleMatch: Input + public let areEquivalent: (Input.Element, Input.Element) -> Bool + + @inlinable + public init( + _ possibleMatch: Input, + by areEquivalent: @escaping (Input.Element, Input.Element) -> Bool + ) { + self.possibleMatch = possibleMatch + self.areEquivalent = areEquivalent + } + + @inlinable + @inline(__always) + public func parse(_ input: inout Input) throws -> Input { + guard let first = self.possibleMatch.first else { return self.possibleMatch } + let count = self.possibleMatch.count + let original = input + while let index = input.firstIndex(where: { self.areEquivalent(first, $0) }) { + input = input[index...] + if input.count >= count, + zip(input[index...], self.possibleMatch).allSatisfy(self.areEquivalent) + { + return original[..( + _ keyPath: WritableKeyPath + ) -> Parsers.Pullback { + .init(downstream: self, keyPath: keyPath) + } +} + +extension Parsers { + /// Transforms the `Input` of a downstream parser. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the ``Parser/pullback(_:)`` operator, which constructs this type. + public struct Pullback: Parser { + public let downstream: Downstream + public let keyPath: WritableKeyPath + + @inlinable + public init(downstream: Downstream, keyPath: WritableKeyPath) { + self.downstream = downstream + self.keyPath = keyPath + } + + @inlinable + public func parse(_ input: inout Input) rethrows -> Downstream.Output { + try self.downstream.parse(&input[keyPath: self.keyPath]) + } + + @inlinable + public func pullback( + _ keyPath: WritableKeyPath + ) -> Pullback { + .init(downstream: self.downstream, keyPath: keyPath.appending(path: self.keyPath)) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/ReplaceError.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/ReplaceError.swift new file mode 100644 index 0000000000..fcb8c09bec --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/ReplaceError.swift @@ -0,0 +1,70 @@ +extension Parser { + /// A parser that replaces its error with a provided output. + /// + /// Useful for providing a default output for a parser. + /// + /// For example, we could create a parser that parses a plus or minus sign and maps the result to + /// a positive or negative multiplier respectively, or else defaults to a positive multiplier: + /// + /// ```swift + /// let sign = OneOf { + /// "+".map { 1 } + /// "-".map { -1 } + /// } + /// .replaceError(with: 1) + /// ``` + /// + /// Notably this parser is non-throwing: + /// + /// ```swift + /// var input = "-123"[...] + /// + /// // No `try` required: + /// sign.parse(&input) // -1 + /// input // "123" + /// + /// // Simply returns the default when parsing fails: + /// sign.parse(&input) // 1 + /// ``` + /// + /// This means it can be used to turn throwing parsers into non-throwing ones, which is important + /// for building up complex parsers that cannot fail. + /// + /// - Parameter output: An output to return should the upstream parser fail. + /// - Returns: A parser that never fails. + @inlinable + public func replaceError(with output: Output) -> Parsers.ReplaceError { + .init(output: output, upstream: self) + } +} + +extension Parsers { + /// A parser that replaces its error with a provided output. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// the ``Parser/replaceError(with:)`` operation, which constructs this type. + public struct ReplaceError: Parser { + @usableFromInline + let output: Upstream.Output + + @usableFromInline + let upstream: Upstream + + @usableFromInline + init(output: Upstream.Output, upstream: Upstream) { + self.output = output + self.upstream = upstream + } + + @inlinable + public func parse(_ input: inout Upstream.Input) -> Upstream.Output { + let original = input + do { + return try self.upstream.parse(&input) + } catch { + input = original + return self.output + } + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Rest.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Rest.swift new file mode 100644 index 0000000000..e3e67bcc93 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Rest.swift @@ -0,0 +1,52 @@ +/// A parser that consumes everything to the end of the collection and returns this subsequence as +/// its output. +/// +/// ```swift +/// var input = "Hello"[...] +/// Rest().parse(&input) // "Hello" +/// input // "" +/// ``` +/// +/// This parser fails if there is no input to consume: +/// +/// ```swift +/// try Rest().parse("") +/// +/// /// error: unexpected input +/// /// --> input:1:1 +/// /// 1 | +/// /// | ^ expected a non-empty input +/// ``` +/// +/// If you want to allow for the possibility of an empty remaining input you can use the +/// ``Optionally`` parser to parse an optional output value, or the ``replaceError(with:)`` method +/// to coalesce the error into a default output value. +public struct Rest: Parser where Input.SubSequence == Input { + @inlinable + public init() {} + + @inlinable + public func parse(_ input: inout Input) throws -> Input { + guard !input.isEmpty + else { throw ParsingError.expectedInput("a non-empty input", at: input) } + let output = input + input.removeFirst(input.count) + return output + } +} + +extension Rest where Input == Substring { + @_disfavoredOverload + @inlinable + public init() {} +} + +extension Rest where Input == Substring.UTF8View { + @_disfavoredOverload + @inlinable + public init() {} +} + +extension Parsers { + public typealias Rest = SwiftTL.Rest // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Skip.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Skip.swift new file mode 100644 index 0000000000..a7296eb69d --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Skip.swift @@ -0,0 +1,19 @@ +/// A parser that discards the output of another parser. +public struct Skip: Parser { + /// The parser from which this parser receives output. + public let parsers: Parsers + + @inlinable + public init(@ParserBuilder _ build: () -> Parsers) { + self.parsers = build() + } + + @inlinable + public func parse(_ input: inout Parsers.Input) rethrows { + _ = try self.parsers.parse(&input) + } +} + +extension Parsers { + public typealias Skip = SwiftTL.Skip // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/StartsWith.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/StartsWith.swift new file mode 100644 index 0000000000..edfae3a3c1 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/StartsWith.swift @@ -0,0 +1,92 @@ +/// A parser that parses a sequence of elements from its input. +/// +/// This parser is named after `Sequence.starts(with:)`, and tests that the input it is parsing +/// starts with a given subsequence by calling this method under the hood. +/// +/// If `true`, it consumes this prefix and returns `Void`: +/// +/// ```swift +/// var input = "Hello, Blob!"[...] +/// +/// StartsWith("Hello, ").parse(&input) // () +/// input // "Blob!" +/// ``` +/// +/// If `false`, it fails and leaves input intact: +/// +/// ```swift +/// var input = "Goodnight, Blob!"[...] +/// try StartsWith("Hello, ").parse(&input) +/// // error: unexpected input +/// // --> input:1:1 +/// // 1 | Goodnight, Blob! +/// // | ^ expected "Hello, " +/// ``` +/// +/// This parser returns `Void` and _not_ the sequence of elements it consumes because the sequence +/// is already known at the time the parser is created (it is the value quite literally passed to +/// ``StartsWith/init(_:)``). +/// +/// In many circumstances you can omit the `StartsWith` parser entirely and just use the collection +/// as the parser. For example: +/// +/// ```swift +/// var input = "Hello, Blob!"[...] +/// +/// try "Hello, ".parse(&input) // () +/// input // "Blob!" +/// ``` +public struct StartsWith: Parser where Input.SubSequence == Input { + public let count: Int + public let possiblePrefix: AnyCollection + public let startsWith: (Input) -> Bool + + /// Initializes a parser that successfully returns `Void` when the initial elements of its input + /// are equivalent to the elements in another sequence, using the given predicate as the + /// equivalence test. + /// + /// - Parameters: + /// - possiblePrefix: A sequence to compare to the start of an input sequence. + /// - areEquivalent: A predicate that returns `true` if its two arguments are equivalent; + /// otherwise, `false`. + @inlinable + public init( + _ possiblePrefix: PossiblePrefix, + by areEquivalent: @escaping (Input.Element, Input.Element) -> Bool + ) + where + PossiblePrefix: Collection, + PossiblePrefix.Element == Input.Element + { + self.count = possiblePrefix.count + self.possiblePrefix = AnyCollection(possiblePrefix) + self.startsWith = { input in input.starts(with: possiblePrefix, by: areEquivalent) } + } + + @inlinable + public func parse(_ input: inout Input) throws { + guard self.startsWith(input) else { + throw ParsingError.expectedInput(formatValue(self.possiblePrefix), at: input) + } + input.removeFirst(self.count) + } +} + +extension Parsers.StartsWith where Input.Element: Equatable { + /// Initializes a parser that successfully returns `Void` when the initial elements of its input + /// are equivalent to the elements in another sequence. + /// + /// - Parameter possiblePrefix: A sequence to compare to the start of an input sequence. + @inlinable + public init(_ possiblePrefix: PossiblePrefix) + where + PossiblePrefix: Collection, + PossiblePrefix.Element == Input.Element + { + self.init(possiblePrefix, by: ==) + } +} + +extension Parsers { + public typealias StartsWith = SwiftTL.StartsWith // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Stream.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Stream.swift new file mode 100644 index 0000000000..520b820287 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Stream.swift @@ -0,0 +1,55 @@ +/// A parser that can parse streams of input. +/// +/// For example, the following parser can parse an integer followed by a newline from a collection +/// of UTF8 bytes: +/// +/// ```swift +/// Parse { +/// Int.parser(of: ArraySlice.self) +/// StartsWith("\n".utf8) +/// } +/// ``` +/// +/// This parser can be transformed into one that processes an incoming stream of UTF8 bytes: +/// +/// ```swift +/// Stream { +/// Parse { +/// Int.parser(of: ArraySlice.self) +/// StartsWith("\n".utf8) +/// } +/// } +/// ``` +/// +/// And then it can be used on a stream, such as values coming from standard in: +/// +/// ```swift +/// var stdin = AnyIterator { +/// readLine().map { ArraySlice($0.utf8) } +/// } +/// +/// try newlineSeparatedIntegers.parse(&stdin) +/// ``` +public struct Stream: Parser where Parsers.Input: RangeReplaceableCollection { + public let parsers: Parsers + + @inlinable + public init(@ParserBuilder build: () -> Parsers) { + self.parsers = build() + } + + @inlinable + public func parse(_ input: inout AnyIterator) rethrows -> [Parsers.Output] { + var buffer = Parsers.Input() + var outputs: Output = [] + while let chunk = input.next() { + buffer.append(contentsOf: chunk) + outputs.append(try self.parsers.parse(&buffer)) + } + return outputs + } +} + +extension Parsers { + public typealias Stream = SwiftTL.Stream // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/UUID.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/UUID.swift new file mode 100644 index 0000000000..bebe31938e --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/UUID.swift @@ -0,0 +1,137 @@ +import Foundation + +extension UUID { + /// A parser that consumes a hexadecimal UUID from the beginning of a collection of UTF-8 code + /// units. + /// + /// ```swift + /// var input = "deadbeef-dead-beef-dead-beefdeadbeef,"[...] + /// try UUID.parser().parse(&input) // DEADBEEF-DEAD-BEEF-DEAD-BEEFDEADBEEF + /// input // "," + /// ``` + /// + /// - Parameter inputType: The collection type of UTF-8 code units to parse. + /// - Returns: A parser that consumes a hexadecimal UUID from the beginning of a collection of + /// UTF-8 code units. + @inlinable + public static func parser( + of inputType: Input.Type = Input.self + ) -> Parsers.UUIDParser { + .init() + } + + /// A parser that consumes a hexadecimal UUID from the beginning of a substring's UTF-8 view. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is + /// `Substring.UTF8View`. + /// + /// - Parameter inputType: The `Substring` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a hexadecimal UUID from the beginning of a substring's UTF-8 + /// view. + @_disfavoredOverload + @inlinable + public static func parser( + of inputType: Substring.UTF8View.Type = Substring.UTF8View.self + ) -> Parsers.UUIDParser { + .init() + } + + /// A parser that consumes a hexadecimal UUID from the beginning of a substring. + /// + /// This overload is provided to allow the `Input` generic to be inferred when it is `Substring`. + /// + /// - Parameter inputType: The `Substring` type. This parameter is included to mirror the + /// interface that parses any collection of UTF-8 code units. + /// - Returns: A parser that consumes a hexadecimal UUID from the beginning of a substring. + @_disfavoredOverload + @inlinable + public static func parser( + of inputType: Substring.Type = Substring.self + ) -> FromUTF8View> { + .init { Parsers.UUIDParser() } + } +} + +extension Parsers { + /// A parser that consumes a UUID from the beginning of a collection of UTF8 code units. + /// + /// You will not typically need to interact with this type directly. Instead you will usually use + /// `UUID.parser()`, which constructs this type. + public struct UUIDParser: Parser + where + Input.SubSequence == Input, + Input.Element == UTF8.CodeUnit + { + @inlinable + public init() {} + + @inlinable + public func parse(_ input: inout Input) throws -> UUID { + func parseHelp(_ bytes: C) throws -> UUID where C: Collection, C.Element == UTF8.CodeUnit { + var prefix = bytes.prefix(36) + guard prefix.count == 36 + else { throw ParsingError.expectedInput("UUID", at: input) } + + @inline(__always) + func digit(for n: UTF8.CodeUnit) throws -> UTF8.CodeUnit { + switch n { + case .init(ascii: "0") ... .init(ascii: "9"): + return UTF8.CodeUnit(n - .init(ascii: "0")) + case .init(ascii: "A") ... .init(ascii: "F"): + return UTF8.CodeUnit(n - .init(ascii: "A") + 10) + case .init(ascii: "a") ... .init(ascii: "f"): + return UTF8.CodeUnit(n - .init(ascii: "a") + 10) + default: + throw ParsingError.expectedInput("UUID", at: input) + } + } + + @inline(__always) + func nextByte() throws -> UInt8 { + try digit(for: prefix.removeFirst()) * 16 + digit(for: prefix.removeFirst()) + } + + @inline(__always) + func chompHyphen() throws { + guard prefix.removeFirst() == .init(ascii: "-") + else { throw ParsingError.expectedInput("UUID", at: input) } + } + + let _00 = try nextByte() + let _01 = try nextByte() + let _02 = try nextByte() + let _03 = try nextByte() + try chompHyphen() + let _04 = try nextByte() + let _05 = try nextByte() + try chompHyphen() + let _06 = try nextByte() + let _07 = try nextByte() + try chompHyphen() + let _08 = try nextByte() + let _09 = try nextByte() + try chompHyphen() + let _10 = try nextByte() + let _11 = try nextByte() + let _12 = try nextByte() + let _13 = try nextByte() + let _14 = try nextByte() + let _15 = try nextByte() + + input.removeFirst(36) + return UUID( + uuid: ( + _00, _01, _02, _03, + _04, _05, + _06, _07, + _08, _09, + _10, _11, _12, _13, _14, _15 + ) + ) + } + + return try input.withContiguousStorageIfAvailable(parseHelp) ?? parseHelp(input) + } + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Whitespace.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Whitespace.swift new file mode 100644 index 0000000000..75617735ab --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/Parsers/Whitespace.swift @@ -0,0 +1,66 @@ +/// A parser that consumes all ASCII whitespace from the beginning of the input. +/// +/// - Note: This parser only consumes ASCII spaces (`" "`), newlines (`"\n"` and `"\r"`), and tabs +/// (`"\t"`). If you need richer support that covers all unicode whitespace, use a ``Prefix`` +/// parser that operates on the `Substring` level with a predicate that consumes whitespace: +/// +/// ```swift +/// Prefix { $0.isWhitespace } +/// ``` +public struct Whitespace: Parser +where + Input.SubSequence == Input, + Bytes.SubSequence == Bytes, + Bytes.Element == UTF8.CodeUnit +{ + @usableFromInline + let toBytes: (Input) -> Bytes + + @usableFromInline + let fromBytes: (Bytes) -> Input + + @inlinable + public func parse(_ input: inout Input) -> Input { + let output = self.toBytes(input).prefix(while: { (byte: UTF8.CodeUnit) in + byte == .init(ascii: " ") + || byte == .init(ascii: "\n") + || byte == .init(ascii: "\r") + || byte == .init(ascii: "\t") + }) + input.removeFirst(output.count) + return self.fromBytes(output) + } +} + +extension Whitespace { + @inlinable + public init() where Bytes == Input { + self.toBytes = { $0 } + self.fromBytes = { $0 } + } +} + +extension Whitespace where Input == Substring, Bytes == Substring.UTF8View { + @_disfavoredOverload + @inlinable + public init() { + self.toBytes = { $0.utf8 } + self.fromBytes = Substring.init + } +} + +/*extension Whitespace where Input == Substring.UTF8View, Bytes == Input { + @_disfavoredOverload + @inlinable + public init() { self.init() } +} + +extension Whitespace where Input == ArraySlice, Bytes == Input { + @_disfavoredOverload + @inlinable + public init() { self.init() } +}*/ + +extension Parsers { + public typealias Whitespace = SwiftTL.Whitespace // NB: Convenience type alias for discovery +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/Parser/ParsingError.swift b/build-system/SwiftTL/Sources/SwiftTL/Parser/ParsingError.swift new file mode 100644 index 0000000000..874d9e4928 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/Parser/ParsingError.swift @@ -0,0 +1,486 @@ +import Foundation + +@usableFromInline +enum ParsingError: Error { + case failed(String, Context) + case manyFailed([Error], Context) + + @usableFromInline + static func expectedInput(_ description: String, at remainingInput: Any) -> Self { + .failed( + summary: "unexpected input", + label: "expected \(description)", + at: remainingInput + ) + } + + @usableFromInline + static func expectedInput( + _ description: String, + from originalInput: Any, + to remainingInput: Any + ) -> Self { + .failed( + summary: "unexpected input", + label: "expected \(description)", + from: originalInput, + to: remainingInput + ) + } + + @usableFromInline + static func failed(summary: String, label: String = "", at remainingInput: Any) -> Self { + .failed(label, .init(remainingInput: remainingInput, debugDescription: summary)) + } + + @usableFromInline + static func failed( + summary: String, label: String = "", from originalInput: Any, to remainingInput: Any + ) -> Self { + .failed( + label, + .init( + originalInput: originalInput, + remainingInput: remainingInput, + debugDescription: summary + ) + ) + } + + @usableFromInline + static func manyFailed(_ errors: [Error], at remainingInput: Any) -> Self { + .manyFailed(errors, .init(remainingInput: remainingInput, debugDescription: "")) + } + + @usableFromInline + static func wrap(_ error: Error, at remainingInput: Any) -> Self { + error as? ParsingError + ?? .failed( + "", + .init( + remainingInput: remainingInput, + debugDescription: formatError(error), + underlyingError: error + ) + ) + } + + @usableFromInline + func flattened() -> Self { + func flatten(_ depth: Int = 0) -> (Error) -> [(depth: Int, error: Error)] { + { error in + switch error { + case let ParsingError.manyFailed(errors, _): + return errors.flatMap(flatten(depth + 1)) + default: + return [(depth, error)] + } + } + } + + switch self { + case .failed: + return self + case let .manyFailed(errors, context): + return .manyFailed( + errors.flatMap(flatten()) + .sorted { + switch ($0.error, $1.error) { + case let (lhs as ParsingError, rhs as ParsingError): + return lhs.context > rhs.context + default: + return $0.depth > $1.depth + } + } + .map { $0.error }, + context + ) + } + } + + @usableFromInline + var context: Context { + switch self { + case let .failed(_, context), let .manyFailed(_, context): + return context + } + } + + @usableFromInline + struct Context { + @usableFromInline + var debugDescription: String + + @usableFromInline + var originalInput: Any + + @usableFromInline + var remainingInput: Any + + @usableFromInline + var underlyingError: Error? + + @usableFromInline + init( + originalInput: Any, + remainingInput: Any, + debugDescription: String, + underlyingError: Error? = nil + ) { + self.originalInput = originalInput + self.remainingInput = remainingInput + self.debugDescription = debugDescription + self.underlyingError = underlyingError + } + + @usableFromInline + init( + remainingInput: Any, + debugDescription: String, + underlyingError: Error? = nil + ) { + self.originalInput = remainingInput + self.remainingInput = remainingInput + self.debugDescription = debugDescription + self.underlyingError = underlyingError + } + } +} + +extension ParsingError: CustomDebugStringConvertible { + @usableFromInline + var debugDescription: String { + switch self.flattened() { + case let .failed(label, context): + return format(labels: [label], context: context) + + case let .manyFailed(errors, context) where errors.isEmpty: + return format(labels: [""], context: context) + + case let .manyFailed(errors, _): + return debugDescription(for: errors) + } + } + + fileprivate func debugDescription(for errors: [Error]) -> String { + func failed(_ error: Error) -> (String, Context)? { + guard + let error = error as? ParsingError, + case .failed(let label, let context) = error + else { return nil } + return (label, context) + } + + var count = 0 + var description = "" + + func append(_ s: String) { + count += 1 + if !description.isEmpty { + description.append("\n\n") + } + description.append(s) + } + + var errors = errors[...] + while let error = errors.popFirst() { + guard case .some((let firstLabel, let firstContext)) = failed(error) else { + append(formatError(error)) + continue + } + + var labels = [firstLabel] + while case .some((let label, let context)) = errors.first.flatMap({ failed($0) }), + firstContext.canGroup(with: context) + { + errors.removeFirst() + labels.append(label) + } + + append(format(labels: labels, context: firstContext)) + } + + if count != 1 { + description = """ + error: multiple failures occurred + + \(description) + """ + } + + return description + } +} + +extension ParsingError.Context { + fileprivate func canGroup(with other: Self) -> Bool { + func areSame(_ lhs: Any, _ rhs: Any) -> Bool { + switch (normalize(lhs), normalize(rhs)) { + case let (lhs as Substring, rhs as Substring): + return lhs.startIndex == rhs.startIndex && lhs.endIndex == rhs.endIndex + case let (lhs as Slice<[Substring]>, rhs as Slice<[Substring]>): + return zip(lhs, rhs).allSatisfy { l, r in + l.startIndex == r.startIndex && l.endIndex == r.endIndex + } + default: + return false + } + } + + return + (areSame(self.remainingInput, other.remainingInput) + && areSame(self.originalInput, other.originalInput) + && self.underlyingError == nil && other.underlyingError == nil) + } +} + +extension Array where Element == (label: String, context: ParsingError.Context) { + fileprivate func allSame(_ keyPath: KeyPath) -> Bool { + guard let first = self.first else { return true } + guard let firstValue = first.context[keyPath: keyPath] as? AnyHashable else { return false } + return self.dropFirst().allSatisfy { + guard let value = $0.context[keyPath: keyPath] as? AnyHashable else { return false } + return value == firstValue + } + } +} + +@usableFromInline +func format(labels: [String], context: ParsingError.Context) -> String { + func formatHelp(from originalInput: Input, to remainingInput: Input) -> String { + switch (normalize(originalInput), normalize(remainingInput)) { + case let (originalInput as Substring, remainingInput as Substring): + let substring = + originalInput.startIndex == remainingInput.startIndex + ? originalInput + : originalInput.base[originalInput.startIndex.., remainingInput as Slice<[Substring]>): + let slice = + originalInput.startIndex == remainingInput.startIndex + ? originalInput + : Slice( + base: originalInput.base, + bounds: originalInput.startIndex.. String { + switch error { + case let error as ParsingError: + return error.debugDescription + + case let error as LocalizedError: + return error.localizedDescription + + default: + return "\(error)" + } +} + +@usableFromInline +func formatValue( + _ input: Input +) -> String { + switch input { + case let input as String: + return input.debugDescription + + case let input as String.UnicodeScalarView: + return String(input).debugDescription + + case let input as String.UTF8View: + return String(input).debugDescription + + case let input as Substring: + return input.debugDescription + + case let input as Substring.UnicodeScalarView: + return Substring(input).debugDescription + + case let input as Substring.UTF8View: + return Substring(input).debugDescription + + default: + return "\(input)" + } +} + +private func formatError( + summary: String, + location: String, + prefix: String, + diagnostic: String +) -> String { + let indent = String(repeating: " ", count: prefix.count) + var diagnostic = + diagnostic + .split(separator: "\n", omittingEmptySubsequences: false) + .map { "\(indent) |\($0.isEmpty ? "" : " \($0)")" } + .joined(separator: "\n") + diagnostic.replaceSubrange(.. \(location) + \(diagnostic) + """ +} + +extension ParsingError.Context { + fileprivate static func > (lhs: Self, rhs: Self) -> Bool { + switch (normalize(lhs.remainingInput), normalize(rhs.remainingInput)) { + case let (lhsInput as Substring, rhsInput as Substring): + return lhsInput.endIndex > rhsInput.endIndex + + case let (lhsInput as Slice<[Substring]>, rhsInput as Slice<[Substring]>): + guard lhsInput.endIndex != rhsInput.endIndex else { + switch (lhs.underlyingError, rhs.underlyingError) { + case let (lhs as ParsingError, rhs as ParsingError): + return lhs.context > rhs.context + case (is ParsingError, _): + return true + default: + return false + } + } + return lhsInput.endIndex > rhsInput.endIndex + + default: + return false + } + } +} + +private func normalize(_ input: Any) -> Any { + // TODO: Use `_openExistential` for `C: Collection where C == C.SubSequence` for index juggling? + switch input { + case let input as Substring: + // NB: We want to ensure we are sliced at a character boundary and not a scalar boundary. + let startIndex = + input.startIndex == input.base.endIndex + ? input.startIndex + : input.base.indices.last { $0 <= input.startIndex } ?? input.startIndex + let endIndex = input.endIndex == input.base.endIndex ? startIndex : input.endIndex + + return input.base[startIndex..: + return input.endIndex == input.base.endIndex ? input[.. Bool { + return lhs.description < rhs.description + } +} + +extension QualifiedName { + init(string: String) { + if let dotRange = string.range(of: ".") { + self.init(namespace: String(string[string.startIndex ..< dotRange.lowerBound]), value: String(string[dotRange.upperBound...])) + } else { + self.init(namespace: nil, value: string) + } + } +} + +enum Resolver { + struct ResolutionError: Error, CustomStringConvertible { + var text: String + + var description: String { + return self.text + } + } + + indirect enum TypeReference { + case int32 + case int64 + case int256 + case double + case bytes + case string + case bool + case boolTrue + case bareVector(TypeReference) + case boxedVector(TypeReference) + case bareConstructor(typeName: QualifiedName, name: QualifiedName) + case boxedType(QualifiedName) + } + + struct Argument { + struct Condition { + var fieldName: String + var bitIndex: Int + } + + var name: String + var type: TypeReference + var condition: Condition? + } + + final class SumType { + struct Constructor { + var name: QualifiedName + var id: UInt32 + var arguments: [Argument] + } + + let name: QualifiedName + var constructors: [QualifiedName: Constructor] = [:] + + init(name: QualifiedName) { + self.name = name + } + } + + struct Function { + var name: QualifiedName + var id: UInt32 + var arguments: [Argument] + var result: TypeReference + } + + static func resolveBuiltinType(name: QualifiedName) -> TypeReference? { + if name.namespace == nil { + if name.value == "int" { + return .int32 + } else if name.value == "long" { + return .int64 + } else if name.value == "int256" { + return .int256 + } else if name.value == "double" { + return .double + } else if name.value == "string" { + return .string + } else if name.value == "bytes" { + return .bytes + } else if name.value == "true" { + return .boolTrue + } + } + return nil + } + + static func resolveTypes(constructors: [DescriptionParser.ConstructorDescription]) throws -> [SumType] { + var constructedTypes: [QualifiedName: [DescriptionParser.ConstructorDescription]] = [:] + var constructorNameToType: [QualifiedName: QualifiedName] = [:] + + for constructorDescription in constructors { + switch constructorDescription.type { + case let .type(name): + if !name.value[name.value.startIndex].isUppercase { + throw ResolutionError(text: "Type constructor \(constructorDescription.name) -> \(name): the resulting type name should begin with a capital letter") + } + + constructedTypes[name, default: []].append(constructorDescription) + + if let _ = constructorNameToType[constructorDescription.name] { + throw ResolutionError(text: "Duplicate type constructor \(constructorDescription.name) found") + } + constructorNameToType[constructorDescription.name] = name + case let .generic(name, argumentType): + throw ResolutionError(text: "Type constructor \(constructorDescription.name) can not be used to construct a generic type \(name)<\(argumentType)>") + } + } + + func resolveTypeReference(description: DescriptionParser.TypeReferenceDescription) throws -> TypeReference { + switch description { + case let .type(name): + if let resolvedBuiltinType = resolveBuiltinType(name: name) { + return resolvedBuiltinType + } + + if name.value[name.value.startIndex].isUppercase { + if let _ = constructedTypes[name] { + return .boxedType(name) + } else { + throw ResolutionError(text: "Unresolved type \(name)") + } + } else { + if let typeName = constructorNameToType[name] { + return .bareConstructor(typeName: typeName, name: name) + } else { + throw ResolutionError(text: "Unresolved type constructor \(name)") + } + } + case let .generic(name, argumentType): + if name == "vector" { + return .bareVector(try resolveTypeReference(description: .type(name: argumentType))) + } else if name == "Vector" { + return .boxedVector(try resolveTypeReference(description: .type(name: argumentType))) + } else { + throw ResolutionError(text: "Unresolved generic type \(name)") + } + } + } + + func resolveArgument(existingArguments: [Argument], description: DescriptionParser.ArgumentDescription) throws -> Argument { + return Argument( + name: description.name, + type: try resolveTypeReference(description: description.type), + condition: try description.condition.flatMap { condition -> Argument.Condition in + if !existingArguments.contains(where: { $0.name == condition.fieldName }) { + throw ResolutionError(text: "Unresolved conditional field reference to \(condition.fieldName)") + } + return Argument.Condition(fieldName: condition.fieldName, bitIndex: condition.bitIndex) + } + ) + } + + var types: [QualifiedName: SumType] = [:] + + for (typeName, constructorDescriptions) in constructedTypes { + let type = SumType(name: typeName) + + for constructorDescription in constructorDescriptions { + var arguments: [Argument] = [] + + for argumentDescription in constructorDescription.arguments { + arguments.append(try resolveArgument(existingArguments: arguments, description: argumentDescription)) + } + + guard let id = constructorDescription.explicitId else { + throw ResolutionError(text: "Constructor \(constructorDescription.name) does not have an id") + } + + type.constructors[constructorDescription.name] = SumType.Constructor( + name: constructorDescription.name, + id: id, + arguments: arguments + ) + } + + types[type.name] = type + } + + return types.values.sorted(by: { $0.name < $1.name }) + } + + static func resolveFunctions(types: [SumType], functionDescriptions: [DescriptionParser.ConstructorDescription]) throws -> [Function] { + var functions: [QualifiedName: Function] = [:] + + var typeMap: [QualifiedName: SumType] = [:] + var constructorMap: [QualifiedName: SumType] = [:] + + for type in types { + typeMap[type.name] = type + + for (_, constructor) in type.constructors { + constructorMap[constructor.name] = type + } + } + + func resolveTypeReference(description: DescriptionParser.TypeReferenceDescription) throws -> TypeReference { + switch description { + case let .type(name): + if let resolvedBuiltinType = resolveBuiltinType(name: name) { + return resolvedBuiltinType + } + + if name.value[name.value.startIndex].isUppercase { + if let _ = typeMap[name] { + return .boxedType(name) + } else { + throw ResolutionError(text: "Unresolved type \(name)") + } + } else { + if let type = constructorMap[name] { + return .bareConstructor(typeName: type.name, name: name) + } else { + throw ResolutionError(text: "Unresolved type constructor \(name)") + } + } + case let .generic(name, argumentType): + if name == "vector" { + return .bareVector(try resolveTypeReference(description: .type(name: argumentType))) + } else if name == "Vector" { + return .boxedVector(try resolveTypeReference(description: .type(name: argumentType))) + } else { + throw ResolutionError(text: "Unresolved generic type \(name)") + } + } + } + + func resolveArgument(existingArguments: [Argument], description: DescriptionParser.ArgumentDescription) throws -> Argument { + return Argument( + name: description.name, + type: try resolveTypeReference(description: description.type), + condition: try description.condition.flatMap { condition -> Argument.Condition in + if !existingArguments.contains(where: { $0.name == condition.fieldName }) { + throw ResolutionError(text: "Unresolved conditional field reference to \(condition.fieldName)") + } + return Argument.Condition(fieldName: condition.fieldName, bitIndex: condition.bitIndex) + } + ) + } + + for functionDescription in functionDescriptions { + var arguments: [Argument] = [] + + for argumentDescription in functionDescription.arguments { + arguments.append(try resolveArgument(existingArguments: arguments, description: argumentDescription)) + } + + let result = try resolveTypeReference(description: functionDescription.type) + + guard let id = functionDescription.explicitId else { + throw ResolutionError(text: "Function \(functionDescription.name) does not have an id") + } + + functions[functionDescription.name] = Function( + name: functionDescription.name, + id: id, + arguments: arguments, + result: result + ) + } + + return functions.values.sorted(by: { $0.name < $1.name }) + } +} diff --git a/build-system/SwiftTL/Sources/SwiftTL/main.swift b/build-system/SwiftTL/Sources/SwiftTL/main.swift new file mode 100644 index 0000000000..30aa736667 --- /dev/null +++ b/build-system/SwiftTL/Sources/SwiftTL/main.swift @@ -0,0 +1,130 @@ +import Foundation + +private extension String { + var camelCased: String { + var result = "" + var capitalizeNext = false + for c in self { + if c == "_" { + capitalizeNext = true + } else { + if capitalizeNext { + capitalizeNext = false + result.append(c.uppercased()) + } else { + result.append(c) + } + } + } + return result + } +} + +if CommandLine.arguments.count < 3 { + print("Usage: SwiftTL path-to-scheme.tl path-to-output-folder [--stub-functions] [--print-constructors=N-M]") + exit(0) +} + +let schemeFilePath = CommandLine.arguments[1] +let outputDirectoryPath = CommandLine.arguments[2] + +var stubFunctions = false +var printConstructorsRange: (start: Int, end: Int)? = nil +for arg in CommandLine.arguments { + if arg == "--stub-functions" { + stubFunctions = true + } + if arg.hasPrefix("--print-constructors=") { + let value = String(arg.dropFirst("--print-constructors=".count)) + let parts = value.split(separator: "-") + if parts.count == 2, let start = Int(parts[0]), let end = Int(parts[1]) { + if start > end { + print("Error: Invalid range for --print-constructors: start (\(start)) must be <= end (\(end))") + exit(1) + } + printConstructorsRange = (start, end) + } else { + print("Error: Invalid format for --print-constructors. Expected: --print-constructors=N-M (e.g., --print-constructors=0-10)") + exit(1) + } + } +} + +guard let data = try? String(contentsOfFile: schemeFilePath) else { + print("Could not open scheme file \(schemeFilePath)") + exit(1) +} + +do { + let parsedData = try DescriptionParser.parse(data: data) + let resolvedTypes = try Resolver.resolveTypes(constructors: parsedData.constructors) + var resolvedFunctions = try Resolver.resolveFunctions(types: resolvedTypes, functionDescriptions: parsedData.functions) + + resolvedFunctions.append(Resolver.Function(name: QualifiedName(namespace: "help", value: "test"), id: 0xc0e202f7, arguments: [], result: .boxedType(QualifiedName(namespace: nil, value: "Bool")))) + + var constructorOrder: [(typeName: QualifiedName, constructorName: String)] = [] + var typeOrder: [(types: [(typeName: QualifiedName, constructorNames: [String])], functions: [QualifiedName])] = [] + + let sortedTypes = resolvedTypes.sorted(by: { $0.name < $1.name }) + + if let range = printConstructorsRange { + print("--- CONSTRUCTORS ---") + for (index, type) in sortedTypes.enumerated() { + if index >= range.start && index < range.end { + for constructor in type.constructors.values.sorted(by: { $0.name < $1.name }) { + let storedArguments = constructor.arguments.filter { + if case .boolTrue = $0.type { return false } + return true + } + if !storedArguments.isEmpty { + let fieldNames = storedArguments.map { $0.name.camelCased } + print("\(constructor.name.value):\(fieldNames.joined(separator: ","))") + } + } + } + } + print("--- END CONSTRUCTORS ---") + print("Total types: \(sortedTypes.count)") + exit(0) + } + + for type in sortedTypes { + for constructor in type.constructors.values.sorted(by: { $0.name < $1.name }) { + constructorOrder.append((type.name, constructor.name.value)) + } + } + + var totalConstructorCount = 0 + var currentConstructorCount = 0 + for type in sortedTypes { + if typeOrder.isEmpty || currentConstructorCount >= 32 { + typeOrder.append(([], [])) + currentConstructorCount = 0 + } + + typeOrder[typeOrder.count - 1].types.append((type.name, type.constructors.values.sorted(by: { $0.name < $1.name }).map(\.name.value))) + + currentConstructorCount += type.constructors.count + totalConstructorCount += type.constructors.count + + if totalConstructorCount > 40 { + } + } + + typeOrder.append(([], [])) + for function in resolvedFunctions.sorted(by: { $0.name < $1.name }) { + typeOrder[typeOrder.count - 1].functions.append(function.name) + } + + try FileManager.default.createDirectory(at: URL(fileURLWithPath: outputDirectoryPath), withIntermediateDirectories: true, attributes: nil) + + let generatedFiles = try CodeGenerator.generate(types: resolvedTypes, functions: resolvedFunctions, constructorOrder: constructorOrder, typeOrder: typeOrder, stubFunctions: stubFunctions) + + for (name, fileData) in generatedFiles { + let filePath = URL(fileURLWithPath: outputDirectoryPath).appendingPathComponent(name).path + let _ = try? FileManager.default.removeItem(atPath: filePath) + try fileData.write(toFile: filePath, atomically: true, encoding: .utf8) + } +} catch let e { + print("\(e)") +} diff --git a/submodules/AccountContext/Sources/AccountContext.swift b/submodules/AccountContext/Sources/AccountContext.swift index fbe392b279..cf18c1f79e 100644 --- a/submodules/AccountContext/Sources/AccountContext.swift +++ b/submodules/AccountContext/Sources/AccountContext.swift @@ -1408,7 +1408,7 @@ public protocol SharedAccountContext: AnyObject { func makeSetupTwoFactorAuthController(context: AccountContext) -> ViewController func makeStorageManagementController(context: AccountContext) -> ViewController func makeAttachmentFileController(context: AccountContext, updatedPresentationData: (initial: PresentationData, signal: Signal)?, audio: Bool, bannedSendMedia: (Int32, Bool)?, presentGallery: @escaping () -> Void, presentFiles: @escaping () -> Void, presentDocumentScanner: (() -> Void)?, send: @escaping ([AnyMediaReference], Bool, Int32?, NSAttributedString?) -> Void) -> AttachmentFileController - func makeGalleryCaptionPanelView(context: AccountContext, chatLocation: ChatLocation, isScheduledMessages: Bool, isFile: Bool, hasTimer: Bool, customEmojiAvailable: Bool, present: @escaping (ViewController) -> Void, presentInGlobalOverlay: @escaping (ViewController) -> Void) -> NSObject? + func makeGalleryCaptionPanelView(context: AccountContext, chatLocation: ChatLocation, isScheduledMessages: Bool, isFile: Bool, hasTimer: Bool, customEmojiAvailable: Bool, pushViewController: @escaping (ViewController) -> Void, present: @escaping (ViewController) -> Void, presentInGlobalOverlay: @escaping (ViewController) -> Void) -> NSObject? func makeHashtagSearchController(context: AccountContext, peer: EnginePeer?, query: String, stories: Bool, forceDark: Bool) -> ViewController func makeStorySearchController(context: AccountContext, scope: StorySearchControllerScope, listContext: SearchStoryListContext?) -> ViewController func makeMyStoriesController(context: AccountContext, isArchive: Bool) -> ViewController @@ -1560,6 +1560,7 @@ public protocol SharedAccountContext: AnyObject { func makeChatRankPreviewItem(context: AccountContext, peer: EnginePeer, rank: String, rankRole: ChatRankInfoScreenRole, theme: PresentationTheme, strings: PresentationStrings, wallpaper: TelegramWallpaper, fontSize: PresentationFontSize, chatBubbleCorners: PresentationChatBubbleCorners, dateTimeFormat: PresentationDateTimeFormat, nameOrder: PresentationPersonNameOrder, sectionId: Int32) -> ListViewItem func makeTextProcessingScreen( context: AccountContext, + theme: PresentationTheme?, mode: TextProcessingScreenMode, ignoredTranslationLanguages: [String], inputText: TextWithEntities, diff --git a/submodules/AttachmentUI/Sources/AttachmentController.swift b/submodules/AttachmentUI/Sources/AttachmentController.swift index 3916affc8a..ca9f40784e 100644 --- a/submodules/AttachmentUI/Sources/AttachmentController.swift +++ b/submodules/AttachmentUI/Sources/AttachmentController.swift @@ -771,6 +771,7 @@ public class AttachmentController: ViewController, MinimizableController { let textProcessingScreen = await controller.context.sharedContext.makeTextProcessingScreen( context: controller.context, + theme: self.presentationData.theme, mode: .edit( saveRestoreStateId: nil, completion: { [weak self] text in diff --git a/submodules/AttachmentUI/Sources/AttachmentPanel.swift b/submodules/AttachmentUI/Sources/AttachmentPanel.swift index 211858a90e..bfd2e6adf3 100644 --- a/submodules/AttachmentUI/Sources/AttachmentPanel.swift +++ b/submodules/AttachmentUI/Sources/AttachmentPanel.swift @@ -2226,7 +2226,10 @@ final class AttachmentPanel: ASDisplayNode, ASScrollViewDelegate, ASGestureRecog strongSelf.present(c) } }, makeEntityInputView: self.makeEntityInputView) - textInputPanelNode.isAIEnabled = true + if let data = self.context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_chat"] as? Double, value == 1.0 { + } else { + textInputPanelNode.isAIEnabled = true + } textInputPanelNode.interfaceInteraction = self.interfaceInteraction textInputPanelNode.sendMessage = { [weak self] mode, messageEffect in if let strongSelf = self { diff --git a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift index 9a293cb39f..7329c1f7ed 100644 --- a/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift +++ b/submodules/ChatListUI/Sources/ChatListSearchListPaneNode.swift @@ -1191,6 +1191,7 @@ public enum ChatListSearchEntry: Comparable, Identifiable { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, @@ -5838,6 +5839,7 @@ public final class ChatListSearchShimmerNode: ASDisplayNode { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/ChatListUI/Sources/ChatListShimmerNode.swift b/submodules/ChatListUI/Sources/ChatListShimmerNode.swift index 6ca1a33b87..68b09cf72a 100644 --- a/submodules/ChatListUI/Sources/ChatListShimmerNode.swift +++ b/submodules/ChatListUI/Sources/ChatListShimmerNode.swift @@ -204,6 +204,7 @@ public final class ChatListShimmerNode: ASDisplayNode { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 911b55d7bc..ec2a65f95a 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -145,6 +145,7 @@ public enum ChatListItemContent { public var presence: EnginePeer.Presence? public var hasUnseenMentions: Bool public var hasUnseenReactions: Bool + public var hasUnseenPollVotes: Bool public var draftState: DraftState? public var mediaDraftContentType: EngineChatList.MediaDraftContentType? public var inputActivities: [(EnginePeer, PeerInputActivity)]? @@ -170,6 +171,7 @@ public enum ChatListItemContent { presence: EnginePeer.Presence?, hasUnseenMentions: Bool, hasUnseenReactions: Bool, + hasUnseenPollVotes: Bool, draftState: DraftState?, mediaDraftContentType: EngineChatList.MediaDraftContentType?, inputActivities: [(EnginePeer, PeerInputActivity)]?, @@ -194,6 +196,7 @@ public enum ChatListItemContent { self.presence = presence self.hasUnseenMentions = hasUnseenMentions self.hasUnseenReactions = hasUnseenReactions + self.hasUnseenPollVotes = hasUnseenPollVotes self.draftState = draftState self.mediaDraftContentType = mediaDraftContentType self.inputActivities = inputActivities @@ -2192,6 +2195,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { let mediaDraftContentType: EngineChatList.MediaDraftContentType? let hasUnseenMentions: Bool let hasUnseenReactions: Bool + let hasUnseenPollVotes: Bool let inputActivities: [(EnginePeer, PeerInputActivity)]? let isPeerGroup: Bool let promoInfo: ChatListNodeEntryPromoInfo? @@ -2217,6 +2221,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { mediaDraftContentType = nil hasUnseenMentions = false hasUnseenReactions = false + hasUnseenPollVotes = false inputActivities = nil isPeerGroup = false promoInfo = nil @@ -2231,6 +2236,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { let peerPresenceValue = peerData.presence let hasUnseenMentionsValue = peerData.hasUnseenMentions let hasUnseenReactionsValue = peerData.hasUnseenReactions + let hasUnseenPollVotesValue = peerData.hasUnseenPollVotes let draftStateValue = peerData.draftState let inputActivitiesValue = peerData.inputActivities let promoInfoValue = peerData.promoInfo @@ -2264,6 +2270,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { threadInfo = threadInfoValue hasUnseenMentions = hasUnseenMentionsValue hasUnseenReactions = hasUnseenReactionsValue + hasUnseenPollVotes = hasUnseenPollVotesValue forumTopicData = forumTopicDataValue topForumTopicItems = topForumTopicItemsValue @@ -2318,6 +2325,7 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { mediaDraftContentType = nil hasUnseenMentions = false hasUnseenReactions = false + hasUnseenPollVotes = false inputActivities = nil isPeerGroup = true groupHiddenByDefault = hiddenByDefault @@ -3295,6 +3303,13 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { currentMentionBadgeImage = PresentationResourcesChatList.badgeBackgroundReactions(item.presentationData.theme, diameter: badgeDiameter) } mentionBadgeContent = .mention + } else if hasUnseenPollVotes { + if isRemovedFromTotalUnreadCount { + currentMentionBadgeImage = PresentationResourcesChatList.badgeBackgroundInactivePollVotes(item.presentationData.theme, diameter: badgeDiameter) + } else { + currentMentionBadgeImage = PresentationResourcesChatList.badgeBackgroundPollVotes(item.presentationData.theme, diameter: badgeDiameter) + } + mentionBadgeContent = .mention } else if item.isPinned, promoInfo == nil, currentBadgeBackgroundImage == nil { currentPinnedIconImage = PresentationResourcesChatList.badgeBackgroundPinned(item.presentationData.theme, diameter: badgeDiameter) } diff --git a/submodules/ChatListUI/Sources/Node/ChatListNode.swift b/submodules/ChatListUI/Sources/Node/ChatListNode.swift index f207a1e779..4236fb048a 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNode.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNode.swift @@ -409,6 +409,7 @@ private func mappedInsertEntries(context: AccountContext, nodeInteraction: ChatL let presence = peerEntry.presence let hasUnseenMentions = peerEntry.hasUnseenMentions let hasUnseenReactions = peerEntry.hasUnseenReactions + let hasUnseenPollVotes = peerEntry.hasUnseenPollVotes let editing = peerEntry.editing let hasActiveRevealControls = peerEntry.hasActiveRevealControls let selected = peerEntry.selected @@ -437,6 +438,7 @@ private func mappedInsertEntries(context: AccountContext, nodeInteraction: ChatL presence: presence, hasUnseenMentions: hasUnseenMentions, hasUnseenReactions: hasUnseenReactions, + hasUnseenPollVotes: hasUnseenPollVotes, draftState: draftState, mediaDraftContentType: peerEntry.mediaDraftContentType, inputActivities: inputActivities, @@ -768,6 +770,7 @@ private func mappedUpdateEntries(context: AccountContext, nodeInteraction: ChatL let presence = peerEntry.presence let hasUnseenMentions = peerEntry.hasUnseenMentions let hasUnseenReactions = peerEntry.hasUnseenReactions + let hasUnseenPollVotes = peerEntry.hasUnseenPollVotes let editing = peerEntry.editing let hasActiveRevealControls = peerEntry.hasActiveRevealControls let selected = peerEntry.selected @@ -796,6 +799,7 @@ private func mappedUpdateEntries(context: AccountContext, nodeInteraction: ChatL presence: presence, hasUnseenMentions: hasUnseenMentions, hasUnseenReactions: hasUnseenReactions, + hasUnseenPollVotes: hasUnseenPollVotes, draftState: draftState, mediaDraftContentType: peerEntry.mediaDraftContentType, inputActivities: inputActivities, diff --git a/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift b/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift index cd42c2a482..879c0daeb8 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNodeEntries.swift @@ -93,6 +93,7 @@ enum ChatListNodeEntry: Comparable, Identifiable { var presence: EnginePeer.Presence? var hasUnseenMentions: Bool var hasUnseenReactions: Bool + var hasUnseenPollVotes: Bool var editing: Bool var hasActiveRevealControls: Bool var selected: Bool @@ -121,6 +122,7 @@ enum ChatListNodeEntry: Comparable, Identifiable { presence: EnginePeer.Presence?, hasUnseenMentions: Bool, hasUnseenReactions: Bool, + hasUnseenPollVotes: Bool, editing: Bool, hasActiveRevealControls: Bool, selected: Bool, @@ -148,6 +150,7 @@ enum ChatListNodeEntry: Comparable, Identifiable { self.presence = presence self.hasUnseenMentions = hasUnseenMentions self.hasUnseenReactions = hasUnseenReactions + self.hasUnseenPollVotes = hasUnseenPollVotes self.editing = editing self.hasActiveRevealControls = hasActiveRevealControls self.selected = selected @@ -238,6 +241,9 @@ enum ChatListNodeEntry: Comparable, Identifiable { if lhs.hasUnseenReactions != rhs.hasUnseenReactions { return false } + if lhs.hasUnseenPollVotes != rhs.hasUnseenPollVotes { + return false + } if let lhsInputActivities = lhs.inputActivities, let rhsInputActivities = rhs.inputActivities { if lhsInputActivities.count != rhsInputActivities.count { return false @@ -706,6 +712,7 @@ func chatListNodeEntriesForView(view: EngineChatList, state: ChatListNodeState, presence: entry.presence, hasUnseenMentions: entry.hasUnseenMentions, hasUnseenReactions: entry.hasUnseenReactions, + hasUnseenPollVotes: entry.hasUnseenPollVotes, editing: state.editing, hasActiveRevealControls: hasActiveRevealControls, selected: isSelected, @@ -764,6 +771,7 @@ func chatListNodeEntriesForView(view: EngineChatList, state: ChatListNodeState, presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, editing: state.editing, hasActiveRevealControls: false, selected: state.selectedPeerIds.contains(peer.0.id), @@ -799,6 +807,7 @@ func chatListNodeEntriesForView(view: EngineChatList, state: ChatListNodeState, presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, editing: state.editing, hasActiveRevealControls: false, selected: state.selectedPeerIds.contains(savedMessagesPeer.id), @@ -855,6 +864,7 @@ func chatListNodeEntriesForView(view: EngineChatList, state: ChatListNodeState, presence: item.item.presence, hasUnseenMentions: item.item.hasUnseenMentions, hasUnseenReactions: item.item.hasUnseenReactions, + hasUnseenPollVotes: item.item.hasUnseenPollVotes, editing: state.editing, hasActiveRevealControls: ChatListNodeState.ItemId(peerId: peerId, threadId: threadId) == state.peerIdWithRevealedOptions, selected: isSelected, diff --git a/submodules/ChatListUI/Sources/Node/ChatListNodeLocation.swift b/submodules/ChatListUI/Sources/Node/ChatListNodeLocation.swift index 9fc1cca413..55bb481a41 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListNodeLocation.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListNodeLocation.swift @@ -190,7 +190,14 @@ public func chatListViewForLocation(chatListLocation: ChatListControllerLocation ), ChatListEntryMessageTagSummaryKey( tag: .unseenReaction, - actionType: PendingMessageActionType.readReaction + actionType: PendingMessageActionType.readReactionOrPollVote + ): ChatListEntrySummaryComponents.Component( + tagSummary: ChatListEntryMessageTagSummaryComponent(namespace: Namespaces.Message.Cloud), + actionsSummary: ChatListEntryPendingMessageActionsSummaryComponent(namespace: Namespaces.Message.Cloud) + ), + ChatListEntryMessageTagSummaryKey( + tag: .unseenPollVote, + actionType: PendingMessageActionType.readReactionOrPollVote ): ChatListEntrySummaryComponents.Component( tagSummary: ChatListEntryMessageTagSummaryComponent(namespace: Namespaces.Message.Cloud), actionsSummary: ChatListEntryPendingMessageActionsSummaryComponent(namespace: Namespaces.Message.Cloud) @@ -255,9 +262,17 @@ public func chatListViewForLocation(chatListLocation: ChatListControllerLocation var hasUnseenReactions = false if let info = item.tagSummaryInfo[ChatListEntryMessageTagSummaryKey( tag: .unseenReaction, - actionType: PendingMessageActionType.readReaction + actionType: PendingMessageActionType.readReactionOrPollVote )] { - hasUnseenReactions = (info.tagSummaryCount ?? 0) != 0// > (info.actionsSummaryCount ?? 0) + hasUnseenReactions = (info.tagSummaryCount ?? 0) != 0 + } + + var hasUnseenPollVotes = false + if let info = item.tagSummaryInfo[ChatListEntryMessageTagSummaryKey( + tag: .unseenPollVote, + actionType: PendingMessageActionType.readReactionOrPollVote + )] { + hasUnseenPollVotes = (info.tagSummaryCount ?? 0) != 0 } let pinnedIndex: EngineChatList.Item.PinnedIndex @@ -295,6 +310,7 @@ public func chatListViewForLocation(chatListLocation: ChatListControllerLocation presence: nil, hasUnseenMentions: hasUnseenMentions, hasUnseenReactions: hasUnseenReactions, + hasUnseenPollVotes: hasUnseenPollVotes, forumTopicData: nil, topForumTopicItems: [], hasFailed: false, @@ -385,6 +401,7 @@ public func chatListViewForLocation(chatListLocation: ChatListControllerLocation presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, forumTopicData: nil, topForumTopicItems: [], hasFailed: false, diff --git a/submodules/Components/ResizableSheetComponent/Sources/ResizableSheetComponent.swift b/submodules/Components/ResizableSheetComponent/Sources/ResizableSheetComponent.swift index 5b1e58f2dd..852881033d 100644 --- a/submodules/Components/ResizableSheetComponent/Sources/ResizableSheetComponent.swift +++ b/submodules/Components/ResizableSheetComponent/Sources/ResizableSheetComponent.swift @@ -466,7 +466,7 @@ public final class ResizableSheetComponent Any?] = { dict[-531931925] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsMentions($0) } dict[-566281095] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsRecent($0) } dict[106343499] = { return Api.ChannelParticipantsFilter.parse_channelParticipantsSearch($0) } - dict[-1817845901] = { return Api.ChannelTopic.parse_channelTopic($0) } dict[473084188] = { return Api.Chat.parse_channel($0) } dict[399807445] = { return Api.Chat.parse_channelForbidden($0) } dict[1103884886] = { return Api.Chat.parse_chat($0) } @@ -799,7 +798,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-193510921] = { return Api.PeerSettings.parse_peerSettings($0) } dict[-1707742823] = { return Api.PeerStories.parse_peerStories($0) } dict[-404214254] = { return Api.PendingSuggestion.parse_pendingSuggestion($0) } - dict[431767677] = { return Api.PersonalChannel.parse_personalChannel($0) } dict[810769141] = { return Api.PhoneCall.parse_phoneCall($0) } dict[912311057] = { return Api.PhoneCall.parse_phoneCallAccepted($0) } dict[1355435489] = { return Api.PhoneCall.parse_phoneCallDiscarded($0) } @@ -1368,8 +1366,6 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = { dict[-541588713] = { return Api.channels.ChannelParticipant.parse_channelParticipant($0) } dict[-1699676497] = { return Api.channels.ChannelParticipants.parse_channelParticipants($0) } dict[-266911767] = { return Api.channels.ChannelParticipants.parse_channelParticipantsNotModified($0) } - dict[824755388] = { return Api.channels.Found.parse_found($0) } - dict[-694491059] = { return Api.channels.PersonalChannels.parse_personalChannels($0) } dict[-191450938] = { return Api.channels.SendAsPeers.parse_sendAsPeers($0) } dict[1044107055] = { return Api.channels.SponsoredMessageReportResult.parse_sponsoredMessageReportResultAdsHidden($0) } dict[-2073059774] = { return Api.channels.SponsoredMessageReportResult.parse_sponsoredMessageReportResultChooseOption($0) } @@ -1772,8 +1768,6 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.ChannelParticipantsFilter: _1.serialize(buffer, boxed) - case let _1 as Api.ChannelTopic: - _1.serialize(buffer, boxed) case let _1 as Api.Chat: _1.serialize(buffer, boxed) case let _1 as Api.ChatAdminRights: @@ -2152,8 +2146,6 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.PendingSuggestion: _1.serialize(buffer, boxed) - case let _1 as Api.PersonalChannel: - _1.serialize(buffer, boxed) case let _1 as Api.PhoneCall: _1.serialize(buffer, boxed) case let _1 as Api.PhoneCallDiscardReason: @@ -2512,10 +2504,6 @@ public extension Api { _1.serialize(buffer, boxed) case let _1 as Api.channels.ChannelParticipants: _1.serialize(buffer, boxed) - case let _1 as Api.channels.Found: - _1.serialize(buffer, boxed) - case let _1 as Api.channels.PersonalChannels: - _1.serialize(buffer, boxed) case let _1 as Api.channels.SendAsPeers: _1.serialize(buffer, boxed) case let _1 as Api.channels.SponsoredMessageReportResult: diff --git a/submodules/TelegramApi/Sources/Api1.swift b/submodules/TelegramApi/Sources/Api1.swift index d4ffca28b0..b7c6682f33 100644 --- a/submodules/TelegramApi/Sources/Api1.swift +++ b/submodules/TelegramApi/Sources/Api1.swift @@ -5,8 +5,8 @@ public extension Api { public init(days: Int32) { self.days = days } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("accountDaysTTL", [("days", self.days as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("accountDaysTTL", [("days", ConstructorParameterDescription(self.days))]) } } case accountDaysTTL(Cons_accountDaysTTL) @@ -22,10 +22,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .accountDaysTTL(let _data): - return ("accountDaysTTL", [("days", _data.days as Any)]) + return ("accountDaysTTL", [("days", ConstructorParameterDescription(_data.days))]) } } @@ -57,8 +57,8 @@ public extension Api { self.peerTypes = peerTypes self.icons = icons } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("attachMenuBot", [("flags", self.flags as Any), ("botId", self.botId as Any), ("shortName", self.shortName as Any), ("peerTypes", self.peerTypes as Any), ("icons", self.icons as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("attachMenuBot", [("flags", ConstructorParameterDescription(self.flags)), ("botId", ConstructorParameterDescription(self.botId)), ("shortName", ConstructorParameterDescription(self.shortName)), ("peerTypes", ConstructorParameterDescription(self.peerTypes)), ("icons", ConstructorParameterDescription(self.icons))]) } } case attachMenuBot(Cons_attachMenuBot) @@ -88,10 +88,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .attachMenuBot(let _data): - return ("attachMenuBot", [("flags", _data.flags as Any), ("botId", _data.botId as Any), ("shortName", _data.shortName as Any), ("peerTypes", _data.peerTypes as Any), ("icons", _data.icons as Any)]) + return ("attachMenuBot", [("flags", ConstructorParameterDescription(_data.flags)), ("botId", ConstructorParameterDescription(_data.botId)), ("shortName", ConstructorParameterDescription(_data.shortName)), ("peerTypes", ConstructorParameterDescription(_data.peerTypes)), ("icons", ConstructorParameterDescription(_data.icons))]) } } @@ -139,8 +139,8 @@ public extension Api { self.icon = icon self.colors = colors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("attachMenuBotIcon", [("flags", self.flags as Any), ("name", self.name as Any), ("icon", self.icon as Any), ("colors", self.colors as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("attachMenuBotIcon", [("flags", ConstructorParameterDescription(self.flags)), ("name", ConstructorParameterDescription(self.name)), ("icon", ConstructorParameterDescription(self.icon)), ("colors", ConstructorParameterDescription(self.colors))]) } } case attachMenuBotIcon(Cons_attachMenuBotIcon) @@ -165,10 +165,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .attachMenuBotIcon(let _data): - return ("attachMenuBotIcon", [("flags", _data.flags as Any), ("name", _data.name as Any), ("icon", _data.icon as Any), ("colors", _data.colors as Any)]) + return ("attachMenuBotIcon", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("icon", ConstructorParameterDescription(_data.icon)), ("colors", ConstructorParameterDescription(_data.colors))]) } } @@ -209,8 +209,8 @@ public extension Api { self.name = name self.color = color } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("attachMenuBotIconColor", [("name", self.name as Any), ("color", self.color as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("attachMenuBotIconColor", [("name", ConstructorParameterDescription(self.name)), ("color", ConstructorParameterDescription(self.color))]) } } case attachMenuBotIconColor(Cons_attachMenuBotIconColor) @@ -227,10 +227,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .attachMenuBotIconColor(let _data): - return ("attachMenuBotIconColor", [("name", _data.name as Any), ("color", _data.color as Any)]) + return ("attachMenuBotIconColor", [("name", ConstructorParameterDescription(_data.name)), ("color", ConstructorParameterDescription(_data.color))]) } } @@ -261,8 +261,8 @@ public extension Api { self.bots = bots self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("attachMenuBots", [("hash", self.hash as Any), ("bots", self.bots as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("attachMenuBots", [("hash", ConstructorParameterDescription(self.hash)), ("bots", ConstructorParameterDescription(self.bots)), ("users", ConstructorParameterDescription(self.users))]) } } case attachMenuBots(Cons_attachMenuBots) @@ -294,10 +294,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .attachMenuBots(let _data): - return ("attachMenuBots", [("hash", _data.hash as Any), ("bots", _data.bots as Any), ("users", _data.users as Any)]) + return ("attachMenuBots", [("hash", ConstructorParameterDescription(_data.hash)), ("bots", ConstructorParameterDescription(_data.bots)), ("users", ConstructorParameterDescription(_data.users))]) case .attachMenuBotsNotModified: return ("attachMenuBotsNotModified", []) } @@ -338,8 +338,8 @@ public extension Api { self.bot = bot self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("attachMenuBotsBot", [("bot", self.bot as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("attachMenuBotsBot", [("bot", ConstructorParameterDescription(self.bot)), ("users", ConstructorParameterDescription(self.users))]) } } case attachMenuBotsBot(Cons_attachMenuBotsBot) @@ -360,10 +360,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .attachMenuBotsBot(let _data): - return ("attachMenuBotsBot", [("bot", _data.bot as Any), ("users", _data.users as Any)]) + return ("attachMenuBotsBot", [("bot", ConstructorParameterDescription(_data.bot)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -425,7 +425,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .attachMenuPeerTypeBotPM: return ("attachMenuPeerTypeBotPM", []) @@ -468,8 +468,8 @@ public extension Api { self.amount = amount self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("auctionBidLevel", [("pos", self.pos as Any), ("amount", self.amount as Any), ("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("auctionBidLevel", [("pos", ConstructorParameterDescription(self.pos)), ("amount", ConstructorParameterDescription(self.amount)), ("date", ConstructorParameterDescription(self.date))]) } } case auctionBidLevel(Cons_auctionBidLevel) @@ -487,10 +487,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .auctionBidLevel(let _data): - return ("auctionBidLevel", [("pos", _data.pos as Any), ("amount", _data.amount as Any), ("date", _data.date as Any)]) + return ("auctionBidLevel", [("pos", ConstructorParameterDescription(_data.pos)), ("amount", ConstructorParameterDescription(_data.amount)), ("date", ConstructorParameterDescription(_data.date))]) } } @@ -544,8 +544,8 @@ public extension Api { self.country = country self.region = region } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("authorization", [("flags", self.flags as Any), ("hash", self.hash as Any), ("deviceModel", self.deviceModel as Any), ("platform", self.platform as Any), ("systemVersion", self.systemVersion as Any), ("apiId", self.apiId as Any), ("appName", self.appName as Any), ("appVersion", self.appVersion as Any), ("dateCreated", self.dateCreated as Any), ("dateActive", self.dateActive as Any), ("ip", self.ip as Any), ("country", self.country as Any), ("region", self.region as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("authorization", [("flags", ConstructorParameterDescription(self.flags)), ("hash", ConstructorParameterDescription(self.hash)), ("deviceModel", ConstructorParameterDescription(self.deviceModel)), ("platform", ConstructorParameterDescription(self.platform)), ("systemVersion", ConstructorParameterDescription(self.systemVersion)), ("apiId", ConstructorParameterDescription(self.apiId)), ("appName", ConstructorParameterDescription(self.appName)), ("appVersion", ConstructorParameterDescription(self.appVersion)), ("dateCreated", ConstructorParameterDescription(self.dateCreated)), ("dateActive", ConstructorParameterDescription(self.dateActive)), ("ip", ConstructorParameterDescription(self.ip)), ("country", ConstructorParameterDescription(self.country)), ("region", ConstructorParameterDescription(self.region))]) } } case authorization(Cons_authorization) @@ -573,10 +573,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .authorization(let _data): - return ("authorization", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("deviceModel", _data.deviceModel as Any), ("platform", _data.platform as Any), ("systemVersion", _data.systemVersion as Any), ("apiId", _data.apiId as Any), ("appName", _data.appName as Any), ("appVersion", _data.appVersion as Any), ("dateCreated", _data.dateCreated as Any), ("dateActive", _data.dateActive as Any), ("ip", _data.ip as Any), ("country", _data.country as Any), ("region", _data.region as Any)]) + return ("authorization", [("flags", ConstructorParameterDescription(_data.flags)), ("hash", ConstructorParameterDescription(_data.hash)), ("deviceModel", ConstructorParameterDescription(_data.deviceModel)), ("platform", ConstructorParameterDescription(_data.platform)), ("systemVersion", ConstructorParameterDescription(_data.systemVersion)), ("apiId", ConstructorParameterDescription(_data.apiId)), ("appName", ConstructorParameterDescription(_data.appName)), ("appVersion", ConstructorParameterDescription(_data.appVersion)), ("dateCreated", ConstructorParameterDescription(_data.dateCreated)), ("dateActive", ConstructorParameterDescription(_data.dateActive)), ("ip", ConstructorParameterDescription(_data.ip)), ("country", ConstructorParameterDescription(_data.country)), ("region", ConstructorParameterDescription(_data.region))]) } } @@ -648,8 +648,8 @@ public extension Api { self.smallQueueActiveOperationsMax = smallQueueActiveOperationsMax self.largeQueueActiveOperationsMax = largeQueueActiveOperationsMax } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("autoDownloadSettings", [("flags", self.flags as Any), ("photoSizeMax", self.photoSizeMax as Any), ("videoSizeMax", self.videoSizeMax as Any), ("fileSizeMax", self.fileSizeMax as Any), ("videoUploadMaxbitrate", self.videoUploadMaxbitrate as Any), ("smallQueueActiveOperationsMax", self.smallQueueActiveOperationsMax as Any), ("largeQueueActiveOperationsMax", self.largeQueueActiveOperationsMax as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("autoDownloadSettings", [("flags", ConstructorParameterDescription(self.flags)), ("photoSizeMax", ConstructorParameterDescription(self.photoSizeMax)), ("videoSizeMax", ConstructorParameterDescription(self.videoSizeMax)), ("fileSizeMax", ConstructorParameterDescription(self.fileSizeMax)), ("videoUploadMaxbitrate", ConstructorParameterDescription(self.videoUploadMaxbitrate)), ("smallQueueActiveOperationsMax", ConstructorParameterDescription(self.smallQueueActiveOperationsMax)), ("largeQueueActiveOperationsMax", ConstructorParameterDescription(self.largeQueueActiveOperationsMax))]) } } case autoDownloadSettings(Cons_autoDownloadSettings) @@ -671,10 +671,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .autoDownloadSettings(let _data): - return ("autoDownloadSettings", [("flags", _data.flags as Any), ("photoSizeMax", _data.photoSizeMax as Any), ("videoSizeMax", _data.videoSizeMax as Any), ("fileSizeMax", _data.fileSizeMax as Any), ("videoUploadMaxbitrate", _data.videoUploadMaxbitrate as Any), ("smallQueueActiveOperationsMax", _data.smallQueueActiveOperationsMax as Any), ("largeQueueActiveOperationsMax", _data.largeQueueActiveOperationsMax as Any)]) + return ("autoDownloadSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("photoSizeMax", ConstructorParameterDescription(_data.photoSizeMax)), ("videoSizeMax", ConstructorParameterDescription(_data.videoSizeMax)), ("fileSizeMax", ConstructorParameterDescription(_data.fileSizeMax)), ("videoUploadMaxbitrate", ConstructorParameterDescription(_data.videoUploadMaxbitrate)), ("smallQueueActiveOperationsMax", ConstructorParameterDescription(_data.smallQueueActiveOperationsMax)), ("largeQueueActiveOperationsMax", ConstructorParameterDescription(_data.largeQueueActiveOperationsMax))]) } } @@ -718,8 +718,8 @@ public extension Api { self.peer = peer self.settings = settings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("autoSaveException", [("peer", self.peer as Any), ("settings", self.settings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("autoSaveException", [("peer", ConstructorParameterDescription(self.peer)), ("settings", ConstructorParameterDescription(self.settings))]) } } case autoSaveException(Cons_autoSaveException) @@ -736,10 +736,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .autoSaveException(let _data): - return ("autoSaveException", [("peer", _data.peer as Any), ("settings", _data.settings as Any)]) + return ("autoSaveException", [("peer", ConstructorParameterDescription(_data.peer)), ("settings", ConstructorParameterDescription(_data.settings))]) } } @@ -772,8 +772,8 @@ public extension Api { self.flags = flags self.videoMaxSize = videoMaxSize } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("autoSaveSettings", [("flags", self.flags as Any), ("videoMaxSize", self.videoMaxSize as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("autoSaveSettings", [("flags", ConstructorParameterDescription(self.flags)), ("videoMaxSize", ConstructorParameterDescription(self.videoMaxSize))]) } } case autoSaveSettings(Cons_autoSaveSettings) @@ -792,10 +792,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .autoSaveSettings(let _data): - return ("autoSaveSettings", [("flags", _data.flags as Any), ("videoMaxSize", _data.videoMaxSize as Any)]) + return ("autoSaveSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("videoMaxSize", ConstructorParameterDescription(_data.videoMaxSize))]) } } @@ -834,8 +834,8 @@ public extension Api { self.effectStickerId = effectStickerId self.effectAnimationId = effectAnimationId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("availableEffect", [("flags", self.flags as Any), ("id", self.id as Any), ("emoticon", self.emoticon as Any), ("staticIconId", self.staticIconId as Any), ("effectStickerId", self.effectStickerId as Any), ("effectAnimationId", self.effectAnimationId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("availableEffect", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("staticIconId", ConstructorParameterDescription(self.staticIconId)), ("effectStickerId", ConstructorParameterDescription(self.effectStickerId)), ("effectAnimationId", ConstructorParameterDescription(self.effectAnimationId))]) } } case availableEffect(Cons_availableEffect) @@ -860,10 +860,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .availableEffect(let _data): - return ("availableEffect", [("flags", _data.flags as Any), ("id", _data.id as Any), ("emoticon", _data.emoticon as Any), ("staticIconId", _data.staticIconId as Any), ("effectStickerId", _data.effectStickerId as Any), ("effectAnimationId", _data.effectAnimationId as Any)]) + return ("availableEffect", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("staticIconId", ConstructorParameterDescription(_data.staticIconId)), ("effectStickerId", ConstructorParameterDescription(_data.effectStickerId)), ("effectAnimationId", ConstructorParameterDescription(_data.effectAnimationId))]) } } @@ -924,8 +924,8 @@ public extension Api { self.aroundAnimation = aroundAnimation self.centerIcon = centerIcon } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("availableReaction", [("flags", self.flags as Any), ("reaction", self.reaction as Any), ("title", self.title as Any), ("staticIcon", self.staticIcon as Any), ("appearAnimation", self.appearAnimation as Any), ("selectAnimation", self.selectAnimation as Any), ("activateAnimation", self.activateAnimation as Any), ("effectAnimation", self.effectAnimation as Any), ("aroundAnimation", self.aroundAnimation as Any), ("centerIcon", self.centerIcon as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("availableReaction", [("flags", ConstructorParameterDescription(self.flags)), ("reaction", ConstructorParameterDescription(self.reaction)), ("title", ConstructorParameterDescription(self.title)), ("staticIcon", ConstructorParameterDescription(self.staticIcon)), ("appearAnimation", ConstructorParameterDescription(self.appearAnimation)), ("selectAnimation", ConstructorParameterDescription(self.selectAnimation)), ("activateAnimation", ConstructorParameterDescription(self.activateAnimation)), ("effectAnimation", ConstructorParameterDescription(self.effectAnimation)), ("aroundAnimation", ConstructorParameterDescription(self.aroundAnimation)), ("centerIcon", ConstructorParameterDescription(self.centerIcon))]) } } case availableReaction(Cons_availableReaction) @@ -954,10 +954,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .availableReaction(let _data): - return ("availableReaction", [("flags", _data.flags as Any), ("reaction", _data.reaction as Any), ("title", _data.title as Any), ("staticIcon", _data.staticIcon as Any), ("appearAnimation", _data.appearAnimation as Any), ("selectAnimation", _data.selectAnimation as Any), ("activateAnimation", _data.activateAnimation as Any), ("effectAnimation", _data.effectAnimation as Any), ("aroundAnimation", _data.aroundAnimation as Any), ("centerIcon", _data.centerIcon as Any)]) + return ("availableReaction", [("flags", ConstructorParameterDescription(_data.flags)), ("reaction", ConstructorParameterDescription(_data.reaction)), ("title", ConstructorParameterDescription(_data.title)), ("staticIcon", ConstructorParameterDescription(_data.staticIcon)), ("appearAnimation", ConstructorParameterDescription(_data.appearAnimation)), ("selectAnimation", ConstructorParameterDescription(_data.selectAnimation)), ("activateAnimation", ConstructorParameterDescription(_data.activateAnimation)), ("effectAnimation", ConstructorParameterDescription(_data.effectAnimation)), ("aroundAnimation", ConstructorParameterDescription(_data.aroundAnimation)), ("centerIcon", ConstructorParameterDescription(_data.centerIcon))]) } } @@ -1028,8 +1028,8 @@ public extension Api { self.url = url self.name = name } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("bankCardOpenUrl", [("url", self.url as Any), ("name", self.name as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("bankCardOpenUrl", [("url", ConstructorParameterDescription(self.url)), ("name", ConstructorParameterDescription(self.name))]) } } case bankCardOpenUrl(Cons_bankCardOpenUrl) @@ -1046,10 +1046,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .bankCardOpenUrl(let _data): - return ("bankCardOpenUrl", [("url", _data.url as Any), ("name", _data.name as Any)]) + return ("bankCardOpenUrl", [("url", ConstructorParameterDescription(_data.url)), ("name", ConstructorParameterDescription(_data.name))]) } } @@ -1107,7 +1107,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .baseThemeArctic: return ("baseThemeArctic", []) @@ -1152,8 +1152,8 @@ public extension Api { self.month = month self.year = year } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("birthday", [("flags", self.flags as Any), ("day", self.day as Any), ("month", self.month as Any), ("year", self.year as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("birthday", [("flags", ConstructorParameterDescription(self.flags)), ("day", ConstructorParameterDescription(self.day)), ("month", ConstructorParameterDescription(self.month)), ("year", ConstructorParameterDescription(self.year))]) } } case birthday(Cons_birthday) @@ -1174,10 +1174,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .birthday(let _data): - return ("birthday", [("flags", _data.flags as Any), ("day", _data.day as Any), ("month", _data.month as Any), ("year", _data.year as Any)]) + return ("birthday", [("flags", ConstructorParameterDescription(_data.flags)), ("day", ConstructorParameterDescription(_data.day)), ("month", ConstructorParameterDescription(_data.month)), ("year", ConstructorParameterDescription(_data.year))]) } } @@ -1225,7 +1225,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .boolFalse: return ("boolFalse", []) @@ -1265,8 +1265,8 @@ public extension Api { self.multiplier = multiplier self.stars = stars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("boost", [("flags", self.flags as Any), ("id", self.id as Any), ("userId", self.userId as Any), ("giveawayMsgId", self.giveawayMsgId as Any), ("date", self.date as Any), ("expires", self.expires as Any), ("usedGiftSlug", self.usedGiftSlug as Any), ("multiplier", self.multiplier as Any), ("stars", self.stars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("boost", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("userId", ConstructorParameterDescription(self.userId)), ("giveawayMsgId", ConstructorParameterDescription(self.giveawayMsgId)), ("date", ConstructorParameterDescription(self.date)), ("expires", ConstructorParameterDescription(self.expires)), ("usedGiftSlug", ConstructorParameterDescription(self.usedGiftSlug)), ("multiplier", ConstructorParameterDescription(self.multiplier)), ("stars", ConstructorParameterDescription(self.stars))]) } } case boost(Cons_boost) @@ -1300,10 +1300,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .boost(let _data): - return ("boost", [("flags", _data.flags as Any), ("id", _data.id as Any), ("userId", _data.userId as Any), ("giveawayMsgId", _data.giveawayMsgId as Any), ("date", _data.date as Any), ("expires", _data.expires as Any), ("usedGiftSlug", _data.usedGiftSlug as Any), ("multiplier", _data.multiplier as Any), ("stars", _data.stars as Any)]) + return ("boost", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("userId", ConstructorParameterDescription(_data.userId)), ("giveawayMsgId", ConstructorParameterDescription(_data.giveawayMsgId)), ("date", ConstructorParameterDescription(_data.date)), ("expires", ConstructorParameterDescription(_data.expires)), ("usedGiftSlug", ConstructorParameterDescription(_data.usedGiftSlug)), ("multiplier", ConstructorParameterDescription(_data.multiplier)), ("stars", ConstructorParameterDescription(_data.stars))]) } } @@ -1377,8 +1377,8 @@ public extension Api { self.document = document self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botApp", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("shortName", self.shortName as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("document", self.document as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botApp", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("shortName", ConstructorParameterDescription(self.shortName)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("document", ConstructorParameterDescription(self.document)), ("hash", ConstructorParameterDescription(self.hash))]) } } case botApp(Cons_botApp) @@ -1410,10 +1410,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botApp(let _data): - return ("botApp", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("shortName", _data.shortName as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("document", _data.document as Any), ("hash", _data.hash as Any)]) + return ("botApp", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("shortName", ConstructorParameterDescription(_data.shortName)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("document", ConstructorParameterDescription(_data.document)), ("hash", ConstructorParameterDescription(_data.hash))]) case .botAppNotModified: return ("botAppNotModified", []) } @@ -1482,8 +1482,8 @@ public extension Api { self.headerColor = headerColor self.headerDarkColor = headerDarkColor } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botAppSettings", [("flags", self.flags as Any), ("placeholderPath", self.placeholderPath as Any), ("backgroundColor", self.backgroundColor as Any), ("backgroundDarkColor", self.backgroundDarkColor as Any), ("headerColor", self.headerColor as Any), ("headerDarkColor", self.headerDarkColor as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botAppSettings", [("flags", ConstructorParameterDescription(self.flags)), ("placeholderPath", ConstructorParameterDescription(self.placeholderPath)), ("backgroundColor", ConstructorParameterDescription(self.backgroundColor)), ("backgroundDarkColor", ConstructorParameterDescription(self.backgroundDarkColor)), ("headerColor", ConstructorParameterDescription(self.headerColor)), ("headerDarkColor", ConstructorParameterDescription(self.headerDarkColor))]) } } case botAppSettings(Cons_botAppSettings) @@ -1514,10 +1514,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botAppSettings(let _data): - return ("botAppSettings", [("flags", _data.flags as Any), ("placeholderPath", _data.placeholderPath as Any), ("backgroundColor", _data.backgroundColor as Any), ("backgroundDarkColor", _data.backgroundDarkColor as Any), ("headerColor", _data.headerColor as Any), ("headerDarkColor", _data.headerDarkColor as Any)]) + return ("botAppSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("placeholderPath", ConstructorParameterDescription(_data.placeholderPath)), ("backgroundColor", ConstructorParameterDescription(_data.backgroundColor)), ("backgroundDarkColor", ConstructorParameterDescription(_data.backgroundDarkColor)), ("headerColor", ConstructorParameterDescription(_data.headerColor)), ("headerDarkColor", ConstructorParameterDescription(_data.headerDarkColor))]) } } diff --git a/submodules/TelegramApi/Sources/Api10.swift b/submodules/TelegramApi/Sources/Api10.swift index f02e31a5ed..1aa0f1f987 100644 --- a/submodules/TelegramApi/Sources/Api10.swift +++ b/submodules/TelegramApi/Sources/Api10.swift @@ -11,8 +11,8 @@ public extension Api { self.fileReference = fileReference self.thumbSize = thumbSize } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputDocumentFileLocation", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("fileReference", self.fileReference as Any), ("thumbSize", self.thumbSize as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputDocumentFileLocation", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference)), ("thumbSize", ConstructorParameterDescription(self.thumbSize))]) } } public class Cons_inputEncryptedFileLocation: TypeConstructorDescription { @@ -22,8 +22,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputEncryptedFileLocation", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputEncryptedFileLocation", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputFileLocation: TypeConstructorDescription { @@ -37,8 +37,8 @@ public extension Api { self.secret = secret self.fileReference = fileReference } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputFileLocation", [("volumeId", self.volumeId as Any), ("localId", self.localId as Any), ("secret", self.secret as Any), ("fileReference", self.fileReference as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputFileLocation", [("volumeId", ConstructorParameterDescription(self.volumeId)), ("localId", ConstructorParameterDescription(self.localId)), ("secret", ConstructorParameterDescription(self.secret)), ("fileReference", ConstructorParameterDescription(self.fileReference))]) } } public class Cons_inputGroupCallStream: TypeConstructorDescription { @@ -56,8 +56,8 @@ public extension Api { self.videoChannel = videoChannel self.videoQuality = videoQuality } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputGroupCallStream", [("flags", self.flags as Any), ("call", self.call as Any), ("timeMs", self.timeMs as Any), ("scale", self.scale as Any), ("videoChannel", self.videoChannel as Any), ("videoQuality", self.videoQuality as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputGroupCallStream", [("flags", ConstructorParameterDescription(self.flags)), ("call", ConstructorParameterDescription(self.call)), ("timeMs", ConstructorParameterDescription(self.timeMs)), ("scale", ConstructorParameterDescription(self.scale)), ("videoChannel", ConstructorParameterDescription(self.videoChannel)), ("videoQuality", ConstructorParameterDescription(self.videoQuality))]) } } public class Cons_inputPeerPhotoFileLocation: TypeConstructorDescription { @@ -69,8 +69,8 @@ public extension Api { self.peer = peer self.photoId = photoId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerPhotoFileLocation", [("flags", self.flags as Any), ("peer", self.peer as Any), ("photoId", self.photoId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerPhotoFileLocation", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("photoId", ConstructorParameterDescription(self.photoId))]) } } public class Cons_inputPhotoFileLocation: TypeConstructorDescription { @@ -84,8 +84,8 @@ public extension Api { self.fileReference = fileReference self.thumbSize = thumbSize } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPhotoFileLocation", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("fileReference", self.fileReference as Any), ("thumbSize", self.thumbSize as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPhotoFileLocation", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference)), ("thumbSize", ConstructorParameterDescription(self.thumbSize))]) } } public class Cons_inputPhotoLegacyFileLocation: TypeConstructorDescription { @@ -103,8 +103,8 @@ public extension Api { self.localId = localId self.secret = secret } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPhotoLegacyFileLocation", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("fileReference", self.fileReference as Any), ("volumeId", self.volumeId as Any), ("localId", self.localId as Any), ("secret", self.secret as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPhotoLegacyFileLocation", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference)), ("volumeId", ConstructorParameterDescription(self.volumeId)), ("localId", ConstructorParameterDescription(self.localId)), ("secret", ConstructorParameterDescription(self.secret))]) } } public class Cons_inputSecureFileLocation: TypeConstructorDescription { @@ -114,8 +114,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSecureFileLocation", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSecureFileLocation", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputStickerSetThumb: TypeConstructorDescription { @@ -125,8 +125,8 @@ public extension Api { self.stickerset = stickerset self.thumbVersion = thumbVersion } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStickerSetThumb", [("stickerset", self.stickerset as Any), ("thumbVersion", self.thumbVersion as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickerSetThumb", [("stickerset", ConstructorParameterDescription(self.stickerset)), ("thumbVersion", ConstructorParameterDescription(self.thumbVersion))]) } } case inputDocumentFileLocation(Cons_inputDocumentFileLocation) @@ -232,26 +232,26 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputDocumentFileLocation(let _data): - return ("inputDocumentFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("thumbSize", _data.thumbSize as Any)]) + return ("inputDocumentFileLocation", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference)), ("thumbSize", ConstructorParameterDescription(_data.thumbSize))]) case .inputEncryptedFileLocation(let _data): - return ("inputEncryptedFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputEncryptedFileLocation", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputFileLocation(let _data): - return ("inputFileLocation", [("volumeId", _data.volumeId as Any), ("localId", _data.localId as Any), ("secret", _data.secret as Any), ("fileReference", _data.fileReference as Any)]) + return ("inputFileLocation", [("volumeId", ConstructorParameterDescription(_data.volumeId)), ("localId", ConstructorParameterDescription(_data.localId)), ("secret", ConstructorParameterDescription(_data.secret)), ("fileReference", ConstructorParameterDescription(_data.fileReference))]) case .inputGroupCallStream(let _data): - return ("inputGroupCallStream", [("flags", _data.flags as Any), ("call", _data.call as Any), ("timeMs", _data.timeMs as Any), ("scale", _data.scale as Any), ("videoChannel", _data.videoChannel as Any), ("videoQuality", _data.videoQuality as Any)]) + return ("inputGroupCallStream", [("flags", ConstructorParameterDescription(_data.flags)), ("call", ConstructorParameterDescription(_data.call)), ("timeMs", ConstructorParameterDescription(_data.timeMs)), ("scale", ConstructorParameterDescription(_data.scale)), ("videoChannel", ConstructorParameterDescription(_data.videoChannel)), ("videoQuality", ConstructorParameterDescription(_data.videoQuality))]) case .inputPeerPhotoFileLocation(let _data): - return ("inputPeerPhotoFileLocation", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("photoId", _data.photoId as Any)]) + return ("inputPeerPhotoFileLocation", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("photoId", ConstructorParameterDescription(_data.photoId))]) case .inputPhotoFileLocation(let _data): - return ("inputPhotoFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("thumbSize", _data.thumbSize as Any)]) + return ("inputPhotoFileLocation", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference)), ("thumbSize", ConstructorParameterDescription(_data.thumbSize))]) case .inputPhotoLegacyFileLocation(let _data): - return ("inputPhotoLegacyFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("volumeId", _data.volumeId as Any), ("localId", _data.localId as Any), ("secret", _data.secret as Any)]) + return ("inputPhotoLegacyFileLocation", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference)), ("volumeId", ConstructorParameterDescription(_data.volumeId)), ("localId", ConstructorParameterDescription(_data.localId)), ("secret", ConstructorParameterDescription(_data.secret))]) case .inputSecureFileLocation(let _data): - return ("inputSecureFileLocation", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputSecureFileLocation", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputStickerSetThumb(let _data): - return ("inputStickerSetThumb", [("stickerset", _data.stickerset as Any), ("thumbVersion", _data.thumbVersion as Any)]) + return ("inputStickerSetThumb", [("stickerset", ConstructorParameterDescription(_data.stickerset)), ("thumbVersion", ConstructorParameterDescription(_data.thumbVersion))]) case .inputTakeoutFileLocation: return ("inputTakeoutFileLocation", []) } @@ -452,8 +452,8 @@ public extension Api { self.peer = peer self.folderId = folderId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputFolderPeer", [("peer", self.peer as Any), ("folderId", self.folderId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputFolderPeer", [("peer", ConstructorParameterDescription(self.peer)), ("folderId", ConstructorParameterDescription(self.folderId))]) } } case inputFolderPeer(Cons_inputFolderPeer) @@ -470,10 +470,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputFolderPeer(let _data): - return ("inputFolderPeer", [("peer", _data.peer as Any), ("folderId", _data.folderId as Any)]) + return ("inputFolderPeer", [("peer", ConstructorParameterDescription(_data.peer)), ("folderId", ConstructorParameterDescription(_data.folderId))]) } } @@ -504,8 +504,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputGameID", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputGameID", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputGameShortName: TypeConstructorDescription { @@ -515,8 +515,8 @@ public extension Api { self.botId = botId self.shortName = shortName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputGameShortName", [("botId", self.botId as Any), ("shortName", self.shortName as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputGameShortName", [("botId", ConstructorParameterDescription(self.botId)), ("shortName", ConstructorParameterDescription(self.shortName))]) } } case inputGameID(Cons_inputGameID) @@ -541,12 +541,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputGameID(let _data): - return ("inputGameID", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputGameID", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputGameShortName(let _data): - return ("inputGameShortName", [("botId", _data.botId as Any), ("shortName", _data.shortName as Any)]) + return ("inputGameShortName", [("botId", ConstructorParameterDescription(_data.botId)), ("shortName", ConstructorParameterDescription(_data.shortName))]) } } @@ -595,8 +595,8 @@ public extension Api { self.long = long self.accuracyRadius = accuracyRadius } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputGeoPoint", [("flags", self.flags as Any), ("lat", self.lat as Any), ("long", self.long as Any), ("accuracyRadius", self.accuracyRadius as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputGeoPoint", [("flags", ConstructorParameterDescription(self.flags)), ("lat", ConstructorParameterDescription(self.lat)), ("long", ConstructorParameterDescription(self.long)), ("accuracyRadius", ConstructorParameterDescription(self.accuracyRadius))]) } } case inputGeoPoint(Cons_inputGeoPoint) @@ -623,10 +623,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputGeoPoint(let _data): - return ("inputGeoPoint", [("flags", _data.flags as Any), ("lat", _data.lat as Any), ("long", _data.long as Any), ("accuracyRadius", _data.accuracyRadius as Any)]) + return ("inputGeoPoint", [("flags", ConstructorParameterDescription(_data.flags)), ("lat", ConstructorParameterDescription(_data.lat)), ("long", ConstructorParameterDescription(_data.long)), ("accuracyRadius", ConstructorParameterDescription(_data.accuracyRadius))]) case .inputGeoPointEmpty: return ("inputGeoPointEmpty", []) } @@ -668,8 +668,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputGroupCall", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputGroupCall", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputGroupCallInviteMessage: TypeConstructorDescription { @@ -677,8 +677,8 @@ public extension Api { public init(msgId: Int32) { self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputGroupCallInviteMessage", [("msgId", self.msgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputGroupCallInviteMessage", [("msgId", ConstructorParameterDescription(self.msgId))]) } } public class Cons_inputGroupCallSlug: TypeConstructorDescription { @@ -686,8 +686,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputGroupCallSlug", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputGroupCallSlug", [("slug", ConstructorParameterDescription(self.slug))]) } } case inputGroupCall(Cons_inputGroupCall) @@ -718,14 +718,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputGroupCall(let _data): - return ("inputGroupCall", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputGroupCall", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputGroupCallInviteMessage(let _data): - return ("inputGroupCallInviteMessage", [("msgId", _data.msgId as Any)]) + return ("inputGroupCallInviteMessage", [("msgId", ConstructorParameterDescription(_data.msgId))]) case .inputGroupCallSlug(let _data): - return ("inputGroupCallSlug", [("slug", _data.slug as Any)]) + return ("inputGroupCallSlug", [("slug", ConstructorParameterDescription(_data.slug))]) } } @@ -776,8 +776,8 @@ public extension Api { self.bot = bot self.stars = stars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceBusinessBotTransferStars", [("bot", self.bot as Any), ("stars", self.stars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceBusinessBotTransferStars", [("bot", ConstructorParameterDescription(self.bot)), ("stars", ConstructorParameterDescription(self.stars))]) } } public class Cons_inputInvoiceChatInviteSubscription: TypeConstructorDescription { @@ -785,8 +785,8 @@ public extension Api { public init(hash: String) { self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceChatInviteSubscription", [("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceChatInviteSubscription", [("hash", ConstructorParameterDescription(self.hash))]) } } public class Cons_inputInvoiceMessage: TypeConstructorDescription { @@ -796,8 +796,8 @@ public extension Api { self.peer = peer self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceMessage", [("peer", self.peer as Any), ("msgId", self.msgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceMessage", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId))]) } } public class Cons_inputInvoicePremiumAuthCode: TypeConstructorDescription { @@ -805,8 +805,8 @@ public extension Api { public init(purpose: Api.InputStorePaymentPurpose) { self.purpose = purpose } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoicePremiumAuthCode", [("purpose", self.purpose as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoicePremiumAuthCode", [("purpose", ConstructorParameterDescription(self.purpose))]) } } public class Cons_inputInvoicePremiumGiftCode: TypeConstructorDescription { @@ -816,8 +816,8 @@ public extension Api { self.purpose = purpose self.option = option } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoicePremiumGiftCode", [("purpose", self.purpose as Any), ("option", self.option as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoicePremiumGiftCode", [("purpose", ConstructorParameterDescription(self.purpose)), ("option", ConstructorParameterDescription(self.option))]) } } public class Cons_inputInvoicePremiumGiftStars: TypeConstructorDescription { @@ -831,8 +831,8 @@ public extension Api { self.months = months self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoicePremiumGiftStars", [("flags", self.flags as Any), ("userId", self.userId as Any), ("months", self.months as Any), ("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoicePremiumGiftStars", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("months", ConstructorParameterDescription(self.months)), ("message", ConstructorParameterDescription(self.message))]) } } public class Cons_inputInvoiceSlug: TypeConstructorDescription { @@ -840,8 +840,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceSlug", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceSlug", [("slug", ConstructorParameterDescription(self.slug))]) } } public class Cons_inputInvoiceStarGift: TypeConstructorDescription { @@ -855,8 +855,8 @@ public extension Api { self.giftId = giftId self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStarGift", [("flags", self.flags as Any), ("peer", self.peer as Any), ("giftId", self.giftId as Any), ("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStarGift", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("giftId", ConstructorParameterDescription(self.giftId)), ("message", ConstructorParameterDescription(self.message))]) } } public class Cons_inputInvoiceStarGiftAuctionBid: TypeConstructorDescription { @@ -872,8 +872,8 @@ public extension Api { self.bidAmount = bidAmount self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStarGiftAuctionBid", [("flags", self.flags as Any), ("peer", self.peer as Any), ("giftId", self.giftId as Any), ("bidAmount", self.bidAmount as Any), ("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStarGiftAuctionBid", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("giftId", ConstructorParameterDescription(self.giftId)), ("bidAmount", ConstructorParameterDescription(self.bidAmount)), ("message", ConstructorParameterDescription(self.message))]) } } public class Cons_inputInvoiceStarGiftDropOriginalDetails: TypeConstructorDescription { @@ -881,8 +881,8 @@ public extension Api { public init(stargift: Api.InputSavedStarGift) { self.stargift = stargift } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStarGiftDropOriginalDetails", [("stargift", self.stargift as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStarGiftDropOriginalDetails", [("stargift", ConstructorParameterDescription(self.stargift))]) } } public class Cons_inputInvoiceStarGiftPrepaidUpgrade: TypeConstructorDescription { @@ -892,8 +892,8 @@ public extension Api { self.peer = peer self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStarGiftPrepaidUpgrade", [("peer", self.peer as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStarGiftPrepaidUpgrade", [("peer", ConstructorParameterDescription(self.peer)), ("hash", ConstructorParameterDescription(self.hash))]) } } public class Cons_inputInvoiceStarGiftResale: TypeConstructorDescription { @@ -905,8 +905,8 @@ public extension Api { self.slug = slug self.toId = toId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStarGiftResale", [("flags", self.flags as Any), ("slug", self.slug as Any), ("toId", self.toId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStarGiftResale", [("flags", ConstructorParameterDescription(self.flags)), ("slug", ConstructorParameterDescription(self.slug)), ("toId", ConstructorParameterDescription(self.toId))]) } } public class Cons_inputInvoiceStarGiftTransfer: TypeConstructorDescription { @@ -916,8 +916,8 @@ public extension Api { self.stargift = stargift self.toId = toId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStarGiftTransfer", [("stargift", self.stargift as Any), ("toId", self.toId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStarGiftTransfer", [("stargift", ConstructorParameterDescription(self.stargift)), ("toId", ConstructorParameterDescription(self.toId))]) } } public class Cons_inputInvoiceStarGiftUpgrade: TypeConstructorDescription { @@ -927,8 +927,8 @@ public extension Api { self.flags = flags self.stargift = stargift } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStarGiftUpgrade", [("flags", self.flags as Any), ("stargift", self.stargift as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStarGiftUpgrade", [("flags", ConstructorParameterDescription(self.flags)), ("stargift", ConstructorParameterDescription(self.stargift))]) } } public class Cons_inputInvoiceStars: TypeConstructorDescription { @@ -936,8 +936,8 @@ public extension Api { public init(purpose: Api.InputStorePaymentPurpose) { self.purpose = purpose } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputInvoiceStars", [("purpose", self.purpose as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputInvoiceStars", [("purpose", ConstructorParameterDescription(self.purpose))]) } } case inputInvoiceBusinessBotTransferStars(Cons_inputInvoiceBusinessBotTransferStars) @@ -1077,38 +1077,38 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputInvoiceBusinessBotTransferStars(let _data): - return ("inputInvoiceBusinessBotTransferStars", [("bot", _data.bot as Any), ("stars", _data.stars as Any)]) + return ("inputInvoiceBusinessBotTransferStars", [("bot", ConstructorParameterDescription(_data.bot)), ("stars", ConstructorParameterDescription(_data.stars))]) case .inputInvoiceChatInviteSubscription(let _data): - return ("inputInvoiceChatInviteSubscription", [("hash", _data.hash as Any)]) + return ("inputInvoiceChatInviteSubscription", [("hash", ConstructorParameterDescription(_data.hash))]) case .inputInvoiceMessage(let _data): - return ("inputInvoiceMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any)]) + return ("inputInvoiceMessage", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId))]) case .inputInvoicePremiumAuthCode(let _data): - return ("inputInvoicePremiumAuthCode", [("purpose", _data.purpose as Any)]) + return ("inputInvoicePremiumAuthCode", [("purpose", ConstructorParameterDescription(_data.purpose))]) case .inputInvoicePremiumGiftCode(let _data): - return ("inputInvoicePremiumGiftCode", [("purpose", _data.purpose as Any), ("option", _data.option as Any)]) + return ("inputInvoicePremiumGiftCode", [("purpose", ConstructorParameterDescription(_data.purpose)), ("option", ConstructorParameterDescription(_data.option))]) case .inputInvoicePremiumGiftStars(let _data): - return ("inputInvoicePremiumGiftStars", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("months", _data.months as Any), ("message", _data.message as Any)]) + return ("inputInvoicePremiumGiftStars", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("months", ConstructorParameterDescription(_data.months)), ("message", ConstructorParameterDescription(_data.message))]) case .inputInvoiceSlug(let _data): - return ("inputInvoiceSlug", [("slug", _data.slug as Any)]) + return ("inputInvoiceSlug", [("slug", ConstructorParameterDescription(_data.slug))]) case .inputInvoiceStarGift(let _data): - return ("inputInvoiceStarGift", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("giftId", _data.giftId as Any), ("message", _data.message as Any)]) + return ("inputInvoiceStarGift", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("giftId", ConstructorParameterDescription(_data.giftId)), ("message", ConstructorParameterDescription(_data.message))]) case .inputInvoiceStarGiftAuctionBid(let _data): - return ("inputInvoiceStarGiftAuctionBid", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("giftId", _data.giftId as Any), ("bidAmount", _data.bidAmount as Any), ("message", _data.message as Any)]) + return ("inputInvoiceStarGiftAuctionBid", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("giftId", ConstructorParameterDescription(_data.giftId)), ("bidAmount", ConstructorParameterDescription(_data.bidAmount)), ("message", ConstructorParameterDescription(_data.message))]) case .inputInvoiceStarGiftDropOriginalDetails(let _data): - return ("inputInvoiceStarGiftDropOriginalDetails", [("stargift", _data.stargift as Any)]) + return ("inputInvoiceStarGiftDropOriginalDetails", [("stargift", ConstructorParameterDescription(_data.stargift))]) case .inputInvoiceStarGiftPrepaidUpgrade(let _data): - return ("inputInvoiceStarGiftPrepaidUpgrade", [("peer", _data.peer as Any), ("hash", _data.hash as Any)]) + return ("inputInvoiceStarGiftPrepaidUpgrade", [("peer", ConstructorParameterDescription(_data.peer)), ("hash", ConstructorParameterDescription(_data.hash))]) case .inputInvoiceStarGiftResale(let _data): - return ("inputInvoiceStarGiftResale", [("flags", _data.flags as Any), ("slug", _data.slug as Any), ("toId", _data.toId as Any)]) + return ("inputInvoiceStarGiftResale", [("flags", ConstructorParameterDescription(_data.flags)), ("slug", ConstructorParameterDescription(_data.slug)), ("toId", ConstructorParameterDescription(_data.toId))]) case .inputInvoiceStarGiftTransfer(let _data): - return ("inputInvoiceStarGiftTransfer", [("stargift", _data.stargift as Any), ("toId", _data.toId as Any)]) + return ("inputInvoiceStarGiftTransfer", [("stargift", ConstructorParameterDescription(_data.stargift)), ("toId", ConstructorParameterDescription(_data.toId))]) case .inputInvoiceStarGiftUpgrade(let _data): - return ("inputInvoiceStarGiftUpgrade", [("flags", _data.flags as Any), ("stargift", _data.stargift as Any)]) + return ("inputInvoiceStarGiftUpgrade", [("flags", ConstructorParameterDescription(_data.flags)), ("stargift", ConstructorParameterDescription(_data.stargift))]) case .inputInvoiceStars(let _data): - return ("inputInvoiceStars", [("purpose", _data.purpose as Any)]) + return ("inputInvoiceStars", [("purpose", ConstructorParameterDescription(_data.purpose))]) } } diff --git a/submodules/TelegramApi/Sources/Api11.swift b/submodules/TelegramApi/Sources/Api11.swift index 4bff06f25a..5c9e6d7e3d 100644 --- a/submodules/TelegramApi/Sources/Api11.swift +++ b/submodules/TelegramApi/Sources/Api11.swift @@ -11,8 +11,8 @@ public extension Api { self.lastName = lastName self.vcard = vcard } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaContact", [("phoneNumber", self.phoneNumber as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("vcard", self.vcard as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaContact", [("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("vcard", ConstructorParameterDescription(self.vcard))]) } } public class Cons_inputMediaDice: TypeConstructorDescription { @@ -20,8 +20,8 @@ public extension Api { public init(emoticon: String) { self.emoticon = emoticon } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaDice", [("emoticon", self.emoticon as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaDice", [("emoticon", ConstructorParameterDescription(self.emoticon))]) } } public class Cons_inputMediaDocument: TypeConstructorDescription { @@ -39,8 +39,8 @@ public extension Api { self.ttlSeconds = ttlSeconds self.query = query } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaDocument", [("flags", self.flags as Any), ("id", self.id as Any), ("videoCover", self.videoCover as Any), ("videoTimestamp", self.videoTimestamp as Any), ("ttlSeconds", self.ttlSeconds as Any), ("query", self.query as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaDocument", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("videoCover", ConstructorParameterDescription(self.videoCover)), ("videoTimestamp", ConstructorParameterDescription(self.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds)), ("query", ConstructorParameterDescription(self.query))]) } } public class Cons_inputMediaDocumentExternal: TypeConstructorDescription { @@ -56,8 +56,8 @@ public extension Api { self.videoCover = videoCover self.videoTimestamp = videoTimestamp } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaDocumentExternal", [("flags", self.flags as Any), ("url", self.url as Any), ("ttlSeconds", self.ttlSeconds as Any), ("videoCover", self.videoCover as Any), ("videoTimestamp", self.videoTimestamp as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaDocumentExternal", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds)), ("videoCover", ConstructorParameterDescription(self.videoCover)), ("videoTimestamp", ConstructorParameterDescription(self.videoTimestamp))]) } } public class Cons_inputMediaGame: TypeConstructorDescription { @@ -65,8 +65,8 @@ public extension Api { public init(id: Api.InputGame) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaGame", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaGame", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_inputMediaGeoLive: TypeConstructorDescription { @@ -82,8 +82,8 @@ public extension Api { self.period = period self.proximityNotificationRadius = proximityNotificationRadius } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaGeoLive", [("flags", self.flags as Any), ("geoPoint", self.geoPoint as Any), ("heading", self.heading as Any), ("period", self.period as Any), ("proximityNotificationRadius", self.proximityNotificationRadius as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaGeoLive", [("flags", ConstructorParameterDescription(self.flags)), ("geoPoint", ConstructorParameterDescription(self.geoPoint)), ("heading", ConstructorParameterDescription(self.heading)), ("period", ConstructorParameterDescription(self.period)), ("proximityNotificationRadius", ConstructorParameterDescription(self.proximityNotificationRadius))]) } } public class Cons_inputMediaGeoPoint: TypeConstructorDescription { @@ -91,8 +91,8 @@ public extension Api { public init(geoPoint: Api.InputGeoPoint) { self.geoPoint = geoPoint } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaGeoPoint", [("geoPoint", self.geoPoint as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaGeoPoint", [("geoPoint", ConstructorParameterDescription(self.geoPoint))]) } } public class Cons_inputMediaInvoice: TypeConstructorDescription { @@ -118,8 +118,8 @@ public extension Api { self.startParam = startParam self.extendedMedia = extendedMedia } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaInvoice", [("flags", self.flags as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("payload", self.payload as Any), ("provider", self.provider as Any), ("providerData", self.providerData as Any), ("startParam", self.startParam as Any), ("extendedMedia", self.extendedMedia as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaInvoice", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("payload", ConstructorParameterDescription(self.payload)), ("provider", ConstructorParameterDescription(self.provider)), ("providerData", ConstructorParameterDescription(self.providerData)), ("startParam", ConstructorParameterDescription(self.startParam)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) } } public class Cons_inputMediaPaidMedia: TypeConstructorDescription { @@ -133,8 +133,8 @@ public extension Api { self.extendedMedia = extendedMedia self.payload = payload } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaPaidMedia", [("flags", self.flags as Any), ("starsAmount", self.starsAmount as Any), ("extendedMedia", self.extendedMedia as Any), ("payload", self.payload as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaPaidMedia", [("flags", ConstructorParameterDescription(self.flags)), ("starsAmount", ConstructorParameterDescription(self.starsAmount)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia)), ("payload", ConstructorParameterDescription(self.payload))]) } } public class Cons_inputMediaPhoto: TypeConstructorDescription { @@ -148,8 +148,8 @@ public extension Api { self.ttlSeconds = ttlSeconds self.video = video } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaPhoto", [("flags", self.flags as Any), ("id", self.id as Any), ("ttlSeconds", self.ttlSeconds as Any), ("video", self.video as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds)), ("video", ConstructorParameterDescription(self.video))]) } } public class Cons_inputMediaPhotoExternal: TypeConstructorDescription { @@ -161,8 +161,8 @@ public extension Api { self.url = url self.ttlSeconds = ttlSeconds } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaPhotoExternal", [("flags", self.flags as Any), ("url", self.url as Any), ("ttlSeconds", self.ttlSeconds as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaPhotoExternal", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds))]) } } public class Cons_inputMediaPoll: TypeConstructorDescription { @@ -182,8 +182,8 @@ public extension Api { self.solutionEntities = solutionEntities self.solutionMedia = solutionMedia } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaPoll", [("flags", self.flags as Any), ("poll", self.poll as Any), ("correctAnswers", self.correctAnswers as Any), ("attachedMedia", self.attachedMedia as Any), ("solution", self.solution as Any), ("solutionEntities", self.solutionEntities as Any), ("solutionMedia", self.solutionMedia as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaPoll", [("flags", ConstructorParameterDescription(self.flags)), ("poll", ConstructorParameterDescription(self.poll)), ("correctAnswers", ConstructorParameterDescription(self.correctAnswers)), ("attachedMedia", ConstructorParameterDescription(self.attachedMedia)), ("solution", ConstructorParameterDescription(self.solution)), ("solutionEntities", ConstructorParameterDescription(self.solutionEntities)), ("solutionMedia", ConstructorParameterDescription(self.solutionMedia))]) } } public class Cons_inputMediaStakeDice: TypeConstructorDescription { @@ -195,8 +195,8 @@ public extension Api { self.tonAmount = tonAmount self.clientSeed = clientSeed } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaStakeDice", [("gameHash", self.gameHash as Any), ("tonAmount", self.tonAmount as Any), ("clientSeed", self.clientSeed as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaStakeDice", [("gameHash", ConstructorParameterDescription(self.gameHash)), ("tonAmount", ConstructorParameterDescription(self.tonAmount)), ("clientSeed", ConstructorParameterDescription(self.clientSeed))]) } } public class Cons_inputMediaStory: TypeConstructorDescription { @@ -206,8 +206,8 @@ public extension Api { self.peer = peer self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaStory", [("peer", self.peer as Any), ("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaStory", [("peer", ConstructorParameterDescription(self.peer)), ("id", ConstructorParameterDescription(self.id))]) } } public class Cons_inputMediaTodo: TypeConstructorDescription { @@ -215,8 +215,8 @@ public extension Api { public init(todo: Api.TodoList) { self.todo = todo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaTodo", [("todo", self.todo as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaTodo", [("todo", ConstructorParameterDescription(self.todo))]) } } public class Cons_inputMediaUploadedDocument: TypeConstructorDescription { @@ -240,8 +240,8 @@ public extension Api { self.videoTimestamp = videoTimestamp self.ttlSeconds = ttlSeconds } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaUploadedDocument", [("flags", self.flags as Any), ("file", self.file as Any), ("thumb", self.thumb as Any), ("mimeType", self.mimeType as Any), ("attributes", self.attributes as Any), ("stickers", self.stickers as Any), ("videoCover", self.videoCover as Any), ("videoTimestamp", self.videoTimestamp as Any), ("ttlSeconds", self.ttlSeconds as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaUploadedDocument", [("flags", ConstructorParameterDescription(self.flags)), ("file", ConstructorParameterDescription(self.file)), ("thumb", ConstructorParameterDescription(self.thumb)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("attributes", ConstructorParameterDescription(self.attributes)), ("stickers", ConstructorParameterDescription(self.stickers)), ("videoCover", ConstructorParameterDescription(self.videoCover)), ("videoTimestamp", ConstructorParameterDescription(self.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds))]) } } public class Cons_inputMediaUploadedPhoto: TypeConstructorDescription { @@ -257,8 +257,8 @@ public extension Api { self.ttlSeconds = ttlSeconds self.video = video } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaUploadedPhoto", [("flags", self.flags as Any), ("file", self.file as Any), ("stickers", self.stickers as Any), ("ttlSeconds", self.ttlSeconds as Any), ("video", self.video as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaUploadedPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("file", ConstructorParameterDescription(self.file)), ("stickers", ConstructorParameterDescription(self.stickers)), ("ttlSeconds", ConstructorParameterDescription(self.ttlSeconds)), ("video", ConstructorParameterDescription(self.video))]) } } public class Cons_inputMediaVenue: TypeConstructorDescription { @@ -276,8 +276,8 @@ public extension Api { self.venueId = venueId self.venueType = venueType } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaVenue", [("geoPoint", self.geoPoint as Any), ("title", self.title as Any), ("address", self.address as Any), ("provider", self.provider as Any), ("venueId", self.venueId as Any), ("venueType", self.venueType as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaVenue", [("geoPoint", ConstructorParameterDescription(self.geoPoint)), ("title", ConstructorParameterDescription(self.title)), ("address", ConstructorParameterDescription(self.address)), ("provider", ConstructorParameterDescription(self.provider)), ("venueId", ConstructorParameterDescription(self.venueId)), ("venueType", ConstructorParameterDescription(self.venueType))]) } } public class Cons_inputMediaWebPage: TypeConstructorDescription { @@ -287,8 +287,8 @@ public extension Api { self.flags = flags self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaWebPage", [("flags", self.flags as Any), ("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaWebPage", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url))]) } } case inputMediaContact(Cons_inputMediaContact) @@ -582,48 +582,48 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputMediaContact(let _data): - return ("inputMediaContact", [("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any)]) + return ("inputMediaContact", [("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("vcard", ConstructorParameterDescription(_data.vcard))]) case .inputMediaDice(let _data): - return ("inputMediaDice", [("emoticon", _data.emoticon as Any)]) + return ("inputMediaDice", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) case .inputMediaDocument(let _data): - return ("inputMediaDocument", [("flags", _data.flags as Any), ("id", _data.id as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("query", _data.query as Any)]) + return ("inputMediaDocument", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("videoCover", ConstructorParameterDescription(_data.videoCover)), ("videoTimestamp", ConstructorParameterDescription(_data.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds)), ("query", ConstructorParameterDescription(_data.query))]) case .inputMediaDocumentExternal(let _data): - return ("inputMediaDocumentExternal", [("flags", _data.flags as Any), ("url", _data.url as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any)]) + return ("inputMediaDocumentExternal", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds)), ("videoCover", ConstructorParameterDescription(_data.videoCover)), ("videoTimestamp", ConstructorParameterDescription(_data.videoTimestamp))]) case .inputMediaEmpty: return ("inputMediaEmpty", []) case .inputMediaGame(let _data): - return ("inputMediaGame", [("id", _data.id as Any)]) + return ("inputMediaGame", [("id", ConstructorParameterDescription(_data.id))]) case .inputMediaGeoLive(let _data): - return ("inputMediaGeoLive", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any)]) + return ("inputMediaGeoLive", [("flags", ConstructorParameterDescription(_data.flags)), ("geoPoint", ConstructorParameterDescription(_data.geoPoint)), ("heading", ConstructorParameterDescription(_data.heading)), ("period", ConstructorParameterDescription(_data.period)), ("proximityNotificationRadius", ConstructorParameterDescription(_data.proximityNotificationRadius))]) case .inputMediaGeoPoint(let _data): - return ("inputMediaGeoPoint", [("geoPoint", _data.geoPoint as Any)]) + return ("inputMediaGeoPoint", [("geoPoint", ConstructorParameterDescription(_data.geoPoint))]) case .inputMediaInvoice(let _data): - return ("inputMediaInvoice", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("payload", _data.payload as Any), ("provider", _data.provider as Any), ("providerData", _data.providerData as Any), ("startParam", _data.startParam as Any), ("extendedMedia", _data.extendedMedia as Any)]) + return ("inputMediaInvoice", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("payload", ConstructorParameterDescription(_data.payload)), ("provider", ConstructorParameterDescription(_data.provider)), ("providerData", ConstructorParameterDescription(_data.providerData)), ("startParam", ConstructorParameterDescription(_data.startParam)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) case .inputMediaPaidMedia(let _data): - return ("inputMediaPaidMedia", [("flags", _data.flags as Any), ("starsAmount", _data.starsAmount as Any), ("extendedMedia", _data.extendedMedia as Any), ("payload", _data.payload as Any)]) + return ("inputMediaPaidMedia", [("flags", ConstructorParameterDescription(_data.flags)), ("starsAmount", ConstructorParameterDescription(_data.starsAmount)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia)), ("payload", ConstructorParameterDescription(_data.payload))]) case .inputMediaPhoto(let _data): - return ("inputMediaPhoto", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("video", _data.video as Any)]) + return ("inputMediaPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds)), ("video", ConstructorParameterDescription(_data.video))]) case .inputMediaPhotoExternal(let _data): - return ("inputMediaPhotoExternal", [("flags", _data.flags as Any), ("url", _data.url as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + return ("inputMediaPhotoExternal", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds))]) case .inputMediaPoll(let _data): - return ("inputMediaPoll", [("flags", _data.flags as Any), ("poll", _data.poll as Any), ("correctAnswers", _data.correctAnswers as Any), ("attachedMedia", _data.attachedMedia as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any), ("solutionMedia", _data.solutionMedia as Any)]) + return ("inputMediaPoll", [("flags", ConstructorParameterDescription(_data.flags)), ("poll", ConstructorParameterDescription(_data.poll)), ("correctAnswers", ConstructorParameterDescription(_data.correctAnswers)), ("attachedMedia", ConstructorParameterDescription(_data.attachedMedia)), ("solution", ConstructorParameterDescription(_data.solution)), ("solutionEntities", ConstructorParameterDescription(_data.solutionEntities)), ("solutionMedia", ConstructorParameterDescription(_data.solutionMedia))]) case .inputMediaStakeDice(let _data): - return ("inputMediaStakeDice", [("gameHash", _data.gameHash as Any), ("tonAmount", _data.tonAmount as Any), ("clientSeed", _data.clientSeed as Any)]) + return ("inputMediaStakeDice", [("gameHash", ConstructorParameterDescription(_data.gameHash)), ("tonAmount", ConstructorParameterDescription(_data.tonAmount)), ("clientSeed", ConstructorParameterDescription(_data.clientSeed))]) case .inputMediaStory(let _data): - return ("inputMediaStory", [("peer", _data.peer as Any), ("id", _data.id as Any)]) + return ("inputMediaStory", [("peer", ConstructorParameterDescription(_data.peer)), ("id", ConstructorParameterDescription(_data.id))]) case .inputMediaTodo(let _data): - return ("inputMediaTodo", [("todo", _data.todo as Any)]) + return ("inputMediaTodo", [("todo", ConstructorParameterDescription(_data.todo))]) case .inputMediaUploadedDocument(let _data): - return ("inputMediaUploadedDocument", [("flags", _data.flags as Any), ("file", _data.file as Any), ("thumb", _data.thumb as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any), ("stickers", _data.stickers as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + return ("inputMediaUploadedDocument", [("flags", ConstructorParameterDescription(_data.flags)), ("file", ConstructorParameterDescription(_data.file)), ("thumb", ConstructorParameterDescription(_data.thumb)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("attributes", ConstructorParameterDescription(_data.attributes)), ("stickers", ConstructorParameterDescription(_data.stickers)), ("videoCover", ConstructorParameterDescription(_data.videoCover)), ("videoTimestamp", ConstructorParameterDescription(_data.videoTimestamp)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds))]) case .inputMediaUploadedPhoto(let _data): - return ("inputMediaUploadedPhoto", [("flags", _data.flags as Any), ("file", _data.file as Any), ("stickers", _data.stickers as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("video", _data.video as Any)]) + return ("inputMediaUploadedPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("file", ConstructorParameterDescription(_data.file)), ("stickers", ConstructorParameterDescription(_data.stickers)), ("ttlSeconds", ConstructorParameterDescription(_data.ttlSeconds)), ("video", ConstructorParameterDescription(_data.video))]) case .inputMediaVenue(let _data): - return ("inputMediaVenue", [("geoPoint", _data.geoPoint as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any)]) + return ("inputMediaVenue", [("geoPoint", ConstructorParameterDescription(_data.geoPoint)), ("title", ConstructorParameterDescription(_data.title)), ("address", ConstructorParameterDescription(_data.address)), ("provider", ConstructorParameterDescription(_data.provider)), ("venueId", ConstructorParameterDescription(_data.venueId)), ("venueType", ConstructorParameterDescription(_data.venueType))]) case .inputMediaWebPage(let _data): - return ("inputMediaWebPage", [("flags", _data.flags as Any), ("url", _data.url as Any)]) + return ("inputMediaWebPage", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url))]) } } @@ -1150,8 +1150,8 @@ public extension Api { self.id = id self.queryId = queryId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMessageCallbackQuery", [("id", self.id as Any), ("queryId", self.queryId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMessageCallbackQuery", [("id", ConstructorParameterDescription(self.id)), ("queryId", ConstructorParameterDescription(self.queryId))]) } } public class Cons_inputMessageID: TypeConstructorDescription { @@ -1159,8 +1159,8 @@ public extension Api { public init(id: Int32) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMessageID", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMessageID", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_inputMessageReplyTo: TypeConstructorDescription { @@ -1168,8 +1168,8 @@ public extension Api { public init(id: Int32) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMessageReplyTo", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMessageReplyTo", [("id", ConstructorParameterDescription(self.id))]) } } case inputMessageCallbackQuery(Cons_inputMessageCallbackQuery) @@ -1206,16 +1206,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputMessageCallbackQuery(let _data): - return ("inputMessageCallbackQuery", [("id", _data.id as Any), ("queryId", _data.queryId as Any)]) + return ("inputMessageCallbackQuery", [("id", ConstructorParameterDescription(_data.id)), ("queryId", ConstructorParameterDescription(_data.queryId))]) case .inputMessageID(let _data): - return ("inputMessageID", [("id", _data.id as Any)]) + return ("inputMessageID", [("id", ConstructorParameterDescription(_data.id))]) case .inputMessagePinned: return ("inputMessagePinned", []) case .inputMessageReplyTo(let _data): - return ("inputMessageReplyTo", [("id", _data.id as Any)]) + return ("inputMessageReplyTo", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -1277,8 +1277,8 @@ public extension Api { self.heightToViewportRatioPermille = heightToViewportRatioPermille self.seenRangeRatioPermille = seenRangeRatioPermille } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMessageReadMetric", [("msgId", self.msgId as Any), ("viewId", self.viewId as Any), ("timeInViewMs", self.timeInViewMs as Any), ("activeTimeInViewMs", self.activeTimeInViewMs as Any), ("heightToViewportRatioPermille", self.heightToViewportRatioPermille as Any), ("seenRangeRatioPermille", self.seenRangeRatioPermille as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMessageReadMetric", [("msgId", ConstructorParameterDescription(self.msgId)), ("viewId", ConstructorParameterDescription(self.viewId)), ("timeInViewMs", ConstructorParameterDescription(self.timeInViewMs)), ("activeTimeInViewMs", ConstructorParameterDescription(self.activeTimeInViewMs)), ("heightToViewportRatioPermille", ConstructorParameterDescription(self.heightToViewportRatioPermille)), ("seenRangeRatioPermille", ConstructorParameterDescription(self.seenRangeRatioPermille))]) } } case inputMessageReadMetric(Cons_inputMessageReadMetric) @@ -1299,10 +1299,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputMessageReadMetric(let _data): - return ("inputMessageReadMetric", [("msgId", _data.msgId as Any), ("viewId", _data.viewId as Any), ("timeInViewMs", _data.timeInViewMs as Any), ("activeTimeInViewMs", _data.activeTimeInViewMs as Any), ("heightToViewportRatioPermille", _data.heightToViewportRatioPermille as Any), ("seenRangeRatioPermille", _data.seenRangeRatioPermille as Any)]) + return ("inputMessageReadMetric", [("msgId", ConstructorParameterDescription(_data.msgId)), ("viewId", ConstructorParameterDescription(_data.viewId)), ("timeInViewMs", ConstructorParameterDescription(_data.timeInViewMs)), ("activeTimeInViewMs", ConstructorParameterDescription(_data.activeTimeInViewMs)), ("heightToViewportRatioPermille", ConstructorParameterDescription(_data.heightToViewportRatioPermille)), ("seenRangeRatioPermille", ConstructorParameterDescription(_data.seenRangeRatioPermille))]) } } @@ -1343,8 +1343,8 @@ public extension Api { self.peer = peer self.topMsgId = topMsgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputNotifyForumTopic", [("peer", self.peer as Any), ("topMsgId", self.topMsgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputNotifyForumTopic", [("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId))]) } } public class Cons_inputNotifyPeer: TypeConstructorDescription { @@ -1352,8 +1352,8 @@ public extension Api { public init(peer: Api.InputPeer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputNotifyPeer", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputNotifyPeer", [("peer", ConstructorParameterDescription(self.peer))]) } } case inputNotifyBroadcasts @@ -1395,16 +1395,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputNotifyBroadcasts: return ("inputNotifyBroadcasts", []) case .inputNotifyChats: return ("inputNotifyChats", []) case .inputNotifyForumTopic(let _data): - return ("inputNotifyForumTopic", [("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any)]) + return ("inputNotifyForumTopic", [("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId))]) case .inputNotifyPeer(let _data): - return ("inputNotifyPeer", [("peer", _data.peer as Any)]) + return ("inputNotifyPeer", [("peer", ConstructorParameterDescription(_data.peer))]) case .inputNotifyUsers: return ("inputNotifyUsers", []) } @@ -1457,8 +1457,8 @@ public extension Api { public init(pnvToken: String) { self.pnvToken = pnvToken } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", self.pnvToken as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", ConstructorParameterDescription(self.pnvToken))]) } } public class Cons_inputPasskeyCredentialPublicKey: TypeConstructorDescription { @@ -1470,8 +1470,8 @@ public extension Api { self.rawId = rawId self.response = response } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPasskeyCredentialPublicKey", [("id", self.id as Any), ("rawId", self.rawId as Any), ("response", self.response as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPasskeyCredentialPublicKey", [("id", ConstructorParameterDescription(self.id)), ("rawId", ConstructorParameterDescription(self.rawId)), ("response", ConstructorParameterDescription(self.response))]) } } case inputPasskeyCredentialFirebasePNV(Cons_inputPasskeyCredentialFirebasePNV) @@ -1496,12 +1496,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPasskeyCredentialFirebasePNV(let _data): - return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", _data.pnvToken as Any)]) + return ("inputPasskeyCredentialFirebasePNV", [("pnvToken", ConstructorParameterDescription(_data.pnvToken))]) case .inputPasskeyCredentialPublicKey(let _data): - return ("inputPasskeyCredentialPublicKey", [("id", _data.id as Any), ("rawId", _data.rawId as Any), ("response", _data.response as Any)]) + return ("inputPasskeyCredentialPublicKey", [("id", ConstructorParameterDescription(_data.id)), ("rawId", ConstructorParameterDescription(_data.rawId)), ("response", ConstructorParameterDescription(_data.response))]) } } diff --git a/submodules/TelegramApi/Sources/Api12.swift b/submodules/TelegramApi/Sources/Api12.swift index 9b4bb168b3..0fd5371719 100644 --- a/submodules/TelegramApi/Sources/Api12.swift +++ b/submodules/TelegramApi/Sources/Api12.swift @@ -11,8 +11,8 @@ public extension Api { self.signature = signature self.userHandle = userHandle } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPasskeyResponseLogin", [("clientData", self.clientData as Any), ("authenticatorData", self.authenticatorData as Any), ("signature", self.signature as Any), ("userHandle", self.userHandle as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPasskeyResponseLogin", [("clientData", ConstructorParameterDescription(self.clientData)), ("authenticatorData", ConstructorParameterDescription(self.authenticatorData)), ("signature", ConstructorParameterDescription(self.signature)), ("userHandle", ConstructorParameterDescription(self.userHandle))]) } } public class Cons_inputPasskeyResponseRegister: TypeConstructorDescription { @@ -22,8 +22,8 @@ public extension Api { self.clientData = clientData self.attestationData = attestationData } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPasskeyResponseRegister", [("clientData", self.clientData as Any), ("attestationData", self.attestationData as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPasskeyResponseRegister", [("clientData", ConstructorParameterDescription(self.clientData)), ("attestationData", ConstructorParameterDescription(self.attestationData))]) } } case inputPasskeyResponseLogin(Cons_inputPasskeyResponseLogin) @@ -50,12 +50,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPasskeyResponseLogin(let _data): - return ("inputPasskeyResponseLogin", [("clientData", _data.clientData as Any), ("authenticatorData", _data.authenticatorData as Any), ("signature", _data.signature as Any), ("userHandle", _data.userHandle as Any)]) + return ("inputPasskeyResponseLogin", [("clientData", ConstructorParameterDescription(_data.clientData)), ("authenticatorData", ConstructorParameterDescription(_data.authenticatorData)), ("signature", ConstructorParameterDescription(_data.signature)), ("userHandle", ConstructorParameterDescription(_data.userHandle))]) case .inputPasskeyResponseRegister(let _data): - return ("inputPasskeyResponseRegister", [("clientData", _data.clientData as Any), ("attestationData", _data.attestationData as Any)]) + return ("inputPasskeyResponseRegister", [("clientData", ConstructorParameterDescription(_data.clientData)), ("attestationData", ConstructorParameterDescription(_data.attestationData))]) } } @@ -108,8 +108,8 @@ public extension Api { self.flags = flags self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPaymentCredentials", [("flags", self.flags as Any), ("data", self.data as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPaymentCredentials", [("flags", ConstructorParameterDescription(self.flags)), ("data", ConstructorParameterDescription(self.data))]) } } public class Cons_inputPaymentCredentialsApplePay: TypeConstructorDescription { @@ -117,8 +117,8 @@ public extension Api { public init(paymentData: Api.DataJSON) { self.paymentData = paymentData } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPaymentCredentialsApplePay", [("paymentData", self.paymentData as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPaymentCredentialsApplePay", [("paymentData", ConstructorParameterDescription(self.paymentData))]) } } public class Cons_inputPaymentCredentialsGooglePay: TypeConstructorDescription { @@ -126,8 +126,8 @@ public extension Api { public init(paymentToken: Api.DataJSON) { self.paymentToken = paymentToken } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPaymentCredentialsGooglePay", [("paymentToken", self.paymentToken as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPaymentCredentialsGooglePay", [("paymentToken", ConstructorParameterDescription(self.paymentToken))]) } } public class Cons_inputPaymentCredentialsSaved: TypeConstructorDescription { @@ -137,8 +137,8 @@ public extension Api { self.id = id self.tmpPassword = tmpPassword } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPaymentCredentialsSaved", [("id", self.id as Any), ("tmpPassword", self.tmpPassword as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPaymentCredentialsSaved", [("id", ConstructorParameterDescription(self.id)), ("tmpPassword", ConstructorParameterDescription(self.tmpPassword))]) } } case inputPaymentCredentials(Cons_inputPaymentCredentials) @@ -177,16 +177,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPaymentCredentials(let _data): - return ("inputPaymentCredentials", [("flags", _data.flags as Any), ("data", _data.data as Any)]) + return ("inputPaymentCredentials", [("flags", ConstructorParameterDescription(_data.flags)), ("data", ConstructorParameterDescription(_data.data))]) case .inputPaymentCredentialsApplePay(let _data): - return ("inputPaymentCredentialsApplePay", [("paymentData", _data.paymentData as Any)]) + return ("inputPaymentCredentialsApplePay", [("paymentData", ConstructorParameterDescription(_data.paymentData))]) case .inputPaymentCredentialsGooglePay(let _data): - return ("inputPaymentCredentialsGooglePay", [("paymentToken", _data.paymentToken as Any)]) + return ("inputPaymentCredentialsGooglePay", [("paymentToken", ConstructorParameterDescription(_data.paymentToken))]) case .inputPaymentCredentialsSaved(let _data): - return ("inputPaymentCredentialsSaved", [("id", _data.id as Any), ("tmpPassword", _data.tmpPassword as Any)]) + return ("inputPaymentCredentialsSaved", [("id", ConstructorParameterDescription(_data.id)), ("tmpPassword", ConstructorParameterDescription(_data.tmpPassword))]) } } @@ -257,8 +257,8 @@ public extension Api { self.channelId = channelId self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerChannel", [("channelId", self.channelId as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerChannel", [("channelId", ConstructorParameterDescription(self.channelId)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputPeerChannelFromMessage: TypeConstructorDescription { @@ -270,8 +270,8 @@ public extension Api { self.msgId = msgId self.channelId = channelId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerChannelFromMessage", [("peer", self.peer as Any), ("msgId", self.msgId as Any), ("channelId", self.channelId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerChannelFromMessage", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("channelId", ConstructorParameterDescription(self.channelId))]) } } public class Cons_inputPeerChat: TypeConstructorDescription { @@ -279,8 +279,8 @@ public extension Api { public init(chatId: Int64) { self.chatId = chatId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerChat", [("chatId", self.chatId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerChat", [("chatId", ConstructorParameterDescription(self.chatId))]) } } public class Cons_inputPeerUser: TypeConstructorDescription { @@ -290,8 +290,8 @@ public extension Api { self.userId = userId self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerUser", [("userId", self.userId as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerUser", [("userId", ConstructorParameterDescription(self.userId)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputPeerUserFromMessage: TypeConstructorDescription { @@ -303,8 +303,8 @@ public extension Api { self.msgId = msgId self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerUserFromMessage", [("peer", self.peer as Any), ("msgId", self.msgId as Any), ("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerUserFromMessage", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("userId", ConstructorParameterDescription(self.userId))]) } } case inputPeerChannel(Cons_inputPeerChannel) @@ -366,22 +366,22 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPeerChannel(let _data): - return ("inputPeerChannel", [("channelId", _data.channelId as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputPeerChannel", [("channelId", ConstructorParameterDescription(_data.channelId)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputPeerChannelFromMessage(let _data): - return ("inputPeerChannelFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("channelId", _data.channelId as Any)]) + return ("inputPeerChannelFromMessage", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("channelId", ConstructorParameterDescription(_data.channelId))]) case .inputPeerChat(let _data): - return ("inputPeerChat", [("chatId", _data.chatId as Any)]) + return ("inputPeerChat", [("chatId", ConstructorParameterDescription(_data.chatId))]) case .inputPeerEmpty: return ("inputPeerEmpty", []) case .inputPeerSelf: return ("inputPeerSelf", []) case .inputPeerUser(let _data): - return ("inputPeerUser", [("userId", _data.userId as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputPeerUser", [("userId", ConstructorParameterDescription(_data.userId)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputPeerUserFromMessage(let _data): - return ("inputPeerUserFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("userId", _data.userId as Any)]) + return ("inputPeerUserFromMessage", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("userId", ConstructorParameterDescription(_data.userId))]) } } @@ -491,8 +491,8 @@ public extension Api { self.storiesHideSender = storiesHideSender self.storiesSound = storiesSound } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerNotifySettings", [("flags", self.flags as Any), ("showPreviews", self.showPreviews as Any), ("silent", self.silent as Any), ("muteUntil", self.muteUntil as Any), ("sound", self.sound as Any), ("storiesMuted", self.storiesMuted as Any), ("storiesHideSender", self.storiesHideSender as Any), ("storiesSound", self.storiesSound as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerNotifySettings", [("flags", ConstructorParameterDescription(self.flags)), ("showPreviews", ConstructorParameterDescription(self.showPreviews)), ("silent", ConstructorParameterDescription(self.silent)), ("muteUntil", ConstructorParameterDescription(self.muteUntil)), ("sound", ConstructorParameterDescription(self.sound)), ("storiesMuted", ConstructorParameterDescription(self.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(self.storiesHideSender)), ("storiesSound", ConstructorParameterDescription(self.storiesSound))]) } } case inputPeerNotifySettings(Cons_inputPeerNotifySettings) @@ -529,10 +529,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPeerNotifySettings(let _data): - return ("inputPeerNotifySettings", [("flags", _data.flags as Any), ("showPreviews", _data.showPreviews as Any), ("silent", _data.silent as Any), ("muteUntil", _data.muteUntil as Any), ("sound", _data.sound as Any), ("storiesMuted", _data.storiesMuted as Any), ("storiesHideSender", _data.storiesHideSender as Any), ("storiesSound", _data.storiesSound as Any)]) + return ("inputPeerNotifySettings", [("flags", ConstructorParameterDescription(_data.flags)), ("showPreviews", ConstructorParameterDescription(_data.showPreviews)), ("silent", ConstructorParameterDescription(_data.silent)), ("muteUntil", ConstructorParameterDescription(_data.muteUntil)), ("sound", ConstructorParameterDescription(_data.sound)), ("storiesMuted", ConstructorParameterDescription(_data.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(_data.storiesHideSender)), ("storiesSound", ConstructorParameterDescription(_data.storiesSound))]) } } @@ -605,8 +605,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPhoneCall", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPhoneCall", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } case inputPhoneCall(Cons_inputPhoneCall) @@ -623,10 +623,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPhoneCall(let _data): - return ("inputPhoneCall", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputPhoneCall", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) } } @@ -657,8 +657,8 @@ public extension Api { self.accessHash = accessHash self.fileReference = fileReference } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPhoto", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("fileReference", self.fileReference as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPhoto", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference))]) } } case inputPhoto(Cons_inputPhoto) @@ -682,10 +682,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPhoto(let _data): - return ("inputPhoto", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any)]) + return ("inputPhoto", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference))]) case .inputPhotoEmpty: return ("inputPhotoEmpty", []) } @@ -805,7 +805,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPrivacyKeyAbout: return ("inputPrivacyKeyAbout", []) @@ -889,8 +889,8 @@ public extension Api { public init(chats: [Int64]) { self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPrivacyValueAllowChatParticipants", [("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) } } public class Cons_inputPrivacyValueAllowUsers: TypeConstructorDescription { @@ -898,8 +898,8 @@ public extension Api { public init(users: [Api.InputUser]) { self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPrivacyValueAllowUsers", [("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueAllowUsers", [("users", ConstructorParameterDescription(self.users))]) } } public class Cons_inputPrivacyValueDisallowChatParticipants: TypeConstructorDescription { @@ -907,8 +907,8 @@ public extension Api { public init(chats: [Int64]) { self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPrivacyValueDisallowChatParticipants", [("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) } } public class Cons_inputPrivacyValueDisallowUsers: TypeConstructorDescription { @@ -916,8 +916,8 @@ public extension Api { public init(users: [Api.InputUser]) { self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPrivacyValueDisallowUsers", [("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPrivacyValueDisallowUsers", [("users", ConstructorParameterDescription(self.users))]) } } case inputPrivacyValueAllowAll @@ -1018,14 +1018,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPrivacyValueAllowAll: return ("inputPrivacyValueAllowAll", []) case .inputPrivacyValueAllowBots: return ("inputPrivacyValueAllowBots", []) case .inputPrivacyValueAllowChatParticipants(let _data): - return ("inputPrivacyValueAllowChatParticipants", [("chats", _data.chats as Any)]) + return ("inputPrivacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) case .inputPrivacyValueAllowCloseFriends: return ("inputPrivacyValueAllowCloseFriends", []) case .inputPrivacyValueAllowContacts: @@ -1033,17 +1033,17 @@ public extension Api { case .inputPrivacyValueAllowPremium: return ("inputPrivacyValueAllowPremium", []) case .inputPrivacyValueAllowUsers(let _data): - return ("inputPrivacyValueAllowUsers", [("users", _data.users as Any)]) + return ("inputPrivacyValueAllowUsers", [("users", ConstructorParameterDescription(_data.users))]) case .inputPrivacyValueDisallowAll: return ("inputPrivacyValueDisallowAll", []) case .inputPrivacyValueDisallowBots: return ("inputPrivacyValueDisallowBots", []) case .inputPrivacyValueDisallowChatParticipants(let _data): - return ("inputPrivacyValueDisallowChatParticipants", [("chats", _data.chats as Any)]) + return ("inputPrivacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) case .inputPrivacyValueDisallowContacts: return ("inputPrivacyValueDisallowContacts", []) case .inputPrivacyValueDisallowUsers(let _data): - return ("inputPrivacyValueDisallowUsers", [("users", _data.users as Any)]) + return ("inputPrivacyValueDisallowUsers", [("users", ConstructorParameterDescription(_data.users))]) } } diff --git a/submodules/TelegramApi/Sources/Api13.swift b/submodules/TelegramApi/Sources/Api13.swift index 2f02bf78a8..1501d492d3 100644 --- a/submodules/TelegramApi/Sources/Api13.swift +++ b/submodules/TelegramApi/Sources/Api13.swift @@ -5,8 +5,8 @@ public extension Api { public init(shortcut: String) { self.shortcut = shortcut } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputQuickReplyShortcut", [("shortcut", self.shortcut as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputQuickReplyShortcut", [("shortcut", ConstructorParameterDescription(self.shortcut))]) } } public class Cons_inputQuickReplyShortcutId: TypeConstructorDescription { @@ -14,8 +14,8 @@ public extension Api { public init(shortcutId: Int32) { self.shortcutId = shortcutId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputQuickReplyShortcutId", [("shortcutId", self.shortcutId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputQuickReplyShortcutId", [("shortcutId", ConstructorParameterDescription(self.shortcutId))]) } } case inputQuickReplyShortcut(Cons_inputQuickReplyShortcut) @@ -38,12 +38,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputQuickReplyShortcut(let _data): - return ("inputQuickReplyShortcut", [("shortcut", _data.shortcut as Any)]) + return ("inputQuickReplyShortcut", [("shortcut", ConstructorParameterDescription(_data.shortcut))]) case .inputQuickReplyShortcutId(let _data): - return ("inputQuickReplyShortcutId", [("shortcutId", _data.shortcutId as Any)]) + return ("inputQuickReplyShortcutId", [("shortcutId", ConstructorParameterDescription(_data.shortcutId))]) } } @@ -96,8 +96,8 @@ public extension Api { self.todoItemId = todoItemId self.pollOption = pollOption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputReplyToMessage", [("flags", self.flags as Any), ("replyToMsgId", self.replyToMsgId as Any), ("topMsgId", self.topMsgId as Any), ("replyToPeerId", self.replyToPeerId as Any), ("quoteText", self.quoteText as Any), ("quoteEntities", self.quoteEntities as Any), ("quoteOffset", self.quoteOffset as Any), ("monoforumPeerId", self.monoforumPeerId as Any), ("todoItemId", self.todoItemId as Any), ("pollOption", self.pollOption as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputReplyToMessage", [("flags", ConstructorParameterDescription(self.flags)), ("replyToMsgId", ConstructorParameterDescription(self.replyToMsgId)), ("topMsgId", ConstructorParameterDescription(self.topMsgId)), ("replyToPeerId", ConstructorParameterDescription(self.replyToPeerId)), ("quoteText", ConstructorParameterDescription(self.quoteText)), ("quoteEntities", ConstructorParameterDescription(self.quoteEntities)), ("quoteOffset", ConstructorParameterDescription(self.quoteOffset)), ("monoforumPeerId", ConstructorParameterDescription(self.monoforumPeerId)), ("todoItemId", ConstructorParameterDescription(self.todoItemId)), ("pollOption", ConstructorParameterDescription(self.pollOption))]) } } public class Cons_inputReplyToMonoForum: TypeConstructorDescription { @@ -105,8 +105,8 @@ public extension Api { public init(monoforumPeerId: Api.InputPeer) { self.monoforumPeerId = monoforumPeerId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputReplyToMonoForum", [("monoforumPeerId", self.monoforumPeerId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputReplyToMonoForum", [("monoforumPeerId", ConstructorParameterDescription(self.monoforumPeerId))]) } } public class Cons_inputReplyToStory: TypeConstructorDescription { @@ -116,8 +116,8 @@ public extension Api { self.peer = peer self.storyId = storyId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputReplyToStory", [("peer", self.peer as Any), ("storyId", self.storyId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputReplyToStory", [("peer", ConstructorParameterDescription(self.peer)), ("storyId", ConstructorParameterDescription(self.storyId))]) } } case inputReplyToMessage(Cons_inputReplyToMessage) @@ -177,14 +177,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputReplyToMessage(let _data): - return ("inputReplyToMessage", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("topMsgId", _data.topMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("monoforumPeerId", _data.monoforumPeerId as Any), ("todoItemId", _data.todoItemId as Any), ("pollOption", _data.pollOption as Any)]) + return ("inputReplyToMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("replyToMsgId", ConstructorParameterDescription(_data.replyToMsgId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("replyToPeerId", ConstructorParameterDescription(_data.replyToPeerId)), ("quoteText", ConstructorParameterDescription(_data.quoteText)), ("quoteEntities", ConstructorParameterDescription(_data.quoteEntities)), ("quoteOffset", ConstructorParameterDescription(_data.quoteOffset)), ("monoforumPeerId", ConstructorParameterDescription(_data.monoforumPeerId)), ("todoItemId", ConstructorParameterDescription(_data.todoItemId)), ("pollOption", ConstructorParameterDescription(_data.pollOption))]) case .inputReplyToMonoForum(let _data): - return ("inputReplyToMonoForum", [("monoforumPeerId", _data.monoforumPeerId as Any)]) + return ("inputReplyToMonoForum", [("monoforumPeerId", ConstructorParameterDescription(_data.monoforumPeerId))]) case .inputReplyToStory(let _data): - return ("inputReplyToStory", [("peer", _data.peer as Any), ("storyId", _data.storyId as Any)]) + return ("inputReplyToStory", [("peer", ConstructorParameterDescription(_data.peer)), ("storyId", ConstructorParameterDescription(_data.storyId))]) } } @@ -288,8 +288,8 @@ public extension Api { self.peer = peer self.savedId = savedId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSavedStarGiftChat", [("peer", self.peer as Any), ("savedId", self.savedId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSavedStarGiftChat", [("peer", ConstructorParameterDescription(self.peer)), ("savedId", ConstructorParameterDescription(self.savedId))]) } } public class Cons_inputSavedStarGiftSlug: TypeConstructorDescription { @@ -297,8 +297,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSavedStarGiftSlug", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSavedStarGiftSlug", [("slug", ConstructorParameterDescription(self.slug))]) } } public class Cons_inputSavedStarGiftUser: TypeConstructorDescription { @@ -306,8 +306,8 @@ public extension Api { public init(msgId: Int32) { self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSavedStarGiftUser", [("msgId", self.msgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSavedStarGiftUser", [("msgId", ConstructorParameterDescription(self.msgId))]) } } case inputSavedStarGiftChat(Cons_inputSavedStarGiftChat) @@ -338,14 +338,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputSavedStarGiftChat(let _data): - return ("inputSavedStarGiftChat", [("peer", _data.peer as Any), ("savedId", _data.savedId as Any)]) + return ("inputSavedStarGiftChat", [("peer", ConstructorParameterDescription(_data.peer)), ("savedId", ConstructorParameterDescription(_data.savedId))]) case .inputSavedStarGiftSlug(let _data): - return ("inputSavedStarGiftSlug", [("slug", _data.slug as Any)]) + return ("inputSavedStarGiftSlug", [("slug", ConstructorParameterDescription(_data.slug))]) case .inputSavedStarGiftUser(let _data): - return ("inputSavedStarGiftUser", [("msgId", _data.msgId as Any)]) + return ("inputSavedStarGiftUser", [("msgId", ConstructorParameterDescription(_data.msgId))]) } } @@ -398,8 +398,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSecureFile", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSecureFile", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputSecureFileUploaded: TypeConstructorDescription { @@ -415,8 +415,8 @@ public extension Api { self.fileHash = fileHash self.secret = secret } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSecureFileUploaded", [("id", self.id as Any), ("parts", self.parts as Any), ("md5Checksum", self.md5Checksum as Any), ("fileHash", self.fileHash as Any), ("secret", self.secret as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSecureFileUploaded", [("id", ConstructorParameterDescription(self.id)), ("parts", ConstructorParameterDescription(self.parts)), ("md5Checksum", ConstructorParameterDescription(self.md5Checksum)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("secret", ConstructorParameterDescription(self.secret))]) } } case inputSecureFile(Cons_inputSecureFile) @@ -444,12 +444,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputSecureFile(let _data): - return ("inputSecureFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputSecureFile", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputSecureFileUploaded(let _data): - return ("inputSecureFileUploaded", [("id", _data.id as Any), ("parts", _data.parts as Any), ("md5Checksum", _data.md5Checksum as Any), ("fileHash", _data.fileHash as Any), ("secret", _data.secret as Any)]) + return ("inputSecureFileUploaded", [("id", ConstructorParameterDescription(_data.id)), ("parts", ConstructorParameterDescription(_data.parts)), ("md5Checksum", ConstructorParameterDescription(_data.md5Checksum)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("secret", ConstructorParameterDescription(_data.secret))]) } } @@ -515,8 +515,8 @@ public extension Api { self.files = files self.plainData = plainData } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSecureValue", [("flags", self.flags as Any), ("type", self.type as Any), ("data", self.data as Any), ("frontSide", self.frontSide as Any), ("reverseSide", self.reverseSide as Any), ("selfie", self.selfie as Any), ("translation", self.translation as Any), ("files", self.files as Any), ("plainData", self.plainData as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSecureValue", [("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))]) } } case inputSecureValue(Cons_inputSecureValue) @@ -562,10 +562,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputSecureValue(let _data): - return ("inputSecureValue", [("flags", _data.flags as Any), ("type", _data.type as Any), ("data", _data.data as Any), ("frontSide", _data.frontSide as Any), ("reverseSide", _data.reverseSide as Any), ("selfie", _data.selfie as Any), ("translation", _data.translation as Any), ("files", _data.files as Any), ("plainData", _data.plainData as Any)]) + return ("inputSecureValue", [("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))]) } } @@ -651,8 +651,8 @@ public extension Api { self.message = message self.entities = entities } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputSingleMedia", [("flags", self.flags as Any), ("media", self.media as Any), ("randomId", self.randomId as Any), ("message", self.message as Any), ("entities", self.entities as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputSingleMedia", [("flags", ConstructorParameterDescription(self.flags)), ("media", ConstructorParameterDescription(self.media)), ("randomId", ConstructorParameterDescription(self.randomId)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities))]) } } case inputSingleMedia(Cons_inputSingleMedia) @@ -678,10 +678,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputSingleMedia(let _data): - return ("inputSingleMedia", [("flags", _data.flags as Any), ("media", _data.media as Any), ("randomId", _data.randomId as Any), ("message", _data.message as Any), ("entities", _data.entities as Any)]) + return ("inputSingleMedia", [("flags", ConstructorParameterDescription(_data.flags)), ("media", ConstructorParameterDescription(_data.media)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities))]) } } @@ -723,8 +723,8 @@ public extension Api { public init(giftId: Int64) { self.giftId = giftId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStarGiftAuction", [("giftId", self.giftId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStarGiftAuction", [("giftId", ConstructorParameterDescription(self.giftId))]) } } public class Cons_inputStarGiftAuctionSlug: TypeConstructorDescription { @@ -732,8 +732,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStarGiftAuctionSlug", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStarGiftAuctionSlug", [("slug", ConstructorParameterDescription(self.slug))]) } } case inputStarGiftAuction(Cons_inputStarGiftAuction) @@ -756,12 +756,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputStarGiftAuction(let _data): - return ("inputStarGiftAuction", [("giftId", _data.giftId as Any)]) + return ("inputStarGiftAuction", [("giftId", ConstructorParameterDescription(_data.giftId))]) case .inputStarGiftAuctionSlug(let _data): - return ("inputStarGiftAuctionSlug", [("slug", _data.slug as Any)]) + return ("inputStarGiftAuctionSlug", [("slug", ConstructorParameterDescription(_data.slug))]) } } @@ -798,8 +798,8 @@ public extension Api { self.flags = flags self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStarsTransaction", [("flags", self.flags as Any), ("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStarsTransaction", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id))]) } } case inputStarsTransaction(Cons_inputStarsTransaction) @@ -816,10 +816,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputStarsTransaction(let _data): - return ("inputStarsTransaction", [("flags", _data.flags as Any), ("id", _data.id as Any)]) + return ("inputStarsTransaction", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id))]) } } @@ -846,8 +846,8 @@ public extension Api { public init(emoticon: String) { self.emoticon = emoticon } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStickerSetDice", [("emoticon", self.emoticon as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickerSetDice", [("emoticon", ConstructorParameterDescription(self.emoticon))]) } } public class Cons_inputStickerSetID: TypeConstructorDescription { @@ -857,8 +857,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStickerSetID", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickerSetID", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputStickerSetShortName: TypeConstructorDescription { @@ -866,8 +866,8 @@ public extension Api { public init(shortName: String) { self.shortName = shortName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStickerSetShortName", [("shortName", self.shortName as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickerSetShortName", [("shortName", ConstructorParameterDescription(self.shortName))]) } } case inputStickerSetAnimatedEmoji @@ -952,14 +952,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputStickerSetAnimatedEmoji: return ("inputStickerSetAnimatedEmoji", []) case .inputStickerSetAnimatedEmojiAnimations: return ("inputStickerSetAnimatedEmojiAnimations", []) case .inputStickerSetDice(let _data): - return ("inputStickerSetDice", [("emoticon", _data.emoticon as Any)]) + return ("inputStickerSetDice", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) case .inputStickerSetEmojiChannelDefaultStatuses: return ("inputStickerSetEmojiChannelDefaultStatuses", []) case .inputStickerSetEmojiDefaultStatuses: @@ -971,11 +971,11 @@ public extension Api { case .inputStickerSetEmpty: return ("inputStickerSetEmpty", []) case .inputStickerSetID(let _data): - return ("inputStickerSetID", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputStickerSetID", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputStickerSetPremiumGifts: return ("inputStickerSetPremiumGifts", []) case .inputStickerSetShortName(let _data): - return ("inputStickerSetShortName", [("shortName", _data.shortName as Any)]) + return ("inputStickerSetShortName", [("shortName", ConstructorParameterDescription(_data.shortName))]) case .inputStickerSetTonGifts: return ("inputStickerSetTonGifts", []) } @@ -1061,8 +1061,8 @@ public extension Api { self.maskCoords = maskCoords self.keywords = keywords } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStickerSetItem", [("flags", self.flags as Any), ("document", self.document as Any), ("emoji", self.emoji as Any), ("maskCoords", self.maskCoords as Any), ("keywords", self.keywords as Any)]) + 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) @@ -1086,10 +1086,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputStickerSetItem(let _data): - return ("inputStickerSetItem", [("flags", _data.flags as Any), ("document", _data.document as Any), ("emoji", _data.emoji as Any), ("maskCoords", _data.maskCoords as Any), ("keywords", _data.keywords as Any)]) + return ("inputStickerSetItem", [("flags", ConstructorParameterDescription(_data.flags)), ("document", ConstructorParameterDescription(_data.document)), ("emoji", ConstructorParameterDescription(_data.emoji)), ("maskCoords", ConstructorParameterDescription(_data.maskCoords)), ("keywords", ConstructorParameterDescription(_data.keywords))]) } } @@ -1133,8 +1133,8 @@ public extension Api { public init(id: Api.InputDocument) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStickeredMediaDocument", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickeredMediaDocument", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_inputStickeredMediaPhoto: TypeConstructorDescription { @@ -1142,8 +1142,8 @@ public extension Api { public init(id: Api.InputPhoto) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStickeredMediaPhoto", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStickeredMediaPhoto", [("id", ConstructorParameterDescription(self.id))]) } } case inputStickeredMediaDocument(Cons_inputStickeredMediaDocument) @@ -1166,12 +1166,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputStickeredMediaDocument(let _data): - return ("inputStickeredMediaDocument", [("id", _data.id as Any)]) + return ("inputStickeredMediaDocument", [("id", ConstructorParameterDescription(_data.id))]) case .inputStickeredMediaPhoto(let _data): - return ("inputStickeredMediaPhoto", [("id", _data.id as Any)]) + return ("inputStickeredMediaPhoto", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -1218,8 +1218,8 @@ public extension Api { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentAuthCode", [("flags", self.flags as Any), ("phoneNumber", self.phoneNumber as Any), ("phoneCodeHash", self.phoneCodeHash as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentAuthCode", [("flags", ConstructorParameterDescription(self.flags)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) } } public class Cons_inputStorePaymentGiftPremium: TypeConstructorDescription { @@ -1231,8 +1231,8 @@ public extension Api { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentGiftPremium", [("userId", self.userId as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + 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 { @@ -1250,8 +1250,8 @@ public extension Api { self.amount = amount self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentPremiumGiftCode", [("flags", self.flags as Any), ("users", self.users as Any), ("boostPeer", self.boostPeer as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("message", self.message as Any)]) + 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 { @@ -1275,8 +1275,8 @@ public extension Api { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentPremiumGiveaway", [("flags", self.flags as Any), ("boostPeer", self.boostPeer as Any), ("additionalPeers", self.additionalPeers as Any), ("countriesIso2", self.countriesIso2 as Any), ("prizeDescription", self.prizeDescription as Any), ("randomId", self.randomId as Any), ("untilDate", self.untilDate as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + 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 { @@ -1284,8 +1284,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentPremiumSubscription", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputStorePaymentPremiumSubscription", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_inputStorePaymentStarsGift: TypeConstructorDescription { @@ -1299,8 +1299,8 @@ public extension Api { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentStarsGift", [("userId", self.userId as Any), ("stars", self.stars as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + 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 { @@ -1328,8 +1328,8 @@ public extension Api { self.amount = amount self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentStarsGiveaway", [("flags", self.flags as Any), ("stars", self.stars as Any), ("boostPeer", self.boostPeer as Any), ("additionalPeers", self.additionalPeers as Any), ("countriesIso2", self.countriesIso2 as Any), ("prizeDescription", self.prizeDescription as Any), ("randomId", self.randomId as Any), ("untilDate", self.untilDate as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("users", self.users as Any)]) + 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 { @@ -1345,8 +1345,8 @@ public extension Api { self.amount = amount self.spendPurposePeer = spendPurposePeer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputStorePaymentStarsTopup", [("flags", self.flags as Any), ("stars", self.stars as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("spendPurposePeer", self.spendPurposePeer as Any)]) + 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) @@ -1485,24 +1485,24 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputStorePaymentAuthCode(let _data): - return ("inputStorePaymentAuthCode", [("flags", _data.flags as Any), ("phoneNumber", _data.phoneNumber as Any), ("phoneCodeHash", _data.phoneCodeHash as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + return ("inputStorePaymentAuthCode", [("flags", ConstructorParameterDescription(_data.flags)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) case .inputStorePaymentGiftPremium(let _data): - return ("inputStorePaymentGiftPremium", [("userId", _data.userId as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + return ("inputStorePaymentGiftPremium", [("userId", ConstructorParameterDescription(_data.userId)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) case .inputStorePaymentPremiumGiftCode(let _data): - return ("inputStorePaymentPremiumGiftCode", [("flags", _data.flags as Any), ("users", _data.users as Any), ("boostPeer", _data.boostPeer as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("message", _data.message as Any)]) + 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", _data.flags as Any), ("boostPeer", _data.boostPeer as Any), ("additionalPeers", _data.additionalPeers as Any), ("countriesIso2", _data.countriesIso2 as Any), ("prizeDescription", _data.prizeDescription as Any), ("randomId", _data.randomId as Any), ("untilDate", _data.untilDate as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + 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", _data.flags as Any)]) + return ("inputStorePaymentPremiumSubscription", [("flags", ConstructorParameterDescription(_data.flags))]) case .inputStorePaymentStarsGift(let _data): - return ("inputStorePaymentStarsGift", [("userId", _data.userId as Any), ("stars", _data.stars as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + 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", _data.flags as Any), ("stars", _data.stars as Any), ("boostPeer", _data.boostPeer as Any), ("additionalPeers", _data.additionalPeers as Any), ("countriesIso2", _data.countriesIso2 as Any), ("prizeDescription", _data.prizeDescription as Any), ("randomId", _data.randomId as Any), ("untilDate", _data.untilDate as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("users", _data.users as Any)]) + 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", _data.flags as Any), ("stars", _data.stars as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("spendPurposePeer", _data.spendPurposePeer as Any)]) + return ("inputStorePaymentStarsTopup", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount)), ("spendPurposePeer", ConstructorParameterDescription(_data.spendPurposePeer))]) } } diff --git a/submodules/TelegramApi/Sources/Api14.swift b/submodules/TelegramApi/Sources/Api14.swift index 1cc5f27329..3d3e270c25 100644 --- a/submodules/TelegramApi/Sources/Api14.swift +++ b/submodules/TelegramApi/Sources/Api14.swift @@ -7,8 +7,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputTheme", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputTheme", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputThemeSlug: TypeConstructorDescription { @@ -16,8 +16,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputThemeSlug", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputThemeSlug", [("slug", ConstructorParameterDescription(self.slug))]) } } case inputTheme(Cons_inputTheme) @@ -41,12 +41,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputTheme(let _data): - return ("inputTheme", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputTheme", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputThemeSlug(let _data): - return ("inputThemeSlug", [("slug", _data.slug as Any)]) + return ("inputThemeSlug", [("slug", ConstructorParameterDescription(_data.slug))]) } } @@ -96,8 +96,8 @@ public extension Api { self.wallpaper = wallpaper self.wallpaperSettings = wallpaperSettings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputThemeSettings", [("flags", self.flags as Any), ("baseTheme", self.baseTheme as Any), ("accentColor", self.accentColor as Any), ("outboxAccentColor", self.outboxAccentColor as Any), ("messageColors", self.messageColors as Any), ("wallpaper", self.wallpaper as Any), ("wallpaperSettings", self.wallpaperSettings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputThemeSettings", [("flags", ConstructorParameterDescription(self.flags)), ("baseTheme", ConstructorParameterDescription(self.baseTheme)), ("accentColor", ConstructorParameterDescription(self.accentColor)), ("outboxAccentColor", ConstructorParameterDescription(self.outboxAccentColor)), ("messageColors", ConstructorParameterDescription(self.messageColors)), ("wallpaper", ConstructorParameterDescription(self.wallpaper)), ("wallpaperSettings", ConstructorParameterDescription(self.wallpaperSettings))]) } } case inputThemeSettings(Cons_inputThemeSettings) @@ -131,10 +131,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputThemeSettings(let _data): - return ("inputThemeSettings", [("flags", _data.flags as Any), ("baseTheme", _data.baseTheme as Any), ("accentColor", _data.accentColor as Any), ("outboxAccentColor", _data.outboxAccentColor as Any), ("messageColors", _data.messageColors as Any), ("wallpaper", _data.wallpaper as Any), ("wallpaperSettings", _data.wallpaperSettings as Any)]) + return ("inputThemeSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("baseTheme", ConstructorParameterDescription(_data.baseTheme)), ("accentColor", ConstructorParameterDescription(_data.accentColor)), ("outboxAccentColor", ConstructorParameterDescription(_data.outboxAccentColor)), ("messageColors", ConstructorParameterDescription(_data.messageColors)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper)), ("wallpaperSettings", ConstructorParameterDescription(_data.wallpaperSettings))]) } } @@ -194,8 +194,8 @@ public extension Api { self.userId = userId self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputUser", [("userId", self.userId as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputUser", [("userId", ConstructorParameterDescription(self.userId)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputUserFromMessage: TypeConstructorDescription { @@ -207,8 +207,8 @@ public extension Api { self.msgId = msgId self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputUserFromMessage", [("peer", self.peer as Any), ("msgId", self.msgId as Any), ("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputUserFromMessage", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("userId", ConstructorParameterDescription(self.userId))]) } } case inputUser(Cons_inputUser) @@ -246,14 +246,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputUser(let _data): - return ("inputUser", [("userId", _data.userId as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputUser", [("userId", ConstructorParameterDescription(_data.userId)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputUserEmpty: return ("inputUserEmpty", []) case .inputUserFromMessage(let _data): - return ("inputUserFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("userId", _data.userId as Any)]) + return ("inputUserFromMessage", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("userId", ConstructorParameterDescription(_data.userId))]) case .inputUserSelf: return ("inputUserSelf", []) } @@ -309,8 +309,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputWallPaper", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputWallPaper", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputWallPaperNoFile: TypeConstructorDescription { @@ -318,8 +318,8 @@ public extension Api { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputWallPaperNoFile", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputWallPaperNoFile", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_inputWallPaperSlug: TypeConstructorDescription { @@ -327,8 +327,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputWallPaperSlug", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputWallPaperSlug", [("slug", ConstructorParameterDescription(self.slug))]) } } case inputWallPaper(Cons_inputWallPaper) @@ -359,14 +359,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputWallPaper(let _data): - return ("inputWallPaper", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputWallPaper", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputWallPaperNoFile(let _data): - return ("inputWallPaperNoFile", [("id", _data.id as Any)]) + return ("inputWallPaperNoFile", [("id", ConstructorParameterDescription(_data.id))]) case .inputWallPaperSlug(let _data): - return ("inputWallPaperSlug", [("slug", _data.slug as Any)]) + return ("inputWallPaperSlug", [("slug", ConstructorParameterDescription(_data.slug))]) } } @@ -421,8 +421,8 @@ public extension Api { self.mimeType = mimeType self.attributes = attributes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputWebDocument", [("url", self.url as Any), ("size", self.size as Any), ("mimeType", self.mimeType as Any), ("attributes", self.attributes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputWebDocument", [("url", ConstructorParameterDescription(self.url)), ("size", ConstructorParameterDescription(self.size)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("attributes", ConstructorParameterDescription(self.attributes))]) } } case inputWebDocument(Cons_inputWebDocument) @@ -445,10 +445,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputWebDocument(let _data): - return ("inputWebDocument", [("url", _data.url as Any), ("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any)]) + return ("inputWebDocument", [("url", ConstructorParameterDescription(_data.url)), ("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("attributes", ConstructorParameterDescription(_data.attributes))]) } } @@ -489,8 +489,8 @@ public extension Api { self.title = title self.performer = performer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputWebFileAudioAlbumThumbLocation", [("flags", self.flags as Any), ("document", self.document as Any), ("title", self.title as Any), ("performer", self.performer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputWebFileAudioAlbumThumbLocation", [("flags", ConstructorParameterDescription(self.flags)), ("document", ConstructorParameterDescription(self.document)), ("title", ConstructorParameterDescription(self.title)), ("performer", ConstructorParameterDescription(self.performer))]) } } public class Cons_inputWebFileGeoPointLocation: TypeConstructorDescription { @@ -508,8 +508,8 @@ public extension Api { self.zoom = zoom self.scale = scale } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputWebFileGeoPointLocation", [("geoPoint", self.geoPoint as Any), ("accessHash", self.accessHash as Any), ("w", self.w as Any), ("h", self.h as Any), ("zoom", self.zoom as Any), ("scale", self.scale as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputWebFileGeoPointLocation", [("geoPoint", ConstructorParameterDescription(self.geoPoint)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("zoom", ConstructorParameterDescription(self.zoom)), ("scale", ConstructorParameterDescription(self.scale))]) } } public class Cons_inputWebFileLocation: TypeConstructorDescription { @@ -519,8 +519,8 @@ public extension Api { self.url = url self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputWebFileLocation", [("url", self.url as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputWebFileLocation", [("url", ConstructorParameterDescription(self.url)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } case inputWebFileAudioAlbumThumbLocation(Cons_inputWebFileAudioAlbumThumbLocation) @@ -565,14 +565,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputWebFileAudioAlbumThumbLocation(let _data): - return ("inputWebFileAudioAlbumThumbLocation", [("flags", _data.flags as Any), ("document", _data.document as Any), ("title", _data.title as Any), ("performer", _data.performer as Any)]) + return ("inputWebFileAudioAlbumThumbLocation", [("flags", ConstructorParameterDescription(_data.flags)), ("document", ConstructorParameterDescription(_data.document)), ("title", ConstructorParameterDescription(_data.title)), ("performer", ConstructorParameterDescription(_data.performer))]) case .inputWebFileGeoPointLocation(let _data): - return ("inputWebFileGeoPointLocation", [("geoPoint", _data.geoPoint as Any), ("accessHash", _data.accessHash as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("zoom", _data.zoom as Any), ("scale", _data.scale as Any)]) + return ("inputWebFileGeoPointLocation", [("geoPoint", ConstructorParameterDescription(_data.geoPoint)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("zoom", ConstructorParameterDescription(_data.zoom)), ("scale", ConstructorParameterDescription(_data.scale))]) case .inputWebFileLocation(let _data): - return ("inputWebFileLocation", [("url", _data.url as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputWebFileLocation", [("url", ConstructorParameterDescription(_data.url)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) } } @@ -667,8 +667,8 @@ public extension Api { self.termsUrl = termsUrl self.subscriptionPeriod = subscriptionPeriod } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("invoice", [("flags", self.flags as Any), ("currency", self.currency as Any), ("prices", self.prices as Any), ("maxTipAmount", self.maxTipAmount as Any), ("suggestedTipAmounts", self.suggestedTipAmounts as Any), ("termsUrl", self.termsUrl as Any), ("subscriptionPeriod", self.subscriptionPeriod as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("invoice", [("flags", ConstructorParameterDescription(self.flags)), ("currency", ConstructorParameterDescription(self.currency)), ("prices", ConstructorParameterDescription(self.prices)), ("maxTipAmount", ConstructorParameterDescription(self.maxTipAmount)), ("suggestedTipAmounts", ConstructorParameterDescription(self.suggestedTipAmounts)), ("termsUrl", ConstructorParameterDescription(self.termsUrl)), ("subscriptionPeriod", ConstructorParameterDescription(self.subscriptionPeriod))]) } } case invoice(Cons_invoice) @@ -706,10 +706,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .invoice(let _data): - return ("invoice", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("prices", _data.prices as Any), ("maxTipAmount", _data.maxTipAmount as Any), ("suggestedTipAmounts", _data.suggestedTipAmounts as Any), ("termsUrl", _data.termsUrl as Any), ("subscriptionPeriod", _data.subscriptionPeriod as Any)]) + return ("invoice", [("flags", ConstructorParameterDescription(_data.flags)), ("currency", ConstructorParameterDescription(_data.currency)), ("prices", ConstructorParameterDescription(_data.prices)), ("maxTipAmount", ConstructorParameterDescription(_data.maxTipAmount)), ("suggestedTipAmounts", ConstructorParameterDescription(_data.suggestedTipAmounts)), ("termsUrl", ConstructorParameterDescription(_data.termsUrl)), ("subscriptionPeriod", ConstructorParameterDescription(_data.subscriptionPeriod))]) } } @@ -765,8 +765,8 @@ public extension Api { self.key = key self.value = value } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("jsonObjectValue", [("key", self.key as Any), ("value", self.value as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("jsonObjectValue", [("key", ConstructorParameterDescription(self.key)), ("value", ConstructorParameterDescription(self.value))]) } } case jsonObjectValue(Cons_jsonObjectValue) @@ -783,10 +783,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .jsonObjectValue(let _data): - return ("jsonObjectValue", [("key", _data.key as Any), ("value", _data.value as Any)]) + return ("jsonObjectValue", [("key", ConstructorParameterDescription(_data.key)), ("value", ConstructorParameterDescription(_data.value))]) } } @@ -815,8 +815,8 @@ public extension Api { public init(value: [Api.JSONValue]) { self.value = value } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("jsonArray", [("value", self.value as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("jsonArray", [("value", ConstructorParameterDescription(self.value))]) } } public class Cons_jsonBool: TypeConstructorDescription { @@ -824,8 +824,8 @@ public extension Api { public init(value: Api.Bool) { self.value = value } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("jsonBool", [("value", self.value as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("jsonBool", [("value", ConstructorParameterDescription(self.value))]) } } public class Cons_jsonNumber: TypeConstructorDescription { @@ -833,8 +833,8 @@ public extension Api { public init(value: Double) { self.value = value } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("jsonNumber", [("value", self.value as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("jsonNumber", [("value", ConstructorParameterDescription(self.value))]) } } public class Cons_jsonObject: TypeConstructorDescription { @@ -842,8 +842,8 @@ public extension Api { public init(value: [Api.JSONObjectValue]) { self.value = value } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("jsonObject", [("value", self.value as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("jsonObject", [("value", ConstructorParameterDescription(self.value))]) } } public class Cons_jsonString: TypeConstructorDescription { @@ -851,8 +851,8 @@ public extension Api { public init(value: String) { self.value = value } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("jsonString", [("value", self.value as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("jsonString", [("value", ConstructorParameterDescription(self.value))]) } } case jsonArray(Cons_jsonArray) @@ -910,20 +910,20 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .jsonArray(let _data): - return ("jsonArray", [("value", _data.value as Any)]) + return ("jsonArray", [("value", ConstructorParameterDescription(_data.value))]) case .jsonBool(let _data): - return ("jsonBool", [("value", _data.value as Any)]) + return ("jsonBool", [("value", ConstructorParameterDescription(_data.value))]) case .jsonNull: return ("jsonNull", []) case .jsonNumber(let _data): - return ("jsonNumber", [("value", _data.value as Any)]) + return ("jsonNumber", [("value", ConstructorParameterDescription(_data.value))]) case .jsonObject(let _data): - return ("jsonObject", [("value", _data.value as Any)]) + return ("jsonObject", [("value", ConstructorParameterDescription(_data.value))]) case .jsonString(let _data): - return ("jsonString", [("value", _data.value as Any)]) + return ("jsonString", [("value", ConstructorParameterDescription(_data.value))]) } } @@ -1010,8 +1010,8 @@ public extension Api { self.peerType = peerType self.maxQuantity = maxQuantity } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputKeyboardButtonRequestPeer", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("buttonId", self.buttonId as Any), ("peerType", self.peerType as Any), ("maxQuantity", self.maxQuantity as Any)]) + 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 { @@ -1029,8 +1029,8 @@ public extension Api { self.url = url self.bot = bot } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputKeyboardButtonUrlAuth", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("fwdText", self.fwdText as Any), ("url", self.url as Any), ("bot", self.bot as Any)]) + 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 { @@ -1044,8 +1044,8 @@ public extension Api { self.text = text self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputKeyboardButtonUserProfile", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("userId", self.userId as Any)]) + 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 { @@ -1057,8 +1057,8 @@ public extension Api { self.style = style self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButton", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any)]) + 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 { @@ -1070,8 +1070,8 @@ public extension Api { self.style = style self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonBuy", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any)]) + 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 { @@ -1085,8 +1085,8 @@ public extension Api { self.text = text self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonCallback", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("data", self.data as Any)]) + 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 { @@ -1100,8 +1100,8 @@ public extension Api { self.text = text self.copyText = copyText } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonCopy", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("copyText", self.copyText as Any)]) + 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 { @@ -1113,8 +1113,8 @@ public extension Api { self.style = style self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonGame", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any)]) + 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 { @@ -1126,8 +1126,8 @@ public extension Api { self.style = style self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonRequestGeoLocation", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any)]) + 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 { @@ -1145,8 +1145,8 @@ public extension Api { self.peerType = peerType self.maxQuantity = maxQuantity } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonRequestPeer", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("buttonId", self.buttonId as Any), ("peerType", self.peerType as Any), ("maxQuantity", self.maxQuantity as Any)]) + 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 { @@ -1158,8 +1158,8 @@ public extension Api { self.style = style self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonRequestPhone", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any)]) + 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 { @@ -1173,8 +1173,8 @@ public extension Api { self.quiz = quiz self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonRequestPoll", [("flags", self.flags as Any), ("style", self.style as Any), ("quiz", self.quiz as Any), ("text", self.text as Any)]) + 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 { @@ -1188,8 +1188,8 @@ public extension Api { self.text = text self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonSimpleWebView", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("url", self.url as Any)]) + 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 { @@ -1205,8 +1205,8 @@ public extension Api { self.query = query self.peerTypes = peerTypes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonSwitchInline", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("query", self.query as Any), ("peerTypes", self.peerTypes as Any)]) + 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 { @@ -1220,8 +1220,8 @@ public extension Api { self.text = text self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonUrl", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("url", self.url as Any)]) + 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 { @@ -1239,8 +1239,8 @@ public extension Api { self.url = url self.buttonId = buttonId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonUrlAuth", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("fwdText", self.fwdText as Any), ("url", self.url as Any), ("buttonId", self.buttonId as Any)]) + 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 { @@ -1254,8 +1254,8 @@ public extension Api { self.text = text self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonUserProfile", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("userId", self.userId as Any)]) + 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 { @@ -1269,8 +1269,8 @@ public extension Api { self.text = text self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonWebView", [("flags", self.flags as Any), ("style", self.style as Any), ("text", self.text as Any), ("url", self.url as Any)]) + 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) @@ -1511,44 +1511,44 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputKeyboardButtonRequestPeer(let _data): - return ("inputKeyboardButtonRequestPeer", [("flags", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("buttonId", _data.buttonId as Any), ("peerType", _data.peerType as Any), ("maxQuantity", _data.maxQuantity as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("fwdText", _data.fwdText as Any), ("url", _data.url as Any), ("bot", _data.bot as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("userId", _data.userId as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any)]) + return ("keyboardButton", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) case .keyboardButtonBuy(let _data): - return ("keyboardButtonBuy", [("flags", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any)]) + return ("keyboardButtonBuy", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) case .keyboardButtonCallback(let _data): - return ("keyboardButtonCallback", [("flags", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("data", _data.data as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("copyText", _data.copyText as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any)]) + return ("keyboardButtonGame", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) case .keyboardButtonRequestGeoLocation(let _data): - return ("keyboardButtonRequestGeoLocation", [("flags", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any)]) + return ("keyboardButtonRequestGeoLocation", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) case .keyboardButtonRequestPeer(let _data): - return ("keyboardButtonRequestPeer", [("flags", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("buttonId", _data.buttonId as Any), ("peerType", _data.peerType as Any), ("maxQuantity", _data.maxQuantity as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any)]) + return ("keyboardButtonRequestPhone", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text))]) case .keyboardButtonRequestPoll(let _data): - return ("keyboardButtonRequestPoll", [("flags", _data.flags as Any), ("style", _data.style as Any), ("quiz", _data.quiz as Any), ("text", _data.text as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("url", _data.url as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("query", _data.query as Any), ("peerTypes", _data.peerTypes as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("url", _data.url as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("fwdText", _data.fwdText as Any), ("url", _data.url as Any), ("buttonId", _data.buttonId as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("userId", _data.userId as Any)]) + 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", _data.flags as Any), ("style", _data.style as Any), ("text", _data.text as Any), ("url", _data.url as Any)]) + return ("keyboardButtonWebView", [("flags", ConstructorParameterDescription(_data.flags)), ("style", ConstructorParameterDescription(_data.style)), ("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) } } diff --git a/submodules/TelegramApi/Sources/Api15.swift b/submodules/TelegramApi/Sources/Api15.swift index 88516bfd09..2fb0d8d59e 100644 --- a/submodules/TelegramApi/Sources/Api15.swift +++ b/submodules/TelegramApi/Sources/Api15.swift @@ -5,8 +5,8 @@ public extension Api { public init(buttons: [Api.KeyboardButton]) { self.buttons = buttons } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonRow", [("buttons", self.buttons as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonRow", [("buttons", ConstructorParameterDescription(self.buttons))]) } } case keyboardButtonRow(Cons_keyboardButtonRow) @@ -26,10 +26,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .keyboardButtonRow(let _data): - return ("keyboardButtonRow", [("buttons", _data.buttons as Any)]) + return ("keyboardButtonRow", [("buttons", ConstructorParameterDescription(_data.buttons))]) } } @@ -57,8 +57,8 @@ public extension Api { self.flags = flags self.icon = icon } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("keyboardButtonStyle", [("flags", self.flags as Any), ("icon", self.icon as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("keyboardButtonStyle", [("flags", ConstructorParameterDescription(self.flags)), ("icon", ConstructorParameterDescription(self.icon))]) } } case keyboardButtonStyle(Cons_keyboardButtonStyle) @@ -77,10 +77,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .keyboardButtonStyle(let _data): - return ("keyboardButtonStyle", [("flags", _data.flags as Any), ("icon", _data.icon as Any)]) + return ("keyboardButtonStyle", [("flags", ConstructorParameterDescription(_data.flags)), ("icon", ConstructorParameterDescription(_data.icon))]) } } @@ -111,8 +111,8 @@ public extension Api { self.label = label self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("labeledPrice", [("label", self.label as Any), ("amount", self.amount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("labeledPrice", [("label", ConstructorParameterDescription(self.label)), ("amount", ConstructorParameterDescription(self.amount))]) } } case labeledPrice(Cons_labeledPrice) @@ -129,10 +129,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .labeledPrice(let _data): - return ("labeledPrice", [("label", _data.label as Any), ("amount", _data.amount as Any)]) + return ("labeledPrice", [("label", ConstructorParameterDescription(_data.label)), ("amount", ConstructorParameterDescription(_data.amount))]) } } @@ -165,8 +165,8 @@ public extension Api { self.version = version self.strings = strings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("langPackDifference", [("langCode", self.langCode as Any), ("fromVersion", self.fromVersion as Any), ("version", self.version as Any), ("strings", self.strings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("langPackDifference", [("langCode", ConstructorParameterDescription(self.langCode)), ("fromVersion", ConstructorParameterDescription(self.fromVersion)), ("version", ConstructorParameterDescription(self.version)), ("strings", ConstructorParameterDescription(self.strings))]) } } case langPackDifference(Cons_langPackDifference) @@ -189,10 +189,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .langPackDifference(let _data): - return ("langPackDifference", [("langCode", _data.langCode as Any), ("fromVersion", _data.fromVersion as Any), ("version", _data.version as Any), ("strings", _data.strings as Any)]) + return ("langPackDifference", [("langCode", ConstructorParameterDescription(_data.langCode)), ("fromVersion", ConstructorParameterDescription(_data.fromVersion)), ("version", ConstructorParameterDescription(_data.version)), ("strings", ConstructorParameterDescription(_data.strings))]) } } @@ -243,8 +243,8 @@ public extension Api { self.translatedCount = translatedCount self.translationsUrl = translationsUrl } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("langPackLanguage", [("flags", self.flags as Any), ("name", self.name as Any), ("nativeName", self.nativeName as Any), ("langCode", self.langCode as Any), ("baseLangCode", self.baseLangCode as Any), ("pluralCode", self.pluralCode as Any), ("stringsCount", self.stringsCount as Any), ("translatedCount", self.translatedCount as Any), ("translationsUrl", self.translationsUrl as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("langPackLanguage", [("flags", ConstructorParameterDescription(self.flags)), ("name", ConstructorParameterDescription(self.name)), ("nativeName", ConstructorParameterDescription(self.nativeName)), ("langCode", ConstructorParameterDescription(self.langCode)), ("baseLangCode", ConstructorParameterDescription(self.baseLangCode)), ("pluralCode", ConstructorParameterDescription(self.pluralCode)), ("stringsCount", ConstructorParameterDescription(self.stringsCount)), ("translatedCount", ConstructorParameterDescription(self.translatedCount)), ("translationsUrl", ConstructorParameterDescription(self.translationsUrl))]) } } case langPackLanguage(Cons_langPackLanguage) @@ -270,10 +270,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .langPackLanguage(let _data): - return ("langPackLanguage", [("flags", _data.flags as Any), ("name", _data.name as Any), ("nativeName", _data.nativeName as Any), ("langCode", _data.langCode as Any), ("baseLangCode", _data.baseLangCode as Any), ("pluralCode", _data.pluralCode as Any), ("stringsCount", _data.stringsCount as Any), ("translatedCount", _data.translatedCount as Any), ("translationsUrl", _data.translationsUrl as Any)]) + return ("langPackLanguage", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("nativeName", ConstructorParameterDescription(_data.nativeName)), ("langCode", ConstructorParameterDescription(_data.langCode)), ("baseLangCode", ConstructorParameterDescription(_data.baseLangCode)), ("pluralCode", ConstructorParameterDescription(_data.pluralCode)), ("stringsCount", ConstructorParameterDescription(_data.stringsCount)), ("translatedCount", ConstructorParameterDescription(_data.translatedCount)), ("translationsUrl", ConstructorParameterDescription(_data.translationsUrl))]) } } @@ -325,8 +325,8 @@ public extension Api { self.key = key self.value = value } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("langPackString", [("key", self.key as Any), ("value", self.value as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("langPackString", [("key", ConstructorParameterDescription(self.key)), ("value", ConstructorParameterDescription(self.value))]) } } public class Cons_langPackStringDeleted: TypeConstructorDescription { @@ -334,8 +334,8 @@ public extension Api { public init(key: String) { self.key = key } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("langPackStringDeleted", [("key", self.key as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("langPackStringDeleted", [("key", ConstructorParameterDescription(self.key))]) } } public class Cons_langPackStringPluralized: TypeConstructorDescription { @@ -357,8 +357,8 @@ public extension Api { self.manyValue = manyValue self.otherValue = otherValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("langPackStringPluralized", [("flags", self.flags as Any), ("key", self.key as Any), ("zeroValue", self.zeroValue as Any), ("oneValue", self.oneValue as Any), ("twoValue", self.twoValue as Any), ("fewValue", self.fewValue as Any), ("manyValue", self.manyValue as Any), ("otherValue", self.otherValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("langPackStringPluralized", [("flags", ConstructorParameterDescription(self.flags)), ("key", ConstructorParameterDescription(self.key)), ("zeroValue", ConstructorParameterDescription(self.zeroValue)), ("oneValue", ConstructorParameterDescription(self.oneValue)), ("twoValue", ConstructorParameterDescription(self.twoValue)), ("fewValue", ConstructorParameterDescription(self.fewValue)), ("manyValue", ConstructorParameterDescription(self.manyValue)), ("otherValue", ConstructorParameterDescription(self.otherValue))]) } } case langPackString(Cons_langPackString) @@ -406,14 +406,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .langPackString(let _data): - return ("langPackString", [("key", _data.key as Any), ("value", _data.value as Any)]) + return ("langPackString", [("key", ConstructorParameterDescription(_data.key)), ("value", ConstructorParameterDescription(_data.value))]) case .langPackStringDeleted(let _data): - return ("langPackStringDeleted", [("key", _data.key as Any)]) + return ("langPackStringDeleted", [("key", ConstructorParameterDescription(_data.key))]) case .langPackStringPluralized(let _data): - return ("langPackStringPluralized", [("flags", _data.flags as Any), ("key", _data.key as Any), ("zeroValue", _data.zeroValue as Any), ("oneValue", _data.oneValue as Any), ("twoValue", _data.twoValue as Any), ("fewValue", _data.fewValue as Any), ("manyValue", _data.manyValue as Any), ("otherValue", _data.otherValue as Any)]) + return ("langPackStringPluralized", [("flags", ConstructorParameterDescription(_data.flags)), ("key", ConstructorParameterDescription(_data.key)), ("zeroValue", ConstructorParameterDescription(_data.zeroValue)), ("oneValue", ConstructorParameterDescription(_data.oneValue)), ("twoValue", ConstructorParameterDescription(_data.twoValue)), ("fewValue", ConstructorParameterDescription(_data.fewValue)), ("manyValue", ConstructorParameterDescription(_data.manyValue)), ("otherValue", ConstructorParameterDescription(_data.otherValue))]) } } @@ -499,8 +499,8 @@ public extension Api { self.y = y self.zoom = zoom } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("maskCoords", [("n", self.n as Any), ("x", self.x as Any), ("y", self.y as Any), ("zoom", self.zoom as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("maskCoords", [("n", ConstructorParameterDescription(self.n)), ("x", ConstructorParameterDescription(self.x)), ("y", ConstructorParameterDescription(self.y)), ("zoom", ConstructorParameterDescription(self.zoom))]) } } case maskCoords(Cons_maskCoords) @@ -519,10 +519,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .maskCoords(let _data): - return ("maskCoords", [("n", _data.n as Any), ("x", _data.x as Any), ("y", _data.y as Any), ("zoom", _data.zoom as Any)]) + return ("maskCoords", [("n", ConstructorParameterDescription(_data.n)), ("x", ConstructorParameterDescription(_data.x)), ("y", ConstructorParameterDescription(_data.y)), ("zoom", ConstructorParameterDescription(_data.zoom))]) } } @@ -559,8 +559,8 @@ public extension Api { self.channel = channel self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaAreaChannelPost", [("coordinates", self.coordinates as Any), ("channel", self.channel as Any), ("msgId", self.msgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaAreaChannelPost", [("coordinates", ConstructorParameterDescription(self.coordinates)), ("channel", ConstructorParameterDescription(self.channel)), ("msgId", ConstructorParameterDescription(self.msgId))]) } } public class Cons_inputMediaAreaVenue: TypeConstructorDescription { @@ -572,8 +572,8 @@ public extension Api { self.queryId = queryId self.resultId = resultId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMediaAreaVenue", [("coordinates", self.coordinates as Any), ("queryId", self.queryId as Any), ("resultId", self.resultId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMediaAreaVenue", [("coordinates", ConstructorParameterDescription(self.coordinates)), ("queryId", ConstructorParameterDescription(self.queryId)), ("resultId", ConstructorParameterDescription(self.resultId))]) } } public class Cons_mediaAreaChannelPost: TypeConstructorDescription { @@ -585,8 +585,8 @@ public extension Api { self.channelId = channelId self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaChannelPost", [("coordinates", self.coordinates as Any), ("channelId", self.channelId as Any), ("msgId", self.msgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("mediaAreaChannelPost", [("coordinates", ConstructorParameterDescription(self.coordinates)), ("channelId", ConstructorParameterDescription(self.channelId)), ("msgId", ConstructorParameterDescription(self.msgId))]) } } public class Cons_mediaAreaGeoPoint: TypeConstructorDescription { @@ -600,8 +600,8 @@ public extension Api { self.geo = geo self.address = address } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaGeoPoint", [("flags", self.flags as Any), ("coordinates", self.coordinates as Any), ("geo", self.geo as Any), ("address", self.address as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("mediaAreaGeoPoint", [("flags", ConstructorParameterDescription(self.flags)), ("coordinates", ConstructorParameterDescription(self.coordinates)), ("geo", ConstructorParameterDescription(self.geo)), ("address", ConstructorParameterDescription(self.address))]) } } public class Cons_mediaAreaStarGift: TypeConstructorDescription { @@ -611,8 +611,8 @@ public extension Api { self.coordinates = coordinates self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaStarGift", [("coordinates", self.coordinates as Any), ("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("mediaAreaStarGift", [("coordinates", ConstructorParameterDescription(self.coordinates)), ("slug", ConstructorParameterDescription(self.slug))]) } } public class Cons_mediaAreaSuggestedReaction: TypeConstructorDescription { @@ -624,8 +624,8 @@ public extension Api { self.coordinates = coordinates self.reaction = reaction } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaSuggestedReaction", [("flags", self.flags as Any), ("coordinates", self.coordinates as Any), ("reaction", self.reaction as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("mediaAreaSuggestedReaction", [("flags", ConstructorParameterDescription(self.flags)), ("coordinates", ConstructorParameterDescription(self.coordinates)), ("reaction", ConstructorParameterDescription(self.reaction))]) } } public class Cons_mediaAreaUrl: TypeConstructorDescription { @@ -635,8 +635,8 @@ public extension Api { self.coordinates = coordinates self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaUrl", [("coordinates", self.coordinates as Any), ("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("mediaAreaUrl", [("coordinates", ConstructorParameterDescription(self.coordinates)), ("url", ConstructorParameterDescription(self.url))]) } } public class Cons_mediaAreaVenue: TypeConstructorDescription { @@ -656,8 +656,8 @@ public extension Api { self.venueId = venueId self.venueType = venueType } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaVenue", [("coordinates", self.coordinates as Any), ("geo", self.geo as Any), ("title", self.title as Any), ("address", self.address as Any), ("provider", self.provider as Any), ("venueId", self.venueId as Any), ("venueType", self.venueType as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("mediaAreaVenue", [("coordinates", ConstructorParameterDescription(self.coordinates)), ("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_mediaAreaWeather: TypeConstructorDescription { @@ -671,8 +671,8 @@ public extension Api { self.temperatureC = temperatureC self.color = color } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaWeather", [("coordinates", self.coordinates as Any), ("emoji", self.emoji as Any), ("temperatureC", self.temperatureC as Any), ("color", self.color as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("mediaAreaWeather", [("coordinates", ConstructorParameterDescription(self.coordinates)), ("emoji", ConstructorParameterDescription(self.emoji)), ("temperatureC", ConstructorParameterDescription(self.temperatureC)), ("color", ConstructorParameterDescription(self.color))]) } } case inputMediaAreaChannelPost(Cons_inputMediaAreaChannelPost) @@ -768,26 +768,26 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputMediaAreaChannelPost(let _data): - return ("inputMediaAreaChannelPost", [("coordinates", _data.coordinates as Any), ("channel", _data.channel as Any), ("msgId", _data.msgId as Any)]) + return ("inputMediaAreaChannelPost", [("coordinates", ConstructorParameterDescription(_data.coordinates)), ("channel", ConstructorParameterDescription(_data.channel)), ("msgId", ConstructorParameterDescription(_data.msgId))]) case .inputMediaAreaVenue(let _data): - return ("inputMediaAreaVenue", [("coordinates", _data.coordinates as Any), ("queryId", _data.queryId as Any), ("resultId", _data.resultId as Any)]) + return ("inputMediaAreaVenue", [("coordinates", ConstructorParameterDescription(_data.coordinates)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("resultId", ConstructorParameterDescription(_data.resultId))]) case .mediaAreaChannelPost(let _data): - return ("mediaAreaChannelPost", [("coordinates", _data.coordinates as Any), ("channelId", _data.channelId as Any), ("msgId", _data.msgId as Any)]) + return ("mediaAreaChannelPost", [("coordinates", ConstructorParameterDescription(_data.coordinates)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("msgId", ConstructorParameterDescription(_data.msgId))]) case .mediaAreaGeoPoint(let _data): - return ("mediaAreaGeoPoint", [("flags", _data.flags as Any), ("coordinates", _data.coordinates as Any), ("geo", _data.geo as Any), ("address", _data.address as Any)]) + return ("mediaAreaGeoPoint", [("flags", ConstructorParameterDescription(_data.flags)), ("coordinates", ConstructorParameterDescription(_data.coordinates)), ("geo", ConstructorParameterDescription(_data.geo)), ("address", ConstructorParameterDescription(_data.address))]) case .mediaAreaStarGift(let _data): - return ("mediaAreaStarGift", [("coordinates", _data.coordinates as Any), ("slug", _data.slug as Any)]) + return ("mediaAreaStarGift", [("coordinates", ConstructorParameterDescription(_data.coordinates)), ("slug", ConstructorParameterDescription(_data.slug))]) case .mediaAreaSuggestedReaction(let _data): - return ("mediaAreaSuggestedReaction", [("flags", _data.flags as Any), ("coordinates", _data.coordinates as Any), ("reaction", _data.reaction as Any)]) + return ("mediaAreaSuggestedReaction", [("flags", ConstructorParameterDescription(_data.flags)), ("coordinates", ConstructorParameterDescription(_data.coordinates)), ("reaction", ConstructorParameterDescription(_data.reaction))]) case .mediaAreaUrl(let _data): - return ("mediaAreaUrl", [("coordinates", _data.coordinates as Any), ("url", _data.url as Any)]) + return ("mediaAreaUrl", [("coordinates", ConstructorParameterDescription(_data.coordinates)), ("url", ConstructorParameterDescription(_data.url))]) case .mediaAreaVenue(let _data): - return ("mediaAreaVenue", [("coordinates", _data.coordinates as Any), ("geo", _data.geo as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any)]) + return ("mediaAreaVenue", [("coordinates", ConstructorParameterDescription(_data.coordinates)), ("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 .mediaAreaWeather(let _data): - return ("mediaAreaWeather", [("coordinates", _data.coordinates as Any), ("emoji", _data.emoji as Any), ("temperatureC", _data.temperatureC as Any), ("color", _data.color as Any)]) + return ("mediaAreaWeather", [("coordinates", ConstructorParameterDescription(_data.coordinates)), ("emoji", ConstructorParameterDescription(_data.emoji)), ("temperatureC", ConstructorParameterDescription(_data.temperatureC)), ("color", ConstructorParameterDescription(_data.color))]) } } @@ -1007,8 +1007,8 @@ public extension Api { self.rotation = rotation self.radius = radius } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("mediaAreaCoordinates", [("flags", self.flags as Any), ("x", self.x as Any), ("y", self.y as Any), ("w", self.w as Any), ("h", self.h as Any), ("rotation", self.rotation as Any), ("radius", self.radius as Any)]) + 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) @@ -1032,10 +1032,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .mediaAreaCoordinates(let _data): - return ("mediaAreaCoordinates", [("flags", _data.flags as Any), ("x", _data.x as Any), ("y", _data.y as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("rotation", _data.rotation as Any), ("radius", _data.radius as Any)]) + 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))]) } } @@ -1145,8 +1145,8 @@ public extension Api { self.scheduleRepeatPeriod = scheduleRepeatPeriod self.summaryFromLanguage = summaryFromLanguage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("message", [("flags", self.flags as Any), ("flags2", self.flags2 as Any), ("id", self.id as Any), ("fromId", self.fromId as Any), ("fromBoostsApplied", self.fromBoostsApplied as Any), ("fromRank", self.fromRank as Any), ("peerId", self.peerId as Any), ("savedPeerId", self.savedPeerId as Any), ("fwdFrom", self.fwdFrom as Any), ("viaBotId", self.viaBotId as Any), ("viaBusinessBotId", self.viaBusinessBotId as Any), ("replyTo", self.replyTo as Any), ("date", self.date as Any), ("message", self.message as Any), ("media", self.media as Any), ("replyMarkup", self.replyMarkup as Any), ("entities", self.entities as Any), ("views", self.views as Any), ("forwards", self.forwards as Any), ("replies", self.replies as Any), ("editDate", self.editDate as Any), ("postAuthor", self.postAuthor as Any), ("groupedId", self.groupedId as Any), ("reactions", self.reactions as Any), ("restrictionReason", self.restrictionReason as Any), ("ttlPeriod", self.ttlPeriod as Any), ("quickReplyShortcutId", self.quickReplyShortcutId as Any), ("effect", self.effect as Any), ("factcheck", self.factcheck as Any), ("reportDeliveryUntilDate", self.reportDeliveryUntilDate as Any), ("paidMessageStars", self.paidMessageStars as Any), ("suggestedPost", self.suggestedPost as Any), ("scheduleRepeatPeriod", self.scheduleRepeatPeriod as Any), ("summaryFromLanguage", self.summaryFromLanguage as Any)]) + 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)), ("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 { @@ -1158,8 +1158,8 @@ public extension Api { self.id = id self.peerId = peerId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEmpty", [("flags", self.flags as Any), ("id", self.id as Any), ("peerId", self.peerId as Any)]) + 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 { @@ -1185,8 +1185,8 @@ public extension Api { self.reactions = reactions self.ttlPeriod = ttlPeriod } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageService", [("flags", self.flags as Any), ("id", self.id as Any), ("fromId", self.fromId as Any), ("peerId", self.peerId as Any), ("savedPeerId", self.savedPeerId as Any), ("replyTo", self.replyTo as Any), ("date", self.date as Any), ("action", self.action as Any), ("reactions", self.reactions as Any), ("ttlPeriod", self.ttlPeriod as Any)]) + 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) @@ -1336,14 +1336,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .message(let _data): - return ("message", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("fromBoostsApplied", _data.fromBoostsApplied as Any), ("fromRank", _data.fromRank as Any), ("peerId", _data.peerId as Any), ("savedPeerId", _data.savedPeerId as Any), ("fwdFrom", _data.fwdFrom as Any), ("viaBotId", _data.viaBotId as Any), ("viaBusinessBotId", _data.viaBusinessBotId as Any), ("replyTo", _data.replyTo as Any), ("date", _data.date as Any), ("message", _data.message as Any), ("media", _data.media as Any), ("replyMarkup", _data.replyMarkup as Any), ("entities", _data.entities as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("replies", _data.replies as Any), ("editDate", _data.editDate as Any), ("postAuthor", _data.postAuthor as Any), ("groupedId", _data.groupedId as Any), ("reactions", _data.reactions as Any), ("restrictionReason", _data.restrictionReason as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("quickReplyShortcutId", _data.quickReplyShortcutId as Any), ("effect", _data.effect as Any), ("factcheck", _data.factcheck as Any), ("reportDeliveryUntilDate", _data.reportDeliveryUntilDate as Any), ("paidMessageStars", _data.paidMessageStars as Any), ("suggestedPost", _data.suggestedPost as Any), ("scheduleRepeatPeriod", _data.scheduleRepeatPeriod as Any), ("summaryFromLanguage", _data.summaryFromLanguage as Any)]) + 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)), ("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", _data.flags as Any), ("id", _data.id as Any), ("peerId", _data.peerId as Any)]) + return ("messageEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("peerId", ConstructorParameterDescription(_data.peerId))]) case .messageService(let _data): - return ("messageService", [("flags", _data.flags as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("peerId", _data.peerId as Any), ("savedPeerId", _data.savedPeerId as Any), ("replyTo", _data.replyTo as Any), ("date", _data.date as Any), ("action", _data.action as Any), ("reactions", _data.reactions as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + 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))]) } } @@ -1629,8 +1629,8 @@ public extension Api { public init(boosts: Int32) { self.boosts = boosts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionBoostApply", [("boosts", self.boosts as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionBoostApply", [("boosts", ConstructorParameterDescription(self.boosts))]) } } public class Cons_messageActionBotAllowed: TypeConstructorDescription { @@ -1642,8 +1642,8 @@ public extension Api { self.domain = domain self.app = app } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionBotAllowed", [("flags", self.flags as Any), ("domain", self.domain as Any), ("app", self.app as Any)]) + 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 { @@ -1651,8 +1651,8 @@ public extension Api { public init(newCreatorId: Int64) { self.newCreatorId = newCreatorId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChangeCreator", [("newCreatorId", self.newCreatorId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChangeCreator", [("newCreatorId", ConstructorParameterDescription(self.newCreatorId))]) } } public class Cons_messageActionChannelCreate: TypeConstructorDescription { @@ -1660,8 +1660,8 @@ public extension Api { public init(title: String) { self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChannelCreate", [("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChannelCreate", [("title", ConstructorParameterDescription(self.title))]) } } public class Cons_messageActionChannelMigrateFrom: TypeConstructorDescription { @@ -1671,8 +1671,8 @@ public extension Api { self.title = title self.chatId = chatId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChannelMigrateFrom", [("title", self.title as Any), ("chatId", self.chatId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChannelMigrateFrom", [("title", ConstructorParameterDescription(self.title)), ("chatId", ConstructorParameterDescription(self.chatId))]) } } public class Cons_messageActionChatAddUser: TypeConstructorDescription { @@ -1680,8 +1680,8 @@ public extension Api { public init(users: [Int64]) { self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChatAddUser", [("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatAddUser", [("users", ConstructorParameterDescription(self.users))]) } } public class Cons_messageActionChatCreate: TypeConstructorDescription { @@ -1691,8 +1691,8 @@ public extension Api { self.title = title self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChatCreate", [("title", self.title as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatCreate", [("title", ConstructorParameterDescription(self.title)), ("users", ConstructorParameterDescription(self.users))]) } } public class Cons_messageActionChatDeleteUser: TypeConstructorDescription { @@ -1700,8 +1700,8 @@ public extension Api { public init(userId: Int64) { self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChatDeleteUser", [("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatDeleteUser", [("userId", ConstructorParameterDescription(self.userId))]) } } public class Cons_messageActionChatEditPhoto: TypeConstructorDescription { @@ -1709,8 +1709,8 @@ public extension Api { public init(photo: Api.Photo) { self.photo = photo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChatEditPhoto", [("photo", self.photo as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatEditPhoto", [("photo", ConstructorParameterDescription(self.photo))]) } } public class Cons_messageActionChatEditTitle: TypeConstructorDescription { @@ -1718,8 +1718,8 @@ public extension Api { public init(title: String) { self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChatEditTitle", [("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatEditTitle", [("title", ConstructorParameterDescription(self.title))]) } } public class Cons_messageActionChatJoinedByLink: TypeConstructorDescription { @@ -1727,8 +1727,8 @@ public extension Api { public init(inviterId: Int64) { self.inviterId = inviterId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChatJoinedByLink", [("inviterId", self.inviterId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatJoinedByLink", [("inviterId", ConstructorParameterDescription(self.inviterId))]) } } public class Cons_messageActionChatMigrateTo: TypeConstructorDescription { @@ -1736,8 +1736,8 @@ public extension Api { public init(channelId: Int64) { self.channelId = channelId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionChatMigrateTo", [("channelId", self.channelId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionChatMigrateTo", [("channelId", ConstructorParameterDescription(self.channelId))]) } } public class Cons_messageActionConferenceCall: TypeConstructorDescription { @@ -1751,8 +1751,8 @@ public extension Api { self.duration = duration self.otherParticipants = otherParticipants } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionConferenceCall", [("flags", self.flags as Any), ("callId", self.callId as Any), ("duration", self.duration as Any), ("otherParticipants", self.otherParticipants as Any)]) + 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 { @@ -1760,8 +1760,8 @@ public extension Api { public init(message: String) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionCustomAction", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionCustomAction", [("message", ConstructorParameterDescription(self.message))]) } } public class Cons_messageActionGameScore: TypeConstructorDescription { @@ -1771,8 +1771,8 @@ public extension Api { self.gameId = gameId self.score = score } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGameScore", [("gameId", self.gameId as Any), ("score", self.score as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGameScore", [("gameId", ConstructorParameterDescription(self.gameId)), ("score", ConstructorParameterDescription(self.score))]) } } public class Cons_messageActionGeoProximityReached: TypeConstructorDescription { @@ -1784,8 +1784,8 @@ public extension Api { self.toId = toId self.distance = distance } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGeoProximityReached", [("fromId", self.fromId as Any), ("toId", self.toId as Any), ("distance", self.distance as Any)]) + 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 { @@ -1809,8 +1809,8 @@ public extension Api { self.cryptoAmount = cryptoAmount self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGiftCode", [("flags", self.flags as Any), ("boostPeer", self.boostPeer as Any), ("days", self.days as Any), ("slug", self.slug as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("cryptoCurrency", self.cryptoCurrency as Any), ("cryptoAmount", self.cryptoAmount as Any), ("message", self.message as Any)]) + 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 { @@ -1830,8 +1830,8 @@ public extension Api { self.cryptoAmount = cryptoAmount self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGiftPremium", [("flags", self.flags as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("days", self.days as Any), ("cryptoCurrency", self.cryptoCurrency as Any), ("cryptoAmount", self.cryptoAmount as Any), ("message", self.message as Any)]) + 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 { @@ -1851,8 +1851,8 @@ public extension Api { self.cryptoAmount = cryptoAmount self.transactionId = transactionId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGiftStars", [("flags", self.flags as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("stars", self.stars as Any), ("cryptoCurrency", self.cryptoCurrency as Any), ("cryptoAmount", self.cryptoAmount as Any), ("transactionId", self.transactionId as Any)]) + 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 { @@ -1870,8 +1870,8 @@ public extension Api { self.cryptoAmount = cryptoAmount self.transactionId = transactionId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGiftTon", [("flags", self.flags as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("cryptoCurrency", self.cryptoCurrency as Any), ("cryptoAmount", self.cryptoAmount as Any), ("transactionId", self.transactionId as Any)]) + 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 { @@ -1881,8 +1881,8 @@ public extension Api { self.flags = flags self.stars = stars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGiveawayLaunch", [("flags", self.flags as Any), ("stars", self.stars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGiveawayLaunch", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars))]) } } public class Cons_messageActionGiveawayResults: TypeConstructorDescription { @@ -1894,8 +1894,8 @@ public extension Api { self.winnersCount = winnersCount self.unclaimedCount = unclaimedCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGiveawayResults", [("flags", self.flags as Any), ("winnersCount", self.winnersCount as Any), ("unclaimedCount", self.unclaimedCount as Any)]) + 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 { @@ -1907,8 +1907,8 @@ public extension Api { self.call = call self.duration = duration } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGroupCall", [("flags", self.flags as Any), ("call", self.call as Any), ("duration", self.duration as Any)]) + 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 { @@ -1918,8 +1918,8 @@ public extension Api { self.call = call self.scheduleDate = scheduleDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionGroupCallScheduled", [("call", self.call as Any), ("scheduleDate", self.scheduleDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionGroupCallScheduled", [("call", ConstructorParameterDescription(self.call)), ("scheduleDate", ConstructorParameterDescription(self.scheduleDate))]) } } public class Cons_messageActionInviteToGroupCall: TypeConstructorDescription { @@ -1929,8 +1929,8 @@ public extension Api { self.call = call self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionInviteToGroupCall", [("call", self.call as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionInviteToGroupCall", [("call", ConstructorParameterDescription(self.call)), ("users", ConstructorParameterDescription(self.users))]) } } public class Cons_messageActionManagedBotCreated: TypeConstructorDescription { @@ -1938,8 +1938,8 @@ public extension Api { public init(botId: Int64) { self.botId = botId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionManagedBotCreated", [("botId", self.botId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionManagedBotCreated", [("botId", ConstructorParameterDescription(self.botId))]) } } public class Cons_messageActionNewCreatorPending: TypeConstructorDescription { @@ -1947,8 +1947,8 @@ public extension Api { public init(newCreatorId: Int64) { self.newCreatorId = newCreatorId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionNewCreatorPending", [("newCreatorId", self.newCreatorId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionNewCreatorPending", [("newCreatorId", ConstructorParameterDescription(self.newCreatorId))]) } } public class Cons_messageActionNoForwardsRequest: TypeConstructorDescription { @@ -1960,8 +1960,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionNoForwardsRequest", [("flags", self.flags as Any), ("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + 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 { @@ -1971,8 +1971,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionNoForwardsToggle", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionNoForwardsToggle", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_messageActionPaidMessagesPrice: TypeConstructorDescription { @@ -1982,8 +1982,8 @@ public extension Api { self.flags = flags self.stars = stars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPaidMessagesPrice", [("flags", self.flags as Any), ("stars", self.stars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPaidMessagesPrice", [("flags", ConstructorParameterDescription(self.flags)), ("stars", ConstructorParameterDescription(self.stars))]) } } public class Cons_messageActionPaidMessagesRefunded: TypeConstructorDescription { @@ -1993,8 +1993,8 @@ public extension Api { self.count = count self.stars = stars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPaidMessagesRefunded", [("count", self.count as Any), ("stars", self.stars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPaidMessagesRefunded", [("count", ConstructorParameterDescription(self.count)), ("stars", ConstructorParameterDescription(self.stars))]) } } public class Cons_messageActionPaymentRefunded: TypeConstructorDescription { @@ -2012,8 +2012,8 @@ public extension Api { self.payload = payload self.charge = charge } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPaymentRefunded", [("flags", self.flags as Any), ("peer", self.peer as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any), ("payload", self.payload as Any), ("charge", self.charge as Any)]) + 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 { @@ -2029,8 +2029,8 @@ public extension Api { self.invoiceSlug = invoiceSlug self.subscriptionUntilDate = subscriptionUntilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPaymentSent", [("flags", self.flags as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any), ("invoiceSlug", self.invoiceSlug as Any), ("subscriptionUntilDate", self.subscriptionUntilDate as Any)]) + 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 { @@ -2052,8 +2052,8 @@ public extension Api { self.charge = charge self.subscriptionUntilDate = subscriptionUntilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPaymentSentMe", [("flags", self.flags as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any), ("payload", self.payload as Any), ("info", self.info as Any), ("shippingOptionId", self.shippingOptionId as Any), ("charge", self.charge as Any), ("subscriptionUntilDate", self.subscriptionUntilDate as Any)]) + 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 { @@ -2067,8 +2067,8 @@ public extension Api { self.reason = reason self.duration = duration } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPhoneCall", [("flags", self.flags as Any), ("callId", self.callId as Any), ("reason", self.reason as Any), ("duration", self.duration as Any)]) + 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 { @@ -2076,8 +2076,8 @@ public extension Api { public init(answer: Api.PollAnswer) { self.answer = answer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPollAppendAnswer", [("answer", self.answer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPollAppendAnswer", [("answer", ConstructorParameterDescription(self.answer))]) } } public class Cons_messageActionPollDeleteAnswer: TypeConstructorDescription { @@ -2085,8 +2085,8 @@ public extension Api { public init(answer: Api.PollAnswer) { self.answer = answer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPollDeleteAnswer", [("answer", self.answer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionPollDeleteAnswer", [("answer", ConstructorParameterDescription(self.answer))]) } } public class Cons_messageActionPrizeStars: TypeConstructorDescription { @@ -2102,8 +2102,8 @@ public extension Api { self.boostPeer = boostPeer self.giveawayMsgId = giveawayMsgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionPrizeStars", [("flags", self.flags as Any), ("stars", self.stars as Any), ("transactionId", self.transactionId as Any), ("boostPeer", self.boostPeer as Any), ("giveawayMsgId", self.giveawayMsgId as Any)]) + 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 { @@ -2113,8 +2113,8 @@ public extension Api { self.buttonId = buttonId self.peers = peers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionRequestedPeer", [("buttonId", self.buttonId as Any), ("peers", self.peers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionRequestedPeer", [("buttonId", ConstructorParameterDescription(self.buttonId)), ("peers", ConstructorParameterDescription(self.peers))]) } } public class Cons_messageActionRequestedPeerSentMe: TypeConstructorDescription { @@ -2124,8 +2124,8 @@ public extension Api { self.buttonId = buttonId self.peers = peers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionRequestedPeerSentMe", [("buttonId", self.buttonId as Any), ("peers", self.peers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionRequestedPeerSentMe", [("buttonId", ConstructorParameterDescription(self.buttonId)), ("peers", ConstructorParameterDescription(self.peers))]) } } public class Cons_messageActionSecureValuesSent: TypeConstructorDescription { @@ -2133,8 +2133,8 @@ public extension Api { public init(types: [Api.SecureValueType]) { self.types = types } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSecureValuesSent", [("types", self.types as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSecureValuesSent", [("types", ConstructorParameterDescription(self.types))]) } } public class Cons_messageActionSecureValuesSentMe: TypeConstructorDescription { @@ -2144,8 +2144,8 @@ public extension Api { self.values = values self.credentials = credentials } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSecureValuesSentMe", [("values", self.values as Any), ("credentials", self.credentials as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSecureValuesSentMe", [("values", ConstructorParameterDescription(self.values)), ("credentials", ConstructorParameterDescription(self.credentials))]) } } public class Cons_messageActionSetChatTheme: TypeConstructorDescription { @@ -2153,8 +2153,8 @@ public extension Api { public init(theme: Api.ChatTheme) { self.theme = theme } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSetChatTheme", [("theme", self.theme as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSetChatTheme", [("theme", ConstructorParameterDescription(self.theme))]) } } public class Cons_messageActionSetChatWallPaper: TypeConstructorDescription { @@ -2164,8 +2164,8 @@ public extension Api { self.flags = flags self.wallpaper = wallpaper } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSetChatWallPaper", [("flags", self.flags as Any), ("wallpaper", self.wallpaper as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSetChatWallPaper", [("flags", ConstructorParameterDescription(self.flags)), ("wallpaper", ConstructorParameterDescription(self.wallpaper))]) } } public class Cons_messageActionSetMessagesTTL: TypeConstructorDescription { @@ -2177,8 +2177,8 @@ public extension Api { self.period = period self.autoSettingFrom = autoSettingFrom } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSetMessagesTTL", [("flags", self.flags as Any), ("period", self.period as Any), ("autoSettingFrom", self.autoSettingFrom as Any)]) + 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 { @@ -2210,8 +2210,8 @@ public extension Api { self.toId = toId self.giftNum = giftNum } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionStarGift", [("flags", self.flags as Any), ("gift", self.gift as Any), ("message", self.message as Any), ("convertStars", self.convertStars as Any), ("upgradeMsgId", self.upgradeMsgId as Any), ("upgradeStars", self.upgradeStars as Any), ("fromId", self.fromId as Any), ("peer", self.peer as Any), ("savedId", self.savedId as Any), ("prepaidUpgradeHash", self.prepaidUpgradeHash as Any), ("giftMsgId", self.giftMsgId as Any), ("toId", self.toId as Any), ("giftNum", self.giftNum as Any)]) + 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 { @@ -2225,8 +2225,8 @@ public extension Api { self.price = price self.expiresAt = expiresAt } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionStarGiftPurchaseOffer", [("flags", self.flags as Any), ("gift", self.gift as Any), ("price", self.price as Any), ("expiresAt", self.expiresAt as Any)]) + 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 { @@ -2238,8 +2238,8 @@ public extension Api { self.gift = gift self.price = price } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", self.flags as Any), ("gift", self.gift as Any), ("price", self.price as Any)]) + 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 { @@ -2269,8 +2269,8 @@ public extension Api { self.dropOriginalDetailsStars = dropOriginalDetailsStars self.canCraftAt = canCraftAt } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionStarGiftUnique", [("flags", self.flags as Any), ("gift", self.gift as Any), ("canExportAt", self.canExportAt as Any), ("transferStars", self.transferStars as Any), ("fromId", self.fromId as Any), ("peer", self.peer as Any), ("savedId", self.savedId as Any), ("resaleAmount", self.resaleAmount as Any), ("canTransferAt", self.canTransferAt as Any), ("canResellAt", self.canResellAt as Any), ("dropOriginalDetailsStars", self.dropOriginalDetailsStars as Any), ("canCraftAt", self.canCraftAt as Any)]) + 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 { @@ -2278,8 +2278,8 @@ public extension Api { public init(birthday: Api.Birthday) { self.birthday = birthday } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSuggestBirthday", [("birthday", self.birthday as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestBirthday", [("birthday", ConstructorParameterDescription(self.birthday))]) } } public class Cons_messageActionSuggestProfilePhoto: TypeConstructorDescription { @@ -2287,8 +2287,8 @@ public extension Api { public init(photo: Api.Photo) { self.photo = photo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSuggestProfilePhoto", [("photo", self.photo as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestProfilePhoto", [("photo", ConstructorParameterDescription(self.photo))]) } } public class Cons_messageActionSuggestedPostApproval: TypeConstructorDescription { @@ -2302,8 +2302,8 @@ public extension Api { self.scheduleDate = scheduleDate self.price = price } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSuggestedPostApproval", [("flags", self.flags as Any), ("rejectComment", self.rejectComment as Any), ("scheduleDate", self.scheduleDate as Any), ("price", self.price as Any)]) + 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 { @@ -2311,8 +2311,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSuggestedPostRefund", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestedPostRefund", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_messageActionSuggestedPostSuccess: TypeConstructorDescription { @@ -2320,8 +2320,8 @@ public extension Api { public init(price: Api.StarsAmount) { self.price = price } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionSuggestedPostSuccess", [("price", self.price as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionSuggestedPostSuccess", [("price", ConstructorParameterDescription(self.price))]) } } public class Cons_messageActionTodoAppendTasks: TypeConstructorDescription { @@ -2329,8 +2329,8 @@ public extension Api { public init(list: [Api.TodoItem]) { self.list = list } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionTodoAppendTasks", [("list", self.list as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionTodoAppendTasks", [("list", ConstructorParameterDescription(self.list))]) } } public class Cons_messageActionTodoCompletions: TypeConstructorDescription { @@ -2340,8 +2340,8 @@ public extension Api { self.completed = completed self.incompleted = incompleted } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionTodoCompletions", [("completed", self.completed as Any), ("incompleted", self.incompleted as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionTodoCompletions", [("completed", ConstructorParameterDescription(self.completed)), ("incompleted", ConstructorParameterDescription(self.incompleted))]) } } public class Cons_messageActionTopicCreate: TypeConstructorDescription { @@ -2355,8 +2355,8 @@ public extension Api { self.iconColor = iconColor self.iconEmojiId = iconEmojiId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionTopicCreate", [("flags", self.flags as Any), ("title", self.title as Any), ("iconColor", self.iconColor as Any), ("iconEmojiId", self.iconEmojiId as Any)]) + 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 { @@ -2372,8 +2372,8 @@ public extension Api { self.closed = closed self.hidden = hidden } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionTopicEdit", [("flags", self.flags as Any), ("title", self.title as Any), ("iconEmojiId", self.iconEmojiId as Any), ("closed", self.closed as Any), ("hidden", self.hidden as Any)]) + 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 { @@ -2381,8 +2381,8 @@ public extension Api { public init(text: String) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionWebViewDataSent", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionWebViewDataSent", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_messageActionWebViewDataSentMe: TypeConstructorDescription { @@ -2392,8 +2392,8 @@ public extension Api { self.text = text self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageActionWebViewDataSentMe", [("text", self.text as Any), ("data", self.data as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageActionWebViewDataSentMe", [("text", ConstructorParameterDescription(self.text)), ("data", ConstructorParameterDescription(self.data))]) } } case messageActionBoostApply(Cons_messageActionBoostApply) @@ -3138,142 +3138,142 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageActionBoostApply(let _data): - return ("messageActionBoostApply", [("boosts", _data.boosts as Any)]) + return ("messageActionBoostApply", [("boosts", ConstructorParameterDescription(_data.boosts))]) case .messageActionBotAllowed(let _data): - return ("messageActionBotAllowed", [("flags", _data.flags as Any), ("domain", _data.domain as Any), ("app", _data.app as Any)]) + return ("messageActionBotAllowed", [("flags", ConstructorParameterDescription(_data.flags)), ("domain", ConstructorParameterDescription(_data.domain)), ("app", ConstructorParameterDescription(_data.app))]) case .messageActionChangeCreator(let _data): - return ("messageActionChangeCreator", [("newCreatorId", _data.newCreatorId as Any)]) + return ("messageActionChangeCreator", [("newCreatorId", ConstructorParameterDescription(_data.newCreatorId))]) case .messageActionChannelCreate(let _data): - return ("messageActionChannelCreate", [("title", _data.title as Any)]) + return ("messageActionChannelCreate", [("title", ConstructorParameterDescription(_data.title))]) case .messageActionChannelMigrateFrom(let _data): - return ("messageActionChannelMigrateFrom", [("title", _data.title as Any), ("chatId", _data.chatId as Any)]) + return ("messageActionChannelMigrateFrom", [("title", ConstructorParameterDescription(_data.title)), ("chatId", ConstructorParameterDescription(_data.chatId))]) case .messageActionChatAddUser(let _data): - return ("messageActionChatAddUser", [("users", _data.users as Any)]) + return ("messageActionChatAddUser", [("users", ConstructorParameterDescription(_data.users))]) case .messageActionChatCreate(let _data): - return ("messageActionChatCreate", [("title", _data.title as Any), ("users", _data.users as Any)]) + return ("messageActionChatCreate", [("title", ConstructorParameterDescription(_data.title)), ("users", ConstructorParameterDescription(_data.users))]) case .messageActionChatDeletePhoto: return ("messageActionChatDeletePhoto", []) case .messageActionChatDeleteUser(let _data): - return ("messageActionChatDeleteUser", [("userId", _data.userId as Any)]) + return ("messageActionChatDeleteUser", [("userId", ConstructorParameterDescription(_data.userId))]) case .messageActionChatEditPhoto(let _data): - return ("messageActionChatEditPhoto", [("photo", _data.photo as Any)]) + return ("messageActionChatEditPhoto", [("photo", ConstructorParameterDescription(_data.photo))]) case .messageActionChatEditTitle(let _data): - return ("messageActionChatEditTitle", [("title", _data.title as Any)]) + return ("messageActionChatEditTitle", [("title", ConstructorParameterDescription(_data.title))]) case .messageActionChatJoinedByLink(let _data): - return ("messageActionChatJoinedByLink", [("inviterId", _data.inviterId as Any)]) + return ("messageActionChatJoinedByLink", [("inviterId", ConstructorParameterDescription(_data.inviterId))]) case .messageActionChatJoinedByRequest: return ("messageActionChatJoinedByRequest", []) case .messageActionChatMigrateTo(let _data): - return ("messageActionChatMigrateTo", [("channelId", _data.channelId as Any)]) + return ("messageActionChatMigrateTo", [("channelId", ConstructorParameterDescription(_data.channelId))]) case .messageActionConferenceCall(let _data): - return ("messageActionConferenceCall", [("flags", _data.flags as Any), ("callId", _data.callId as Any), ("duration", _data.duration as Any), ("otherParticipants", _data.otherParticipants as Any)]) + 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", _data.message as Any)]) + return ("messageActionCustomAction", [("message", ConstructorParameterDescription(_data.message))]) case .messageActionEmpty: return ("messageActionEmpty", []) case .messageActionGameScore(let _data): - return ("messageActionGameScore", [("gameId", _data.gameId as Any), ("score", _data.score as Any)]) + return ("messageActionGameScore", [("gameId", ConstructorParameterDescription(_data.gameId)), ("score", ConstructorParameterDescription(_data.score))]) case .messageActionGeoProximityReached(let _data): - return ("messageActionGeoProximityReached", [("fromId", _data.fromId as Any), ("toId", _data.toId as Any), ("distance", _data.distance as Any)]) + return ("messageActionGeoProximityReached", [("fromId", ConstructorParameterDescription(_data.fromId)), ("toId", ConstructorParameterDescription(_data.toId)), ("distance", ConstructorParameterDescription(_data.distance))]) case .messageActionGiftCode(let _data): - return ("messageActionGiftCode", [("flags", _data.flags as Any), ("boostPeer", _data.boostPeer as Any), ("days", _data.days as Any), ("slug", _data.slug as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("message", _data.message as Any)]) + 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", _data.flags as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("days", _data.days as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("message", _data.message as Any)]) + 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", _data.flags as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("stars", _data.stars as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("transactionId", _data.transactionId as Any)]) + 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", _data.flags as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("transactionId", _data.transactionId as Any)]) + 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", _data.flags as Any), ("stars", _data.stars as Any)]) + return ("messageActionGiveawayLaunch", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars))]) case .messageActionGiveawayResults(let _data): - return ("messageActionGiveawayResults", [("flags", _data.flags as Any), ("winnersCount", _data.winnersCount as Any), ("unclaimedCount", _data.unclaimedCount as Any)]) + return ("messageActionGiveawayResults", [("flags", ConstructorParameterDescription(_data.flags)), ("winnersCount", ConstructorParameterDescription(_data.winnersCount)), ("unclaimedCount", ConstructorParameterDescription(_data.unclaimedCount))]) case .messageActionGroupCall(let _data): - return ("messageActionGroupCall", [("flags", _data.flags as Any), ("call", _data.call as Any), ("duration", _data.duration as Any)]) + return ("messageActionGroupCall", [("flags", ConstructorParameterDescription(_data.flags)), ("call", ConstructorParameterDescription(_data.call)), ("duration", ConstructorParameterDescription(_data.duration))]) case .messageActionGroupCallScheduled(let _data): - return ("messageActionGroupCallScheduled", [("call", _data.call as Any), ("scheduleDate", _data.scheduleDate as Any)]) + return ("messageActionGroupCallScheduled", [("call", ConstructorParameterDescription(_data.call)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate))]) case .messageActionHistoryClear: return ("messageActionHistoryClear", []) case .messageActionInviteToGroupCall(let _data): - return ("messageActionInviteToGroupCall", [("call", _data.call as Any), ("users", _data.users as Any)]) + return ("messageActionInviteToGroupCall", [("call", ConstructorParameterDescription(_data.call)), ("users", ConstructorParameterDescription(_data.users))]) case .messageActionManagedBotCreated(let _data): - return ("messageActionManagedBotCreated", [("botId", _data.botId as Any)]) + return ("messageActionManagedBotCreated", [("botId", ConstructorParameterDescription(_data.botId))]) case .messageActionNewCreatorPending(let _data): - return ("messageActionNewCreatorPending", [("newCreatorId", _data.newCreatorId as Any)]) + return ("messageActionNewCreatorPending", [("newCreatorId", ConstructorParameterDescription(_data.newCreatorId))]) case .messageActionNoForwardsRequest(let _data): - return ("messageActionNoForwardsRequest", [("flags", _data.flags as Any), ("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("messageActionNoForwardsRequest", [("flags", ConstructorParameterDescription(_data.flags)), ("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .messageActionNoForwardsToggle(let _data): - return ("messageActionNoForwardsToggle", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("messageActionNoForwardsToggle", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .messageActionPaidMessagesPrice(let _data): - return ("messageActionPaidMessagesPrice", [("flags", _data.flags as Any), ("stars", _data.stars as Any)]) + return ("messageActionPaidMessagesPrice", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars))]) case .messageActionPaidMessagesRefunded(let _data): - return ("messageActionPaidMessagesRefunded", [("count", _data.count as Any), ("stars", _data.stars as Any)]) + return ("messageActionPaidMessagesRefunded", [("count", ConstructorParameterDescription(_data.count)), ("stars", ConstructorParameterDescription(_data.stars))]) case .messageActionPaymentRefunded(let _data): - return ("messageActionPaymentRefunded", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("payload", _data.payload as Any), ("charge", _data.charge as Any)]) + 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", _data.flags as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("invoiceSlug", _data.invoiceSlug as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any)]) + 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", _data.flags as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("payload", _data.payload as Any), ("info", _data.info as Any), ("shippingOptionId", _data.shippingOptionId as Any), ("charge", _data.charge as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any)]) + 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", _data.flags as Any), ("callId", _data.callId as Any), ("reason", _data.reason as Any), ("duration", _data.duration as Any)]) + 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", _data.answer as Any)]) + return ("messageActionPollAppendAnswer", [("answer", ConstructorParameterDescription(_data.answer))]) case .messageActionPollDeleteAnswer(let _data): - return ("messageActionPollDeleteAnswer", [("answer", _data.answer as Any)]) + return ("messageActionPollDeleteAnswer", [("answer", ConstructorParameterDescription(_data.answer))]) case .messageActionPrizeStars(let _data): - return ("messageActionPrizeStars", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("transactionId", _data.transactionId as Any), ("boostPeer", _data.boostPeer as Any), ("giveawayMsgId", _data.giveawayMsgId as Any)]) + 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", _data.buttonId as Any), ("peers", _data.peers as Any)]) + return ("messageActionRequestedPeer", [("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peers", ConstructorParameterDescription(_data.peers))]) case .messageActionRequestedPeerSentMe(let _data): - return ("messageActionRequestedPeerSentMe", [("buttonId", _data.buttonId as Any), ("peers", _data.peers as Any)]) + return ("messageActionRequestedPeerSentMe", [("buttonId", ConstructorParameterDescription(_data.buttonId)), ("peers", ConstructorParameterDescription(_data.peers))]) case .messageActionScreenshotTaken: return ("messageActionScreenshotTaken", []) case .messageActionSecureValuesSent(let _data): - return ("messageActionSecureValuesSent", [("types", _data.types as Any)]) + return ("messageActionSecureValuesSent", [("types", ConstructorParameterDescription(_data.types))]) case .messageActionSecureValuesSentMe(let _data): - return ("messageActionSecureValuesSentMe", [("values", _data.values as Any), ("credentials", _data.credentials as Any)]) + return ("messageActionSecureValuesSentMe", [("values", ConstructorParameterDescription(_data.values)), ("credentials", ConstructorParameterDescription(_data.credentials))]) case .messageActionSetChatTheme(let _data): - return ("messageActionSetChatTheme", [("theme", _data.theme as Any)]) + return ("messageActionSetChatTheme", [("theme", ConstructorParameterDescription(_data.theme))]) case .messageActionSetChatWallPaper(let _data): - return ("messageActionSetChatWallPaper", [("flags", _data.flags as Any), ("wallpaper", _data.wallpaper as Any)]) + return ("messageActionSetChatWallPaper", [("flags", ConstructorParameterDescription(_data.flags)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) case .messageActionSetMessagesTTL(let _data): - return ("messageActionSetMessagesTTL", [("flags", _data.flags as Any), ("period", _data.period as Any), ("autoSettingFrom", _data.autoSettingFrom as Any)]) + return ("messageActionSetMessagesTTL", [("flags", ConstructorParameterDescription(_data.flags)), ("period", ConstructorParameterDescription(_data.period)), ("autoSettingFrom", ConstructorParameterDescription(_data.autoSettingFrom))]) case .messageActionStarGift(let _data): - return ("messageActionStarGift", [("flags", _data.flags as Any), ("gift", _data.gift as Any), ("message", _data.message as Any), ("convertStars", _data.convertStars as Any), ("upgradeMsgId", _data.upgradeMsgId as Any), ("upgradeStars", _data.upgradeStars as Any), ("fromId", _data.fromId as Any), ("peer", _data.peer as Any), ("savedId", _data.savedId as Any), ("prepaidUpgradeHash", _data.prepaidUpgradeHash as Any), ("giftMsgId", _data.giftMsgId as Any), ("toId", _data.toId as Any), ("giftNum", _data.giftNum as Any)]) + 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", _data.flags as Any), ("gift", _data.gift as Any), ("price", _data.price as Any), ("expiresAt", _data.expiresAt as Any)]) + 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", _data.flags as Any), ("gift", _data.gift as Any), ("price", _data.price as Any)]) + return ("messageActionStarGiftPurchaseOfferDeclined", [("flags", ConstructorParameterDescription(_data.flags)), ("gift", ConstructorParameterDescription(_data.gift)), ("price", ConstructorParameterDescription(_data.price))]) case .messageActionStarGiftUnique(let _data): - return ("messageActionStarGiftUnique", [("flags", _data.flags as Any), ("gift", _data.gift as Any), ("canExportAt", _data.canExportAt as Any), ("transferStars", _data.transferStars as Any), ("fromId", _data.fromId as Any), ("peer", _data.peer as Any), ("savedId", _data.savedId as Any), ("resaleAmount", _data.resaleAmount as Any), ("canTransferAt", _data.canTransferAt as Any), ("canResellAt", _data.canResellAt as Any), ("dropOriginalDetailsStars", _data.dropOriginalDetailsStars as Any), ("canCraftAt", _data.canCraftAt as Any)]) + 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", _data.birthday as Any)]) + return ("messageActionSuggestBirthday", [("birthday", ConstructorParameterDescription(_data.birthday))]) case .messageActionSuggestProfilePhoto(let _data): - return ("messageActionSuggestProfilePhoto", [("photo", _data.photo as Any)]) + return ("messageActionSuggestProfilePhoto", [("photo", ConstructorParameterDescription(_data.photo))]) case .messageActionSuggestedPostApproval(let _data): - return ("messageActionSuggestedPostApproval", [("flags", _data.flags as Any), ("rejectComment", _data.rejectComment as Any), ("scheduleDate", _data.scheduleDate as Any), ("price", _data.price as Any)]) + 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", _data.flags as Any)]) + return ("messageActionSuggestedPostRefund", [("flags", ConstructorParameterDescription(_data.flags))]) case .messageActionSuggestedPostSuccess(let _data): - return ("messageActionSuggestedPostSuccess", [("price", _data.price as Any)]) + return ("messageActionSuggestedPostSuccess", [("price", ConstructorParameterDescription(_data.price))]) case .messageActionTodoAppendTasks(let _data): - return ("messageActionTodoAppendTasks", [("list", _data.list as Any)]) + return ("messageActionTodoAppendTasks", [("list", ConstructorParameterDescription(_data.list))]) case .messageActionTodoCompletions(let _data): - return ("messageActionTodoCompletions", [("completed", _data.completed as Any), ("incompleted", _data.incompleted as Any)]) + return ("messageActionTodoCompletions", [("completed", ConstructorParameterDescription(_data.completed)), ("incompleted", ConstructorParameterDescription(_data.incompleted))]) case .messageActionTopicCreate(let _data): - return ("messageActionTopicCreate", [("flags", _data.flags as Any), ("title", _data.title as Any), ("iconColor", _data.iconColor as Any), ("iconEmojiId", _data.iconEmojiId as Any)]) + 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", _data.flags as Any), ("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("closed", _data.closed as Any), ("hidden", _data.hidden as Any)]) + 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", _data.text as Any)]) + return ("messageActionWebViewDataSent", [("text", ConstructorParameterDescription(_data.text))]) case .messageActionWebViewDataSentMe(let _data): - return ("messageActionWebViewDataSentMe", [("text", _data.text as Any), ("data", _data.data as Any)]) + return ("messageActionWebViewDataSentMe", [("text", ConstructorParameterDescription(_data.text)), ("data", ConstructorParameterDescription(_data.data))]) } } diff --git a/submodules/TelegramApi/Sources/Api16.swift b/submodules/TelegramApi/Sources/Api16.swift index 636e3bde9f..c774f8f008 100644 --- a/submodules/TelegramApi/Sources/Api16.swift +++ b/submodules/TelegramApi/Sources/Api16.swift @@ -9,8 +9,8 @@ public extension Api { self.length = length self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMessageEntityMentionName", [("offset", self.offset as Any), ("length", self.length as Any), ("userId", self.userId as Any)]) + 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 { @@ -20,8 +20,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityBankCard", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityBankCard", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityBlockquote: TypeConstructorDescription { @@ -33,8 +33,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityBlockquote", [("flags", self.flags as Any), ("offset", self.offset as Any), ("length", self.length as Any)]) + 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 { @@ -44,8 +44,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityBold", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityBold", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityBotCommand: TypeConstructorDescription { @@ -55,8 +55,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityBotCommand", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityBotCommand", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityCashtag: TypeConstructorDescription { @@ -66,8 +66,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityCashtag", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityCashtag", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityCode: TypeConstructorDescription { @@ -77,8 +77,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityCode", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityCode", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityCustomEmoji: TypeConstructorDescription { @@ -90,8 +90,8 @@ public extension Api { self.length = length self.documentId = documentId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityCustomEmoji", [("offset", self.offset as Any), ("length", self.length as Any), ("documentId", self.documentId as Any)]) + 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 { @@ -101,8 +101,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityDiffDelete", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityDiffDelete", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityDiffInsert: TypeConstructorDescription { @@ -112,8 +112,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityDiffInsert", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityDiffInsert", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityDiffReplace: TypeConstructorDescription { @@ -125,8 +125,8 @@ public extension Api { self.length = length self.oldText = oldText } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityDiffReplace", [("offset", self.offset as Any), ("length", self.length as Any), ("oldText", self.oldText as Any)]) + 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 { @@ -136,8 +136,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityEmail", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityEmail", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityFormattedDate: TypeConstructorDescription { @@ -151,8 +151,8 @@ public extension Api { self.length = length self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityFormattedDate", [("flags", self.flags as Any), ("offset", self.offset as Any), ("length", self.length as Any), ("date", self.date as Any)]) + 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 { @@ -162,8 +162,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityHashtag", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityHashtag", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityItalic: TypeConstructorDescription { @@ -173,8 +173,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityItalic", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityItalic", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityMention: TypeConstructorDescription { @@ -184,8 +184,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityMention", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityMention", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityMentionName: TypeConstructorDescription { @@ -197,8 +197,8 @@ public extension Api { self.length = length self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityMentionName", [("offset", self.offset as Any), ("length", self.length as Any), ("userId", self.userId as Any)]) + 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 { @@ -208,8 +208,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityPhone", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityPhone", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityPre: TypeConstructorDescription { @@ -221,8 +221,8 @@ public extension Api { self.length = length self.language = language } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityPre", [("offset", self.offset as Any), ("length", self.length as Any), ("language", self.language as Any)]) + 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 { @@ -232,8 +232,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntitySpoiler", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntitySpoiler", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityStrike: TypeConstructorDescription { @@ -243,8 +243,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityStrike", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityStrike", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityTextUrl: TypeConstructorDescription { @@ -256,8 +256,8 @@ public extension Api { self.length = length self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityTextUrl", [("offset", self.offset as Any), ("length", self.length as Any), ("url", self.url as Any)]) + 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 { @@ -267,8 +267,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityUnderline", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityUnderline", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityUnknown: TypeConstructorDescription { @@ -278,8 +278,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityUnknown", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityUnknown", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_messageEntityUrl: TypeConstructorDescription { @@ -289,8 +289,8 @@ public extension Api { self.offset = offset self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEntityUrl", [("offset", self.offset as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEntityUrl", [("offset", ConstructorParameterDescription(self.offset)), ("length", ConstructorParameterDescription(self.length))]) } } case inputMessageEntityMentionName(Cons_inputMessageEntityMentionName) @@ -508,58 +508,58 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputMessageEntityMentionName(let _data): - return ("inputMessageEntityMentionName", [("offset", _data.offset as Any), ("length", _data.length as Any), ("userId", _data.userId as Any)]) + return ("inputMessageEntityMentionName", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("userId", ConstructorParameterDescription(_data.userId))]) case .messageEntityBankCard(let _data): - return ("messageEntityBankCard", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityBankCard", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityBlockquote(let _data): - return ("messageEntityBlockquote", [("flags", _data.flags as Any), ("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityBlockquote", [("flags", ConstructorParameterDescription(_data.flags)), ("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityBold(let _data): - return ("messageEntityBold", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityBold", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityBotCommand(let _data): - return ("messageEntityBotCommand", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityBotCommand", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityCashtag(let _data): - return ("messageEntityCashtag", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityCashtag", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityCode(let _data): - return ("messageEntityCode", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityCode", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityCustomEmoji(let _data): - return ("messageEntityCustomEmoji", [("offset", _data.offset as Any), ("length", _data.length as Any), ("documentId", _data.documentId as Any)]) + return ("messageEntityCustomEmoji", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("documentId", ConstructorParameterDescription(_data.documentId))]) case .messageEntityDiffDelete(let _data): - return ("messageEntityDiffDelete", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityDiffDelete", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityDiffInsert(let _data): - return ("messageEntityDiffInsert", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityDiffInsert", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityDiffReplace(let _data): - return ("messageEntityDiffReplace", [("offset", _data.offset as Any), ("length", _data.length as Any), ("oldText", _data.oldText as Any)]) + return ("messageEntityDiffReplace", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("oldText", ConstructorParameterDescription(_data.oldText))]) case .messageEntityEmail(let _data): - return ("messageEntityEmail", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityEmail", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityFormattedDate(let _data): - return ("messageEntityFormattedDate", [("flags", _data.flags as Any), ("offset", _data.offset as Any), ("length", _data.length as Any), ("date", _data.date as Any)]) + 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", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityHashtag", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityItalic(let _data): - return ("messageEntityItalic", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityItalic", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityMention(let _data): - return ("messageEntityMention", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityMention", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityMentionName(let _data): - return ("messageEntityMentionName", [("offset", _data.offset as Any), ("length", _data.length as Any), ("userId", _data.userId as Any)]) + return ("messageEntityMentionName", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("userId", ConstructorParameterDescription(_data.userId))]) case .messageEntityPhone(let _data): - return ("messageEntityPhone", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityPhone", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityPre(let _data): - return ("messageEntityPre", [("offset", _data.offset as Any), ("length", _data.length as Any), ("language", _data.language as Any)]) + return ("messageEntityPre", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("language", ConstructorParameterDescription(_data.language))]) case .messageEntitySpoiler(let _data): - return ("messageEntitySpoiler", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntitySpoiler", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityStrike(let _data): - return ("messageEntityStrike", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityStrike", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityTextUrl(let _data): - return ("messageEntityTextUrl", [("offset", _data.offset as Any), ("length", _data.length as Any), ("url", _data.url as Any)]) + return ("messageEntityTextUrl", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length)), ("url", ConstructorParameterDescription(_data.url))]) case .messageEntityUnderline(let _data): - return ("messageEntityUnderline", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityUnderline", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityUnknown(let _data): - return ("messageEntityUnknown", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityUnknown", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) case .messageEntityUrl(let _data): - return ("messageEntityUrl", [("offset", _data.offset as Any), ("length", _data.length as Any)]) + return ("messageEntityUrl", [("offset", ConstructorParameterDescription(_data.offset)), ("length", ConstructorParameterDescription(_data.length))]) } } @@ -951,8 +951,8 @@ public extension Api { public init(media: Api.MessageMedia) { self.media = media } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageExtendedMedia", [("media", self.media as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageExtendedMedia", [("media", ConstructorParameterDescription(self.media))]) } } public class Cons_messageExtendedMediaPreview: TypeConstructorDescription { @@ -968,8 +968,8 @@ public extension Api { self.thumb = thumb self.videoDuration = videoDuration } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageExtendedMediaPreview", [("flags", self.flags as Any), ("w", self.w as Any), ("h", self.h as Any), ("thumb", self.thumb as Any), ("videoDuration", self.videoDuration as Any)]) + 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) @@ -1004,12 +1004,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageExtendedMedia(let _data): - return ("messageExtendedMedia", [("media", _data.media as Any)]) + return ("messageExtendedMedia", [("media", ConstructorParameterDescription(_data.media))]) case .messageExtendedMediaPreview(let _data): - return ("messageExtendedMediaPreview", [("flags", _data.flags as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("thumb", _data.thumb as Any), ("videoDuration", _data.videoDuration as Any)]) + return ("messageExtendedMediaPreview", [("flags", ConstructorParameterDescription(_data.flags)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("thumb", ConstructorParameterDescription(_data.thumb)), ("videoDuration", ConstructorParameterDescription(_data.videoDuration))]) } } @@ -1090,8 +1090,8 @@ public extension Api { self.savedDate = savedDate self.psaType = psaType } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageFwdHeader", [("flags", self.flags as Any), ("fromId", self.fromId as Any), ("fromName", self.fromName as Any), ("date", self.date as Any), ("channelPost", self.channelPost as Any), ("postAuthor", self.postAuthor as Any), ("savedFromPeer", self.savedFromPeer as Any), ("savedFromMsgId", self.savedFromMsgId as Any), ("savedFromId", self.savedFromId as Any), ("savedFromName", self.savedFromName as Any), ("savedDate", self.savedDate as Any), ("psaType", self.psaType as Any)]) + 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) @@ -1138,10 +1138,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageFwdHeader(let _data): - return ("messageFwdHeader", [("flags", _data.flags as Any), ("fromId", _data.fromId as Any), ("fromName", _data.fromName as Any), ("date", _data.date as Any), ("channelPost", _data.channelPost as Any), ("postAuthor", _data.postAuthor as Any), ("savedFromPeer", _data.savedFromPeer as Any), ("savedFromMsgId", _data.savedFromMsgId as Any), ("savedFromId", _data.savedFromId as Any), ("savedFromName", _data.savedFromName as Any), ("savedDate", _data.savedDate as Any), ("psaType", _data.psaType as Any)]) + 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))]) } } @@ -1232,8 +1232,8 @@ public extension Api { self.vcard = vcard self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaContact", [("phoneNumber", self.phoneNumber as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("vcard", self.vcard as Any), ("userId", self.userId as Any)]) + 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 { @@ -1247,8 +1247,8 @@ public extension Api { self.emoticon = emoticon self.gameOutcome = gameOutcome } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaDice", [("flags", self.flags as Any), ("value", self.value as Any), ("emoticon", self.emoticon as Any), ("gameOutcome", self.gameOutcome as Any)]) + 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 { @@ -1266,8 +1266,8 @@ public extension Api { self.videoTimestamp = videoTimestamp self.ttlSeconds = ttlSeconds } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaDocument", [("flags", self.flags as Any), ("document", self.document as Any), ("altDocuments", self.altDocuments as Any), ("videoCover", self.videoCover as Any), ("videoTimestamp", self.videoTimestamp as Any), ("ttlSeconds", self.ttlSeconds as Any)]) + 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 { @@ -1275,8 +1275,8 @@ public extension Api { public init(game: Api.Game) { self.game = game } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaGame", [("game", self.game as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaGame", [("game", ConstructorParameterDescription(self.game))]) } } public class Cons_messageMediaGeo: TypeConstructorDescription { @@ -1284,8 +1284,8 @@ public extension Api { public init(geo: Api.GeoPoint) { self.geo = geo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaGeo", [("geo", self.geo as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaGeo", [("geo", ConstructorParameterDescription(self.geo))]) } } public class Cons_messageMediaGeoLive: TypeConstructorDescription { @@ -1301,8 +1301,8 @@ public extension Api { self.period = period self.proximityNotificationRadius = proximityNotificationRadius } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaGeoLive", [("flags", self.flags as Any), ("geo", self.geo as Any), ("heading", self.heading as Any), ("period", self.period as Any), ("proximityNotificationRadius", self.proximityNotificationRadius as Any)]) + 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 { @@ -1324,8 +1324,8 @@ public extension Api { self.stars = stars self.untilDate = untilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaGiveaway", [("flags", self.flags as Any), ("channels", self.channels as Any), ("countriesIso2", self.countriesIso2 as Any), ("prizeDescription", self.prizeDescription as Any), ("quantity", self.quantity as Any), ("months", self.months as Any), ("stars", self.stars as Any), ("untilDate", self.untilDate as Any)]) + 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 { @@ -1353,8 +1353,8 @@ public extension Api { self.prizeDescription = prizeDescription self.untilDate = untilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaGiveawayResults", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("additionalPeersCount", self.additionalPeersCount as Any), ("launchMsgId", self.launchMsgId as Any), ("winnersCount", self.winnersCount as Any), ("unclaimedCount", self.unclaimedCount as Any), ("winners", self.winners as Any), ("months", self.months as Any), ("stars", self.stars as Any), ("prizeDescription", self.prizeDescription as Any), ("untilDate", self.untilDate as Any)]) + 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 { @@ -1378,8 +1378,8 @@ public extension Api { self.startParam = startParam self.extendedMedia = extendedMedia } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaInvoice", [("flags", self.flags as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("receiptMsgId", self.receiptMsgId as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any), ("startParam", self.startParam as Any), ("extendedMedia", self.extendedMedia as Any)]) + 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 { @@ -1389,8 +1389,8 @@ public extension Api { self.starsAmount = starsAmount self.extendedMedia = extendedMedia } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaPaidMedia", [("starsAmount", self.starsAmount as Any), ("extendedMedia", self.extendedMedia as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaPaidMedia", [("starsAmount", ConstructorParameterDescription(self.starsAmount)), ("extendedMedia", ConstructorParameterDescription(self.extendedMedia))]) } } public class Cons_messageMediaPhoto: TypeConstructorDescription { @@ -1404,8 +1404,8 @@ public extension Api { self.ttlSeconds = ttlSeconds self.video = video } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaPhoto", [("flags", self.flags as Any), ("photo", self.photo as Any), ("ttlSeconds", self.ttlSeconds as Any), ("video", self.video as Any)]) + 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 { @@ -1419,8 +1419,8 @@ public extension Api { self.results = results self.attachedMedia = attachedMedia } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaPoll", [("flags", self.flags as Any), ("poll", self.poll as Any), ("results", self.results as Any), ("attachedMedia", self.attachedMedia as Any)]) + 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 { @@ -1434,8 +1434,8 @@ public extension Api { self.id = id self.story = story } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaStory", [("flags", self.flags as Any), ("peer", self.peer as Any), ("id", self.id as Any), ("story", self.story as Any)]) + 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 { @@ -1447,8 +1447,8 @@ public extension Api { self.todo = todo self.completions = completions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaToDo", [("flags", self.flags as Any), ("todo", self.todo as Any), ("completions", self.completions as Any)]) + 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 { @@ -1466,8 +1466,8 @@ public extension Api { self.venueId = venueId self.venueType = venueType } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaVenue", [("geo", self.geo as Any), ("title", self.title as Any), ("address", self.address as Any), ("provider", self.provider as Any), ("venueId", self.venueId as Any), ("venueType", self.venueType as Any)]) + 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 { @@ -1477,8 +1477,8 @@ public extension Api { self.flags = flags self.call = call } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaVideoStream", [("flags", self.flags as Any), ("call", self.call as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaVideoStream", [("flags", ConstructorParameterDescription(self.flags)), ("call", ConstructorParameterDescription(self.call))]) } } public class Cons_messageMediaWebPage: TypeConstructorDescription { @@ -1488,8 +1488,8 @@ public extension Api { self.flags = flags self.webpage = webpage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageMediaWebPage", [("flags", self.flags as Any), ("webpage", self.webpage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageMediaWebPage", [("flags", ConstructorParameterDescription(self.flags)), ("webpage", ConstructorParameterDescription(self.webpage))]) } } case messageMediaContact(Cons_messageMediaContact) @@ -1763,46 +1763,46 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageMediaContact(let _data): - return ("messageMediaContact", [("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any), ("userId", _data.userId as Any)]) + 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", _data.flags as Any), ("value", _data.value as Any), ("emoticon", _data.emoticon as Any), ("gameOutcome", _data.gameOutcome as Any)]) + 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", _data.flags as Any), ("document", _data.document as Any), ("altDocuments", _data.altDocuments as Any), ("videoCover", _data.videoCover as Any), ("videoTimestamp", _data.videoTimestamp as Any), ("ttlSeconds", _data.ttlSeconds as Any)]) + 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", _data.game as Any)]) + return ("messageMediaGame", [("game", ConstructorParameterDescription(_data.game))]) case .messageMediaGeo(let _data): - return ("messageMediaGeo", [("geo", _data.geo as Any)]) + return ("messageMediaGeo", [("geo", ConstructorParameterDescription(_data.geo))]) case .messageMediaGeoLive(let _data): - return ("messageMediaGeoLive", [("flags", _data.flags as Any), ("geo", _data.geo as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any)]) + 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", _data.flags as Any), ("channels", _data.channels as Any), ("countriesIso2", _data.countriesIso2 as Any), ("prizeDescription", _data.prizeDescription as Any), ("quantity", _data.quantity as Any), ("months", _data.months as Any), ("stars", _data.stars as Any), ("untilDate", _data.untilDate as Any)]) + 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", _data.flags as Any), ("channelId", _data.channelId as Any), ("additionalPeersCount", _data.additionalPeersCount as Any), ("launchMsgId", _data.launchMsgId as Any), ("winnersCount", _data.winnersCount as Any), ("unclaimedCount", _data.unclaimedCount as Any), ("winners", _data.winners as Any), ("months", _data.months as Any), ("stars", _data.stars as Any), ("prizeDescription", _data.prizeDescription as Any), ("untilDate", _data.untilDate as Any)]) + 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", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("receiptMsgId", _data.receiptMsgId as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("startParam", _data.startParam as Any), ("extendedMedia", _data.extendedMedia as Any)]) + 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", _data.starsAmount as Any), ("extendedMedia", _data.extendedMedia as Any)]) + return ("messageMediaPaidMedia", [("starsAmount", ConstructorParameterDescription(_data.starsAmount)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) case .messageMediaPhoto(let _data): - return ("messageMediaPhoto", [("flags", _data.flags as Any), ("photo", _data.photo as Any), ("ttlSeconds", _data.ttlSeconds as Any), ("video", _data.video as Any)]) + 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", _data.flags as Any), ("poll", _data.poll as Any), ("results", _data.results as Any), ("attachedMedia", _data.attachedMedia as Any)]) + 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", _data.flags as Any), ("peer", _data.peer as Any), ("id", _data.id as Any), ("story", _data.story as Any)]) + 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", _data.flags as Any), ("todo", _data.todo as Any), ("completions", _data.completions as Any)]) + 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", _data.geo as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any)]) + 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", _data.flags as Any), ("call", _data.call as Any)]) + return ("messageMediaVideoStream", [("flags", ConstructorParameterDescription(_data.flags)), ("call", ConstructorParameterDescription(_data.call))]) case .messageMediaWebPage(let _data): - return ("messageMediaWebPage", [("flags", _data.flags as Any), ("webpage", _data.webpage as Any)]) + return ("messageMediaWebPage", [("flags", ConstructorParameterDescription(_data.flags)), ("webpage", ConstructorParameterDescription(_data.webpage))]) } } diff --git a/submodules/TelegramApi/Sources/Api17.swift b/submodules/TelegramApi/Sources/Api17.swift index d5a0c93d0f..cde9dbb53c 100644 --- a/submodules/TelegramApi/Sources/Api17.swift +++ b/submodules/TelegramApi/Sources/Api17.swift @@ -11,8 +11,8 @@ public extension Api { self.date = date self.reaction = reaction } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messagePeerReaction", [("flags", self.flags as Any), ("peerId", self.peerId as Any), ("date", self.date as Any), ("reaction", self.reaction as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagePeerReaction", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.date)), ("reaction", ConstructorParameterDescription(self.reaction))]) } } case messagePeerReaction(Cons_messagePeerReaction) @@ -31,10 +31,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messagePeerReaction(let _data): - return ("messagePeerReaction", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("date", _data.date as Any), ("reaction", _data.reaction as Any)]) + return ("messagePeerReaction", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) } } @@ -75,8 +75,8 @@ public extension Api { self.option = option self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messagePeerVote", [("peer", self.peer as Any), ("option", self.option as Any), ("date", self.date as Any)]) + 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 { @@ -86,8 +86,8 @@ public extension Api { self.peer = peer self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messagePeerVoteInputOption", [("peer", self.peer as Any), ("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagePeerVoteInputOption", [("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date))]) } } public class Cons_messagePeerVoteMultiple: TypeConstructorDescription { @@ -99,8 +99,8 @@ public extension Api { self.options = options self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messagePeerVoteMultiple", [("peer", self.peer as Any), ("options", self.options as Any), ("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagePeerVoteMultiple", [("peer", ConstructorParameterDescription(self.peer)), ("options", ConstructorParameterDescription(self.options)), ("date", ConstructorParameterDescription(self.date))]) } } case messagePeerVote(Cons_messagePeerVote) @@ -139,14 +139,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messagePeerVote(let _data): - return ("messagePeerVote", [("peer", _data.peer as Any), ("option", _data.option as Any), ("date", _data.date as Any)]) + return ("messagePeerVote", [("peer", ConstructorParameterDescription(_data.peer)), ("option", ConstructorParameterDescription(_data.option)), ("date", ConstructorParameterDescription(_data.date))]) case .messagePeerVoteInputOption(let _data): - return ("messagePeerVoteInputOption", [("peer", _data.peer as Any), ("date", _data.date as Any)]) + return ("messagePeerVoteInputOption", [("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date))]) case .messagePeerVoteMultiple(let _data): - return ("messagePeerVoteMultiple", [("peer", _data.peer as Any), ("options", _data.options as Any), ("date", _data.date as Any)]) + return ("messagePeerVoteMultiple", [("peer", ConstructorParameterDescription(_data.peer)), ("options", ConstructorParameterDescription(_data.options)), ("date", ConstructorParameterDescription(_data.date))]) } } @@ -217,8 +217,8 @@ public extension Api { self.minId = minId self.maxId = maxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageRange", [("minId", self.minId as Any), ("maxId", self.maxId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageRange", [("minId", ConstructorParameterDescription(self.minId)), ("maxId", ConstructorParameterDescription(self.maxId))]) } } case messageRange(Cons_messageRange) @@ -235,10 +235,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageRange(let _data): - return ("messageRange", [("minId", _data.minId as Any), ("maxId", _data.maxId as Any)]) + return ("messageRange", [("minId", ConstructorParameterDescription(_data.minId)), ("maxId", ConstructorParameterDescription(_data.maxId))]) } } @@ -271,8 +271,8 @@ public extension Api { self.recentReactions = recentReactions self.topReactors = topReactors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageReactions", [("flags", self.flags as Any), ("results", self.results as Any), ("recentReactions", self.recentReactions as Any), ("topReactors", self.topReactors as Any)]) + 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) @@ -307,10 +307,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageReactions(let _data): - return ("messageReactions", [("flags", _data.flags as Any), ("results", _data.results as Any), ("recentReactions", _data.recentReactions as Any), ("topReactors", _data.topReactors as Any)]) + return ("messageReactions", [("flags", ConstructorParameterDescription(_data.flags)), ("results", ConstructorParameterDescription(_data.results)), ("recentReactions", ConstructorParameterDescription(_data.recentReactions)), ("topReactors", ConstructorParameterDescription(_data.topReactors))]) } } @@ -357,8 +357,8 @@ public extension Api { self.peerId = peerId self.count = count } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageReactor", [("flags", self.flags as Any), ("peerId", self.peerId as Any), ("count", self.count as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReactor", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("count", ConstructorParameterDescription(self.count))]) } } case messageReactor(Cons_messageReactor) @@ -378,10 +378,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageReactor(let _data): - return ("messageReactor", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("count", _data.count as Any)]) + return ("messageReactor", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("count", ConstructorParameterDescription(_data.count))]) } } @@ -427,8 +427,8 @@ public extension Api { self.maxId = maxId self.readMaxId = readMaxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageReplies", [("flags", self.flags as Any), ("replies", self.replies as Any), ("repliesPts", self.repliesPts as Any), ("recentRepliers", self.recentRepliers as Any), ("channelId", self.channelId as Any), ("maxId", self.maxId as Any), ("readMaxId", self.readMaxId as Any)]) + 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) @@ -462,10 +462,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageReplies(let _data): - return ("messageReplies", [("flags", _data.flags as Any), ("replies", _data.replies as Any), ("repliesPts", _data.repliesPts as Any), ("recentRepliers", _data.recentRepliers as Any), ("channelId", _data.channelId as Any), ("maxId", _data.maxId as Any), ("readMaxId", _data.readMaxId as Any)]) + 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))]) } } @@ -537,8 +537,8 @@ public extension Api { self.todoItemId = todoItemId self.pollOption = pollOption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageReplyHeader", [("flags", self.flags as Any), ("replyToMsgId", self.replyToMsgId as Any), ("replyToPeerId", self.replyToPeerId as Any), ("replyFrom", self.replyFrom as Any), ("replyMedia", self.replyMedia as Any), ("replyToTopId", self.replyToTopId as Any), ("quoteText", self.quoteText as Any), ("quoteEntities", self.quoteEntities as Any), ("quoteOffset", self.quoteOffset as Any), ("todoItemId", self.todoItemId as Any), ("pollOption", self.pollOption as Any)]) + 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 { @@ -548,8 +548,8 @@ public extension Api { self.peer = peer self.storyId = storyId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageReplyStoryHeader", [("peer", self.peer as Any), ("storyId", self.storyId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReplyStoryHeader", [("peer", ConstructorParameterDescription(self.peer)), ("storyId", ConstructorParameterDescription(self.storyId))]) } } case messageReplyHeader(Cons_messageReplyHeader) @@ -607,12 +607,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageReplyHeader(let _data): - return ("messageReplyHeader", [("flags", _data.flags as Any), ("replyToMsgId", _data.replyToMsgId as Any), ("replyToPeerId", _data.replyToPeerId as Any), ("replyFrom", _data.replyFrom as Any), ("replyMedia", _data.replyMedia as Any), ("replyToTopId", _data.replyToTopId as Any), ("quoteText", _data.quoteText as Any), ("quoteEntities", _data.quoteEntities as Any), ("quoteOffset", _data.quoteOffset as Any), ("todoItemId", _data.todoItemId as Any), ("pollOption", _data.pollOption as Any)]) + 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", _data.peer as Any), ("storyId", _data.storyId as Any)]) + return ("messageReplyStoryHeader", [("peer", ConstructorParameterDescription(_data.peer)), ("storyId", ConstructorParameterDescription(_data.storyId))]) } } @@ -712,8 +712,8 @@ public extension Api { self.text = text self.option = option } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageReportOption", [("text", self.text as Any), ("option", self.option as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageReportOption", [("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.option))]) } } case messageReportOption(Cons_messageReportOption) @@ -730,10 +730,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageReportOption(let _data): - return ("messageReportOption", [("text", _data.text as Any), ("option", _data.option as Any)]) + return ("messageReportOption", [("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option))]) } } @@ -766,8 +766,8 @@ public extension Api { self.forwards = forwards self.replies = replies } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageViews", [("flags", self.flags as Any), ("views", self.views as Any), ("forwards", self.forwards as Any), ("replies", self.replies as Any)]) + 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) @@ -792,10 +792,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageViews(let _data): - return ("messageViews", [("flags", _data.flags as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("replies", _data.replies as Any)]) + return ("messageViews", [("flags", ConstructorParameterDescription(_data.flags)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("replies", ConstructorParameterDescription(_data.replies))]) } } @@ -836,8 +836,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputMessagesFilterPhoneCalls", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputMessagesFilterPhoneCalls", [("flags", ConstructorParameterDescription(self.flags))]) } } case inputMessagesFilterChatPhotos @@ -955,7 +955,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputMessagesFilterChatPhotos: return ("inputMessagesFilterChatPhotos", []) @@ -974,7 +974,7 @@ public extension Api { case .inputMessagesFilterMyMentions: return ("inputMessagesFilterMyMentions", []) case .inputMessagesFilterPhoneCalls(let _data): - return ("inputMessagesFilterPhoneCalls", [("flags", _data.flags as Any)]) + return ("inputMessagesFilterPhoneCalls", [("flags", ConstructorParameterDescription(_data.flags))]) case .inputMessagesFilterPhotoVideo: return ("inputMessagesFilterPhotoVideo", []) case .inputMessagesFilterPhotos: @@ -1069,8 +1069,8 @@ public extension Api { self.flags = flags self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("missingInvitee", [("flags", self.flags as Any), ("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("missingInvitee", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId))]) } } case missingInvitee(Cons_missingInvitee) @@ -1087,10 +1087,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .missingInvitee(let _data): - return ("missingInvitee", [("flags", _data.flags as Any), ("userId", _data.userId as Any)]) + return ("missingInvitee", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId))]) } } @@ -1127,8 +1127,8 @@ public extension Api { self.expires = expires self.cooldownUntilDate = cooldownUntilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("myBoost", [("flags", self.flags as Any), ("slot", self.slot as Any), ("peer", self.peer as Any), ("date", self.date as Any), ("expires", self.expires as Any), ("cooldownUntilDate", self.cooldownUntilDate as Any)]) + 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) @@ -1153,10 +1153,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .myBoost(let _data): - return ("myBoost", [("flags", _data.flags as Any), ("slot", _data.slot as Any), ("peer", _data.peer as Any), ("date", _data.date as Any), ("expires", _data.expires as Any), ("cooldownUntilDate", _data.cooldownUntilDate as Any)]) + 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))]) } } diff --git a/submodules/TelegramApi/Sources/Api18.swift b/submodules/TelegramApi/Sources/Api18.swift index e5f62f6058..4cdba8c6d6 100644 --- a/submodules/TelegramApi/Sources/Api18.swift +++ b/submodules/TelegramApi/Sources/Api18.swift @@ -9,8 +9,8 @@ public extension Api { self.thisDc = thisDc self.nearestDc = nearestDc } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("nearestDc", [("country", self.country as Any), ("thisDc", self.thisDc as Any), ("nearestDc", self.nearestDc as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("nearestDc", [("country", ConstructorParameterDescription(self.country)), ("thisDc", ConstructorParameterDescription(self.thisDc)), ("nearestDc", ConstructorParameterDescription(self.nearestDc))]) } } case nearestDc(Cons_nearestDc) @@ -28,10 +28,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .nearestDc(let _data): - return ("nearestDc", [("country", _data.country as Any), ("thisDc", _data.thisDc as Any), ("nearestDc", _data.nearestDc as Any)]) + return ("nearestDc", [("country", ConstructorParameterDescription(_data.country)), ("thisDc", ConstructorParameterDescription(_data.thisDc)), ("nearestDc", ConstructorParameterDescription(_data.nearestDc))]) } } @@ -63,8 +63,8 @@ public extension Api { self.title = title self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("notificationSoundLocal", [("title", self.title as Any), ("data", self.data as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("notificationSoundLocal", [("title", ConstructorParameterDescription(self.title)), ("data", ConstructorParameterDescription(self.data))]) } } public class Cons_notificationSoundRingtone: TypeConstructorDescription { @@ -72,8 +72,8 @@ public extension Api { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("notificationSoundRingtone", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("notificationSoundRingtone", [("id", ConstructorParameterDescription(self.id))]) } } case notificationSoundDefault @@ -109,16 +109,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .notificationSoundDefault: return ("notificationSoundDefault", []) case .notificationSoundLocal(let _data): - return ("notificationSoundLocal", [("title", _data.title as Any), ("data", _data.data as Any)]) + return ("notificationSoundLocal", [("title", ConstructorParameterDescription(_data.title)), ("data", ConstructorParameterDescription(_data.data))]) case .notificationSoundNone: return ("notificationSoundNone", []) case .notificationSoundRingtone(let _data): - return ("notificationSoundRingtone", [("id", _data.id as Any)]) + return ("notificationSoundRingtone", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -164,8 +164,8 @@ public extension Api { self.peer = peer self.topMsgId = topMsgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("notifyForumTopic", [("peer", self.peer as Any), ("topMsgId", self.topMsgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("notifyForumTopic", [("peer", ConstructorParameterDescription(self.peer)), ("topMsgId", ConstructorParameterDescription(self.topMsgId))]) } } public class Cons_notifyPeer: TypeConstructorDescription { @@ -173,8 +173,8 @@ public extension Api { public init(peer: Api.Peer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("notifyPeer", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("notifyPeer", [("peer", ConstructorParameterDescription(self.peer))]) } } case notifyBroadcasts @@ -216,16 +216,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .notifyBroadcasts: return ("notifyBroadcasts", []) case .notifyChats: return ("notifyChats", []) case .notifyForumTopic(let _data): - return ("notifyForumTopic", [("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any)]) + return ("notifyForumTopic", [("peer", ConstructorParameterDescription(_data.peer)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId))]) case .notifyPeer(let _data): - return ("notifyPeer", [("peer", _data.peer as Any)]) + return ("notifyPeer", [("peer", ConstructorParameterDescription(_data.peer))]) case .notifyUsers: return ("notifyUsers", []) } @@ -278,8 +278,8 @@ public extension Api { public init(date: Int32) { self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("outboxReadDate", [("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("outboxReadDate", [("date", ConstructorParameterDescription(self.date))]) } } case outboxReadDate(Cons_outboxReadDate) @@ -295,10 +295,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .outboxReadDate(let _data): - return ("outboxReadDate", [("date", _data.date as Any)]) + return ("outboxReadDate", [("date", ConstructorParameterDescription(_data.date))]) } } @@ -332,8 +332,8 @@ public extension Api { self.documents = documents self.views = views } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("page", [("flags", self.flags as Any), ("url", self.url as Any), ("blocks", self.blocks as Any), ("photos", self.photos as Any), ("documents", self.documents as Any), ("views", self.views as Any)]) + 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))]) } } case page(Cons_page) @@ -368,10 +368,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .page(let _data): - return ("page", [("flags", _data.flags as Any), ("url", _data.url as Any), ("blocks", _data.blocks as Any), ("photos", _data.photos as Any), ("documents", _data.documents as Any), ("views", _data.views as Any)]) + 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))]) } } @@ -418,8 +418,8 @@ public extension Api { public init(name: String) { self.name = name } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockAnchor", [("name", self.name as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockAnchor", [("name", ConstructorParameterDescription(self.name))]) } } public class Cons_pageBlockAudio: TypeConstructorDescription { @@ -429,8 +429,8 @@ public extension Api { self.audioId = audioId self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockAudio", [("audioId", self.audioId as Any), ("caption", self.caption as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockAudio", [("audioId", ConstructorParameterDescription(self.audioId)), ("caption", ConstructorParameterDescription(self.caption))]) } } public class Cons_pageBlockAuthorDate: TypeConstructorDescription { @@ -440,8 +440,8 @@ public extension Api { self.author = author self.publishedDate = publishedDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockAuthorDate", [("author", self.author as Any), ("publishedDate", self.publishedDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockAuthorDate", [("author", ConstructorParameterDescription(self.author)), ("publishedDate", ConstructorParameterDescription(self.publishedDate))]) } } public class Cons_pageBlockBlockquote: TypeConstructorDescription { @@ -451,8 +451,8 @@ public extension Api { self.text = text self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockBlockquote", [("text", self.text as Any), ("caption", self.caption as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockBlockquote", [("text", ConstructorParameterDescription(self.text)), ("caption", ConstructorParameterDescription(self.caption))]) } } public class Cons_pageBlockChannel: TypeConstructorDescription { @@ -460,8 +460,8 @@ public extension Api { public init(channel: Api.Chat) { self.channel = channel } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockChannel", [("channel", self.channel as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockChannel", [("channel", ConstructorParameterDescription(self.channel))]) } } public class Cons_pageBlockCollage: TypeConstructorDescription { @@ -471,8 +471,8 @@ public extension Api { self.items = items self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockCollage", [("items", self.items as Any), ("caption", self.caption as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockCollage", [("items", ConstructorParameterDescription(self.items)), ("caption", ConstructorParameterDescription(self.caption))]) } } public class Cons_pageBlockCover: TypeConstructorDescription { @@ -480,8 +480,8 @@ public extension Api { public init(cover: Api.PageBlock) { self.cover = cover } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockCover", [("cover", self.cover as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockCover", [("cover", ConstructorParameterDescription(self.cover))]) } } public class Cons_pageBlockDetails: TypeConstructorDescription { @@ -493,8 +493,8 @@ public extension Api { self.blocks = blocks self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockDetails", [("flags", self.flags as Any), ("blocks", self.blocks as Any), ("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockDetails", [("flags", ConstructorParameterDescription(self.flags)), ("blocks", ConstructorParameterDescription(self.blocks)), ("title", ConstructorParameterDescription(self.title))]) } } public class Cons_pageBlockEmbed: TypeConstructorDescription { @@ -514,8 +514,8 @@ public extension Api { self.h = h self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockEmbed", [("flags", self.flags as Any), ("url", self.url as Any), ("html", self.html as Any), ("posterPhotoId", self.posterPhotoId as Any), ("w", self.w as Any), ("h", self.h as Any), ("caption", self.caption as Any)]) + 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 { @@ -535,8 +535,8 @@ public extension Api { self.blocks = blocks self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockEmbedPost", [("url", self.url as Any), ("webpageId", self.webpageId as Any), ("authorPhotoId", self.authorPhotoId as Any), ("author", self.author as Any), ("date", self.date as Any), ("blocks", self.blocks as Any), ("caption", self.caption as Any)]) + 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 { @@ -544,8 +544,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockFooter", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockFooter", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_pageBlockHeader: TypeConstructorDescription { @@ -553,8 +553,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockHeader", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockHeader", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_pageBlockKicker: TypeConstructorDescription { @@ -562,8 +562,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockKicker", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockKicker", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_pageBlockList: TypeConstructorDescription { @@ -571,8 +571,8 @@ public extension Api { public init(items: [Api.PageListItem]) { self.items = items } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockList", [("items", self.items as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockList", [("items", ConstructorParameterDescription(self.items))]) } } public class Cons_pageBlockMap: TypeConstructorDescription { @@ -588,8 +588,8 @@ public extension Api { self.h = h self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockMap", [("geo", self.geo as Any), ("zoom", self.zoom as Any), ("w", self.w as Any), ("h", self.h as Any), ("caption", self.caption as Any)]) + 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 { @@ -597,8 +597,8 @@ public extension Api { public init(items: [Api.PageListOrderedItem]) { self.items = items } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockOrderedList", [("items", self.items as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockOrderedList", [("items", ConstructorParameterDescription(self.items))]) } } public class Cons_pageBlockParagraph: TypeConstructorDescription { @@ -606,8 +606,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockParagraph", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockParagraph", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_pageBlockPhoto: TypeConstructorDescription { @@ -623,8 +623,8 @@ public extension Api { self.url = url self.webpageId = webpageId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockPhoto", [("flags", self.flags as Any), ("photoId", self.photoId as Any), ("caption", self.caption as Any), ("url", self.url as Any), ("webpageId", self.webpageId as Any)]) + 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 { @@ -634,8 +634,8 @@ public extension Api { self.text = text self.language = language } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockPreformatted", [("text", self.text as Any), ("language", self.language as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockPreformatted", [("text", ConstructorParameterDescription(self.text)), ("language", ConstructorParameterDescription(self.language))]) } } public class Cons_pageBlockPullquote: TypeConstructorDescription { @@ -645,8 +645,8 @@ public extension Api { self.text = text self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockPullquote", [("text", self.text as Any), ("caption", self.caption as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockPullquote", [("text", ConstructorParameterDescription(self.text)), ("caption", ConstructorParameterDescription(self.caption))]) } } public class Cons_pageBlockRelatedArticles: TypeConstructorDescription { @@ -656,8 +656,8 @@ public extension Api { self.title = title self.articles = articles } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockRelatedArticles", [("title", self.title as Any), ("articles", self.articles as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockRelatedArticles", [("title", ConstructorParameterDescription(self.title)), ("articles", ConstructorParameterDescription(self.articles))]) } } public class Cons_pageBlockSlideshow: TypeConstructorDescription { @@ -667,8 +667,8 @@ public extension Api { self.items = items self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockSlideshow", [("items", self.items as Any), ("caption", self.caption as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockSlideshow", [("items", ConstructorParameterDescription(self.items)), ("caption", ConstructorParameterDescription(self.caption))]) } } public class Cons_pageBlockSubheader: TypeConstructorDescription { @@ -676,8 +676,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockSubheader", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockSubheader", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_pageBlockSubtitle: TypeConstructorDescription { @@ -685,8 +685,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockSubtitle", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockSubtitle", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_pageBlockTable: TypeConstructorDescription { @@ -698,8 +698,8 @@ public extension Api { self.title = title self.rows = rows } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockTable", [("flags", self.flags as Any), ("title", self.title as Any), ("rows", self.rows as Any)]) + 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 { @@ -707,8 +707,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockTitle", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockTitle", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_pageBlockVideo: TypeConstructorDescription { @@ -720,8 +720,8 @@ public extension Api { self.videoId = videoId self.caption = caption } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageBlockVideo", [("flags", self.flags as Any), ("videoId", self.videoId as Any), ("caption", self.caption as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageBlockVideo", [("flags", ConstructorParameterDescription(self.flags)), ("videoId", ConstructorParameterDescription(self.videoId)), ("caption", ConstructorParameterDescription(self.caption))]) } } case pageBlockAnchor(Cons_pageBlockAnchor) @@ -1011,66 +1011,66 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pageBlockAnchor(let _data): - return ("pageBlockAnchor", [("name", _data.name as Any)]) + return ("pageBlockAnchor", [("name", ConstructorParameterDescription(_data.name))]) case .pageBlockAudio(let _data): - return ("pageBlockAudio", [("audioId", _data.audioId as Any), ("caption", _data.caption as Any)]) + return ("pageBlockAudio", [("audioId", ConstructorParameterDescription(_data.audioId)), ("caption", ConstructorParameterDescription(_data.caption))]) case .pageBlockAuthorDate(let _data): - return ("pageBlockAuthorDate", [("author", _data.author as Any), ("publishedDate", _data.publishedDate as Any)]) + return ("pageBlockAuthorDate", [("author", ConstructorParameterDescription(_data.author)), ("publishedDate", ConstructorParameterDescription(_data.publishedDate))]) case .pageBlockBlockquote(let _data): - return ("pageBlockBlockquote", [("text", _data.text as Any), ("caption", _data.caption as Any)]) + return ("pageBlockBlockquote", [("text", ConstructorParameterDescription(_data.text)), ("caption", ConstructorParameterDescription(_data.caption))]) case .pageBlockChannel(let _data): - return ("pageBlockChannel", [("channel", _data.channel as Any)]) + return ("pageBlockChannel", [("channel", ConstructorParameterDescription(_data.channel))]) case .pageBlockCollage(let _data): - return ("pageBlockCollage", [("items", _data.items as Any), ("caption", _data.caption as Any)]) + return ("pageBlockCollage", [("items", ConstructorParameterDescription(_data.items)), ("caption", ConstructorParameterDescription(_data.caption))]) case .pageBlockCover(let _data): - return ("pageBlockCover", [("cover", _data.cover as Any)]) + return ("pageBlockCover", [("cover", ConstructorParameterDescription(_data.cover))]) case .pageBlockDetails(let _data): - return ("pageBlockDetails", [("flags", _data.flags as Any), ("blocks", _data.blocks as Any), ("title", _data.title as Any)]) + 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", _data.flags as Any), ("url", _data.url as Any), ("html", _data.html as Any), ("posterPhotoId", _data.posterPhotoId as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("caption", _data.caption as Any)]) + 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", _data.url as Any), ("webpageId", _data.webpageId as Any), ("authorPhotoId", _data.authorPhotoId as Any), ("author", _data.author as Any), ("date", _data.date as Any), ("blocks", _data.blocks as Any), ("caption", _data.caption as Any)]) + 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", _data.text as Any)]) + return ("pageBlockFooter", [("text", ConstructorParameterDescription(_data.text))]) case .pageBlockHeader(let _data): - return ("pageBlockHeader", [("text", _data.text as Any)]) + return ("pageBlockHeader", [("text", ConstructorParameterDescription(_data.text))]) case .pageBlockKicker(let _data): - return ("pageBlockKicker", [("text", _data.text as Any)]) + return ("pageBlockKicker", [("text", ConstructorParameterDescription(_data.text))]) case .pageBlockList(let _data): - return ("pageBlockList", [("items", _data.items as Any)]) + return ("pageBlockList", [("items", ConstructorParameterDescription(_data.items))]) case .pageBlockMap(let _data): - return ("pageBlockMap", [("geo", _data.geo as Any), ("zoom", _data.zoom as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("caption", _data.caption as Any)]) + 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", _data.items as Any)]) + return ("pageBlockOrderedList", [("items", ConstructorParameterDescription(_data.items))]) case .pageBlockParagraph(let _data): - return ("pageBlockParagraph", [("text", _data.text as Any)]) + return ("pageBlockParagraph", [("text", ConstructorParameterDescription(_data.text))]) case .pageBlockPhoto(let _data): - return ("pageBlockPhoto", [("flags", _data.flags as Any), ("photoId", _data.photoId as Any), ("caption", _data.caption as Any), ("url", _data.url as Any), ("webpageId", _data.webpageId as Any)]) + 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", _data.text as Any), ("language", _data.language as Any)]) + return ("pageBlockPreformatted", [("text", ConstructorParameterDescription(_data.text)), ("language", ConstructorParameterDescription(_data.language))]) case .pageBlockPullquote(let _data): - return ("pageBlockPullquote", [("text", _data.text as Any), ("caption", _data.caption as Any)]) + return ("pageBlockPullquote", [("text", ConstructorParameterDescription(_data.text)), ("caption", ConstructorParameterDescription(_data.caption))]) case .pageBlockRelatedArticles(let _data): - return ("pageBlockRelatedArticles", [("title", _data.title as Any), ("articles", _data.articles as Any)]) + return ("pageBlockRelatedArticles", [("title", ConstructorParameterDescription(_data.title)), ("articles", ConstructorParameterDescription(_data.articles))]) case .pageBlockSlideshow(let _data): - return ("pageBlockSlideshow", [("items", _data.items as Any), ("caption", _data.caption as Any)]) + return ("pageBlockSlideshow", [("items", ConstructorParameterDescription(_data.items)), ("caption", ConstructorParameterDescription(_data.caption))]) case .pageBlockSubheader(let _data): - return ("pageBlockSubheader", [("text", _data.text as Any)]) + return ("pageBlockSubheader", [("text", ConstructorParameterDescription(_data.text))]) case .pageBlockSubtitle(let _data): - return ("pageBlockSubtitle", [("text", _data.text as Any)]) + return ("pageBlockSubtitle", [("text", ConstructorParameterDescription(_data.text))]) case .pageBlockTable(let _data): - return ("pageBlockTable", [("flags", _data.flags as Any), ("title", _data.title as Any), ("rows", _data.rows as Any)]) + return ("pageBlockTable", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("rows", ConstructorParameterDescription(_data.rows))]) case .pageBlockTitle(let _data): - return ("pageBlockTitle", [("text", _data.text as Any)]) + return ("pageBlockTitle", [("text", ConstructorParameterDescription(_data.text))]) case .pageBlockUnsupported: return ("pageBlockUnsupported", []) case .pageBlockVideo(let _data): - return ("pageBlockVideo", [("flags", _data.flags as Any), ("videoId", _data.videoId as Any), ("caption", _data.caption as Any)]) + return ("pageBlockVideo", [("flags", ConstructorParameterDescription(_data.flags)), ("videoId", ConstructorParameterDescription(_data.videoId)), ("caption", ConstructorParameterDescription(_data.caption))]) } } diff --git a/submodules/TelegramApi/Sources/Api19.swift b/submodules/TelegramApi/Sources/Api19.swift index 681aaef216..dad55093d8 100644 --- a/submodules/TelegramApi/Sources/Api19.swift +++ b/submodules/TelegramApi/Sources/Api19.swift @@ -7,8 +7,8 @@ public extension Api { self.text = text self.credit = credit } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageCaption", [("text", self.text as Any), ("credit", self.credit as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageCaption", [("text", ConstructorParameterDescription(self.text)), ("credit", ConstructorParameterDescription(self.credit))]) } } case pageCaption(Cons_pageCaption) @@ -25,10 +25,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pageCaption(let _data): - return ("pageCaption", [("text", _data.text as Any), ("credit", _data.credit as Any)]) + return ("pageCaption", [("text", ConstructorParameterDescription(_data.text)), ("credit", ConstructorParameterDescription(_data.credit))]) } } @@ -59,8 +59,8 @@ public extension Api { public init(blocks: [Api.PageBlock]) { self.blocks = blocks } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageListItemBlocks", [("blocks", self.blocks as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageListItemBlocks", [("blocks", ConstructorParameterDescription(self.blocks))]) } } public class Cons_pageListItemText: TypeConstructorDescription { @@ -68,8 +68,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageListItemText", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageListItemText", [("text", ConstructorParameterDescription(self.text))]) } } case pageListItemBlocks(Cons_pageListItemBlocks) @@ -96,12 +96,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pageListItemBlocks(let _data): - return ("pageListItemBlocks", [("blocks", _data.blocks as Any)]) + return ("pageListItemBlocks", [("blocks", ConstructorParameterDescription(_data.blocks))]) case .pageListItemText(let _data): - return ("pageListItemText", [("text", _data.text as Any)]) + return ("pageListItemText", [("text", ConstructorParameterDescription(_data.text))]) } } @@ -142,8 +142,8 @@ public extension Api { self.num = num self.blocks = blocks } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageListOrderedItemBlocks", [("num", self.num as Any), ("blocks", self.blocks as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageListOrderedItemBlocks", [("num", ConstructorParameterDescription(self.num)), ("blocks", ConstructorParameterDescription(self.blocks))]) } } public class Cons_pageListOrderedItemText: TypeConstructorDescription { @@ -153,8 +153,8 @@ public extension Api { self.num = num self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageListOrderedItemText", [("num", self.num as Any), ("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageListOrderedItemText", [("num", ConstructorParameterDescription(self.num)), ("text", ConstructorParameterDescription(self.text))]) } } case pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks) @@ -183,12 +183,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pageListOrderedItemBlocks(let _data): - return ("pageListOrderedItemBlocks", [("num", _data.num as Any), ("blocks", _data.blocks as Any)]) + return ("pageListOrderedItemBlocks", [("num", ConstructorParameterDescription(_data.num)), ("blocks", ConstructorParameterDescription(_data.blocks))]) case .pageListOrderedItemText(let _data): - return ("pageListOrderedItemText", [("num", _data.num as Any), ("text", _data.text as Any)]) + return ("pageListOrderedItemText", [("num", ConstructorParameterDescription(_data.num)), ("text", ConstructorParameterDescription(_data.text))]) } } @@ -247,8 +247,8 @@ public extension Api { self.author = author self.publishedDate = publishedDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageRelatedArticle", [("flags", self.flags as Any), ("url", self.url as Any), ("webpageId", self.webpageId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photoId", self.photoId as Any), ("author", self.author as Any), ("publishedDate", self.publishedDate as Any)]) + 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) @@ -281,10 +281,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pageRelatedArticle(let _data): - return ("pageRelatedArticle", [("flags", _data.flags as Any), ("url", _data.url as Any), ("webpageId", _data.webpageId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photoId", _data.photoId as Any), ("author", _data.author as Any), ("publishedDate", _data.publishedDate as Any)]) + 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))]) } } @@ -345,8 +345,8 @@ public extension Api { self.colspan = colspan self.rowspan = rowspan } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageTableCell", [("flags", self.flags as Any), ("text", self.text as Any), ("colspan", self.colspan as Any), ("rowspan", self.rowspan as Any)]) + 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) @@ -371,10 +371,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pageTableCell(let _data): - return ("pageTableCell", [("flags", _data.flags as Any), ("text", _data.text as Any), ("colspan", _data.colspan as Any), ("rowspan", _data.rowspan as Any)]) + return ("pageTableCell", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("colspan", ConstructorParameterDescription(_data.colspan)), ("rowspan", ConstructorParameterDescription(_data.rowspan))]) } } @@ -415,8 +415,8 @@ public extension Api { public init(cells: [Api.PageTableCell]) { self.cells = cells } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pageTableRow", [("cells", self.cells as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("pageTableRow", [("cells", ConstructorParameterDescription(self.cells))]) } } case pageTableRow(Cons_pageTableRow) @@ -436,10 +436,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pageTableRow(let _data): - return ("pageTableRow", [("cells", _data.cells as Any)]) + return ("pageTableRow", [("cells", ConstructorParameterDescription(_data.cells))]) } } @@ -465,8 +465,8 @@ public extension Api { public init(peer: Api.InputPeer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paidReactionPrivacyPeer", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(self.peer))]) } } case paidReactionPrivacyAnonymous @@ -494,14 +494,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paidReactionPrivacyAnonymous: return ("paidReactionPrivacyAnonymous", []) case .paidReactionPrivacyDefault: return ("paidReactionPrivacyDefault", []) case .paidReactionPrivacyPeer(let _data): - return ("paidReactionPrivacyPeer", [("peer", _data.peer as Any)]) + return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(_data.peer))]) } } @@ -543,8 +543,8 @@ public extension Api { self.softwareEmojiId = softwareEmojiId self.lastUsageDate = lastUsageDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passkey", [("flags", self.flags as Any), ("id", self.id as Any), ("name", self.name as Any), ("date", self.date as Any), ("softwareEmojiId", self.softwareEmojiId as Any), ("lastUsageDate", self.lastUsageDate as Any)]) + 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) @@ -569,10 +569,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passkey(let _data): - return ("passkey", [("flags", _data.flags as Any), ("id", _data.id as Any), ("name", _data.name as Any), ("date", _data.date as Any), ("softwareEmojiId", _data.softwareEmojiId as Any), ("lastUsageDate", _data.lastUsageDate as Any)]) + 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))]) } } @@ -621,8 +621,8 @@ public extension Api { self.g = g self.p = p } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", self.salt1 as Any), ("salt2", self.salt2 as Any), ("g", self.g as Any), ("p", self.p as Any)]) + 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) @@ -647,10 +647,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let _data): - return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", _data.salt1 as Any), ("salt2", _data.salt2 as Any), ("g", _data.g as Any), ("p", _data.p as Any)]) + return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", ConstructorParameterDescription(_data.salt1)), ("salt2", ConstructorParameterDescription(_data.salt2)), ("g", ConstructorParameterDescription(_data.g)), ("p", ConstructorParameterDescription(_data.p))]) case .passwordKdfAlgoUnknown: return ("passwordKdfAlgoUnknown", []) } @@ -690,8 +690,8 @@ public extension Api { self.id = id self.providerChargeId = providerChargeId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentCharge", [("id", self.id as Any), ("providerChargeId", self.providerChargeId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentCharge", [("id", ConstructorParameterDescription(self.id)), ("providerChargeId", ConstructorParameterDescription(self.providerChargeId))]) } } case paymentCharge(Cons_paymentCharge) @@ -708,10 +708,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paymentCharge(let _data): - return ("paymentCharge", [("id", _data.id as Any), ("providerChargeId", _data.providerChargeId as Any)]) + return ("paymentCharge", [("id", ConstructorParameterDescription(_data.id)), ("providerChargeId", ConstructorParameterDescription(_data.providerChargeId))]) } } @@ -740,8 +740,8 @@ public extension Api { self.url = url self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentFormMethod", [("url", self.url as Any), ("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentFormMethod", [("url", ConstructorParameterDescription(self.url)), ("title", ConstructorParameterDescription(self.title))]) } } case paymentFormMethod(Cons_paymentFormMethod) @@ -758,10 +758,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paymentFormMethod(let _data): - return ("paymentFormMethod", [("url", _data.url as Any), ("title", _data.title as Any)]) + return ("paymentFormMethod", [("url", ConstructorParameterDescription(_data.url)), ("title", ConstructorParameterDescription(_data.title))]) } } @@ -796,8 +796,8 @@ public extension Api { self.email = email self.shippingAddress = shippingAddress } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentRequestedInfo", [("flags", self.flags as Any), ("name", self.name as Any), ("phone", self.phone as Any), ("email", self.email as Any), ("shippingAddress", self.shippingAddress as Any)]) + 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) @@ -825,10 +825,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paymentRequestedInfo(let _data): - return ("paymentRequestedInfo", [("flags", _data.flags as Any), ("name", _data.name as Any), ("phone", _data.phone as Any), ("email", _data.email as Any), ("shippingAddress", _data.shippingAddress as Any)]) + return ("paymentRequestedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("phone", ConstructorParameterDescription(_data.phone)), ("email", ConstructorParameterDescription(_data.email)), ("shippingAddress", ConstructorParameterDescription(_data.shippingAddress))]) } } @@ -876,8 +876,8 @@ public extension Api { self.id = id self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentSavedCredentialsCard", [("id", self.id as Any), ("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title))]) } } case paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard) @@ -894,10 +894,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paymentSavedCredentialsCard(let _data): - return ("paymentSavedCredentialsCard", [("id", _data.id as Any), ("title", _data.title as Any)]) + return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title))]) } } @@ -924,8 +924,8 @@ public extension Api { public init(channelId: Int64) { self.channelId = channelId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerChannel", [("channelId", self.channelId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerChannel", [("channelId", ConstructorParameterDescription(self.channelId))]) } } public class Cons_peerChat: TypeConstructorDescription { @@ -933,8 +933,8 @@ public extension Api { public init(chatId: Int64) { self.chatId = chatId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerChat", [("chatId", self.chatId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerChat", [("chatId", ConstructorParameterDescription(self.chatId))]) } } public class Cons_peerUser: TypeConstructorDescription { @@ -942,8 +942,8 @@ public extension Api { public init(userId: Int64) { self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerUser", [("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerUser", [("userId", ConstructorParameterDescription(self.userId))]) } } case peerChannel(Cons_peerChannel) @@ -973,14 +973,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerChannel(let _data): - return ("peerChannel", [("channelId", _data.channelId as Any)]) + return ("peerChannel", [("channelId", ConstructorParameterDescription(_data.channelId))]) case .peerChat(let _data): - return ("peerChat", [("chatId", _data.chatId as Any)]) + return ("peerChat", [("chatId", ConstructorParameterDescription(_data.chatId))]) case .peerUser(let _data): - return ("peerUser", [("userId", _data.userId as Any)]) + return ("peerUser", [("userId", ConstructorParameterDescription(_data.userId))]) } } @@ -1028,8 +1028,8 @@ public extension Api { self.peerId = peerId self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerBlocked", [("peerId", self.peerId as Any), ("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerBlocked", [("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.date))]) } } case peerBlocked(Cons_peerBlocked) @@ -1046,10 +1046,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerBlocked(let _data): - return ("peerBlocked", [("peerId", _data.peerId as Any), ("date", _data.date as Any)]) + return ("peerBlocked", [("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date))]) } } @@ -1078,8 +1078,8 @@ public extension Api { public init(collectibleId: Int64) { self.collectibleId = collectibleId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPeerColorCollectible", [("collectibleId", self.collectibleId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(self.collectibleId))]) } } public class Cons_peerColor: TypeConstructorDescription { @@ -1091,8 +1091,8 @@ public extension Api { self.color = color self.backgroundEmojiId = backgroundEmojiId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerColor", [("flags", self.flags as Any), ("color", self.color as Any), ("backgroundEmojiId", self.backgroundEmojiId as Any)]) + 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 { @@ -1114,8 +1114,8 @@ public extension Api { self.darkAccentColor = darkAccentColor self.darkColors = darkColors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerColorCollectible", [("flags", self.flags as Any), ("collectibleId", self.collectibleId as Any), ("giftEmojiId", self.giftEmojiId as Any), ("backgroundEmojiId", self.backgroundEmojiId as Any), ("accentColor", self.accentColor as Any), ("colors", self.colors as Any), ("darkAccentColor", self.darkAccentColor as Any), ("darkColors", self.darkColors as Any)]) + 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) @@ -1170,14 +1170,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPeerColorCollectible(let _data): - return ("inputPeerColorCollectible", [("collectibleId", _data.collectibleId as Any)]) + return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(_data.collectibleId))]) case .peerColor(let _data): - return ("peerColor", [("flags", _data.flags as Any), ("color", _data.color as Any), ("backgroundEmojiId", _data.backgroundEmojiId as Any)]) + return ("peerColor", [("flags", ConstructorParameterDescription(_data.flags)), ("color", ConstructorParameterDescription(_data.color)), ("backgroundEmojiId", ConstructorParameterDescription(_data.backgroundEmojiId))]) case .peerColorCollectible(let _data): - return ("peerColorCollectible", [("flags", _data.flags as Any), ("collectibleId", _data.collectibleId as Any), ("giftEmojiId", _data.giftEmojiId as Any), ("backgroundEmojiId", _data.backgroundEmojiId as Any), ("accentColor", _data.accentColor as Any), ("colors", _data.colors as Any), ("darkAccentColor", _data.darkAccentColor as Any), ("darkColors", _data.darkColors as Any)]) + 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))]) } } @@ -1266,8 +1266,8 @@ public extension Api { self.expires = expires self.distance = distance } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerLocated", [("peer", self.peer as Any), ("expires", self.expires as Any), ("distance", self.distance as Any)]) + 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 { @@ -1275,8 +1275,8 @@ public extension Api { public init(expires: Int32) { self.expires = expires } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerSelfLocated", [("expires", self.expires as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerSelfLocated", [("expires", ConstructorParameterDescription(self.expires))]) } } case peerLocated(Cons_peerLocated) @@ -1301,12 +1301,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerLocated(let _data): - return ("peerLocated", [("peer", _data.peer as Any), ("expires", _data.expires as Any), ("distance", _data.distance as Any)]) + return ("peerLocated", [("peer", ConstructorParameterDescription(_data.peer)), ("expires", ConstructorParameterDescription(_data.expires)), ("distance", ConstructorParameterDescription(_data.distance))]) case .peerSelfLocated(let _data): - return ("peerSelfLocated", [("expires", _data.expires as Any)]) + return ("peerSelfLocated", [("expires", ConstructorParameterDescription(_data.expires))]) } } @@ -1371,8 +1371,8 @@ public extension Api { self.storiesAndroidSound = storiesAndroidSound self.storiesOtherSound = storiesOtherSound } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerNotifySettings", [("flags", self.flags as Any), ("showPreviews", self.showPreviews as Any), ("silent", self.silent as Any), ("muteUntil", self.muteUntil as Any), ("iosSound", self.iosSound as Any), ("androidSound", self.androidSound as Any), ("otherSound", self.otherSound as Any), ("storiesMuted", self.storiesMuted as Any), ("storiesHideSender", self.storiesHideSender as Any), ("storiesIosSound", self.storiesIosSound as Any), ("storiesAndroidSound", self.storiesAndroidSound as Any), ("storiesOtherSound", self.storiesOtherSound as Any)]) + 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) @@ -1421,10 +1421,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerNotifySettings(let _data): - return ("peerNotifySettings", [("flags", _data.flags as Any), ("showPreviews", _data.showPreviews as Any), ("silent", _data.silent as Any), ("muteUntil", _data.muteUntil as Any), ("iosSound", _data.iosSound as Any), ("androidSound", _data.androidSound as Any), ("otherSound", _data.otherSound as Any), ("storiesMuted", _data.storiesMuted as Any), ("storiesHideSender", _data.storiesHideSender as Any), ("storiesIosSound", _data.storiesIosSound as Any), ("storiesAndroidSound", _data.storiesAndroidSound as Any), ("storiesOtherSound", _data.storiesOtherSound as Any)]) + 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))]) } } @@ -1543,8 +1543,8 @@ public extension Api { self.nameChangeDate = nameChangeDate self.photoChangeDate = photoChangeDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerSettings", [("flags", self.flags as Any), ("geoDistance", self.geoDistance as Any), ("requestChatTitle", self.requestChatTitle as Any), ("requestChatDate", self.requestChatDate as Any), ("businessBotId", self.businessBotId as Any), ("businessBotManageUrl", self.businessBotManageUrl as Any), ("chargePaidMessageStars", self.chargePaidMessageStars as Any), ("registrationMonth", self.registrationMonth as Any), ("phoneCountry", self.phoneCountry as Any), ("nameChangeDate", self.nameChangeDate as Any), ("photoChangeDate", self.photoChangeDate as Any)]) + 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) @@ -1590,10 +1590,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerSettings(let _data): - return ("peerSettings", [("flags", _data.flags as Any), ("geoDistance", _data.geoDistance as Any), ("requestChatTitle", _data.requestChatTitle as Any), ("requestChatDate", _data.requestChatDate as Any), ("businessBotId", _data.businessBotId as Any), ("businessBotManageUrl", _data.businessBotManageUrl as Any), ("chargePaidMessageStars", _data.chargePaidMessageStars as Any), ("registrationMonth", _data.registrationMonth as Any), ("phoneCountry", _data.phoneCountry as Any), ("nameChangeDate", _data.nameChangeDate as Any), ("photoChangeDate", _data.photoChangeDate as Any)]) + 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))]) } } @@ -1673,8 +1673,8 @@ public extension Api { self.maxReadId = maxReadId self.stories = stories } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerStories", [("flags", self.flags as Any), ("peer", self.peer as Any), ("maxReadId", self.maxReadId as Any), ("stories", self.stories as Any)]) + 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) @@ -1699,10 +1699,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerStories(let _data): - return ("peerStories", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("maxReadId", _data.maxReadId as Any), ("stories", _data.stories as Any)]) + return ("peerStories", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("maxReadId", ConstructorParameterDescription(_data.maxReadId)), ("stories", ConstructorParameterDescription(_data.stories))]) } } @@ -1747,8 +1747,8 @@ public extension Api { self.description = description self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pendingSuggestion", [("suggestion", self.suggestion as Any), ("title", self.title as Any), ("description", self.description as Any), ("url", self.url as Any)]) + 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) @@ -1767,10 +1767,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pendingSuggestion(let _data): - return ("pendingSuggestion", [("suggestion", _data.suggestion as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("url", _data.url as Any)]) + return ("pendingSuggestion", [("suggestion", ConstructorParameterDescription(_data.suggestion)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("url", ConstructorParameterDescription(_data.url))]) } } @@ -1801,48 +1801,431 @@ public extension Api { } } public extension Api { - enum PersonalChannel: TypeConstructorDescription { - public class Cons_personalChannel: TypeConstructorDescription { - public var userId: Int64 - public var channelId: Int64 - public init(userId: Int64, channelId: Int64) { - self.userId = userId - self.channelId = channelId + 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, Any)]) { - return ("personalChannel", [("userId", self.userId as Any), ("channelId", self.channelId as Any)]) + 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))]) } } - case personalChannel(Cons_personalChannel) + 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 .personalChannel(let _data): + case .phoneCall(let _data): if boxed { - buffer.appendInt32(431767677) + 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) } - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeInt64(_data.channelId, buffer: buffer, boxed: false) break } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { - case .personalChannel(let _data): - return ("personalChannel", [("userId", _data.userId as Any), ("channelId", _data.channelId as Any)]) + 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_personalChannel(_ reader: BufferReader) -> PersonalChannel? { - var _1: Int64? - _1 = reader.readInt64() + 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!) & 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 - if _c1 && _c2 { - return Api.PersonalChannel.personalChannel(Cons_personalChannel(userId: _1!, channelId: _2!)) + 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!) & 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!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason + } + } + var _4: Int32? + if Int(_1!) & Int(1 << 1) != 0 { + _4 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.PhoneCall.phoneCallDiscarded(Cons_phoneCallDiscarded(flags: _1!, id: _2!, reason: _3, duration: _4)) + } + else { + return nil + } + } + 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_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_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!) & 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!) & 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/Api2.swift b/submodules/TelegramApi/Sources/Api2.swift index f058e80386..f9f45b3af7 100644 --- a/submodules/TelegramApi/Sources/Api2.swift +++ b/submodules/TelegramApi/Sources/Api2.swift @@ -15,8 +15,8 @@ public extension Api { self.date = date self.rights = rights } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botBusinessConnection", [("flags", self.flags as Any), ("connectionId", self.connectionId as Any), ("userId", self.userId as Any), ("dcId", self.dcId as Any), ("date", self.date as Any), ("rights", self.rights as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botBusinessConnection", [("flags", ConstructorParameterDescription(self.flags)), ("connectionId", ConstructorParameterDescription(self.connectionId)), ("userId", ConstructorParameterDescription(self.userId)), ("dcId", ConstructorParameterDescription(self.dcId)), ("date", ConstructorParameterDescription(self.date)), ("rights", ConstructorParameterDescription(self.rights))]) } } case botBusinessConnection(Cons_botBusinessConnection) @@ -39,10 +39,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botBusinessConnection(let _data): - return ("botBusinessConnection", [("flags", _data.flags as Any), ("connectionId", _data.connectionId as Any), ("userId", _data.userId as Any), ("dcId", _data.dcId as Any), ("date", _data.date as Any), ("rights", _data.rights as Any)]) + return ("botBusinessConnection", [("flags", ConstructorParameterDescription(_data.flags)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("userId", ConstructorParameterDescription(_data.userId)), ("dcId", ConstructorParameterDescription(_data.dcId)), ("date", ConstructorParameterDescription(_data.date)), ("rights", ConstructorParameterDescription(_data.rights))]) } } @@ -87,8 +87,8 @@ public extension Api { self.command = command self.description = description } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botCommand", [("command", self.command as Any), ("description", self.description as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botCommand", [("command", ConstructorParameterDescription(self.command)), ("description", ConstructorParameterDescription(self.description))]) } } case botCommand(Cons_botCommand) @@ -105,10 +105,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botCommand(let _data): - return ("botCommand", [("command", _data.command as Any), ("description", _data.description as Any)]) + return ("botCommand", [("command", ConstructorParameterDescription(_data.command)), ("description", ConstructorParameterDescription(_data.description))]) } } @@ -135,8 +135,8 @@ public extension Api { public init(peer: Api.InputPeer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botCommandScopePeer", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botCommandScopePeer", [("peer", ConstructorParameterDescription(self.peer))]) } } public class Cons_botCommandScopePeerAdmins: TypeConstructorDescription { @@ -144,8 +144,8 @@ public extension Api { public init(peer: Api.InputPeer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botCommandScopePeerAdmins", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botCommandScopePeerAdmins", [("peer", ConstructorParameterDescription(self.peer))]) } } public class Cons_botCommandScopePeerUser: TypeConstructorDescription { @@ -155,8 +155,8 @@ public extension Api { self.peer = peer self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botCommandScopePeerUser", [("peer", self.peer as Any), ("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botCommandScopePeerUser", [("peer", ConstructorParameterDescription(self.peer)), ("userId", ConstructorParameterDescription(self.userId))]) } } case botCommandScopeChatAdmins @@ -211,7 +211,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botCommandScopeChatAdmins: return ("botCommandScopeChatAdmins", []) @@ -220,11 +220,11 @@ public extension Api { case .botCommandScopeDefault: return ("botCommandScopeDefault", []) case .botCommandScopePeer(let _data): - return ("botCommandScopePeer", [("peer", _data.peer as Any)]) + return ("botCommandScopePeer", [("peer", ConstructorParameterDescription(_data.peer))]) case .botCommandScopePeerAdmins(let _data): - return ("botCommandScopePeerAdmins", [("peer", _data.peer as Any)]) + return ("botCommandScopePeerAdmins", [("peer", ConstructorParameterDescription(_data.peer))]) case .botCommandScopePeerUser(let _data): - return ("botCommandScopePeerUser", [("peer", _data.peer as Any), ("userId", _data.userId as Any)]) + return ("botCommandScopePeerUser", [("peer", ConstructorParameterDescription(_data.peer)), ("userId", ConstructorParameterDescription(_data.userId))]) case .botCommandScopeUsers: return ("botCommandScopeUsers", []) } @@ -313,8 +313,8 @@ public extension Api { self.appSettings = appSettings self.verifierSettings = verifierSettings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInfo", [("flags", self.flags as Any), ("userId", self.userId as Any), ("description", self.description as Any), ("descriptionPhoto", self.descriptionPhoto as Any), ("descriptionDocument", self.descriptionDocument as Any), ("commands", self.commands as Any), ("menuButton", self.menuButton as Any), ("privacyPolicyUrl", self.privacyPolicyUrl as Any), ("appSettings", self.appSettings as Any), ("verifierSettings", self.verifierSettings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInfo", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("description", ConstructorParameterDescription(self.description)), ("descriptionPhoto", ConstructorParameterDescription(self.descriptionPhoto)), ("descriptionDocument", ConstructorParameterDescription(self.descriptionDocument)), ("commands", ConstructorParameterDescription(self.commands)), ("menuButton", ConstructorParameterDescription(self.menuButton)), ("privacyPolicyUrl", ConstructorParameterDescription(self.privacyPolicyUrl)), ("appSettings", ConstructorParameterDescription(self.appSettings)), ("verifierSettings", ConstructorParameterDescription(self.verifierSettings))]) } } case botInfo(Cons_botInfo) @@ -361,10 +361,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botInfo(let _data): - return ("botInfo", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("description", _data.description as Any), ("descriptionPhoto", _data.descriptionPhoto as Any), ("descriptionDocument", _data.descriptionDocument as Any), ("commands", _data.commands as Any), ("menuButton", _data.menuButton as Any), ("privacyPolicyUrl", _data.privacyPolicyUrl as Any), ("appSettings", _data.appSettings as Any), ("verifierSettings", _data.verifierSettings as Any)]) + return ("botInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("description", ConstructorParameterDescription(_data.description)), ("descriptionPhoto", ConstructorParameterDescription(_data.descriptionPhoto)), ("descriptionDocument", ConstructorParameterDescription(_data.descriptionDocument)), ("commands", ConstructorParameterDescription(_data.commands)), ("menuButton", ConstructorParameterDescription(_data.menuButton)), ("privacyPolicyUrl", ConstructorParameterDescription(_data.privacyPolicyUrl)), ("appSettings", ConstructorParameterDescription(_data.appSettings)), ("verifierSettings", ConstructorParameterDescription(_data.verifierSettings))]) } } @@ -451,8 +451,8 @@ public extension Api { self.entities = entities self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMessageMediaAuto", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMessageMediaAuto", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_botInlineMessageMediaContact: TypeConstructorDescription { @@ -470,8 +470,8 @@ public extension Api { self.vcard = vcard self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMessageMediaContact", [("flags", self.flags as Any), ("phoneNumber", self.phoneNumber as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("vcard", self.vcard as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMessageMediaContact", [("flags", ConstructorParameterDescription(self.flags)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("vcard", ConstructorParameterDescription(self.vcard)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_botInlineMessageMediaGeo: TypeConstructorDescription { @@ -489,8 +489,8 @@ public extension Api { self.proximityNotificationRadius = proximityNotificationRadius self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMessageMediaGeo", [("flags", self.flags as Any), ("geo", self.geo as Any), ("heading", self.heading as Any), ("period", self.period as Any), ("proximityNotificationRadius", self.proximityNotificationRadius as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMessageMediaGeo", [("flags", ConstructorParameterDescription(self.flags)), ("geo", ConstructorParameterDescription(self.geo)), ("heading", ConstructorParameterDescription(self.heading)), ("period", ConstructorParameterDescription(self.period)), ("proximityNotificationRadius", ConstructorParameterDescription(self.proximityNotificationRadius)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_botInlineMessageMediaInvoice: TypeConstructorDescription { @@ -510,8 +510,8 @@ public extension Api { self.totalAmount = totalAmount self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMessageMediaInvoice", [("flags", self.flags as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMessageMediaInvoice", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("currency", ConstructorParameterDescription(self.currency)), ("totalAmount", ConstructorParameterDescription(self.totalAmount)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_botInlineMessageMediaVenue: TypeConstructorDescription { @@ -533,8 +533,8 @@ public extension Api { self.venueType = venueType self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMessageMediaVenue", [("flags", self.flags as Any), ("geo", self.geo as Any), ("title", self.title as Any), ("address", self.address as Any), ("provider", self.provider as Any), ("venueId", self.venueId as Any), ("venueType", self.venueType as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMessageMediaVenue", [("flags", ConstructorParameterDescription(self.flags)), ("geo", ConstructorParameterDescription(self.geo)), ("title", ConstructorParameterDescription(self.title)), ("address", ConstructorParameterDescription(self.address)), ("provider", ConstructorParameterDescription(self.provider)), ("venueId", ConstructorParameterDescription(self.venueId)), ("venueType", ConstructorParameterDescription(self.venueType)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_botInlineMessageMediaWebPage: TypeConstructorDescription { @@ -550,8 +550,8 @@ public extension Api { self.url = url self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMessageMediaWebPage", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("url", self.url as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMessageMediaWebPage", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("url", ConstructorParameterDescription(self.url)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_botInlineMessageText: TypeConstructorDescription { @@ -565,8 +565,8 @@ public extension Api { self.entities = entities self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMessageText", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMessageText", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } case botInlineMessageMediaAuto(Cons_botInlineMessageMediaAuto) @@ -697,22 +697,22 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botInlineMessageMediaAuto(let _data): - return ("botInlineMessageMediaAuto", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("botInlineMessageMediaAuto", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .botInlineMessageMediaContact(let _data): - return ("botInlineMessageMediaContact", [("flags", _data.flags as Any), ("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("botInlineMessageMediaContact", [("flags", ConstructorParameterDescription(_data.flags)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("vcard", ConstructorParameterDescription(_data.vcard)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .botInlineMessageMediaGeo(let _data): - return ("botInlineMessageMediaGeo", [("flags", _data.flags as Any), ("geo", _data.geo as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("botInlineMessageMediaGeo", [("flags", ConstructorParameterDescription(_data.flags)), ("geo", ConstructorParameterDescription(_data.geo)), ("heading", ConstructorParameterDescription(_data.heading)), ("period", ConstructorParameterDescription(_data.period)), ("proximityNotificationRadius", ConstructorParameterDescription(_data.proximityNotificationRadius)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .botInlineMessageMediaInvoice(let _data): - return ("botInlineMessageMediaInvoice", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("botInlineMessageMediaInvoice", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("currency", ConstructorParameterDescription(_data.currency)), ("totalAmount", ConstructorParameterDescription(_data.totalAmount)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .botInlineMessageMediaVenue(let _data): - return ("botInlineMessageMediaVenue", [("flags", _data.flags as Any), ("geo", _data.geo as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("botInlineMessageMediaVenue", [("flags", ConstructorParameterDescription(_data.flags)), ("geo", ConstructorParameterDescription(_data.geo)), ("title", ConstructorParameterDescription(_data.title)), ("address", ConstructorParameterDescription(_data.address)), ("provider", ConstructorParameterDescription(_data.provider)), ("venueId", ConstructorParameterDescription(_data.venueId)), ("venueType", ConstructorParameterDescription(_data.venueType)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .botInlineMessageMediaWebPage(let _data): - return ("botInlineMessageMediaWebPage", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("url", _data.url as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("botInlineMessageMediaWebPage", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("url", ConstructorParameterDescription(_data.url)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .botInlineMessageText(let _data): - return ("botInlineMessageText", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("botInlineMessageText", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) } } @@ -969,8 +969,8 @@ public extension Api { self.description = description self.sendMessage = sendMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineMediaResult", [("flags", self.flags as Any), ("id", self.id as Any), ("type", self.type as Any), ("photo", self.photo as Any), ("document", self.document as Any), ("title", self.title as Any), ("description", self.description as Any), ("sendMessage", self.sendMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineMediaResult", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("type", ConstructorParameterDescription(self.type)), ("photo", ConstructorParameterDescription(self.photo)), ("document", ConstructorParameterDescription(self.document)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("sendMessage", ConstructorParameterDescription(self.sendMessage))]) } } public class Cons_botInlineResult: TypeConstructorDescription { @@ -994,8 +994,8 @@ public extension Api { self.content = content self.sendMessage = sendMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInlineResult", [("flags", self.flags as Any), ("id", self.id as Any), ("type", self.type as Any), ("title", self.title as Any), ("description", self.description as Any), ("url", self.url as Any), ("thumb", self.thumb as Any), ("content", self.content as Any), ("sendMessage", self.sendMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInlineResult", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("type", ConstructorParameterDescription(self.type)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("url", ConstructorParameterDescription(self.url)), ("thumb", ConstructorParameterDescription(self.thumb)), ("content", ConstructorParameterDescription(self.content)), ("sendMessage", ConstructorParameterDescription(self.sendMessage))]) } } case botInlineMediaResult(Cons_botInlineMediaResult) @@ -1051,12 +1051,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botInlineMediaResult(let _data): - return ("botInlineMediaResult", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("photo", _data.photo as Any), ("document", _data.document as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("sendMessage", _data.sendMessage as Any)]) + return ("botInlineMediaResult", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("type", ConstructorParameterDescription(_data.type)), ("photo", ConstructorParameterDescription(_data.photo)), ("document", ConstructorParameterDescription(_data.document)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))]) case .botInlineResult(let _data): - return ("botInlineResult", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("url", _data.url as Any), ("thumb", _data.thumb as Any), ("content", _data.content as Any), ("sendMessage", _data.sendMessage as Any)]) + return ("botInlineResult", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("type", ConstructorParameterDescription(_data.type)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("url", ConstructorParameterDescription(_data.url)), ("thumb", ConstructorParameterDescription(_data.thumb)), ("content", ConstructorParameterDescription(_data.content)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))]) } } @@ -1168,8 +1168,8 @@ public extension Api { self.text = text self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botMenuButton", [("text", self.text as Any), ("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botMenuButton", [("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url))]) } } case botMenuButton(Cons_botMenuButton) @@ -1198,10 +1198,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botMenuButton(let _data): - return ("botMenuButton", [("text", _data.text as Any), ("url", _data.url as Any)]) + return ("botMenuButton", [("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) case .botMenuButtonCommands: return ("botMenuButtonCommands", []) case .botMenuButtonDefault: @@ -1240,8 +1240,8 @@ public extension Api { self.date = date self.media = media } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botPreviewMedia", [("date", self.date as Any), ("media", self.media as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botPreviewMedia", [("date", ConstructorParameterDescription(self.date)), ("media", ConstructorParameterDescription(self.media))]) } } case botPreviewMedia(Cons_botPreviewMedia) @@ -1258,10 +1258,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botPreviewMedia(let _data): - return ("botPreviewMedia", [("date", _data.date as Any), ("media", _data.media as Any)]) + return ("botPreviewMedia", [("date", ConstructorParameterDescription(_data.date)), ("media", ConstructorParameterDescription(_data.media))]) } } @@ -1294,8 +1294,8 @@ public extension Api { self.icon = icon self.description = description } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botVerification", [("botId", self.botId as Any), ("icon", self.icon as Any), ("description", self.description as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botVerification", [("botId", ConstructorParameterDescription(self.botId)), ("icon", ConstructorParameterDescription(self.icon)), ("description", ConstructorParameterDescription(self.description))]) } } case botVerification(Cons_botVerification) @@ -1313,10 +1313,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botVerification(let _data): - return ("botVerification", [("botId", _data.botId as Any), ("icon", _data.icon as Any), ("description", _data.description as Any)]) + return ("botVerification", [("botId", ConstructorParameterDescription(_data.botId)), ("icon", ConstructorParameterDescription(_data.icon)), ("description", ConstructorParameterDescription(_data.description))]) } } @@ -1352,8 +1352,8 @@ public extension Api { self.company = company self.customDescription = customDescription } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botVerifierSettings", [("flags", self.flags as Any), ("icon", self.icon as Any), ("company", self.company as Any), ("customDescription", self.customDescription as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botVerifierSettings", [("flags", ConstructorParameterDescription(self.flags)), ("icon", ConstructorParameterDescription(self.icon)), ("company", ConstructorParameterDescription(self.company)), ("customDescription", ConstructorParameterDescription(self.customDescription))]) } } case botVerifierSettings(Cons_botVerifierSettings) @@ -1374,10 +1374,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botVerifierSettings(let _data): - return ("botVerifierSettings", [("flags", _data.flags as Any), ("icon", _data.icon as Any), ("company", _data.company as Any), ("customDescription", _data.customDescription as Any)]) + return ("botVerifierSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("icon", ConstructorParameterDescription(_data.icon)), ("company", ConstructorParameterDescription(_data.company)), ("customDescription", ConstructorParameterDescription(_data.customDescription))]) } } @@ -1418,8 +1418,8 @@ public extension Api { self.schedule = schedule self.recipients = recipients } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessAwayMessage", [("flags", self.flags as Any), ("shortcutId", self.shortcutId as Any), ("schedule", self.schedule as Any), ("recipients", self.recipients as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessAwayMessage", [("flags", ConstructorParameterDescription(self.flags)), ("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("schedule", ConstructorParameterDescription(self.schedule)), ("recipients", ConstructorParameterDescription(self.recipients))]) } } case businessAwayMessage(Cons_businessAwayMessage) @@ -1438,10 +1438,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessAwayMessage(let _data): - return ("businessAwayMessage", [("flags", _data.flags as Any), ("shortcutId", _data.shortcutId as Any), ("schedule", _data.schedule as Any), ("recipients", _data.recipients as Any)]) + return ("businessAwayMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("schedule", ConstructorParameterDescription(_data.schedule)), ("recipients", ConstructorParameterDescription(_data.recipients))]) } } @@ -1480,8 +1480,8 @@ public extension Api { self.startDate = startDate self.endDate = endDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessAwayMessageScheduleCustom", [("startDate", self.startDate as Any), ("endDate", self.endDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessAwayMessageScheduleCustom", [("startDate", ConstructorParameterDescription(self.startDate)), ("endDate", ConstructorParameterDescription(self.endDate))]) } } case businessAwayMessageScheduleAlways @@ -1510,12 +1510,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessAwayMessageScheduleAlways: return ("businessAwayMessageScheduleAlways", []) case .businessAwayMessageScheduleCustom(let _data): - return ("businessAwayMessageScheduleCustom", [("startDate", _data.startDate as Any), ("endDate", _data.endDate as Any)]) + return ("businessAwayMessageScheduleCustom", [("startDate", ConstructorParameterDescription(_data.startDate)), ("endDate", ConstructorParameterDescription(_data.endDate))]) case .businessAwayMessageScheduleOutsideWorkHours: return ("businessAwayMessageScheduleOutsideWorkHours", []) } @@ -1554,8 +1554,8 @@ public extension Api { self.users = users self.excludeUsers = excludeUsers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessBotRecipients", [("flags", self.flags as Any), ("users", self.users as Any), ("excludeUsers", self.excludeUsers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessBotRecipients", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("excludeUsers", ConstructorParameterDescription(self.excludeUsers))]) } } case businessBotRecipients(Cons_businessBotRecipients) @@ -1585,10 +1585,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessBotRecipients(let _data): - return ("businessBotRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any), ("excludeUsers", _data.excludeUsers as Any)]) + return ("businessBotRecipients", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("excludeUsers", ConstructorParameterDescription(_data.excludeUsers))]) } } @@ -1626,8 +1626,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessBotRights", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessBotRights", [("flags", ConstructorParameterDescription(self.flags))]) } } case businessBotRights(Cons_businessBotRights) @@ -1643,10 +1643,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessBotRights(let _data): - return ("businessBotRights", [("flags", _data.flags as Any)]) + return ("businessBotRights", [("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -1680,8 +1680,8 @@ public extension Api { self.title = title self.views = views } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessChatLink", [("flags", self.flags as Any), ("link", self.link as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("title", self.title as Any), ("views", self.views as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessChatLink", [("flags", ConstructorParameterDescription(self.flags)), ("link", ConstructorParameterDescription(self.link)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("title", ConstructorParameterDescription(self.title)), ("views", ConstructorParameterDescription(self.views))]) } } case businessChatLink(Cons_businessChatLink) @@ -1710,10 +1710,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessChatLink(let _data): - return ("businessChatLink", [("flags", _data.flags as Any), ("link", _data.link as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("title", _data.title as Any), ("views", _data.views as Any)]) + return ("businessChatLink", [("flags", ConstructorParameterDescription(_data.flags)), ("link", ConstructorParameterDescription(_data.link)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("title", ConstructorParameterDescription(_data.title)), ("views", ConstructorParameterDescription(_data.views))]) } } diff --git a/submodules/TelegramApi/Sources/Api20.swift b/submodules/TelegramApi/Sources/Api20.swift index b942087475..5b522e41e1 100644 --- a/submodules/TelegramApi/Sources/Api20.swift +++ b/submodules/TelegramApi/Sources/Api20.swift @@ -1,436 +1,3 @@ -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, Any)]) { - return ("phoneCall", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("date", self.date as Any), ("adminId", self.adminId as Any), ("participantId", self.participantId as Any), ("gAOrB", self.gAOrB as Any), ("keyFingerprint", self.keyFingerprint as Any), ("`protocol`", self.`protocol` as Any), ("connections", self.connections as Any), ("startDate", self.startDate as Any), ("customParameters", self.customParameters as Any)]) - } - } - 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, Any)]) { - return ("phoneCallAccepted", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("date", self.date as Any), ("adminId", self.adminId as Any), ("participantId", self.participantId as Any), ("gB", self.gB as Any), ("`protocol`", self.`protocol` as Any)]) - } - } - 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, Any)]) { - return ("phoneCallDiscarded", [("flags", self.flags as Any), ("id", self.id as Any), ("reason", self.reason as Any), ("duration", self.duration as Any)]) - } - } - public class Cons_phoneCallEmpty: TypeConstructorDescription { - public var id: Int64 - public init(id: Int64) { - self.id = id - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("phoneCallEmpty", [("id", self.id as Any)]) - } - } - 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, Any)]) { - return ("phoneCallRequested", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("date", self.date as Any), ("adminId", self.adminId as Any), ("participantId", self.participantId as Any), ("gAHash", self.gAHash as Any), ("`protocol`", self.`protocol` as Any)]) - } - } - 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, Any)]) { - return ("phoneCallWaiting", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("date", self.date as Any), ("adminId", self.adminId as Any), ("participantId", self.participantId as Any), ("`protocol`", self.`protocol` as Any), ("receiveDate", self.receiveDate as Any)]) - } - } - case phoneCall(Cons_phoneCall) - case phoneCallAccepted(Cons_phoneCallAccepted) - case phoneCallDiscarded(Cons_phoneCallDiscarded) - case phoneCallEmpty(Cons_phoneCallEmpty) - case phoneCallRequested(Cons_phoneCallRequested) - case phoneCallWaiting(Cons_phoneCallWaiting) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .phoneCall(let _data): - if boxed { - buffer.appendInt32(810769141) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt64(_data.accessHash, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt64(_data.adminId, buffer: buffer, boxed: false) - serializeInt64(_data.participantId, buffer: buffer, boxed: false) - serializeBytes(_data.gAOrB, buffer: buffer, boxed: false) - serializeInt64(_data.keyFingerprint, buffer: buffer, boxed: false) - _data.`protocol`.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.connections.count)) - for item in _data.connections { - item.serialize(buffer, true) - } - serializeInt32(_data.startDate, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 7) != 0 { - _data.customParameters!.serialize(buffer, true) - } - break - case .phoneCallAccepted(let _data): - if boxed { - buffer.appendInt32(912311057) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt64(_data.accessHash, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt64(_data.adminId, buffer: buffer, boxed: false) - serializeInt64(_data.participantId, buffer: buffer, boxed: false) - serializeBytes(_data.gB, buffer: buffer, boxed: false) - _data.`protocol`.serialize(buffer, true) - break - case .phoneCallDiscarded(let _data): - if boxed { - buffer.appendInt32(1355435489) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.id, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.reason!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.duration!, buffer: buffer, boxed: false) - } - break - case .phoneCallEmpty(let _data): - if boxed { - buffer.appendInt32(1399245077) - } - serializeInt64(_data.id, buffer: buffer, boxed: false) - break - case .phoneCallRequested(let _data): - if boxed { - buffer.appendInt32(347139340) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt64(_data.accessHash, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt64(_data.adminId, buffer: buffer, boxed: false) - serializeInt64(_data.participantId, buffer: buffer, boxed: false) - serializeBytes(_data.gAHash, buffer: buffer, boxed: false) - _data.`protocol`.serialize(buffer, true) - break - case .phoneCallWaiting(let _data): - if boxed { - buffer.appendInt32(-987599081) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt64(_data.accessHash, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt64(_data.adminId, buffer: buffer, boxed: false) - serializeInt64(_data.participantId, buffer: buffer, boxed: false) - _data.`protocol`.serialize(buffer, true) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeInt32(_data.receiveDate!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .phoneCall(let _data): - return ("phoneCall", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gAOrB", _data.gAOrB as Any), ("keyFingerprint", _data.keyFingerprint as Any), ("`protocol`", _data.`protocol` as Any), ("connections", _data.connections as Any), ("startDate", _data.startDate as Any), ("customParameters", _data.customParameters as Any)]) - case .phoneCallAccepted(let _data): - return ("phoneCallAccepted", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gB", _data.gB as Any), ("`protocol`", _data.`protocol` as Any)]) - case .phoneCallDiscarded(let _data): - return ("phoneCallDiscarded", [("flags", _data.flags as Any), ("id", _data.id as Any), ("reason", _data.reason as Any), ("duration", _data.duration as Any)]) - case .phoneCallEmpty(let _data): - return ("phoneCallEmpty", [("id", _data.id as Any)]) - case .phoneCallRequested(let _data): - return ("phoneCallRequested", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gAHash", _data.gAHash as Any), ("`protocol`", _data.`protocol` as Any)]) - case .phoneCallWaiting(let _data): - return ("phoneCallWaiting", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("`protocol`", _data.`protocol` as Any), ("receiveDate", _data.receiveDate as Any)]) - } - } - - public static func parse_phoneCall(_ reader: BufferReader) -> PhoneCall? { - var _1: Int32? - _1 = reader.readInt32() - 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!) & 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!) & 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!) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.PhoneCallDiscardReason - } - } - var _4: Int32? - if Int(_1!) & Int(1 << 1) != 0 { - _4 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.PhoneCall.phoneCallDiscarded(Cons_phoneCallDiscarded(flags: _1!, id: _2!, reason: _3, duration: _4)) - } - else { - return nil - } - } - 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_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_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!) & 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!) & 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 - } - } - } -} public extension Api { enum PhoneCallDiscardReason: TypeConstructorDescription { public class Cons_phoneCallDiscardReasonMigrateConferenceCall: TypeConstructorDescription { @@ -438,8 +5,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", ConstructorParameterDescription(self.slug))]) } } case phoneCallDiscardReasonBusy @@ -479,7 +46,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .phoneCallDiscardReasonBusy: return ("phoneCallDiscardReasonBusy", []) @@ -488,7 +55,7 @@ public extension Api { case .phoneCallDiscardReasonHangup: return ("phoneCallDiscardReasonHangup", []) case .phoneCallDiscardReasonMigrateConferenceCall(let _data): - return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", _data.slug as Any)]) + return ("phoneCallDiscardReasonMigrateConferenceCall", [("slug", ConstructorParameterDescription(_data.slug))]) case .phoneCallDiscardReasonMissed: return ("phoneCallDiscardReasonMissed", []) } @@ -532,8 +99,8 @@ public extension Api { self.maxLayer = maxLayer self.libraryVersions = libraryVersions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("phoneCallProtocol", [("flags", self.flags as Any), ("minLayer", self.minLayer as Any), ("maxLayer", self.maxLayer as Any), ("libraryVersions", self.libraryVersions as Any)]) + 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) @@ -556,10 +123,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .phoneCallProtocol(let _data): - return ("phoneCallProtocol", [("flags", _data.flags as Any), ("minLayer", _data.minLayer as Any), ("maxLayer", _data.maxLayer as Any), ("libraryVersions", _data.libraryVersions as Any)]) + return ("phoneCallProtocol", [("flags", ConstructorParameterDescription(_data.flags)), ("minLayer", ConstructorParameterDescription(_data.minLayer)), ("maxLayer", ConstructorParameterDescription(_data.maxLayer)), ("libraryVersions", ConstructorParameterDescription(_data.libraryVersions))]) } } @@ -604,8 +171,8 @@ public extension Api { self.port = port self.peerTag = peerTag } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("phoneConnection", [("flags", self.flags as Any), ("id", self.id as Any), ("ip", self.ip as Any), ("ipv6", self.ipv6 as Any), ("port", self.port as Any), ("peerTag", self.peerTag as Any)]) + 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))]) } } public class Cons_phoneConnectionWebrtc: TypeConstructorDescription { @@ -625,8 +192,8 @@ public extension Api { self.username = username self.password = password } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("phoneConnectionWebrtc", [("flags", self.flags as Any), ("id", self.id as Any), ("ip", self.ip as Any), ("ipv6", self.ipv6 as Any), ("port", self.port as Any), ("username", self.username as Any), ("password", self.password as Any)]) + 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) @@ -660,12 +227,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .phoneConnection(let _data): - return ("phoneConnection", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ip", _data.ip as Any), ("ipv6", _data.ipv6 as Any), ("port", _data.port as Any), ("peerTag", _data.peerTag as Any)]) + 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", _data.flags as Any), ("id", _data.id as Any), ("ip", _data.ip as Any), ("ipv6", _data.ipv6 as Any), ("port", _data.port as Any), ("username", _data.username as Any), ("password", _data.password as Any)]) + 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))]) } } @@ -747,8 +314,8 @@ public extension Api { self.videoSizes = videoSizes self.dcId = dcId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photo", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("fileReference", self.fileReference as Any), ("date", self.date as Any), ("sizes", self.sizes as Any), ("videoSizes", self.videoSizes as Any), ("dcId", self.dcId as Any)]) + 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 { @@ -756,8 +323,8 @@ public extension Api { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photoEmpty", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoEmpty", [("id", ConstructorParameterDescription(self.id))]) } } case photo(Cons_photo) @@ -797,12 +364,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .photo(let _data): - return ("photo", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("date", _data.date as Any), ("sizes", _data.sizes as Any), ("videoSizes", _data.videoSizes as Any), ("dcId", _data.dcId as Any)]) + 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", _data.id as Any)]) + return ("photoEmpty", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -870,8 +437,8 @@ public extension Api { self.h = h self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photoCachedSize", [("type", self.type as Any), ("w", self.w as Any), ("h", self.h as Any), ("bytes", self.bytes as Any)]) + 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 { @@ -881,8 +448,8 @@ public extension Api { self.type = type self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photoPathSize", [("type", self.type as Any), ("bytes", self.bytes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoPathSize", [("type", ConstructorParameterDescription(self.type)), ("bytes", ConstructorParameterDescription(self.bytes))]) } } public class Cons_photoSize: TypeConstructorDescription { @@ -896,8 +463,8 @@ public extension Api { self.h = h self.size = size } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photoSize", [("type", self.type as Any), ("w", self.w as Any), ("h", self.h as Any), ("size", self.size as Any)]) + 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 { @@ -905,8 +472,8 @@ public extension Api { public init(type: String) { self.type = type } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photoSizeEmpty", [("type", self.type as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoSizeEmpty", [("type", ConstructorParameterDescription(self.type))]) } } public class Cons_photoSizeProgressive: TypeConstructorDescription { @@ -920,8 +487,8 @@ public extension Api { self.h = h self.sizes = sizes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photoSizeProgressive", [("type", self.type as Any), ("w", self.w as Any), ("h", self.h as Any), ("sizes", self.sizes as Any)]) + 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 { @@ -931,8 +498,8 @@ public extension Api { self.type = type self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photoStrippedSize", [("type", self.type as Any), ("bytes", self.bytes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photoStrippedSize", [("type", ConstructorParameterDescription(self.type)), ("bytes", ConstructorParameterDescription(self.bytes))]) } } case photoCachedSize(Cons_photoCachedSize) @@ -998,20 +565,20 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .photoCachedSize(let _data): - return ("photoCachedSize", [("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("bytes", _data.bytes as Any)]) + 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", _data.type as Any), ("bytes", _data.bytes as Any)]) + return ("photoPathSize", [("type", ConstructorParameterDescription(_data.type)), ("bytes", ConstructorParameterDescription(_data.bytes))]) case .photoSize(let _data): - return ("photoSize", [("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("size", _data.size as Any)]) + 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", _data.type as Any)]) + return ("photoSizeEmpty", [("type", ConstructorParameterDescription(_data.type))]) case .photoSizeProgressive(let _data): - return ("photoSizeProgressive", [("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("sizes", _data.sizes as Any)]) + 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", _data.type as Any), ("bytes", _data.bytes as Any)]) + return ("photoStrippedSize", [("type", ConstructorParameterDescription(_data.type)), ("bytes", ConstructorParameterDescription(_data.bytes))]) } } @@ -1137,8 +704,8 @@ public extension Api { self.closeDate = closeDate self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("poll", [("id", self.id as Any), ("flags", self.flags as Any), ("question", self.question as Any), ("answers", self.answers as Any), ("closePeriod", self.closePeriod as Any), ("closeDate", self.closeDate as Any), ("hash", self.hash as Any)]) + 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)), ("hash", ConstructorParameterDescription(self.hash))]) } } case poll(Cons_poll) @@ -1168,10 +735,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .poll(let _data): - return ("poll", [("id", _data.id as Any), ("flags", _data.flags as Any), ("question", _data.question as Any), ("answers", _data.answers as Any), ("closePeriod", _data.closePeriod as Any), ("closeDate", _data.closeDate as Any), ("hash", _data.hash as Any)]) + 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)), ("hash", ConstructorParameterDescription(_data.hash))]) } } @@ -1225,8 +792,8 @@ public extension Api { self.text = text self.media = media } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPollAnswer", [("flags", self.flags as Any), ("text", self.text as Any), ("media", self.media as Any)]) + 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 { @@ -1244,8 +811,8 @@ public extension Api { self.addedBy = addedBy self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pollAnswer", [("flags", self.flags as Any), ("text", self.text as Any), ("option", self.option as Any), ("media", self.media as Any), ("addedBy", self.addedBy as Any), ("date", self.date as Any)]) + 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) @@ -1283,12 +850,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPollAnswer(let _data): - return ("inputPollAnswer", [("flags", _data.flags as Any), ("text", _data.text as Any), ("media", _data.media as Any)]) + return ("inputPollAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("media", ConstructorParameterDescription(_data.media))]) case .pollAnswer(let _data): - return ("pollAnswer", [("flags", _data.flags as Any), ("text", _data.text as Any), ("option", _data.option as Any), ("media", _data.media as Any), ("addedBy", _data.addedBy as Any), ("date", _data.date as Any)]) + 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))]) } } @@ -1368,8 +935,8 @@ public extension Api { self.voters = voters self.recentVoters = recentVoters } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pollAnswerVoters", [("flags", self.flags as Any), ("option", self.option as Any), ("voters", self.voters as Any), ("recentVoters", self.recentVoters as Any)]) + 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) @@ -1396,10 +963,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pollAnswerVoters(let _data): - return ("pollAnswerVoters", [("flags", _data.flags as Any), ("option", _data.option as Any), ("voters", _data.voters as Any), ("recentVoters", _data.recentVoters as Any)]) + return ("pollAnswerVoters", [("flags", ConstructorParameterDescription(_data.flags)), ("option", ConstructorParameterDescription(_data.option)), ("voters", ConstructorParameterDescription(_data.voters)), ("recentVoters", ConstructorParameterDescription(_data.recentVoters))]) } } @@ -1450,8 +1017,8 @@ public extension Api { self.solutionEntities = solutionEntities self.solutionMedia = solutionMedia } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("pollResults", [("flags", self.flags as Any), ("results", self.results as Any), ("totalVoters", self.totalVoters as Any), ("recentVoters", self.recentVoters as Any), ("solution", self.solution as Any), ("solutionEntities", self.solutionEntities as Any), ("solutionMedia", self.solutionMedia as Any)]) + 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) @@ -1497,10 +1064,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .pollResults(let _data): - return ("pollResults", [("flags", _data.flags as Any), ("results", _data.results as Any), ("totalVoters", _data.totalVoters as Any), ("recentVoters", _data.recentVoters as Any), ("solution", _data.solution as Any), ("solutionEntities", _data.solutionEntities as Any), ("solutionMedia", _data.solutionMedia as Any)]) + 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))]) } } @@ -1564,8 +1131,8 @@ public extension Api { self.clientId = clientId self.importers = importers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("popularContact", [("clientId", self.clientId as Any), ("importers", self.importers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("popularContact", [("clientId", ConstructorParameterDescription(self.clientId)), ("importers", ConstructorParameterDescription(self.importers))]) } } case popularContact(Cons_popularContact) @@ -1582,10 +1149,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .popularContact(let _data): - return ("popularContact", [("clientId", _data.clientId as Any), ("importers", _data.importers as Any)]) + return ("popularContact", [("clientId", ConstructorParameterDescription(_data.clientId)), ("importers", ConstructorParameterDescription(_data.importers))]) } } @@ -1622,8 +1189,8 @@ public extension Api { self.countryIso2 = countryIso2 self.postCode = postCode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("postAddress", [("streetLine1", self.streetLine1 as Any), ("streetLine2", self.streetLine2 as Any), ("city", self.city as Any), ("state", self.state as Any), ("countryIso2", self.countryIso2 as Any), ("postCode", self.postCode as Any)]) + 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) @@ -1644,10 +1211,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .postAddress(let _data): - return ("postAddress", [("streetLine1", _data.streetLine1 as Any), ("streetLine2", _data.streetLine2 as Any), ("city", _data.city as Any), ("state", _data.state as Any), ("countryIso2", _data.countryIso2 as Any), ("postCode", _data.postCode as Any)]) + 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))]) } } @@ -1692,8 +1259,8 @@ public extension Api { self.forwards = forwards self.reactions = reactions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("postInteractionCountersMessage", [("msgId", self.msgId as Any), ("views", self.views as Any), ("forwards", self.forwards as Any), ("reactions", self.reactions as Any)]) + 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 { @@ -1707,8 +1274,8 @@ public extension Api { self.forwards = forwards self.reactions = reactions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("postInteractionCountersStory", [("storyId", self.storyId as Any), ("views", self.views as Any), ("forwards", self.forwards as Any), ("reactions", self.reactions as Any)]) + 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) @@ -1737,12 +1304,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .postInteractionCountersMessage(let _data): - return ("postInteractionCountersMessage", [("msgId", _data.msgId as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("reactions", _data.reactions as Any)]) + 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", _data.storyId as Any), ("views", _data.views as Any), ("forwards", _data.forwards as Any), ("reactions", _data.reactions as Any)]) + return ("postInteractionCountersStory", [("storyId", ConstructorParameterDescription(_data.storyId)), ("views", ConstructorParameterDescription(_data.views)), ("forwards", ConstructorParameterDescription(_data.forwards)), ("reactions", ConstructorParameterDescription(_data.reactions))]) } } @@ -1807,8 +1374,8 @@ public extension Api { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("premiumGiftCodeOption", [("flags", self.flags as Any), ("users", self.users as Any), ("months", self.months as Any), ("storeProduct", self.storeProduct as Any), ("storeQuantity", self.storeQuantity as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + 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) @@ -1834,10 +1401,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .premiumGiftCodeOption(let _data): - return ("premiumGiftCodeOption", [("flags", _data.flags as Any), ("users", _data.users as Any), ("months", _data.months as Any), ("storeProduct", _data.storeProduct as Any), ("storeQuantity", _data.storeQuantity as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + 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))]) } } @@ -1876,3 +1443,375 @@ public extension Api { } } } +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!) & 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!) & Int(1 << 0) != 0 { + _7 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = _5 != nil + let _c6 = _6 != nil + let _c7 = (Int(_1!) & Int(1 << 0) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.PremiumSubscriptionOption.premiumSubscriptionOption(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/Api21.swift b/submodules/TelegramApi/Sources/Api21.swift index 9a931a098c..a14d943b32 100644 --- a/submodules/TelegramApi/Sources/Api21.swift +++ b/submodules/TelegramApi/Sources/Api21.swift @@ -1,375 +1,3 @@ -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, Any)]) { - return ("premiumSubscriptionOption", [("flags", self.flags as Any), ("transaction", self.transaction as Any), ("months", self.months as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("botUrl", self.botUrl as Any), ("storeProduct", self.storeProduct as Any)]) - } - } - case premiumSubscriptionOption(Cons_premiumSubscriptionOption) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .premiumSubscriptionOption(let _data): - if boxed { - buffer.appendInt32(1596792306) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 3) != 0 { - serializeString(_data.transaction!, buffer: buffer, boxed: false) - } - serializeInt32(_data.months, buffer: buffer, boxed: false) - serializeString(_data.currency, buffer: buffer, boxed: false) - serializeInt64(_data.amount, buffer: buffer, boxed: false) - serializeString(_data.botUrl, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.storeProduct!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .premiumSubscriptionOption(let _data): - return ("premiumSubscriptionOption", [("flags", _data.flags as Any), ("transaction", _data.transaction as Any), ("months", _data.months as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("botUrl", _data.botUrl as Any), ("storeProduct", _data.storeProduct as Any)]) - } - } - - public static func parse_premiumSubscriptionOption(_ reader: BufferReader) -> PremiumSubscriptionOption? { - var _1: Int32? - _1 = reader.readInt32() - var _2: String? - if Int(_1!) & Int(1 << 3) != 0 { - _2 = parseString(reader) - } - 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!) & Int(1 << 0) != 0 { - _7 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = _5 != nil - let _c6 = _6 != nil - let _c7 = (Int(_1!) & Int(1 << 0) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.PremiumSubscriptionOption.premiumSubscriptionOption(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, Any)]) { - return ("prepaidGiveaway", [("id", self.id as Any), ("months", self.months as Any), ("quantity", self.quantity as Any), ("date", self.date as Any)]) - } - } - 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, Any)]) { - return ("prepaidStarsGiveaway", [("id", self.id as Any), ("stars", self.stars as Any), ("quantity", self.quantity as Any), ("boosts", self.boosts as Any), ("date", self.date as Any)]) - } - } - case prepaidGiveaway(Cons_prepaidGiveaway) - case prepaidStarsGiveaway(Cons_prepaidStarsGiveaway) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .prepaidGiveaway(let _data): - if boxed { - buffer.appendInt32(-1303143084) - } - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt32(_data.months, buffer: buffer, boxed: false) - serializeInt32(_data.quantity, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - break - case .prepaidStarsGiveaway(let _data): - if boxed { - buffer.appendInt32(-1700956192) - } - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt64(_data.stars, buffer: buffer, boxed: false) - serializeInt32(_data.quantity, buffer: buffer, boxed: false) - serializeInt32(_data.boosts, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .prepaidGiveaway(let _data): - return ("prepaidGiveaway", [("id", _data.id as Any), ("months", _data.months as Any), ("quantity", _data.quantity as Any), ("date", _data.date as Any)]) - case .prepaidStarsGiveaway(let _data): - return ("prepaidStarsGiveaway", [("id", _data.id as Any), ("stars", _data.stars as Any), ("quantity", _data.quantity as Any), ("boosts", _data.boosts as Any), ("date", _data.date as Any)]) - } - } - - public static func parse_prepaidGiveaway(_ reader: BufferReader) -> PrepaidGiveaway? { - var _1: Int64? - _1 = reader.readInt64() - 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, Any)]) { - 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 - } - } -} public extension Api { enum PrivacyRule: TypeConstructorDescription { public class Cons_privacyValueAllowChatParticipants: TypeConstructorDescription { @@ -377,8 +5,8 @@ public extension Api { public init(chats: [Int64]) { self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("privacyValueAllowChatParticipants", [("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) } } public class Cons_privacyValueAllowUsers: TypeConstructorDescription { @@ -386,8 +14,8 @@ public extension Api { public init(users: [Int64]) { self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("privacyValueAllowUsers", [("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyValueAllowUsers", [("users", ConstructorParameterDescription(self.users))]) } } public class Cons_privacyValueDisallowChatParticipants: TypeConstructorDescription { @@ -395,8 +23,8 @@ public extension Api { public init(chats: [Int64]) { self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("privacyValueDisallowChatParticipants", [("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(self.chats))]) } } public class Cons_privacyValueDisallowUsers: TypeConstructorDescription { @@ -404,8 +32,8 @@ public extension Api { public init(users: [Int64]) { self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("privacyValueDisallowUsers", [("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyValueDisallowUsers", [("users", ConstructorParameterDescription(self.users))]) } } case privacyValueAllowAll @@ -506,14 +134,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .privacyValueAllowAll: return ("privacyValueAllowAll", []) case .privacyValueAllowBots: return ("privacyValueAllowBots", []) case .privacyValueAllowChatParticipants(let _data): - return ("privacyValueAllowChatParticipants", [("chats", _data.chats as Any)]) + return ("privacyValueAllowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) case .privacyValueAllowCloseFriends: return ("privacyValueAllowCloseFriends", []) case .privacyValueAllowContacts: @@ -521,17 +149,17 @@ public extension Api { case .privacyValueAllowPremium: return ("privacyValueAllowPremium", []) case .privacyValueAllowUsers(let _data): - return ("privacyValueAllowUsers", [("users", _data.users as Any)]) + return ("privacyValueAllowUsers", [("users", ConstructorParameterDescription(_data.users))]) case .privacyValueDisallowAll: return ("privacyValueDisallowAll", []) case .privacyValueDisallowBots: return ("privacyValueDisallowBots", []) case .privacyValueDisallowChatParticipants(let _data): - return ("privacyValueDisallowChatParticipants", [("chats", _data.chats as Any)]) + return ("privacyValueDisallowChatParticipants", [("chats", ConstructorParameterDescription(_data.chats))]) case .privacyValueDisallowContacts: return ("privacyValueDisallowContacts", []) case .privacyValueDisallowUsers(let _data): - return ("privacyValueDisallowUsers", [("users", _data.users as Any)]) + return ("privacyValueDisallowUsers", [("users", ConstructorParameterDescription(_data.users))]) } } @@ -669,7 +297,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .profileTabFiles: return ("profileTabFiles", []) @@ -716,3 +344,496 @@ public extension Api { } } } +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!) & 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!) & 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!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom + } + } + var _3: Api.ReactionNotificationsFrom? + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom + } + } + var _4: Api.ReactionNotificationsFrom? + if Int(_1!) & 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!) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil + let _c5 = _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.ReadParticipantDate.readParticipantDate(Cons_readParticipantDate(userId: _1!, date: _2!)) + } + else { + return nil + } + } + } +} diff --git a/submodules/TelegramApi/Sources/Api22.swift b/submodules/TelegramApi/Sources/Api22.swift index c81b187cd0..200a882362 100644 --- a/submodules/TelegramApi/Sources/Api22.swift +++ b/submodules/TelegramApi/Sources/Api22.swift @@ -1,496 +1,3 @@ -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, Any)]) { - return ("publicForwardMessage", [("message", self.message as Any)]) - } - } - 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, Any)]) { - return ("publicForwardStory", [("peer", self.peer as Any), ("story", self.story as Any)]) - } - } - case publicForwardMessage(Cons_publicForwardMessage) - case publicForwardStory(Cons_publicForwardStory) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .publicForwardMessage(let _data): - if boxed { - buffer.appendInt32(32685898) - } - _data.message.serialize(buffer, true) - break - case .publicForwardStory(let _data): - if boxed { - buffer.appendInt32(-302797360) - } - _data.peer.serialize(buffer, true) - _data.story.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .publicForwardMessage(let _data): - return ("publicForwardMessage", [("message", _data.message as Any)]) - case .publicForwardStory(let _data): - return ("publicForwardStory", [("peer", _data.peer as Any), ("story", _data.story as Any)]) - } - } - - public static func parse_publicForwardMessage(_ reader: BufferReader) -> PublicForward? { - var _1: Api.Message? - if let signature = reader.readInt32() { - _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, Any)]) { - return ("quickReply", [("shortcutId", self.shortcutId as Any), ("shortcut", self.shortcut as Any), ("topMessage", self.topMessage as Any), ("count", self.count as Any)]) - } - } - case quickReply(Cons_quickReply) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .quickReply(let _data): - if boxed { - buffer.appendInt32(110563371) - } - serializeInt32(_data.shortcutId, buffer: buffer, boxed: false) - serializeString(_data.shortcut, buffer: buffer, boxed: false) - serializeInt32(_data.topMessage, buffer: buffer, boxed: false) - serializeInt32(_data.count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .quickReply(let _data): - return ("quickReply", [("shortcutId", _data.shortcutId as Any), ("shortcut", _data.shortcut as Any), ("topMessage", _data.topMessage as Any), ("count", _data.count as Any)]) - } - } - - public static func parse_quickReply(_ reader: BufferReader) -> QuickReply? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("reactionCustomEmoji", [("documentId", self.documentId as Any)]) - } - } - public class Cons_reactionEmoji: TypeConstructorDescription { - public var emoticon: String - public init(emoticon: String) { - self.emoticon = emoticon - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("reactionEmoji", [("emoticon", self.emoticon as Any)]) - } - } - 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, Any)]) { - switch self { - case .reactionCustomEmoji(let _data): - return ("reactionCustomEmoji", [("documentId", _data.documentId as Any)]) - case .reactionEmoji(let _data): - return ("reactionEmoji", [("emoticon", _data.emoticon as Any)]) - case .reactionEmpty: - return ("reactionEmpty", []) - case .reactionPaid: - 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, Any)]) { - return ("reactionCount", [("flags", self.flags as Any), ("chosenOrder", self.chosenOrder as Any), ("reaction", self.reaction as Any), ("count", self.count as Any)]) - } - } - case reactionCount(Cons_reactionCount) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .reactionCount(let _data): - if boxed { - buffer.appendInt32(-1546531968) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeInt32(_data.chosenOrder!, buffer: buffer, boxed: false) - } - _data.reaction.serialize(buffer, true) - serializeInt32(_data.count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .reactionCount(let _data): - return ("reactionCount", [("flags", _data.flags as Any), ("chosenOrder", _data.chosenOrder as Any), ("reaction", _data.reaction as Any), ("count", _data.count as Any)]) - } - } - - public static func parse_reactionCount(_ reader: BufferReader) -> ReactionCount? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - 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!) & 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, Any)]) { - 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, Any)]) { - return ("reactionsNotifySettings", [("flags", self.flags as Any), ("messagesNotifyFrom", self.messagesNotifyFrom as Any), ("storiesNotifyFrom", self.storiesNotifyFrom as Any), ("pollVotesNotifyFrom", self.pollVotesNotifyFrom as Any), ("sound", self.sound as Any), ("showPreviews", self.showPreviews as Any)]) - } - } - 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, Any)]) { - switch self { - case .reactionsNotifySettings(let _data): - return ("reactionsNotifySettings", [("flags", _data.flags as Any), ("messagesNotifyFrom", _data.messagesNotifyFrom as Any), ("storiesNotifyFrom", _data.storiesNotifyFrom as Any), ("pollVotesNotifyFrom", _data.pollVotesNotifyFrom as Any), ("sound", _data.sound as Any), ("showPreviews", _data.showPreviews as Any)]) - } - } - - public static func parse_reactionsNotifySettings(_ reader: BufferReader) -> ReactionsNotifySettings? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.ReactionNotificationsFrom? - if Int(_1!) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom - } - } - var _3: Api.ReactionNotificationsFrom? - if Int(_1!) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ReactionNotificationsFrom - } - } - var _4: Api.ReactionNotificationsFrom? - if Int(_1!) & 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!) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil - let _c5 = _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, Any)]) { - return ("readParticipantDate", [("userId", self.userId as Any), ("date", self.date as Any)]) - } - } - case readParticipantDate(Cons_readParticipantDate) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .readParticipantDate(let _data): - if boxed { - buffer.appendInt32(1246753138) - } - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .readParticipantDate(let _data): - return ("readParticipantDate", [("userId", _data.userId as Any), ("date", _data.date as Any)]) - } - } - - public static func parse_readParticipantDate(_ reader: BufferReader) -> ReadParticipantDate? { - var _1: Int64? - _1 = reader.readInt64() - var _2: Int32? - _2 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.ReadParticipantDate.readParticipantDate(Cons_readParticipantDate(userId: _1!, date: _2!)) - } - else { - return nil - } - } - } -} public extension Api { enum ReceivedNotifyMessage: TypeConstructorDescription { public class Cons_receivedNotifyMessage: TypeConstructorDescription { @@ -500,8 +7,8 @@ public extension Api { self.id = id self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("receivedNotifyMessage", [("id", self.id as Any), ("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("receivedNotifyMessage", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags))]) } } case receivedNotifyMessage(Cons_receivedNotifyMessage) @@ -518,10 +25,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .receivedNotifyMessage(let _data): - return ("receivedNotifyMessage", [("id", _data.id as Any), ("flags", _data.flags as Any)]) + return ("receivedNotifyMessage", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -550,8 +57,8 @@ public extension Api { self.url = url self.chatId = chatId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentMeUrlChat", [("url", self.url as Any), ("chatId", self.chatId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlChat", [("url", ConstructorParameterDescription(self.url)), ("chatId", ConstructorParameterDescription(self.chatId))]) } } public class Cons_recentMeUrlChatInvite: TypeConstructorDescription { @@ -561,8 +68,8 @@ public extension Api { self.url = url self.chatInvite = chatInvite } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentMeUrlChatInvite", [("url", self.url as Any), ("chatInvite", self.chatInvite as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlChatInvite", [("url", ConstructorParameterDescription(self.url)), ("chatInvite", ConstructorParameterDescription(self.chatInvite))]) } } public class Cons_recentMeUrlStickerSet: TypeConstructorDescription { @@ -572,8 +79,8 @@ public extension Api { self.url = url self.set = set } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentMeUrlStickerSet", [("url", self.url as Any), ("set", self.set as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlStickerSet", [("url", ConstructorParameterDescription(self.url)), ("set", ConstructorParameterDescription(self.set))]) } } public class Cons_recentMeUrlUnknown: TypeConstructorDescription { @@ -581,8 +88,8 @@ public extension Api { public init(url: String) { self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentMeUrlUnknown", [("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlUnknown", [("url", ConstructorParameterDescription(self.url))]) } } public class Cons_recentMeUrlUser: TypeConstructorDescription { @@ -592,8 +99,8 @@ public extension Api { self.url = url self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentMeUrlUser", [("url", self.url as Any), ("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrlUser", [("url", ConstructorParameterDescription(self.url)), ("userId", ConstructorParameterDescription(self.userId))]) } } case recentMeUrlChat(Cons_recentMeUrlChat) @@ -641,18 +148,18 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .recentMeUrlChat(let _data): - return ("recentMeUrlChat", [("url", _data.url as Any), ("chatId", _data.chatId as Any)]) + return ("recentMeUrlChat", [("url", ConstructorParameterDescription(_data.url)), ("chatId", ConstructorParameterDescription(_data.chatId))]) case .recentMeUrlChatInvite(let _data): - return ("recentMeUrlChatInvite", [("url", _data.url as Any), ("chatInvite", _data.chatInvite as Any)]) + return ("recentMeUrlChatInvite", [("url", ConstructorParameterDescription(_data.url)), ("chatInvite", ConstructorParameterDescription(_data.chatInvite))]) case .recentMeUrlStickerSet(let _data): - return ("recentMeUrlStickerSet", [("url", _data.url as Any), ("set", _data.set as Any)]) + return ("recentMeUrlStickerSet", [("url", ConstructorParameterDescription(_data.url)), ("set", ConstructorParameterDescription(_data.set))]) case .recentMeUrlUnknown(let _data): - return ("recentMeUrlUnknown", [("url", _data.url as Any)]) + return ("recentMeUrlUnknown", [("url", ConstructorParameterDescription(_data.url))]) case .recentMeUrlUser(let _data): - return ("recentMeUrlUser", [("url", _data.url as Any), ("userId", _data.userId as Any)]) + return ("recentMeUrlUser", [("url", ConstructorParameterDescription(_data.url)), ("userId", ConstructorParameterDescription(_data.userId))]) } } @@ -738,8 +245,8 @@ public extension Api { self.flags = flags self.maxId = maxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentStory", [("flags", self.flags as Any), ("maxId", self.maxId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentStory", [("flags", ConstructorParameterDescription(self.flags)), ("maxId", ConstructorParameterDescription(self.maxId))]) } } case recentStory(Cons_recentStory) @@ -758,10 +265,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .recentStory(let _data): - return ("recentStory", [("flags", _data.flags as Any), ("maxId", _data.maxId as Any)]) + return ("recentStory", [("flags", ConstructorParameterDescription(_data.flags)), ("maxId", ConstructorParameterDescription(_data.maxId))]) } } @@ -790,8 +297,8 @@ public extension Api { public init(rows: [Api.KeyboardButtonRow]) { self.rows = rows } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("replyInlineMarkup", [("rows", self.rows as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyInlineMarkup", [("rows", ConstructorParameterDescription(self.rows))]) } } public class Cons_replyKeyboardForceReply: TypeConstructorDescription { @@ -801,8 +308,8 @@ public extension Api { self.flags = flags self.placeholder = placeholder } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("replyKeyboardForceReply", [("flags", self.flags as Any), ("placeholder", self.placeholder as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyKeyboardForceReply", [("flags", ConstructorParameterDescription(self.flags)), ("placeholder", ConstructorParameterDescription(self.placeholder))]) } } public class Cons_replyKeyboardHide: TypeConstructorDescription { @@ -810,8 +317,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("replyKeyboardHide", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyKeyboardHide", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_replyKeyboardMarkup: TypeConstructorDescription { @@ -823,8 +330,8 @@ public extension Api { self.rows = rows self.placeholder = placeholder } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("replyKeyboardMarkup", [("flags", self.flags as Any), ("rows", self.rows as Any), ("placeholder", self.placeholder as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("replyKeyboardMarkup", [("flags", ConstructorParameterDescription(self.flags)), ("rows", ConstructorParameterDescription(self.rows)), ("placeholder", ConstructorParameterDescription(self.placeholder))]) } } case replyInlineMarkup(Cons_replyInlineMarkup) @@ -876,16 +383,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .replyInlineMarkup(let _data): - return ("replyInlineMarkup", [("rows", _data.rows as Any)]) + return ("replyInlineMarkup", [("rows", ConstructorParameterDescription(_data.rows))]) case .replyKeyboardForceReply(let _data): - return ("replyKeyboardForceReply", [("flags", _data.flags as Any), ("placeholder", _data.placeholder as Any)]) + return ("replyKeyboardForceReply", [("flags", ConstructorParameterDescription(_data.flags)), ("placeholder", ConstructorParameterDescription(_data.placeholder))]) case .replyKeyboardHide(let _data): - return ("replyKeyboardHide", [("flags", _data.flags as Any)]) + return ("replyKeyboardHide", [("flags", ConstructorParameterDescription(_data.flags))]) case .replyKeyboardMarkup(let _data): - return ("replyKeyboardMarkup", [("flags", _data.flags as Any), ("rows", _data.rows as Any), ("placeholder", _data.placeholder as Any)]) + return ("replyKeyboardMarkup", [("flags", ConstructorParameterDescription(_data.flags)), ("rows", ConstructorParameterDescription(_data.rows)), ("placeholder", ConstructorParameterDescription(_data.placeholder))]) } } @@ -1020,7 +527,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputReportReasonChildAbuse: return ("inputReportReasonChildAbuse", []) @@ -1077,3 +584,646 @@ public extension Api { } } } +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!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } + var _3: Api.ChatAdminRights? + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } + var _4: Api.ChatAdminRights? + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil + let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.RequestPeerType.requestPeerTypeBroadcast(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!) & Int(1 << 3) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } + var _3: Api.Bool? + if Int(_1!) & Int(1 << 4) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } + var _4: Api.ChatAdminRights? + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } + var _5: Api.ChatAdminRights? + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights + } + } + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil + let _c3 = (Int(_1!) & Int(1 << 4) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.RequestPeerType.requestPeerTypeChat(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!) & Int(1 << 1) != 0 { + _2 = parseString(reader) + } + var _3: String? + if Int(_1!) & Int(1 << 2) != 0 { + _3 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil + let _c3 = (Int(_1!) & 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!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Bool + } + } + var _3: Api.Bool? + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _3 = Api.parse(reader, signature: signature) as? Api.Bool + } + } + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.RequestPeerType.requestPeerTypeUser(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!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: String? + if Int(_1!) & Int(1 << 1) != 0 { + _4 = parseString(reader) + } + var _5: Api.Photo? + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Photo + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil + let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 { + return Api.RequestedPeer.requestedPeerChannel(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!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: Api.Photo? + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Photo + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil + if _c1 && _c2 && _c3 && _c4 { + return Api.RequestedPeer.requestedPeerChat(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!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + var _4: String? + if Int(_1!) & Int(1 << 0) != 0 { + _4 = parseString(reader) + } + var _5: String? + if Int(_1!) & Int(1 << 1) != 0 { + _5 = parseString(reader) + } + var _6: Api.Photo? + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Photo + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.RequestedPeer.requestedPeerUser(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 e4fadf4997..9e9f2b2b5c 100644 --- a/submodules/TelegramApi/Sources/Api23.swift +++ b/submodules/TelegramApi/Sources/Api23.swift @@ -1,646 +1,3 @@ -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, Any)]) { - return ("reportResultAddComment", [("flags", self.flags as Any), ("option", self.option as Any)]) - } - } - 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, Any)]) { - return ("reportResultChooseOption", [("title", self.title as Any), ("options", self.options as Any)]) - } - } - 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, Any)]) { - switch self { - case .reportResultAddComment(let _data): - return ("reportResultAddComment", [("flags", _data.flags as Any), ("option", _data.option as Any)]) - case .reportResultChooseOption(let _data): - return ("reportResultChooseOption", [("title", _data.title as Any), ("options", _data.options as Any)]) - case .reportResultReported: - return ("reportResultReported", []) - } - } - - public static func parse_reportResultAddComment(_ reader: BufferReader) -> ReportResult? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("requestPeerTypeBroadcast", [("flags", self.flags as Any), ("hasUsername", self.hasUsername as Any), ("userAdminRights", self.userAdminRights as Any), ("botAdminRights", self.botAdminRights as Any)]) - } - } - 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, Any)]) { - return ("requestPeerTypeChat", [("flags", self.flags as Any), ("hasUsername", self.hasUsername as Any), ("forum", self.forum as Any), ("userAdminRights", self.userAdminRights as Any), ("botAdminRights", self.botAdminRights as Any)]) - } - } - 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, Any)]) { - return ("requestPeerTypeCreateBot", [("flags", self.flags as Any), ("suggestedName", self.suggestedName as Any), ("suggestedUsername", self.suggestedUsername as Any)]) - } - } - 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, Any)]) { - return ("requestPeerTypeUser", [("flags", self.flags as Any), ("bot", self.bot as Any), ("premium", self.premium as Any)]) - } - } - 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, Any)]) { - switch self { - case .requestPeerTypeBroadcast(let _data): - return ("requestPeerTypeBroadcast", [("flags", _data.flags as Any), ("hasUsername", _data.hasUsername as Any), ("userAdminRights", _data.userAdminRights as Any), ("botAdminRights", _data.botAdminRights as Any)]) - case .requestPeerTypeChat(let _data): - return ("requestPeerTypeChat", [("flags", _data.flags as Any), ("hasUsername", _data.hasUsername as Any), ("forum", _data.forum as Any), ("userAdminRights", _data.userAdminRights as Any), ("botAdminRights", _data.botAdminRights as Any)]) - case .requestPeerTypeCreateBot(let _data): - return ("requestPeerTypeCreateBot", [("flags", _data.flags as Any), ("suggestedName", _data.suggestedName as Any), ("suggestedUsername", _data.suggestedUsername as Any)]) - case .requestPeerTypeUser(let _data): - return ("requestPeerTypeUser", [("flags", _data.flags as Any), ("bot", _data.bot as Any), ("premium", _data.premium as Any)]) - } - } - - public static func parse_requestPeerTypeBroadcast(_ reader: BufferReader) -> RequestPeerType? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Bool? - if Int(_1!) & Int(1 << 3) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } - } - var _3: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } - } - var _4: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil - let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.RequestPeerType.requestPeerTypeBroadcast(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!) & Int(1 << 3) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } - } - var _3: Api.Bool? - if Int(_1!) & Int(1 << 4) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } - } - var _4: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } - } - var _5: Api.ChatAdminRights? - if Int(_1!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.ChatAdminRights - } - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 3) == 0) || _2 != nil - let _c3 = (Int(_1!) & Int(1 << 4) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.RequestPeerType.requestPeerTypeChat(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!) & Int(1 << 1) != 0 { - _2 = parseString(reader) - } - var _3: String? - if Int(_1!) & Int(1 << 2) != 0 { - _3 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil - let _c3 = (Int(_1!) & 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!) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Bool - } - } - var _3: Api.Bool? - if Int(_1!) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _3 = Api.parse(reader, signature: signature) as? Api.Bool - } - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.RequestPeerType.requestPeerTypeUser(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, Any)]) { - return ("requestedPeerChannel", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("title", self.title as Any), ("username", self.username as Any), ("photo", self.photo as Any)]) - } - } - 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, Any)]) { - return ("requestedPeerChat", [("flags", self.flags as Any), ("chatId", self.chatId as Any), ("title", self.title as Any), ("photo", self.photo as Any)]) - } - } - 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, Any)]) { - return ("requestedPeerUser", [("flags", self.flags as Any), ("userId", self.userId as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("username", self.username as Any), ("photo", self.photo as Any)]) - } - } - case requestedPeerChannel(Cons_requestedPeerChannel) - case requestedPeerChat(Cons_requestedPeerChat) - case requestedPeerUser(Cons_requestedPeerUser) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .requestedPeerChannel(let _data): - if boxed { - buffer.appendInt32(-1952185372) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.channelId, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.title!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeString(_data.username!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - _data.photo!.serialize(buffer, true) - } - break - case .requestedPeerChat(let _data): - if boxed { - buffer.appendInt32(1929860175) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.chatId, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.title!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - _data.photo!.serialize(buffer, true) - } - break - case .requestedPeerUser(let _data): - if boxed { - buffer.appendInt32(-701500310) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.userId, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.firstName!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.lastName!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeString(_data.username!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - _data.photo!.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .requestedPeerChannel(let _data): - return ("requestedPeerChannel", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("title", _data.title as Any), ("username", _data.username as Any), ("photo", _data.photo as Any)]) - case .requestedPeerChat(let _data): - return ("requestedPeerChat", [("flags", _data.flags as Any), ("chatId", _data.chatId as Any), ("title", _data.title as Any), ("photo", _data.photo as Any)]) - case .requestedPeerUser(let _data): - return ("requestedPeerUser", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("username", _data.username as Any), ("photo", _data.photo as Any)]) - } - } - - public static func parse_requestedPeerChannel(_ reader: BufferReader) -> RequestedPeer? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: String? - if Int(_1!) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - var _4: String? - if Int(_1!) & Int(1 << 1) != 0 { - _4 = parseString(reader) - } - var _5: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Photo - } - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil - let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.RequestedPeer.requestedPeerChannel(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!) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - var _4: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Photo - } - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil - if _c1 && _c2 && _c3 && _c4 { - return Api.RequestedPeer.requestedPeerChat(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!) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - var _4: String? - if Int(_1!) & Int(1 << 0) != 0 { - _4 = parseString(reader) - } - var _5: String? - if Int(_1!) & Int(1 << 1) != 0 { - _5 = parseString(reader) - } - var _6: Api.Photo? - if Int(_1!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Photo - } - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.RequestedPeer.requestedPeerUser(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, Any)]) { - return ("requirementToContactPaidMessages", [("starsAmount", self.starsAmount as Any)]) - } - } - 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, Any)]) { - switch self { - case .requirementToContactEmpty: - return ("requirementToContactEmpty", []) - case .requirementToContactPaidMessages(let _data): - return ("requirementToContactPaidMessages", [("starsAmount", _data.starsAmount as Any)]) - case .requirementToContactPremium: - return ("requirementToContactPremium", []) - } - } - - public static func parse_requirementToContactEmpty(_ reader: BufferReader) -> RequirementToContact? { - return Api.RequirementToContact.requirementToContactEmpty - } - 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 - } - } -} public extension Api { enum RestrictionReason: TypeConstructorDescription { public class Cons_restrictionReason: TypeConstructorDescription { @@ -652,8 +9,8 @@ public extension Api { self.reason = reason self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("restrictionReason", [("platform", self.platform as Any), ("reason", self.reason as Any), ("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("restrictionReason", [("platform", ConstructorParameterDescription(self.platform)), ("reason", ConstructorParameterDescription(self.reason)), ("text", ConstructorParameterDescription(self.text))]) } } case restrictionReason(Cons_restrictionReason) @@ -671,10 +28,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .restrictionReason(let _data): - return ("restrictionReason", [("platform", _data.platform as Any), ("reason", _data.reason as Any), ("text", _data.text as Any)]) + return ("restrictionReason", [("platform", ConstructorParameterDescription(_data.platform)), ("reason", ConstructorParameterDescription(_data.reason)), ("text", ConstructorParameterDescription(_data.text))]) } } @@ -706,8 +63,8 @@ public extension Api { self.text = text self.name = name } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textAnchor", [("text", self.text as Any), ("name", self.name as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textAnchor", [("text", ConstructorParameterDescription(self.text)), ("name", ConstructorParameterDescription(self.name))]) } } public class Cons_textBold: TypeConstructorDescription { @@ -715,8 +72,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textBold", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textBold", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textConcat: TypeConstructorDescription { @@ -724,8 +81,8 @@ public extension Api { public init(texts: [Api.RichText]) { self.texts = texts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textConcat", [("texts", self.texts as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textConcat", [("texts", ConstructorParameterDescription(self.texts))]) } } public class Cons_textEmail: TypeConstructorDescription { @@ -735,8 +92,8 @@ public extension Api { self.text = text self.email = email } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textEmail", [("text", self.text as Any), ("email", self.email as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textEmail", [("text", ConstructorParameterDescription(self.text)), ("email", ConstructorParameterDescription(self.email))]) } } public class Cons_textFixed: TypeConstructorDescription { @@ -744,8 +101,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textFixed", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textFixed", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textImage: TypeConstructorDescription { @@ -757,8 +114,8 @@ public extension Api { self.w = w self.h = h } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textImage", [("documentId", self.documentId as Any), ("w", self.w as Any), ("h", self.h as Any)]) + 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 { @@ -766,8 +123,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textItalic", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textItalic", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textMarked: TypeConstructorDescription { @@ -775,8 +132,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textMarked", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textMarked", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textPhone: TypeConstructorDescription { @@ -786,8 +143,8 @@ public extension Api { self.text = text self.phone = phone } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textPhone", [("text", self.text as Any), ("phone", self.phone as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textPhone", [("text", ConstructorParameterDescription(self.text)), ("phone", ConstructorParameterDescription(self.phone))]) } } public class Cons_textPlain: TypeConstructorDescription { @@ -795,8 +152,8 @@ public extension Api { public init(text: String) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textPlain", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textPlain", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textStrike: TypeConstructorDescription { @@ -804,8 +161,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textStrike", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textStrike", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textSubscript: TypeConstructorDescription { @@ -813,8 +170,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textSubscript", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textSubscript", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textSuperscript: TypeConstructorDescription { @@ -822,8 +179,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textSuperscript", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textSuperscript", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textUnderline: TypeConstructorDescription { @@ -831,8 +188,8 @@ public extension Api { public init(text: Api.RichText) { self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textUnderline", [("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textUnderline", [("text", ConstructorParameterDescription(self.text))]) } } public class Cons_textUrl: TypeConstructorDescription { @@ -844,8 +201,8 @@ public extension Api { self.url = url self.webpageId = webpageId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textUrl", [("text", self.text as Any), ("url", self.url as Any), ("webpageId", self.webpageId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textUrl", [("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId))]) } } case textAnchor(Cons_textAnchor) @@ -976,40 +333,40 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .textAnchor(let _data): - return ("textAnchor", [("text", _data.text as Any), ("name", _data.name as Any)]) + return ("textAnchor", [("text", ConstructorParameterDescription(_data.text)), ("name", ConstructorParameterDescription(_data.name))]) case .textBold(let _data): - return ("textBold", [("text", _data.text as Any)]) + return ("textBold", [("text", ConstructorParameterDescription(_data.text))]) case .textConcat(let _data): - return ("textConcat", [("texts", _data.texts as Any)]) + return ("textConcat", [("texts", ConstructorParameterDescription(_data.texts))]) case .textEmail(let _data): - return ("textEmail", [("text", _data.text as Any), ("email", _data.email as Any)]) + return ("textEmail", [("text", ConstructorParameterDescription(_data.text)), ("email", ConstructorParameterDescription(_data.email))]) case .textEmpty: return ("textEmpty", []) case .textFixed(let _data): - return ("textFixed", [("text", _data.text as Any)]) + return ("textFixed", [("text", ConstructorParameterDescription(_data.text))]) case .textImage(let _data): - return ("textImage", [("documentId", _data.documentId as Any), ("w", _data.w as Any), ("h", _data.h as Any)]) + return ("textImage", [("documentId", ConstructorParameterDescription(_data.documentId)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h))]) case .textItalic(let _data): - return ("textItalic", [("text", _data.text as Any)]) + return ("textItalic", [("text", ConstructorParameterDescription(_data.text))]) case .textMarked(let _data): - return ("textMarked", [("text", _data.text as Any)]) + return ("textMarked", [("text", ConstructorParameterDescription(_data.text))]) case .textPhone(let _data): - return ("textPhone", [("text", _data.text as Any), ("phone", _data.phone as Any)]) + return ("textPhone", [("text", ConstructorParameterDescription(_data.text)), ("phone", ConstructorParameterDescription(_data.phone))]) case .textPlain(let _data): - return ("textPlain", [("text", _data.text as Any)]) + return ("textPlain", [("text", ConstructorParameterDescription(_data.text))]) case .textStrike(let _data): - return ("textStrike", [("text", _data.text as Any)]) + return ("textStrike", [("text", ConstructorParameterDescription(_data.text))]) case .textSubscript(let _data): - return ("textSubscript", [("text", _data.text as Any)]) + return ("textSubscript", [("text", ConstructorParameterDescription(_data.text))]) case .textSuperscript(let _data): - return ("textSuperscript", [("text", _data.text as Any)]) + return ("textSuperscript", [("text", ConstructorParameterDescription(_data.text))]) case .textUnderline(let _data): - return ("textUnderline", [("text", _data.text as Any)]) + return ("textUnderline", [("text", ConstructorParameterDescription(_data.text))]) case .textUrl(let _data): - return ("textUrl", [("text", _data.text as Any), ("url", _data.url as Any), ("webpageId", _data.webpageId as Any)]) + return ("textUrl", [("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId))]) } } @@ -1243,8 +600,8 @@ public extension Api { self.lastName = lastName self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedPhoneContact", [("phone", self.phone as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("date", self.date as Any)]) + 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) @@ -1263,10 +620,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedPhoneContact(let _data): - return ("savedPhoneContact", [("phone", _data.phone as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("date", _data.date as Any)]) + return ("savedPhoneContact", [("phone", ConstructorParameterDescription(_data.phone)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("date", ConstructorParameterDescription(_data.date))]) } } @@ -1313,8 +670,8 @@ public extension Api { self.unreadReactionsCount = unreadReactionsCount self.draft = draft } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("monoForumDialog", [("flags", self.flags as Any), ("peer", self.peer as Any), ("topMessage", self.topMessage as Any), ("readInboxMaxId", self.readInboxMaxId as Any), ("readOutboxMaxId", self.readOutboxMaxId as Any), ("unreadCount", self.unreadCount as Any), ("unreadReactionsCount", self.unreadReactionsCount as Any), ("draft", self.draft as Any)]) + 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 { @@ -1326,8 +683,8 @@ public extension Api { self.peer = peer self.topMessage = topMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedDialog", [("flags", self.flags as Any), ("peer", self.peer as Any), ("topMessage", self.topMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedDialog", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMessage", ConstructorParameterDescription(self.topMessage))]) } } case monoForumDialog(Cons_monoForumDialog) @@ -1361,12 +718,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .monoForumDialog(let _data): - return ("monoForumDialog", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("draft", _data.draft as Any)]) + 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", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any)]) + return ("savedDialog", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMessage", ConstructorParameterDescription(_data.topMessage))]) } } @@ -1429,3 +786,766 @@ public extension Api { } } } +public extension Api { + 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 ("savedReactionTag", [("flags", ConstructorParameterDescription(self.flags)), ("reaction", ConstructorParameterDescription(self.reaction)), ("title", ConstructorParameterDescription(self.title)), ("count", ConstructorParameterDescription(self.count))]) + } + } + case savedReactionTag(Cons_savedReactionTag) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .savedReactionTag(let _data): + if boxed { + buffer.appendInt32(-881854424) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.reaction.serialize(buffer, true) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeString(_data.title!, buffer: buffer, boxed: false) + } + serializeInt32(_data.count, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, 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!) & 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!) & 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(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? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Api.Peer? + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _2 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + 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!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } + var _6: Int32? + if Int(_1!) & Int(1 << 3) != 0 { + _6 = reader.readInt32() + } + var _7: Int64? + if Int(_1!) & Int(1 << 11) != 0 { + _7 = reader.readInt64() + } + var _8: Int64? + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt64() + } + var _9: Int64? + if Int(_1!) & Int(1 << 6) != 0 { + _9 = reader.readInt64() + } + var _10: Int32? + if Int(_1!) & Int(1 << 7) != 0 { + _10 = reader.readInt32() + } + var _11: Int64? + if Int(_1!) & Int(1 << 8) != 0 { + _11 = reader.readInt64() + } + var _12: Int32? + if Int(_1!) & Int(1 << 13) != 0 { + _12 = reader.readInt32() + } + var _13: Int32? + if Int(_1!) & Int(1 << 14) != 0 { + _13 = reader.readInt32() + } + var _14: [Int32]? + if Int(_1!) & Int(1 << 15) != 0 { + if let _ = reader.readInt32() { + _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } + var _15: String? + if Int(_1!) & Int(1 << 16) != 0 { + _15 = parseString(reader) + } + var _16: Int64? + if Int(_1!) & Int(1 << 18) != 0 { + _16 = reader.readInt64() + } + var _17: Int32? + if Int(_1!) & Int(1 << 19) != 0 { + _17 = reader.readInt32() + } + var _18: Int32? + if Int(_1!) & Int(1 << 20) != 0 { + _18 = reader.readInt32() + } + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil + let _c3 = _3 != nil + let _c4 = _4 != nil + let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil + let _c6 = (Int(_1!) & Int(1 << 3) == 0) || _6 != nil + let _c7 = (Int(_1!) & Int(1 << 11) == 0) || _7 != nil + let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil + let _c10 = (Int(_1!) & Int(1 << 7) == 0) || _10 != nil + let _c11 = (Int(_1!) & Int(1 << 8) == 0) || _11 != nil + let _c12 = (Int(_1!) & Int(1 << 13) == 0) || _12 != nil + let _c13 = (Int(_1!) & Int(1 << 14) == 0) || _13 != nil + let _c14 = (Int(_1!) & Int(1 << 15) == 0) || _14 != nil + let _c15 = (Int(_1!) & Int(1 << 16) == 0) || _15 != nil + let _c16 = (Int(_1!) & Int(1 << 18) == 0) || _16 != nil + let _c17 = (Int(_1!) & Int(1 << 19) == 0) || _17 != nil + let _c18 = (Int(_1!) & Int(1 << 20) == 0) || _18 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 { + return Api.SavedStarGift.savedStarGift(Cons_savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11, canTransferAt: _12, canResellAt: _13, collectionId: _14, prepaidUpgradeHash: _15, dropOriginalDetailsStars: _16, giftNum: _17, canCraftAt: _18)) + } + else { + return nil + } + } + } +} +public extension Api { + enum SearchPostsFlood: TypeConstructorDescription { + 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))]) + } + } + case searchPostsFlood(Cons_searchPostsFlood) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .searchPostsFlood(let _data): + if boxed { + buffer.appendInt32(1040931690) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.totalDaily, buffer: buffer, boxed: false) + serializeInt32(_data.remains, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.waitTill!, buffer: buffer, boxed: false) + } + serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, 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!) & 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!) & 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.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) + } + 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 + } + } +} +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 + } + } +} diff --git a/submodules/TelegramApi/Sources/Api24.swift b/submodules/TelegramApi/Sources/Api24.swift index 0c64cee661..a72b6cde79 100644 --- a/submodules/TelegramApi/Sources/Api24.swift +++ b/submodules/TelegramApi/Sources/Api24.swift @@ -1,766 +1,3 @@ -public extension Api { - 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, Any)]) { - return ("savedReactionTag", [("flags", self.flags as Any), ("reaction", self.reaction as Any), ("title", self.title as Any), ("count", self.count as Any)]) - } - } - case savedReactionTag(Cons_savedReactionTag) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .savedReactionTag(let _data): - if boxed { - buffer.appendInt32(-881854424) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.reaction.serialize(buffer, true) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.title!, buffer: buffer, boxed: false) - } - serializeInt32(_data.count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .savedReactionTag(let _data): - return ("savedReactionTag", [("flags", _data.flags as Any), ("reaction", _data.reaction as Any), ("title", _data.title as Any), ("count", _data.count as Any)]) - } - } - - public static func parse_savedReactionTag(_ reader: BufferReader) -> SavedReactionTag? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Reaction? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Reaction - } - var _3: String? - if Int(_1!) & 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!) & 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, Any)]) { - return ("savedStarGift", [("flags", self.flags as Any), ("fromId", self.fromId as Any), ("date", self.date as Any), ("gift", self.gift as Any), ("message", self.message as Any), ("msgId", self.msgId as Any), ("savedId", self.savedId as Any), ("convertStars", self.convertStars as Any), ("upgradeStars", self.upgradeStars as Any), ("canExportAt", self.canExportAt as Any), ("transferStars", self.transferStars as Any), ("canTransferAt", self.canTransferAt as Any), ("canResellAt", self.canResellAt as Any), ("collectionId", self.collectionId as Any), ("prepaidUpgradeHash", self.prepaidUpgradeHash as Any), ("dropOriginalDetailsStars", self.dropOriginalDetailsStars as Any), ("giftNum", self.giftNum as Any), ("canCraftAt", self.canCraftAt as Any)]) - } - } - 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, Any)]) { - switch self { - case .savedStarGift(let _data): - return ("savedStarGift", [("flags", _data.flags as Any), ("fromId", _data.fromId as Any), ("date", _data.date as Any), ("gift", _data.gift as Any), ("message", _data.message as Any), ("msgId", _data.msgId as Any), ("savedId", _data.savedId as Any), ("convertStars", _data.convertStars as Any), ("upgradeStars", _data.upgradeStars as Any), ("canExportAt", _data.canExportAt as Any), ("transferStars", _data.transferStars as Any), ("canTransferAt", _data.canTransferAt as Any), ("canResellAt", _data.canResellAt as Any), ("collectionId", _data.collectionId as Any), ("prepaidUpgradeHash", _data.prepaidUpgradeHash as Any), ("dropOriginalDetailsStars", _data.dropOriginalDetailsStars as Any), ("giftNum", _data.giftNum as Any), ("canCraftAt", _data.canCraftAt as Any)]) - } - } - - public static func parse_savedStarGift(_ reader: BufferReader) -> SavedStarGift? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.Peer? - if Int(_1!) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - 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!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - } - var _6: Int32? - if Int(_1!) & Int(1 << 3) != 0 { - _6 = reader.readInt32() - } - var _7: Int64? - if Int(_1!) & Int(1 << 11) != 0 { - _7 = reader.readInt64() - } - var _8: Int64? - if Int(_1!) & Int(1 << 4) != 0 { - _8 = reader.readInt64() - } - var _9: Int64? - if Int(_1!) & Int(1 << 6) != 0 { - _9 = reader.readInt64() - } - var _10: Int32? - if Int(_1!) & Int(1 << 7) != 0 { - _10 = reader.readInt32() - } - var _11: Int64? - if Int(_1!) & Int(1 << 8) != 0 { - _11 = reader.readInt64() - } - var _12: Int32? - if Int(_1!) & Int(1 << 13) != 0 { - _12 = reader.readInt32() - } - var _13: Int32? - if Int(_1!) & Int(1 << 14) != 0 { - _13 = reader.readInt32() - } - var _14: [Int32]? - if Int(_1!) & Int(1 << 15) != 0 { - if let _ = reader.readInt32() { - _14 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - } - var _15: String? - if Int(_1!) & Int(1 << 16) != 0 { - _15 = parseString(reader) - } - var _16: Int64? - if Int(_1!) & Int(1 << 18) != 0 { - _16 = reader.readInt64() - } - var _17: Int32? - if Int(_1!) & Int(1 << 19) != 0 { - _17 = reader.readInt32() - } - var _18: Int32? - if Int(_1!) & Int(1 << 20) != 0 { - _18 = reader.readInt32() - } - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil - let _c6 = (Int(_1!) & Int(1 << 3) == 0) || _6 != nil - let _c7 = (Int(_1!) & Int(1 << 11) == 0) || _7 != nil - let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil - let _c10 = (Int(_1!) & Int(1 << 7) == 0) || _10 != nil - let _c11 = (Int(_1!) & Int(1 << 8) == 0) || _11 != nil - let _c12 = (Int(_1!) & Int(1 << 13) == 0) || _12 != nil - let _c13 = (Int(_1!) & Int(1 << 14) == 0) || _13 != nil - let _c14 = (Int(_1!) & Int(1 << 15) == 0) || _14 != nil - let _c15 = (Int(_1!) & Int(1 << 16) == 0) || _15 != nil - let _c16 = (Int(_1!) & Int(1 << 18) == 0) || _16 != nil - let _c17 = (Int(_1!) & Int(1 << 19) == 0) || _17 != nil - let _c18 = (Int(_1!) & Int(1 << 20) == 0) || _18 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 && _c14 && _c15 && _c16 && _c17 && _c18 { - return Api.SavedStarGift.savedStarGift(Cons_savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11, canTransferAt: _12, canResellAt: _13, collectionId: _14, prepaidUpgradeHash: _15, dropOriginalDetailsStars: _16, giftNum: _17, canCraftAt: _18)) - } - else { - return nil - } - } - } -} -public extension Api { - enum SearchPostsFlood: TypeConstructorDescription { - 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, Any)]) { - return ("searchPostsFlood", [("flags", self.flags as Any), ("totalDaily", self.totalDaily as Any), ("remains", self.remains as Any), ("waitTill", self.waitTill as Any), ("starsAmount", self.starsAmount as Any)]) - } - } - case searchPostsFlood(Cons_searchPostsFlood) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchPostsFlood(let _data): - if boxed { - buffer.appendInt32(1040931690) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt32(_data.totalDaily, buffer: buffer, boxed: false) - serializeInt32(_data.remains, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.waitTill!, buffer: buffer, boxed: false) - } - serializeInt64(_data.starsAmount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchPostsFlood(let _data): - return ("searchPostsFlood", [("flags", _data.flags as Any), ("totalDaily", _data.totalDaily as Any), ("remains", _data.remains as Any), ("waitTill", _data.waitTill as Any), ("starsAmount", _data.starsAmount as Any)]) - } - } - - public static func parse_searchPostsFlood(_ reader: BufferReader) -> SearchPostsFlood? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - if Int(_1!) & 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!) & 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, Any)]) { - return ("searchResultsCalendarPeriod", [("date", self.date as Any), ("minMsgId", self.minMsgId as Any), ("maxMsgId", self.maxMsgId as Any), ("count", self.count as Any)]) - } - } - case searchResultsCalendarPeriod(Cons_searchResultsCalendarPeriod) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchResultsCalendarPeriod(let _data): - if boxed { - buffer.appendInt32(-911191137) - } - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt32(_data.minMsgId, buffer: buffer, boxed: false) - serializeInt32(_data.maxMsgId, buffer: buffer, boxed: false) - serializeInt32(_data.count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchResultsCalendarPeriod(let _data): - return ("searchResultsCalendarPeriod", [("date", _data.date as Any), ("minMsgId", _data.minMsgId as Any), ("maxMsgId", _data.maxMsgId as Any), ("count", _data.count as Any)]) - } - } - - public static func parse_searchResultsCalendarPeriod(_ reader: BufferReader) -> SearchResultsCalendarPeriod? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("searchResultPosition", [("msgId", self.msgId as Any), ("date", self.date as Any), ("offset", self.offset as Any)]) - } - } - case searchResultPosition(Cons_searchResultPosition) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .searchResultPosition(let _data): - if boxed { - buffer.appendInt32(2137295719) - } - serializeInt32(_data.msgId, buffer: buffer, boxed: false) - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt32(_data.offset, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .searchResultPosition(let _data): - return ("searchResultPosition", [("msgId", _data.msgId as Any), ("date", _data.date as Any), ("offset", _data.offset as Any)]) - } - } - - public static func parse_searchResultPosition(_ reader: BufferReader) -> SearchResultsPosition? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("secureCredentialsEncrypted", [("data", self.data as Any), ("hash", self.hash as Any), ("secret", self.secret as Any)]) - } - } - case secureCredentialsEncrypted(Cons_secureCredentialsEncrypted) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureCredentialsEncrypted(let _data): - if boxed { - buffer.appendInt32(871426631) - } - serializeBytes(_data.data, buffer: buffer, boxed: false) - serializeBytes(_data.hash, buffer: buffer, boxed: false) - serializeBytes(_data.secret, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureCredentialsEncrypted(let _data): - return ("secureCredentialsEncrypted", [("data", _data.data as Any), ("hash", _data.hash as Any), ("secret", _data.secret as Any)]) - } - } - - public static func parse_secureCredentialsEncrypted(_ reader: BufferReader) -> SecureCredentialsEncrypted? { - var _1: Buffer? - _1 = parseBytes(reader) - 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, Any)]) { - return ("secureData", [("data", self.data as Any), ("dataHash", self.dataHash as Any), ("secret", self.secret as Any)]) - } - } - case secureData(Cons_secureData) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .secureData(let _data): - if boxed { - buffer.appendInt32(-1964327229) - } - serializeBytes(_data.data, buffer: buffer, boxed: false) - serializeBytes(_data.dataHash, buffer: buffer, boxed: false) - serializeBytes(_data.secret, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .secureData(let _data): - return ("secureData", [("data", _data.data as Any), ("dataHash", _data.dataHash as Any), ("secret", _data.secret as Any)]) - } - } - - public static func parse_secureData(_ reader: BufferReader) -> SecureData? { - var _1: Buffer? - _1 = parseBytes(reader) - 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, Any)]) { - return ("secureFile", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("size", self.size as Any), ("dcId", self.dcId as Any), ("date", self.date as Any), ("fileHash", self.fileHash as Any), ("secret", self.secret as Any)]) - } - } - 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, Any)]) { - switch self { - case .secureFile(let _data): - return ("secureFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("size", _data.size as Any), ("dcId", _data.dcId as Any), ("date", _data.date as Any), ("fileHash", _data.fileHash as Any), ("secret", _data.secret as Any)]) - case .secureFileEmpty: - return ("secureFileEmpty", []) - } - } - - public static func parse_secureFile(_ reader: BufferReader) -> SecureFile? { - var _1: Int64? - _1 = reader.readInt64() - 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 - } - } -} -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, Any)]) { - return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", self.salt as Any)]) - } - } - public class Cons_securePasswordKdfAlgoSHA512: TypeConstructorDescription { - public var salt: Buffer - public init(salt: Buffer) { - self.salt = salt - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("securePasswordKdfAlgoSHA512", [("salt", self.salt as Any)]) - } - } - 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, Any)]) { - switch self { - case .securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(let _data): - return ("securePasswordKdfAlgoPBKDF2HMACSHA512iter100000", [("salt", _data.salt as Any)]) - case .securePasswordKdfAlgoSHA512(let _data): - return ("securePasswordKdfAlgoSHA512", [("salt", _data.salt as Any)]) - case .securePasswordKdfAlgoUnknown: - return ("securePasswordKdfAlgoUnknown", []) - } - } - - public static func parse_securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(_ reader: BufferReader) -> SecurePasswordKdfAlgo? { - var _1: Buffer? - _1 = parseBytes(reader) - let _c1 = _1 != nil - if _c1 { - return Api.SecurePasswordKdfAlgo.securePasswordKdfAlgoPBKDF2HMACSHA512iter100000(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 { @@ -768,8 +5,8 @@ public extension Api { public init(email: String) { self.email = email } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("securePlainEmail", [("email", self.email as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("securePlainEmail", [("email", ConstructorParameterDescription(self.email))]) } } public class Cons_securePlainPhone: TypeConstructorDescription { @@ -777,8 +14,8 @@ public extension Api { public init(phone: String) { self.phone = phone } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("securePlainPhone", [("phone", self.phone as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("securePlainPhone", [("phone", ConstructorParameterDescription(self.phone))]) } } case securePlainEmail(Cons_securePlainEmail) @@ -801,12 +38,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .securePlainEmail(let _data): - return ("securePlainEmail", [("email", _data.email as Any)]) + return ("securePlainEmail", [("email", ConstructorParameterDescription(_data.email))]) case .securePlainPhone(let _data): - return ("securePlainPhone", [("phone", _data.phone as Any)]) + return ("securePlainPhone", [("phone", ConstructorParameterDescription(_data.phone))]) } } @@ -843,8 +80,8 @@ public extension Api { self.flags = flags self.type = type } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureRequiredType", [("flags", self.flags as Any), ("type", self.type as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureRequiredType", [("flags", ConstructorParameterDescription(self.flags)), ("type", ConstructorParameterDescription(self.type))]) } } public class Cons_secureRequiredTypeOneOf: TypeConstructorDescription { @@ -852,8 +89,8 @@ public extension Api { public init(types: [Api.SecureRequiredType]) { self.types = types } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureRequiredTypeOneOf", [("types", self.types as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureRequiredTypeOneOf", [("types", ConstructorParameterDescription(self.types))]) } } case secureRequiredType(Cons_secureRequiredType) @@ -881,12 +118,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .secureRequiredType(let _data): - return ("secureRequiredType", [("flags", _data.flags as Any), ("type", _data.type as Any)]) + return ("secureRequiredType", [("flags", ConstructorParameterDescription(_data.flags)), ("type", ConstructorParameterDescription(_data.type))]) case .secureRequiredTypeOneOf(let _data): - return ("secureRequiredTypeOneOf", [("types", _data.types as Any)]) + return ("secureRequiredTypeOneOf", [("types", ConstructorParameterDescription(_data.types))]) } } @@ -932,8 +169,8 @@ public extension Api { self.secureSecret = secureSecret self.secureSecretId = secureSecretId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureSecretSettings", [("secureAlgo", self.secureAlgo as Any), ("secureSecret", self.secureSecret as Any), ("secureSecretId", self.secureSecretId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureSecretSettings", [("secureAlgo", ConstructorParameterDescription(self.secureAlgo)), ("secureSecret", ConstructorParameterDescription(self.secureSecret)), ("secureSecretId", ConstructorParameterDescription(self.secureSecretId))]) } } case secureSecretSettings(Cons_secureSecretSettings) @@ -951,10 +188,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .secureSecretSettings(let _data): - return ("secureSecretSettings", [("secureAlgo", _data.secureAlgo as Any), ("secureSecret", _data.secureSecret as Any), ("secureSecretId", _data.secureSecretId as Any)]) + return ("secureSecretSettings", [("secureAlgo", ConstructorParameterDescription(_data.secureAlgo)), ("secureSecret", ConstructorParameterDescription(_data.secureSecret)), ("secureSecretId", ConstructorParameterDescription(_data.secureSecretId))]) } } @@ -1004,8 +241,8 @@ public extension Api { self.plainData = plainData self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValue", [("flags", self.flags as Any), ("type", self.type as Any), ("data", self.data as Any), ("frontSide", self.frontSide as Any), ("reverseSide", self.reverseSide as Any), ("selfie", self.selfie as Any), ("translation", self.translation as Any), ("files", self.files as Any), ("plainData", self.plainData as Any), ("hash", self.hash as Any)]) + 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))]) } } case secureValue(Cons_secureValue) @@ -1052,10 +289,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .secureValue(let _data): - return ("secureValue", [("flags", _data.flags as Any), ("type", _data.type as Any), ("data", _data.data as Any), ("frontSide", _data.frontSide as Any), ("reverseSide", _data.reverseSide as Any), ("selfie", _data.selfie as Any), ("translation", _data.translation as Any), ("files", _data.files as Any), ("plainData", _data.plainData as Any), ("hash", _data.hash as Any)]) + 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))]) } } @@ -1140,8 +377,8 @@ public extension Api { self.hash = hash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueError", [("type", self.type as Any), ("hash", self.hash as Any), ("text", self.text as Any)]) + 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 { @@ -1155,8 +392,8 @@ public extension Api { self.field = field self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorData", [("type", self.type as Any), ("dataHash", self.dataHash as Any), ("field", self.field as Any), ("text", self.text as Any)]) + 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 { @@ -1168,8 +405,8 @@ public extension Api { self.fileHash = fileHash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorFile", [("type", self.type as Any), ("fileHash", self.fileHash as Any), ("text", self.text as Any)]) + 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 { @@ -1181,8 +418,8 @@ public extension Api { self.fileHash = fileHash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorFiles", [("type", self.type as Any), ("fileHash", self.fileHash as Any), ("text", self.text as Any)]) + 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 { @@ -1194,8 +431,8 @@ public extension Api { self.fileHash = fileHash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorFrontSide", [("type", self.type as Any), ("fileHash", self.fileHash as Any), ("text", self.text as Any)]) + 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 { @@ -1207,8 +444,8 @@ public extension Api { self.fileHash = fileHash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorReverseSide", [("type", self.type as Any), ("fileHash", self.fileHash as Any), ("text", self.text as Any)]) + 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 { @@ -1220,8 +457,8 @@ public extension Api { self.fileHash = fileHash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorSelfie", [("type", self.type as Any), ("fileHash", self.fileHash as Any), ("text", self.text as Any)]) + 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 { @@ -1233,8 +470,8 @@ public extension Api { self.fileHash = fileHash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorTranslationFile", [("type", self.type as Any), ("fileHash", self.fileHash as Any), ("text", self.text as Any)]) + 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 { @@ -1246,8 +483,8 @@ public extension Api { self.fileHash = fileHash self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueErrorTranslationFiles", [("type", self.type as Any), ("fileHash", self.fileHash as Any), ("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueErrorTranslationFiles", [("type", ConstructorParameterDescription(self.type)), ("fileHash", ConstructorParameterDescription(self.fileHash)), ("text", ConstructorParameterDescription(self.text))]) } } case secureValueError(Cons_secureValueError) @@ -1346,26 +583,26 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .secureValueError(let _data): - return ("secureValueError", [("type", _data.type as Any), ("hash", _data.hash as Any), ("text", _data.text as Any)]) + return ("secureValueError", [("type", ConstructorParameterDescription(_data.type)), ("hash", ConstructorParameterDescription(_data.hash)), ("text", ConstructorParameterDescription(_data.text))]) case .secureValueErrorData(let _data): - return ("secureValueErrorData", [("type", _data.type as Any), ("dataHash", _data.dataHash as Any), ("field", _data.field as Any), ("text", _data.text as Any)]) + 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", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + return ("secureValueErrorFile", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) case .secureValueErrorFiles(let _data): - return ("secureValueErrorFiles", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + return ("secureValueErrorFiles", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) case .secureValueErrorFrontSide(let _data): - return ("secureValueErrorFrontSide", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + return ("secureValueErrorFrontSide", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) case .secureValueErrorReverseSide(let _data): - return ("secureValueErrorReverseSide", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + return ("secureValueErrorReverseSide", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) case .secureValueErrorSelfie(let _data): - return ("secureValueErrorSelfie", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + return ("secureValueErrorSelfie", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) case .secureValueErrorTranslationFile(let _data): - return ("secureValueErrorTranslationFile", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + return ("secureValueErrorTranslationFile", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) case .secureValueErrorTranslationFiles(let _data): - return ("secureValueErrorTranslationFiles", [("type", _data.type as Any), ("fileHash", _data.fileHash as Any), ("text", _data.text as Any)]) + return ("secureValueErrorTranslationFiles", [("type", ConstructorParameterDescription(_data.type)), ("fileHash", ConstructorParameterDescription(_data.fileHash)), ("text", ConstructorParameterDescription(_data.text))]) } } @@ -1558,8 +795,8 @@ public extension Api { self.type = type self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("secureValueHash", [("type", self.type as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("secureValueHash", [("type", ConstructorParameterDescription(self.type)), ("hash", ConstructorParameterDescription(self.hash))]) } } case secureValueHash(Cons_secureValueHash) @@ -1576,10 +813,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .secureValueHash(let _data): - return ("secureValueHash", [("type", _data.type as Any), ("hash", _data.hash as Any)]) + return ("secureValueHash", [("type", ConstructorParameterDescription(_data.type)), ("hash", ConstructorParameterDescription(_data.hash))]) } } @@ -1687,7 +924,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .secureValueTypeAddress: return ("secureValueTypeAddress", []) @@ -1759,3 +996,463 @@ public extension Api { } } } +public extension Api { + 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 ("sendAsPeer", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer))]) + } + } + case sendAsPeer(Cons_sendAsPeer) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .sendAsPeer(let _data): + if boxed { + buffer.appendInt32(-1206095820) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + _data.peer.serialize(buffer, true) + break + } + } + + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + switch self { + case .sendAsPeer(let _data): + return ("sendAsPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer))]) + } + } + + 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.SendAsPeer.sendAsPeer(Cons_sendAsPeer(flags: _1!, peer: _2!)) + } + else { + return nil + } + } + } +} +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 + } + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendMessageEmojiInteraction", [("emoticon", ConstructorParameterDescription(self.emoticon)), ("msgId", ConstructorParameterDescription(self.msgId)), ("interaction", ConstructorParameterDescription(self.interaction))]) + } + } + 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 .sendMessageCancelAction: + if boxed { + buffer.appendInt32(-44119819) + } + break + case .sendMessageChooseContactAction: + if boxed { + buffer.appendInt32(1653390447) + } + break + case .sendMessageChooseStickerAction: + if boxed { + buffer.appendInt32(-1336228175) + } + break + case .sendMessageEmojiInteraction(let _data): + if boxed { + buffer.appendInt32(630664139) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + serializeInt32(_data.msgId, buffer: buffer, boxed: false) + _data.interaction.serialize(buffer, true) + break + case .sendMessageEmojiInteractionSeen(let _data): + if boxed { + buffer.appendInt32(-1234857938) + } + serializeString(_data.emoticon, buffer: buffer, boxed: false) + break + case .sendMessageGamePlayAction: + if boxed { + buffer.appendInt32(-580219064) + } + break + case .sendMessageGeoLocationAction: + if boxed { + buffer.appendInt32(393186209) + } + break + case .sendMessageHistoryImportAction(let _data): + if boxed { + buffer.appendInt32(-606432698) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageRecordAudioAction: + if boxed { + buffer.appendInt32(-718310409) + } + break + case .sendMessageRecordRoundAction: + if boxed { + buffer.appendInt32(-1997373508) + } + break + case .sendMessageRecordVideoAction: + if boxed { + buffer.appendInt32(-1584933265) + } + break + case .sendMessageTextDraftAction(let _data): + if boxed { + buffer.appendInt32(929929052) + } + serializeInt64(_data.randomId, buffer: buffer, boxed: false) + _data.text.serialize(buffer, true) + break + case .sendMessageTypingAction: + if boxed { + buffer.appendInt32(381645902) + } + break + case .sendMessageUploadAudioAction(let _data): + if boxed { + buffer.appendInt32(-212740181) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadDocumentAction(let _data): + if boxed { + buffer.appendInt32(-1441998364) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadPhotoAction(let _data): + if boxed { + buffer.appendInt32(-774682074) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadRoundAction(let _data): + if boxed { + buffer.appendInt32(608050278) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .sendMessageUploadVideoAction(let _data): + if boxed { + buffer.appendInt32(-378127636) + } + serializeInt32(_data.progress, buffer: buffer, boxed: false) + break + case .speakingInGroupCallAction: + if boxed { + buffer.appendInt32(-651419003) + } + break + } + } + + public func descriptionFields() -> (String, [(String, 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", []) + } + } + + 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 + } + 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!)) + } + 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 + } + } +} diff --git a/submodules/TelegramApi/Sources/Api25.swift b/submodules/TelegramApi/Sources/Api25.swift index 33d3cfbe15..36ee647b44 100644 --- a/submodules/TelegramApi/Sources/Api25.swift +++ b/submodules/TelegramApi/Sources/Api25.swift @@ -1,463 +1,3 @@ -public extension Api { - 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, Any)]) { - return ("sendAsPeer", [("flags", self.flags as Any), ("peer", self.peer as Any)]) - } - } - case sendAsPeer(Cons_sendAsPeer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .sendAsPeer(let _data): - if boxed { - buffer.appendInt32(-1206095820) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.peer.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sendAsPeer(let _data): - return ("sendAsPeer", [("flags", _data.flags as Any), ("peer", _data.peer as Any)]) - } - } - - public static func parse_sendAsPeer(_ reader: BufferReader) -> SendAsPeer? { - var _1: Int32? - _1 = reader.readInt32() - 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.SendAsPeer.sendAsPeer(Cons_sendAsPeer(flags: _1!, peer: _2!)) - } - else { - return nil - } - } - } -} -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 - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageEmojiInteraction", [("emoticon", self.emoticon as Any), ("msgId", self.msgId as Any), ("interaction", self.interaction as Any)]) - } - } - public class Cons_sendMessageEmojiInteractionSeen: TypeConstructorDescription { - public var emoticon: String - public init(emoticon: String) { - self.emoticon = emoticon - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageEmojiInteractionSeen", [("emoticon", self.emoticon as Any)]) - } - } - public class Cons_sendMessageHistoryImportAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageHistoryImportAction", [("progress", self.progress as Any)]) - } - } - 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, Any)]) { - return ("sendMessageTextDraftAction", [("randomId", self.randomId as Any), ("text", self.text as Any)]) - } - } - public class Cons_sendMessageUploadAudioAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageUploadAudioAction", [("progress", self.progress as Any)]) - } - } - public class Cons_sendMessageUploadDocumentAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageUploadDocumentAction", [("progress", self.progress as Any)]) - } - } - public class Cons_sendMessageUploadPhotoAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageUploadPhotoAction", [("progress", self.progress as Any)]) - } - } - public class Cons_sendMessageUploadRoundAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageUploadRoundAction", [("progress", self.progress as Any)]) - } - } - public class Cons_sendMessageUploadVideoAction: TypeConstructorDescription { - public var progress: Int32 - public init(progress: Int32) { - self.progress = progress - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendMessageUploadVideoAction", [("progress", self.progress as Any)]) - } - } - 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 .sendMessageCancelAction: - if boxed { - buffer.appendInt32(-44119819) - } - break - case .sendMessageChooseContactAction: - if boxed { - buffer.appendInt32(1653390447) - } - break - case .sendMessageChooseStickerAction: - if boxed { - buffer.appendInt32(-1336228175) - } - break - case .sendMessageEmojiInteraction(let _data): - if boxed { - buffer.appendInt32(630664139) - } - serializeString(_data.emoticon, buffer: buffer, boxed: false) - serializeInt32(_data.msgId, buffer: buffer, boxed: false) - _data.interaction.serialize(buffer, true) - break - case .sendMessageEmojiInteractionSeen(let _data): - if boxed { - buffer.appendInt32(-1234857938) - } - serializeString(_data.emoticon, buffer: buffer, boxed: false) - break - case .sendMessageGamePlayAction: - if boxed { - buffer.appendInt32(-580219064) - } - break - case .sendMessageGeoLocationAction: - if boxed { - buffer.appendInt32(393186209) - } - break - case .sendMessageHistoryImportAction(let _data): - if boxed { - buffer.appendInt32(-606432698) - } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageRecordAudioAction: - if boxed { - buffer.appendInt32(-718310409) - } - break - case .sendMessageRecordRoundAction: - if boxed { - buffer.appendInt32(-1997373508) - } - break - case .sendMessageRecordVideoAction: - if boxed { - buffer.appendInt32(-1584933265) - } - break - case .sendMessageTextDraftAction(let _data): - if boxed { - buffer.appendInt32(929929052) - } - serializeInt64(_data.randomId, buffer: buffer, boxed: false) - _data.text.serialize(buffer, true) - break - case .sendMessageTypingAction: - if boxed { - buffer.appendInt32(381645902) - } - break - case .sendMessageUploadAudioAction(let _data): - if boxed { - buffer.appendInt32(-212740181) - } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadDocumentAction(let _data): - if boxed { - buffer.appendInt32(-1441998364) - } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadPhotoAction(let _data): - if boxed { - buffer.appendInt32(-774682074) - } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadRoundAction(let _data): - if boxed { - buffer.appendInt32(608050278) - } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .sendMessageUploadVideoAction(let _data): - if boxed { - buffer.appendInt32(-378127636) - } - serializeInt32(_data.progress, buffer: buffer, boxed: false) - break - case .speakingInGroupCallAction: - if boxed { - buffer.appendInt32(-651419003) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .sendMessageCancelAction: - return ("sendMessageCancelAction", []) - case .sendMessageChooseContactAction: - return ("sendMessageChooseContactAction", []) - case .sendMessageChooseStickerAction: - return ("sendMessageChooseStickerAction", []) - case .sendMessageEmojiInteraction(let _data): - return ("sendMessageEmojiInteraction", [("emoticon", _data.emoticon as Any), ("msgId", _data.msgId as Any), ("interaction", _data.interaction as Any)]) - case .sendMessageEmojiInteractionSeen(let _data): - return ("sendMessageEmojiInteractionSeen", [("emoticon", _data.emoticon as Any)]) - case .sendMessageGamePlayAction: - return ("sendMessageGamePlayAction", []) - case .sendMessageGeoLocationAction: - return ("sendMessageGeoLocationAction", []) - case .sendMessageHistoryImportAction(let _data): - return ("sendMessageHistoryImportAction", [("progress", _data.progress as Any)]) - case .sendMessageRecordAudioAction: - return ("sendMessageRecordAudioAction", []) - case .sendMessageRecordRoundAction: - return ("sendMessageRecordRoundAction", []) - case .sendMessageRecordVideoAction: - return ("sendMessageRecordVideoAction", []) - case .sendMessageTextDraftAction(let _data): - return ("sendMessageTextDraftAction", [("randomId", _data.randomId as Any), ("text", _data.text as Any)]) - case .sendMessageTypingAction: - return ("sendMessageTypingAction", []) - case .sendMessageUploadAudioAction(let _data): - return ("sendMessageUploadAudioAction", [("progress", _data.progress as Any)]) - case .sendMessageUploadDocumentAction(let _data): - return ("sendMessageUploadDocumentAction", [("progress", _data.progress as Any)]) - case .sendMessageUploadPhotoAction(let _data): - return ("sendMessageUploadPhotoAction", [("progress", _data.progress as Any)]) - case .sendMessageUploadRoundAction(let _data): - return ("sendMessageUploadRoundAction", [("progress", _data.progress as Any)]) - case .sendMessageUploadVideoAction(let _data): - return ("sendMessageUploadVideoAction", [("progress", _data.progress as Any)]) - case .speakingInGroupCallAction: - return ("speakingInGroupCallAction", []) - } - } - - public static func parse_sendMessageCancelAction(_ reader: BufferReader) -> SendMessageAction? { - return Api.SendMessageAction.sendMessageCancelAction - } - 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 - } - 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!)) - } - 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 ShippingOption: TypeConstructorDescription { public class Cons_shippingOption: TypeConstructorDescription { @@ -469,8 +9,8 @@ public extension Api { self.title = title self.prices = prices } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("shippingOption", [("id", self.id as Any), ("title", self.title as Any), ("prices", self.prices as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("shippingOption", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title)), ("prices", ConstructorParameterDescription(self.prices))]) } } case shippingOption(Cons_shippingOption) @@ -492,10 +32,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .shippingOption(let _data): - return ("shippingOption", [("id", _data.id as Any), ("title", _data.title as Any), ("prices", _data.prices as Any)]) + return ("shippingOption", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title)), ("prices", ConstructorParameterDescription(_data.prices))]) } } @@ -531,8 +71,8 @@ public extension Api { self.phoneNumber = phoneNumber self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("smsJob", [("jobId", self.jobId as Any), ("phoneNumber", self.phoneNumber as Any), ("text", self.text as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("smsJob", [("jobId", ConstructorParameterDescription(self.jobId)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("text", ConstructorParameterDescription(self.text))]) } } case smsJob(Cons_smsJob) @@ -550,10 +90,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .smsJob(let _data): - return ("smsJob", [("jobId", _data.jobId as Any), ("phoneNumber", _data.phoneNumber as Any), ("text", _data.text as Any)]) + return ("smsJob", [("jobId", ConstructorParameterDescription(_data.jobId)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("text", ConstructorParameterDescription(_data.text))]) } } @@ -609,8 +149,8 @@ public extension Api { self.minDisplayDuration = minDisplayDuration self.maxDisplayDuration = maxDisplayDuration } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sponsoredMessage", [("flags", self.flags as Any), ("randomId", self.randomId as Any), ("url", self.url as Any), ("title", self.title as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("photo", self.photo as Any), ("media", self.media as Any), ("color", self.color as Any), ("buttonText", self.buttonText as Any), ("sponsorInfo", self.sponsorInfo as Any), ("additionalInfo", self.additionalInfo as Any), ("minDisplayDuration", self.minDisplayDuration as Any), ("maxDisplayDuration", self.maxDisplayDuration as Any)]) + 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) @@ -659,10 +199,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sponsoredMessage(let _data): - return ("sponsoredMessage", [("flags", _data.flags as Any), ("randomId", _data.randomId as Any), ("url", _data.url as Any), ("title", _data.title as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("photo", _data.photo as Any), ("media", _data.media as Any), ("color", _data.color as Any), ("buttonText", _data.buttonText as Any), ("sponsorInfo", _data.sponsorInfo as Any), ("additionalInfo", _data.additionalInfo as Any), ("minDisplayDuration", _data.minDisplayDuration as Any), ("maxDisplayDuration", _data.maxDisplayDuration as Any)]) + 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))]) } } @@ -751,8 +291,8 @@ public extension Api { self.text = text self.option = option } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sponsoredMessageReportOption", [("text", self.text as Any), ("option", self.option as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sponsoredMessageReportOption", [("text", ConstructorParameterDescription(self.text)), ("option", ConstructorParameterDescription(self.option))]) } } case sponsoredMessageReportOption(Cons_sponsoredMessageReportOption) @@ -769,10 +309,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sponsoredMessageReportOption(let _data): - return ("sponsoredMessageReportOption", [("text", _data.text as Any), ("option", _data.option as Any)]) + return ("sponsoredMessageReportOption", [("text", ConstructorParameterDescription(_data.text)), ("option", ConstructorParameterDescription(_data.option))]) } } @@ -807,8 +347,8 @@ public extension Api { self.sponsorInfo = sponsorInfo self.additionalInfo = additionalInfo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sponsoredPeer", [("flags", self.flags as Any), ("randomId", self.randomId as Any), ("peer", self.peer as Any), ("sponsorInfo", self.sponsorInfo as Any), ("additionalInfo", self.additionalInfo as Any)]) + 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) @@ -832,10 +372,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sponsoredPeer(let _data): - return ("sponsoredPeer", [("flags", _data.flags as Any), ("randomId", _data.randomId as Any), ("peer", _data.peer as Any), ("sponsorInfo", _data.sponsorInfo as Any), ("additionalInfo", _data.additionalInfo as Any)]) + return ("sponsoredPeer", [("flags", ConstructorParameterDescription(_data.flags)), ("randomId", ConstructorParameterDescription(_data.randomId)), ("peer", ConstructorParameterDescription(_data.peer)), ("sponsorInfo", ConstructorParameterDescription(_data.sponsorInfo)), ("additionalInfo", ConstructorParameterDescription(_data.additionalInfo))]) } } @@ -919,8 +459,8 @@ public extension Api { self.upgradeVariants = upgradeVariants self.background = background } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGift", [("flags", self.flags as Any), ("id", self.id as Any), ("sticker", self.sticker as Any), ("stars", self.stars as Any), ("availabilityRemains", self.availabilityRemains as Any), ("availabilityTotal", self.availabilityTotal as Any), ("availabilityResale", self.availabilityResale as Any), ("convertStars", self.convertStars as Any), ("firstSaleDate", self.firstSaleDate as Any), ("lastSaleDate", self.lastSaleDate as Any), ("upgradeStars", self.upgradeStars as Any), ("resellMinStars", self.resellMinStars as Any), ("title", self.title as Any), ("releasedBy", self.releasedBy as Any), ("perUserTotal", self.perUserTotal as Any), ("perUserRemains", self.perUserRemains as Any), ("lockedUntilDate", self.lockedUntilDate as Any), ("auctionSlug", self.auctionSlug as Any), ("giftsPerRound", self.giftsPerRound as Any), ("auctionStartDate", self.auctionStartDate as Any), ("upgradeVariants", self.upgradeVariants as Any), ("background", self.background as Any)]) + 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 { @@ -972,8 +512,8 @@ public extension Api { self.offerMinStars = offerMinStars self.craftChancePermille = craftChancePermille } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftUnique", [("flags", self.flags as Any), ("id", self.id as Any), ("giftId", self.giftId as Any), ("title", self.title as Any), ("slug", self.slug as Any), ("num", self.num as Any), ("ownerId", self.ownerId as Any), ("ownerName", self.ownerName as Any), ("ownerAddress", self.ownerAddress as Any), ("attributes", self.attributes as Any), ("availabilityIssued", self.availabilityIssued as Any), ("availabilityTotal", self.availabilityTotal as Any), ("giftAddress", self.giftAddress as Any), ("resellAmount", self.resellAmount as Any), ("releasedBy", self.releasedBy as Any), ("valueAmount", self.valueAmount as Any), ("valueCurrency", self.valueCurrency as Any), ("valueUsdAmount", self.valueUsdAmount as Any), ("themePeer", self.themePeer as Any), ("peerColor", self.peerColor as Any), ("hostId", self.hostId as Any), ("offerMinStars", self.offerMinStars as Any), ("craftChancePermille", self.craftChancePermille as Any)]) + 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) @@ -1109,12 +649,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGift(let _data): - return ("starGift", [("flags", _data.flags as Any), ("id", _data.id as Any), ("sticker", _data.sticker as Any), ("stars", _data.stars as Any), ("availabilityRemains", _data.availabilityRemains as Any), ("availabilityTotal", _data.availabilityTotal as Any), ("availabilityResale", _data.availabilityResale as Any), ("convertStars", _data.convertStars as Any), ("firstSaleDate", _data.firstSaleDate as Any), ("lastSaleDate", _data.lastSaleDate as Any), ("upgradeStars", _data.upgradeStars as Any), ("resellMinStars", _data.resellMinStars as Any), ("title", _data.title as Any), ("releasedBy", _data.releasedBy as Any), ("perUserTotal", _data.perUserTotal as Any), ("perUserRemains", _data.perUserRemains as Any), ("lockedUntilDate", _data.lockedUntilDate as Any), ("auctionSlug", _data.auctionSlug as Any), ("giftsPerRound", _data.giftsPerRound as Any), ("auctionStartDate", _data.auctionStartDate as Any), ("upgradeVariants", _data.upgradeVariants as Any), ("background", _data.background as Any)]) + 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", _data.flags as Any), ("id", _data.id as Any), ("giftId", _data.giftId as Any), ("title", _data.title as Any), ("slug", _data.slug as Any), ("num", _data.num as Any), ("ownerId", _data.ownerId as Any), ("ownerName", _data.ownerName as Any), ("ownerAddress", _data.ownerAddress as Any), ("attributes", _data.attributes as Any), ("availabilityIssued", _data.availabilityIssued as Any), ("availabilityTotal", _data.availabilityTotal as Any), ("giftAddress", _data.giftAddress as Any), ("resellAmount", _data.resellAmount as Any), ("releasedBy", _data.releasedBy as Any), ("valueAmount", _data.valueAmount as Any), ("valueCurrency", _data.valueCurrency as Any), ("valueUsdAmount", _data.valueUsdAmount as Any), ("themePeer", _data.themePeer as Any), ("peerColor", _data.peerColor as Any), ("hostId", _data.hostId as Any), ("offerMinStars", _data.offerMinStars as Any), ("craftChancePermille", _data.craftChancePermille as Any)]) + 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))]) } } @@ -1364,8 +904,8 @@ public extension Api { self.state = state self.userState = userState } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftActiveAuctionState", [("gift", self.gift as Any), ("state", self.state as Any), ("userState", self.userState as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftActiveAuctionState", [("gift", ConstructorParameterDescription(self.gift)), ("state", ConstructorParameterDescription(self.state)), ("userState", ConstructorParameterDescription(self.userState))]) } } case starGiftActiveAuctionState(Cons_starGiftActiveAuctionState) @@ -1383,10 +923,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftActiveAuctionState(let _data): - return ("starGiftActiveAuctionState", [("gift", _data.gift as Any), ("state", _data.state as Any), ("userState", _data.userState as Any)]) + return ("starGiftActiveAuctionState", [("gift", ConstructorParameterDescription(_data.gift)), ("state", ConstructorParameterDescription(_data.state)), ("userState", ConstructorParameterDescription(_data.userState))]) } } @@ -1434,8 +974,8 @@ public extension Api { self.textColor = textColor self.rarity = rarity } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAttributeBackdrop", [("name", self.name as Any), ("backdropId", self.backdropId as Any), ("centerColor", self.centerColor as Any), ("edgeColor", self.edgeColor as Any), ("patternColor", self.patternColor as Any), ("textColor", self.textColor as Any), ("rarity", self.rarity as Any)]) + 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 { @@ -1449,8 +989,8 @@ public extension Api { self.document = document self.rarity = rarity } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAttributeModel", [("flags", self.flags as Any), ("name", self.name as Any), ("document", self.document as Any), ("rarity", self.rarity as Any)]) + 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 { @@ -1466,8 +1006,8 @@ public extension Api { self.date = date self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAttributeOriginalDetails", [("flags", self.flags as Any), ("senderId", self.senderId as Any), ("recipientId", self.recipientId as Any), ("date", self.date as Any), ("message", self.message as Any)]) + 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 { @@ -1479,8 +1019,8 @@ public extension Api { self.document = document self.rarity = rarity } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAttributePattern", [("name", self.name as Any), ("document", self.document as Any), ("rarity", self.rarity as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAttributePattern", [("name", ConstructorParameterDescription(self.name)), ("document", ConstructorParameterDescription(self.document)), ("rarity", ConstructorParameterDescription(self.rarity))]) } } case starGiftAttributeBackdrop(Cons_starGiftAttributeBackdrop) @@ -1536,16 +1076,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftAttributeBackdrop(let _data): - return ("starGiftAttributeBackdrop", [("name", _data.name as Any), ("backdropId", _data.backdropId as Any), ("centerColor", _data.centerColor as Any), ("edgeColor", _data.edgeColor as Any), ("patternColor", _data.patternColor as Any), ("textColor", _data.textColor as Any), ("rarity", _data.rarity as Any)]) + 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", _data.flags as Any), ("name", _data.name as Any), ("document", _data.document as Any), ("rarity", _data.rarity as Any)]) + 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", _data.flags as Any), ("senderId", _data.senderId as Any), ("recipientId", _data.recipientId as Any), ("date", _data.date as Any), ("message", _data.message as Any)]) + 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", _data.name as Any), ("document", _data.document as Any), ("rarity", _data.rarity as Any)]) + return ("starGiftAttributePattern", [("name", ConstructorParameterDescription(_data.name)), ("document", ConstructorParameterDescription(_data.document)), ("rarity", ConstructorParameterDescription(_data.rarity))]) } } @@ -1660,3 +1200,1022 @@ public extension Api { } } } +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!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities + } + } + var _8: Int32? + if Int(_1!) & Int(1 << 2) != 0 { + _8 = reader.readInt32() + } + 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!) & Int(1 << 1) == 0) || _7 != nil + let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { + return Api.StarGiftAuctionAcquiredGift.starGiftAuctionAcquiredGift(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!) & Int(1 << 0) != 0 { + _5 = reader.readInt32() + } + var _6: Int32? + if Int(_1!) & Int(1 << 1) != 0 { + _6 = reader.readInt32() + } + var _7: String? + if Int(_1!) & 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!) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil + let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { + return Api.StarGiftAuctionState.starGiftAuctionStateFinished(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!) & Int(1 << 0) != 0 { + _2 = reader.readInt64() + } + var _3: Int32? + if Int(_1!) & Int(1 << 0) != 0 { + _3 = reader.readInt32() + } + var _4: Int64? + if Int(_1!) & Int(1 << 0) != 0 { + _4 = reader.readInt64() + } + var _5: Api.Peer? + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _5 = Api.parse(reader, signature: signature) as? Api.Peer + } + } + var _6: Int32? + _6 = reader.readInt32() + let _c1 = _1 != nil + let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil + let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil + let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil + let _c6 = _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.StarGiftAuctionUserState.starGiftAuctionUserState(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.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))]) + } + } + case starGiftCollection(Cons_starGiftCollection) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starGiftCollection(let _data): + if boxed { + buffer.appendInt32(-1653926992) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt32(_data.collectionId, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + _data.icon!.serialize(buffer, true) + } + serializeInt32(_data.giftsCount, buffer: buffer, boxed: false) + serializeInt64(_data.hash, buffer: buffer, boxed: false) + break + } + } + + public func descriptionFields() -> (String, [(String, 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))]) + } + } + + public static func parse_starGiftCollection(_ reader: BufferReader) -> StarGiftCollection? { + var _1: Int32? + _1 = reader.readInt32() + var _2: Int32? + _2 = reader.readInt32() + var _3: String? + _3 = parseString(reader) + var _4: Api.Document? + if Int(_1!) & Int(1 << 0) != 0 { + if let signature = reader.readInt32() { + _4 = Api.parse(reader, signature: signature) as? Api.Document + } + } + 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!) & 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.StarGiftUpgradePrice.starGiftUpgradePrice(Cons_starGiftUpgradePrice(date: _1!, upgradeStars: _2!)) + } + else { + return nil + } + } + } +} +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) + + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { + switch self { + case .starRefProgram(let _data): + if boxed { + buffer.appendInt32(-586389774) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.botId, buffer: buffer, boxed: false) + serializeInt32(_data.commissionPermille, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 0) != 0 { + serializeInt32(_data.durationMonths!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 1) != 0 { + serializeInt32(_data.endDate!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.dailyRevenuePerUser!.serialize(buffer, true) + } + break + } + } + + public func descriptionFields() -> (String, [(String, 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!) & Int(1 << 0) != 0 { + _4 = reader.readInt32() + } + var _5: Int32? + if Int(_1!) & Int(1 << 1) != 0 { + _5 = reader.readInt32() + } + var _6: Api.StarsAmount? + if Int(_1!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.StarsAmount + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil + let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil + let _c6 = (Int(_1!) & 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 + } + } + } +} diff --git a/submodules/TelegramApi/Sources/Api26.swift b/submodules/TelegramApi/Sources/Api26.swift index 5788786607..8bc5c73f45 100644 --- a/submodules/TelegramApi/Sources/Api26.swift +++ b/submodules/TelegramApi/Sources/Api26.swift @@ -1,1022 +1,3 @@ -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, Any)]) { - return ("starGiftAttributeCounter", [("attribute", self.attribute as Any), ("count", self.count as Any)]) - } - } - case starGiftAttributeCounter(Cons_starGiftAttributeCounter) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAttributeCounter(let _data): - if boxed { - buffer.appendInt32(783398488) - } - _data.attribute.serialize(buffer, true) - serializeInt32(_data.count, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAttributeCounter(let _data): - return ("starGiftAttributeCounter", [("attribute", _data.attribute as Any), ("count", _data.count as Any)]) - } - } - - public static func parse_starGiftAttributeCounter(_ reader: BufferReader) -> StarGiftAttributeCounter? { - var _1: Api.StarGiftAttributeId? - if let signature = reader.readInt32() { - _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, Any)]) { - return ("starGiftAttributeIdBackdrop", [("backdropId", self.backdropId as Any)]) - } - } - public class Cons_starGiftAttributeIdModel: TypeConstructorDescription { - public var documentId: Int64 - public init(documentId: Int64) { - self.documentId = documentId - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAttributeIdModel", [("documentId", self.documentId as Any)]) - } - } - public class Cons_starGiftAttributeIdPattern: TypeConstructorDescription { - public var documentId: Int64 - public init(documentId: Int64) { - self.documentId = documentId - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAttributeIdPattern", [("documentId", self.documentId as Any)]) - } - } - case starGiftAttributeIdBackdrop(Cons_starGiftAttributeIdBackdrop) - case starGiftAttributeIdModel(Cons_starGiftAttributeIdModel) - case starGiftAttributeIdPattern(Cons_starGiftAttributeIdPattern) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAttributeIdBackdrop(let _data): - if boxed { - buffer.appendInt32(520210263) - } - serializeInt32(_data.backdropId, buffer: buffer, boxed: false) - break - case .starGiftAttributeIdModel(let _data): - if boxed { - buffer.appendInt32(1219145276) - } - serializeInt64(_data.documentId, buffer: buffer, boxed: false) - break - case .starGiftAttributeIdPattern(let _data): - if boxed { - buffer.appendInt32(1242965043) - } - serializeInt64(_data.documentId, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAttributeIdBackdrop(let _data): - return ("starGiftAttributeIdBackdrop", [("backdropId", _data.backdropId as Any)]) - case .starGiftAttributeIdModel(let _data): - return ("starGiftAttributeIdModel", [("documentId", _data.documentId as Any)]) - case .starGiftAttributeIdPattern(let _data): - return ("starGiftAttributeIdPattern", [("documentId", _data.documentId as Any)]) - } - } - - public static func parse_starGiftAttributeIdBackdrop(_ reader: BufferReader) -> StarGiftAttributeId? { - var _1: Int32? - _1 = reader.readInt32() - let _c1 = _1 != nil - if _c1 { - return Api.StarGiftAttributeId.starGiftAttributeIdBackdrop(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, Any)]) { - return ("starGiftAttributeRarity", [("permille", self.permille as Any)]) - } - } - 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, Any)]) { - switch self { - case .starGiftAttributeRarity(let _data): - return ("starGiftAttributeRarity", [("permille", _data.permille as Any)]) - 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, Any)]) { - return ("starGiftAuctionAcquiredGift", [("flags", self.flags as Any), ("peer", self.peer as Any), ("date", self.date as Any), ("bidAmount", self.bidAmount as Any), ("round", self.round as Any), ("pos", self.pos as Any), ("message", self.message as Any), ("giftNum", self.giftNum as Any)]) - } - } - case starGiftAuctionAcquiredGift(Cons_starGiftAuctionAcquiredGift) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionAcquiredGift(let _data): - if boxed { - buffer.appendInt32(1118831432) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.peer.serialize(buffer, true) - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt64(_data.bidAmount, buffer: buffer, boxed: false) - serializeInt32(_data.round, buffer: buffer, boxed: false) - serializeInt32(_data.pos, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 1) != 0 { - _data.message!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - serializeInt32(_data.giftNum!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionAcquiredGift(let _data): - return ("starGiftAuctionAcquiredGift", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("date", _data.date as Any), ("bidAmount", _data.bidAmount as Any), ("round", _data.round as Any), ("pos", _data.pos as Any), ("message", _data.message as Any), ("giftNum", _data.giftNum as Any)]) - } - } - - public static func parse_starGiftAuctionAcquiredGift(_ reader: BufferReader) -> StarGiftAuctionAcquiredGift? { - var _1: Int32? - _1 = reader.readInt32() - 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!) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _7 = Api.parse(reader, signature: signature) as? Api.TextWithEntities - } - } - var _8: Int32? - if Int(_1!) & Int(1 << 2) != 0 { - _8 = reader.readInt32() - } - 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!) & Int(1 << 1) == 0) || _7 != nil - let _c8 = (Int(_1!) & Int(1 << 2) == 0) || _8 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 { - return Api.StarGiftAuctionAcquiredGift.starGiftAuctionAcquiredGift(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, Any)]) { - return ("starGiftAuctionRound", [("num", self.num as Any), ("duration", self.duration as Any)]) - } - } - 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, Any)]) { - return ("starGiftAuctionRoundExtendable", [("num", self.num as Any), ("duration", self.duration as Any), ("extendTop", self.extendTop as Any), ("extendWindow", self.extendWindow as Any)]) - } - } - case starGiftAuctionRound(Cons_starGiftAuctionRound) - case starGiftAuctionRoundExtendable(Cons_starGiftAuctionRoundExtendable) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionRound(let _data): - if boxed { - buffer.appendInt32(984483112) - } - serializeInt32(_data.num, buffer: buffer, boxed: false) - serializeInt32(_data.duration, buffer: buffer, boxed: false) - break - case .starGiftAuctionRoundExtendable(let _data): - if boxed { - buffer.appendInt32(178266597) - } - serializeInt32(_data.num, buffer: buffer, boxed: false) - serializeInt32(_data.duration, buffer: buffer, boxed: false) - serializeInt32(_data.extendTop, buffer: buffer, boxed: false) - serializeInt32(_data.extendWindow, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionRound(let _data): - return ("starGiftAuctionRound", [("num", _data.num as Any), ("duration", _data.duration as Any)]) - case .starGiftAuctionRoundExtendable(let _data): - return ("starGiftAuctionRoundExtendable", [("num", _data.num as Any), ("duration", _data.duration as Any), ("extendTop", _data.extendTop as Any), ("extendWindow", _data.extendWindow as Any)]) - } - } - - public static func parse_starGiftAuctionRound(_ reader: BufferReader) -> StarGiftAuctionRound? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("starGiftAuctionState", [("version", self.version as Any), ("startDate", self.startDate as Any), ("endDate", self.endDate as Any), ("minBidAmount", self.minBidAmount as Any), ("bidLevels", self.bidLevels as Any), ("topBidders", self.topBidders as Any), ("nextRoundAt", self.nextRoundAt as Any), ("lastGiftNum", self.lastGiftNum as Any), ("giftsLeft", self.giftsLeft as Any), ("currentRound", self.currentRound as Any), ("totalRounds", self.totalRounds as Any), ("rounds", self.rounds as Any)]) - } - } - 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, Any)]) { - return ("starGiftAuctionStateFinished", [("flags", self.flags as Any), ("startDate", self.startDate as Any), ("endDate", self.endDate as Any), ("averagePrice", self.averagePrice as Any), ("listedCount", self.listedCount as Any), ("fragmentListedCount", self.fragmentListedCount as Any), ("fragmentListedUrl", self.fragmentListedUrl as Any)]) - } - } - 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, Any)]) { - switch self { - case .starGiftAuctionState(let _data): - return ("starGiftAuctionState", [("version", _data.version as Any), ("startDate", _data.startDate as Any), ("endDate", _data.endDate as Any), ("minBidAmount", _data.minBidAmount as Any), ("bidLevels", _data.bidLevels as Any), ("topBidders", _data.topBidders as Any), ("nextRoundAt", _data.nextRoundAt as Any), ("lastGiftNum", _data.lastGiftNum as Any), ("giftsLeft", _data.giftsLeft as Any), ("currentRound", _data.currentRound as Any), ("totalRounds", _data.totalRounds as Any), ("rounds", _data.rounds as Any)]) - case .starGiftAuctionStateFinished(let _data): - return ("starGiftAuctionStateFinished", [("flags", _data.flags as Any), ("startDate", _data.startDate as Any), ("endDate", _data.endDate as Any), ("averagePrice", _data.averagePrice as Any), ("listedCount", _data.listedCount as Any), ("fragmentListedCount", _data.fragmentListedCount as Any), ("fragmentListedUrl", _data.fragmentListedUrl as Any)]) - case .starGiftAuctionStateNotModified: - return ("starGiftAuctionStateNotModified", []) - } - } - - public static func parse_starGiftAuctionState(_ reader: BufferReader) -> StarGiftAuctionState? { - var _1: Int32? - _1 = reader.readInt32() - 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!) & Int(1 << 0) != 0 { - _5 = reader.readInt32() - } - var _6: Int32? - if Int(_1!) & Int(1 << 1) != 0 { - _6 = reader.readInt32() - } - var _7: String? - if Int(_1!) & 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!) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil - let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 { - return Api.StarGiftAuctionState.starGiftAuctionStateFinished(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, Any)]) { - return ("starGiftAuctionUserState", [("flags", self.flags as Any), ("bidAmount", self.bidAmount as Any), ("bidDate", self.bidDate as Any), ("minBidAmount", self.minBidAmount as Any), ("bidPeer", self.bidPeer as Any), ("acquiredCount", self.acquiredCount as Any)]) - } - } - case starGiftAuctionUserState(Cons_starGiftAuctionUserState) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftAuctionUserState(let _data): - if boxed { - buffer.appendInt32(787403204) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeInt64(_data.bidAmount!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeInt32(_data.bidDate!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeInt64(_data.minBidAmount!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.bidPeer!.serialize(buffer, true) - } - serializeInt32(_data.acquiredCount, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftAuctionUserState(let _data): - return ("starGiftAuctionUserState", [("flags", _data.flags as Any), ("bidAmount", _data.bidAmount as Any), ("bidDate", _data.bidDate as Any), ("minBidAmount", _data.minBidAmount as Any), ("bidPeer", _data.bidPeer as Any), ("acquiredCount", _data.acquiredCount as Any)]) - } - } - - public static func parse_starGiftAuctionUserState(_ reader: BufferReader) -> StarGiftAuctionUserState? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - if Int(_1!) & Int(1 << 0) != 0 { - _2 = reader.readInt64() - } - var _3: Int32? - if Int(_1!) & Int(1 << 0) != 0 { - _3 = reader.readInt32() - } - var _4: Int64? - if Int(_1!) & Int(1 << 0) != 0 { - _4 = reader.readInt64() - } - var _5: Api.Peer? - if Int(_1!) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _5 = Api.parse(reader, signature: signature) as? Api.Peer - } - } - var _6: Int32? - _6 = reader.readInt32() - let _c1 = _1 != nil - let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil - let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil - let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil - let _c6 = _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.StarGiftAuctionUserState.starGiftAuctionUserState(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, Any)]) { - return ("starGiftBackground", [("centerColor", self.centerColor as Any), ("edgeColor", self.edgeColor as Any), ("textColor", self.textColor as Any)]) - } - } - case starGiftBackground(Cons_starGiftBackground) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftBackground(let _data): - if boxed { - buffer.appendInt32(-1342872680) - } - serializeInt32(_data.centerColor, buffer: buffer, boxed: false) - serializeInt32(_data.edgeColor, buffer: buffer, boxed: false) - serializeInt32(_data.textColor, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftBackground(let _data): - return ("starGiftBackground", [("centerColor", _data.centerColor as Any), ("edgeColor", _data.edgeColor as Any), ("textColor", _data.textColor as Any)]) - } - } - - public static func parse_starGiftBackground(_ reader: BufferReader) -> StarGiftBackground? { - var _1: Int32? - _1 = reader.readInt32() - 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.hash = hash - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftCollection", [("flags", self.flags as Any), ("collectionId", self.collectionId as Any), ("title", self.title as Any), ("icon", self.icon as Any), ("giftsCount", self.giftsCount as Any), ("hash", self.hash as Any)]) - } - } - case starGiftCollection(Cons_starGiftCollection) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftCollection(let _data): - if boxed { - buffer.appendInt32(-1653926992) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt32(_data.collectionId, buffer: buffer, boxed: false) - serializeString(_data.title, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - _data.icon!.serialize(buffer, true) - } - serializeInt32(_data.giftsCount, buffer: buffer, boxed: false) - serializeInt64(_data.hash, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftCollection(let _data): - return ("starGiftCollection", [("flags", _data.flags as Any), ("collectionId", _data.collectionId as Any), ("title", _data.title as Any), ("icon", _data.icon as Any), ("giftsCount", _data.giftsCount as Any), ("hash", _data.hash as Any)]) - } - } - - public static func parse_starGiftCollection(_ reader: BufferReader) -> StarGiftCollection? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - _2 = reader.readInt32() - var _3: String? - _3 = parseString(reader) - var _4: Api.Document? - if Int(_1!) & Int(1 << 0) != 0 { - if let signature = reader.readInt32() { - _4 = Api.parse(reader, signature: signature) as? Api.Document - } - } - 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!) & 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, Any)]) { - return ("starGiftUpgradePrice", [("date", self.date as Any), ("upgradeStars", self.upgradeStars as Any)]) - } - } - case starGiftUpgradePrice(Cons_starGiftUpgradePrice) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starGiftUpgradePrice(let _data): - if boxed { - buffer.appendInt32(-1712704739) - } - serializeInt32(_data.date, buffer: buffer, boxed: false) - serializeInt64(_data.upgradeStars, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starGiftUpgradePrice(let _data): - return ("starGiftUpgradePrice", [("date", _data.date as Any), ("upgradeStars", _data.upgradeStars as Any)]) - } - } - - public static func parse_starGiftUpgradePrice(_ reader: BufferReader) -> StarGiftUpgradePrice? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - let _c1 = _1 != nil - let _c2 = _2 != nil - if _c1 && _c2 { - return Api.StarGiftUpgradePrice.starGiftUpgradePrice(Cons_starGiftUpgradePrice(date: _1!, upgradeStars: _2!)) - } - else { - return nil - } - } - } -} -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, Any)]) { - return ("starRefProgram", [("flags", self.flags as Any), ("botId", self.botId as Any), ("commissionPermille", self.commissionPermille as Any), ("durationMonths", self.durationMonths as Any), ("endDate", self.endDate as Any), ("dailyRevenuePerUser", self.dailyRevenuePerUser as Any)]) - } - } - case starRefProgram(Cons_starRefProgram) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .starRefProgram(let _data): - if boxed { - buffer.appendInt32(-586389774) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.botId, buffer: buffer, boxed: false) - serializeInt32(_data.commissionPermille, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeInt32(_data.durationMonths!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 1) != 0 { - serializeInt32(_data.endDate!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 2) != 0 { - _data.dailyRevenuePerUser!.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .starRefProgram(let _data): - return ("starRefProgram", [("flags", _data.flags as Any), ("botId", _data.botId as Any), ("commissionPermille", _data.commissionPermille as Any), ("durationMonths", _data.durationMonths as Any), ("endDate", _data.endDate as Any), ("dailyRevenuePerUser", _data.dailyRevenuePerUser as Any)]) - } - } - - public static func parse_starRefProgram(_ reader: BufferReader) -> StarRefProgram? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int64? - _2 = reader.readInt64() - var _3: Int32? - _3 = reader.readInt32() - var _4: Int32? - if Int(_1!) & Int(1 << 0) != 0 { - _4 = reader.readInt32() - } - var _5: Int32? - if Int(_1!) & Int(1 << 1) != 0 { - _5 = reader.readInt32() - } - var _6: Api.StarsAmount? - if Int(_1!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.StarsAmount - } - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil - let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil - let _c6 = (Int(_1!) & 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 { @@ -1026,8 +7,8 @@ public extension Api { self.amount = amount self.nanos = nanos } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsAmount", [("amount", self.amount as Any), ("nanos", self.nanos as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsAmount", [("amount", ConstructorParameterDescription(self.amount)), ("nanos", ConstructorParameterDescription(self.nanos))]) } } public class Cons_starsTonAmount: TypeConstructorDescription { @@ -1035,8 +16,8 @@ public extension Api { public init(amount: Int64) { self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsTonAmount", [("amount", self.amount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsTonAmount", [("amount", ConstructorParameterDescription(self.amount))]) } } case starsAmount(Cons_starsAmount) @@ -1060,12 +41,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsAmount(let _data): - return ("starsAmount", [("amount", _data.amount as Any), ("nanos", _data.nanos as Any)]) + return ("starsAmount", [("amount", ConstructorParameterDescription(_data.amount)), ("nanos", ConstructorParameterDescription(_data.nanos))]) case .starsTonAmount(let _data): - return ("starsTonAmount", [("amount", _data.amount as Any)]) + return ("starsTonAmount", [("amount", ConstructorParameterDescription(_data.amount))]) } } @@ -1111,8 +92,8 @@ public extension Api { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsGiftOption", [("flags", self.flags as Any), ("stars", self.stars as Any), ("storeProduct", self.storeProduct as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + 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) @@ -1134,10 +115,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsGiftOption(let _data): - return ("starsGiftOption", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("storeProduct", _data.storeProduct as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + return ("starsGiftOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) } } @@ -1187,8 +168,8 @@ public extension Api { self.amount = amount self.winners = winners } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsGiveawayOption", [("flags", self.flags as Any), ("stars", self.stars as Any), ("yearlyBoosts", self.yearlyBoosts as Any), ("storeProduct", self.storeProduct as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("winners", self.winners as Any)]) + 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) @@ -1216,10 +197,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsGiveawayOption(let _data): - return ("starsGiveawayOption", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("yearlyBoosts", _data.yearlyBoosts as Any), ("storeProduct", _data.storeProduct as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("winners", _data.winners as Any)]) + 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))]) } } @@ -1269,8 +250,8 @@ public extension Api { self.users = users self.perUserStars = perUserStars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsGiveawayWinnersOption", [("flags", self.flags as Any), ("users", self.users as Any), ("perUserStars", self.perUserStars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsGiveawayWinnersOption", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("perUserStars", ConstructorParameterDescription(self.perUserStars))]) } } case starsGiveawayWinnersOption(Cons_starsGiveawayWinnersOption) @@ -1288,10 +269,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsGiveawayWinnersOption(let _data): - return ("starsGiveawayWinnersOption", [("flags", _data.flags as Any), ("users", _data.users as Any), ("perUserStars", _data.perUserStars as Any)]) + return ("starsGiveawayWinnersOption", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("perUserStars", ConstructorParameterDescription(_data.perUserStars))]) } } @@ -1329,8 +310,8 @@ public extension Api { self.stars = stars self.nextLevelStars = nextLevelStars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsRating", [("flags", self.flags as Any), ("level", self.level as Any), ("currentLevelStars", self.currentLevelStars as Any), ("stars", self.stars as Any), ("nextLevelStars", self.nextLevelStars as Any)]) + 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) @@ -1352,10 +333,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsRating(let _data): - return ("starsRating", [("flags", _data.flags as Any), ("level", _data.level as Any), ("currentLevelStars", _data.currentLevelStars as Any), ("stars", _data.stars as Any), ("nextLevelStars", _data.nextLevelStars as Any)]) + return ("starsRating", [("flags", ConstructorParameterDescription(_data.flags)), ("level", ConstructorParameterDescription(_data.level)), ("currentLevelStars", ConstructorParameterDescription(_data.currentLevelStars)), ("stars", ConstructorParameterDescription(_data.stars)), ("nextLevelStars", ConstructorParameterDescription(_data.nextLevelStars))]) } } @@ -1401,8 +382,8 @@ public extension Api { self.overallRevenue = overallRevenue self.nextWithdrawalAt = nextWithdrawalAt } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsRevenueStatus", [("flags", self.flags as Any), ("currentBalance", self.currentBalance as Any), ("availableBalance", self.availableBalance as Any), ("overallRevenue", self.overallRevenue as Any), ("nextWithdrawalAt", self.nextWithdrawalAt as Any)]) + 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) @@ -1424,10 +405,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsRevenueStatus(let _data): - return ("starsRevenueStatus", [("flags", _data.flags as Any), ("currentBalance", _data.currentBalance as Any), ("availableBalance", _data.availableBalance as Any), ("overallRevenue", _data.overallRevenue as Any), ("nextWithdrawalAt", _data.nextWithdrawalAt as Any)]) + return ("starsRevenueStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("currentBalance", ConstructorParameterDescription(_data.currentBalance)), ("availableBalance", ConstructorParameterDescription(_data.availableBalance)), ("overallRevenue", ConstructorParameterDescription(_data.overallRevenue)), ("nextWithdrawalAt", ConstructorParameterDescription(_data.nextWithdrawalAt))]) } } @@ -1487,8 +468,8 @@ public extension Api { self.photo = photo self.invoiceSlug = invoiceSlug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsSubscription", [("flags", self.flags as Any), ("id", self.id as Any), ("peer", self.peer as Any), ("untilDate", self.untilDate as Any), ("pricing", self.pricing as Any), ("chatInviteHash", self.chatInviteHash as Any), ("title", self.title as Any), ("photo", self.photo as Any), ("invoiceSlug", self.invoiceSlug as Any)]) + 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) @@ -1520,10 +501,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsSubscription(let _data): - return ("starsSubscription", [("flags", _data.flags as Any), ("id", _data.id as Any), ("peer", _data.peer as Any), ("untilDate", _data.untilDate as Any), ("pricing", _data.pricing as Any), ("chatInviteHash", _data.chatInviteHash as Any), ("title", _data.title as Any), ("photo", _data.photo as Any), ("invoiceSlug", _data.invoiceSlug as Any)]) + 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))]) } } @@ -1587,8 +568,8 @@ public extension Api { self.period = period self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsSubscriptionPricing", [("period", self.period as Any), ("amount", self.amount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsSubscriptionPricing", [("period", ConstructorParameterDescription(self.period)), ("amount", ConstructorParameterDescription(self.amount))]) } } case starsSubscriptionPricing(Cons_starsSubscriptionPricing) @@ -1605,10 +586,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsSubscriptionPricing(let _data): - return ("starsSubscriptionPricing", [("period", _data.period as Any), ("amount", _data.amount as Any)]) + return ("starsSubscriptionPricing", [("period", ConstructorParameterDescription(_data.period)), ("amount", ConstructorParameterDescription(_data.amount))]) } } @@ -1643,8 +624,8 @@ public extension Api { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsTopupOption", [("flags", self.flags as Any), ("stars", self.stars as Any), ("storeProduct", self.storeProduct as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + 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) @@ -1666,10 +647,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsTopupOption(let _data): - return ("starsTopupOption", [("flags", _data.flags as Any), ("stars", _data.stars as Any), ("storeProduct", _data.storeProduct as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + return ("starsTopupOption", [("flags", ConstructorParameterDescription(_data.flags)), ("stars", ConstructorParameterDescription(_data.stars)), ("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) } } @@ -1753,8 +734,8 @@ public extension Api { self.adsProceedsFromDate = adsProceedsFromDate self.adsProceedsToDate = adsProceedsToDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsTransaction", [("flags", self.flags as Any), ("id", self.id as Any), ("amount", self.amount as Any), ("date", self.date as Any), ("peer", self.peer as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("transactionDate", self.transactionDate as Any), ("transactionUrl", self.transactionUrl as Any), ("botPayload", self.botPayload as Any), ("msgId", self.msgId as Any), ("extendedMedia", self.extendedMedia as Any), ("subscriptionPeriod", self.subscriptionPeriod as Any), ("giveawayPostId", self.giveawayPostId as Any), ("stargift", self.stargift as Any), ("floodskipNumber", self.floodskipNumber as Any), ("starrefCommissionPermille", self.starrefCommissionPermille as Any), ("starrefPeer", self.starrefPeer as Any), ("starrefAmount", self.starrefAmount as Any), ("paidMessages", self.paidMessages as Any), ("premiumGiftMonths", self.premiumGiftMonths as Any), ("adsProceedsFromDate", self.adsProceedsFromDate as Any), ("adsProceedsToDate", self.adsProceedsToDate as Any)]) + 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) @@ -1835,10 +816,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsTransaction(let _data): - return ("starsTransaction", [("flags", _data.flags as Any), ("id", _data.id as Any), ("amount", _data.amount as Any), ("date", _data.date as Any), ("peer", _data.peer as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("transactionDate", _data.transactionDate as Any), ("transactionUrl", _data.transactionUrl as Any), ("botPayload", _data.botPayload as Any), ("msgId", _data.msgId as Any), ("extendedMedia", _data.extendedMedia as Any), ("subscriptionPeriod", _data.subscriptionPeriod as Any), ("giveawayPostId", _data.giveawayPostId as Any), ("stargift", _data.stargift as Any), ("floodskipNumber", _data.floodskipNumber as Any), ("starrefCommissionPermille", _data.starrefCommissionPermille as Any), ("starrefPeer", _data.starrefPeer as Any), ("starrefAmount", _data.starrefAmount as Any), ("paidMessages", _data.paidMessages as Any), ("premiumGiftMonths", _data.premiumGiftMonths as Any), ("adsProceedsFromDate", _data.adsProceedsFromDate as Any), ("adsProceedsToDate", _data.adsProceedsToDate as Any)]) + 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))]) } } @@ -1983,8 +964,8 @@ public extension Api { public init(peer: Api.Peer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsTransactionPeer", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsTransactionPeer", [("peer", ConstructorParameterDescription(self.peer))]) } } case starsTransactionPeer(Cons_starsTransactionPeer) @@ -2042,10 +1023,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsTransactionPeer(let _data): - return ("starsTransactionPeer", [("peer", _data.peer as Any)]) + return ("starsTransactionPeer", [("peer", ConstructorParameterDescription(_data.peer))]) case .starsTransactionPeerAPI: return ("starsTransactionPeerAPI", []) case .starsTransactionPeerAds: @@ -2099,3 +1080,733 @@ public extension Api { } } } +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!) & Int(1 << 0) != 0 { + _3 = parseString(reader) + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil + if _c1 && _c2 && _c3 { + return Api.StatsGraph.statsGraph(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!) & 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!) & Int(1 << 4) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) + } + } + var _8: Int32? + if Int(_1!) & Int(1 << 4) != 0 { + _8 = reader.readInt32() + } + var _9: Int32? + if Int(_1!) & Int(1 << 4) != 0 { + _9 = reader.readInt32() + } + var _10: Int64? + if Int(_1!) & 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!) & 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!) & Int(1 << 4) == 0) || _7 != nil + let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil + let _c9 = (Int(_1!) & Int(1 << 4) == 0) || _9 != nil + let _c10 = (Int(_1!) & 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 + } + } + } +} diff --git a/submodules/TelegramApi/Sources/Api27.swift b/submodules/TelegramApi/Sources/Api27.swift index e9e2209060..0394a490ae 100644 --- a/submodules/TelegramApi/Sources/Api27.swift +++ b/submodules/TelegramApi/Sources/Api27.swift @@ -1,733 +1,3 @@ -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, Any)]) { - return ("statsAbsValueAndPrev", [("current", self.current as Any), ("previous", self.previous as Any)]) - } - } - case statsAbsValueAndPrev(Cons_statsAbsValueAndPrev) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsAbsValueAndPrev(let _data): - if boxed { - buffer.appendInt32(-884757282) - } - serializeDouble(_data.current, buffer: buffer, boxed: false) - serializeDouble(_data.previous, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsAbsValueAndPrev(let _data): - return ("statsAbsValueAndPrev", [("current", _data.current as Any), ("previous", _data.previous as Any)]) - } - } - - public static func parse_statsAbsValueAndPrev(_ reader: BufferReader) -> StatsAbsValueAndPrev? { - var _1: Double? - _1 = reader.readDouble() - 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, Any)]) { - return ("statsDateRangeDays", [("minDate", self.minDate as Any), ("maxDate", self.maxDate as Any)]) - } - } - case statsDateRangeDays(Cons_statsDateRangeDays) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsDateRangeDays(let _data): - if boxed { - buffer.appendInt32(-1237848657) - } - serializeInt32(_data.minDate, buffer: buffer, boxed: false) - serializeInt32(_data.maxDate, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsDateRangeDays(let _data): - return ("statsDateRangeDays", [("minDate", _data.minDate as Any), ("maxDate", _data.maxDate as Any)]) - } - } - - public static func parse_statsDateRangeDays(_ reader: BufferReader) -> StatsDateRangeDays? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("statsGraph", [("flags", self.flags as Any), ("json", self.json as Any), ("zoomToken", self.zoomToken as Any)]) - } - } - public class Cons_statsGraphAsync: TypeConstructorDescription { - public var token: String - public init(token: String) { - self.token = token - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("statsGraphAsync", [("token", self.token as Any)]) - } - } - public class Cons_statsGraphError: TypeConstructorDescription { - public var error: String - public init(error: String) { - self.error = error - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("statsGraphError", [("error", self.error as Any)]) - } - } - case statsGraph(Cons_statsGraph) - case statsGraphAsync(Cons_statsGraphAsync) - case statsGraphError(Cons_statsGraphError) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGraph(let _data): - if boxed { - buffer.appendInt32(-1901828938) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.json.serialize(buffer, true) - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.zoomToken!, buffer: buffer, boxed: false) - } - break - case .statsGraphAsync(let _data): - if boxed { - buffer.appendInt32(1244130093) - } - serializeString(_data.token, buffer: buffer, boxed: false) - break - case .statsGraphError(let _data): - if boxed { - buffer.appendInt32(-1092839390) - } - serializeString(_data.error, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGraph(let _data): - return ("statsGraph", [("flags", _data.flags as Any), ("json", _data.json as Any), ("zoomToken", _data.zoomToken as Any)]) - case .statsGraphAsync(let _data): - return ("statsGraphAsync", [("token", _data.token as Any)]) - case .statsGraphError(let _data): - return ("statsGraphError", [("error", _data.error as Any)]) - } - } - - public static func parse_statsGraph(_ reader: BufferReader) -> StatsGraph? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Api.DataJSON? - if let signature = reader.readInt32() { - _2 = Api.parse(reader, signature: signature) as? Api.DataJSON - } - var _3: String? - if Int(_1!) & Int(1 << 0) != 0 { - _3 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil - if _c1 && _c2 && _c3 { - return Api.StatsGraph.statsGraph(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, Any)]) { - return ("statsGroupTopAdmin", [("userId", self.userId as Any), ("deleted", self.deleted as Any), ("kicked", self.kicked as Any), ("banned", self.banned as Any)]) - } - } - case statsGroupTopAdmin(Cons_statsGroupTopAdmin) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGroupTopAdmin(let _data): - if boxed { - buffer.appendInt32(-682079097) - } - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeInt32(_data.deleted, buffer: buffer, boxed: false) - serializeInt32(_data.kicked, buffer: buffer, boxed: false) - serializeInt32(_data.banned, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGroupTopAdmin(let _data): - return ("statsGroupTopAdmin", [("userId", _data.userId as Any), ("deleted", _data.deleted as Any), ("kicked", _data.kicked as Any), ("banned", _data.banned as Any)]) - } - } - - public static func parse_statsGroupTopAdmin(_ reader: BufferReader) -> StatsGroupTopAdmin? { - var _1: Int64? - _1 = reader.readInt64() - 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, Any)]) { - return ("statsGroupTopInviter", [("userId", self.userId as Any), ("invitations", self.invitations as Any)]) - } - } - case statsGroupTopInviter(Cons_statsGroupTopInviter) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGroupTopInviter(let _data): - if boxed { - buffer.appendInt32(1398765469) - } - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeInt32(_data.invitations, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGroupTopInviter(let _data): - return ("statsGroupTopInviter", [("userId", _data.userId as Any), ("invitations", _data.invitations as Any)]) - } - } - - public static func parse_statsGroupTopInviter(_ reader: BufferReader) -> StatsGroupTopInviter? { - var _1: Int64? - _1 = reader.readInt64() - 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, Any)]) { - return ("statsGroupTopPoster", [("userId", self.userId as Any), ("messages", self.messages as Any), ("avgChars", self.avgChars as Any)]) - } - } - case statsGroupTopPoster(Cons_statsGroupTopPoster) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsGroupTopPoster(let _data): - if boxed { - buffer.appendInt32(-1660637285) - } - serializeInt64(_data.userId, buffer: buffer, boxed: false) - serializeInt32(_data.messages, buffer: buffer, boxed: false) - serializeInt32(_data.avgChars, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsGroupTopPoster(let _data): - return ("statsGroupTopPoster", [("userId", _data.userId as Any), ("messages", _data.messages as Any), ("avgChars", _data.avgChars as Any)]) - } - } - - public static func parse_statsGroupTopPoster(_ reader: BufferReader) -> StatsGroupTopPoster? { - var _1: Int64? - _1 = reader.readInt64() - 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, Any)]) { - return ("statsPercentValue", [("part", self.part as Any), ("total", self.total as Any)]) - } - } - case statsPercentValue(Cons_statsPercentValue) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsPercentValue(let _data): - if boxed { - buffer.appendInt32(-875679776) - } - serializeDouble(_data.part, buffer: buffer, boxed: false) - serializeDouble(_data.total, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsPercentValue(let _data): - return ("statsPercentValue", [("part", _data.part as Any), ("total", _data.total as Any)]) - } - } - - public static func parse_statsPercentValue(_ reader: BufferReader) -> StatsPercentValue? { - var _1: Double? - _1 = reader.readDouble() - 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, Any)]) { - return ("statsURL", [("url", self.url as Any)]) - } - } - case statsURL(Cons_statsURL) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .statsURL(let _data): - if boxed { - buffer.appendInt32(1202287072) - } - serializeString(_data.url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .statsURL(let _data): - return ("statsURL", [("url", _data.url as Any)]) - } - } - - public static func parse_statsURL(_ reader: BufferReader) -> StatsURL? { - var _1: String? - _1 = parseString(reader) - let _c1 = _1 != nil - if _c1 { - return Api.StatsURL.statsURL(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, Any)]) { - return ("stickerKeyword", [("documentId", self.documentId as Any), ("keyword", self.keyword as Any)]) - } - } - case stickerKeyword(Cons_stickerKeyword) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerKeyword(let _data): - if boxed { - buffer.appendInt32(-50416996) - } - serializeInt64(_data.documentId, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.keyword.count)) - for item in _data.keyword { - serializeString(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerKeyword(let _data): - return ("stickerKeyword", [("documentId", _data.documentId as Any), ("keyword", _data.keyword as Any)]) - } - } - - public static func parse_stickerKeyword(_ reader: BufferReader) -> StickerKeyword? { - var _1: Int64? - _1 = reader.readInt64() - 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, Any)]) { - return ("stickerPack", [("emoticon", self.emoticon as Any), ("documents", self.documents as Any)]) - } - } - case stickerPack(Cons_stickerPack) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .stickerPack(let _data): - if boxed { - buffer.appendInt32(313694676) - } - serializeString(_data.emoticon, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.documents.count)) - for item in _data.documents { - serializeInt64(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .stickerPack(let _data): - return ("stickerPack", [("emoticon", _data.emoticon as Any), ("documents", _data.documents as Any)]) - } - } - - public static func parse_stickerPack(_ reader: BufferReader) -> StickerPack? { - var _1: String? - _1 = parseString(reader) - 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, Any)]) { - return ("stickerSet", [("flags", self.flags as Any), ("installedDate", self.installedDate as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("title", self.title as Any), ("shortName", self.shortName as Any), ("thumbs", self.thumbs as Any), ("thumbDcId", self.thumbDcId as Any), ("thumbVersion", self.thumbVersion as Any), ("thumbDocumentId", self.thumbDocumentId as Any), ("count", self.count as Any), ("hash", self.hash as Any)]) - } - } - 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, Any)]) { - switch self { - case .stickerSet(let _data): - return ("stickerSet", [("flags", _data.flags as Any), ("installedDate", _data.installedDate as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("title", _data.title as Any), ("shortName", _data.shortName as Any), ("thumbs", _data.thumbs as Any), ("thumbDcId", _data.thumbDcId as Any), ("thumbVersion", _data.thumbVersion as Any), ("thumbDocumentId", _data.thumbDocumentId as Any), ("count", _data.count as Any), ("hash", _data.hash as Any)]) - } - } - - public static func parse_stickerSet(_ reader: BufferReader) -> StickerSet? { - var _1: Int32? - _1 = reader.readInt32() - var _2: Int32? - if Int(_1!) & Int(1 << 0) != 0 { - _2 = reader.readInt32() - } - 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!) & Int(1 << 4) != 0 { - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PhotoSize.self) - } - } - var _8: Int32? - if Int(_1!) & Int(1 << 4) != 0 { - _8 = reader.readInt32() - } - var _9: Int32? - if Int(_1!) & Int(1 << 4) != 0 { - _9 = reader.readInt32() - } - var _10: Int64? - if Int(_1!) & 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!) & 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!) & Int(1 << 4) == 0) || _7 != nil - let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil - let _c9 = (Int(_1!) & Int(1 << 4) == 0) || _9 != nil - let _c10 = (Int(_1!) & 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 { @@ -737,8 +7,8 @@ public extension Api { self.set = set self.cover = cover } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stickerSetCovered", [("set", self.set as Any), ("cover", self.cover as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetCovered", [("set", ConstructorParameterDescription(self.set)), ("cover", ConstructorParameterDescription(self.cover))]) } } public class Cons_stickerSetFullCovered: TypeConstructorDescription { @@ -752,8 +22,8 @@ public extension Api { self.keywords = keywords self.documents = documents } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stickerSetFullCovered", [("set", self.set as Any), ("packs", self.packs as Any), ("keywords", self.keywords as Any), ("documents", self.documents as Any)]) + 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 { @@ -763,8 +33,8 @@ public extension Api { self.set = set self.covers = covers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stickerSetMultiCovered", [("set", self.set as Any), ("covers", self.covers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetMultiCovered", [("set", ConstructorParameterDescription(self.set)), ("covers", ConstructorParameterDescription(self.covers))]) } } public class Cons_stickerSetNoCovered: TypeConstructorDescription { @@ -772,8 +42,8 @@ public extension Api { public init(set: Api.StickerSet) { self.set = set } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stickerSetNoCovered", [("set", self.set as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetNoCovered", [("set", ConstructorParameterDescription(self.set))]) } } case stickerSetCovered(Cons_stickerSetCovered) @@ -831,16 +101,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .stickerSetCovered(let _data): - return ("stickerSetCovered", [("set", _data.set as Any), ("cover", _data.cover as Any)]) + return ("stickerSetCovered", [("set", ConstructorParameterDescription(_data.set)), ("cover", ConstructorParameterDescription(_data.cover))]) case .stickerSetFullCovered(let _data): - return ("stickerSetFullCovered", [("set", _data.set as Any), ("packs", _data.packs as Any), ("keywords", _data.keywords as Any), ("documents", _data.documents as Any)]) + 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", _data.set as Any), ("covers", _data.covers as Any)]) + return ("stickerSetMultiCovered", [("set", ConstructorParameterDescription(_data.set)), ("covers", ConstructorParameterDescription(_data.covers))]) case .stickerSetNoCovered(let _data): - return ("stickerSetNoCovered", [("set", _data.set as Any)]) + return ("stickerSetNoCovered", [("set", ConstructorParameterDescription(_data.set))]) } } @@ -934,8 +204,8 @@ public extension Api { self.activeUntilDate = activeUntilDate self.cooldownUntilDate = cooldownUntilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storiesStealthMode", [("flags", self.flags as Any), ("activeUntilDate", self.activeUntilDate as Any), ("cooldownUntilDate", self.cooldownUntilDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storiesStealthMode", [("flags", ConstructorParameterDescription(self.flags)), ("activeUntilDate", ConstructorParameterDescription(self.activeUntilDate)), ("cooldownUntilDate", ConstructorParameterDescription(self.cooldownUntilDate))]) } } case storiesStealthMode(Cons_storiesStealthMode) @@ -957,10 +227,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storiesStealthMode(let _data): - return ("storiesStealthMode", [("flags", _data.flags as Any), ("activeUntilDate", _data.activeUntilDate as Any), ("cooldownUntilDate", _data.cooldownUntilDate as Any)]) + return ("storiesStealthMode", [("flags", ConstructorParameterDescription(_data.flags)), ("activeUntilDate", ConstructorParameterDescription(_data.activeUntilDate)), ("cooldownUntilDate", ConstructorParameterDescription(_data.cooldownUntilDate))]) } } @@ -1002,8 +272,8 @@ public extension Api { self.iconPhoto = iconPhoto self.iconVideo = iconVideo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyAlbum", [("flags", self.flags as Any), ("albumId", self.albumId as Any), ("title", self.title as Any), ("iconPhoto", self.iconPhoto as Any), ("iconVideo", self.iconVideo as Any)]) + 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) @@ -1027,10 +297,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyAlbum(let _data): - return ("storyAlbum", [("flags", _data.flags as Any), ("albumId", _data.albumId as Any), ("title", _data.title as Any), ("iconPhoto", _data.iconPhoto as Any), ("iconVideo", _data.iconVideo as Any)]) + return ("storyAlbum", [("flags", ConstructorParameterDescription(_data.flags)), ("albumId", ConstructorParameterDescription(_data.albumId)), ("title", ConstructorParameterDescription(_data.title)), ("iconPhoto", ConstructorParameterDescription(_data.iconPhoto)), ("iconVideo", ConstructorParameterDescription(_data.iconVideo))]) } } @@ -1080,8 +350,8 @@ public extension Api { self.fromName = fromName self.storyId = storyId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyFwdHeader", [("flags", self.flags as Any), ("from", self.from as Any), ("fromName", self.fromName as Any), ("storyId", self.storyId as Any)]) + 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) @@ -1106,10 +376,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyFwdHeader(let _data): - return ("storyFwdHeader", [("flags", _data.flags as Any), ("from", _data.from as Any), ("fromName", _data.fromName as Any), ("storyId", _data.storyId as Any)]) + return ("storyFwdHeader", [("flags", ConstructorParameterDescription(_data.flags)), ("from", ConstructorParameterDescription(_data.from)), ("fromName", ConstructorParameterDescription(_data.fromName)), ("storyId", ConstructorParameterDescription(_data.storyId))]) } } @@ -1176,8 +446,8 @@ public extension Api { self.sentReaction = sentReaction self.albums = albums } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyItem", [("flags", self.flags as Any), ("id", self.id as Any), ("date", self.date as Any), ("fromId", self.fromId as Any), ("fwdFrom", self.fwdFrom as Any), ("expireDate", self.expireDate as Any), ("caption", self.caption as Any), ("entities", self.entities as Any), ("media", self.media as Any), ("mediaAreas", self.mediaAreas as Any), ("privacy", self.privacy as Any), ("views", self.views as Any), ("sentReaction", self.sentReaction as Any), ("albums", self.albums as Any)]) + 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))]) } } public class Cons_storyItemDeleted: TypeConstructorDescription { @@ -1185,8 +455,8 @@ public extension Api { public init(id: Int32) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyItemDeleted", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyItemDeleted", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_storyItemSkipped: TypeConstructorDescription { @@ -1200,8 +470,8 @@ public extension Api { self.date = date self.expireDate = expireDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyItemSkipped", [("flags", self.flags as Any), ("id", self.id as Any), ("date", self.date as Any), ("expireDate", self.expireDate as Any)]) + 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) @@ -1281,14 +551,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyItem(let _data): - return ("storyItem", [("flags", _data.flags as Any), ("id", _data.id as Any), ("date", _data.date as Any), ("fromId", _data.fromId as Any), ("fwdFrom", _data.fwdFrom as Any), ("expireDate", _data.expireDate as Any), ("caption", _data.caption as Any), ("entities", _data.entities as Any), ("media", _data.media as Any), ("mediaAreas", _data.mediaAreas as Any), ("privacy", _data.privacy as Any), ("views", _data.views as Any), ("sentReaction", _data.sentReaction as Any), ("albums", _data.albums as Any)]) + 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))]) case .storyItemDeleted(let _data): - return ("storyItemDeleted", [("id", _data.id as Any)]) + return ("storyItemDeleted", [("id", ConstructorParameterDescription(_data.id))]) case .storyItemSkipped(let _data): - return ("storyItemSkipped", [("flags", _data.flags as Any), ("id", _data.id as Any), ("date", _data.date as Any), ("expireDate", _data.expireDate as Any)]) + return ("storyItemSkipped", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("date", ConstructorParameterDescription(_data.date)), ("expireDate", ConstructorParameterDescription(_data.expireDate))]) } } @@ -1422,8 +692,8 @@ public extension Api { self.date = date self.reaction = reaction } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyReaction", [("peerId", self.peerId as Any), ("date", self.date as Any), ("reaction", self.reaction as Any)]) + 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 { @@ -1431,8 +701,8 @@ public extension Api { public init(message: Api.Message) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyReactionPublicForward", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyReactionPublicForward", [("message", ConstructorParameterDescription(self.message))]) } } public class Cons_storyReactionPublicRepost: TypeConstructorDescription { @@ -1442,8 +712,8 @@ public extension Api { self.peerId = peerId self.story = story } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyReactionPublicRepost", [("peerId", self.peerId as Any), ("story", self.story as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyReactionPublicRepost", [("peerId", ConstructorParameterDescription(self.peerId)), ("story", ConstructorParameterDescription(self.story))]) } } case storyReaction(Cons_storyReaction) @@ -1476,14 +746,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyReaction(let _data): - return ("storyReaction", [("peerId", _data.peerId as Any), ("date", _data.date as Any), ("reaction", _data.reaction as Any)]) + return ("storyReaction", [("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date)), ("reaction", ConstructorParameterDescription(_data.reaction))]) case .storyReactionPublicForward(let _data): - return ("storyReactionPublicForward", [("message", _data.message as Any)]) + return ("storyReactionPublicForward", [("message", ConstructorParameterDescription(_data.message))]) case .storyReactionPublicRepost(let _data): - return ("storyReactionPublicRepost", [("peerId", _data.peerId as Any), ("story", _data.story as Any)]) + return ("storyReactionPublicRepost", [("peerId", ConstructorParameterDescription(_data.peerId)), ("story", ConstructorParameterDescription(_data.story))]) } } @@ -1554,8 +824,8 @@ public extension Api { self.date = date self.reaction = reaction } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyView", [("flags", self.flags as Any), ("userId", self.userId as Any), ("date", self.date as Any), ("reaction", self.reaction as Any)]) + 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 { @@ -1565,8 +835,8 @@ public extension Api { self.flags = flags self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyViewPublicForward", [("flags", self.flags as Any), ("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViewPublicForward", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message))]) } } public class Cons_storyViewPublicRepost: TypeConstructorDescription { @@ -1578,8 +848,8 @@ public extension Api { self.peerId = peerId self.story = story } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyViewPublicRepost", [("flags", self.flags as Any), ("peerId", self.peerId as Any), ("story", self.story as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViewPublicRepost", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("story", ConstructorParameterDescription(self.story))]) } } case storyView(Cons_storyView) @@ -1617,14 +887,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyView(let _data): - return ("storyView", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("date", _data.date as Any), ("reaction", _data.reaction as Any)]) + 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", _data.flags as Any), ("message", _data.message as Any)]) + return ("storyViewPublicForward", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message))]) case .storyViewPublicRepost(let _data): - return ("storyViewPublicRepost", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("story", _data.story as Any)]) + return ("storyViewPublicRepost", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("story", ConstructorParameterDescription(_data.story))]) } } @@ -1708,8 +978,8 @@ public extension Api { self.reactionsCount = reactionsCount self.recentViewers = recentViewers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyViews", [("flags", self.flags as Any), ("viewsCount", self.viewsCount as Any), ("forwardsCount", self.forwardsCount as Any), ("reactions", self.reactions as Any), ("reactionsCount", self.reactionsCount as Any), ("recentViewers", self.recentViewers as Any)]) + 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) @@ -1746,10 +1016,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyViews(let _data): - return ("storyViews", [("flags", _data.flags as Any), ("viewsCount", _data.viewsCount as Any), ("forwardsCount", _data.forwardsCount as Any), ("reactions", _data.reactions as Any), ("reactionsCount", _data.reactionsCount as Any), ("recentViewers", _data.recentViewers as Any)]) + 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))]) } } @@ -1804,8 +1074,8 @@ public extension Api { self.price = price self.scheduleDate = scheduleDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("suggestedPost", [("flags", self.flags as Any), ("price", self.price as Any), ("scheduleDate", self.scheduleDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("suggestedPost", [("flags", ConstructorParameterDescription(self.flags)), ("price", ConstructorParameterDescription(self.price)), ("scheduleDate", ConstructorParameterDescription(self.scheduleDate))]) } } case suggestedPost(Cons_suggestedPost) @@ -1827,10 +1097,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .suggestedPost(let _data): - return ("suggestedPost", [("flags", _data.flags as Any), ("price", _data.price as Any), ("scheduleDate", _data.scheduleDate as Any)]) + return ("suggestedPost", [("flags", ConstructorParameterDescription(_data.flags)), ("price", ConstructorParameterDescription(_data.price)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate))]) } } @@ -1868,8 +1138,8 @@ public extension Api { self.text = text self.entities = entities } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("textWithEntities", [("text", self.text as Any), ("entities", self.entities as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("textWithEntities", [("text", ConstructorParameterDescription(self.text)), ("entities", ConstructorParameterDescription(self.entities))]) } } case textWithEntities(Cons_textWithEntities) @@ -1890,10 +1160,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .textWithEntities(let _data): - return ("textWithEntities", [("text", _data.text as Any), ("entities", _data.entities as Any)]) + return ("textWithEntities", [("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities))]) } } @@ -1915,3 +1185,611 @@ public extension Api { } } } +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): + if boxed { + buffer.appendInt32(-1609668650) + } + serializeInt32(_data.flags, buffer: buffer, boxed: false) + serializeInt64(_data.id, buffer: buffer, boxed: false) + serializeInt64(_data.accessHash, buffer: buffer, boxed: false) + serializeString(_data.slug, buffer: buffer, boxed: false) + serializeString(_data.title, buffer: buffer, boxed: false) + if Int(_data.flags) & Int(1 << 2) != 0 { + _data.document!.serialize(buffer, true) + } + if Int(_data.flags) & Int(1 << 3) != 0 { + buffer.appendInt32(481674261) + buffer.appendInt32(Int32(_data.settings!.count)) + for item in _data.settings! { + item.serialize(buffer, true) + } + } + if Int(_data.flags) & Int(1 << 6) != 0 { + serializeString(_data.emoticon!, buffer: buffer, boxed: false) + } + if Int(_data.flags) & Int(1 << 4) != 0 { + serializeInt32(_data.installsCount!, buffer: buffer, boxed: false) + } + break + } + } + + public func descriptionFields() -> (String, [(String, 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))]) + } + } + + public static func parse_theme(_ reader: BufferReader) -> Theme? { + 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!) & Int(1 << 2) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.Document + } + } + var _7: [Api.ThemeSettings]? + if Int(_1!) & Int(1 << 3) != 0 { + if let _ = reader.readInt32() { + _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ThemeSettings.self) + } + } + var _8: String? + if Int(_1!) & Int(1 << 6) != 0 { + _8 = parseString(reader) + } + var _9: Int32? + if Int(_1!) & 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!) & Int(1 << 2) == 0) || _6 != nil + let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil + let _c8 = (Int(_1!) & Int(1 << 6) == 0) || _8 != nil + let _c9 = (Int(_1!) & Int(1 << 4) == 0) || _9 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { + return Api.Theme.theme(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!) & Int(1 << 3) != 0 { + _4 = reader.readInt32() + } + var _5: [Int32]? + if Int(_1!) & Int(1 << 0) != 0 { + if let _ = reader.readInt32() { + _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) + } + } + var _6: Api.WallPaper? + if Int(_1!) & Int(1 << 1) != 0 { + if let signature = reader.readInt32() { + _6 = Api.parse(reader, signature: signature) as? Api.WallPaper + } + } + let _c1 = _1 != nil + let _c2 = _2 != nil + let _c3 = _3 != nil + let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil + let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil + let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil + if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { + return Api.ThemeSettings.themeSettings(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 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 .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 .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_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 + } + } +} diff --git a/submodules/TelegramApi/Sources/Api28.swift b/submodules/TelegramApi/Sources/Api28.swift index acde42a931..e3507ba121 100644 --- a/submodules/TelegramApi/Sources/Api28.swift +++ b/submodules/TelegramApi/Sources/Api28.swift @@ -1,611 +1,3 @@ -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, Any)]) { - return ("theme", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("slug", self.slug as Any), ("title", self.title as Any), ("document", self.document as Any), ("settings", self.settings as Any), ("emoticon", self.emoticon as Any), ("installsCount", self.installsCount as Any)]) - } - } - case theme(Cons_theme) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .theme(let _data): - if boxed { - buffer.appendInt32(-1609668650) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - serializeInt64(_data.id, buffer: buffer, boxed: false) - serializeInt64(_data.accessHash, buffer: buffer, boxed: false) - serializeString(_data.slug, buffer: buffer, boxed: false) - serializeString(_data.title, buffer: buffer, boxed: false) - if Int(_data.flags) & Int(1 << 2) != 0 { - _data.document!.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 3) != 0 { - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.settings!.count)) - for item in _data.settings! { - item.serialize(buffer, true) - } - } - if Int(_data.flags) & Int(1 << 6) != 0 { - serializeString(_data.emoticon!, buffer: buffer, boxed: false) - } - if Int(_data.flags) & Int(1 << 4) != 0 { - serializeInt32(_data.installsCount!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .theme(let _data): - return ("theme", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("slug", _data.slug as Any), ("title", _data.title as Any), ("document", _data.document as Any), ("settings", _data.settings as Any), ("emoticon", _data.emoticon as Any), ("installsCount", _data.installsCount as Any)]) - } - } - - public static func parse_theme(_ reader: BufferReader) -> Theme? { - var _1: Int32? - _1 = reader.readInt32() - 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!) & Int(1 << 2) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.Document - } - } - var _7: [Api.ThemeSettings]? - if Int(_1!) & Int(1 << 3) != 0 { - if let _ = reader.readInt32() { - _7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ThemeSettings.self) - } - } - var _8: String? - if Int(_1!) & Int(1 << 6) != 0 { - _8 = parseString(reader) - } - var _9: Int32? - if Int(_1!) & 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!) & Int(1 << 2) == 0) || _6 != nil - let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil - let _c8 = (Int(_1!) & Int(1 << 6) == 0) || _8 != nil - let _c9 = (Int(_1!) & Int(1 << 4) == 0) || _9 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 { - return Api.Theme.theme(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, Any)]) { - return ("themeSettings", [("flags", self.flags as Any), ("baseTheme", self.baseTheme as Any), ("accentColor", self.accentColor as Any), ("outboxAccentColor", self.outboxAccentColor as Any), ("messageColors", self.messageColors as Any), ("wallpaper", self.wallpaper as Any)]) - } - } - 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, Any)]) { - switch self { - case .themeSettings(let _data): - return ("themeSettings", [("flags", _data.flags as Any), ("baseTheme", _data.baseTheme as Any), ("accentColor", _data.accentColor as Any), ("outboxAccentColor", _data.outboxAccentColor as Any), ("messageColors", _data.messageColors as Any), ("wallpaper", _data.wallpaper as Any)]) - } - } - - public static func parse_themeSettings(_ reader: BufferReader) -> ThemeSettings? { - var _1: Int32? - _1 = reader.readInt32() - 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!) & Int(1 << 3) != 0 { - _4 = reader.readInt32() - } - var _5: [Int32]? - if Int(_1!) & Int(1 << 0) != 0 { - if let _ = reader.readInt32() { - _5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self) - } - } - var _6: Api.WallPaper? - if Int(_1!) & Int(1 << 1) != 0 { - if let signature = reader.readInt32() { - _6 = Api.parse(reader, signature: signature) as? Api.WallPaper - } - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil - let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil - let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 { - return Api.ThemeSettings.themeSettings(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, Any)]) { - return ("timezone", [("id", self.id as Any), ("name", self.name as Any), ("utcOffset", self.utcOffset as Any)]) - } - } - case timezone(Cons_timezone) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .timezone(let _data): - if boxed { - buffer.appendInt32(-7173643) - } - serializeString(_data.id, buffer: buffer, boxed: false) - serializeString(_data.name, buffer: buffer, boxed: false) - serializeInt32(_data.utcOffset, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .timezone(let _data): - return ("timezone", [("id", _data.id as Any), ("name", _data.name as Any), ("utcOffset", _data.utcOffset as Any)]) - } - } - - public static func parse_timezone(_ reader: BufferReader) -> Timezone? { - var _1: String? - _1 = parseString(reader) - 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, Any)]) { - return ("todoCompletion", [("id", self.id as Any), ("completedBy", self.completedBy as Any), ("date", self.date as Any)]) - } - } - case todoCompletion(Cons_todoCompletion) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .todoCompletion(let _data): - if boxed { - buffer.appendInt32(572241380) - } - serializeInt32(_data.id, buffer: buffer, boxed: false) - _data.completedBy.serialize(buffer, true) - serializeInt32(_data.date, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .todoCompletion(let _data): - return ("todoCompletion", [("id", _data.id as Any), ("completedBy", _data.completedBy as Any), ("date", _data.date as Any)]) - } - } - - public static func parse_todoCompletion(_ reader: BufferReader) -> TodoCompletion? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("todoItem", [("id", self.id as Any), ("title", self.title as Any)]) - } - } - case todoItem(Cons_todoItem) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .todoItem(let _data): - if boxed { - buffer.appendInt32(-878074577) - } - serializeInt32(_data.id, buffer: buffer, boxed: false) - _data.title.serialize(buffer, true) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .todoItem(let _data): - return ("todoItem", [("id", _data.id as Any), ("title", _data.title as Any)]) - } - } - - public static func parse_todoItem(_ reader: BufferReader) -> TodoItem? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("todoList", [("flags", self.flags as Any), ("title", self.title as Any), ("list", self.list as Any)]) - } - } - case todoList(Cons_todoList) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .todoList(let _data): - if boxed { - buffer.appendInt32(1236871718) - } - serializeInt32(_data.flags, buffer: buffer, boxed: false) - _data.title.serialize(buffer, true) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.list.count)) - for item in _data.list { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .todoList(let _data): - return ("todoList", [("flags", _data.flags as Any), ("title", _data.title as Any), ("list", _data.list as Any)]) - } - } - - public static func parse_todoList(_ reader: BufferReader) -> TodoList? { - var _1: Int32? - _1 = reader.readInt32() - 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, Any)]) { - return ("topPeer", [("peer", self.peer as Any), ("rating", self.rating as Any)]) - } - } - case topPeer(Cons_topPeer) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .topPeer(let _data): - if boxed { - buffer.appendInt32(-305282981) - } - _data.peer.serialize(buffer, true) - serializeDouble(_data.rating, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .topPeer(let _data): - return ("topPeer", [("peer", _data.peer as Any), ("rating", _data.rating as Any)]) - } - } - - public static func parse_topPeer(_ reader: BufferReader) -> TopPeer? { - var _1: Api.Peer? - if let signature = reader.readInt32() { - _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 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 .topPeerCategoryBotsInline: - if boxed { - buffer.appendInt32(344356834) - } - break - case .topPeerCategoryBotsPM: - if boxed { - buffer.appendInt32(-1419371685) - } - break - case .topPeerCategoryChannels: - if boxed { - buffer.appendInt32(371037736) - } - break - case .topPeerCategoryCorrespondents: - if boxed { - buffer.appendInt32(104314861) - } - break - case .topPeerCategoryForwardChats: - if boxed { - buffer.appendInt32(-68239120) - } - break - case .topPeerCategoryForwardUsers: - if boxed { - buffer.appendInt32(-1472172887) - } - break - case .topPeerCategoryGroups: - if boxed { - buffer.appendInt32(-1122524854) - } - break - case .topPeerCategoryPhoneCalls: - if boxed { - buffer.appendInt32(511092620) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .topPeerCategoryBotsApp: - return ("topPeerCategoryBotsApp", []) - case .topPeerCategoryBotsInline: - 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_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 { @@ -617,8 +9,8 @@ public extension Api { self.count = count self.peers = peers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("topPeerCategoryPeers", [("category", self.category as Any), ("count", self.count as Any), ("peers", self.peers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("topPeerCategoryPeers", [("category", ConstructorParameterDescription(self.category)), ("count", ConstructorParameterDescription(self.count)), ("peers", ConstructorParameterDescription(self.peers))]) } } case topPeerCategoryPeers(Cons_topPeerCategoryPeers) @@ -640,10 +32,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .topPeerCategoryPeers(let _data): - return ("topPeerCategoryPeers", [("category", _data.category as Any), ("count", _data.count as Any), ("peers", _data.peers as Any)]) + return ("topPeerCategoryPeers", [("category", ConstructorParameterDescription(_data.category)), ("count", ConstructorParameterDescription(_data.count)), ("peers", ConstructorParameterDescription(_data.peers))]) } } @@ -679,8 +71,8 @@ public extension Api { self.connection = connection self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotBusinessConnect", [("connection", self.connection as Any), ("qts", self.qts as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotBusinessConnect", [("connection", ConstructorParameterDescription(self.connection)), ("qts", ConstructorParameterDescription(self.qts))]) } } public class Cons_updateBotCallbackQuery: TypeConstructorDescription { @@ -702,8 +94,8 @@ public extension Api { self.data = data self.gameShortName = gameShortName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotCallbackQuery", [("flags", self.flags as Any), ("queryId", self.queryId as Any), ("userId", self.userId as Any), ("peer", self.peer as Any), ("msgId", self.msgId as Any), ("chatInstance", self.chatInstance as Any), ("data", self.data as Any), ("gameShortName", self.gameShortName as Any)]) + 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 { @@ -715,8 +107,8 @@ public extension Api { self.boost = boost self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotChatBoost", [("peer", self.peer as Any), ("boost", self.boost as Any), ("qts", self.qts as Any)]) + 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 { @@ -734,8 +126,8 @@ public extension Api { self.invite = invite self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotChatInviteRequester", [("peer", self.peer as Any), ("date", self.date as Any), ("userId", self.userId as Any), ("about", self.about as Any), ("invite", self.invite as Any), ("qts", self.qts as Any)]) + 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 { @@ -747,8 +139,8 @@ public extension Api { self.botId = botId self.commands = commands } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotCommands", [("peer", self.peer as Any), ("botId", self.botId as Any), ("commands", self.commands as Any)]) + 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 { @@ -762,8 +154,8 @@ public extension Api { self.messages = messages self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotDeleteBusinessMessage", [("connectionId", self.connectionId as Any), ("peer", self.peer as Any), ("messages", self.messages as Any), ("qts", self.qts as Any)]) + 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 { @@ -779,8 +171,8 @@ public extension Api { self.replyToMessage = replyToMessage self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotEditBusinessMessage", [("flags", self.flags as Any), ("connectionId", self.connectionId as Any), ("message", self.message as Any), ("replyToMessage", self.replyToMessage as Any), ("qts", self.qts as Any)]) + 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_updateBotInlineQuery: TypeConstructorDescription { @@ -800,8 +192,8 @@ public extension Api { self.peerType = peerType self.offset = offset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotInlineQuery", [("flags", self.flags as Any), ("queryId", self.queryId as Any), ("userId", self.userId as Any), ("query", self.query as Any), ("geo", self.geo as Any), ("peerType", self.peerType as Any), ("offset", self.offset as Any)]) + 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 { @@ -819,8 +211,8 @@ public extension Api { self.id = id self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotInlineSend", [("flags", self.flags as Any), ("userId", self.userId as Any), ("query", self.query as Any), ("geo", self.geo as Any), ("id", self.id as Any), ("msgId", self.msgId as Any)]) + 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 { @@ -830,8 +222,8 @@ public extension Api { self.botId = botId self.button = button } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotMenuButton", [("botId", self.botId as Any), ("button", self.button as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotMenuButton", [("botId", ConstructorParameterDescription(self.botId)), ("button", ConstructorParameterDescription(self.button))]) } } public class Cons_updateBotMessageReaction: TypeConstructorDescription { @@ -851,8 +243,8 @@ public extension Api { self.newReactions = newReactions self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotMessageReaction", [("peer", self.peer as Any), ("msgId", self.msgId as Any), ("date", self.date as Any), ("actor", self.actor as Any), ("oldReactions", self.oldReactions as Any), ("newReactions", self.newReactions as Any), ("qts", self.qts as Any)]) + 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 { @@ -868,8 +260,8 @@ public extension Api { self.reactions = reactions self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotMessageReactions", [("peer", self.peer as Any), ("msgId", self.msgId as Any), ("date", self.date as Any), ("reactions", self.reactions as Any), ("qts", self.qts as Any)]) + 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 { @@ -885,8 +277,8 @@ public extension Api { self.replyToMessage = replyToMessage self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotNewBusinessMessage", [("flags", self.flags as Any), ("connectionId", self.connectionId as Any), ("message", self.message as Any), ("replyToMessage", self.replyToMessage as Any), ("qts", self.qts as Any)]) + 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 { @@ -908,8 +300,8 @@ public extension Api { self.currency = currency self.totalAmount = totalAmount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotPrecheckoutQuery", [("flags", self.flags as Any), ("queryId", self.queryId as Any), ("userId", self.userId as Any), ("payload", self.payload as Any), ("info", self.info as Any), ("shippingOptionId", self.shippingOptionId as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any)]) + 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 { @@ -921,8 +313,8 @@ public extension Api { self.payload = payload self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotPurchasedPaidMedia", [("userId", self.userId as Any), ("payload", self.payload as Any), ("qts", self.qts as Any)]) + 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 { @@ -936,8 +328,8 @@ public extension Api { self.payload = payload self.shippingAddress = shippingAddress } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotShippingQuery", [("queryId", self.queryId as Any), ("userId", self.userId as Any), ("payload", self.payload as Any), ("shippingAddress", self.shippingAddress as Any)]) + 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 { @@ -951,8 +343,8 @@ public extension Api { self.stopped = stopped self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotStopped", [("userId", self.userId as Any), ("date", self.date as Any), ("stopped", self.stopped as Any), ("qts", self.qts as Any)]) + 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 { @@ -960,8 +352,8 @@ public extension Api { public init(data: Api.DataJSON) { self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotWebhookJSON", [("data", self.data as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateBotWebhookJSON", [("data", ConstructorParameterDescription(self.data))]) } } public class Cons_updateBotWebhookJSONQuery: TypeConstructorDescription { @@ -973,8 +365,8 @@ public extension Api { self.data = data self.timeout = timeout } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBotWebhookJSONQuery", [("queryId", self.queryId as Any), ("data", self.data as Any), ("timeout", self.timeout as Any)]) + 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 { @@ -996,8 +388,8 @@ public extension Api { self.chatInstance = chatInstance self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateBusinessBotCallbackQuery", [("flags", self.flags as Any), ("queryId", self.queryId as Any), ("userId", self.userId as Any), ("connectionId", self.connectionId as Any), ("message", self.message as Any), ("replyToMessage", self.replyToMessage as Any), ("chatInstance", self.chatInstance as Any), ("data", self.data as Any)]) + 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 { @@ -1005,8 +397,8 @@ public extension Api { public init(channelId: Int64) { self.channelId = channelId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannel", [("channelId", self.channelId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannel", [("channelId", ConstructorParameterDescription(self.channelId))]) } } public class Cons_updateChannelAvailableMessages: TypeConstructorDescription { @@ -1016,8 +408,8 @@ public extension Api { self.channelId = channelId self.availableMinId = availableMinId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelAvailableMessages", [("channelId", self.channelId as Any), ("availableMinId", self.availableMinId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelAvailableMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("availableMinId", ConstructorParameterDescription(self.availableMinId))]) } } public class Cons_updateChannelMessageForwards: TypeConstructorDescription { @@ -1029,8 +421,8 @@ public extension Api { self.id = id self.forwards = forwards } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelMessageForwards", [("channelId", self.channelId as Any), ("id", self.id as Any), ("forwards", self.forwards as Any)]) + 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 { @@ -1042,8 +434,8 @@ public extension Api { self.id = id self.views = views } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelMessageViews", [("channelId", self.channelId as Any), ("id", self.id as Any), ("views", self.views as Any)]) + 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 { @@ -1067,8 +459,8 @@ public extension Api { self.invite = invite self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelParticipant", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("date", self.date as Any), ("actorId", self.actorId as Any), ("userId", self.userId as Any), ("prevParticipant", self.prevParticipant as Any), ("newParticipant", self.newParticipant as Any), ("invite", self.invite as Any), ("qts", self.qts as Any)]) + 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 { @@ -1084,8 +476,8 @@ public extension Api { self.savedPeerId = savedPeerId self.messages = messages } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelReadMessagesContents", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("topMsgId", self.topMsgId as Any), ("savedPeerId", self.savedPeerId as Any), ("messages", self.messages as Any)]) + 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 { @@ -1097,8 +489,8 @@ public extension Api { self.channelId = channelId self.pts = pts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelTooLong", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("pts", self.pts as Any)]) + 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 { @@ -1114,8 +506,8 @@ public extension Api { self.fromId = fromId self.action = action } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelUserTyping", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("topMsgId", self.topMsgId as Any), ("fromId", self.fromId as Any), ("action", self.action as Any)]) + 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 { @@ -1125,8 +517,8 @@ public extension Api { self.channelId = channelId self.enabled = enabled } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelViewForumAsMessages", [("channelId", self.channelId as Any), ("enabled", self.enabled as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChannelViewForumAsMessages", [("channelId", ConstructorParameterDescription(self.channelId)), ("enabled", ConstructorParameterDescription(self.enabled))]) } } public class Cons_updateChannelWebPage: TypeConstructorDescription { @@ -1140,8 +532,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChannelWebPage", [("channelId", self.channelId as Any), ("webpage", self.webpage as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1149,8 +541,8 @@ public extension Api { public init(chatId: Int64) { self.chatId = chatId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChat", [("chatId", self.chatId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChat", [("chatId", ConstructorParameterDescription(self.chatId))]) } } public class Cons_updateChatDefaultBannedRights: TypeConstructorDescription { @@ -1162,8 +554,8 @@ public extension Api { self.defaultBannedRights = defaultBannedRights self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatDefaultBannedRights", [("peer", self.peer as Any), ("defaultBannedRights", self.defaultBannedRights as Any), ("version", self.version as Any)]) + 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 { @@ -1187,8 +579,8 @@ public extension Api { self.invite = invite self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatParticipant", [("flags", self.flags as Any), ("chatId", self.chatId as Any), ("date", self.date as Any), ("actorId", self.actorId as Any), ("userId", self.userId as Any), ("prevParticipant", self.prevParticipant as Any), ("newParticipant", self.newParticipant as Any), ("invite", self.invite as Any), ("qts", self.qts as Any)]) + 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 { @@ -1204,8 +596,8 @@ public extension Api { self.date = date self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatParticipantAdd", [("chatId", self.chatId as Any), ("userId", self.userId as Any), ("inviterId", self.inviterId as Any), ("date", self.date as Any), ("version", self.version as Any)]) + 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 { @@ -1219,8 +611,8 @@ public extension Api { self.isAdmin = isAdmin self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatParticipantAdmin", [("chatId", self.chatId as Any), ("userId", self.userId as Any), ("isAdmin", self.isAdmin as Any), ("version", self.version as Any)]) + 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 { @@ -1232,8 +624,8 @@ public extension Api { self.userId = userId self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatParticipantDelete", [("chatId", self.chatId as Any), ("userId", self.userId as Any), ("version", self.version as Any)]) + 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 { @@ -1247,8 +639,8 @@ public extension Api { self.rank = rank self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatParticipantRank", [("chatId", self.chatId as Any), ("userId", self.userId as Any), ("rank", self.rank as Any), ("version", self.version as Any)]) + 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 { @@ -1256,8 +648,8 @@ public extension Api { public init(participants: Api.ChatParticipants) { self.participants = participants } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatParticipants", [("participants", self.participants as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateChatParticipants", [("participants", ConstructorParameterDescription(self.participants))]) } } public class Cons_updateChatUserTyping: TypeConstructorDescription { @@ -1269,8 +661,8 @@ public extension Api { self.fromId = fromId self.action = action } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateChatUserTyping", [("chatId", self.chatId as Any), ("fromId", self.fromId as Any), ("action", self.action as Any)]) + 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 { @@ -1278,8 +670,8 @@ public extension Api { public init(dcOptions: [Api.DcOption]) { self.dcOptions = dcOptions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDcOptions", [("dcOptions", self.dcOptions as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDcOptions", [("dcOptions", ConstructorParameterDescription(self.dcOptions))]) } } public class Cons_updateDeleteChannelMessages: TypeConstructorDescription { @@ -1293,8 +685,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDeleteChannelMessages", [("channelId", self.channelId as Any), ("messages", self.messages as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1304,8 +696,8 @@ public extension Api { self.call = call self.messages = messages } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDeleteGroupCallMessages", [("call", self.call as Any), ("messages", self.messages as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteGroupCallMessages", [("call", ConstructorParameterDescription(self.call)), ("messages", ConstructorParameterDescription(self.messages))]) } } public class Cons_updateDeleteMessages: TypeConstructorDescription { @@ -1317,8 +709,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDeleteMessages", [("messages", self.messages as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1326,8 +718,8 @@ public extension Api { public init(shortcutId: Int32) { self.shortcutId = shortcutId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDeleteQuickReply", [("shortcutId", self.shortcutId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteQuickReply", [("shortcutId", ConstructorParameterDescription(self.shortcutId))]) } } public class Cons_updateDeleteQuickReplyMessages: TypeConstructorDescription { @@ -1337,8 +729,8 @@ public extension Api { self.shortcutId = shortcutId self.messages = messages } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDeleteQuickReplyMessages", [("shortcutId", self.shortcutId as Any), ("messages", self.messages as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDeleteQuickReplyMessages", [("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("messages", ConstructorParameterDescription(self.messages))]) } } public class Cons_updateDeleteScheduledMessages: TypeConstructorDescription { @@ -1352,8 +744,8 @@ public extension Api { self.messages = messages self.sentMessages = sentMessages } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDeleteScheduledMessages", [("flags", self.flags as Any), ("peer", self.peer as Any), ("messages", self.messages as Any), ("sentMessages", self.sentMessages as Any)]) + 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 { @@ -1365,8 +757,8 @@ public extension Api { self.id = id self.filter = filter } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDialogFilter", [("flags", self.flags as Any), ("id", self.id as Any), ("filter", self.filter as Any)]) + 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 { @@ -1374,8 +766,8 @@ public extension Api { public init(order: [Int32]) { self.order = order } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDialogFilterOrder", [("order", self.order as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateDialogFilterOrder", [("order", ConstructorParameterDescription(self.order))]) } } public class Cons_updateDialogPinned: TypeConstructorDescription { @@ -1387,8 +779,8 @@ public extension Api { self.folderId = folderId self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDialogPinned", [("flags", self.flags as Any), ("folderId", self.folderId as Any), ("peer", self.peer as Any)]) + 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 { @@ -1400,8 +792,8 @@ public extension Api { self.peer = peer self.savedPeerId = savedPeerId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDialogUnreadMark", [("flags", self.flags as Any), ("peer", self.peer as Any), ("savedPeerId", self.savedPeerId as Any)]) + 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 { @@ -1417,8 +809,8 @@ public extension Api { self.savedPeerId = savedPeerId self.draft = draft } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateDraftMessage", [("flags", self.flags as Any), ("peer", self.peer as Any), ("topMsgId", self.topMsgId as Any), ("savedPeerId", self.savedPeerId as Any), ("draft", self.draft as Any)]) + 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 { @@ -1430,8 +822,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateEditChannelMessage", [("message", self.message as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1443,8 +835,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateEditMessage", [("message", self.message as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1452,8 +844,8 @@ public extension Api { public init(info: Api.messages.EmojiGameInfo) { self.info = info } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateEmojiGameInfo", [("info", self.info as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEmojiGameInfo", [("info", ConstructorParameterDescription(self.info))]) } } public class Cons_updateEncryptedChatTyping: TypeConstructorDescription { @@ -1461,8 +853,8 @@ public extension Api { public init(chatId: Int32) { self.chatId = chatId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateEncryptedChatTyping", [("chatId", self.chatId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEncryptedChatTyping", [("chatId", ConstructorParameterDescription(self.chatId))]) } } public class Cons_updateEncryptedMessagesRead: TypeConstructorDescription { @@ -1474,8 +866,8 @@ public extension Api { self.maxDate = maxDate self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateEncryptedMessagesRead", [("chatId", self.chatId as Any), ("maxDate", self.maxDate as Any), ("date", self.date as Any)]) + 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 { @@ -1485,8 +877,8 @@ public extension Api { self.chat = chat self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateEncryption", [("chat", self.chat as Any), ("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateEncryption", [("chat", ConstructorParameterDescription(self.chat)), ("date", ConstructorParameterDescription(self.date))]) } } public class Cons_updateFolderPeers: TypeConstructorDescription { @@ -1498,8 +890,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateFolderPeers", [("folderPeers", self.folderPeers as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1509,8 +901,8 @@ public extension Api { self.peer = peer self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateGeoLiveViewed", [("peer", self.peer as Any), ("msgId", self.msgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGeoLiveViewed", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId))]) } } public class Cons_updateGroupCall: TypeConstructorDescription { @@ -1522,8 +914,8 @@ public extension Api { self.peer = peer self.call = call } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateGroupCall", [("flags", self.flags as Any), ("peer", self.peer as Any), ("call", self.call as Any)]) + 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 { @@ -1537,8 +929,8 @@ public extension Api { self.blocks = blocks self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateGroupCallChainBlocks", [("call", self.call as Any), ("subChainId", self.subChainId as Any), ("blocks", self.blocks as Any), ("nextOffset", self.nextOffset as Any)]) + 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 { @@ -1548,8 +940,8 @@ public extension Api { self.flags = flags self.params = params } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateGroupCallConnection", [("flags", self.flags as Any), ("params", self.params as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCallConnection", [("flags", ConstructorParameterDescription(self.flags)), ("params", ConstructorParameterDescription(self.params))]) } } public class Cons_updateGroupCallEncryptedMessage: TypeConstructorDescription { @@ -1561,8 +953,8 @@ public extension Api { self.fromId = fromId self.encryptedMessage = encryptedMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateGroupCallEncryptedMessage", [("call", self.call as Any), ("fromId", self.fromId as Any), ("encryptedMessage", self.encryptedMessage as Any)]) + 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 { @@ -1572,8 +964,8 @@ public extension Api { self.call = call self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateGroupCallMessage", [("call", self.call as Any), ("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateGroupCallMessage", [("call", ConstructorParameterDescription(self.call)), ("message", ConstructorParameterDescription(self.message))]) } } public class Cons_updateGroupCallParticipants: TypeConstructorDescription { @@ -1585,8 +977,8 @@ public extension Api { self.participants = participants self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateGroupCallParticipants", [("call", self.call as Any), ("participants", self.participants as Any), ("version", self.version as Any)]) + 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 { @@ -1606,8 +998,8 @@ public extension Api { self.data = data self.gameShortName = gameShortName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateInlineBotCallbackQuery", [("flags", self.flags as Any), ("queryId", self.queryId as Any), ("userId", self.userId as Any), ("msgId", self.msgId as Any), ("chatInstance", self.chatInstance as Any), ("data", self.data as Any), ("gameShortName", self.gameShortName as Any)]) + 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 { @@ -1615,8 +1007,8 @@ public extension Api { public init(difference: Api.LangPackDifference) { self.difference = difference } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateLangPack", [("difference", self.difference as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateLangPack", [("difference", ConstructorParameterDescription(self.difference))]) } } public class Cons_updateLangPackTooLong: TypeConstructorDescription { @@ -1624,8 +1016,8 @@ public extension Api { public init(langCode: String) { self.langCode = langCode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateLangPackTooLong", [("langCode", self.langCode as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateLangPackTooLong", [("langCode", ConstructorParameterDescription(self.langCode))]) } } public class Cons_updateManagedBot: TypeConstructorDescription { @@ -1637,8 +1029,8 @@ public extension Api { self.botId = botId self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateManagedBot", [("userId", self.userId as Any), ("botId", self.botId as Any), ("qts", self.qts as Any)]) + 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 { @@ -1650,8 +1042,8 @@ public extension Api { self.msgId = msgId self.extendedMedia = extendedMedia } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMessageExtendedMedia", [("peer", self.peer as Any), ("msgId", self.msgId as Any), ("extendedMedia", self.extendedMedia as Any)]) + 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 { @@ -1661,8 +1053,8 @@ public extension Api { self.id = id self.randomId = randomId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMessageID", [("id", self.id as Any), ("randomId", self.randomId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMessageID", [("id", ConstructorParameterDescription(self.id)), ("randomId", ConstructorParameterDescription(self.randomId))]) } } public class Cons_updateMessagePoll: TypeConstructorDescription { @@ -1682,8 +1074,8 @@ public extension Api { self.poll = poll self.results = results } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMessagePoll", [("flags", self.flags as Any), ("peer", self.peer as Any), ("msgId", self.msgId as Any), ("topMsgId", self.topMsgId as Any), ("pollId", self.pollId as Any), ("poll", self.poll as Any), ("results", self.results as Any)]) + 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 { @@ -1699,8 +1091,8 @@ public extension Api { self.positions = positions self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMessagePollVote", [("pollId", self.pollId as Any), ("peer", self.peer as Any), ("options", self.options as Any), ("positions", self.positions as Any), ("qts", self.qts as Any)]) + 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 { @@ -1718,8 +1110,8 @@ public extension Api { self.savedPeerId = savedPeerId self.reactions = reactions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMessageReactions", [("flags", self.flags as Any), ("peer", self.peer as Any), ("msgId", self.msgId as Any), ("topMsgId", self.topMsgId as Any), ("savedPeerId", self.savedPeerId as Any), ("reactions", self.reactions as Any)]) + 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 { @@ -1731,8 +1123,8 @@ public extension Api { self.channelId = channelId self.savedPeerId = savedPeerId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMonoForumNoPaidException", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("savedPeerId", self.savedPeerId as Any)]) + 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 { @@ -1742,8 +1134,8 @@ public extension Api { self.flags = flags self.stickerset = stickerset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateMoveStickerSetToTop", [("flags", self.flags as Any), ("stickerset", self.stickerset as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateMoveStickerSetToTop", [("flags", ConstructorParameterDescription(self.flags)), ("stickerset", ConstructorParameterDescription(self.stickerset))]) } } public class Cons_updateNewAuthorization: TypeConstructorDescription { @@ -1759,8 +1151,8 @@ public extension Api { self.device = device self.location = location } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewAuthorization", [("flags", self.flags as Any), ("hash", self.hash as Any), ("date", self.date as Any), ("device", self.device as Any), ("location", self.location as Any)]) + 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 { @@ -1772,8 +1164,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewChannelMessage", [("message", self.message as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1783,8 +1175,8 @@ public extension Api { self.message = message self.qts = qts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewEncryptedMessage", [("message", self.message as Any), ("qts", self.qts as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewEncryptedMessage", [("message", ConstructorParameterDescription(self.message)), ("qts", ConstructorParameterDescription(self.qts))]) } } public class Cons_updateNewMessage: TypeConstructorDescription { @@ -1796,8 +1188,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewMessage", [("message", self.message as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1805,8 +1197,8 @@ public extension Api { public init(quickReply: Api.QuickReply) { self.quickReply = quickReply } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewQuickReply", [("quickReply", self.quickReply as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewQuickReply", [("quickReply", ConstructorParameterDescription(self.quickReply))]) } } public class Cons_updateNewScheduledMessage: TypeConstructorDescription { @@ -1814,8 +1206,8 @@ public extension Api { public init(message: Api.Message) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewScheduledMessage", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewScheduledMessage", [("message", ConstructorParameterDescription(self.message))]) } } public class Cons_updateNewStickerSet: TypeConstructorDescription { @@ -1823,8 +1215,8 @@ public extension Api { public init(stickerset: Api.messages.StickerSet) { self.stickerset = stickerset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewStickerSet", [("stickerset", self.stickerset as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNewStickerSet", [("stickerset", ConstructorParameterDescription(self.stickerset))]) } } public class Cons_updateNewStoryReaction: TypeConstructorDescription { @@ -1836,8 +1228,8 @@ public extension Api { self.peer = peer self.reaction = reaction } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNewStoryReaction", [("storyId", self.storyId as Any), ("peer", self.peer as Any), ("reaction", self.reaction as Any)]) + 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 { @@ -1847,8 +1239,8 @@ public extension Api { self.peer = peer self.notifySettings = notifySettings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateNotifySettings", [("peer", self.peer as Any), ("notifySettings", self.notifySettings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateNotifySettings", [("peer", ConstructorParameterDescription(self.peer)), ("notifySettings", ConstructorParameterDescription(self.notifySettings))]) } } public class Cons_updatePaidReactionPrivacy: TypeConstructorDescription { @@ -1856,8 +1248,8 @@ public extension Api { public init(`private`: Api.PaidReactionPrivacy) { self.`private` = `private` } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePaidReactionPrivacy", [("`private`", self.`private` as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePaidReactionPrivacy", [("`private`", ConstructorParameterDescription(self.`private`))]) } } public class Cons_updatePeerBlocked: TypeConstructorDescription { @@ -1867,8 +1259,8 @@ public extension Api { self.flags = flags self.peerId = peerId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePeerBlocked", [("flags", self.flags as Any), ("peerId", self.peerId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerBlocked", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId))]) } } public class Cons_updatePeerHistoryTTL: TypeConstructorDescription { @@ -1880,8 +1272,8 @@ public extension Api { self.peer = peer self.ttlPeriod = ttlPeriod } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePeerHistoryTTL", [("flags", self.flags as Any), ("peer", self.peer as Any), ("ttlPeriod", self.ttlPeriod as Any)]) + 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 { @@ -1889,8 +1281,8 @@ public extension Api { public init(peers: [Api.PeerLocated]) { self.peers = peers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePeerLocated", [("peers", self.peers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerLocated", [("peers", ConstructorParameterDescription(self.peers))]) } } public class Cons_updatePeerSettings: TypeConstructorDescription { @@ -1900,8 +1292,8 @@ public extension Api { self.peer = peer self.settings = settings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePeerSettings", [("peer", self.peer as Any), ("settings", self.settings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePeerSettings", [("peer", ConstructorParameterDescription(self.peer)), ("settings", ConstructorParameterDescription(self.settings))]) } } public class Cons_updatePeerWallpaper: TypeConstructorDescription { @@ -1913,8 +1305,8 @@ public extension Api { self.peer = peer self.wallpaper = wallpaper } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePeerWallpaper", [("flags", self.flags as Any), ("peer", self.peer as Any), ("wallpaper", self.wallpaper as Any)]) + 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 { @@ -1926,8 +1318,8 @@ public extension Api { self.requestsPending = requestsPending self.recentRequesters = recentRequesters } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePendingJoinRequests", [("peer", self.peer as Any), ("requestsPending", self.requestsPending as Any), ("recentRequesters", self.recentRequesters as Any)]) + 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 { @@ -1935,8 +1327,8 @@ public extension Api { public init(phoneCall: Api.PhoneCall) { self.phoneCall = phoneCall } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePhoneCall", [("phoneCall", self.phoneCall as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePhoneCall", [("phoneCall", ConstructorParameterDescription(self.phoneCall))]) } } public class Cons_updatePhoneCallSignalingData: TypeConstructorDescription { @@ -1946,8 +1338,8 @@ public extension Api { self.phoneCallId = phoneCallId self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePhoneCallSignalingData", [("phoneCallId", self.phoneCallId as Any), ("data", self.data as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePhoneCallSignalingData", [("phoneCallId", ConstructorParameterDescription(self.phoneCallId)), ("data", ConstructorParameterDescription(self.data))]) } } public class Cons_updatePinnedChannelMessages: TypeConstructorDescription { @@ -1963,8 +1355,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePinnedChannelMessages", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("messages", self.messages as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -1976,8 +1368,8 @@ public extension Api { self.folderId = folderId self.order = order } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePinnedDialogs", [("flags", self.flags as Any), ("folderId", self.folderId as Any), ("order", self.order as Any)]) + 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 { @@ -1989,8 +1381,8 @@ public extension Api { self.peer = peer self.topicId = topicId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePinnedForumTopic", [("flags", self.flags as Any), ("peer", self.peer as Any), ("topicId", self.topicId as Any)]) + 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 { @@ -2002,8 +1394,8 @@ public extension Api { self.peer = peer self.order = order } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePinnedForumTopics", [("flags", self.flags as Any), ("peer", self.peer as Any), ("order", self.order as Any)]) + 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 { @@ -2019,8 +1411,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePinnedMessages", [("flags", self.flags as Any), ("peer", self.peer as Any), ("messages", self.messages as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -2030,8 +1422,8 @@ public extension Api { self.flags = flags self.order = order } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePinnedSavedDialogs", [("flags", self.flags as Any), ("order", self.order as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePinnedSavedDialogs", [("flags", ConstructorParameterDescription(self.flags)), ("order", ConstructorParameterDescription(self.order))]) } } public class Cons_updatePrivacy: TypeConstructorDescription { @@ -2041,8 +1433,8 @@ public extension Api { self.key = key self.rules = rules } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatePrivacy", [("key", self.key as Any), ("rules", self.rules as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updatePrivacy", [("key", ConstructorParameterDescription(self.key)), ("rules", ConstructorParameterDescription(self.rules))]) } } public class Cons_updateQuickReplies: TypeConstructorDescription { @@ -2050,8 +1442,8 @@ public extension Api { public init(quickReplies: [Api.QuickReply]) { self.quickReplies = quickReplies } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateQuickReplies", [("quickReplies", self.quickReplies as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateQuickReplies", [("quickReplies", ConstructorParameterDescription(self.quickReplies))]) } } public class Cons_updateQuickReplyMessage: TypeConstructorDescription { @@ -2059,8 +1451,8 @@ public extension Api { public init(message: Api.Message) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateQuickReplyMessage", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateQuickReplyMessage", [("message", ConstructorParameterDescription(self.message))]) } } public class Cons_updateReadChannelDiscussionInbox: TypeConstructorDescription { @@ -2078,8 +1470,8 @@ public extension Api { self.broadcastId = broadcastId self.broadcastPost = broadcastPost } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadChannelDiscussionInbox", [("flags", self.flags as Any), ("channelId", self.channelId as Any), ("topMsgId", self.topMsgId as Any), ("readMaxId", self.readMaxId as Any), ("broadcastId", self.broadcastId as Any), ("broadcastPost", self.broadcastPost as Any)]) + 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 { @@ -2091,8 +1483,8 @@ public extension Api { self.topMsgId = topMsgId self.readMaxId = readMaxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadChannelDiscussionOutbox", [("channelId", self.channelId as Any), ("topMsgId", self.topMsgId as Any), ("readMaxId", self.readMaxId as Any)]) + 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 { @@ -2110,8 +1502,8 @@ public extension Api { self.stillUnreadCount = stillUnreadCount self.pts = pts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadChannelInbox", [("flags", self.flags as Any), ("folderId", self.folderId as Any), ("channelId", self.channelId as Any), ("maxId", self.maxId as Any), ("stillUnreadCount", self.stillUnreadCount as Any), ("pts", self.pts as Any)]) + 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 { @@ -2121,8 +1513,8 @@ public extension Api { self.channelId = channelId self.maxId = maxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadChannelOutbox", [("channelId", self.channelId as Any), ("maxId", self.maxId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadChannelOutbox", [("channelId", ConstructorParameterDescription(self.channelId)), ("maxId", ConstructorParameterDescription(self.maxId))]) } } public class Cons_updateReadHistoryInbox: TypeConstructorDescription { @@ -2144,8 +1536,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadHistoryInbox", [("flags", self.flags as Any), ("folderId", self.folderId as Any), ("peer", self.peer as Any), ("topMsgId", self.topMsgId as Any), ("maxId", self.maxId as Any), ("stillUnreadCount", self.stillUnreadCount as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -2159,8 +1551,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadHistoryOutbox", [("peer", self.peer as Any), ("maxId", self.maxId as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -2176,8 +1568,8 @@ public extension Api { self.ptsCount = ptsCount self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadMessagesContents", [("flags", self.flags as Any), ("messages", self.messages as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("date", self.date as Any)]) + 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 { @@ -2189,8 +1581,8 @@ public extension Api { self.savedPeerId = savedPeerId self.readMaxId = readMaxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadMonoForumInbox", [("channelId", self.channelId as Any), ("savedPeerId", self.savedPeerId as Any), ("readMaxId", self.readMaxId as Any)]) + 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 { @@ -2202,8 +1594,8 @@ public extension Api { self.savedPeerId = savedPeerId self.readMaxId = readMaxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadMonoForumOutbox", [("channelId", self.channelId as Any), ("savedPeerId", self.savedPeerId as Any), ("readMaxId", self.readMaxId as Any)]) + 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 { @@ -2213,8 +1605,8 @@ public extension Api { self.peer = peer self.maxId = maxId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateReadStories", [("peer", self.peer as Any), ("maxId", self.maxId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateReadStories", [("peer", ConstructorParameterDescription(self.peer)), ("maxId", ConstructorParameterDescription(self.maxId))]) } } public class Cons_updateSavedDialogPinned: TypeConstructorDescription { @@ -2224,8 +1616,8 @@ public extension Api { self.flags = flags self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateSavedDialogPinned", [("flags", self.flags as Any), ("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateSavedDialogPinned", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer))]) } } public class Cons_updateSentPhoneCode: TypeConstructorDescription { @@ -2233,8 +1625,8 @@ public extension Api { public init(sentCode: Api.auth.SentCode) { self.sentCode = sentCode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateSentPhoneCode", [("sentCode", self.sentCode as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateSentPhoneCode", [("sentCode", ConstructorParameterDescription(self.sentCode))]) } } public class Cons_updateSentStoryReaction: TypeConstructorDescription { @@ -2246,8 +1638,8 @@ public extension Api { self.storyId = storyId self.reaction = reaction } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateSentStoryReaction", [("peer", self.peer as Any), ("storyId", self.storyId as Any), ("reaction", self.reaction as Any)]) + 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 { @@ -2265,8 +1657,8 @@ public extension Api { self.media = media self.entities = entities } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateServiceNotification", [("flags", self.flags as Any), ("inboxDate", self.inboxDate as Any), ("type", self.type as Any), ("message", self.message as Any), ("media", self.media as Any), ("entities", self.entities as Any)]) + 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 { @@ -2274,8 +1666,8 @@ public extension Api { public init(jobId: String) { self.jobId = jobId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateSmsJob", [("jobId", self.jobId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateSmsJob", [("jobId", ConstructorParameterDescription(self.jobId))]) } } public class Cons_updateStarGiftAuctionState: TypeConstructorDescription { @@ -2285,8 +1677,8 @@ public extension Api { self.giftId = giftId self.state = state } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStarGiftAuctionState", [("giftId", self.giftId as Any), ("state", self.state as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarGiftAuctionState", [("giftId", ConstructorParameterDescription(self.giftId)), ("state", ConstructorParameterDescription(self.state))]) } } public class Cons_updateStarGiftAuctionUserState: TypeConstructorDescription { @@ -2296,8 +1688,8 @@ public extension Api { self.giftId = giftId self.userState = userState } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStarGiftAuctionUserState", [("giftId", self.giftId as Any), ("userState", self.userState as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarGiftAuctionUserState", [("giftId", ConstructorParameterDescription(self.giftId)), ("userState", ConstructorParameterDescription(self.userState))]) } } public class Cons_updateStarsBalance: TypeConstructorDescription { @@ -2305,8 +1697,8 @@ public extension Api { public init(balance: Api.StarsAmount) { self.balance = balance } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStarsBalance", [("balance", self.balance as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarsBalance", [("balance", ConstructorParameterDescription(self.balance))]) } } public class Cons_updateStarsRevenueStatus: TypeConstructorDescription { @@ -2316,8 +1708,8 @@ public extension Api { self.peer = peer self.status = status } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStarsRevenueStatus", [("peer", self.peer as Any), ("status", self.status as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStarsRevenueStatus", [("peer", ConstructorParameterDescription(self.peer)), ("status", ConstructorParameterDescription(self.status))]) } } public class Cons_updateStickerSets: TypeConstructorDescription { @@ -2325,8 +1717,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStickerSets", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStickerSets", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_updateStickerSetsOrder: TypeConstructorDescription { @@ -2336,8 +1728,8 @@ public extension Api { self.flags = flags self.order = order } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStickerSetsOrder", [("flags", self.flags as Any), ("order", self.order as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStickerSetsOrder", [("flags", ConstructorParameterDescription(self.flags)), ("order", ConstructorParameterDescription(self.order))]) } } public class Cons_updateStoriesStealthMode: TypeConstructorDescription { @@ -2345,8 +1737,8 @@ public extension Api { public init(stealthMode: Api.StoriesStealthMode) { self.stealthMode = stealthMode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStoriesStealthMode", [("stealthMode", self.stealthMode as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStoriesStealthMode", [("stealthMode", ConstructorParameterDescription(self.stealthMode))]) } } public class Cons_updateStory: TypeConstructorDescription { @@ -2356,8 +1748,8 @@ public extension Api { self.peer = peer self.story = story } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStory", [("peer", self.peer as Any), ("story", self.story as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStory", [("peer", ConstructorParameterDescription(self.peer)), ("story", ConstructorParameterDescription(self.story))]) } } public class Cons_updateStoryID: TypeConstructorDescription { @@ -2367,8 +1759,8 @@ public extension Api { self.id = id self.randomId = randomId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateStoryID", [("id", self.id as Any), ("randomId", self.randomId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateStoryID", [("id", ConstructorParameterDescription(self.id)), ("randomId", ConstructorParameterDescription(self.randomId))]) } } public class Cons_updateTheme: TypeConstructorDescription { @@ -2376,8 +1768,8 @@ public extension Api { public init(theme: Api.Theme) { self.theme = theme } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateTheme", [("theme", self.theme as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateTheme", [("theme", ConstructorParameterDescription(self.theme))]) } } public class Cons_updateTranscribedAudio: TypeConstructorDescription { @@ -2393,8 +1785,8 @@ public extension Api { self.transcriptionId = transcriptionId self.text = text } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateTranscribedAudio", [("flags", self.flags as Any), ("peer", self.peer as Any), ("msgId", self.msgId as Any), ("transcriptionId", self.transcriptionId as Any), ("text", self.text as Any)]) + 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 { @@ -2402,8 +1794,8 @@ public extension Api { public init(userId: Int64) { self.userId = userId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateUser", [("userId", self.userId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUser", [("userId", ConstructorParameterDescription(self.userId))]) } } public class Cons_updateUserEmojiStatus: TypeConstructorDescription { @@ -2413,8 +1805,8 @@ public extension Api { self.userId = userId self.emojiStatus = emojiStatus } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateUserEmojiStatus", [("userId", self.userId as Any), ("emojiStatus", self.emojiStatus as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserEmojiStatus", [("userId", ConstructorParameterDescription(self.userId)), ("emojiStatus", ConstructorParameterDescription(self.emojiStatus))]) } } public class Cons_updateUserName: TypeConstructorDescription { @@ -2428,8 +1820,8 @@ public extension Api { self.lastName = lastName self.usernames = usernames } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateUserName", [("userId", self.userId as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("usernames", self.usernames as Any)]) + 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 { @@ -2439,8 +1831,8 @@ public extension Api { self.userId = userId self.phone = phone } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateUserPhone", [("userId", self.userId as Any), ("phone", self.phone as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserPhone", [("userId", ConstructorParameterDescription(self.userId)), ("phone", ConstructorParameterDescription(self.phone))]) } } public class Cons_updateUserStatus: TypeConstructorDescription { @@ -2450,8 +1842,8 @@ public extension Api { self.userId = userId self.status = status } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateUserStatus", [("userId", self.userId as Any), ("status", self.status as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateUserStatus", [("userId", ConstructorParameterDescription(self.userId)), ("status", ConstructorParameterDescription(self.status))]) } } public class Cons_updateUserTyping: TypeConstructorDescription { @@ -2465,8 +1857,8 @@ public extension Api { self.topMsgId = topMsgId self.action = action } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateUserTyping", [("flags", self.flags as Any), ("userId", self.userId as Any), ("topMsgId", self.topMsgId as Any), ("action", self.action as Any)]) + 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 { @@ -2478,8 +1870,8 @@ public extension Api { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateWebPage", [("webpage", self.webpage as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + 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 { @@ -2487,8 +1879,8 @@ public extension Api { public init(queryId: Int64) { self.queryId = queryId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateWebViewResultSent", [("queryId", self.queryId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateWebViewResultSent", [("queryId", ConstructorParameterDescription(self.queryId))]) } } case updateAttachMenuBots @@ -4091,254 +3483,254 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .updateAttachMenuBots: return ("updateAttachMenuBots", []) case .updateAutoSaveSettings: return ("updateAutoSaveSettings", []) case .updateBotBusinessConnect(let _data): - return ("updateBotBusinessConnect", [("connection", _data.connection as Any), ("qts", _data.qts as Any)]) + return ("updateBotBusinessConnect", [("connection", ConstructorParameterDescription(_data.connection)), ("qts", ConstructorParameterDescription(_data.qts))]) case .updateBotCallbackQuery(let _data): - return ("updateBotCallbackQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("chatInstance", _data.chatInstance as Any), ("data", _data.data as Any), ("gameShortName", _data.gameShortName as Any)]) + 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", _data.peer as Any), ("boost", _data.boost as Any), ("qts", _data.qts as Any)]) + return ("updateBotChatBoost", [("peer", ConstructorParameterDescription(_data.peer)), ("boost", ConstructorParameterDescription(_data.boost)), ("qts", ConstructorParameterDescription(_data.qts))]) case .updateBotChatInviteRequester(let _data): - return ("updateBotChatInviteRequester", [("peer", _data.peer as Any), ("date", _data.date as Any), ("userId", _data.userId as Any), ("about", _data.about as Any), ("invite", _data.invite as Any), ("qts", _data.qts as Any)]) + 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", _data.peer as Any), ("botId", _data.botId as Any), ("commands", _data.commands as Any)]) + return ("updateBotCommands", [("peer", ConstructorParameterDescription(_data.peer)), ("botId", ConstructorParameterDescription(_data.botId)), ("commands", ConstructorParameterDescription(_data.commands))]) case .updateBotDeleteBusinessMessage(let _data): - return ("updateBotDeleteBusinessMessage", [("connectionId", _data.connectionId as Any), ("peer", _data.peer as Any), ("messages", _data.messages as Any), ("qts", _data.qts as Any)]) + 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", _data.flags as Any), ("connectionId", _data.connectionId as Any), ("message", _data.message as Any), ("replyToMessage", _data.replyToMessage as Any), ("qts", _data.qts as Any)]) + return ("updateBotEditBusinessMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("connectionId", ConstructorParameterDescription(_data.connectionId)), ("message", ConstructorParameterDescription(_data.message)), ("replyToMessage", ConstructorParameterDescription(_data.replyToMessage)), ("qts", ConstructorParameterDescription(_data.qts))]) case .updateBotInlineQuery(let _data): - return ("updateBotInlineQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("query", _data.query as Any), ("geo", _data.geo as Any), ("peerType", _data.peerType as Any), ("offset", _data.offset as Any)]) + 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", _data.flags as Any), ("userId", _data.userId as Any), ("query", _data.query as Any), ("geo", _data.geo as Any), ("id", _data.id as Any), ("msgId", _data.msgId as Any)]) + 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", _data.botId as Any), ("button", _data.button as Any)]) + return ("updateBotMenuButton", [("botId", ConstructorParameterDescription(_data.botId)), ("button", ConstructorParameterDescription(_data.button))]) case .updateBotMessageReaction(let _data): - return ("updateBotMessageReaction", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("date", _data.date as Any), ("actor", _data.actor as Any), ("oldReactions", _data.oldReactions as Any), ("newReactions", _data.newReactions as Any), ("qts", _data.qts as Any)]) + 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", _data.peer as Any), ("msgId", _data.msgId as Any), ("date", _data.date as Any), ("reactions", _data.reactions as Any), ("qts", _data.qts as Any)]) + 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", _data.flags as Any), ("connectionId", _data.connectionId as Any), ("message", _data.message as Any), ("replyToMessage", _data.replyToMessage as Any), ("qts", _data.qts as Any)]) + 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", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("payload", _data.payload as Any), ("info", _data.info as Any), ("shippingOptionId", _data.shippingOptionId as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any)]) + 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", _data.userId as Any), ("payload", _data.payload as Any), ("qts", _data.qts as Any)]) + return ("updateBotPurchasedPaidMedia", [("userId", ConstructorParameterDescription(_data.userId)), ("payload", ConstructorParameterDescription(_data.payload)), ("qts", ConstructorParameterDescription(_data.qts))]) case .updateBotShippingQuery(let _data): - return ("updateBotShippingQuery", [("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("payload", _data.payload as Any), ("shippingAddress", _data.shippingAddress as Any)]) + 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", _data.userId as Any), ("date", _data.date as Any), ("stopped", _data.stopped as Any), ("qts", _data.qts as Any)]) + 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", _data.data as Any)]) + return ("updateBotWebhookJSON", [("data", ConstructorParameterDescription(_data.data))]) case .updateBotWebhookJSONQuery(let _data): - return ("updateBotWebhookJSONQuery", [("queryId", _data.queryId as Any), ("data", _data.data as Any), ("timeout", _data.timeout as Any)]) + return ("updateBotWebhookJSONQuery", [("queryId", ConstructorParameterDescription(_data.queryId)), ("data", ConstructorParameterDescription(_data.data)), ("timeout", ConstructorParameterDescription(_data.timeout))]) case .updateBusinessBotCallbackQuery(let _data): - return ("updateBusinessBotCallbackQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("connectionId", _data.connectionId as Any), ("message", _data.message as Any), ("replyToMessage", _data.replyToMessage as Any), ("chatInstance", _data.chatInstance as Any), ("data", _data.data as Any)]) + 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", _data.channelId as Any)]) + return ("updateChannel", [("channelId", ConstructorParameterDescription(_data.channelId))]) case .updateChannelAvailableMessages(let _data): - return ("updateChannelAvailableMessages", [("channelId", _data.channelId as Any), ("availableMinId", _data.availableMinId as Any)]) + return ("updateChannelAvailableMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("availableMinId", ConstructorParameterDescription(_data.availableMinId))]) case .updateChannelMessageForwards(let _data): - return ("updateChannelMessageForwards", [("channelId", _data.channelId as Any), ("id", _data.id as Any), ("forwards", _data.forwards as Any)]) + return ("updateChannelMessageForwards", [("channelId", ConstructorParameterDescription(_data.channelId)), ("id", ConstructorParameterDescription(_data.id)), ("forwards", ConstructorParameterDescription(_data.forwards))]) case .updateChannelMessageViews(let _data): - return ("updateChannelMessageViews", [("channelId", _data.channelId as Any), ("id", _data.id as Any), ("views", _data.views as Any)]) + return ("updateChannelMessageViews", [("channelId", ConstructorParameterDescription(_data.channelId)), ("id", ConstructorParameterDescription(_data.id)), ("views", ConstructorParameterDescription(_data.views))]) case .updateChannelParticipant(let _data): - return ("updateChannelParticipant", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("date", _data.date as Any), ("actorId", _data.actorId as Any), ("userId", _data.userId as Any), ("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any), ("invite", _data.invite as Any), ("qts", _data.qts as Any)]) + 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", _data.flags as Any), ("channelId", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("savedPeerId", _data.savedPeerId as Any), ("messages", _data.messages as Any)]) + 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", _data.flags as Any), ("channelId", _data.channelId as Any), ("pts", _data.pts as Any)]) + return ("updateChannelTooLong", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("pts", ConstructorParameterDescription(_data.pts))]) case .updateChannelUserTyping(let _data): - return ("updateChannelUserTyping", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("fromId", _data.fromId as Any), ("action", _data.action as Any)]) + 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", _data.channelId as Any), ("enabled", _data.enabled as Any)]) + return ("updateChannelViewForumAsMessages", [("channelId", ConstructorParameterDescription(_data.channelId)), ("enabled", ConstructorParameterDescription(_data.enabled))]) case .updateChannelWebPage(let _data): - return ("updateChannelWebPage", [("channelId", _data.channelId as Any), ("webpage", _data.webpage as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + 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", _data.chatId as Any)]) + return ("updateChat", [("chatId", ConstructorParameterDescription(_data.chatId))]) case .updateChatDefaultBannedRights(let _data): - return ("updateChatDefaultBannedRights", [("peer", _data.peer as Any), ("defaultBannedRights", _data.defaultBannedRights as Any), ("version", _data.version as Any)]) + return ("updateChatDefaultBannedRights", [("peer", ConstructorParameterDescription(_data.peer)), ("defaultBannedRights", ConstructorParameterDescription(_data.defaultBannedRights)), ("version", ConstructorParameterDescription(_data.version))]) case .updateChatParticipant(let _data): - return ("updateChatParticipant", [("flags", _data.flags as Any), ("chatId", _data.chatId as Any), ("date", _data.date as Any), ("actorId", _data.actorId as Any), ("userId", _data.userId as Any), ("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any), ("invite", _data.invite as Any), ("qts", _data.qts as Any)]) + 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", _data.chatId as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any), ("version", _data.version as Any)]) + 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", _data.chatId as Any), ("userId", _data.userId as Any), ("isAdmin", _data.isAdmin as Any), ("version", _data.version as Any)]) + 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", _data.chatId as Any), ("userId", _data.userId as Any), ("version", _data.version as Any)]) + return ("updateChatParticipantDelete", [("chatId", ConstructorParameterDescription(_data.chatId)), ("userId", ConstructorParameterDescription(_data.userId)), ("version", ConstructorParameterDescription(_data.version))]) case .updateChatParticipantRank(let _data): - return ("updateChatParticipantRank", [("chatId", _data.chatId as Any), ("userId", _data.userId as Any), ("rank", _data.rank as Any), ("version", _data.version as Any)]) + 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", _data.participants as Any)]) + return ("updateChatParticipants", [("participants", ConstructorParameterDescription(_data.participants))]) case .updateChatUserTyping(let _data): - return ("updateChatUserTyping", [("chatId", _data.chatId as Any), ("fromId", _data.fromId as Any), ("action", _data.action as Any)]) + 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", _data.dcOptions as Any)]) + return ("updateDcOptions", [("dcOptions", ConstructorParameterDescription(_data.dcOptions))]) case .updateDeleteChannelMessages(let _data): - return ("updateDeleteChannelMessages", [("channelId", _data.channelId as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + 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", _data.call as Any), ("messages", _data.messages as Any)]) + return ("updateDeleteGroupCallMessages", [("call", ConstructorParameterDescription(_data.call)), ("messages", ConstructorParameterDescription(_data.messages))]) case .updateDeleteMessages(let _data): - return ("updateDeleteMessages", [("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("updateDeleteMessages", [("messages", ConstructorParameterDescription(_data.messages)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) case .updateDeleteQuickReply(let _data): - return ("updateDeleteQuickReply", [("shortcutId", _data.shortcutId as Any)]) + return ("updateDeleteQuickReply", [("shortcutId", ConstructorParameterDescription(_data.shortcutId))]) case .updateDeleteQuickReplyMessages(let _data): - return ("updateDeleteQuickReplyMessages", [("shortcutId", _data.shortcutId as Any), ("messages", _data.messages as Any)]) + return ("updateDeleteQuickReplyMessages", [("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("messages", ConstructorParameterDescription(_data.messages))]) case .updateDeleteScheduledMessages(let _data): - return ("updateDeleteScheduledMessages", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("messages", _data.messages as Any), ("sentMessages", _data.sentMessages as Any)]) + 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", _data.flags as Any), ("id", _data.id as Any), ("filter", _data.filter as Any)]) + return ("updateDialogFilter", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("filter", ConstructorParameterDescription(_data.filter))]) case .updateDialogFilterOrder(let _data): - return ("updateDialogFilterOrder", [("order", _data.order as Any)]) + return ("updateDialogFilterOrder", [("order", ConstructorParameterDescription(_data.order))]) case .updateDialogFilters: return ("updateDialogFilters", []) case .updateDialogPinned(let _data): - return ("updateDialogPinned", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("peer", _data.peer as Any)]) + return ("updateDialogPinned", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("peer", ConstructorParameterDescription(_data.peer))]) case .updateDialogUnreadMark(let _data): - return ("updateDialogUnreadMark", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("savedPeerId", _data.savedPeerId as Any)]) + return ("updateDialogUnreadMark", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId))]) case .updateDraftMessage(let _data): - return ("updateDraftMessage", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any), ("savedPeerId", _data.savedPeerId as Any), ("draft", _data.draft as Any)]) + 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", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("updateEditChannelMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) case .updateEditMessage(let _data): - return ("updateEditMessage", [("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("updateEditMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) case .updateEmojiGameInfo(let _data): - return ("updateEmojiGameInfo", [("info", _data.info as Any)]) + return ("updateEmojiGameInfo", [("info", ConstructorParameterDescription(_data.info))]) case .updateEncryptedChatTyping(let _data): - return ("updateEncryptedChatTyping", [("chatId", _data.chatId as Any)]) + return ("updateEncryptedChatTyping", [("chatId", ConstructorParameterDescription(_data.chatId))]) case .updateEncryptedMessagesRead(let _data): - return ("updateEncryptedMessagesRead", [("chatId", _data.chatId as Any), ("maxDate", _data.maxDate as Any), ("date", _data.date as Any)]) + return ("updateEncryptedMessagesRead", [("chatId", ConstructorParameterDescription(_data.chatId)), ("maxDate", ConstructorParameterDescription(_data.maxDate)), ("date", ConstructorParameterDescription(_data.date))]) case .updateEncryption(let _data): - return ("updateEncryption", [("chat", _data.chat as Any), ("date", _data.date as Any)]) + return ("updateEncryption", [("chat", ConstructorParameterDescription(_data.chat)), ("date", ConstructorParameterDescription(_data.date))]) case .updateFavedStickers: return ("updateFavedStickers", []) case .updateFolderPeers(let _data): - return ("updateFolderPeers", [("folderPeers", _data.folderPeers as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("updateFolderPeers", [("folderPeers", ConstructorParameterDescription(_data.folderPeers)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) case .updateGeoLiveViewed(let _data): - return ("updateGeoLiveViewed", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any)]) + return ("updateGeoLiveViewed", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId))]) case .updateGroupCall(let _data): - return ("updateGroupCall", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("call", _data.call as Any)]) + return ("updateGroupCall", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("call", ConstructorParameterDescription(_data.call))]) case .updateGroupCallChainBlocks(let _data): - return ("updateGroupCallChainBlocks", [("call", _data.call as Any), ("subChainId", _data.subChainId as Any), ("blocks", _data.blocks as Any), ("nextOffset", _data.nextOffset as Any)]) + 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", _data.flags as Any), ("params", _data.params as Any)]) + return ("updateGroupCallConnection", [("flags", ConstructorParameterDescription(_data.flags)), ("params", ConstructorParameterDescription(_data.params))]) case .updateGroupCallEncryptedMessage(let _data): - return ("updateGroupCallEncryptedMessage", [("call", _data.call as Any), ("fromId", _data.fromId as Any), ("encryptedMessage", _data.encryptedMessage as Any)]) + return ("updateGroupCallEncryptedMessage", [("call", ConstructorParameterDescription(_data.call)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("encryptedMessage", ConstructorParameterDescription(_data.encryptedMessage))]) case .updateGroupCallMessage(let _data): - return ("updateGroupCallMessage", [("call", _data.call as Any), ("message", _data.message as Any)]) + return ("updateGroupCallMessage", [("call", ConstructorParameterDescription(_data.call)), ("message", ConstructorParameterDescription(_data.message))]) case .updateGroupCallParticipants(let _data): - return ("updateGroupCallParticipants", [("call", _data.call as Any), ("participants", _data.participants as Any), ("version", _data.version as Any)]) + return ("updateGroupCallParticipants", [("call", ConstructorParameterDescription(_data.call)), ("participants", ConstructorParameterDescription(_data.participants)), ("version", ConstructorParameterDescription(_data.version))]) case .updateInlineBotCallbackQuery(let _data): - return ("updateInlineBotCallbackQuery", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("userId", _data.userId as Any), ("msgId", _data.msgId as Any), ("chatInstance", _data.chatInstance as Any), ("data", _data.data as Any), ("gameShortName", _data.gameShortName as Any)]) + 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", _data.difference as Any)]) + return ("updateLangPack", [("difference", ConstructorParameterDescription(_data.difference))]) case .updateLangPackTooLong(let _data): - return ("updateLangPackTooLong", [("langCode", _data.langCode as Any)]) + return ("updateLangPackTooLong", [("langCode", ConstructorParameterDescription(_data.langCode))]) case .updateLoginToken: return ("updateLoginToken", []) case .updateManagedBot(let _data): - return ("updateManagedBot", [("userId", _data.userId as Any), ("botId", _data.botId as Any), ("qts", _data.qts as Any)]) + return ("updateManagedBot", [("userId", ConstructorParameterDescription(_data.userId)), ("botId", ConstructorParameterDescription(_data.botId)), ("qts", ConstructorParameterDescription(_data.qts))]) case .updateMessageExtendedMedia(let _data): - return ("updateMessageExtendedMedia", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("extendedMedia", _data.extendedMedia as Any)]) + return ("updateMessageExtendedMedia", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("extendedMedia", ConstructorParameterDescription(_data.extendedMedia))]) case .updateMessageID(let _data): - return ("updateMessageID", [("id", _data.id as Any), ("randomId", _data.randomId as Any)]) + return ("updateMessageID", [("id", ConstructorParameterDescription(_data.id)), ("randomId", ConstructorParameterDescription(_data.randomId))]) case .updateMessagePoll(let _data): - return ("updateMessagePoll", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("topMsgId", _data.topMsgId as Any), ("pollId", _data.pollId as Any), ("poll", _data.poll as Any), ("results", _data.results as Any)]) + 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", _data.pollId as Any), ("peer", _data.peer as Any), ("options", _data.options as Any), ("positions", _data.positions as Any), ("qts", _data.qts as Any)]) + 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", _data.flags as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("topMsgId", _data.topMsgId as Any), ("savedPeerId", _data.savedPeerId as Any), ("reactions", _data.reactions as Any)]) + 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", _data.flags as Any), ("channelId", _data.channelId as Any), ("savedPeerId", _data.savedPeerId as Any)]) + return ("updateMonoForumNoPaidException", [("flags", ConstructorParameterDescription(_data.flags)), ("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId))]) case .updateMoveStickerSetToTop(let _data): - return ("updateMoveStickerSetToTop", [("flags", _data.flags as Any), ("stickerset", _data.stickerset as Any)]) + return ("updateMoveStickerSetToTop", [("flags", ConstructorParameterDescription(_data.flags)), ("stickerset", ConstructorParameterDescription(_data.stickerset))]) case .updateNewAuthorization(let _data): - return ("updateNewAuthorization", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("date", _data.date as Any), ("device", _data.device as Any), ("location", _data.location as Any)]) + 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", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("updateNewChannelMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) case .updateNewEncryptedMessage(let _data): - return ("updateNewEncryptedMessage", [("message", _data.message as Any), ("qts", _data.qts as Any)]) + return ("updateNewEncryptedMessage", [("message", ConstructorParameterDescription(_data.message)), ("qts", ConstructorParameterDescription(_data.qts))]) case .updateNewMessage(let _data): - return ("updateNewMessage", [("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("updateNewMessage", [("message", ConstructorParameterDescription(_data.message)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) case .updateNewQuickReply(let _data): - return ("updateNewQuickReply", [("quickReply", _data.quickReply as Any)]) + return ("updateNewQuickReply", [("quickReply", ConstructorParameterDescription(_data.quickReply))]) case .updateNewScheduledMessage(let _data): - return ("updateNewScheduledMessage", [("message", _data.message as Any)]) + return ("updateNewScheduledMessage", [("message", ConstructorParameterDescription(_data.message))]) case .updateNewStickerSet(let _data): - return ("updateNewStickerSet", [("stickerset", _data.stickerset as Any)]) + return ("updateNewStickerSet", [("stickerset", ConstructorParameterDescription(_data.stickerset))]) case .updateNewStoryReaction(let _data): - return ("updateNewStoryReaction", [("storyId", _data.storyId as Any), ("peer", _data.peer as Any), ("reaction", _data.reaction as Any)]) + return ("updateNewStoryReaction", [("storyId", ConstructorParameterDescription(_data.storyId)), ("peer", ConstructorParameterDescription(_data.peer)), ("reaction", ConstructorParameterDescription(_data.reaction))]) case .updateNotifySettings(let _data): - return ("updateNotifySettings", [("peer", _data.peer as Any), ("notifySettings", _data.notifySettings as Any)]) + return ("updateNotifySettings", [("peer", ConstructorParameterDescription(_data.peer)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings))]) case .updatePaidReactionPrivacy(let _data): - return ("updatePaidReactionPrivacy", [("`private`", _data.`private` as Any)]) + return ("updatePaidReactionPrivacy", [("`private`", ConstructorParameterDescription(_data.`private`))]) case .updatePeerBlocked(let _data): - return ("updatePeerBlocked", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any)]) + return ("updatePeerBlocked", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId))]) case .updatePeerHistoryTTL(let _data): - return ("updatePeerHistoryTTL", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + return ("updatePeerHistoryTTL", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) case .updatePeerLocated(let _data): - return ("updatePeerLocated", [("peers", _data.peers as Any)]) + return ("updatePeerLocated", [("peers", ConstructorParameterDescription(_data.peers))]) case .updatePeerSettings(let _data): - return ("updatePeerSettings", [("peer", _data.peer as Any), ("settings", _data.settings as Any)]) + return ("updatePeerSettings", [("peer", ConstructorParameterDescription(_data.peer)), ("settings", ConstructorParameterDescription(_data.settings))]) case .updatePeerWallpaper(let _data): - return ("updatePeerWallpaper", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("wallpaper", _data.wallpaper as Any)]) + return ("updatePeerWallpaper", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("wallpaper", ConstructorParameterDescription(_data.wallpaper))]) case .updatePendingJoinRequests(let _data): - return ("updatePendingJoinRequests", [("peer", _data.peer as Any), ("requestsPending", _data.requestsPending as Any), ("recentRequesters", _data.recentRequesters as Any)]) + return ("updatePendingJoinRequests", [("peer", ConstructorParameterDescription(_data.peer)), ("requestsPending", ConstructorParameterDescription(_data.requestsPending)), ("recentRequesters", ConstructorParameterDescription(_data.recentRequesters))]) case .updatePhoneCall(let _data): - return ("updatePhoneCall", [("phoneCall", _data.phoneCall as Any)]) + return ("updatePhoneCall", [("phoneCall", ConstructorParameterDescription(_data.phoneCall))]) case .updatePhoneCallSignalingData(let _data): - return ("updatePhoneCallSignalingData", [("phoneCallId", _data.phoneCallId as Any), ("data", _data.data as Any)]) + return ("updatePhoneCallSignalingData", [("phoneCallId", ConstructorParameterDescription(_data.phoneCallId)), ("data", ConstructorParameterDescription(_data.data))]) case .updatePinnedChannelMessages(let _data): - return ("updatePinnedChannelMessages", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + 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", _data.flags as Any), ("folderId", _data.folderId as Any), ("order", _data.order as Any)]) + return ("updatePinnedDialogs", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("order", ConstructorParameterDescription(_data.order))]) case .updatePinnedForumTopic(let _data): - return ("updatePinnedForumTopic", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topicId", _data.topicId as Any)]) + return ("updatePinnedForumTopic", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topicId", ConstructorParameterDescription(_data.topicId))]) case .updatePinnedForumTopics(let _data): - return ("updatePinnedForumTopics", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("order", _data.order as Any)]) + return ("updatePinnedForumTopics", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("order", ConstructorParameterDescription(_data.order))]) case .updatePinnedMessages(let _data): - return ("updatePinnedMessages", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + 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", _data.flags as Any), ("order", _data.order as Any)]) + return ("updatePinnedSavedDialogs", [("flags", ConstructorParameterDescription(_data.flags)), ("order", ConstructorParameterDescription(_data.order))]) case .updatePrivacy(let _data): - return ("updatePrivacy", [("key", _data.key as Any), ("rules", _data.rules as Any)]) + return ("updatePrivacy", [("key", ConstructorParameterDescription(_data.key)), ("rules", ConstructorParameterDescription(_data.rules))]) case .updatePtsChanged: return ("updatePtsChanged", []) case .updateQuickReplies(let _data): - return ("updateQuickReplies", [("quickReplies", _data.quickReplies as Any)]) + return ("updateQuickReplies", [("quickReplies", ConstructorParameterDescription(_data.quickReplies))]) case .updateQuickReplyMessage(let _data): - return ("updateQuickReplyMessage", [("message", _data.message as Any)]) + return ("updateQuickReplyMessage", [("message", ConstructorParameterDescription(_data.message))]) case .updateReadChannelDiscussionInbox(let _data): - return ("updateReadChannelDiscussionInbox", [("flags", _data.flags as Any), ("channelId", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("readMaxId", _data.readMaxId as Any), ("broadcastId", _data.broadcastId as Any), ("broadcastPost", _data.broadcastPost as Any)]) + 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", _data.channelId as Any), ("topMsgId", _data.topMsgId as Any), ("readMaxId", _data.readMaxId as Any)]) + return ("updateReadChannelDiscussionOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) case .updateReadChannelInbox(let _data): - return ("updateReadChannelInbox", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("channelId", _data.channelId as Any), ("maxId", _data.maxId as Any), ("stillUnreadCount", _data.stillUnreadCount as Any), ("pts", _data.pts as Any)]) + 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", _data.channelId as Any), ("maxId", _data.maxId as Any)]) + 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", _data.flags as Any), ("folderId", _data.folderId as Any), ("peer", _data.peer as Any), ("topMsgId", _data.topMsgId as Any), ("maxId", _data.maxId as Any), ("stillUnreadCount", _data.stillUnreadCount as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + 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", _data.peer as Any), ("maxId", _data.maxId as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + 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", _data.flags as Any), ("messages", _data.messages as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any)]) + 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", _data.channelId as Any), ("savedPeerId", _data.savedPeerId as Any), ("readMaxId", _data.readMaxId as Any)]) + return ("updateReadMonoForumInbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) case .updateReadMonoForumOutbox(let _data): - return ("updateReadMonoForumOutbox", [("channelId", _data.channelId as Any), ("savedPeerId", _data.savedPeerId as Any), ("readMaxId", _data.readMaxId as Any)]) + return ("updateReadMonoForumOutbox", [("channelId", ConstructorParameterDescription(_data.channelId)), ("savedPeerId", ConstructorParameterDescription(_data.savedPeerId)), ("readMaxId", ConstructorParameterDescription(_data.readMaxId))]) case .updateReadStories(let _data): - return ("updateReadStories", [("peer", _data.peer as Any), ("maxId", _data.maxId as Any)]) + return ("updateReadStories", [("peer", ConstructorParameterDescription(_data.peer)), ("maxId", ConstructorParameterDescription(_data.maxId))]) case .updateRecentEmojiStatuses: return ("updateRecentEmojiStatuses", []) case .updateRecentReactions: @@ -4346,7 +3738,7 @@ public extension Api { case .updateRecentStickers: return ("updateRecentStickers", []) case .updateSavedDialogPinned(let _data): - return ("updateSavedDialogPinned", [("flags", _data.flags as Any), ("peer", _data.peer as Any)]) + return ("updateSavedDialogPinned", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer))]) case .updateSavedGifs: return ("updateSavedGifs", []) case .updateSavedReactionTags: @@ -4354,53 +3746,53 @@ public extension Api { case .updateSavedRingtones: return ("updateSavedRingtones", []) case .updateSentPhoneCode(let _data): - return ("updateSentPhoneCode", [("sentCode", _data.sentCode as Any)]) + return ("updateSentPhoneCode", [("sentCode", ConstructorParameterDescription(_data.sentCode))]) case .updateSentStoryReaction(let _data): - return ("updateSentStoryReaction", [("peer", _data.peer as Any), ("storyId", _data.storyId as Any), ("reaction", _data.reaction as Any)]) + return ("updateSentStoryReaction", [("peer", ConstructorParameterDescription(_data.peer)), ("storyId", ConstructorParameterDescription(_data.storyId)), ("reaction", ConstructorParameterDescription(_data.reaction))]) case .updateServiceNotification(let _data): - return ("updateServiceNotification", [("flags", _data.flags as Any), ("inboxDate", _data.inboxDate as Any), ("type", _data.type as Any), ("message", _data.message as Any), ("media", _data.media as Any), ("entities", _data.entities as Any)]) + 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", _data.jobId as Any)]) + return ("updateSmsJob", [("jobId", ConstructorParameterDescription(_data.jobId))]) case .updateStarGiftAuctionState(let _data): - return ("updateStarGiftAuctionState", [("giftId", _data.giftId as Any), ("state", _data.state as Any)]) + return ("updateStarGiftAuctionState", [("giftId", ConstructorParameterDescription(_data.giftId)), ("state", ConstructorParameterDescription(_data.state))]) case .updateStarGiftAuctionUserState(let _data): - return ("updateStarGiftAuctionUserState", [("giftId", _data.giftId as Any), ("userState", _data.userState as Any)]) + return ("updateStarGiftAuctionUserState", [("giftId", ConstructorParameterDescription(_data.giftId)), ("userState", ConstructorParameterDescription(_data.userState))]) case .updateStarGiftCraftFail: return ("updateStarGiftCraftFail", []) case .updateStarsBalance(let _data): - return ("updateStarsBalance", [("balance", _data.balance as Any)]) + return ("updateStarsBalance", [("balance", ConstructorParameterDescription(_data.balance))]) case .updateStarsRevenueStatus(let _data): - return ("updateStarsRevenueStatus", [("peer", _data.peer as Any), ("status", _data.status as Any)]) + return ("updateStarsRevenueStatus", [("peer", ConstructorParameterDescription(_data.peer)), ("status", ConstructorParameterDescription(_data.status))]) case .updateStickerSets(let _data): - return ("updateStickerSets", [("flags", _data.flags as Any)]) + return ("updateStickerSets", [("flags", ConstructorParameterDescription(_data.flags))]) case .updateStickerSetsOrder(let _data): - return ("updateStickerSetsOrder", [("flags", _data.flags as Any), ("order", _data.order as Any)]) + return ("updateStickerSetsOrder", [("flags", ConstructorParameterDescription(_data.flags)), ("order", ConstructorParameterDescription(_data.order))]) case .updateStoriesStealthMode(let _data): - return ("updateStoriesStealthMode", [("stealthMode", _data.stealthMode as Any)]) + return ("updateStoriesStealthMode", [("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) case .updateStory(let _data): - return ("updateStory", [("peer", _data.peer as Any), ("story", _data.story as Any)]) + return ("updateStory", [("peer", ConstructorParameterDescription(_data.peer)), ("story", ConstructorParameterDescription(_data.story))]) case .updateStoryID(let _data): - return ("updateStoryID", [("id", _data.id as Any), ("randomId", _data.randomId as Any)]) + return ("updateStoryID", [("id", ConstructorParameterDescription(_data.id)), ("randomId", ConstructorParameterDescription(_data.randomId))]) case .updateTheme(let _data): - return ("updateTheme", [("theme", _data.theme as Any)]) + return ("updateTheme", [("theme", ConstructorParameterDescription(_data.theme))]) case .updateTranscribedAudio(let _data): - return ("updateTranscribedAudio", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("transcriptionId", _data.transcriptionId as Any), ("text", _data.text as Any)]) + 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", _data.userId as Any)]) + return ("updateUser", [("userId", ConstructorParameterDescription(_data.userId))]) case .updateUserEmojiStatus(let _data): - return ("updateUserEmojiStatus", [("userId", _data.userId as Any), ("emojiStatus", _data.emojiStatus as Any)]) + return ("updateUserEmojiStatus", [("userId", ConstructorParameterDescription(_data.userId)), ("emojiStatus", ConstructorParameterDescription(_data.emojiStatus))]) case .updateUserName(let _data): - return ("updateUserName", [("userId", _data.userId as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("usernames", _data.usernames as Any)]) + 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", _data.userId as Any), ("phone", _data.phone as Any)]) + return ("updateUserPhone", [("userId", ConstructorParameterDescription(_data.userId)), ("phone", ConstructorParameterDescription(_data.phone))]) case .updateUserStatus(let _data): - return ("updateUserStatus", [("userId", _data.userId as Any), ("status", _data.status as Any)]) + return ("updateUserStatus", [("userId", ConstructorParameterDescription(_data.userId)), ("status", ConstructorParameterDescription(_data.status))]) case .updateUserTyping(let _data): - return ("updateUserTyping", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("topMsgId", _data.topMsgId as Any), ("action", _data.action as Any)]) + 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", _data.webpage as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("updateWebPage", [("webpage", ConstructorParameterDescription(_data.webpage)), ("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) case .updateWebViewResultSent(let _data): - return ("updateWebViewResultSent", [("queryId", _data.queryId as Any)]) + return ("updateWebViewResultSent", [("queryId", ConstructorParameterDescription(_data.queryId))]) } } diff --git a/submodules/TelegramApi/Sources/Api29.swift b/submodules/TelegramApi/Sources/Api29.swift index 4aa4b68c4a..c9cb55d312 100644 --- a/submodules/TelegramApi/Sources/Api29.swift +++ b/submodules/TelegramApi/Sources/Api29.swift @@ -7,8 +7,8 @@ public extension Api { self.update = update self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateShort", [("update", self.update as Any), ("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("updateShort", [("update", ConstructorParameterDescription(self.update)), ("date", ConstructorParameterDescription(self.date))]) } } public class Cons_updateShortChatMessage: TypeConstructorDescription { @@ -40,8 +40,8 @@ public extension Api { self.entities = entities self.ttlPeriod = ttlPeriod } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateShortChatMessage", [("flags", self.flags as Any), ("id", self.id as Any), ("fromId", self.fromId as Any), ("chatId", self.chatId as Any), ("message", self.message as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("date", self.date as Any), ("fwdFrom", self.fwdFrom as Any), ("viaBotId", self.viaBotId as Any), ("replyTo", self.replyTo as Any), ("entities", self.entities as Any), ("ttlPeriod", self.ttlPeriod as Any)]) + 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))]) } } public class Cons_updateShortMessage: TypeConstructorDescription { @@ -71,8 +71,8 @@ public extension Api { self.entities = entities self.ttlPeriod = ttlPeriod } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateShortMessage", [("flags", self.flags as Any), ("id", self.id as Any), ("userId", self.userId as Any), ("message", self.message as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("date", self.date as Any), ("fwdFrom", self.fwdFrom as Any), ("viaBotId", self.viaBotId as Any), ("replyTo", self.replyTo as Any), ("entities", self.entities as Any), ("ttlPeriod", self.ttlPeriod as Any)]) + 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 { @@ -94,8 +94,8 @@ public extension Api { self.entities = entities self.ttlPeriod = ttlPeriod } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updateShortSentMessage", [("flags", self.flags as Any), ("id", self.id as Any), ("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("date", self.date as Any), ("media", self.media as Any), ("entities", self.entities as Any), ("ttlPeriod", self.ttlPeriod as Any)]) + 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 { @@ -111,8 +111,8 @@ public extension Api { self.date = date self.seq = seq } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updates", [("updates", self.updates as Any), ("users", self.users as Any), ("chats", self.chats as Any), ("date", self.date as Any), ("seq", self.seq as Any)]) + 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 { @@ -130,8 +130,8 @@ public extension Api { self.seqStart = seqStart self.seq = seq } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("updatesCombined", [("updates", self.updates as Any), ("users", self.users as Any), ("chats", self.chats as Any), ("date", self.date as Any), ("seqStart", self.seqStart as Any), ("seq", self.seq as Any)]) + 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) @@ -290,20 +290,20 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .updateShort(let _data): - return ("updateShort", [("update", _data.update as Any), ("date", _data.date as Any)]) + return ("updateShort", [("update", ConstructorParameterDescription(_data.update)), ("date", ConstructorParameterDescription(_data.date))]) case .updateShortChatMessage(let _data): - return ("updateShortChatMessage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("chatId", _data.chatId as Any), ("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any), ("fwdFrom", _data.fwdFrom as Any), ("viaBotId", _data.viaBotId as Any), ("replyTo", _data.replyTo as Any), ("entities", _data.entities as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + 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", _data.flags as Any), ("id", _data.id as Any), ("userId", _data.userId as Any), ("message", _data.message as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any), ("fwdFrom", _data.fwdFrom as Any), ("viaBotId", _data.viaBotId as Any), ("replyTo", _data.replyTo as Any), ("entities", _data.entities as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + 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", _data.flags as Any), ("id", _data.id as Any), ("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("date", _data.date as Any), ("media", _data.media as Any), ("entities", _data.entities as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + 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", _data.updates as Any), ("users", _data.users as Any), ("chats", _data.chats as Any), ("date", _data.date as Any), ("seq", _data.seq as Any)]) + 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", _data.updates as Any), ("users", _data.users as Any), ("chats", _data.chats as Any), ("date", _data.date as Any), ("seqStart", _data.seqStart as Any), ("seq", _data.seq as Any)]) + 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", []) } @@ -565,8 +565,8 @@ public extension Api { self.flags = flags self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("urlAuthResultAccepted", [("flags", self.flags as Any), ("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("urlAuthResultAccepted", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url))]) } } public class Cons_urlAuthResultRequest: TypeConstructorDescription { @@ -592,8 +592,8 @@ public extension Api { self.userIdHint = userIdHint self.verifiedAppName = verifiedAppName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("urlAuthResultRequest", [("flags", self.flags as Any), ("bot", self.bot as Any), ("domain", self.domain as Any), ("browser", self.browser as Any), ("platform", self.platform as Any), ("ip", self.ip as Any), ("region", self.region as Any), ("matchCodes", self.matchCodes as Any), ("userIdHint", self.userIdHint as Any), ("verifiedAppName", self.verifiedAppName as Any)]) + 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) @@ -652,14 +652,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .urlAuthResultAccepted(let _data): - return ("urlAuthResultAccepted", [("flags", _data.flags as Any), ("url", _data.url as Any)]) + return ("urlAuthResultAccepted", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url))]) case .urlAuthResultDefault: return ("urlAuthResultDefault", []) case .urlAuthResultRequest(let _data): - return ("urlAuthResultRequest", [("flags", _data.flags as Any), ("bot", _data.bot as Any), ("domain", _data.domain as Any), ("browser", _data.browser as Any), ("platform", _data.platform as Any), ("ip", _data.ip as Any), ("region", _data.region as Any), ("matchCodes", _data.matchCodes as Any), ("userIdHint", _data.userIdHint as Any), ("verifiedAppName", _data.verifiedAppName as Any)]) + 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))]) } } @@ -789,8 +789,8 @@ public extension Api { self.botVerificationIcon = botVerificationIcon self.sendPaidMessagesStars = sendPaidMessagesStars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("user", [("flags", self.flags as Any), ("flags2", self.flags2 as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("username", self.username as Any), ("phone", self.phone as Any), ("photo", self.photo as Any), ("status", self.status as Any), ("botInfoVersion", self.botInfoVersion as Any), ("restrictionReason", self.restrictionReason as Any), ("botInlinePlaceholder", self.botInlinePlaceholder as Any), ("langCode", self.langCode as Any), ("emojiStatus", self.emojiStatus as Any), ("usernames", self.usernames as Any), ("storiesMaxId", self.storiesMaxId as Any), ("color", self.color as Any), ("profileColor", self.profileColor as Any), ("botActiveUsers", self.botActiveUsers as Any), ("botVerificationIcon", self.botVerificationIcon as Any), ("sendPaidMessagesStars", self.sendPaidMessagesStars as Any)]) + 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 { @@ -798,8 +798,8 @@ public extension Api { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userEmpty", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userEmpty", [("id", ConstructorParameterDescription(self.id))]) } } case user(Cons_user) @@ -889,12 +889,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .user(let _data): - return ("user", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("username", _data.username as Any), ("phone", _data.phone as Any), ("photo", _data.photo as Any), ("status", _data.status as Any), ("botInfoVersion", _data.botInfoVersion as Any), ("restrictionReason", _data.restrictionReason as Any), ("botInlinePlaceholder", _data.botInlinePlaceholder as Any), ("langCode", _data.langCode as Any), ("emojiStatus", _data.emojiStatus as Any), ("usernames", _data.usernames as Any), ("storiesMaxId", _data.storiesMaxId as Any), ("color", _data.color as Any), ("profileColor", _data.profileColor as Any), ("botActiveUsers", _data.botActiveUsers as Any), ("botVerificationIcon", _data.botVerificationIcon as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any)]) + 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", _data.id as Any)]) + return ("userEmpty", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -1124,8 +1124,8 @@ public extension Api { self.note = note self.botManagerId = botManagerId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userFull", [("flags", self.flags as Any), ("flags2", self.flags2 as Any), ("id", self.id as Any), ("about", self.about as Any), ("settings", self.settings as Any), ("personalPhoto", self.personalPhoto as Any), ("profilePhoto", self.profilePhoto as Any), ("fallbackPhoto", self.fallbackPhoto as Any), ("notifySettings", self.notifySettings as Any), ("botInfo", self.botInfo as Any), ("pinnedMsgId", self.pinnedMsgId as Any), ("commonChatsCount", self.commonChatsCount as Any), ("folderId", self.folderId as Any), ("ttlPeriod", self.ttlPeriod as Any), ("theme", self.theme as Any), ("privateForwardName", self.privateForwardName as Any), ("botGroupAdminRights", self.botGroupAdminRights as Any), ("botBroadcastAdminRights", self.botBroadcastAdminRights as Any), ("wallpaper", self.wallpaper as Any), ("stories", self.stories as Any), ("businessWorkHours", self.businessWorkHours as Any), ("businessLocation", self.businessLocation as Any), ("businessGreetingMessage", self.businessGreetingMessage as Any), ("businessAwayMessage", self.businessAwayMessage as Any), ("businessIntro", self.businessIntro as Any), ("birthday", self.birthday as Any), ("personalChannelId", self.personalChannelId as Any), ("personalChannelMessage", self.personalChannelMessage as Any), ("stargiftsCount", self.stargiftsCount as Any), ("starrefProgram", self.starrefProgram as Any), ("botVerification", self.botVerification as Any), ("sendPaidMessagesStars", self.sendPaidMessagesStars as Any), ("disallowedGifts", self.disallowedGifts as Any), ("starsRating", self.starsRating as Any), ("starsMyPendingRating", self.starsMyPendingRating as Any), ("starsMyPendingRatingDate", self.starsMyPendingRatingDate as Any), ("mainTab", self.mainTab as Any), ("savedMusic", self.savedMusic as Any), ("note", self.note as Any), ("botManagerId", self.botManagerId as Any)]) + 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) @@ -1248,10 +1248,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .userFull(let _data): - return ("userFull", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("settings", _data.settings as Any), ("personalPhoto", _data.personalPhoto as Any), ("profilePhoto", _data.profilePhoto as Any), ("fallbackPhoto", _data.fallbackPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("botInfo", _data.botInfo as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("commonChatsCount", _data.commonChatsCount as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("theme", _data.theme as Any), ("privateForwardName", _data.privateForwardName as Any), ("botGroupAdminRights", _data.botGroupAdminRights as Any), ("botBroadcastAdminRights", _data.botBroadcastAdminRights as Any), ("wallpaper", _data.wallpaper as Any), ("stories", _data.stories as Any), ("businessWorkHours", _data.businessWorkHours as Any), ("businessLocation", _data.businessLocation as Any), ("businessGreetingMessage", _data.businessGreetingMessage as Any), ("businessAwayMessage", _data.businessAwayMessage as Any), ("businessIntro", _data.businessIntro as Any), ("birthday", _data.birthday as Any), ("personalChannelId", _data.personalChannelId as Any), ("personalChannelMessage", _data.personalChannelMessage as Any), ("stargiftsCount", _data.stargiftsCount as Any), ("starrefProgram", _data.starrefProgram as Any), ("botVerification", _data.botVerification as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("disallowedGifts", _data.disallowedGifts as Any), ("starsRating", _data.starsRating as Any), ("starsMyPendingRating", _data.starsMyPendingRating as Any), ("starsMyPendingRatingDate", _data.starsMyPendingRatingDate as Any), ("mainTab", _data.mainTab as Any), ("savedMusic", _data.savedMusic as Any), ("note", _data.note as Any), ("botManagerId", _data.botManagerId as Any)]) + 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))]) } } @@ -1516,8 +1516,8 @@ public extension Api { self.strippedThumb = strippedThumb self.dcId = dcId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userProfilePhoto", [("flags", self.flags as Any), ("photoId", self.photoId as Any), ("strippedThumb", self.strippedThumb as Any), ("dcId", self.dcId as Any)]) + 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) @@ -1544,10 +1544,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .userProfilePhoto(let _data): - return ("userProfilePhoto", [("flags", _data.flags as Any), ("photoId", _data.photoId as Any), ("strippedThumb", _data.strippedThumb as Any), ("dcId", _data.dcId as Any)]) + return ("userProfilePhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("strippedThumb", ConstructorParameterDescription(_data.strippedThumb)), ("dcId", ConstructorParameterDescription(_data.dcId))]) case .userProfilePhotoEmpty: return ("userProfilePhotoEmpty", []) } @@ -1587,8 +1587,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userStatusLastMonth", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusLastMonth", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_userStatusLastWeek: TypeConstructorDescription { @@ -1596,8 +1596,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userStatusLastWeek", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusLastWeek", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_userStatusOffline: TypeConstructorDescription { @@ -1605,8 +1605,8 @@ public extension Api { public init(wasOnline: Int32) { self.wasOnline = wasOnline } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userStatusOffline", [("wasOnline", self.wasOnline as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusOffline", [("wasOnline", ConstructorParameterDescription(self.wasOnline))]) } } public class Cons_userStatusOnline: TypeConstructorDescription { @@ -1614,8 +1614,8 @@ public extension Api { public init(expires: Int32) { self.expires = expires } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userStatusOnline", [("expires", self.expires as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusOnline", [("expires", ConstructorParameterDescription(self.expires))]) } } public class Cons_userStatusRecently: TypeConstructorDescription { @@ -1623,8 +1623,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userStatusRecently", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userStatusRecently", [("flags", ConstructorParameterDescription(self.flags))]) } } case userStatusEmpty @@ -1674,20 +1674,20 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .userStatusEmpty: return ("userStatusEmpty", []) case .userStatusLastMonth(let _data): - return ("userStatusLastMonth", [("flags", _data.flags as Any)]) + return ("userStatusLastMonth", [("flags", ConstructorParameterDescription(_data.flags))]) case .userStatusLastWeek(let _data): - return ("userStatusLastWeek", [("flags", _data.flags as Any)]) + return ("userStatusLastWeek", [("flags", ConstructorParameterDescription(_data.flags))]) case .userStatusOffline(let _data): - return ("userStatusOffline", [("wasOnline", _data.wasOnline as Any)]) + return ("userStatusOffline", [("wasOnline", ConstructorParameterDescription(_data.wasOnline))]) case .userStatusOnline(let _data): - return ("userStatusOnline", [("expires", _data.expires as Any)]) + return ("userStatusOnline", [("expires", ConstructorParameterDescription(_data.expires))]) case .userStatusRecently(let _data): - return ("userStatusRecently", [("flags", _data.flags as Any)]) + return ("userStatusRecently", [("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -1760,8 +1760,8 @@ public extension Api { self.flags = flags self.username = username } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("username", [("flags", self.flags as Any), ("username", self.username as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("username", [("flags", ConstructorParameterDescription(self.flags)), ("username", ConstructorParameterDescription(self.username))]) } } case username(Cons_username) @@ -1778,10 +1778,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .username(let _data): - return ("username", [("flags", _data.flags as Any), ("username", _data.username as Any)]) + return ("username", [("flags", ConstructorParameterDescription(_data.flags)), ("username", ConstructorParameterDescription(_data.username))]) } } @@ -1818,8 +1818,8 @@ public extension Api { self.size = size self.videoStartTs = videoStartTs } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("videoSize", [("flags", self.flags as Any), ("type", self.type as Any), ("w", self.w as Any), ("h", self.h as Any), ("size", self.size as Any), ("videoStartTs", self.videoStartTs as Any)]) + 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 { @@ -1829,8 +1829,8 @@ public extension Api { self.emojiId = emojiId self.backgroundColors = backgroundColors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("videoSizeEmojiMarkup", [("emojiId", self.emojiId as Any), ("backgroundColors", self.backgroundColors as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("videoSizeEmojiMarkup", [("emojiId", ConstructorParameterDescription(self.emojiId)), ("backgroundColors", ConstructorParameterDescription(self.backgroundColors))]) } } public class Cons_videoSizeStickerMarkup: TypeConstructorDescription { @@ -1842,8 +1842,8 @@ public extension Api { self.stickerId = stickerId self.backgroundColors = backgroundColors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("videoSizeStickerMarkup", [("stickerset", self.stickerset as Any), ("stickerId", self.stickerId as Any), ("backgroundColors", self.backgroundColors as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("videoSizeStickerMarkup", [("stickerset", ConstructorParameterDescription(self.stickerset)), ("stickerId", ConstructorParameterDescription(self.stickerId)), ("backgroundColors", ConstructorParameterDescription(self.backgroundColors))]) } } case videoSize(Cons_videoSize) @@ -1891,14 +1891,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .videoSize(let _data): - return ("videoSize", [("flags", _data.flags as Any), ("type", _data.type as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("size", _data.size as Any), ("videoStartTs", _data.videoStartTs as Any)]) + 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", _data.emojiId as Any), ("backgroundColors", _data.backgroundColors as Any)]) + return ("videoSizeEmojiMarkup", [("emojiId", ConstructorParameterDescription(_data.emojiId)), ("backgroundColors", ConstructorParameterDescription(_data.backgroundColors))]) case .videoSizeStickerMarkup(let _data): - return ("videoSizeStickerMarkup", [("stickerset", _data.stickerset as Any), ("stickerId", _data.stickerId as Any), ("backgroundColors", _data.backgroundColors as Any)]) + return ("videoSizeStickerMarkup", [("stickerset", ConstructorParameterDescription(_data.stickerset)), ("stickerId", ConstructorParameterDescription(_data.stickerId)), ("backgroundColors", ConstructorParameterDescription(_data.backgroundColors))]) } } @@ -1986,8 +1986,8 @@ public extension Api { self.document = document self.settings = settings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("wallPaper", [("id", self.id as Any), ("flags", self.flags as Any), ("accessHash", self.accessHash as Any), ("slug", self.slug as Any), ("document", self.document as Any), ("settings", self.settings as Any)]) + 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 { @@ -1999,8 +1999,8 @@ public extension Api { self.flags = flags self.settings = settings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("wallPaperNoFile", [("id", self.id as Any), ("flags", self.flags as Any), ("settings", self.settings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("wallPaperNoFile", [("id", ConstructorParameterDescription(self.id)), ("flags", ConstructorParameterDescription(self.flags)), ("settings", ConstructorParameterDescription(self.settings))]) } } case wallPaper(Cons_wallPaper) @@ -2034,12 +2034,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .wallPaper(let _data): - return ("wallPaper", [("id", _data.id as Any), ("flags", _data.flags as Any), ("accessHash", _data.accessHash as Any), ("slug", _data.slug as Any), ("document", _data.document as Any), ("settings", _data.settings as Any)]) + 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", _data.id as Any), ("flags", _data.flags as Any), ("settings", _data.settings as Any)]) + return ("wallPaperNoFile", [("id", ConstructorParameterDescription(_data.id)), ("flags", ConstructorParameterDescription(_data.flags)), ("settings", ConstructorParameterDescription(_data.settings))]) } } @@ -2119,8 +2119,8 @@ public extension Api { self.rotation = rotation self.emoticon = emoticon } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("wallPaperSettings", [("flags", self.flags as Any), ("backgroundColor", self.backgroundColor as Any), ("secondBackgroundColor", self.secondBackgroundColor as Any), ("thirdBackgroundColor", self.thirdBackgroundColor as Any), ("fourthBackgroundColor", self.fourthBackgroundColor as Any), ("intensity", self.intensity as Any), ("rotation", self.rotation as Any), ("emoticon", self.emoticon as Any)]) + 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) @@ -2157,10 +2157,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .wallPaperSettings(let _data): - return ("wallPaperSettings", [("flags", _data.flags as Any), ("backgroundColor", _data.backgroundColor as Any), ("secondBackgroundColor", _data.secondBackgroundColor as Any), ("thirdBackgroundColor", _data.thirdBackgroundColor as Any), ("fourthBackgroundColor", _data.fourthBackgroundColor as Any), ("intensity", _data.intensity as Any), ("rotation", _data.rotation as Any), ("emoticon", _data.emoticon as Any)]) + 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))]) } } @@ -2235,8 +2235,8 @@ public extension Api { self.ip = ip self.region = region } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webAuthorization", [("hash", self.hash as Any), ("botId", self.botId as Any), ("domain", self.domain as Any), ("browser", self.browser as Any), ("platform", self.platform as Any), ("dateCreated", self.dateCreated as Any), ("dateActive", self.dateActive as Any), ("ip", self.ip as Any), ("region", self.region as Any)]) + 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) @@ -2260,10 +2260,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webAuthorization(let _data): - return ("webAuthorization", [("hash", _data.hash as Any), ("botId", _data.botId as Any), ("domain", _data.domain as Any), ("browser", _data.browser as Any), ("platform", _data.platform as Any), ("dateCreated", _data.dateCreated as Any), ("dateActive", _data.dateActive as Any), ("ip", _data.ip as Any), ("region", _data.region as Any)]) + 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))]) } } @@ -2319,8 +2319,8 @@ public extension Api { self.mimeType = mimeType self.attributes = attributes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webDocument", [("url", self.url as Any), ("accessHash", self.accessHash as Any), ("size", self.size as Any), ("mimeType", self.mimeType as Any), ("attributes", self.attributes as Any)]) + 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 { @@ -2334,8 +2334,8 @@ public extension Api { self.mimeType = mimeType self.attributes = attributes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webDocumentNoProxy", [("url", self.url as Any), ("size", self.size as Any), ("mimeType", self.mimeType as Any), ("attributes", self.attributes as Any)]) + 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) @@ -2373,12 +2373,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webDocument(let _data): - return ("webDocument", [("url", _data.url as Any), ("accessHash", _data.accessHash as Any), ("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any)]) + 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", _data.url as Any), ("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("attributes", _data.attributes as Any)]) + return ("webDocumentNoProxy", [("url", ConstructorParameterDescription(_data.url)), ("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("attributes", ConstructorParameterDescription(_data.attributes))]) } } @@ -2474,8 +2474,8 @@ public extension Api { self.cachedPage = cachedPage self.attributes = attributes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPage", [("flags", self.flags as Any), ("id", self.id as Any), ("url", self.url as Any), ("displayUrl", self.displayUrl as Any), ("hash", self.hash as Any), ("type", self.type as Any), ("siteName", self.siteName as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("embedUrl", self.embedUrl as Any), ("embedType", self.embedType as Any), ("embedWidth", self.embedWidth as Any), ("embedHeight", self.embedHeight as Any), ("duration", self.duration as Any), ("author", self.author as Any), ("document", self.document as Any), ("cachedPage", self.cachedPage as Any), ("attributes", self.attributes as Any)]) + 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 { @@ -2487,8 +2487,8 @@ public extension Api { self.id = id self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageEmpty", [("flags", self.flags as Any), ("id", self.id as Any), ("url", self.url as Any)]) + 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 { @@ -2498,8 +2498,8 @@ public extension Api { self.flags = flags self.cachedPageViews = cachedPageViews } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageNotModified", [("flags", self.flags as Any), ("cachedPageViews", self.cachedPageViews as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("cachedPageViews", ConstructorParameterDescription(self.cachedPageViews))]) } } public class Cons_webPagePending: TypeConstructorDescription { @@ -2513,8 +2513,8 @@ public extension Api { self.url = url self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPagePending", [("flags", self.flags as Any), ("id", self.id as Any), ("url", self.url as Any), ("date", self.date as Any)]) + 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) @@ -2613,16 +2613,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webPage(let _data): - return ("webPage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("url", _data.url as Any), ("displayUrl", _data.displayUrl as Any), ("hash", _data.hash as Any), ("type", _data.type as Any), ("siteName", _data.siteName as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("embedUrl", _data.embedUrl as Any), ("embedType", _data.embedType as Any), ("embedWidth", _data.embedWidth as Any), ("embedHeight", _data.embedHeight as Any), ("duration", _data.duration as Any), ("author", _data.author as Any), ("document", _data.document as Any), ("cachedPage", _data.cachedPage as Any), ("attributes", _data.attributes as Any)]) + 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", _data.flags as Any), ("id", _data.id as Any), ("url", _data.url as Any)]) + return ("webPageEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url))]) case .webPageNotModified(let _data): - return ("webPageNotModified", [("flags", _data.flags as Any), ("cachedPageViews", _data.cachedPageViews as Any)]) + return ("webPageNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("cachedPageViews", ConstructorParameterDescription(_data.cachedPageViews))]) case .webPagePending(let _data): - return ("webPagePending", [("flags", _data.flags as Any), ("id", _data.id as Any), ("url", _data.url as Any), ("date", _data.date as Any)]) + return ("webPagePending", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("url", ConstructorParameterDescription(_data.url)), ("date", ConstructorParameterDescription(_data.date))]) } } diff --git a/submodules/TelegramApi/Sources/Api3.swift b/submodules/TelegramApi/Sources/Api3.swift index abc84a4d70..36621d885d 100644 --- a/submodules/TelegramApi/Sources/Api3.swift +++ b/submodules/TelegramApi/Sources/Api3.swift @@ -9,8 +9,8 @@ public extension Api { self.recipients = recipients self.noActivityDays = noActivityDays } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessGreetingMessage", [("shortcutId", self.shortcutId as Any), ("recipients", self.recipients as Any), ("noActivityDays", self.noActivityDays as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessGreetingMessage", [("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("recipients", ConstructorParameterDescription(self.recipients)), ("noActivityDays", ConstructorParameterDescription(self.noActivityDays))]) } } case businessGreetingMessage(Cons_businessGreetingMessage) @@ -28,10 +28,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessGreetingMessage(let _data): - return ("businessGreetingMessage", [("shortcutId", _data.shortcutId as Any), ("recipients", _data.recipients as Any), ("noActivityDays", _data.noActivityDays as Any)]) + return ("businessGreetingMessage", [("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("recipients", ConstructorParameterDescription(_data.recipients)), ("noActivityDays", ConstructorParameterDescription(_data.noActivityDays))]) } } @@ -69,8 +69,8 @@ public extension Api { self.description = description self.sticker = sticker } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessIntro", [("flags", self.flags as Any), ("title", self.title as Any), ("description", self.description as Any), ("sticker", self.sticker as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessIntro", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("sticker", ConstructorParameterDescription(self.sticker))]) } } case businessIntro(Cons_businessIntro) @@ -91,10 +91,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessIntro(let _data): - return ("businessIntro", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("sticker", _data.sticker as Any)]) + return ("businessIntro", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("sticker", ConstructorParameterDescription(_data.sticker))]) } } @@ -135,8 +135,8 @@ public extension Api { self.geoPoint = geoPoint self.address = address } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessLocation", [("flags", self.flags as Any), ("geoPoint", self.geoPoint as Any), ("address", self.address as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessLocation", [("flags", ConstructorParameterDescription(self.flags)), ("geoPoint", ConstructorParameterDescription(self.geoPoint)), ("address", ConstructorParameterDescription(self.address))]) } } case businessLocation(Cons_businessLocation) @@ -156,10 +156,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessLocation(let _data): - return ("businessLocation", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("address", _data.address as Any)]) + return ("businessLocation", [("flags", ConstructorParameterDescription(_data.flags)), ("geoPoint", ConstructorParameterDescription(_data.geoPoint)), ("address", ConstructorParameterDescription(_data.address))]) } } @@ -195,8 +195,8 @@ public extension Api { self.flags = flags self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessRecipients", [("flags", self.flags as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessRecipients", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users))]) } } case businessRecipients(Cons_businessRecipients) @@ -219,10 +219,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessRecipients(let _data): - return ("businessRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any)]) + return ("businessRecipients", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -255,8 +255,8 @@ public extension Api { self.startMinute = startMinute self.endMinute = endMinute } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessWeeklyOpen", [("startMinute", self.startMinute as Any), ("endMinute", self.endMinute as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessWeeklyOpen", [("startMinute", ConstructorParameterDescription(self.startMinute)), ("endMinute", ConstructorParameterDescription(self.endMinute))]) } } case businessWeeklyOpen(Cons_businessWeeklyOpen) @@ -273,10 +273,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessWeeklyOpen(let _data): - return ("businessWeeklyOpen", [("startMinute", _data.startMinute as Any), ("endMinute", _data.endMinute as Any)]) + return ("businessWeeklyOpen", [("startMinute", ConstructorParameterDescription(_data.startMinute)), ("endMinute", ConstructorParameterDescription(_data.endMinute))]) } } @@ -307,8 +307,8 @@ public extension Api { self.timezoneId = timezoneId self.weeklyOpen = weeklyOpen } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessWorkHours", [("flags", self.flags as Any), ("timezoneId", self.timezoneId as Any), ("weeklyOpen", self.weeklyOpen as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessWorkHours", [("flags", ConstructorParameterDescription(self.flags)), ("timezoneId", ConstructorParameterDescription(self.timezoneId)), ("weeklyOpen", ConstructorParameterDescription(self.weeklyOpen))]) } } case businessWorkHours(Cons_businessWorkHours) @@ -330,10 +330,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessWorkHours(let _data): - return ("businessWorkHours", [("flags", _data.flags as Any), ("timezoneId", _data.timezoneId as Any), ("weeklyOpen", _data.weeklyOpen as Any)]) + return ("businessWorkHours", [("flags", ConstructorParameterDescription(_data.flags)), ("timezoneId", ConstructorParameterDescription(_data.timezoneId)), ("weeklyOpen", ConstructorParameterDescription(_data.weeklyOpen))]) } } @@ -365,8 +365,8 @@ public extension Api { public init(publicKeys: [Api.CdnPublicKey]) { self.publicKeys = publicKeys } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("cdnConfig", [("publicKeys", self.publicKeys as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("cdnConfig", [("publicKeys", ConstructorParameterDescription(self.publicKeys))]) } } case cdnConfig(Cons_cdnConfig) @@ -386,10 +386,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .cdnConfig(let _data): - return ("cdnConfig", [("publicKeys", _data.publicKeys as Any)]) + return ("cdnConfig", [("publicKeys", ConstructorParameterDescription(_data.publicKeys))]) } } @@ -417,8 +417,8 @@ public extension Api { self.dcId = dcId self.publicKey = publicKey } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("cdnPublicKey", [("dcId", self.dcId as Any), ("publicKey", self.publicKey as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("cdnPublicKey", [("dcId", ConstructorParameterDescription(self.dcId)), ("publicKey", ConstructorParameterDescription(self.publicKey))]) } } case cdnPublicKey(Cons_cdnPublicKey) @@ -435,10 +435,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .cdnPublicKey(let _data): - return ("cdnPublicKey", [("dcId", _data.dcId as Any), ("publicKey", _data.publicKey as Any)]) + return ("cdnPublicKey", [("dcId", ConstructorParameterDescription(_data.dcId)), ("publicKey", ConstructorParameterDescription(_data.publicKey))]) } } @@ -471,8 +471,8 @@ public extension Api { self.userId = userId self.action = action } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEvent", [("id", self.id as Any), ("date", self.date as Any), ("userId", self.userId as Any), ("action", self.action as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEvent", [("id", ConstructorParameterDescription(self.id)), ("date", ConstructorParameterDescription(self.date)), ("userId", ConstructorParameterDescription(self.userId)), ("action", ConstructorParameterDescription(self.action))]) } } case channelAdminLogEvent(Cons_channelAdminLogEvent) @@ -491,10 +491,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelAdminLogEvent(let _data): - return ("channelAdminLogEvent", [("id", _data.id as Any), ("date", _data.date as Any), ("userId", _data.userId as Any), ("action", _data.action as Any)]) + return ("channelAdminLogEvent", [("id", ConstructorParameterDescription(_data.id)), ("date", ConstructorParameterDescription(_data.date)), ("userId", ConstructorParameterDescription(_data.userId)), ("action", ConstructorParameterDescription(_data.action))]) } } @@ -531,8 +531,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeAbout", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeAbout", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeAvailableReactions: TypeConstructorDescription { @@ -542,8 +542,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeAvailableReactions", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeAvailableReactions", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeEmojiStatus: TypeConstructorDescription { @@ -553,8 +553,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeEmojiStatus", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeEmojiStatus", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeEmojiStickerSet: TypeConstructorDescription { @@ -564,8 +564,8 @@ public extension Api { self.prevStickerset = prevStickerset self.newStickerset = newStickerset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeEmojiStickerSet", [("prevStickerset", self.prevStickerset as Any), ("newStickerset", self.newStickerset as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeEmojiStickerSet", [("prevStickerset", ConstructorParameterDescription(self.prevStickerset)), ("newStickerset", ConstructorParameterDescription(self.newStickerset))]) } } public class Cons_channelAdminLogEventActionChangeHistoryTTL: TypeConstructorDescription { @@ -575,8 +575,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeHistoryTTL", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeHistoryTTL", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeLinkedChat: TypeConstructorDescription { @@ -586,8 +586,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeLinkedChat", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeLinkedChat", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeLocation: TypeConstructorDescription { @@ -597,8 +597,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeLocation", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeLocation", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangePeerColor: TypeConstructorDescription { @@ -608,8 +608,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangePeerColor", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangePeerColor", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangePhoto: TypeConstructorDescription { @@ -619,8 +619,8 @@ public extension Api { self.prevPhoto = prevPhoto self.newPhoto = newPhoto } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangePhoto", [("prevPhoto", self.prevPhoto as Any), ("newPhoto", self.newPhoto as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangePhoto", [("prevPhoto", ConstructorParameterDescription(self.prevPhoto)), ("newPhoto", ConstructorParameterDescription(self.newPhoto))]) } } public class Cons_channelAdminLogEventActionChangeProfilePeerColor: TypeConstructorDescription { @@ -630,8 +630,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeProfilePeerColor", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeProfilePeerColor", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeStickerSet: TypeConstructorDescription { @@ -641,8 +641,8 @@ public extension Api { self.prevStickerset = prevStickerset self.newStickerset = newStickerset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeStickerSet", [("prevStickerset", self.prevStickerset as Any), ("newStickerset", self.newStickerset as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeStickerSet", [("prevStickerset", ConstructorParameterDescription(self.prevStickerset)), ("newStickerset", ConstructorParameterDescription(self.newStickerset))]) } } public class Cons_channelAdminLogEventActionChangeTitle: TypeConstructorDescription { @@ -652,8 +652,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeTitle", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeTitle", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeUsername: TypeConstructorDescription { @@ -663,8 +663,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeUsername", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeUsername", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeUsernames: TypeConstructorDescription { @@ -674,8 +674,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeUsernames", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeUsernames", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionChangeWallpaper: TypeConstructorDescription { @@ -685,8 +685,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionChangeWallpaper", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionChangeWallpaper", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionCreateTopic: TypeConstructorDescription { @@ -694,8 +694,8 @@ public extension Api { public init(topic: Api.ForumTopic) { self.topic = topic } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionCreateTopic", [("topic", self.topic as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionCreateTopic", [("topic", ConstructorParameterDescription(self.topic))]) } } public class Cons_channelAdminLogEventActionDefaultBannedRights: TypeConstructorDescription { @@ -705,8 +705,8 @@ public extension Api { self.prevBannedRights = prevBannedRights self.newBannedRights = newBannedRights } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionDefaultBannedRights", [("prevBannedRights", self.prevBannedRights as Any), ("newBannedRights", self.newBannedRights as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionDefaultBannedRights", [("prevBannedRights", ConstructorParameterDescription(self.prevBannedRights)), ("newBannedRights", ConstructorParameterDescription(self.newBannedRights))]) } } public class Cons_channelAdminLogEventActionDeleteMessage: TypeConstructorDescription { @@ -714,8 +714,8 @@ public extension Api { public init(message: Api.Message) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionDeleteMessage", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionDeleteMessage", [("message", ConstructorParameterDescription(self.message))]) } } public class Cons_channelAdminLogEventActionDeleteTopic: TypeConstructorDescription { @@ -723,8 +723,8 @@ public extension Api { public init(topic: Api.ForumTopic) { self.topic = topic } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionDeleteTopic", [("topic", self.topic as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionDeleteTopic", [("topic", ConstructorParameterDescription(self.topic))]) } } public class Cons_channelAdminLogEventActionDiscardGroupCall: TypeConstructorDescription { @@ -732,8 +732,8 @@ public extension Api { public init(call: Api.InputGroupCall) { self.call = call } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionDiscardGroupCall", [("call", self.call as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionDiscardGroupCall", [("call", ConstructorParameterDescription(self.call))]) } } public class Cons_channelAdminLogEventActionEditMessage: TypeConstructorDescription { @@ -743,8 +743,8 @@ public extension Api { self.prevMessage = prevMessage self.newMessage = newMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionEditMessage", [("prevMessage", self.prevMessage as Any), ("newMessage", self.newMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionEditMessage", [("prevMessage", ConstructorParameterDescription(self.prevMessage)), ("newMessage", ConstructorParameterDescription(self.newMessage))]) } } public class Cons_channelAdminLogEventActionEditTopic: TypeConstructorDescription { @@ -754,8 +754,8 @@ public extension Api { self.prevTopic = prevTopic self.newTopic = newTopic } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionEditTopic", [("prevTopic", self.prevTopic as Any), ("newTopic", self.newTopic as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionEditTopic", [("prevTopic", ConstructorParameterDescription(self.prevTopic)), ("newTopic", ConstructorParameterDescription(self.newTopic))]) } } public class Cons_channelAdminLogEventActionExportedInviteDelete: TypeConstructorDescription { @@ -763,8 +763,8 @@ public extension Api { public init(invite: Api.ExportedChatInvite) { self.invite = invite } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionExportedInviteDelete", [("invite", self.invite as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionExportedInviteDelete", [("invite", ConstructorParameterDescription(self.invite))]) } } public class Cons_channelAdminLogEventActionExportedInviteEdit: TypeConstructorDescription { @@ -774,8 +774,8 @@ public extension Api { self.prevInvite = prevInvite self.newInvite = newInvite } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionExportedInviteEdit", [("prevInvite", self.prevInvite as Any), ("newInvite", self.newInvite as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionExportedInviteEdit", [("prevInvite", ConstructorParameterDescription(self.prevInvite)), ("newInvite", ConstructorParameterDescription(self.newInvite))]) } } public class Cons_channelAdminLogEventActionExportedInviteRevoke: TypeConstructorDescription { @@ -783,8 +783,8 @@ public extension Api { public init(invite: Api.ExportedChatInvite) { self.invite = invite } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionExportedInviteRevoke", [("invite", self.invite as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionExportedInviteRevoke", [("invite", ConstructorParameterDescription(self.invite))]) } } public class Cons_channelAdminLogEventActionParticipantEditRank: TypeConstructorDescription { @@ -796,8 +796,8 @@ public extension Api { self.prevRank = prevRank self.newRank = newRank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantEditRank", [("userId", self.userId as Any), ("prevRank", self.prevRank as Any), ("newRank", self.newRank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantEditRank", [("userId", ConstructorParameterDescription(self.userId)), ("prevRank", ConstructorParameterDescription(self.prevRank)), ("newRank", ConstructorParameterDescription(self.newRank))]) } } public class Cons_channelAdminLogEventActionParticipantInvite: TypeConstructorDescription { @@ -805,8 +805,8 @@ public extension Api { public init(participant: Api.ChannelParticipant) { self.participant = participant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantInvite", [("participant", self.participant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantInvite", [("participant", ConstructorParameterDescription(self.participant))]) } } public class Cons_channelAdminLogEventActionParticipantJoinByInvite: TypeConstructorDescription { @@ -816,8 +816,8 @@ public extension Api { self.flags = flags self.invite = invite } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantJoinByInvite", [("flags", self.flags as Any), ("invite", self.invite as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantJoinByInvite", [("flags", ConstructorParameterDescription(self.flags)), ("invite", ConstructorParameterDescription(self.invite))]) } } public class Cons_channelAdminLogEventActionParticipantJoinByRequest: TypeConstructorDescription { @@ -827,8 +827,8 @@ public extension Api { self.invite = invite self.approvedBy = approvedBy } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantJoinByRequest", [("invite", self.invite as Any), ("approvedBy", self.approvedBy as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantJoinByRequest", [("invite", ConstructorParameterDescription(self.invite)), ("approvedBy", ConstructorParameterDescription(self.approvedBy))]) } } public class Cons_channelAdminLogEventActionParticipantMute: TypeConstructorDescription { @@ -836,8 +836,8 @@ public extension Api { public init(participant: Api.GroupCallParticipant) { self.participant = participant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantMute", [("participant", self.participant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantMute", [("participant", ConstructorParameterDescription(self.participant))]) } } public class Cons_channelAdminLogEventActionParticipantSubExtend: TypeConstructorDescription { @@ -847,8 +847,8 @@ public extension Api { self.prevParticipant = prevParticipant self.newParticipant = newParticipant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantSubExtend", [("prevParticipant", self.prevParticipant as Any), ("newParticipant", self.newParticipant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantSubExtend", [("prevParticipant", ConstructorParameterDescription(self.prevParticipant)), ("newParticipant", ConstructorParameterDescription(self.newParticipant))]) } } public class Cons_channelAdminLogEventActionParticipantToggleAdmin: TypeConstructorDescription { @@ -858,8 +858,8 @@ public extension Api { self.prevParticipant = prevParticipant self.newParticipant = newParticipant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantToggleAdmin", [("prevParticipant", self.prevParticipant as Any), ("newParticipant", self.newParticipant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantToggleAdmin", [("prevParticipant", ConstructorParameterDescription(self.prevParticipant)), ("newParticipant", ConstructorParameterDescription(self.newParticipant))]) } } public class Cons_channelAdminLogEventActionParticipantToggleBan: TypeConstructorDescription { @@ -869,8 +869,8 @@ public extension Api { self.prevParticipant = prevParticipant self.newParticipant = newParticipant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantToggleBan", [("prevParticipant", self.prevParticipant as Any), ("newParticipant", self.newParticipant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantToggleBan", [("prevParticipant", ConstructorParameterDescription(self.prevParticipant)), ("newParticipant", ConstructorParameterDescription(self.newParticipant))]) } } public class Cons_channelAdminLogEventActionParticipantUnmute: TypeConstructorDescription { @@ -878,8 +878,8 @@ public extension Api { public init(participant: Api.GroupCallParticipant) { self.participant = participant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantUnmute", [("participant", self.participant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantUnmute", [("participant", ConstructorParameterDescription(self.participant))]) } } public class Cons_channelAdminLogEventActionParticipantVolume: TypeConstructorDescription { @@ -887,8 +887,8 @@ public extension Api { public init(participant: Api.GroupCallParticipant) { self.participant = participant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionParticipantVolume", [("participant", self.participant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionParticipantVolume", [("participant", ConstructorParameterDescription(self.participant))]) } } public class Cons_channelAdminLogEventActionPinTopic: TypeConstructorDescription { @@ -900,8 +900,8 @@ public extension Api { self.prevTopic = prevTopic self.newTopic = newTopic } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionPinTopic", [("flags", self.flags as Any), ("prevTopic", self.prevTopic as Any), ("newTopic", self.newTopic as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionPinTopic", [("flags", ConstructorParameterDescription(self.flags)), ("prevTopic", ConstructorParameterDescription(self.prevTopic)), ("newTopic", ConstructorParameterDescription(self.newTopic))]) } } public class Cons_channelAdminLogEventActionSendMessage: TypeConstructorDescription { @@ -909,8 +909,8 @@ public extension Api { public init(message: Api.Message) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionSendMessage", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionSendMessage", [("message", ConstructorParameterDescription(self.message))]) } } public class Cons_channelAdminLogEventActionStartGroupCall: TypeConstructorDescription { @@ -918,8 +918,8 @@ public extension Api { public init(call: Api.InputGroupCall) { self.call = call } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionStartGroupCall", [("call", self.call as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionStartGroupCall", [("call", ConstructorParameterDescription(self.call))]) } } public class Cons_channelAdminLogEventActionStopPoll: TypeConstructorDescription { @@ -927,8 +927,8 @@ public extension Api { public init(message: Api.Message) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionStopPoll", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionStopPoll", [("message", ConstructorParameterDescription(self.message))]) } } public class Cons_channelAdminLogEventActionToggleAntiSpam: TypeConstructorDescription { @@ -936,8 +936,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleAntiSpam", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleAntiSpam", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionToggleAutotranslation: TypeConstructorDescription { @@ -945,8 +945,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleAutotranslation", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleAutotranslation", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionToggleForum: TypeConstructorDescription { @@ -954,8 +954,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleForum", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleForum", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionToggleGroupCallSetting: TypeConstructorDescription { @@ -963,8 +963,8 @@ public extension Api { public init(joinMuted: Api.Bool) { self.joinMuted = joinMuted } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleGroupCallSetting", [("joinMuted", self.joinMuted as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleGroupCallSetting", [("joinMuted", ConstructorParameterDescription(self.joinMuted))]) } } public class Cons_channelAdminLogEventActionToggleInvites: TypeConstructorDescription { @@ -972,8 +972,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleInvites", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleInvites", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionToggleNoForwards: TypeConstructorDescription { @@ -981,8 +981,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleNoForwards", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleNoForwards", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionTogglePreHistoryHidden: TypeConstructorDescription { @@ -990,8 +990,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionTogglePreHistoryHidden", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionTogglePreHistoryHidden", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionToggleSignatureProfiles: TypeConstructorDescription { @@ -999,8 +999,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleSignatureProfiles", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleSignatureProfiles", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionToggleSignatures: TypeConstructorDescription { @@ -1008,8 +1008,8 @@ public extension Api { public init(newValue: Api.Bool) { self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleSignatures", [("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleSignatures", [("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionToggleSlowMode: TypeConstructorDescription { @@ -1019,8 +1019,8 @@ public extension Api { self.prevValue = prevValue self.newValue = newValue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionToggleSlowMode", [("prevValue", self.prevValue as Any), ("newValue", self.newValue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionToggleSlowMode", [("prevValue", ConstructorParameterDescription(self.prevValue)), ("newValue", ConstructorParameterDescription(self.newValue))]) } } public class Cons_channelAdminLogEventActionUpdatePinned: TypeConstructorDescription { @@ -1028,8 +1028,8 @@ public extension Api { public init(message: Api.Message) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventActionUpdatePinned", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventActionUpdatePinned", [("message", ConstructorParameterDescription(self.message))]) } } case channelAdminLogEventActionChangeAbout(Cons_channelAdminLogEventActionChangeAbout) @@ -1441,112 +1441,112 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelAdminLogEventActionChangeAbout(let _data): - return ("channelAdminLogEventActionChangeAbout", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeAbout", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeAvailableReactions(let _data): - return ("channelAdminLogEventActionChangeAvailableReactions", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeAvailableReactions", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeEmojiStatus(let _data): - return ("channelAdminLogEventActionChangeEmojiStatus", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeEmojiStatus", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeEmojiStickerSet(let _data): - return ("channelAdminLogEventActionChangeEmojiStickerSet", [("prevStickerset", _data.prevStickerset as Any), ("newStickerset", _data.newStickerset as Any)]) + return ("channelAdminLogEventActionChangeEmojiStickerSet", [("prevStickerset", ConstructorParameterDescription(_data.prevStickerset)), ("newStickerset", ConstructorParameterDescription(_data.newStickerset))]) case .channelAdminLogEventActionChangeHistoryTTL(let _data): - return ("channelAdminLogEventActionChangeHistoryTTL", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeHistoryTTL", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeLinkedChat(let _data): - return ("channelAdminLogEventActionChangeLinkedChat", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeLinkedChat", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeLocation(let _data): - return ("channelAdminLogEventActionChangeLocation", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeLocation", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangePeerColor(let _data): - return ("channelAdminLogEventActionChangePeerColor", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangePeerColor", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangePhoto(let _data): - return ("channelAdminLogEventActionChangePhoto", [("prevPhoto", _data.prevPhoto as Any), ("newPhoto", _data.newPhoto as Any)]) + return ("channelAdminLogEventActionChangePhoto", [("prevPhoto", ConstructorParameterDescription(_data.prevPhoto)), ("newPhoto", ConstructorParameterDescription(_data.newPhoto))]) case .channelAdminLogEventActionChangeProfilePeerColor(let _data): - return ("channelAdminLogEventActionChangeProfilePeerColor", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeProfilePeerColor", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeStickerSet(let _data): - return ("channelAdminLogEventActionChangeStickerSet", [("prevStickerset", _data.prevStickerset as Any), ("newStickerset", _data.newStickerset as Any)]) + return ("channelAdminLogEventActionChangeStickerSet", [("prevStickerset", ConstructorParameterDescription(_data.prevStickerset)), ("newStickerset", ConstructorParameterDescription(_data.newStickerset))]) case .channelAdminLogEventActionChangeTitle(let _data): - return ("channelAdminLogEventActionChangeTitle", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeTitle", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeUsername(let _data): - return ("channelAdminLogEventActionChangeUsername", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeUsername", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeUsernames(let _data): - return ("channelAdminLogEventActionChangeUsernames", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeUsernames", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionChangeWallpaper(let _data): - return ("channelAdminLogEventActionChangeWallpaper", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionChangeWallpaper", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionCreateTopic(let _data): - return ("channelAdminLogEventActionCreateTopic", [("topic", _data.topic as Any)]) + return ("channelAdminLogEventActionCreateTopic", [("topic", ConstructorParameterDescription(_data.topic))]) case .channelAdminLogEventActionDefaultBannedRights(let _data): - return ("channelAdminLogEventActionDefaultBannedRights", [("prevBannedRights", _data.prevBannedRights as Any), ("newBannedRights", _data.newBannedRights as Any)]) + return ("channelAdminLogEventActionDefaultBannedRights", [("prevBannedRights", ConstructorParameterDescription(_data.prevBannedRights)), ("newBannedRights", ConstructorParameterDescription(_data.newBannedRights))]) case .channelAdminLogEventActionDeleteMessage(let _data): - return ("channelAdminLogEventActionDeleteMessage", [("message", _data.message as Any)]) + return ("channelAdminLogEventActionDeleteMessage", [("message", ConstructorParameterDescription(_data.message))]) case .channelAdminLogEventActionDeleteTopic(let _data): - return ("channelAdminLogEventActionDeleteTopic", [("topic", _data.topic as Any)]) + return ("channelAdminLogEventActionDeleteTopic", [("topic", ConstructorParameterDescription(_data.topic))]) case .channelAdminLogEventActionDiscardGroupCall(let _data): - return ("channelAdminLogEventActionDiscardGroupCall", [("call", _data.call as Any)]) + return ("channelAdminLogEventActionDiscardGroupCall", [("call", ConstructorParameterDescription(_data.call))]) case .channelAdminLogEventActionEditMessage(let _data): - return ("channelAdminLogEventActionEditMessage", [("prevMessage", _data.prevMessage as Any), ("newMessage", _data.newMessage as Any)]) + return ("channelAdminLogEventActionEditMessage", [("prevMessage", ConstructorParameterDescription(_data.prevMessage)), ("newMessage", ConstructorParameterDescription(_data.newMessage))]) case .channelAdminLogEventActionEditTopic(let _data): - return ("channelAdminLogEventActionEditTopic", [("prevTopic", _data.prevTopic as Any), ("newTopic", _data.newTopic as Any)]) + return ("channelAdminLogEventActionEditTopic", [("prevTopic", ConstructorParameterDescription(_data.prevTopic)), ("newTopic", ConstructorParameterDescription(_data.newTopic))]) case .channelAdminLogEventActionExportedInviteDelete(let _data): - return ("channelAdminLogEventActionExportedInviteDelete", [("invite", _data.invite as Any)]) + return ("channelAdminLogEventActionExportedInviteDelete", [("invite", ConstructorParameterDescription(_data.invite))]) case .channelAdminLogEventActionExportedInviteEdit(let _data): - return ("channelAdminLogEventActionExportedInviteEdit", [("prevInvite", _data.prevInvite as Any), ("newInvite", _data.newInvite as Any)]) + return ("channelAdminLogEventActionExportedInviteEdit", [("prevInvite", ConstructorParameterDescription(_data.prevInvite)), ("newInvite", ConstructorParameterDescription(_data.newInvite))]) case .channelAdminLogEventActionExportedInviteRevoke(let _data): - return ("channelAdminLogEventActionExportedInviteRevoke", [("invite", _data.invite as Any)]) + return ("channelAdminLogEventActionExportedInviteRevoke", [("invite", ConstructorParameterDescription(_data.invite))]) case .channelAdminLogEventActionParticipantEditRank(let _data): - return ("channelAdminLogEventActionParticipantEditRank", [("userId", _data.userId as Any), ("prevRank", _data.prevRank as Any), ("newRank", _data.newRank as Any)]) + return ("channelAdminLogEventActionParticipantEditRank", [("userId", ConstructorParameterDescription(_data.userId)), ("prevRank", ConstructorParameterDescription(_data.prevRank)), ("newRank", ConstructorParameterDescription(_data.newRank))]) case .channelAdminLogEventActionParticipantInvite(let _data): - return ("channelAdminLogEventActionParticipantInvite", [("participant", _data.participant as Any)]) + return ("channelAdminLogEventActionParticipantInvite", [("participant", ConstructorParameterDescription(_data.participant))]) case .channelAdminLogEventActionParticipantJoin: return ("channelAdminLogEventActionParticipantJoin", []) case .channelAdminLogEventActionParticipantJoinByInvite(let _data): - return ("channelAdminLogEventActionParticipantJoinByInvite", [("flags", _data.flags as Any), ("invite", _data.invite as Any)]) + return ("channelAdminLogEventActionParticipantJoinByInvite", [("flags", ConstructorParameterDescription(_data.flags)), ("invite", ConstructorParameterDescription(_data.invite))]) case .channelAdminLogEventActionParticipantJoinByRequest(let _data): - return ("channelAdminLogEventActionParticipantJoinByRequest", [("invite", _data.invite as Any), ("approvedBy", _data.approvedBy as Any)]) + return ("channelAdminLogEventActionParticipantJoinByRequest", [("invite", ConstructorParameterDescription(_data.invite)), ("approvedBy", ConstructorParameterDescription(_data.approvedBy))]) case .channelAdminLogEventActionParticipantLeave: return ("channelAdminLogEventActionParticipantLeave", []) case .channelAdminLogEventActionParticipantMute(let _data): - return ("channelAdminLogEventActionParticipantMute", [("participant", _data.participant as Any)]) + return ("channelAdminLogEventActionParticipantMute", [("participant", ConstructorParameterDescription(_data.participant))]) case .channelAdminLogEventActionParticipantSubExtend(let _data): - return ("channelAdminLogEventActionParticipantSubExtend", [("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any)]) + return ("channelAdminLogEventActionParticipantSubExtend", [("prevParticipant", ConstructorParameterDescription(_data.prevParticipant)), ("newParticipant", ConstructorParameterDescription(_data.newParticipant))]) case .channelAdminLogEventActionParticipantToggleAdmin(let _data): - return ("channelAdminLogEventActionParticipantToggleAdmin", [("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any)]) + return ("channelAdminLogEventActionParticipantToggleAdmin", [("prevParticipant", ConstructorParameterDescription(_data.prevParticipant)), ("newParticipant", ConstructorParameterDescription(_data.newParticipant))]) case .channelAdminLogEventActionParticipantToggleBan(let _data): - return ("channelAdminLogEventActionParticipantToggleBan", [("prevParticipant", _data.prevParticipant as Any), ("newParticipant", _data.newParticipant as Any)]) + return ("channelAdminLogEventActionParticipantToggleBan", [("prevParticipant", ConstructorParameterDescription(_data.prevParticipant)), ("newParticipant", ConstructorParameterDescription(_data.newParticipant))]) case .channelAdminLogEventActionParticipantUnmute(let _data): - return ("channelAdminLogEventActionParticipantUnmute", [("participant", _data.participant as Any)]) + return ("channelAdminLogEventActionParticipantUnmute", [("participant", ConstructorParameterDescription(_data.participant))]) case .channelAdminLogEventActionParticipantVolume(let _data): - return ("channelAdminLogEventActionParticipantVolume", [("participant", _data.participant as Any)]) + return ("channelAdminLogEventActionParticipantVolume", [("participant", ConstructorParameterDescription(_data.participant))]) case .channelAdminLogEventActionPinTopic(let _data): - return ("channelAdminLogEventActionPinTopic", [("flags", _data.flags as Any), ("prevTopic", _data.prevTopic as Any), ("newTopic", _data.newTopic as Any)]) + return ("channelAdminLogEventActionPinTopic", [("flags", ConstructorParameterDescription(_data.flags)), ("prevTopic", ConstructorParameterDescription(_data.prevTopic)), ("newTopic", ConstructorParameterDescription(_data.newTopic))]) case .channelAdminLogEventActionSendMessage(let _data): - return ("channelAdminLogEventActionSendMessage", [("message", _data.message as Any)]) + return ("channelAdminLogEventActionSendMessage", [("message", ConstructorParameterDescription(_data.message))]) case .channelAdminLogEventActionStartGroupCall(let _data): - return ("channelAdminLogEventActionStartGroupCall", [("call", _data.call as Any)]) + return ("channelAdminLogEventActionStartGroupCall", [("call", ConstructorParameterDescription(_data.call))]) case .channelAdminLogEventActionStopPoll(let _data): - return ("channelAdminLogEventActionStopPoll", [("message", _data.message as Any)]) + return ("channelAdminLogEventActionStopPoll", [("message", ConstructorParameterDescription(_data.message))]) case .channelAdminLogEventActionToggleAntiSpam(let _data): - return ("channelAdminLogEventActionToggleAntiSpam", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleAntiSpam", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionToggleAutotranslation(let _data): - return ("channelAdminLogEventActionToggleAutotranslation", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleAutotranslation", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionToggleForum(let _data): - return ("channelAdminLogEventActionToggleForum", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleForum", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionToggleGroupCallSetting(let _data): - return ("channelAdminLogEventActionToggleGroupCallSetting", [("joinMuted", _data.joinMuted as Any)]) + return ("channelAdminLogEventActionToggleGroupCallSetting", [("joinMuted", ConstructorParameterDescription(_data.joinMuted))]) case .channelAdminLogEventActionToggleInvites(let _data): - return ("channelAdminLogEventActionToggleInvites", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleInvites", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionToggleNoForwards(let _data): - return ("channelAdminLogEventActionToggleNoForwards", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleNoForwards", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionTogglePreHistoryHidden(let _data): - return ("channelAdminLogEventActionTogglePreHistoryHidden", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionTogglePreHistoryHidden", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionToggleSignatureProfiles(let _data): - return ("channelAdminLogEventActionToggleSignatureProfiles", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleSignatureProfiles", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionToggleSignatures(let _data): - return ("channelAdminLogEventActionToggleSignatures", [("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleSignatures", [("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionToggleSlowMode(let _data): - return ("channelAdminLogEventActionToggleSlowMode", [("prevValue", _data.prevValue as Any), ("newValue", _data.newValue as Any)]) + return ("channelAdminLogEventActionToggleSlowMode", [("prevValue", ConstructorParameterDescription(_data.prevValue)), ("newValue", ConstructorParameterDescription(_data.newValue))]) case .channelAdminLogEventActionUpdatePinned(let _data): - return ("channelAdminLogEventActionUpdatePinned", [("message", _data.message as Any)]) + return ("channelAdminLogEventActionUpdatePinned", [("message", ConstructorParameterDescription(_data.message))]) } } diff --git a/submodules/TelegramApi/Sources/Api30.swift b/submodules/TelegramApi/Sources/Api30.swift index 3ddce221ad..321e789202 100644 --- a/submodules/TelegramApi/Sources/Api30.swift +++ b/submodules/TelegramApi/Sources/Api30.swift @@ -7,8 +7,8 @@ public extension Api { self.gift = gift self.endDate = endDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageAttributeStarGiftAuction", [("gift", self.gift as Any), ("endDate", self.endDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeStarGiftAuction", [("gift", ConstructorParameterDescription(self.gift)), ("endDate", ConstructorParameterDescription(self.endDate))]) } } public class Cons_webPageAttributeStarGiftCollection: TypeConstructorDescription { @@ -16,8 +16,8 @@ public extension Api { public init(icons: [Api.Document]) { self.icons = icons } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageAttributeStarGiftCollection", [("icons", self.icons as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeStarGiftCollection", [("icons", ConstructorParameterDescription(self.icons))]) } } public class Cons_webPageAttributeStickerSet: TypeConstructorDescription { @@ -27,8 +27,8 @@ public extension Api { self.flags = flags self.stickers = stickers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageAttributeStickerSet", [("flags", self.flags as Any), ("stickers", self.stickers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeStickerSet", [("flags", ConstructorParameterDescription(self.flags)), ("stickers", ConstructorParameterDescription(self.stickers))]) } } public class Cons_webPageAttributeStory: TypeConstructorDescription { @@ -42,8 +42,8 @@ public extension Api { self.id = id self.story = story } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageAttributeStory", [("flags", self.flags as Any), ("peer", self.peer as Any), ("id", self.id as Any), ("story", self.story as Any)]) + 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 { @@ -55,8 +55,8 @@ public extension Api { self.documents = documents self.settings = settings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageAttributeTheme", [("flags", self.flags as Any), ("documents", self.documents as Any), ("settings", self.settings as Any)]) + 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 { @@ -64,8 +64,8 @@ public extension Api { public init(gift: Api.StarGift) { self.gift = gift } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPageAttributeUniqueStarGift", [("gift", self.gift as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPageAttributeUniqueStarGift", [("gift", ConstructorParameterDescription(self.gift))]) } } case webPageAttributeStarGiftAuction(Cons_webPageAttributeStarGiftAuction) @@ -141,20 +141,20 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webPageAttributeStarGiftAuction(let _data): - return ("webPageAttributeStarGiftAuction", [("gift", _data.gift as Any), ("endDate", _data.endDate as Any)]) + return ("webPageAttributeStarGiftAuction", [("gift", ConstructorParameterDescription(_data.gift)), ("endDate", ConstructorParameterDescription(_data.endDate))]) case .webPageAttributeStarGiftCollection(let _data): - return ("webPageAttributeStarGiftCollection", [("icons", _data.icons as Any)]) + return ("webPageAttributeStarGiftCollection", [("icons", ConstructorParameterDescription(_data.icons))]) case .webPageAttributeStickerSet(let _data): - return ("webPageAttributeStickerSet", [("flags", _data.flags as Any), ("stickers", _data.stickers as Any)]) + return ("webPageAttributeStickerSet", [("flags", ConstructorParameterDescription(_data.flags)), ("stickers", ConstructorParameterDescription(_data.stickers))]) case .webPageAttributeStory(let _data): - return ("webPageAttributeStory", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("id", _data.id as Any), ("story", _data.story as Any)]) + 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", _data.flags as Any), ("documents", _data.documents as Any), ("settings", _data.settings as Any)]) + return ("webPageAttributeTheme", [("flags", ConstructorParameterDescription(_data.flags)), ("documents", ConstructorParameterDescription(_data.documents)), ("settings", ConstructorParameterDescription(_data.settings))]) case .webPageAttributeUniqueStarGift(let _data): - return ("webPageAttributeUniqueStarGift", [("gift", _data.gift as Any)]) + return ("webPageAttributeUniqueStarGift", [("gift", ConstructorParameterDescription(_data.gift))]) } } @@ -278,8 +278,8 @@ public extension Api { self.flags = flags self.msgId = msgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webViewMessageSent", [("flags", self.flags as Any), ("msgId", self.msgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webViewMessageSent", [("flags", ConstructorParameterDescription(self.flags)), ("msgId", ConstructorParameterDescription(self.msgId))]) } } case webViewMessageSent(Cons_webViewMessageSent) @@ -298,10 +298,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webViewMessageSent(let _data): - return ("webViewMessageSent", [("flags", _data.flags as Any), ("msgId", _data.msgId as Any)]) + return ("webViewMessageSent", [("flags", ConstructorParameterDescription(_data.flags)), ("msgId", ConstructorParameterDescription(_data.msgId))]) } } @@ -336,8 +336,8 @@ public extension Api { self.queryId = queryId self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webViewResultUrl", [("flags", self.flags as Any), ("queryId", self.queryId as Any), ("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webViewResultUrl", [("flags", ConstructorParameterDescription(self.flags)), ("queryId", ConstructorParameterDescription(self.queryId)), ("url", ConstructorParameterDescription(self.url))]) } } case webViewResultUrl(Cons_webViewResultUrl) @@ -357,10 +357,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webViewResultUrl(let _data): - return ("webViewResultUrl", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("url", _data.url as Any)]) + return ("webViewResultUrl", [("flags", ConstructorParameterDescription(_data.flags)), ("queryId", ConstructorParameterDescription(_data.queryId)), ("url", ConstructorParameterDescription(_data.url))]) } } @@ -402,8 +402,8 @@ public extension Api.account { self.users = users self.privacyPolicyUrl = privacyPolicyUrl } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("authorizationForm", [("flags", self.flags as Any), ("requiredTypes", self.requiredTypes as Any), ("values", self.values as Any), ("errors", self.errors as Any), ("users", self.users as Any), ("privacyPolicyUrl", self.privacyPolicyUrl as Any)]) + 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) @@ -442,10 +442,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .authorizationForm(let _data): - return ("authorizationForm", [("flags", _data.flags as Any), ("requiredTypes", _data.requiredTypes as Any), ("values", _data.values as Any), ("errors", _data.errors as Any), ("users", _data.users as Any), ("privacyPolicyUrl", _data.privacyPolicyUrl as Any)]) + 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))]) } } @@ -496,8 +496,8 @@ public extension Api.account { self.authorizationTtlDays = authorizationTtlDays self.authorizations = authorizations } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("authorizations", [("authorizationTtlDays", self.authorizationTtlDays as Any), ("authorizations", self.authorizations as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("authorizations", [("authorizationTtlDays", ConstructorParameterDescription(self.authorizationTtlDays)), ("authorizations", ConstructorParameterDescription(self.authorizations))]) } } case authorizations(Cons_authorizations) @@ -518,10 +518,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .authorizations(let _data): - return ("authorizations", [("authorizationTtlDays", _data.authorizationTtlDays as Any), ("authorizations", _data.authorizations as Any)]) + return ("authorizations", [("authorizationTtlDays", ConstructorParameterDescription(_data.authorizationTtlDays)), ("authorizations", ConstructorParameterDescription(_data.authorizations))]) } } @@ -554,8 +554,8 @@ public extension Api.account { self.medium = medium self.high = high } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("autoDownloadSettings", [("low", self.low as Any), ("medium", self.medium as Any), ("high", self.high as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("autoDownloadSettings", [("low", ConstructorParameterDescription(self.low)), ("medium", ConstructorParameterDescription(self.medium)), ("high", ConstructorParameterDescription(self.high))]) } } case autoDownloadSettings(Cons_autoDownloadSettings) @@ -573,10 +573,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .autoDownloadSettings(let _data): - return ("autoDownloadSettings", [("low", _data.low as Any), ("medium", _data.medium as Any), ("high", _data.high as Any)]) + return ("autoDownloadSettings", [("low", ConstructorParameterDescription(_data.low)), ("medium", ConstructorParameterDescription(_data.medium)), ("high", ConstructorParameterDescription(_data.high))]) } } @@ -622,8 +622,8 @@ public extension Api.account { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("autoSaveSettings", [("usersSettings", self.usersSettings as Any), ("chatsSettings", self.chatsSettings as Any), ("broadcastsSettings", self.broadcastsSettings as Any), ("exceptions", self.exceptions as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -656,10 +656,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .autoSaveSettings(let _data): - return ("autoSaveSettings", [("usersSettings", _data.usersSettings as Any), ("chatsSettings", _data.chatsSettings as Any), ("broadcastsSettings", _data.broadcastsSettings as Any), ("exceptions", _data.exceptions as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -714,8 +714,8 @@ public extension Api.account { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("businessChatLinks", [("links", self.links as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("businessChatLinks", [("links", ConstructorParameterDescription(self.links)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case businessChatLinks(Cons_businessChatLinks) @@ -745,10 +745,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .businessChatLinks(let _data): - return ("businessChatLinks", [("links", _data.links as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("businessChatLinks", [("links", ConstructorParameterDescription(_data.links)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -794,8 +794,8 @@ public extension Api.account { self.users = users self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatThemes", [("flags", self.flags as Any), ("hash", self.hash as Any), ("themes", self.themes as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("nextOffset", self.nextOffset as Any)]) + 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))]) } } case chatThemes(Cons_chatThemes) @@ -836,10 +836,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatThemes(let _data): - return ("chatThemes", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("themes", _data.themes as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + 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", []) } @@ -893,8 +893,8 @@ public extension Api.account { self.connectedBots = connectedBots self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("connectedBots", [("connectedBots", self.connectedBots as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("connectedBots", [("connectedBots", ConstructorParameterDescription(self.connectedBots)), ("users", ConstructorParameterDescription(self.users))]) } } case connectedBots(Cons_connectedBots) @@ -919,10 +919,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .connectedBots(let _data): - return ("connectedBots", [("connectedBots", _data.connectedBots as Any), ("users", _data.users as Any)]) + return ("connectedBots", [("connectedBots", ConstructorParameterDescription(_data.connectedBots)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -953,8 +953,8 @@ public extension Api.account { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("contentSettings", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("contentSettings", [("flags", ConstructorParameterDescription(self.flags))]) } } case contentSettings(Cons_contentSettings) @@ -970,10 +970,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .contentSettings(let _data): - return ("contentSettings", [("flags", _data.flags as Any)]) + return ("contentSettings", [("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -997,8 +997,8 @@ public extension Api.account { public init(email: String) { self.email = email } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emailVerified", [("email", self.email as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerified", [("email", ConstructorParameterDescription(self.email))]) } } public class Cons_emailVerifiedLogin: TypeConstructorDescription { @@ -1008,8 +1008,8 @@ public extension Api.account { self.email = email self.sentCode = sentCode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emailVerifiedLogin", [("email", self.email as Any), ("sentCode", self.sentCode as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerifiedLogin", [("email", ConstructorParameterDescription(self.email)), ("sentCode", ConstructorParameterDescription(self.sentCode))]) } } case emailVerified(Cons_emailVerified) @@ -1033,12 +1033,12 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emailVerified(let _data): - return ("emailVerified", [("email", _data.email as Any)]) + return ("emailVerified", [("email", ConstructorParameterDescription(_data.email))]) case .emailVerifiedLogin(let _data): - return ("emailVerifiedLogin", [("email", _data.email as Any), ("sentCode", _data.sentCode as Any)]) + return ("emailVerifiedLogin", [("email", ConstructorParameterDescription(_data.email)), ("sentCode", ConstructorParameterDescription(_data.sentCode))]) } } @@ -1080,8 +1080,8 @@ public extension Api.account { self.hash = hash self.statuses = statuses } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiStatuses", [("hash", self.hash as Any), ("statuses", self.statuses as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiStatuses", [("hash", ConstructorParameterDescription(self.hash)), ("statuses", ConstructorParameterDescription(self.statuses))]) } } case emojiStatuses(Cons_emojiStatuses) @@ -1108,10 +1108,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiStatuses(let _data): - return ("emojiStatuses", [("hash", _data.hash as Any), ("statuses", _data.statuses as Any)]) + return ("emojiStatuses", [("hash", ConstructorParameterDescription(_data.hash)), ("statuses", ConstructorParameterDescription(_data.statuses))]) case .emojiStatusesNotModified: return ("emojiStatusesNotModified", []) } @@ -1145,8 +1145,8 @@ public extension Api.account { public init(starsAmount: Int64) { self.starsAmount = starsAmount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paidMessagesRevenue", [("starsAmount", self.starsAmount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paidMessagesRevenue", [("starsAmount", ConstructorParameterDescription(self.starsAmount))]) } } case paidMessagesRevenue(Cons_paidMessagesRevenue) @@ -1162,10 +1162,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paidMessagesRevenue(let _data): - return ("paidMessagesRevenue", [("starsAmount", _data.starsAmount as Any)]) + return ("paidMessagesRevenue", [("starsAmount", ConstructorParameterDescription(_data.starsAmount))]) } } @@ -1189,8 +1189,8 @@ public extension Api.account { public init(options: Api.DataJSON) { self.options = options } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passkeyRegistrationOptions", [("options", self.options as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passkeyRegistrationOptions", [("options", ConstructorParameterDescription(self.options))]) } } case passkeyRegistrationOptions(Cons_passkeyRegistrationOptions) @@ -1206,10 +1206,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passkeyRegistrationOptions(let _data): - return ("passkeyRegistrationOptions", [("options", _data.options as Any)]) + return ("passkeyRegistrationOptions", [("options", ConstructorParameterDescription(_data.options))]) } } @@ -1235,8 +1235,8 @@ public extension Api.account { public init(passkeys: [Api.Passkey]) { self.passkeys = passkeys } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passkeys", [("passkeys", self.passkeys as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passkeys", [("passkeys", ConstructorParameterDescription(self.passkeys))]) } } case passkeys(Cons_passkeys) @@ -1256,10 +1256,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passkeys(let _data): - return ("passkeys", [("passkeys", _data.passkeys as Any)]) + return ("passkeys", [("passkeys", ConstructorParameterDescription(_data.passkeys))]) } } @@ -1305,8 +1305,8 @@ public extension Api.account { self.pendingResetDate = pendingResetDate self.loginEmailPattern = loginEmailPattern } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("password", [("flags", self.flags as Any), ("currentAlgo", self.currentAlgo as Any), ("srpB", self.srpB as Any), ("srpId", self.srpId as Any), ("hint", self.hint as Any), ("emailUnconfirmedPattern", self.emailUnconfirmedPattern as Any), ("newAlgo", self.newAlgo as Any), ("newSecureAlgo", self.newSecureAlgo as Any), ("secureRandom", self.secureRandom as Any), ("pendingResetDate", self.pendingResetDate as Any), ("loginEmailPattern", self.loginEmailPattern as Any)]) + 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) @@ -1346,10 +1346,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .password(let _data): - return ("password", [("flags", _data.flags as Any), ("currentAlgo", _data.currentAlgo as Any), ("srpB", _data.srpB as Any), ("srpId", _data.srpId as Any), ("hint", _data.hint as Any), ("emailUnconfirmedPattern", _data.emailUnconfirmedPattern as Any), ("newAlgo", _data.newAlgo as Any), ("newSecureAlgo", _data.newSecureAlgo as Any), ("secureRandom", _data.secureRandom as Any), ("pendingResetDate", _data.pendingResetDate as Any), ("loginEmailPattern", _data.loginEmailPattern as Any)]) + 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))]) } } @@ -1433,8 +1433,8 @@ public extension Api.account { self.email = email self.newSecureSettings = newSecureSettings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passwordInputSettings", [("flags", self.flags as Any), ("newAlgo", self.newAlgo as Any), ("newPasswordHash", self.newPasswordHash as Any), ("hint", self.hint as Any), ("email", self.email as Any), ("newSecureSettings", self.newSecureSettings as Any)]) + 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) @@ -1465,10 +1465,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passwordInputSettings(let _data): - return ("passwordInputSettings", [("flags", _data.flags as Any), ("newAlgo", _data.newAlgo as Any), ("newPasswordHash", _data.newPasswordHash as Any), ("hint", _data.hint as Any), ("email", _data.email as Any), ("newSecureSettings", _data.newSecureSettings as Any)]) + 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))]) } } @@ -1525,8 +1525,8 @@ public extension Api.account { self.email = email self.secureSettings = secureSettings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passwordSettings", [("flags", self.flags as Any), ("email", self.email as Any), ("secureSettings", self.secureSettings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passwordSettings", [("flags", ConstructorParameterDescription(self.flags)), ("email", ConstructorParameterDescription(self.email)), ("secureSettings", ConstructorParameterDescription(self.secureSettings))]) } } case passwordSettings(Cons_passwordSettings) @@ -1548,10 +1548,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passwordSettings(let _data): - return ("passwordSettings", [("flags", _data.flags as Any), ("email", _data.email as Any), ("secureSettings", _data.secureSettings as Any)]) + return ("passwordSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("email", ConstructorParameterDescription(_data.email)), ("secureSettings", ConstructorParameterDescription(_data.secureSettings))]) } } @@ -1591,8 +1591,8 @@ public extension Api.account { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("privacyRules", [("rules", self.rules as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("privacyRules", [("rules", ConstructorParameterDescription(self.rules)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case privacyRules(Cons_privacyRules) @@ -1622,10 +1622,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .privacyRules(let _data): - return ("privacyRules", [("rules", _data.rules as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("privacyRules", [("rules", ConstructorParameterDescription(_data.rules)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1661,8 +1661,8 @@ public extension Api.account { public init(retryDate: Int32) { self.retryDate = retryDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("resetPasswordFailedWait", [("retryDate", self.retryDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("resetPasswordFailedWait", [("retryDate", ConstructorParameterDescription(self.retryDate))]) } } public class Cons_resetPasswordRequestedWait: TypeConstructorDescription { @@ -1670,8 +1670,8 @@ public extension Api.account { public init(untilDate: Int32) { self.untilDate = untilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("resetPasswordRequestedWait", [("untilDate", self.untilDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("resetPasswordRequestedWait", [("untilDate", ConstructorParameterDescription(self.untilDate))]) } } case resetPasswordFailedWait(Cons_resetPasswordFailedWait) @@ -1700,14 +1700,14 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .resetPasswordFailedWait(let _data): - return ("resetPasswordFailedWait", [("retryDate", _data.retryDate as Any)]) + return ("resetPasswordFailedWait", [("retryDate", ConstructorParameterDescription(_data.retryDate))]) case .resetPasswordOk: return ("resetPasswordOk", []) case .resetPasswordRequestedWait(let _data): - return ("resetPasswordRequestedWait", [("untilDate", _data.untilDate as Any)]) + return ("resetPasswordRequestedWait", [("untilDate", ConstructorParameterDescription(_data.untilDate))]) } } @@ -1755,8 +1755,8 @@ public extension Api.account { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("resolvedBusinessChatLinks", [("flags", self.flags as Any), ("peer", self.peer as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1791,10 +1791,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .resolvedBusinessChatLinks(let _data): - return ("resolvedBusinessChatLinks", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } diff --git a/submodules/TelegramApi/Sources/Api31.swift b/submodules/TelegramApi/Sources/Api31.swift index be3333b043..46d8b246c9 100644 --- a/submodules/TelegramApi/Sources/Api31.swift +++ b/submodules/TelegramApi/Sources/Api31.swift @@ -5,8 +5,8 @@ public extension Api.account { public init(ids: [Int64]) { self.ids = ids } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedMusicIds", [("ids", self.ids as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedMusicIds", [("ids", ConstructorParameterDescription(self.ids))]) } } case savedMusicIds(Cons_savedMusicIds) @@ -32,10 +32,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedMusicIds(let _data): - return ("savedMusicIds", [("ids", _data.ids as Any)]) + return ("savedMusicIds", [("ids", ConstructorParameterDescription(_data.ids))]) case .savedMusicIdsNotModified: return ("savedMusicIdsNotModified", []) } @@ -66,8 +66,8 @@ public extension Api.account { public init(document: Api.Document) { self.document = document } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedRingtoneConverted", [("document", self.document as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedRingtoneConverted", [("document", ConstructorParameterDescription(self.document))]) } } case savedRingtone @@ -89,12 +89,12 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedRingtone: return ("savedRingtone", []) case .savedRingtoneConverted(let _data): - return ("savedRingtoneConverted", [("document", _data.document as Any)]) + return ("savedRingtoneConverted", [("document", ConstructorParameterDescription(_data.document))]) } } @@ -125,8 +125,8 @@ public extension Api.account { self.hash = hash self.ringtones = ringtones } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedRingtones", [("hash", self.hash as Any), ("ringtones", self.ringtones as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedRingtones", [("hash", ConstructorParameterDescription(self.hash)), ("ringtones", ConstructorParameterDescription(self.ringtones))]) } } case savedRingtones(Cons_savedRingtones) @@ -153,10 +153,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedRingtones(let _data): - return ("savedRingtones", [("hash", _data.hash as Any), ("ringtones", _data.ringtones as Any)]) + return ("savedRingtones", [("hash", ConstructorParameterDescription(_data.hash)), ("ringtones", ConstructorParameterDescription(_data.ringtones))]) case .savedRingtonesNotModified: return ("savedRingtonesNotModified", []) } @@ -192,8 +192,8 @@ public extension Api.account { self.emailPattern = emailPattern self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentEmailCode", [("emailPattern", self.emailPattern as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentEmailCode", [("emailPattern", ConstructorParameterDescription(self.emailPattern)), ("length", ConstructorParameterDescription(self.length))]) } } case sentEmailCode(Cons_sentEmailCode) @@ -210,10 +210,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sentEmailCode(let _data): - return ("sentEmailCode", [("emailPattern", _data.emailPattern as Any), ("length", _data.length as Any)]) + return ("sentEmailCode", [("emailPattern", ConstructorParameterDescription(_data.emailPattern)), ("length", ConstructorParameterDescription(_data.length))]) } } @@ -240,8 +240,8 @@ public extension Api.account { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("takeout", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("takeout", [("id", ConstructorParameterDescription(self.id))]) } } case takeout(Cons_takeout) @@ -257,10 +257,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .takeout(let _data): - return ("takeout", [("id", _data.id as Any)]) + return ("takeout", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -286,8 +286,8 @@ public extension Api.account { self.hash = hash self.themes = themes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("themes", [("hash", self.hash as Any), ("themes", self.themes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("themes", [("hash", ConstructorParameterDescription(self.hash)), ("themes", ConstructorParameterDescription(self.themes))]) } } case themes(Cons_themes) @@ -314,10 +314,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .themes(let _data): - return ("themes", [("hash", _data.hash as Any), ("themes", _data.themes as Any)]) + return ("themes", [("hash", ConstructorParameterDescription(_data.hash)), ("themes", ConstructorParameterDescription(_data.themes))]) case .themesNotModified: return ("themesNotModified", []) } @@ -353,8 +353,8 @@ public extension Api.account { self.tmpPassword = tmpPassword self.validUntil = validUntil } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("tmpPassword", [("tmpPassword", self.tmpPassword as Any), ("validUntil", self.validUntil as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("tmpPassword", [("tmpPassword", ConstructorParameterDescription(self.tmpPassword)), ("validUntil", ConstructorParameterDescription(self.validUntil))]) } } case tmpPassword(Cons_tmpPassword) @@ -371,10 +371,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .tmpPassword(let _data): - return ("tmpPassword", [("tmpPassword", _data.tmpPassword as Any), ("validUntil", _data.validUntil as Any)]) + return ("tmpPassword", [("tmpPassword", ConstructorParameterDescription(_data.tmpPassword)), ("validUntil", ConstructorParameterDescription(_data.validUntil))]) } } @@ -403,8 +403,8 @@ public extension Api.account { self.hash = hash self.wallpapers = wallpapers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("wallPapers", [("hash", self.hash as Any), ("wallpapers", self.wallpapers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("wallPapers", [("hash", ConstructorParameterDescription(self.hash)), ("wallpapers", ConstructorParameterDescription(self.wallpapers))]) } } case wallPapers(Cons_wallPapers) @@ -431,10 +431,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .wallPapers(let _data): - return ("wallPapers", [("hash", _data.hash as Any), ("wallpapers", _data.wallpapers as Any)]) + return ("wallPapers", [("hash", ConstructorParameterDescription(_data.hash)), ("wallpapers", ConstructorParameterDescription(_data.wallpapers))]) case .wallPapersNotModified: return ("wallPapersNotModified", []) } @@ -470,8 +470,8 @@ public extension Api.account { self.authorizations = authorizations self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webAuthorizations", [("authorizations", self.authorizations as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webAuthorizations", [("authorizations", ConstructorParameterDescription(self.authorizations)), ("users", ConstructorParameterDescription(self.users))]) } } case webAuthorizations(Cons_webAuthorizations) @@ -496,10 +496,10 @@ public extension Api.account { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webAuthorizations(let _data): - return ("webAuthorizations", [("authorizations", _data.authorizations as Any), ("users", _data.users as Any)]) + return ("webAuthorizations", [("authorizations", ConstructorParameterDescription(_data.authorizations)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -538,8 +538,8 @@ public extension Api.auth { self.futureAuthToken = futureAuthToken self.user = user } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("authorization", [("flags", self.flags as Any), ("otherwiseReloginDays", self.otherwiseReloginDays as Any), ("tmpSessions", self.tmpSessions as Any), ("futureAuthToken", self.futureAuthToken as Any), ("user", self.user as Any)]) + 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 { @@ -549,8 +549,8 @@ public extension Api.auth { self.flags = flags self.termsOfService = termsOfService } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("authorizationSignUpRequired", [("flags", self.flags as Any), ("termsOfService", self.termsOfService as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("authorizationSignUpRequired", [("flags", ConstructorParameterDescription(self.flags)), ("termsOfService", ConstructorParameterDescription(self.termsOfService))]) } } case authorization(Cons_authorization) @@ -586,12 +586,12 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .authorization(let _data): - return ("authorization", [("flags", _data.flags as Any), ("otherwiseReloginDays", _data.otherwiseReloginDays as Any), ("tmpSessions", _data.tmpSessions as Any), ("futureAuthToken", _data.futureAuthToken as Any), ("user", _data.user as Any)]) + 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", _data.flags as Any), ("termsOfService", _data.termsOfService as Any)]) + return ("authorizationSignUpRequired", [("flags", ConstructorParameterDescription(_data.flags)), ("termsOfService", ConstructorParameterDescription(_data.termsOfService))]) } } @@ -684,7 +684,7 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .codeTypeCall: return ("codeTypeCall", []) @@ -725,8 +725,8 @@ public extension Api.auth { self.id = id self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedAuthorization", [("id", self.id as Any), ("bytes", self.bytes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedAuthorization", [("id", ConstructorParameterDescription(self.id)), ("bytes", ConstructorParameterDescription(self.bytes))]) } } case exportedAuthorization(Cons_exportedAuthorization) @@ -743,10 +743,10 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedAuthorization(let _data): - return ("exportedAuthorization", [("id", _data.id as Any), ("bytes", _data.bytes as Any)]) + return ("exportedAuthorization", [("id", ConstructorParameterDescription(_data.id)), ("bytes", ConstructorParameterDescription(_data.bytes))]) } } @@ -775,8 +775,8 @@ public extension Api.auth { self.flags = flags self.futureAuthToken = futureAuthToken } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("loggedOut", [("flags", self.flags as Any), ("futureAuthToken", self.futureAuthToken as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("loggedOut", [("flags", ConstructorParameterDescription(self.flags)), ("futureAuthToken", ConstructorParameterDescription(self.futureAuthToken))]) } } case loggedOut(Cons_loggedOut) @@ -795,10 +795,10 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .loggedOut(let _data): - return ("loggedOut", [("flags", _data.flags as Any), ("futureAuthToken", _data.futureAuthToken as Any)]) + return ("loggedOut", [("flags", ConstructorParameterDescription(_data.flags)), ("futureAuthToken", ConstructorParameterDescription(_data.futureAuthToken))]) } } @@ -829,8 +829,8 @@ public extension Api.auth { self.expires = expires self.token = token } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("loginToken", [("expires", self.expires as Any), ("token", self.token as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("loginToken", [("expires", ConstructorParameterDescription(self.expires)), ("token", ConstructorParameterDescription(self.token))]) } } public class Cons_loginTokenMigrateTo: TypeConstructorDescription { @@ -840,8 +840,8 @@ public extension Api.auth { self.dcId = dcId self.token = token } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("loginTokenMigrateTo", [("dcId", self.dcId as Any), ("token", self.token as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("loginTokenMigrateTo", [("dcId", ConstructorParameterDescription(self.dcId)), ("token", ConstructorParameterDescription(self.token))]) } } public class Cons_loginTokenSuccess: TypeConstructorDescription { @@ -849,8 +849,8 @@ public extension Api.auth { public init(authorization: Api.auth.Authorization) { self.authorization = authorization } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("loginTokenSuccess", [("authorization", self.authorization as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("loginTokenSuccess", [("authorization", ConstructorParameterDescription(self.authorization))]) } } case loginToken(Cons_loginToken) @@ -882,14 +882,14 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .loginToken(let _data): - return ("loginToken", [("expires", _data.expires as Any), ("token", _data.token as Any)]) + return ("loginToken", [("expires", ConstructorParameterDescription(_data.expires)), ("token", ConstructorParameterDescription(_data.token))]) case .loginTokenMigrateTo(let _data): - return ("loginTokenMigrateTo", [("dcId", _data.dcId as Any), ("token", _data.token as Any)]) + return ("loginTokenMigrateTo", [("dcId", ConstructorParameterDescription(_data.dcId)), ("token", ConstructorParameterDescription(_data.token))]) case .loginTokenSuccess(let _data): - return ("loginTokenSuccess", [("authorization", _data.authorization as Any)]) + return ("loginTokenSuccess", [("authorization", ConstructorParameterDescription(_data.authorization))]) } } @@ -943,8 +943,8 @@ public extension Api.auth { public init(options: Api.DataJSON) { self.options = options } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passkeyLoginOptions", [("options", self.options as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passkeyLoginOptions", [("options", ConstructorParameterDescription(self.options))]) } } case passkeyLoginOptions(Cons_passkeyLoginOptions) @@ -960,10 +960,10 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passkeyLoginOptions(let _data): - return ("passkeyLoginOptions", [("options", _data.options as Any)]) + return ("passkeyLoginOptions", [("options", ConstructorParameterDescription(_data.options))]) } } @@ -989,8 +989,8 @@ public extension Api.auth { public init(emailPattern: String) { self.emailPattern = emailPattern } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passwordRecovery", [("emailPattern", self.emailPattern as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passwordRecovery", [("emailPattern", ConstructorParameterDescription(self.emailPattern))]) } } case passwordRecovery(Cons_passwordRecovery) @@ -1006,10 +1006,10 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passwordRecovery(let _data): - return ("passwordRecovery", [("emailPattern", _data.emailPattern as Any)]) + return ("passwordRecovery", [("emailPattern", ConstructorParameterDescription(_data.emailPattern))]) } } @@ -1041,8 +1041,8 @@ public extension Api.auth { self.nextType = nextType self.timeout = timeout } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCode", [("flags", self.flags as Any), ("type", self.type as Any), ("phoneCodeHash", self.phoneCodeHash as Any), ("nextType", self.nextType as Any), ("timeout", self.timeout as Any)]) + 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 { @@ -1060,8 +1060,8 @@ public extension Api.auth { self.currency = currency self.amount = amount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodePaymentRequired", [("storeProduct", self.storeProduct as Any), ("phoneCodeHash", self.phoneCodeHash as Any), ("supportEmailAddress", self.supportEmailAddress as Any), ("supportEmailSubject", self.supportEmailSubject as Any), ("currency", self.currency as Any), ("amount", self.amount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodePaymentRequired", [("storeProduct", ConstructorParameterDescription(self.storeProduct)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash)), ("supportEmailAddress", ConstructorParameterDescription(self.supportEmailAddress)), ("supportEmailSubject", ConstructorParameterDescription(self.supportEmailSubject)), ("currency", ConstructorParameterDescription(self.currency)), ("amount", ConstructorParameterDescription(self.amount))]) } } public class Cons_sentCodeSuccess: TypeConstructorDescription { @@ -1069,8 +1069,8 @@ public extension Api.auth { public init(authorization: Api.auth.Authorization) { self.authorization = authorization } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeSuccess", [("authorization", self.authorization as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeSuccess", [("authorization", ConstructorParameterDescription(self.authorization))]) } } case sentCode(Cons_sentCode) @@ -1113,14 +1113,14 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sentCode(let _data): - return ("sentCode", [("flags", _data.flags as Any), ("type", _data.type as Any), ("phoneCodeHash", _data.phoneCodeHash as Any), ("nextType", _data.nextType as Any), ("timeout", _data.timeout as Any)]) + 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", _data.storeProduct as Any), ("phoneCodeHash", _data.phoneCodeHash as Any), ("supportEmailAddress", _data.supportEmailAddress as Any), ("supportEmailSubject", _data.supportEmailSubject as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any)]) + return ("sentCodePaymentRequired", [("storeProduct", ConstructorParameterDescription(_data.storeProduct)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash)), ("supportEmailAddress", ConstructorParameterDescription(_data.supportEmailAddress)), ("supportEmailSubject", ConstructorParameterDescription(_data.supportEmailSubject)), ("currency", ConstructorParameterDescription(_data.currency)), ("amount", ConstructorParameterDescription(_data.amount))]) case .sentCodeSuccess(let _data): - return ("sentCodeSuccess", [("authorization", _data.authorization as Any)]) + return ("sentCodeSuccess", [("authorization", ConstructorParameterDescription(_data.authorization))]) } } @@ -1203,8 +1203,8 @@ public extension Api.auth { public init(length: Int32) { self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeApp", [("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeApp", [("length", ConstructorParameterDescription(self.length))]) } } public class Cons_sentCodeTypeCall: TypeConstructorDescription { @@ -1212,8 +1212,8 @@ public extension Api.auth { public init(length: Int32) { self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeCall", [("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeCall", [("length", ConstructorParameterDescription(self.length))]) } } public class Cons_sentCodeTypeEmailCode: TypeConstructorDescription { @@ -1229,8 +1229,8 @@ public extension Api.auth { self.resetAvailablePeriod = resetAvailablePeriod self.resetPendingDate = resetPendingDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeEmailCode", [("flags", self.flags as Any), ("emailPattern", self.emailPattern as Any), ("length", self.length as Any), ("resetAvailablePeriod", self.resetAvailablePeriod as Any), ("resetPendingDate", self.resetPendingDate as Any)]) + 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 { @@ -1250,8 +1250,8 @@ public extension Api.auth { self.pushTimeout = pushTimeout self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeFirebaseSms", [("flags", self.flags as Any), ("nonce", self.nonce as Any), ("playIntegrityProjectId", self.playIntegrityProjectId as Any), ("playIntegrityNonce", self.playIntegrityNonce as Any), ("receipt", self.receipt as Any), ("pushTimeout", self.pushTimeout as Any), ("length", self.length as Any)]) + 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 { @@ -1259,8 +1259,8 @@ public extension Api.auth { public init(pattern: String) { self.pattern = pattern } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeFlashCall", [("pattern", self.pattern as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeFlashCall", [("pattern", ConstructorParameterDescription(self.pattern))]) } } public class Cons_sentCodeTypeFragmentSms: TypeConstructorDescription { @@ -1270,8 +1270,8 @@ public extension Api.auth { self.url = url self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeFragmentSms", [("url", self.url as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeFragmentSms", [("url", ConstructorParameterDescription(self.url)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_sentCodeTypeMissedCall: TypeConstructorDescription { @@ -1281,8 +1281,8 @@ public extension Api.auth { self.prefix = prefix self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeMissedCall", [("prefix", self.prefix as Any), ("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeMissedCall", [("prefix", ConstructorParameterDescription(self.prefix)), ("length", ConstructorParameterDescription(self.length))]) } } public class Cons_sentCodeTypeSetUpEmailRequired: TypeConstructorDescription { @@ -1290,8 +1290,8 @@ public extension Api.auth { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeSetUpEmailRequired", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSetUpEmailRequired", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_sentCodeTypeSms: TypeConstructorDescription { @@ -1299,8 +1299,8 @@ public extension Api.auth { public init(length: Int32) { self.length = length } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeSms", [("length", self.length as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSms", [("length", ConstructorParameterDescription(self.length))]) } } public class Cons_sentCodeTypeSmsPhrase: TypeConstructorDescription { @@ -1310,8 +1310,8 @@ public extension Api.auth { self.flags = flags self.beginning = beginning } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeSmsPhrase", [("flags", self.flags as Any), ("beginning", self.beginning as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSmsPhrase", [("flags", ConstructorParameterDescription(self.flags)), ("beginning", ConstructorParameterDescription(self.beginning))]) } } public class Cons_sentCodeTypeSmsWord: TypeConstructorDescription { @@ -1321,8 +1321,8 @@ public extension Api.auth { self.flags = flags self.beginning = beginning } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentCodeTypeSmsWord", [("flags", self.flags as Any), ("beginning", self.beginning as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentCodeTypeSmsWord", [("flags", ConstructorParameterDescription(self.flags)), ("beginning", ConstructorParameterDescription(self.beginning))]) } } case sentCodeTypeApp(Cons_sentCodeTypeApp) @@ -1440,30 +1440,30 @@ public extension Api.auth { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sentCodeTypeApp(let _data): - return ("sentCodeTypeApp", [("length", _data.length as Any)]) + return ("sentCodeTypeApp", [("length", ConstructorParameterDescription(_data.length))]) case .sentCodeTypeCall(let _data): - return ("sentCodeTypeCall", [("length", _data.length as Any)]) + return ("sentCodeTypeCall", [("length", ConstructorParameterDescription(_data.length))]) case .sentCodeTypeEmailCode(let _data): - return ("sentCodeTypeEmailCode", [("flags", _data.flags as Any), ("emailPattern", _data.emailPattern as Any), ("length", _data.length as Any), ("resetAvailablePeriod", _data.resetAvailablePeriod as Any), ("resetPendingDate", _data.resetPendingDate as Any)]) + 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", _data.flags as Any), ("nonce", _data.nonce as Any), ("playIntegrityProjectId", _data.playIntegrityProjectId as Any), ("playIntegrityNonce", _data.playIntegrityNonce as Any), ("receipt", _data.receipt as Any), ("pushTimeout", _data.pushTimeout as Any), ("length", _data.length as Any)]) + 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", _data.pattern as Any)]) + return ("sentCodeTypeFlashCall", [("pattern", ConstructorParameterDescription(_data.pattern))]) case .sentCodeTypeFragmentSms(let _data): - return ("sentCodeTypeFragmentSms", [("url", _data.url as Any), ("length", _data.length as Any)]) + return ("sentCodeTypeFragmentSms", [("url", ConstructorParameterDescription(_data.url)), ("length", ConstructorParameterDescription(_data.length))]) case .sentCodeTypeMissedCall(let _data): - return ("sentCodeTypeMissedCall", [("prefix", _data.prefix as Any), ("length", _data.length as Any)]) + return ("sentCodeTypeMissedCall", [("prefix", ConstructorParameterDescription(_data.prefix)), ("length", ConstructorParameterDescription(_data.length))]) case .sentCodeTypeSetUpEmailRequired(let _data): - return ("sentCodeTypeSetUpEmailRequired", [("flags", _data.flags as Any)]) + return ("sentCodeTypeSetUpEmailRequired", [("flags", ConstructorParameterDescription(_data.flags))]) case .sentCodeTypeSms(let _data): - return ("sentCodeTypeSms", [("length", _data.length as Any)]) + return ("sentCodeTypeSms", [("length", ConstructorParameterDescription(_data.length))]) case .sentCodeTypeSmsPhrase(let _data): - return ("sentCodeTypeSmsPhrase", [("flags", _data.flags as Any), ("beginning", _data.beginning as Any)]) + return ("sentCodeTypeSmsPhrase", [("flags", ConstructorParameterDescription(_data.flags)), ("beginning", ConstructorParameterDescription(_data.beginning))]) case .sentCodeTypeSmsWord(let _data): - return ("sentCodeTypeSmsWord", [("flags", _data.flags as Any), ("beginning", _data.beginning as Any)]) + return ("sentCodeTypeSmsWord", [("flags", ConstructorParameterDescription(_data.flags)), ("beginning", ConstructorParameterDescription(_data.beginning))]) } } diff --git a/submodules/TelegramApi/Sources/Api32.swift b/submodules/TelegramApi/Sources/Api32.swift index e2640a9b0d..c188d6b7db 100644 --- a/submodules/TelegramApi/Sources/Api32.swift +++ b/submodules/TelegramApi/Sources/Api32.swift @@ -9,8 +9,8 @@ public extension Api.bots { self.about = about self.description = description } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botInfo", [("name", self.name as Any), ("about", self.about as Any), ("description", self.description as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botInfo", [("name", ConstructorParameterDescription(self.name)), ("about", ConstructorParameterDescription(self.about)), ("description", ConstructorParameterDescription(self.description))]) } } case botInfo(Cons_botInfo) @@ -28,10 +28,10 @@ public extension Api.bots { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botInfo(let _data): - return ("botInfo", [("name", _data.name as Any), ("about", _data.about as Any), ("description", _data.description as Any)]) + return ("botInfo", [("name", ConstructorParameterDescription(_data.name)), ("about", ConstructorParameterDescription(_data.about)), ("description", ConstructorParameterDescription(_data.description))]) } } @@ -61,8 +61,8 @@ public extension Api.bots { public init(token: String) { self.token = token } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedBotToken", [("token", self.token as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedBotToken", [("token", ConstructorParameterDescription(self.token))]) } } case exportedBotToken(Cons_exportedBotToken) @@ -78,10 +78,10 @@ public extension Api.bots { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedBotToken(let _data): - return ("exportedBotToken", [("token", _data.token as Any)]) + return ("exportedBotToken", [("token", ConstructorParameterDescription(_data.token))]) } } @@ -109,8 +109,8 @@ public extension Api.bots { self.nextOffset = nextOffset self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("popularAppBots", [("flags", self.flags as Any), ("nextOffset", self.nextOffset as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("popularAppBots", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.nextOffset)), ("users", ConstructorParameterDescription(self.users))]) } } case popularAppBots(Cons_popularAppBots) @@ -134,10 +134,10 @@ public extension Api.bots { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .popularAppBots(let _data): - return ("popularAppBots", [("flags", _data.flags as Any), ("nextOffset", _data.nextOffset as Any), ("users", _data.users as Any)]) + return ("popularAppBots", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -173,8 +173,8 @@ public extension Api.bots { self.media = media self.langCodes = langCodes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("previewInfo", [("media", self.media as Any), ("langCodes", self.langCodes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("previewInfo", [("media", ConstructorParameterDescription(self.media)), ("langCodes", ConstructorParameterDescription(self.langCodes))]) } } case previewInfo(Cons_previewInfo) @@ -199,10 +199,10 @@ public extension Api.bots { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .previewInfo(let _data): - return ("previewInfo", [("media", _data.media as Any), ("langCodes", _data.langCodes as Any)]) + return ("previewInfo", [("media", ConstructorParameterDescription(_data.media)), ("langCodes", ConstructorParameterDescription(_data.langCodes))]) } } @@ -233,8 +233,8 @@ public extension Api.bots { public init(webappReqId: String) { self.webappReqId = webappReqId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("requestedButton", [("webappReqId", self.webappReqId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("requestedButton", [("webappReqId", ConstructorParameterDescription(self.webappReqId))]) } } case requestedButton(Cons_requestedButton) @@ -250,10 +250,10 @@ public extension Api.bots { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .requestedButton(let _data): - return ("requestedButton", [("webappReqId", _data.webappReqId as Any)]) + return ("requestedButton", [("webappReqId", ConstructorParameterDescription(_data.webappReqId))]) } } @@ -281,8 +281,8 @@ public extension Api.channels { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("adminLogResults", [("events", self.events as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("adminLogResults", [("events", ConstructorParameterDescription(self.events)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case adminLogResults(Cons_adminLogResults) @@ -312,10 +312,10 @@ public extension Api.channels { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .adminLogResults(let _data): - return ("adminLogResults", [("events", _data.events as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("adminLogResults", [("events", ConstructorParameterDescription(_data.events)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -355,8 +355,8 @@ public extension Api.channels { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipant", [("participant", self.participant as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipant", [("participant", ConstructorParameterDescription(self.participant)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case channelParticipant(Cons_channelParticipant) @@ -382,10 +382,10 @@ public extension Api.channels { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelParticipant(let _data): - return ("channelParticipant", [("participant", _data.participant as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("channelParticipant", [("participant", ConstructorParameterDescription(_data.participant)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -427,8 +427,8 @@ public extension Api.channels { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipants", [("count", self.count as Any), ("participants", self.participants as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -465,10 +465,10 @@ public extension Api.channels { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelParticipants(let _data): - return ("channelParticipants", [("count", _data.count as Any), ("participants", _data.participants as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("channelParticipants", [("count", ConstructorParameterDescription(_data.count)), ("participants", ConstructorParameterDescription(_data.participants)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) case .channelParticipantsNotModified: return ("channelParticipantsNotModified", []) } @@ -505,170 +505,6 @@ public extension Api.channels { } } } -public extension Api.channels { - enum Found: TypeConstructorDescription { - public class Cons_found: TypeConstructorDescription { - public var flags: Int32 - public var results: [Api.Peer] - public var chats: [Api.Chat] - public var users: [Api.User] - public var nextOffset: String? - public init(flags: Int32, results: [Api.Peer], chats: [Api.Chat], users: [Api.User], nextOffset: String?) { - self.flags = flags - self.results = results - self.chats = chats - self.users = users - self.nextOffset = nextOffset - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("found", [("flags", self.flags as Any), ("results", self.results as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("nextOffset", self.nextOffset as Any)]) - } - } - case found(Cons_found) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .found(let _data): - if boxed { - buffer.appendInt32(824755388) - } - 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) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - if Int(_data.flags) & Int(1 << 0) != 0 { - serializeString(_data.nextOffset!, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .found(let _data): - return ("found", [("flags", _data.flags as Any), ("results", _data.results as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) - } - } - - public static func parse_found(_ reader: BufferReader) -> Found? { - 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.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: String? - if Int(_1!) & Int(1 << 0) != 0 { - _5 = parseString(reader) - } - let _c1 = _1 != nil - let _c2 = _2 != nil - let _c3 = _3 != nil - let _c4 = _4 != nil - let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil - if _c1 && _c2 && _c3 && _c4 && _c5 { - return Api.channels.Found.found(Cons_found(flags: _1!, results: _2!, chats: _3!, users: _4!, nextOffset: _5)) - } - else { - return nil - } - } - } -} -public extension Api.channels { - enum PersonalChannels: TypeConstructorDescription { - public class Cons_personalChannels: TypeConstructorDescription { - public var channels: [Api.PersonalChannel] - public var chats: [Api.Chat] - public var users: [Api.User] - public init(channels: [Api.PersonalChannel], chats: [Api.Chat], users: [Api.User]) { - self.channels = channels - self.chats = chats - self.users = users - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("personalChannels", [("channels", self.channels as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) - } - } - case personalChannels(Cons_personalChannels) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .personalChannels(let _data): - if boxed { - buffer.appendInt32(-694491059) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.channels.count)) - for item in _data.channels { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.chats.count)) - for item in _data.chats { - item.serialize(buffer, true) - } - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.users.count)) - for item in _data.users { - item.serialize(buffer, true) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .personalChannels(let _data): - return ("personalChannels", [("channels", _data.channels as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) - } - } - - public static func parse_personalChannels(_ reader: BufferReader) -> PersonalChannels? { - var _1: [Api.PersonalChannel]? - if let _ = reader.readInt32() { - _1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PersonalChannel.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.PersonalChannels.personalChannels(Cons_personalChannels(channels: _1!, chats: _2!, users: _3!)) - } - else { - return nil - } - } - } -} public extension Api.channels { enum SendAsPeers: TypeConstructorDescription { public class Cons_sendAsPeers: TypeConstructorDescription { @@ -680,8 +516,8 @@ public extension Api.channels { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sendAsPeers", [("peers", self.peers as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sendAsPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case sendAsPeers(Cons_sendAsPeers) @@ -711,10 +547,10 @@ public extension Api.channels { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sendAsPeers(let _data): - return ("sendAsPeers", [("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("sendAsPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -752,8 +588,8 @@ public extension Api.channels { self.title = title self.options = options } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sponsoredMessageReportResultChooseOption", [("title", self.title as Any), ("options", self.options as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sponsoredMessageReportResultChooseOption", [("title", ConstructorParameterDescription(self.title)), ("options", ConstructorParameterDescription(self.options))]) } } case sponsoredMessageReportResultAdsHidden @@ -786,12 +622,12 @@ public extension Api.channels { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sponsoredMessageReportResultAdsHidden: return ("sponsoredMessageReportResultAdsHidden", []) case .sponsoredMessageReportResultChooseOption(let _data): - return ("sponsoredMessageReportResultChooseOption", [("title", _data.title as Any), ("options", _data.options as Any)]) + return ("sponsoredMessageReportResultChooseOption", [("title", ConstructorParameterDescription(_data.title)), ("options", ConstructorParameterDescription(_data.options))]) case .sponsoredMessageReportResultReported: return ("sponsoredMessageReportResultReported", []) } @@ -838,8 +674,8 @@ public extension Api.chatlists { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatlistInvite", [("flags", self.flags as Any), ("title", self.title as Any), ("emoticon", self.emoticon as Any), ("peers", self.peers as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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 { @@ -855,8 +691,8 @@ public extension Api.chatlists { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatlistInviteAlready", [("filterId", self.filterId as Any), ("missingPeers", self.missingPeers as Any), ("alreadyPeers", self.alreadyPeers as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -918,12 +754,12 @@ public extension Api.chatlists { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatlistInvite(let _data): - return ("chatlistInvite", [("flags", _data.flags as Any), ("title", _data.title as Any), ("emoticon", _data.emoticon as Any), ("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", _data.filterId as Any), ("missingPeers", _data.missingPeers as Any), ("alreadyPeers", _data.alreadyPeers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("chatlistInviteAlready", [("filterId", ConstructorParameterDescription(_data.filterId)), ("missingPeers", ConstructorParameterDescription(_data.missingPeers)), ("alreadyPeers", ConstructorParameterDescription(_data.alreadyPeers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1007,8 +843,8 @@ public extension Api.chatlists { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatlistUpdates", [("missingPeers", self.missingPeers as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatlistUpdates", [("missingPeers", ConstructorParameterDescription(self.missingPeers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case chatlistUpdates(Cons_chatlistUpdates) @@ -1038,10 +874,10 @@ public extension Api.chatlists { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatlistUpdates(let _data): - return ("chatlistUpdates", [("missingPeers", _data.missingPeers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("chatlistUpdates", [("missingPeers", ConstructorParameterDescription(_data.missingPeers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1079,8 +915,8 @@ public extension Api.chatlists { self.filter = filter self.invite = invite } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedChatlistInvite", [("filter", self.filter as Any), ("invite", self.invite as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedChatlistInvite", [("filter", ConstructorParameterDescription(self.filter)), ("invite", ConstructorParameterDescription(self.invite))]) } } case exportedChatlistInvite(Cons_exportedChatlistInvite) @@ -1097,10 +933,10 @@ public extension Api.chatlists { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedChatlistInvite(let _data): - return ("exportedChatlistInvite", [("filter", _data.filter as Any), ("invite", _data.invite as Any)]) + return ("exportedChatlistInvite", [("filter", ConstructorParameterDescription(_data.filter)), ("invite", ConstructorParameterDescription(_data.invite))]) } } @@ -1135,8 +971,8 @@ public extension Api.chatlists { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedInvites", [("invites", self.invites as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedInvites", [("invites", ConstructorParameterDescription(self.invites)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case exportedInvites(Cons_exportedInvites) @@ -1166,10 +1002,10 @@ public extension Api.chatlists { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedInvites(let _data): - return ("exportedInvites", [("invites", _data.invites as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("exportedInvites", [("invites", ConstructorParameterDescription(_data.invites)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1209,8 +1045,8 @@ public extension Api.contacts { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("blocked", [("blocked", self.blocked as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("blocked", [("blocked", ConstructorParameterDescription(self.blocked)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } public class Cons_blockedSlice: TypeConstructorDescription { @@ -1224,8 +1060,8 @@ public extension Api.contacts { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("blockedSlice", [("count", self.count as Any), ("blocked", self.blocked as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1277,12 +1113,12 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .blocked(let _data): - return ("blocked", [("blocked", _data.blocked as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("blocked", [("blocked", ConstructorParameterDescription(_data.blocked)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) case .blockedSlice(let _data): - return ("blockedSlice", [("count", _data.count as Any), ("blocked", _data.blocked as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("blockedSlice", [("count", ConstructorParameterDescription(_data.count)), ("blocked", ConstructorParameterDescription(_data.blocked)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1346,8 +1182,8 @@ public extension Api.contacts { self.contacts = contacts self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("contactBirthdays", [("contacts", self.contacts as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("contactBirthdays", [("contacts", ConstructorParameterDescription(self.contacts)), ("users", ConstructorParameterDescription(self.users))]) } } case contactBirthdays(Cons_contactBirthdays) @@ -1372,10 +1208,10 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .contactBirthdays(let _data): - return ("contactBirthdays", [("contacts", _data.contacts as Any), ("users", _data.users as Any)]) + return ("contactBirthdays", [("contacts", ConstructorParameterDescription(_data.contacts)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1410,8 +1246,8 @@ public extension Api.contacts { self.savedCount = savedCount self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("contacts", [("contacts", self.contacts as Any), ("savedCount", self.savedCount as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("contacts", [("contacts", ConstructorParameterDescription(self.contacts)), ("savedCount", ConstructorParameterDescription(self.savedCount)), ("users", ConstructorParameterDescription(self.users))]) } } case contacts(Cons_contacts) @@ -1443,10 +1279,10 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .contacts(let _data): - return ("contacts", [("contacts", _data.contacts as Any), ("savedCount", _data.savedCount as Any), ("users", _data.users as Any)]) + return ("contacts", [("contacts", ConstructorParameterDescription(_data.contacts)), ("savedCount", ConstructorParameterDescription(_data.savedCount)), ("users", ConstructorParameterDescription(_data.users))]) case .contactsNotModified: return ("contactsNotModified", []) } @@ -1491,8 +1327,8 @@ public extension Api.contacts { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("found", [("myResults", self.myResults as Any), ("results", self.results as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("found", [("myResults", ConstructorParameterDescription(self.myResults)), ("results", ConstructorParameterDescription(self.results)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case found(Cons_found) @@ -1527,10 +1363,10 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .found(let _data): - return ("found", [("myResults", _data.myResults as Any), ("results", _data.results as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("found", [("myResults", ConstructorParameterDescription(_data.myResults)), ("results", ConstructorParameterDescription(_data.results)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1577,8 +1413,8 @@ public extension Api.contacts { self.retryContacts = retryContacts self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("importedContacts", [("imported", self.imported as Any), ("popularInvites", self.popularInvites as Any), ("retryContacts", self.retryContacts as Any), ("users", self.users as Any)]) + 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) @@ -1613,10 +1449,10 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .importedContacts(let _data): - return ("importedContacts", [("imported", _data.imported as Any), ("popularInvites", _data.popularInvites as Any), ("retryContacts", _data.retryContacts as Any), ("users", _data.users as Any)]) + return ("importedContacts", [("imported", ConstructorParameterDescription(_data.imported)), ("popularInvites", ConstructorParameterDescription(_data.popularInvites)), ("retryContacts", ConstructorParameterDescription(_data.retryContacts)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1661,8 +1497,8 @@ public extension Api.contacts { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("resolvedPeer", [("peer", self.peer as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("resolvedPeer", [("peer", ConstructorParameterDescription(self.peer)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case resolvedPeer(Cons_resolvedPeer) @@ -1688,10 +1524,10 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .resolvedPeer(let _data): - return ("resolvedPeer", [("peer", _data.peer as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("resolvedPeer", [("peer", ConstructorParameterDescription(_data.peer)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1731,8 +1567,8 @@ public extension Api.contacts { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sponsoredPeers", [("peers", self.peers as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sponsoredPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case sponsoredPeers(Cons_sponsoredPeers) @@ -1768,10 +1604,10 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sponsoredPeers(let _data): - return ("sponsoredPeers", [("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("sponsoredPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) case .sponsoredPeersEmpty: return ("sponsoredPeersEmpty", []) } @@ -1816,8 +1652,8 @@ public extension Api.contacts { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("topPeers", [("categories", self.categories as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("topPeers", [("categories", ConstructorParameterDescription(self.categories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case topPeers(Cons_topPeers) @@ -1859,10 +1695,10 @@ public extension Api.contacts { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .topPeers(let _data): - return ("topPeers", [("categories", _data.categories as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("topPeers", [("categories", ConstructorParameterDescription(_data.categories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) case .topPeersDisabled: return ("topPeersDisabled", []) case .topPeersNotModified: @@ -1901,3 +1737,77 @@ public extension Api.contacts { } } } +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 + } + } + } +} diff --git a/submodules/TelegramApi/Sources/Api33.swift b/submodules/TelegramApi/Sources/Api33.swift index 4731174e83..d3b185ee7f 100644 --- a/submodules/TelegramApi/Sources/Api33.swift +++ b/submodules/TelegramApi/Sources/Api33.swift @@ -1,77 +1,3 @@ -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, Any)]) { - return ("collectibleInfo", [("purchaseDate", self.purchaseDate as Any), ("currency", self.currency as Any), ("amount", self.amount as Any), ("cryptoCurrency", self.cryptoCurrency as Any), ("cryptoAmount", self.cryptoAmount as Any), ("url", self.url as Any)]) - } - } - case collectibleInfo(Cons_collectibleInfo) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .collectibleInfo(let _data): - if boxed { - buffer.appendInt32(1857945489) - } - serializeInt32(_data.purchaseDate, buffer: buffer, boxed: false) - serializeString(_data.currency, buffer: buffer, boxed: false) - serializeInt64(_data.amount, buffer: buffer, boxed: false) - serializeString(_data.cryptoCurrency, buffer: buffer, boxed: false) - serializeInt64(_data.cryptoAmount, buffer: buffer, boxed: false) - serializeString(_data.url, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .collectibleInfo(let _data): - return ("collectibleInfo", [("purchaseDate", _data.purchaseDate as Any), ("currency", _data.currency as Any), ("amount", _data.amount as Any), ("cryptoCurrency", _data.cryptoCurrency as Any), ("cryptoAmount", _data.cryptoAmount as Any), ("url", _data.url as Any)]) - } - } - - public static func parse_collectibleInfo(_ reader: BufferReader) -> CollectibleInfo? { - var _1: Int32? - _1 = reader.readInt32() - 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 { @@ -81,8 +7,8 @@ public extension Api.help { self.hash = hash self.config = config } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("appConfig", [("hash", self.hash as Any), ("config", self.config as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("appConfig", [("hash", ConstructorParameterDescription(self.hash)), ("config", ConstructorParameterDescription(self.config))]) } } case appConfig(Cons_appConfig) @@ -105,10 +31,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .appConfig(let _data): - return ("appConfig", [("hash", _data.hash as Any), ("config", _data.config as Any)]) + return ("appConfig", [("hash", ConstructorParameterDescription(_data.hash)), ("config", ConstructorParameterDescription(_data.config))]) case .appConfigNotModified: return ("appConfigNotModified", []) } @@ -156,8 +82,8 @@ public extension Api.help { self.url = url self.sticker = sticker } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("appUpdate", [("flags", self.flags as Any), ("id", self.id as Any), ("version", self.version as Any), ("text", self.text as Any), ("entities", self.entities as Any), ("document", self.document as Any), ("url", self.url as Any), ("sticker", self.sticker as Any)]) + 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) @@ -196,10 +122,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .appUpdate(let _data): - return ("appUpdate", [("flags", _data.flags as Any), ("id", _data.id as Any), ("version", _data.version as Any), ("text", _data.text as Any), ("entities", _data.entities as Any), ("document", _data.document as Any), ("url", _data.url as Any), ("sticker", _data.sticker as Any)]) + 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", []) } @@ -263,8 +189,8 @@ public extension Api.help { self.countries = countries self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("countriesList", [("countries", self.countries as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("countriesList", [("countries", ConstructorParameterDescription(self.countries)), ("hash", ConstructorParameterDescription(self.hash))]) } } case countriesList(Cons_countriesList) @@ -291,10 +217,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .countriesList(let _data): - return ("countriesList", [("countries", _data.countries as Any), ("hash", _data.hash as Any)]) + return ("countriesList", [("countries", ConstructorParameterDescription(_data.countries)), ("hash", ConstructorParameterDescription(_data.hash))]) case .countriesListNotModified: return ("countriesListNotModified", []) } @@ -336,8 +262,8 @@ public extension Api.help { self.name = name self.countryCodes = countryCodes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("country", [("flags", self.flags as Any), ("iso2", self.iso2 as Any), ("defaultName", self.defaultName as Any), ("name", self.name as Any), ("countryCodes", self.countryCodes as Any)]) + 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) @@ -363,10 +289,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .country(let _data): - return ("country", [("flags", _data.flags as Any), ("iso2", _data.iso2 as Any), ("defaultName", _data.defaultName as Any), ("name", _data.name as Any), ("countryCodes", _data.countryCodes as Any)]) + return ("country", [("flags", ConstructorParameterDescription(_data.flags)), ("iso2", ConstructorParameterDescription(_data.iso2)), ("defaultName", ConstructorParameterDescription(_data.defaultName)), ("name", ConstructorParameterDescription(_data.name)), ("countryCodes", ConstructorParameterDescription(_data.countryCodes))]) } } @@ -412,8 +338,8 @@ public extension Api.help { self.prefixes = prefixes self.patterns = patterns } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("countryCode", [("flags", self.flags as Any), ("countryCode", self.countryCode as Any), ("prefixes", self.prefixes as Any), ("patterns", self.patterns as Any)]) + 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) @@ -444,10 +370,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .countryCode(let _data): - return ("countryCode", [("flags", _data.flags as Any), ("countryCode", _data.countryCode as Any), ("prefixes", _data.prefixes as Any), ("patterns", _data.patterns as Any)]) + return ("countryCode", [("flags", ConstructorParameterDescription(_data.flags)), ("countryCode", ConstructorParameterDescription(_data.countryCode)), ("prefixes", ConstructorParameterDescription(_data.prefixes)), ("patterns", ConstructorParameterDescription(_data.patterns))]) } } @@ -492,8 +418,8 @@ public extension Api.help { self.message = message self.entities = entities } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("deepLinkInfo", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("deepLinkInfo", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities))]) } } case deepLinkInfo(Cons_deepLinkInfo) @@ -523,10 +449,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .deepLinkInfo(let _data): - return ("deepLinkInfo", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any)]) + return ("deepLinkInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities))]) case .deepLinkInfoEmpty: return ("deepLinkInfoEmpty", []) } @@ -565,8 +491,8 @@ public extension Api.help { public init(message: String) { self.message = message } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inviteText", [("message", self.message as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inviteText", [("message", ConstructorParameterDescription(self.message))]) } } case inviteText(Cons_inviteText) @@ -582,10 +508,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inviteText(let _data): - return ("inviteText", [("message", _data.message as Any)]) + return ("inviteText", [("message", ConstructorParameterDescription(_data.message))]) } } @@ -611,8 +537,8 @@ public extension Api.help { self.hash = hash self.countriesLangs = countriesLangs } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("passportConfig", [("hash", self.hash as Any), ("countriesLangs", self.countriesLangs as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("passportConfig", [("hash", ConstructorParameterDescription(self.hash)), ("countriesLangs", ConstructorParameterDescription(self.countriesLangs))]) } } case passportConfig(Cons_passportConfig) @@ -635,10 +561,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .passportConfig(let _data): - return ("passportConfig", [("hash", _data.hash as Any), ("countriesLangs", _data.countriesLangs as Any)]) + return ("passportConfig", [("hash", ConstructorParameterDescription(_data.hash)), ("countriesLangs", ConstructorParameterDescription(_data.countriesLangs))]) case .passportConfigNotModified: return ("passportConfigNotModified", []) } @@ -682,8 +608,8 @@ public extension Api.help { self.channelMinLevel = channelMinLevel self.groupMinLevel = groupMinLevel } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerColorOption", [("flags", self.flags as Any), ("colorId", self.colorId as Any), ("colors", self.colors as Any), ("darkColors", self.darkColors as Any), ("channelMinLevel", self.channelMinLevel as Any), ("groupMinLevel", self.groupMinLevel as Any)]) + 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) @@ -712,10 +638,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerColorOption(let _data): - return ("peerColorOption", [("flags", _data.flags as Any), ("colorId", _data.colorId as Any), ("colors", _data.colors as Any), ("darkColors", _data.darkColors as Any), ("channelMinLevel", _data.channelMinLevel as Any), ("groupMinLevel", _data.groupMinLevel as Any)]) + 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))]) } } @@ -770,8 +696,8 @@ public extension Api.help { self.bgColors = bgColors self.storyColors = storyColors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerColorProfileSet", [("paletteColors", self.paletteColors as Any), ("bgColors", self.bgColors as Any), ("storyColors", self.storyColors as Any)]) + 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 { @@ -779,8 +705,8 @@ public extension Api.help { public init(colors: [Int32]) { self.colors = colors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerColorSet", [("colors", self.colors as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerColorSet", [("colors", ConstructorParameterDescription(self.colors))]) } } case peerColorProfileSet(Cons_peerColorProfileSet) @@ -821,12 +747,12 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerColorProfileSet(let _data): - return ("peerColorProfileSet", [("paletteColors", _data.paletteColors as Any), ("bgColors", _data.bgColors as Any), ("storyColors", _data.storyColors as Any)]) + return ("peerColorProfileSet", [("paletteColors", ConstructorParameterDescription(_data.paletteColors)), ("bgColors", ConstructorParameterDescription(_data.bgColors)), ("storyColors", ConstructorParameterDescription(_data.storyColors))]) case .peerColorSet(let _data): - return ("peerColorSet", [("colors", _data.colors as Any)]) + return ("peerColorSet", [("colors", ConstructorParameterDescription(_data.colors))]) } } @@ -877,8 +803,8 @@ public extension Api.help { self.hash = hash self.colors = colors } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerColors", [("hash", self.hash as Any), ("colors", self.colors as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerColors", [("hash", ConstructorParameterDescription(self.hash)), ("colors", ConstructorParameterDescription(self.colors))]) } } case peerColors(Cons_peerColors) @@ -905,10 +831,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerColors(let _data): - return ("peerColors", [("hash", _data.hash as Any), ("colors", _data.colors as Any)]) + return ("peerColors", [("hash", ConstructorParameterDescription(_data.hash)), ("colors", ConstructorParameterDescription(_data.colors))]) case .peerColorsNotModified: return ("peerColorsNotModified", []) } @@ -952,8 +878,8 @@ public extension Api.help { self.periodOptions = periodOptions self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("premiumPromo", [("statusText", self.statusText as Any), ("statusEntities", self.statusEntities as Any), ("videoSections", self.videoSections as Any), ("videos", self.videos as Any), ("periodOptions", self.periodOptions as Any), ("users", self.users as Any)]) + 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) @@ -994,10 +920,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .premiumPromo(let _data): - return ("premiumPromo", [("statusText", _data.statusText as Any), ("statusEntities", _data.statusEntities as Any), ("videoSections", _data.videoSections as Any), ("videos", _data.videos as Any), ("periodOptions", _data.periodOptions as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1064,8 +990,8 @@ public extension Api.help { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("promoData", [("flags", self.flags as Any), ("expires", self.expires as Any), ("peer", self.peer as Any), ("psaType", self.psaType as Any), ("psaMessage", self.psaMessage as Any), ("pendingSuggestions", self.pendingSuggestions as Any), ("dismissedSuggestions", self.dismissedSuggestions as Any), ("customPendingSuggestion", self.customPendingSuggestion as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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 { @@ -1073,8 +999,8 @@ public extension Api.help { public init(expires: Int32) { self.expires = expires } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("promoDataEmpty", [("expires", self.expires as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("promoDataEmpty", [("expires", ConstructorParameterDescription(self.expires))]) } } case promoData(Cons_promoData) @@ -1130,12 +1056,12 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .promoData(let _data): - return ("promoData", [("flags", _data.flags as Any), ("expires", _data.expires as Any), ("peer", _data.peer as Any), ("psaType", _data.psaType as Any), ("psaMessage", _data.psaMessage as Any), ("pendingSuggestions", _data.pendingSuggestions as Any), ("dismissedSuggestions", _data.dismissedSuggestions as Any), ("customPendingSuggestion", _data.customPendingSuggestion as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", _data.expires as Any)]) + return ("promoDataEmpty", [("expires", ConstructorParameterDescription(_data.expires))]) } } @@ -1221,8 +1147,8 @@ public extension Api.help { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentMeUrls", [("urls", self.urls as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("recentMeUrls", [("urls", ConstructorParameterDescription(self.urls)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case recentMeUrls(Cons_recentMeUrls) @@ -1252,10 +1178,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .recentMeUrls(let _data): - return ("recentMeUrls", [("urls", _data.urls as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("recentMeUrls", [("urls", ConstructorParameterDescription(_data.urls)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1293,8 +1219,8 @@ public extension Api.help { self.phoneNumber = phoneNumber self.user = user } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("support", [("phoneNumber", self.phoneNumber as Any), ("user", self.user as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("support", [("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("user", ConstructorParameterDescription(self.user))]) } } case support(Cons_support) @@ -1311,10 +1237,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .support(let _data): - return ("support", [("phoneNumber", _data.phoneNumber as Any), ("user", _data.user as Any)]) + return ("support", [("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("user", ConstructorParameterDescription(_data.user))]) } } @@ -1343,8 +1269,8 @@ public extension Api.help { public init(name: String) { self.name = name } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("supportName", [("name", self.name as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("supportName", [("name", ConstructorParameterDescription(self.name))]) } } case supportName(Cons_supportName) @@ -1360,10 +1286,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .supportName(let _data): - return ("supportName", [("name", _data.name as Any)]) + return ("supportName", [("name", ConstructorParameterDescription(_data.name))]) } } @@ -1395,8 +1321,8 @@ public extension Api.help { self.entities = entities self.minAgeConfirm = minAgeConfirm } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("termsOfService", [("flags", self.flags as Any), ("id", self.id as Any), ("text", self.text as Any), ("entities", self.entities as Any), ("minAgeConfirm", self.minAgeConfirm as Any)]) + 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) @@ -1422,10 +1348,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .termsOfService(let _data): - return ("termsOfService", [("flags", _data.flags as Any), ("id", _data.id as Any), ("text", _data.text as Any), ("entities", _data.entities as Any), ("minAgeConfirm", _data.minAgeConfirm as Any)]) + return ("termsOfService", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("text", ConstructorParameterDescription(_data.text)), ("entities", ConstructorParameterDescription(_data.entities)), ("minAgeConfirm", ConstructorParameterDescription(_data.minAgeConfirm))]) } } @@ -1469,8 +1395,8 @@ public extension Api.help { self.expires = expires self.termsOfService = termsOfService } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("termsOfServiceUpdate", [("expires", self.expires as Any), ("termsOfService", self.termsOfService as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("termsOfServiceUpdate", [("expires", ConstructorParameterDescription(self.expires)), ("termsOfService", ConstructorParameterDescription(self.termsOfService))]) } } public class Cons_termsOfServiceUpdateEmpty: TypeConstructorDescription { @@ -1478,8 +1404,8 @@ public extension Api.help { public init(expires: Int32) { self.expires = expires } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("termsOfServiceUpdateEmpty", [("expires", self.expires as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("termsOfServiceUpdateEmpty", [("expires", ConstructorParameterDescription(self.expires))]) } } case termsOfServiceUpdate(Cons_termsOfServiceUpdate) @@ -1503,12 +1429,12 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .termsOfServiceUpdate(let _data): - return ("termsOfServiceUpdate", [("expires", _data.expires as Any), ("termsOfService", _data.termsOfService as Any)]) + return ("termsOfServiceUpdate", [("expires", ConstructorParameterDescription(_data.expires)), ("termsOfService", ConstructorParameterDescription(_data.termsOfService))]) case .termsOfServiceUpdateEmpty(let _data): - return ("termsOfServiceUpdateEmpty", [("expires", _data.expires as Any)]) + return ("termsOfServiceUpdateEmpty", [("expires", ConstructorParameterDescription(_data.expires))]) } } @@ -1550,8 +1476,8 @@ public extension Api.help { self.timezones = timezones self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("timezonesList", [("timezones", self.timezones as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("timezonesList", [("timezones", ConstructorParameterDescription(self.timezones)), ("hash", ConstructorParameterDescription(self.hash))]) } } case timezonesList(Cons_timezonesList) @@ -1578,10 +1504,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .timezonesList(let _data): - return ("timezonesList", [("timezones", _data.timezones as Any), ("hash", _data.hash as Any)]) + return ("timezonesList", [("timezones", ConstructorParameterDescription(_data.timezones)), ("hash", ConstructorParameterDescription(_data.hash))]) case .timezonesListNotModified: return ("timezonesListNotModified", []) } @@ -1621,8 +1547,8 @@ public extension Api.help { self.author = author self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userInfo", [("message", self.message as Any), ("entities", self.entities as Any), ("author", self.author as Any), ("date", self.date as Any)]) + 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) @@ -1651,10 +1577,10 @@ public extension Api.help { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .userInfo(let _data): - return ("userInfo", [("message", _data.message as Any), ("entities", _data.entities as Any), ("author", _data.author as Any), ("date", _data.date as Any)]) + return ("userInfo", [("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("author", ConstructorParameterDescription(_data.author)), ("date", ConstructorParameterDescription(_data.date))]) case .userInfoEmpty: return ("userInfoEmpty", []) } @@ -1687,3 +1613,71 @@ public extension Api.help { } } } +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.AffectedFoundMessages.affectedFoundMessages(Cons_affectedFoundMessages(pts: _1!, ptsCount: _2!, offset: _3!, messages: _4!)) + } + else { + return nil + } + } + } +} diff --git a/submodules/TelegramApi/Sources/Api34.swift b/submodules/TelegramApi/Sources/Api34.swift index 9d2d80cd3f..f03ad72730 100644 --- a/submodules/TelegramApi/Sources/Api34.swift +++ b/submodules/TelegramApi/Sources/Api34.swift @@ -1,71 +1,3 @@ -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, Any)]) { - return ("affectedFoundMessages", [("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("offset", self.offset as Any), ("messages", self.messages as Any)]) - } - } - case affectedFoundMessages(Cons_affectedFoundMessages) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .affectedFoundMessages(let _data): - if boxed { - buffer.appendInt32(-275956116) - } - serializeInt32(_data.pts, buffer: buffer, boxed: false) - serializeInt32(_data.ptsCount, buffer: buffer, boxed: false) - serializeInt32(_data.offset, buffer: buffer, boxed: false) - buffer.appendInt32(481674261) - buffer.appendInt32(Int32(_data.messages.count)) - for item in _data.messages { - serializeInt32(item, buffer: buffer, boxed: false) - } - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .affectedFoundMessages(let _data): - return ("affectedFoundMessages", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("offset", _data.offset as Any), ("messages", _data.messages as Any)]) - } - } - - public static func parse_affectedFoundMessages(_ reader: BufferReader) -> AffectedFoundMessages? { - var _1: Int32? - _1 = reader.readInt32() - 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.AffectedFoundMessages.affectedFoundMessages(Cons_affectedFoundMessages(pts: _1!, ptsCount: _2!, offset: _3!, messages: _4!)) - } - else { - return nil - } - } - } -} public extension Api.messages { enum AffectedHistory: TypeConstructorDescription { public class Cons_affectedHistory: TypeConstructorDescription { @@ -77,8 +9,8 @@ public extension Api.messages { self.ptsCount = ptsCount self.offset = offset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("affectedHistory", [("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any), ("offset", self.offset as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("affectedHistory", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount)), ("offset", ConstructorParameterDescription(self.offset))]) } } case affectedHistory(Cons_affectedHistory) @@ -96,10 +28,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .affectedHistory(let _data): - return ("affectedHistory", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any), ("offset", _data.offset as Any)]) + return ("affectedHistory", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount)), ("offset", ConstructorParameterDescription(_data.offset))]) } } @@ -131,8 +63,8 @@ public extension Api.messages { self.pts = pts self.ptsCount = ptsCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("affectedMessages", [("pts", self.pts as Any), ("ptsCount", self.ptsCount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("affectedMessages", [("pts", ConstructorParameterDescription(self.pts)), ("ptsCount", ConstructorParameterDescription(self.ptsCount))]) } } case affectedMessages(Cons_affectedMessages) @@ -149,10 +81,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .affectedMessages(let _data): - return ("affectedMessages", [("pts", _data.pts as Any), ("ptsCount", _data.ptsCount as Any)]) + return ("affectedMessages", [("pts", ConstructorParameterDescription(_data.pts)), ("ptsCount", ConstructorParameterDescription(_data.ptsCount))]) } } @@ -181,8 +113,8 @@ public extension Api.messages { self.hash = hash self.sets = sets } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("allStickers", [("hash", self.hash as Any), ("sets", self.sets as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("allStickers", [("hash", ConstructorParameterDescription(self.hash)), ("sets", ConstructorParameterDescription(self.sets))]) } } case allStickers(Cons_allStickers) @@ -209,10 +141,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .allStickers(let _data): - return ("allStickers", [("hash", _data.hash as Any), ("sets", _data.sets as Any)]) + return ("allStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("sets", ConstructorParameterDescription(_data.sets))]) case .allStickersNotModified: return ("allStickersNotModified", []) } @@ -248,8 +180,8 @@ public extension Api.messages { self.count = count self.sets = sets } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("archivedStickers", [("count", self.count as Any), ("sets", self.sets as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("archivedStickers", [("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.sets))]) } } case archivedStickers(Cons_archivedStickers) @@ -270,10 +202,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .archivedStickers(let _data): - return ("archivedStickers", [("count", _data.count as Any), ("sets", _data.sets as Any)]) + return ("archivedStickers", [("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets))]) } } @@ -306,8 +238,8 @@ public extension Api.messages { self.effects = effects self.documents = documents } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("availableEffects", [("hash", self.hash as Any), ("effects", self.effects as Any), ("documents", self.documents as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("availableEffects", [("hash", ConstructorParameterDescription(self.hash)), ("effects", ConstructorParameterDescription(self.effects)), ("documents", ConstructorParameterDescription(self.documents))]) } } case availableEffects(Cons_availableEffects) @@ -339,10 +271,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .availableEffects(let _data): - return ("availableEffects", [("hash", _data.hash as Any), ("effects", _data.effects as Any), ("documents", _data.documents as Any)]) + return ("availableEffects", [("hash", ConstructorParameterDescription(_data.hash)), ("effects", ConstructorParameterDescription(_data.effects)), ("documents", ConstructorParameterDescription(_data.documents))]) case .availableEffectsNotModified: return ("availableEffectsNotModified", []) } @@ -383,8 +315,8 @@ public extension Api.messages { self.hash = hash self.reactions = reactions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("availableReactions", [("hash", self.hash as Any), ("reactions", self.reactions as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("availableReactions", [("hash", ConstructorParameterDescription(self.hash)), ("reactions", ConstructorParameterDescription(self.reactions))]) } } case availableReactions(Cons_availableReactions) @@ -411,10 +343,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .availableReactions(let _data): - return ("availableReactions", [("hash", _data.hash as Any), ("reactions", _data.reactions as Any)]) + return ("availableReactions", [("hash", ConstructorParameterDescription(_data.hash)), ("reactions", ConstructorParameterDescription(_data.reactions))]) case .availableReactionsNotModified: return ("availableReactionsNotModified", []) } @@ -450,8 +382,8 @@ public extension Api.messages { self.flags = flags self.app = app } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botApp", [("flags", self.flags as Any), ("app", self.app as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botApp", [("flags", ConstructorParameterDescription(self.flags)), ("app", ConstructorParameterDescription(self.app))]) } } case botApp(Cons_botApp) @@ -468,10 +400,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botApp(let _data): - return ("botApp", [("flags", _data.flags as Any), ("app", _data.app as Any)]) + return ("botApp", [("flags", ConstructorParameterDescription(_data.flags)), ("app", ConstructorParameterDescription(_data.app))]) } } @@ -506,8 +438,8 @@ public extension Api.messages { self.url = url self.cacheTime = cacheTime } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botCallbackAnswer", [("flags", self.flags as Any), ("message", self.message as Any), ("url", self.url as Any), ("cacheTime", self.cacheTime as Any)]) + 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) @@ -530,10 +462,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botCallbackAnswer(let _data): - return ("botCallbackAnswer", [("flags", _data.flags as Any), ("message", _data.message as Any), ("url", _data.url as Any), ("cacheTime", _data.cacheTime as Any)]) + return ("botCallbackAnswer", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("url", ConstructorParameterDescription(_data.url)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime))]) } } @@ -572,8 +504,8 @@ public extension Api.messages { self.id = id self.expireDate = expireDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botPreparedInlineMessage", [("id", self.id as Any), ("expireDate", self.expireDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("botPreparedInlineMessage", [("id", ConstructorParameterDescription(self.id)), ("expireDate", ConstructorParameterDescription(self.expireDate))]) } } case botPreparedInlineMessage(Cons_botPreparedInlineMessage) @@ -590,10 +522,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botPreparedInlineMessage(let _data): - return ("botPreparedInlineMessage", [("id", _data.id as Any), ("expireDate", _data.expireDate as Any)]) + return ("botPreparedInlineMessage", [("id", ConstructorParameterDescription(_data.id)), ("expireDate", ConstructorParameterDescription(_data.expireDate))]) } } @@ -634,8 +566,8 @@ public extension Api.messages { self.cacheTime = cacheTime self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("botResults", [("flags", self.flags as Any), ("queryId", self.queryId as Any), ("nextOffset", self.nextOffset as Any), ("switchPm", self.switchPm as Any), ("switchWebview", self.switchWebview as Any), ("results", self.results as Any), ("cacheTime", self.cacheTime as Any), ("users", self.users as Any)]) + 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) @@ -672,10 +604,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .botResults(let _data): - return ("botResults", [("flags", _data.flags as Any), ("queryId", _data.queryId as Any), ("nextOffset", _data.nextOffset as Any), ("switchPm", _data.switchPm as Any), ("switchWebview", _data.switchWebview as Any), ("results", _data.results as Any), ("cacheTime", _data.cacheTime as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -736,8 +668,8 @@ public extension Api.messages { self.admins = admins self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatAdminsWithInvites", [("admins", self.admins as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatAdminsWithInvites", [("admins", ConstructorParameterDescription(self.admins)), ("users", ConstructorParameterDescription(self.users))]) } } case chatAdminsWithInvites(Cons_chatAdminsWithInvites) @@ -762,10 +694,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatAdminsWithInvites(let _data): - return ("chatAdminsWithInvites", [("admins", _data.admins as Any), ("users", _data.users as Any)]) + return ("chatAdminsWithInvites", [("admins", ConstructorParameterDescription(_data.admins)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -800,8 +732,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatFull", [("fullChat", self.fullChat as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatFull", [("fullChat", ConstructorParameterDescription(self.fullChat)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case chatFull(Cons_chatFull) @@ -827,10 +759,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatFull(let _data): - return ("chatFull", [("fullChat", _data.fullChat as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("chatFull", [("fullChat", ConstructorParameterDescription(_data.fullChat)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -870,8 +802,8 @@ public extension Api.messages { self.importers = importers self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatInviteImporters", [("count", self.count as Any), ("importers", self.importers as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInviteImporters", [("count", ConstructorParameterDescription(self.count)), ("importers", ConstructorParameterDescription(self.importers)), ("users", ConstructorParameterDescription(self.users))]) } } case chatInviteImporters(Cons_chatInviteImporters) @@ -897,10 +829,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatInviteImporters(let _data): - return ("chatInviteImporters", [("count", _data.count as Any), ("importers", _data.importers as Any), ("users", _data.users as Any)]) + return ("chatInviteImporters", [("count", ConstructorParameterDescription(_data.count)), ("importers", ConstructorParameterDescription(_data.importers)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -934,8 +866,8 @@ public extension Api.messages { public init(chats: [Api.Chat]) { self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chats", [("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chats", [("chats", ConstructorParameterDescription(self.chats))]) } } public class Cons_chatsSlice: TypeConstructorDescription { @@ -945,8 +877,8 @@ public extension Api.messages { self.count = count self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatsSlice", [("count", self.count as Any), ("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatsSlice", [("count", ConstructorParameterDescription(self.count)), ("chats", ConstructorParameterDescription(self.chats))]) } } case chats(Cons_chats) @@ -978,12 +910,12 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chats(let _data): - return ("chats", [("chats", _data.chats as Any)]) + return ("chats", [("chats", ConstructorParameterDescription(_data.chats))]) case .chatsSlice(let _data): - return ("chatsSlice", [("count", _data.count as Any), ("chats", _data.chats as Any)]) + return ("chatsSlice", [("count", ConstructorParameterDescription(_data.count)), ("chats", ConstructorParameterDescription(_data.chats))]) } } @@ -1025,8 +957,8 @@ public extension Api.messages { public init(confirmText: String) { self.confirmText = confirmText } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("checkedHistoryImportPeer", [("confirmText", self.confirmText as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("checkedHistoryImportPeer", [("confirmText", ConstructorParameterDescription(self.confirmText))]) } } case checkedHistoryImportPeer(Cons_checkedHistoryImportPeer) @@ -1042,10 +974,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .checkedHistoryImportPeer(let _data): - return ("checkedHistoryImportPeer", [("confirmText", _data.confirmText as Any)]) + return ("checkedHistoryImportPeer", [("confirmText", ConstructorParameterDescription(_data.confirmText))]) } } @@ -1073,8 +1005,8 @@ public extension Api.messages { self.resultText = resultText self.diffText = diffText } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("composedMessageWithAI", [("flags", self.flags as Any), ("resultText", self.resultText as Any), ("diffText", self.diffText as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("composedMessageWithAI", [("flags", ConstructorParameterDescription(self.flags)), ("resultText", ConstructorParameterDescription(self.resultText)), ("diffText", ConstructorParameterDescription(self.diffText))]) } } case composedMessageWithAI(Cons_composedMessageWithAI) @@ -1094,10 +1026,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .composedMessageWithAI(let _data): - return ("composedMessageWithAI", [("flags", _data.flags as Any), ("resultText", _data.resultText as Any), ("diffText", _data.diffText as Any)]) + return ("composedMessageWithAI", [("flags", ConstructorParameterDescription(_data.flags)), ("resultText", ConstructorParameterDescription(_data.resultText)), ("diffText", ConstructorParameterDescription(_data.diffText))]) } } @@ -1139,8 +1071,8 @@ public extension Api.messages { self.version = version self.random = random } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dhConfig", [("g", self.g as Any), ("p", self.p as Any), ("version", self.version as Any), ("random", self.random as Any)]) + 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 { @@ -1148,8 +1080,8 @@ public extension Api.messages { public init(random: Buffer) { self.random = random } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dhConfigNotModified", [("random", self.random as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dhConfigNotModified", [("random", ConstructorParameterDescription(self.random))]) } } case dhConfig(Cons_dhConfig) @@ -1175,12 +1107,12 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dhConfig(let _data): - return ("dhConfig", [("g", _data.g as Any), ("p", _data.p as Any), ("version", _data.version as Any), ("random", _data.random as Any)]) + 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", _data.random as Any)]) + return ("dhConfigNotModified", [("random", ConstructorParameterDescription(_data.random))]) } } @@ -1226,8 +1158,8 @@ public extension Api.messages { self.flags = flags self.filters = filters } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogFilters", [("flags", self.flags as Any), ("filters", self.filters as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogFilters", [("flags", ConstructorParameterDescription(self.flags)), ("filters", ConstructorParameterDescription(self.filters))]) } } case dialogFilters(Cons_dialogFilters) @@ -1248,10 +1180,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dialogFilters(let _data): - return ("dialogFilters", [("flags", _data.flags as Any), ("filters", _data.filters as Any)]) + return ("dialogFilters", [("flags", ConstructorParameterDescription(_data.flags)), ("filters", ConstructorParameterDescription(_data.filters))]) } } @@ -1286,8 +1218,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogs", [("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogs", [("dialogs", ConstructorParameterDescription(self.dialogs)), ("messages", ConstructorParameterDescription(self.messages)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } public class Cons_dialogsNotModified: TypeConstructorDescription { @@ -1295,8 +1227,8 @@ public extension Api.messages { public init(count: Int32) { self.count = count } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogsNotModified", [("count", self.count as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogsNotModified", [("count", ConstructorParameterDescription(self.count))]) } } public class Cons_dialogsSlice: TypeConstructorDescription { @@ -1312,8 +1244,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogsSlice", [("count", self.count as Any), ("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1382,14 +1314,14 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dialogs(let _data): - return ("dialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", _data.count as Any)]) + return ("dialogsNotModified", [("count", ConstructorParameterDescription(_data.count))]) case .dialogsSlice(let _data): - return ("dialogsSlice", [("count", _data.count as Any), ("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("dialogsSlice", [("count", ConstructorParameterDescription(_data.count)), ("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1486,8 +1418,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("discussionMessage", [("flags", self.flags as Any), ("messages", self.messages as Any), ("maxId", self.maxId as Any), ("readInboxMaxId", self.readInboxMaxId as Any), ("readOutboxMaxId", self.readOutboxMaxId as Any), ("unreadCount", self.unreadCount as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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))]) } } case discussionMessage(Cons_discussionMessage) @@ -1528,10 +1460,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .discussionMessage(let _data): - return ("discussionMessage", [("flags", _data.flags as Any), ("messages", _data.messages as Any), ("maxId", _data.maxId as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1598,8 +1530,8 @@ public extension Api.messages { self.params = params self.playsLeft = playsLeft } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiGameDiceInfo", [("flags", self.flags as Any), ("gameHash", self.gameHash as Any), ("prevStake", self.prevStake as Any), ("currentStreak", self.currentStreak as Any), ("params", self.params as Any), ("playsLeft", self.playsLeft as Any)]) + 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) @@ -1632,10 +1564,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiGameDiceInfo(let _data): - return ("emojiGameDiceInfo", [("flags", _data.flags as Any), ("gameHash", _data.gameHash as Any), ("prevStake", _data.prevStake as Any), ("currentStreak", _data.currentStreak as Any), ("params", _data.params as Any), ("playsLeft", _data.playsLeft as Any)]) + 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", []) } @@ -1687,8 +1619,8 @@ public extension Api.messages { self.stakeTonAmount = stakeTonAmount self.tonAmount = tonAmount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiGameOutcome", [("seed", self.seed as Any), ("stakeTonAmount", self.stakeTonAmount as Any), ("tonAmount", self.tonAmount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiGameOutcome", [("seed", ConstructorParameterDescription(self.seed)), ("stakeTonAmount", ConstructorParameterDescription(self.stakeTonAmount)), ("tonAmount", ConstructorParameterDescription(self.tonAmount))]) } } case emojiGameOutcome(Cons_emojiGameOutcome) @@ -1706,10 +1638,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiGameOutcome(let _data): - return ("emojiGameOutcome", [("seed", _data.seed as Any), ("stakeTonAmount", _data.stakeTonAmount as Any), ("tonAmount", _data.tonAmount as Any)]) + return ("emojiGameOutcome", [("seed", ConstructorParameterDescription(_data.seed)), ("stakeTonAmount", ConstructorParameterDescription(_data.stakeTonAmount)), ("tonAmount", ConstructorParameterDescription(_data.tonAmount))]) } } @@ -1741,8 +1673,8 @@ public extension Api.messages { self.hash = hash self.groups = groups } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiGroups", [("hash", self.hash as Any), ("groups", self.groups as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiGroups", [("hash", ConstructorParameterDescription(self.hash)), ("groups", ConstructorParameterDescription(self.groups))]) } } case emojiGroups(Cons_emojiGroups) @@ -1769,10 +1701,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiGroups(let _data): - return ("emojiGroups", [("hash", _data.hash as Any), ("groups", _data.groups as Any)]) + return ("emojiGroups", [("hash", ConstructorParameterDescription(_data.hash)), ("groups", ConstructorParameterDescription(_data.groups))]) case .emojiGroupsNotModified: return ("emojiGroupsNotModified", []) } diff --git a/submodules/TelegramApi/Sources/Api35.swift b/submodules/TelegramApi/Sources/Api35.swift index 4c246713c5..15431344d4 100644 --- a/submodules/TelegramApi/Sources/Api35.swift +++ b/submodules/TelegramApi/Sources/Api35.swift @@ -7,8 +7,8 @@ public extension Api.messages { self.invite = invite self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedChatInvite", [("invite", self.invite as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedChatInvite", [("invite", ConstructorParameterDescription(self.invite)), ("users", ConstructorParameterDescription(self.users))]) } } public class Cons_exportedChatInviteReplaced: TypeConstructorDescription { @@ -20,8 +20,8 @@ public extension Api.messages { self.newInvite = newInvite self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedChatInviteReplaced", [("invite", self.invite as Any), ("newInvite", self.newInvite as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedChatInviteReplaced", [("invite", ConstructorParameterDescription(self.invite)), ("newInvite", ConstructorParameterDescription(self.newInvite)), ("users", ConstructorParameterDescription(self.users))]) } } case exportedChatInvite(Cons_exportedChatInvite) @@ -55,12 +55,12 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedChatInvite(let _data): - return ("exportedChatInvite", [("invite", _data.invite as Any), ("users", _data.users as Any)]) + return ("exportedChatInvite", [("invite", ConstructorParameterDescription(_data.invite)), ("users", ConstructorParameterDescription(_data.users))]) case .exportedChatInviteReplaced(let _data): - return ("exportedChatInviteReplaced", [("invite", _data.invite as Any), ("newInvite", _data.newInvite as Any), ("users", _data.users as Any)]) + return ("exportedChatInviteReplaced", [("invite", ConstructorParameterDescription(_data.invite)), ("newInvite", ConstructorParameterDescription(_data.newInvite)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -118,8 +118,8 @@ public extension Api.messages { self.invites = invites self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedChatInvites", [("count", self.count as Any), ("invites", self.invites as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedChatInvites", [("count", ConstructorParameterDescription(self.count)), ("invites", ConstructorParameterDescription(self.invites)), ("users", ConstructorParameterDescription(self.users))]) } } case exportedChatInvites(Cons_exportedChatInvites) @@ -145,10 +145,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedChatInvites(let _data): - return ("exportedChatInvites", [("count", _data.count as Any), ("invites", _data.invites as Any), ("users", _data.users as Any)]) + return ("exportedChatInvites", [("count", ConstructorParameterDescription(_data.count)), ("invites", ConstructorParameterDescription(_data.invites)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -186,8 +186,8 @@ public extension Api.messages { self.packs = packs self.stickers = stickers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("favedStickers", [("hash", self.hash as Any), ("packs", self.packs as Any), ("stickers", self.stickers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("favedStickers", [("hash", ConstructorParameterDescription(self.hash)), ("packs", ConstructorParameterDescription(self.packs)), ("stickers", ConstructorParameterDescription(self.stickers))]) } } case favedStickers(Cons_favedStickers) @@ -219,10 +219,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .favedStickers(let _data): - return ("favedStickers", [("hash", _data.hash as Any), ("packs", _data.packs as Any), ("stickers", _data.stickers as Any)]) + return ("favedStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("packs", ConstructorParameterDescription(_data.packs)), ("stickers", ConstructorParameterDescription(_data.stickers))]) case .favedStickersNotModified: return ("favedStickersNotModified", []) } @@ -269,8 +269,8 @@ public extension Api.messages { self.sets = sets self.unread = unread } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("featuredStickers", [("flags", self.flags as Any), ("hash", self.hash as Any), ("count", self.count as Any), ("sets", self.sets as Any), ("unread", self.unread as Any)]) + 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 { @@ -278,8 +278,8 @@ public extension Api.messages { public init(count: Int32) { self.count = count } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("featuredStickersNotModified", [("count", self.count as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("featuredStickersNotModified", [("count", ConstructorParameterDescription(self.count))]) } } case featuredStickers(Cons_featuredStickers) @@ -314,12 +314,12 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .featuredStickers(let _data): - return ("featuredStickers", [("flags", _data.flags as Any), ("hash", _data.hash as Any), ("count", _data.count as Any), ("sets", _data.sets as Any), ("unread", _data.unread as Any)]) + 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", _data.count as Any)]) + return ("featuredStickersNotModified", [("count", ConstructorParameterDescription(_data.count))]) } } @@ -382,8 +382,8 @@ public extension Api.messages { self.users = users self.pts = pts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("forumTopics", [("flags", self.flags as Any), ("count", self.count as Any), ("topics", self.topics as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("pts", self.pts as Any)]) + 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) @@ -421,10 +421,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .forumTopics(let _data): - return ("forumTopics", [("flags", _data.flags as Any), ("count", _data.count as Any), ("topics", _data.topics as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("pts", _data.pts as Any)]) + 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))]) } } @@ -476,8 +476,8 @@ public extension Api.messages { self.hash = hash self.sets = sets } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("foundStickerSets", [("hash", self.hash as Any), ("sets", self.sets as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("foundStickerSets", [("hash", ConstructorParameterDescription(self.hash)), ("sets", ConstructorParameterDescription(self.sets))]) } } case foundStickerSets(Cons_foundStickerSets) @@ -504,10 +504,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .foundStickerSets(let _data): - return ("foundStickerSets", [("hash", _data.hash as Any), ("sets", _data.sets as Any)]) + return ("foundStickerSets", [("hash", ConstructorParameterDescription(_data.hash)), ("sets", ConstructorParameterDescription(_data.sets))]) case .foundStickerSetsNotModified: return ("foundStickerSetsNotModified", []) } @@ -547,8 +547,8 @@ public extension Api.messages { self.hash = hash self.stickers = stickers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("foundStickers", [("flags", self.flags as Any), ("nextOffset", self.nextOffset as Any), ("hash", self.hash as Any), ("stickers", self.stickers as Any)]) + 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 { @@ -558,8 +558,8 @@ public extension Api.messages { self.flags = flags self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("foundStickersNotModified", [("flags", self.flags as Any), ("nextOffset", self.nextOffset as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("foundStickersNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("nextOffset", ConstructorParameterDescription(self.nextOffset))]) } } case foundStickers(Cons_foundStickers) @@ -594,12 +594,12 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .foundStickers(let _data): - return ("foundStickers", [("flags", _data.flags as Any), ("nextOffset", _data.nextOffset as Any), ("hash", _data.hash as Any), ("stickers", _data.stickers as Any)]) + 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", _data.flags as Any), ("nextOffset", _data.nextOffset as Any)]) + return ("foundStickersNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) } } @@ -654,8 +654,8 @@ public extension Api.messages { self.scores = scores self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("highScores", [("scores", self.scores as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("highScores", [("scores", ConstructorParameterDescription(self.scores)), ("users", ConstructorParameterDescription(self.users))]) } } case highScores(Cons_highScores) @@ -680,10 +680,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .highScores(let _data): - return ("highScores", [("scores", _data.scores as Any), ("users", _data.users as Any)]) + return ("highScores", [("scores", ConstructorParameterDescription(_data.scores)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -714,8 +714,8 @@ public extension Api.messages { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("historyImport", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("historyImport", [("id", ConstructorParameterDescription(self.id))]) } } case historyImport(Cons_historyImport) @@ -731,10 +731,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .historyImport(let _data): - return ("historyImport", [("id", _data.id as Any)]) + return ("historyImport", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -760,8 +760,8 @@ public extension Api.messages { self.flags = flags self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("historyImportParsed", [("flags", self.flags as Any), ("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("historyImportParsed", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title))]) } } case historyImportParsed(Cons_historyImportParsed) @@ -780,10 +780,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .historyImportParsed(let _data): - return ("historyImportParsed", [("flags", _data.flags as Any), ("title", _data.title as Any)]) + return ("historyImportParsed", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title))]) } } @@ -816,8 +816,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inactiveChats", [("dates", self.dates as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inactiveChats", [("dates", ConstructorParameterDescription(self.dates)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case inactiveChats(Cons_inactiveChats) @@ -847,10 +847,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inactiveChats(let _data): - return ("inactiveChats", [("dates", _data.dates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("inactiveChats", [("dates", ConstructorParameterDescription(_data.dates)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -888,8 +888,8 @@ public extension Api.messages { self.updates = updates self.missingInvitees = missingInvitees } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("invitedUsers", [("updates", self.updates as Any), ("missingInvitees", self.missingInvitees as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("invitedUsers", [("updates", ConstructorParameterDescription(self.updates)), ("missingInvitees", ConstructorParameterDescription(self.missingInvitees))]) } } case invitedUsers(Cons_invitedUsers) @@ -910,10 +910,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .invitedUsers(let _data): - return ("invitedUsers", [("updates", _data.updates as Any), ("missingInvitees", _data.missingInvitees as Any)]) + return ("invitedUsers", [("updates", ConstructorParameterDescription(_data.updates)), ("missingInvitees", ConstructorParameterDescription(_data.missingInvitees))]) } } @@ -944,8 +944,8 @@ public extension Api.messages { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageEditData", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageEditData", [("flags", ConstructorParameterDescription(self.flags))]) } } case messageEditData(Cons_messageEditData) @@ -961,10 +961,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageEditData(let _data): - return ("messageEditData", [("flags", _data.flags as Any)]) + return ("messageEditData", [("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -998,8 +998,8 @@ public extension Api.messages { self.users = users self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageReactionsList", [("flags", self.flags as Any), ("count", self.count as Any), ("reactions", self.reactions as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("nextOffset", self.nextOffset as Any)]) + 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))]) } } case messageReactionsList(Cons_messageReactionsList) @@ -1034,10 +1034,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageReactionsList(let _data): - return ("messageReactionsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("reactions", _data.reactions as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + 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))]) } } @@ -1088,8 +1088,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageViews", [("views", self.views as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageViews", [("views", ConstructorParameterDescription(self.views)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case messageViews(Cons_messageViews) @@ -1119,10 +1119,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageViews(let _data): - return ("messageViews", [("views", _data.views as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("messageViews", [("views", ConstructorParameterDescription(_data.views)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1172,8 +1172,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelMessages", [("flags", self.flags as Any), ("pts", self.pts as Any), ("count", self.count as Any), ("offsetIdOffset", self.offsetIdOffset as Any), ("messages", self.messages as Any), ("topics", self.topics as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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 { @@ -1187,8 +1187,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messages", [("messages", self.messages as Any), ("topics", self.topics as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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 { @@ -1196,8 +1196,8 @@ public extension Api.messages { public init(count: Int32) { self.count = count } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messagesNotModified", [("count", self.count as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messagesNotModified", [("count", ConstructorParameterDescription(self.count))]) } } public class Cons_messagesSlice: TypeConstructorDescription { @@ -1221,8 +1221,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messagesSlice", [("flags", self.flags as Any), ("count", self.count as Any), ("nextRate", self.nextRate as Any), ("offsetIdOffset", self.offsetIdOffset as Any), ("searchFlood", self.searchFlood as Any), ("messages", self.messages as Any), ("topics", self.topics as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1333,16 +1333,16 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelMessages(let _data): - return ("channelMessages", [("flags", _data.flags as Any), ("pts", _data.pts as Any), ("count", _data.count as Any), ("offsetIdOffset", _data.offsetIdOffset as Any), ("messages", _data.messages as Any), ("topics", _data.topics as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", _data.messages as Any), ("topics", _data.topics as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", _data.count as Any)]) + return ("messagesNotModified", [("count", ConstructorParameterDescription(_data.count))]) case .messagesSlice(let _data): - return ("messagesSlice", [("flags", _data.flags as Any), ("count", _data.count as Any), ("nextRate", _data.nextRate as Any), ("offsetIdOffset", _data.offsetIdOffset as Any), ("searchFlood", _data.searchFlood as Any), ("messages", _data.messages as Any), ("topics", _data.topics as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1489,8 +1489,8 @@ public extension Api.messages { self.count = count self.sets = sets } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("myStickers", [("count", self.count as Any), ("sets", self.sets as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("myStickers", [("count", ConstructorParameterDescription(self.count)), ("sets", ConstructorParameterDescription(self.sets))]) } } case myStickers(Cons_myStickers) @@ -1511,10 +1511,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .myStickers(let _data): - return ("myStickers", [("count", _data.count as Any), ("sets", _data.sets as Any)]) + return ("myStickers", [("count", ConstructorParameterDescription(_data.count)), ("sets", ConstructorParameterDescription(_data.sets))]) } } @@ -1551,8 +1551,8 @@ public extension Api.messages { self.users = users self.state = state } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerDialogs", [("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("state", self.state as Any)]) + 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) @@ -1588,10 +1588,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerDialogs(let _data): - return ("peerDialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("state", _data.state as Any)]) + return ("peerDialogs", [("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users)), ("state", ConstructorParameterDescription(_data.state))]) } } @@ -1641,8 +1641,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerSettings", [("settings", self.settings as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerSettings", [("settings", ConstructorParameterDescription(self.settings)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case peerSettings(Cons_peerSettings) @@ -1668,10 +1668,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerSettings(let _data): - return ("peerSettings", [("settings", _data.settings as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("peerSettings", [("settings", ConstructorParameterDescription(_data.settings)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1715,8 +1715,8 @@ public extension Api.messages { self.cacheTime = cacheTime self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("preparedInlineMessage", [("queryId", self.queryId as Any), ("result", self.result as Any), ("peerTypes", self.peerTypes as Any), ("cacheTime", self.cacheTime as Any), ("users", self.users as Any)]) + 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) @@ -1744,10 +1744,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .preparedInlineMessage(let _data): - return ("preparedInlineMessage", [("queryId", _data.queryId as Any), ("result", _data.result as Any), ("peerTypes", _data.peerTypes as Any), ("cacheTime", _data.cacheTime as Any), ("users", _data.users as Any)]) + return ("preparedInlineMessage", [("queryId", ConstructorParameterDescription(_data.queryId)), ("result", ConstructorParameterDescription(_data.result)), ("peerTypes", ConstructorParameterDescription(_data.peerTypes)), ("cacheTime", ConstructorParameterDescription(_data.cacheTime)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1795,8 +1795,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("quickReplies", [("quickReplies", self.quickReplies as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1837,10 +1837,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .quickReplies(let _data): - return ("quickReplies", [("quickReplies", _data.quickReplies as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("quickReplies", [("quickReplies", ConstructorParameterDescription(_data.quickReplies)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) case .quickRepliesNotModified: return ("quickRepliesNotModified", []) } @@ -1888,8 +1888,8 @@ public extension Api.messages { self.hash = hash self.reactions = reactions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("reactions", [("hash", self.hash as Any), ("reactions", self.reactions as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("reactions", [("hash", ConstructorParameterDescription(self.hash)), ("reactions", ConstructorParameterDescription(self.reactions))]) } } case reactions(Cons_reactions) @@ -1916,10 +1916,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .reactions(let _data): - return ("reactions", [("hash", _data.hash as Any), ("reactions", _data.reactions as Any)]) + return ("reactions", [("hash", ConstructorParameterDescription(_data.hash)), ("reactions", ConstructorParameterDescription(_data.reactions))]) case .reactionsNotModified: return ("reactionsNotModified", []) } diff --git a/submodules/TelegramApi/Sources/Api36.swift b/submodules/TelegramApi/Sources/Api36.swift index 34ce45fd5c..2ad050397d 100644 --- a/submodules/TelegramApi/Sources/Api36.swift +++ b/submodules/TelegramApi/Sources/Api36.swift @@ -11,8 +11,8 @@ public extension Api.messages { self.stickers = stickers self.dates = dates } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("recentStickers", [("hash", self.hash as Any), ("packs", self.packs as Any), ("stickers", self.stickers as Any), ("dates", self.dates as Any)]) + 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) @@ -49,10 +49,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .recentStickers(let _data): - return ("recentStickers", [("hash", _data.hash as Any), ("packs", _data.packs as Any), ("stickers", _data.stickers as Any), ("dates", _data.dates as Any)]) + return ("recentStickers", [("hash", ConstructorParameterDescription(_data.hash)), ("packs", ConstructorParameterDescription(_data.packs)), ("stickers", ConstructorParameterDescription(_data.stickers)), ("dates", ConstructorParameterDescription(_data.dates))]) case .recentStickersNotModified: return ("recentStickersNotModified", []) } @@ -102,8 +102,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedDialogs", [("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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 { @@ -111,8 +111,8 @@ public extension Api.messages { public init(count: Int32) { self.count = count } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedDialogsNotModified", [("count", self.count as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedDialogsNotModified", [("count", ConstructorParameterDescription(self.count))]) } } public class Cons_savedDialogsSlice: TypeConstructorDescription { @@ -128,8 +128,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedDialogsSlice", [("count", self.count as Any), ("dialogs", self.dialogs as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -198,14 +198,14 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedDialogs(let _data): - return ("savedDialogs", [("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", _data.count as Any)]) + return ("savedDialogsNotModified", [("count", ConstructorParameterDescription(_data.count))]) case .savedDialogsSlice(let _data): - return ("savedDialogsSlice", [("count", _data.count as Any), ("dialogs", _data.dialogs as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("savedDialogsSlice", [("count", ConstructorParameterDescription(_data.count)), ("dialogs", ConstructorParameterDescription(_data.dialogs)), ("messages", ConstructorParameterDescription(_data.messages)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -290,8 +290,8 @@ public extension Api.messages { self.hash = hash self.gifs = gifs } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedGifs", [("hash", self.hash as Any), ("gifs", self.gifs as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedGifs", [("hash", ConstructorParameterDescription(self.hash)), ("gifs", ConstructorParameterDescription(self.gifs))]) } } case savedGifs(Cons_savedGifs) @@ -318,10 +318,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedGifs(let _data): - return ("savedGifs", [("hash", _data.hash as Any), ("gifs", _data.gifs as Any)]) + return ("savedGifs", [("hash", ConstructorParameterDescription(_data.hash)), ("gifs", ConstructorParameterDescription(_data.gifs))]) case .savedGifsNotModified: return ("savedGifsNotModified", []) } @@ -357,8 +357,8 @@ public extension Api.messages { self.tags = tags self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedReactionTags", [("tags", self.tags as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedReactionTags", [("tags", ConstructorParameterDescription(self.tags)), ("hash", ConstructorParameterDescription(self.hash))]) } } case savedReactionTags(Cons_savedReactionTags) @@ -385,10 +385,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedReactionTags(let _data): - return ("savedReactionTags", [("tags", _data.tags as Any), ("hash", _data.hash as Any)]) + return ("savedReactionTags", [("tags", ConstructorParameterDescription(_data.tags)), ("hash", ConstructorParameterDescription(_data.hash))]) case .savedReactionTagsNotModified: return ("savedReactionTagsNotModified", []) } @@ -426,8 +426,8 @@ public extension Api.messages { self.filter = filter self.count = count } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("searchCounter", [("flags", self.flags as Any), ("filter", self.filter as Any), ("count", self.count as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchCounter", [("flags", ConstructorParameterDescription(self.flags)), ("filter", ConstructorParameterDescription(self.filter)), ("count", ConstructorParameterDescription(self.count))]) } } case searchCounter(Cons_searchCounter) @@ -445,10 +445,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .searchCounter(let _data): - return ("searchCounter", [("flags", _data.flags as Any), ("filter", _data.filter as Any), ("count", _data.count as Any)]) + return ("searchCounter", [("flags", ConstructorParameterDescription(_data.flags)), ("filter", ConstructorParameterDescription(_data.filter)), ("count", ConstructorParameterDescription(_data.count))]) } } @@ -496,8 +496,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("searchResultsCalendar", [("flags", self.flags as Any), ("count", self.count as Any), ("minDate", self.minDate as Any), ("minMsgId", self.minMsgId as Any), ("offsetIdOffset", self.offsetIdOffset as Any), ("periods", self.periods as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -539,10 +539,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .searchResultsCalendar(let _data): - return ("searchResultsCalendar", [("flags", _data.flags as Any), ("count", _data.count as Any), ("minDate", _data.minDate as Any), ("minMsgId", _data.minMsgId as Any), ("offsetIdOffset", _data.offsetIdOffset as Any), ("periods", _data.periods as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -602,8 +602,8 @@ public extension Api.messages { self.count = count self.positions = positions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("searchResultsPositions", [("count", self.count as Any), ("positions", self.positions as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("searchResultsPositions", [("count", ConstructorParameterDescription(self.count)), ("positions", ConstructorParameterDescription(self.positions))]) } } case searchResultsPositions(Cons_searchResultsPositions) @@ -624,10 +624,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .searchResultsPositions(let _data): - return ("searchResultsPositions", [("count", _data.count as Any), ("positions", _data.positions as Any)]) + return ("searchResultsPositions", [("count", ConstructorParameterDescription(_data.count)), ("positions", ConstructorParameterDescription(_data.positions))]) } } @@ -658,8 +658,8 @@ public extension Api.messages { self.date = date self.file = file } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentEncryptedFile", [("date", self.date as Any), ("file", self.file as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentEncryptedFile", [("date", ConstructorParameterDescription(self.date)), ("file", ConstructorParameterDescription(self.file))]) } } public class Cons_sentEncryptedMessage: TypeConstructorDescription { @@ -667,8 +667,8 @@ public extension Api.messages { public init(date: Int32) { self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sentEncryptedMessage", [("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("sentEncryptedMessage", [("date", ConstructorParameterDescription(self.date))]) } } case sentEncryptedFile(Cons_sentEncryptedFile) @@ -692,12 +692,12 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sentEncryptedFile(let _data): - return ("sentEncryptedFile", [("date", _data.date as Any), ("file", _data.file as Any)]) + return ("sentEncryptedFile", [("date", ConstructorParameterDescription(_data.date)), ("file", ConstructorParameterDescription(_data.file))]) case .sentEncryptedMessage(let _data): - return ("sentEncryptedMessage", [("date", _data.date as Any)]) + return ("sentEncryptedMessage", [("date", ConstructorParameterDescription(_data.date))]) } } @@ -749,8 +749,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("sponsoredMessages", [("flags", self.flags as Any), ("postsBetween", self.postsBetween as Any), ("startDelay", self.startDelay as Any), ("betweenDelay", self.betweenDelay as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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))]) } } case sponsoredMessages(Cons_sponsoredMessages) @@ -796,10 +796,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .sponsoredMessages(let _data): - return ("sponsoredMessages", [("flags", _data.flags as Any), ("postsBetween", _data.postsBetween as Any), ("startDelay", _data.startDelay as Any), ("betweenDelay", _data.betweenDelay as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", []) } @@ -864,8 +864,8 @@ public extension Api.messages { self.keywords = keywords self.documents = documents } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stickerSet", [("set", self.set as Any), ("packs", self.packs as Any), ("keywords", self.keywords as Any), ("documents", self.documents as Any)]) + 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) @@ -902,10 +902,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .stickerSet(let _data): - return ("stickerSet", [("set", _data.set as Any), ("packs", _data.packs as Any), ("keywords", _data.keywords as Any), ("documents", _data.documents as Any)]) + return ("stickerSet", [("set", ConstructorParameterDescription(_data.set)), ("packs", ConstructorParameterDescription(_data.packs)), ("keywords", ConstructorParameterDescription(_data.keywords)), ("documents", ConstructorParameterDescription(_data.documents))]) case .stickerSetNotModified: return ("stickerSetNotModified", []) } @@ -951,8 +951,8 @@ public extension Api.messages { public init(sets: [Api.StickerSetCovered]) { self.sets = sets } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stickerSetInstallResultArchive", [("sets", self.sets as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickerSetInstallResultArchive", [("sets", ConstructorParameterDescription(self.sets))]) } } case stickerSetInstallResultArchive(Cons_stickerSetInstallResultArchive) @@ -978,10 +978,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .stickerSetInstallResultArchive(let _data): - return ("stickerSetInstallResultArchive", [("sets", _data.sets as Any)]) + return ("stickerSetInstallResultArchive", [("sets", ConstructorParameterDescription(_data.sets))]) case .stickerSetInstallResultSuccess: return ("stickerSetInstallResultSuccess", []) } @@ -1014,8 +1014,8 @@ public extension Api.messages { self.hash = hash self.stickers = stickers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stickers", [("hash", self.hash as Any), ("stickers", self.stickers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("stickers", [("hash", ConstructorParameterDescription(self.hash)), ("stickers", ConstructorParameterDescription(self.stickers))]) } } case stickers(Cons_stickers) @@ -1042,10 +1042,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .stickers(let _data): - return ("stickers", [("hash", _data.hash as Any), ("stickers", _data.stickers as Any)]) + return ("stickers", [("hash", ConstructorParameterDescription(_data.hash)), ("stickers", ConstructorParameterDescription(_data.stickers))]) case .stickersNotModified: return ("stickersNotModified", []) } @@ -1087,8 +1087,8 @@ public extension Api.messages { self.trialRemainsNum = trialRemainsNum self.trialRemainsUntilDate = trialRemainsUntilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("transcribedAudio", [("flags", self.flags as Any), ("transcriptionId", self.transcriptionId as Any), ("text", self.text as Any), ("trialRemainsNum", self.trialRemainsNum as Any), ("trialRemainsUntilDate", self.trialRemainsUntilDate as Any)]) + 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) @@ -1112,10 +1112,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .transcribedAudio(let _data): - return ("transcribedAudio", [("flags", _data.flags as Any), ("transcriptionId", _data.transcriptionId as Any), ("text", _data.text as Any), ("trialRemainsNum", _data.trialRemainsNum as Any), ("trialRemainsUntilDate", _data.trialRemainsUntilDate as Any)]) + return ("transcribedAudio", [("flags", ConstructorParameterDescription(_data.flags)), ("transcriptionId", ConstructorParameterDescription(_data.transcriptionId)), ("text", ConstructorParameterDescription(_data.text)), ("trialRemainsNum", ConstructorParameterDescription(_data.trialRemainsNum)), ("trialRemainsUntilDate", ConstructorParameterDescription(_data.trialRemainsUntilDate))]) } } @@ -1155,8 +1155,8 @@ public extension Api.messages { public init(result: [Api.TextWithEntities]) { self.result = result } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("translateResult", [("result", self.result as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("translateResult", [("result", ConstructorParameterDescription(self.result))]) } } case translateResult(Cons_translateResult) @@ -1176,10 +1176,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .translateResult(let _data): - return ("translateResult", [("result", _data.result as Any)]) + return ("translateResult", [("result", ConstructorParameterDescription(_data.result))]) } } @@ -1215,8 +1215,8 @@ public extension Api.messages { self.users = users self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("votesList", [("flags", self.flags as Any), ("count", self.count as Any), ("votes", self.votes as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("nextOffset", self.nextOffset as Any)]) + 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) @@ -1251,10 +1251,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .votesList(let _data): - return ("votesList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("votes", _data.votes as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + 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))]) } } @@ -1305,8 +1305,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPage", [("webpage", self.webpage as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPage", [("webpage", ConstructorParameterDescription(self.webpage)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case webPage(Cons_webPage) @@ -1332,10 +1332,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webPage(let _data): - return ("webPage", [("webpage", _data.webpage as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("webPage", [("webpage", ConstructorParameterDescription(_data.webpage)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1375,8 +1375,8 @@ public extension Api.messages { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webPagePreview", [("media", self.media as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("webPagePreview", [("media", ConstructorParameterDescription(self.media)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case webPagePreview(Cons_webPagePreview) @@ -1402,10 +1402,10 @@ public extension Api.messages { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webPagePreview(let _data): - return ("webPagePreview", [("media", _data.media as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("webPagePreview", [("media", ConstructorParameterDescription(_data.media)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1443,8 +1443,8 @@ public extension Api.payments { self.title = title self.openUrls = openUrls } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("bankCardData", [("title", self.title as Any), ("openUrls", self.openUrls as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("bankCardData", [("title", ConstructorParameterDescription(self.title)), ("openUrls", ConstructorParameterDescription(self.openUrls))]) } } case bankCardData(Cons_bankCardData) @@ -1465,10 +1465,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .bankCardData(let _data): - return ("bankCardData", [("title", _data.title as Any), ("openUrls", _data.openUrls as Any)]) + return ("bankCardData", [("title", ConstructorParameterDescription(_data.title)), ("openUrls", ConstructorParameterDescription(_data.openUrls))]) } } @@ -1497,8 +1497,8 @@ public extension Api.payments { public init(reason: Api.TextWithEntities) { self.reason = reason } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("checkCanSendGiftResultFail", [("reason", self.reason as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("checkCanSendGiftResultFail", [("reason", ConstructorParameterDescription(self.reason))]) } } case checkCanSendGiftResultFail(Cons_checkCanSendGiftResultFail) @@ -1520,10 +1520,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .checkCanSendGiftResultFail(let _data): - return ("checkCanSendGiftResultFail", [("reason", _data.reason as Any)]) + return ("checkCanSendGiftResultFail", [("reason", ConstructorParameterDescription(_data.reason))]) case .checkCanSendGiftResultOk: return ("checkCanSendGiftResultOk", []) } @@ -1570,8 +1570,8 @@ public extension Api.payments { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("checkedGiftCode", [("flags", self.flags as Any), ("fromId", self.fromId as Any), ("giveawayMsgId", self.giveawayMsgId as Any), ("toId", self.toId as Any), ("date", self.date as Any), ("days", self.days as Any), ("usedDate", self.usedDate as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1611,10 +1611,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .checkedGiftCode(let _data): - return ("checkedGiftCode", [("flags", _data.flags as Any), ("fromId", _data.fromId as Any), ("giveawayMsgId", _data.giveawayMsgId as Any), ("toId", _data.toId as Any), ("date", _data.date as Any), ("days", _data.days as Any), ("usedDate", _data.usedDate as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1680,8 +1680,8 @@ public extension Api.payments { self.connectedBots = connectedBots self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("connectedStarRefBots", [("count", self.count as Any), ("connectedBots", self.connectedBots as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("connectedStarRefBots", [("count", ConstructorParameterDescription(self.count)), ("connectedBots", ConstructorParameterDescription(self.connectedBots)), ("users", ConstructorParameterDescription(self.users))]) } } case connectedStarRefBots(Cons_connectedStarRefBots) @@ -1707,10 +1707,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .connectedStarRefBots(let _data): - return ("connectedStarRefBots", [("count", _data.count as Any), ("connectedBots", _data.connectedBots as Any), ("users", _data.users as Any)]) + return ("connectedStarRefBots", [("count", ConstructorParameterDescription(_data.count)), ("connectedBots", ConstructorParameterDescription(_data.connectedBots)), ("users", ConstructorParameterDescription(_data.users))]) } } diff --git a/submodules/TelegramApi/Sources/Api37.swift b/submodules/TelegramApi/Sources/Api37.swift index e5be012948..c4a2ad6d96 100644 --- a/submodules/TelegramApi/Sources/Api37.swift +++ b/submodules/TelegramApi/Sources/Api37.swift @@ -5,8 +5,8 @@ public extension Api.payments { public init(url: String) { self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedInvoice", [("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedInvoice", [("url", ConstructorParameterDescription(self.url))]) } } case exportedInvoice(Cons_exportedInvoice) @@ -22,10 +22,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedInvoice(let _data): - return ("exportedInvoice", [("url", _data.url as Any)]) + return ("exportedInvoice", [("url", ConstructorParameterDescription(_data.url))]) } } @@ -57,8 +57,8 @@ public extension Api.payments { self.adminDisallowedChatId = adminDisallowedChatId self.disallowedCountry = disallowedCountry } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("giveawayInfo", [("flags", self.flags as Any), ("startDate", self.startDate as Any), ("joinedTooEarlyDate", self.joinedTooEarlyDate as Any), ("adminDisallowedChatId", self.adminDisallowedChatId as Any), ("disallowedCountry", self.disallowedCountry as Any)]) + 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 { @@ -78,8 +78,8 @@ public extension Api.payments { self.winnersCount = winnersCount self.activatedCount = activatedCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("giveawayInfoResults", [("flags", self.flags as Any), ("startDate", self.startDate as Any), ("giftCodeSlug", self.giftCodeSlug as Any), ("starsPrize", self.starsPrize as Any), ("finishDate", self.finishDate as Any), ("winnersCount", self.winnersCount as Any), ("activatedCount", self.activatedCount as Any)]) + 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) @@ -124,12 +124,12 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .giveawayInfo(let _data): - return ("giveawayInfo", [("flags", _data.flags as Any), ("startDate", _data.startDate as Any), ("joinedTooEarlyDate", _data.joinedTooEarlyDate as Any), ("adminDisallowedChatId", _data.adminDisallowedChatId as Any), ("disallowedCountry", _data.disallowedCountry as Any)]) + 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", _data.flags as Any), ("startDate", _data.startDate as Any), ("giftCodeSlug", _data.giftCodeSlug as Any), ("starsPrize", _data.starsPrize as Any), ("finishDate", _data.finishDate as Any), ("winnersCount", _data.winnersCount as Any), ("activatedCount", _data.activatedCount as Any)]) + 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))]) } } @@ -234,8 +234,8 @@ public extension Api.payments { self.savedCredentials = savedCredentials self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentForm", [("flags", self.flags as Any), ("formId", self.formId as Any), ("botId", self.botId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("providerId", self.providerId as Any), ("url", self.url as Any), ("nativeProvider", self.nativeProvider as Any), ("nativeParams", self.nativeParams as Any), ("additionalMethods", self.additionalMethods as Any), ("savedInfo", self.savedInfo as Any), ("savedCredentials", self.savedCredentials as Any), ("users", self.users as Any)]) + 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 { @@ -245,8 +245,8 @@ public extension Api.payments { self.formId = formId self.invoice = invoice } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentFormStarGift", [("formId", self.formId as Any), ("invoice", self.invoice as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentFormStarGift", [("formId", ConstructorParameterDescription(self.formId)), ("invoice", ConstructorParameterDescription(self.invoice))]) } } public class Cons_paymentFormStars: TypeConstructorDescription { @@ -268,8 +268,8 @@ public extension Api.payments { self.invoice = invoice self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentFormStars", [("flags", self.flags as Any), ("formId", self.formId as Any), ("botId", self.botId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("users", self.users as Any)]) + 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) @@ -351,14 +351,14 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paymentForm(let _data): - return ("paymentForm", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("providerId", _data.providerId as Any), ("url", _data.url as Any), ("nativeProvider", _data.nativeProvider as Any), ("nativeParams", _data.nativeParams as Any), ("additionalMethods", _data.additionalMethods as Any), ("savedInfo", _data.savedInfo as Any), ("savedCredentials", _data.savedCredentials as Any), ("users", _data.users as Any)]) + 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", _data.formId as Any), ("invoice", _data.invoice as Any)]) + return ("paymentFormStarGift", [("formId", ConstructorParameterDescription(_data.formId)), ("invoice", ConstructorParameterDescription(_data.invoice))]) case .paymentFormStars(let _data): - return ("paymentFormStars", [("flags", _data.flags as Any), ("formId", _data.formId as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -534,8 +534,8 @@ public extension Api.payments { self.credentialsTitle = credentialsTitle self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentReceipt", [("flags", self.flags as Any), ("date", self.date as Any), ("botId", self.botId as Any), ("providerId", self.providerId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("info", self.info as Any), ("shipping", self.shipping as Any), ("tipAmount", self.tipAmount as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any), ("credentialsTitle", self.credentialsTitle as Any), ("users", self.users as Any)]) + 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 { @@ -563,8 +563,8 @@ public extension Api.payments { self.transactionId = transactionId self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentReceiptStars", [("flags", self.flags as Any), ("date", self.date as Any), ("botId", self.botId as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("currency", self.currency as Any), ("totalAmount", self.totalAmount as Any), ("transactionId", self.transactionId as Any), ("users", self.users as Any)]) + 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) @@ -629,12 +629,12 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paymentReceipt(let _data): - return ("paymentReceipt", [("flags", _data.flags as Any), ("date", _data.date as Any), ("botId", _data.botId as Any), ("providerId", _data.providerId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("info", _data.info as Any), ("shipping", _data.shipping as Any), ("tipAmount", _data.tipAmount as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("credentialsTitle", _data.credentialsTitle as Any), ("users", _data.users as Any)]) + 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", _data.flags as Any), ("date", _data.date as Any), ("botId", _data.botId as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("currency", _data.currency as Any), ("totalAmount", _data.totalAmount as Any), ("transactionId", _data.transactionId as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -767,8 +767,8 @@ public extension Api.payments { public init(updates: Api.Updates) { self.updates = updates } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentResult", [("updates", self.updates as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentResult", [("updates", ConstructorParameterDescription(self.updates))]) } } public class Cons_paymentVerificationNeeded: TypeConstructorDescription { @@ -776,8 +776,8 @@ public extension Api.payments { public init(url: String) { self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("paymentVerificationNeeded", [("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("paymentVerificationNeeded", [("url", ConstructorParameterDescription(self.url))]) } } case paymentResult(Cons_paymentResult) @@ -800,12 +800,12 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .paymentResult(let _data): - return ("paymentResult", [("updates", _data.updates as Any)]) + return ("paymentResult", [("updates", ConstructorParameterDescription(_data.updates))]) case .paymentVerificationNeeded(let _data): - return ("paymentVerificationNeeded", [("url", _data.url as Any)]) + return ("paymentVerificationNeeded", [("url", ConstructorParameterDescription(_data.url))]) } } @@ -858,8 +858,8 @@ public extension Api.payments { self.counters = counters self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("resaleStarGifts", [("flags", self.flags as Any), ("count", self.count as Any), ("gifts", self.gifts as Any), ("nextOffset", self.nextOffset as Any), ("attributes", self.attributes as Any), ("attributesHash", self.attributesHash as Any), ("chats", self.chats as Any), ("counters", self.counters as Any), ("users", self.users as Any)]) + 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) @@ -911,10 +911,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .resaleStarGifts(let _data): - return ("resaleStarGifts", [("flags", _data.flags as Any), ("count", _data.count as Any), ("gifts", _data.gifts as Any), ("nextOffset", _data.nextOffset as Any), ("attributes", _data.attributes as Any), ("attributesHash", _data.attributesHash as Any), ("chats", _data.chats as Any), ("counters", _data.counters as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -982,8 +982,8 @@ public extension Api.payments { self.flags = flags self.savedInfo = savedInfo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedInfo", [("flags", self.flags as Any), ("savedInfo", self.savedInfo as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("savedInfo", ConstructorParameterDescription(self.savedInfo))]) } } case savedInfo(Cons_savedInfo) @@ -1002,10 +1002,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedInfo(let _data): - return ("savedInfo", [("flags", _data.flags as Any), ("savedInfo", _data.savedInfo as Any)]) + return ("savedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("savedInfo", ConstructorParameterDescription(_data.savedInfo))]) } } @@ -1048,8 +1048,8 @@ public extension Api.payments { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedStarGifts", [("flags", self.flags as Any), ("count", self.count as Any), ("chatNotificationsEnabled", self.chatNotificationsEnabled as Any), ("gifts", self.gifts as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1087,10 +1087,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedStarGifts(let _data): - return ("savedStarGifts", [("flags", _data.flags as Any), ("count", _data.count as Any), ("chatNotificationsEnabled", _data.chatNotificationsEnabled as Any), ("gifts", _data.gifts as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1148,8 +1148,8 @@ public extension Api.payments { self.users = users self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftActiveAuctions", [("auctions", self.auctions as Any), ("users", self.users as Any), ("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftActiveAuctions", [("auctions", ConstructorParameterDescription(self.auctions)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats))]) } } case starGiftActiveAuctions(Cons_starGiftActiveAuctions) @@ -1185,10 +1185,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftActiveAuctions(let _data): - return ("starGiftActiveAuctions", [("auctions", _data.auctions as Any), ("users", _data.users as Any), ("chats", _data.chats as Any)]) + return ("starGiftActiveAuctions", [("auctions", ConstructorParameterDescription(_data.auctions)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) case .starGiftActiveAuctionsNotModified: return ("starGiftActiveAuctionsNotModified", []) } @@ -1233,8 +1233,8 @@ public extension Api.payments { self.users = users self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAuctionAcquiredGifts", [("gifts", self.gifts as Any), ("users", self.users as Any), ("chats", self.chats as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftAuctionAcquiredGifts", [("gifts", ConstructorParameterDescription(self.gifts)), ("users", ConstructorParameterDescription(self.users)), ("chats", ConstructorParameterDescription(self.chats))]) } } case starGiftAuctionAcquiredGifts(Cons_starGiftAuctionAcquiredGifts) @@ -1264,10 +1264,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftAuctionAcquiredGifts(let _data): - return ("starGiftAuctionAcquiredGifts", [("gifts", _data.gifts as Any), ("users", _data.users as Any), ("chats", _data.chats as Any)]) + return ("starGiftAuctionAcquiredGifts", [("gifts", ConstructorParameterDescription(_data.gifts)), ("users", ConstructorParameterDescription(_data.users)), ("chats", ConstructorParameterDescription(_data.chats))]) } } @@ -1313,8 +1313,8 @@ public extension Api.payments { self.users = users self.chats = chats } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftAuctionState", [("gift", self.gift as Any), ("state", self.state as Any), ("userState", self.userState as Any), ("timeout", self.timeout as Any), ("users", self.users as Any), ("chats", self.chats as Any)]) + 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) @@ -1343,10 +1343,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftAuctionState(let _data): - return ("starGiftAuctionState", [("gift", _data.gift as Any), ("state", _data.state as Any), ("userState", _data.userState as Any), ("timeout", _data.timeout as Any), ("users", _data.users as Any), ("chats", _data.chats as Any)]) + 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))]) } } @@ -1395,8 +1395,8 @@ public extension Api.payments { public init(collections: [Api.StarGiftCollection]) { self.collections = collections } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftCollections", [("collections", self.collections as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftCollections", [("collections", ConstructorParameterDescription(self.collections))]) } } case starGiftCollections(Cons_starGiftCollections) @@ -1422,10 +1422,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftCollections(let _data): - return ("starGiftCollections", [("collections", _data.collections as Any)]) + return ("starGiftCollections", [("collections", ConstructorParameterDescription(_data.collections))]) case .starGiftCollectionsNotModified: return ("starGiftCollectionsNotModified", []) } @@ -1456,8 +1456,8 @@ public extension Api.payments { public init(attributes: [Api.StarGiftAttribute]) { self.attributes = attributes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftUpgradeAttributes", [("attributes", self.attributes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftUpgradeAttributes", [("attributes", ConstructorParameterDescription(self.attributes))]) } } case starGiftUpgradeAttributes(Cons_starGiftUpgradeAttributes) @@ -1477,10 +1477,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftUpgradeAttributes(let _data): - return ("starGiftUpgradeAttributes", [("attributes", _data.attributes as Any)]) + return ("starGiftUpgradeAttributes", [("attributes", ConstructorParameterDescription(_data.attributes))]) } } @@ -1510,8 +1510,8 @@ public extension Api.payments { self.prices = prices self.nextPrices = nextPrices } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftUpgradePreview", [("sampleAttributes", self.sampleAttributes as Any), ("prices", self.prices as Any), ("nextPrices", self.nextPrices as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftUpgradePreview", [("sampleAttributes", ConstructorParameterDescription(self.sampleAttributes)), ("prices", ConstructorParameterDescription(self.prices)), ("nextPrices", ConstructorParameterDescription(self.nextPrices))]) } } case starGiftUpgradePreview(Cons_starGiftUpgradePreview) @@ -1541,10 +1541,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftUpgradePreview(let _data): - return ("starGiftUpgradePreview", [("sampleAttributes", _data.sampleAttributes as Any), ("prices", _data.prices as Any), ("nextPrices", _data.nextPrices as Any)]) + return ("starGiftUpgradePreview", [("sampleAttributes", ConstructorParameterDescription(_data.sampleAttributes)), ("prices", ConstructorParameterDescription(_data.prices)), ("nextPrices", ConstructorParameterDescription(_data.nextPrices))]) } } @@ -1580,8 +1580,8 @@ public extension Api.payments { public init(url: String) { self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGiftWithdrawalUrl", [("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starGiftWithdrawalUrl", [("url", ConstructorParameterDescription(self.url))]) } } case starGiftWithdrawalUrl(Cons_starGiftWithdrawalUrl) @@ -1597,10 +1597,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGiftWithdrawalUrl(let _data): - return ("starGiftWithdrawalUrl", [("url", _data.url as Any)]) + return ("starGiftWithdrawalUrl", [("url", ConstructorParameterDescription(_data.url))]) } } @@ -1630,8 +1630,8 @@ public extension Api.payments { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starGifts", [("hash", self.hash as Any), ("gifts", self.gifts as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1668,10 +1668,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starGifts(let _data): - return ("starGifts", [("hash", _data.hash as Any), ("gifts", _data.gifts as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("starGifts", [("hash", ConstructorParameterDescription(_data.hash)), ("gifts", ConstructorParameterDescription(_data.gifts)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) case .starGiftsNotModified: return ("starGiftsNotModified", []) } @@ -1715,8 +1715,8 @@ public extension Api.payments { public init(url: String) { self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsRevenueAdsAccountUrl", [("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsRevenueAdsAccountUrl", [("url", ConstructorParameterDescription(self.url))]) } } case starsRevenueAdsAccountUrl(Cons_starsRevenueAdsAccountUrl) @@ -1732,10 +1732,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsRevenueAdsAccountUrl(let _data): - return ("starsRevenueAdsAccountUrl", [("url", _data.url as Any)]) + return ("starsRevenueAdsAccountUrl", [("url", ConstructorParameterDescription(_data.url))]) } } @@ -1767,8 +1767,8 @@ public extension Api.payments { self.status = status self.usdRate = usdRate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsRevenueStats", [("flags", self.flags as Any), ("topHoursGraph", self.topHoursGraph as Any), ("revenueGraph", self.revenueGraph as Any), ("status", self.status as Any), ("usdRate", self.usdRate as Any)]) + 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) @@ -1790,10 +1790,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsRevenueStats(let _data): - return ("starsRevenueStats", [("flags", _data.flags as Any), ("topHoursGraph", _data.topHoursGraph as Any), ("revenueGraph", _data.revenueGraph as Any), ("status", _data.status as Any), ("usdRate", _data.usdRate as Any)]) + return ("starsRevenueStats", [("flags", ConstructorParameterDescription(_data.flags)), ("topHoursGraph", ConstructorParameterDescription(_data.topHoursGraph)), ("revenueGraph", ConstructorParameterDescription(_data.revenueGraph)), ("status", ConstructorParameterDescription(_data.status)), ("usdRate", ConstructorParameterDescription(_data.usdRate))]) } } @@ -1837,8 +1837,8 @@ public extension Api.payments { public init(url: String) { self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsRevenueWithdrawalUrl", [("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("starsRevenueWithdrawalUrl", [("url", ConstructorParameterDescription(self.url))]) } } case starsRevenueWithdrawalUrl(Cons_starsRevenueWithdrawalUrl) @@ -1854,10 +1854,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsRevenueWithdrawalUrl(let _data): - return ("starsRevenueWithdrawalUrl", [("url", _data.url as Any)]) + return ("starsRevenueWithdrawalUrl", [("url", ConstructorParameterDescription(_data.url))]) } } @@ -1897,8 +1897,8 @@ public extension Api.payments { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("starsStatus", [("flags", self.flags as Any), ("balance", self.balance as Any), ("subscriptions", self.subscriptions as Any), ("subscriptionsNextOffset", self.subscriptionsNextOffset as Any), ("subscriptionsMissingBalance", self.subscriptionsMissingBalance as Any), ("history", self.history as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1948,10 +1948,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .starsStatus(let _data): - return ("starsStatus", [("flags", _data.flags as Any), ("balance", _data.balance as Any), ("subscriptions", _data.subscriptions as Any), ("subscriptionsNextOffset", _data.subscriptionsNextOffset as Any), ("subscriptionsMissingBalance", _data.subscriptionsMissingBalance as Any), ("history", _data.history as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -2027,8 +2027,8 @@ public extension Api.payments { self.users = users self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("suggestedStarRefBots", [("flags", self.flags as Any), ("count", self.count as Any), ("suggestedBots", self.suggestedBots as Any), ("users", self.users as Any), ("nextOffset", self.nextOffset as Any)]) + 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))]) } } case suggestedStarRefBots(Cons_suggestedStarRefBots) @@ -2058,10 +2058,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .suggestedStarRefBots(let _data): - return ("suggestedStarRefBots", [("flags", _data.flags as Any), ("count", _data.count as Any), ("suggestedBots", _data.suggestedBots as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + return ("suggestedStarRefBots", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("suggestedBots", ConstructorParameterDescription(_data.suggestedBots)), ("users", ConstructorParameterDescription(_data.users)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset))]) } } @@ -2107,8 +2107,8 @@ public extension Api.payments { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("uniqueStarGift", [("gift", self.gift as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("uniqueStarGift", [("gift", ConstructorParameterDescription(self.gift)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case uniqueStarGift(Cons_uniqueStarGift) @@ -2134,10 +2134,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .uniqueStarGift(let _data): - return ("uniqueStarGift", [("gift", _data.gift as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("uniqueStarGift", [("gift", ConstructorParameterDescription(_data.gift)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -2197,8 +2197,8 @@ public extension Api.payments { self.fragmentListedCount = fragmentListedCount self.fragmentListedUrl = fragmentListedUrl } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("uniqueStarGiftValueInfo", [("flags", self.flags as Any), ("currency", self.currency as Any), ("value", self.value as Any), ("initialSaleDate", self.initialSaleDate as Any), ("initialSaleStars", self.initialSaleStars as Any), ("initialSalePrice", self.initialSalePrice as Any), ("lastSaleDate", self.lastSaleDate as Any), ("lastSalePrice", self.lastSalePrice as Any), ("floorPrice", self.floorPrice as Any), ("averagePrice", self.averagePrice as Any), ("listedCount", self.listedCount as Any), ("fragmentListedCount", self.fragmentListedCount as Any), ("fragmentListedUrl", self.fragmentListedUrl as Any)]) + 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) @@ -2240,10 +2240,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .uniqueStarGiftValueInfo(let _data): - return ("uniqueStarGiftValueInfo", [("flags", _data.flags as Any), ("currency", _data.currency as Any), ("value", _data.value as Any), ("initialSaleDate", _data.initialSaleDate as Any), ("initialSaleStars", _data.initialSaleStars as Any), ("initialSalePrice", _data.initialSalePrice as Any), ("lastSaleDate", _data.lastSaleDate as Any), ("lastSalePrice", _data.lastSalePrice as Any), ("floorPrice", _data.floorPrice as Any), ("averagePrice", _data.averagePrice as Any), ("listedCount", _data.listedCount as Any), ("fragmentListedCount", _data.fragmentListedCount as Any), ("fragmentListedUrl", _data.fragmentListedUrl as Any)]) + 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))]) } } @@ -2321,8 +2321,8 @@ public extension Api.payments { self.id = id self.shippingOptions = shippingOptions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("validatedRequestedInfo", [("flags", self.flags as Any), ("id", self.id as Any), ("shippingOptions", self.shippingOptions as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("validatedRequestedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("shippingOptions", ConstructorParameterDescription(self.shippingOptions))]) } } case validatedRequestedInfo(Cons_validatedRequestedInfo) @@ -2348,10 +2348,10 @@ public extension Api.payments { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .validatedRequestedInfo(let _data): - return ("validatedRequestedInfo", [("flags", _data.flags as Any), ("id", _data.id as Any), ("shippingOptions", _data.shippingOptions as Any)]) + return ("validatedRequestedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("shippingOptions", ConstructorParameterDescription(_data.shippingOptions))]) } } diff --git a/submodules/TelegramApi/Sources/Api38.swift b/submodules/TelegramApi/Sources/Api38.swift index 9b3e6b0c7c..36500500ca 100644 --- a/submodules/TelegramApi/Sources/Api38.swift +++ b/submodules/TelegramApi/Sources/Api38.swift @@ -5,8 +5,8 @@ public extension Api.phone { public init(link: String) { self.link = link } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedGroupCallInvite", [("link", self.link as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedGroupCallInvite", [("link", ConstructorParameterDescription(self.link))]) } } case exportedGroupCallInvite(Cons_exportedGroupCallInvite) @@ -22,10 +22,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedGroupCallInvite(let _data): - return ("exportedGroupCallInvite", [("link", _data.link as Any)]) + return ("exportedGroupCallInvite", [("link", ConstructorParameterDescription(_data.link))]) } } @@ -57,8 +57,8 @@ public extension Api.phone { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCall", [("call", self.call as Any), ("participants", self.participants as Any), ("participantsNextOffset", self.participantsNextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -90,10 +90,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCall(let _data): - return ("groupCall", [("call", _data.call as Any), ("participants", _data.participants as Any), ("participantsNextOffset", _data.participantsNextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("groupCall", [("call", ConstructorParameterDescription(_data.call)), ("participants", ConstructorParameterDescription(_data.participants)), ("participantsNextOffset", ConstructorParameterDescription(_data.participantsNextOffset)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -143,8 +143,8 @@ public extension Api.phone { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallStars", [("totalStars", self.totalStars as Any), ("topDonors", self.topDonors as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -175,10 +175,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallStars(let _data): - return ("groupCallStars", [("totalStars", _data.totalStars as Any), ("topDonors", _data.topDonors as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("groupCallStars", [("totalStars", ConstructorParameterDescription(_data.totalStars)), ("topDonors", ConstructorParameterDescription(_data.topDonors)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -217,8 +217,8 @@ public extension Api.phone { public init(channels: [Api.GroupCallStreamChannel]) { self.channels = channels } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallStreamChannels", [("channels", self.channels as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallStreamChannels", [("channels", ConstructorParameterDescription(self.channels))]) } } case groupCallStreamChannels(Cons_groupCallStreamChannels) @@ -238,10 +238,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallStreamChannels(let _data): - return ("groupCallStreamChannels", [("channels", _data.channels as Any)]) + return ("groupCallStreamChannels", [("channels", ConstructorParameterDescription(_data.channels))]) } } @@ -269,8 +269,8 @@ public extension Api.phone { self.url = url self.key = key } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallStreamRtmpUrl", [("url", self.url as Any), ("key", self.key as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallStreamRtmpUrl", [("url", ConstructorParameterDescription(self.url)), ("key", ConstructorParameterDescription(self.key))]) } } case groupCallStreamRtmpUrl(Cons_groupCallStreamRtmpUrl) @@ -287,10 +287,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallStreamRtmpUrl(let _data): - return ("groupCallStreamRtmpUrl", [("url", _data.url as Any), ("key", _data.key as Any)]) + return ("groupCallStreamRtmpUrl", [("url", ConstructorParameterDescription(_data.url)), ("key", ConstructorParameterDescription(_data.key))]) } } @@ -327,8 +327,8 @@ public extension Api.phone { self.users = users self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupParticipants", [("count", self.count as Any), ("participants", self.participants as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("version", self.version as Any)]) + 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) @@ -361,10 +361,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupParticipants(let _data): - return ("groupParticipants", [("count", _data.count as Any), ("participants", _data.participants as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("version", _data.version as Any)]) + 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))]) } } @@ -413,8 +413,8 @@ public extension Api.phone { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("joinAsPeers", [("peers", self.peers as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("joinAsPeers", [("peers", ConstructorParameterDescription(self.peers)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case joinAsPeers(Cons_joinAsPeers) @@ -444,10 +444,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .joinAsPeers(let _data): - return ("joinAsPeers", [("peers", _data.peers as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("joinAsPeers", [("peers", ConstructorParameterDescription(_data.peers)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -485,8 +485,8 @@ public extension Api.phone { self.phoneCall = phoneCall self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("phoneCall", [("phoneCall", self.phoneCall as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("phoneCall", [("phoneCall", ConstructorParameterDescription(self.phoneCall)), ("users", ConstructorParameterDescription(self.users))]) } } case phoneCall(Cons_phoneCall) @@ -507,10 +507,10 @@ public extension Api.phone { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .phoneCall(let _data): - return ("phoneCall", [("phoneCall", _data.phoneCall as Any), ("users", _data.users as Any)]) + return ("phoneCall", [("phoneCall", ConstructorParameterDescription(_data.phoneCall)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -543,8 +543,8 @@ public extension Api.photos { self.photo = photo self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photo", [("photo", self.photo as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photo", [("photo", ConstructorParameterDescription(self.photo)), ("users", ConstructorParameterDescription(self.users))]) } } case photo(Cons_photo) @@ -565,10 +565,10 @@ public extension Api.photos { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .photo(let _data): - return ("photo", [("photo", _data.photo as Any), ("users", _data.users as Any)]) + return ("photo", [("photo", ConstructorParameterDescription(_data.photo)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -601,8 +601,8 @@ public extension Api.photos { self.photos = photos self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photos", [("photos", self.photos as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photos", [("photos", ConstructorParameterDescription(self.photos)), ("users", ConstructorParameterDescription(self.users))]) } } public class Cons_photosSlice: TypeConstructorDescription { @@ -614,8 +614,8 @@ public extension Api.photos { self.photos = photos self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("photosSlice", [("count", self.count as Any), ("photos", self.photos as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("photosSlice", [("count", ConstructorParameterDescription(self.count)), ("photos", ConstructorParameterDescription(self.photos)), ("users", ConstructorParameterDescription(self.users))]) } } case photos(Cons_photos) @@ -657,12 +657,12 @@ public extension Api.photos { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .photos(let _data): - return ("photos", [("photos", _data.photos as Any), ("users", _data.users as Any)]) + return ("photos", [("photos", ConstructorParameterDescription(_data.photos)), ("users", ConstructorParameterDescription(_data.users))]) case .photosSlice(let _data): - return ("photosSlice", [("count", _data.count as Any), ("photos", _data.photos as Any), ("users", _data.users as Any)]) + return ("photosSlice", [("count", ConstructorParameterDescription(_data.count)), ("photos", ConstructorParameterDescription(_data.photos)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -722,8 +722,8 @@ public extension Api.premium { self.nextOffset = nextOffset self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("boostsList", [("flags", self.flags as Any), ("count", self.count as Any), ("boosts", self.boosts as Any), ("nextOffset", self.nextOffset as Any), ("users", self.users as Any)]) + 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) @@ -753,10 +753,10 @@ public extension Api.premium { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .boostsList(let _data): - return ("boostsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("boosts", _data.boosts as Any), ("nextOffset", _data.nextOffset as Any), ("users", _data.users as Any)]) + return ("boostsList", [("flags", ConstructorParameterDescription(_data.flags)), ("count", ConstructorParameterDescription(_data.count)), ("boosts", ConstructorParameterDescription(_data.boosts)), ("nextOffset", ConstructorParameterDescription(_data.nextOffset)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -816,8 +816,8 @@ public extension Api.premium { self.prepaidGiveaways = prepaidGiveaways self.myBoostSlots = myBoostSlots } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("boostsStatus", [("flags", self.flags as Any), ("level", self.level as Any), ("currentLevelBoosts", self.currentLevelBoosts as Any), ("boosts", self.boosts as Any), ("giftBoosts", self.giftBoosts as Any), ("nextLevelBoosts", self.nextLevelBoosts as Any), ("premiumAudience", self.premiumAudience as Any), ("boostUrl", self.boostUrl as Any), ("prepaidGiveaways", self.prepaidGiveaways as Any), ("myBoostSlots", self.myBoostSlots as Any)]) + 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) @@ -860,10 +860,10 @@ public extension Api.premium { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .boostsStatus(let _data): - return ("boostsStatus", [("flags", _data.flags as Any), ("level", _data.level as Any), ("currentLevelBoosts", _data.currentLevelBoosts as Any), ("boosts", _data.boosts as Any), ("giftBoosts", _data.giftBoosts as Any), ("nextLevelBoosts", _data.nextLevelBoosts as Any), ("premiumAudience", _data.premiumAudience as Any), ("boostUrl", _data.boostUrl as Any), ("prepaidGiveaways", _data.prepaidGiveaways as Any), ("myBoostSlots", _data.myBoostSlots as Any)]) + 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))]) } } @@ -934,8 +934,8 @@ public extension Api.premium { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("myBoosts", [("myBoosts", self.myBoosts as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("myBoosts", [("myBoosts", ConstructorParameterDescription(self.myBoosts)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case myBoosts(Cons_myBoosts) @@ -965,10 +965,10 @@ public extension Api.premium { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .myBoosts(let _data): - return ("myBoosts", [("myBoosts", _data.myBoosts as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("myBoosts", [("myBoosts", ConstructorParameterDescription(_data.myBoosts)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1006,8 +1006,8 @@ public extension Api.smsjobs { self.termsUrl = termsUrl self.monthlySentSms = monthlySentSms } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("eligibleToJoin", [("termsUrl", self.termsUrl as Any), ("monthlySentSms", self.monthlySentSms as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("eligibleToJoin", [("termsUrl", ConstructorParameterDescription(self.termsUrl)), ("monthlySentSms", ConstructorParameterDescription(self.monthlySentSms))]) } } case eligibleToJoin(Cons_eligibleToJoin) @@ -1024,10 +1024,10 @@ public extension Api.smsjobs { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .eligibleToJoin(let _data): - return ("eligibleToJoin", [("termsUrl", _data.termsUrl as Any), ("monthlySentSms", _data.monthlySentSms as Any)]) + return ("eligibleToJoin", [("termsUrl", ConstructorParameterDescription(_data.termsUrl)), ("monthlySentSms", ConstructorParameterDescription(_data.monthlySentSms))]) } } @@ -1068,8 +1068,8 @@ public extension Api.smsjobs { self.lastGiftSlug = lastGiftSlug self.termsUrl = termsUrl } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("status", [("flags", self.flags as Any), ("recentSent", self.recentSent as Any), ("recentSince", self.recentSince as Any), ("recentRemains", self.recentRemains as Any), ("totalSent", self.totalSent as Any), ("totalSince", self.totalSince as Any), ("lastGiftSlug", self.lastGiftSlug as Any), ("termsUrl", self.termsUrl as Any)]) + 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) @@ -1094,10 +1094,10 @@ public extension Api.smsjobs { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .status(let _data): - return ("status", [("flags", _data.flags as Any), ("recentSent", _data.recentSent as Any), ("recentSince", _data.recentSince as Any), ("recentRemains", _data.recentRemains as Any), ("totalSent", _data.totalSent as Any), ("totalSince", _data.totalSince as Any), ("lastGiftSlug", _data.lastGiftSlug as Any), ("termsUrl", _data.termsUrl as Any)]) + 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))]) } } @@ -1186,8 +1186,8 @@ public extension Api.stats { self.storyReactionsByEmotionGraph = storyReactionsByEmotionGraph self.recentPostsInteractions = recentPostsInteractions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("broadcastStats", [("period", self.period as Any), ("followers", self.followers as Any), ("viewsPerPost", self.viewsPerPost as Any), ("sharesPerPost", self.sharesPerPost as Any), ("reactionsPerPost", self.reactionsPerPost as Any), ("viewsPerStory", self.viewsPerStory as Any), ("sharesPerStory", self.sharesPerStory as Any), ("reactionsPerStory", self.reactionsPerStory as Any), ("enabledNotifications", self.enabledNotifications as Any), ("growthGraph", self.growthGraph as Any), ("followersGraph", self.followersGraph as Any), ("muteGraph", self.muteGraph as Any), ("topHoursGraph", self.topHoursGraph as Any), ("interactionsGraph", self.interactionsGraph as Any), ("ivInteractionsGraph", self.ivInteractionsGraph as Any), ("viewsBySourceGraph", self.viewsBySourceGraph as Any), ("newFollowersBySourceGraph", self.newFollowersBySourceGraph as Any), ("languagesGraph", self.languagesGraph as Any), ("reactionsByEmotionGraph", self.reactionsByEmotionGraph as Any), ("storyInteractionsGraph", self.storyInteractionsGraph as Any), ("storyReactionsByEmotionGraph", self.storyReactionsByEmotionGraph as Any), ("recentPostsInteractions", self.recentPostsInteractions as Any)]) + 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) @@ -1228,10 +1228,10 @@ public extension Api.stats { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .broadcastStats(let _data): - return ("broadcastStats", [("period", _data.period as Any), ("followers", _data.followers as Any), ("viewsPerPost", _data.viewsPerPost as Any), ("sharesPerPost", _data.sharesPerPost as Any), ("reactionsPerPost", _data.reactionsPerPost as Any), ("viewsPerStory", _data.viewsPerStory as Any), ("sharesPerStory", _data.sharesPerStory as Any), ("reactionsPerStory", _data.reactionsPerStory as Any), ("enabledNotifications", _data.enabledNotifications as Any), ("growthGraph", _data.growthGraph as Any), ("followersGraph", _data.followersGraph as Any), ("muteGraph", _data.muteGraph as Any), ("topHoursGraph", _data.topHoursGraph as Any), ("interactionsGraph", _data.interactionsGraph as Any), ("ivInteractionsGraph", _data.ivInteractionsGraph as Any), ("viewsBySourceGraph", _data.viewsBySourceGraph as Any), ("newFollowersBySourceGraph", _data.newFollowersBySourceGraph as Any), ("languagesGraph", _data.languagesGraph as Any), ("reactionsByEmotionGraph", _data.reactionsByEmotionGraph as Any), ("storyInteractionsGraph", _data.storyInteractionsGraph as Any), ("storyReactionsByEmotionGraph", _data.storyReactionsByEmotionGraph as Any), ("recentPostsInteractions", _data.recentPostsInteractions as Any)]) + 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))]) } } @@ -1394,8 +1394,8 @@ public extension Api.stats { self.topInviters = topInviters self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("megagroupStats", [("period", self.period as Any), ("members", self.members as Any), ("messages", self.messages as Any), ("viewers", self.viewers as Any), ("posters", self.posters as Any), ("growthGraph", self.growthGraph as Any), ("membersGraph", self.membersGraph as Any), ("newMembersBySourceGraph", self.newMembersBySourceGraph as Any), ("languagesGraph", self.languagesGraph as Any), ("messagesGraph", self.messagesGraph as Any), ("actionsGraph", self.actionsGraph as Any), ("topHoursGraph", self.topHoursGraph as Any), ("weekdaysGraph", self.weekdaysGraph as Any), ("topPosters", self.topPosters as Any), ("topAdmins", self.topAdmins as Any), ("topInviters", self.topInviters as Any), ("users", self.users as Any)]) + 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) @@ -1443,10 +1443,10 @@ public extension Api.stats { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .megagroupStats(let _data): - return ("megagroupStats", [("period", _data.period as Any), ("members", _data.members as Any), ("messages", _data.messages as Any), ("viewers", _data.viewers as Any), ("posters", _data.posters as Any), ("growthGraph", _data.growthGraph as Any), ("membersGraph", _data.membersGraph as Any), ("newMembersBySourceGraph", _data.newMembersBySourceGraph as Any), ("languagesGraph", _data.languagesGraph as Any), ("messagesGraph", _data.messagesGraph as Any), ("actionsGraph", _data.actionsGraph as Any), ("topHoursGraph", _data.topHoursGraph as Any), ("weekdaysGraph", _data.weekdaysGraph as Any), ("topPosters", _data.topPosters as Any), ("topAdmins", _data.topAdmins as Any), ("topInviters", _data.topInviters as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1554,8 +1554,8 @@ public extension Api.stats { self.viewsGraph = viewsGraph self.reactionsByEmotionGraph = reactionsByEmotionGraph } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("messageStats", [("viewsGraph", self.viewsGraph as Any), ("reactionsByEmotionGraph", self.reactionsByEmotionGraph as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("messageStats", [("viewsGraph", ConstructorParameterDescription(self.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.reactionsByEmotionGraph))]) } } case messageStats(Cons_messageStats) @@ -1572,10 +1572,10 @@ public extension Api.stats { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .messageStats(let _data): - return ("messageStats", [("viewsGraph", _data.viewsGraph as Any), ("reactionsByEmotionGraph", _data.reactionsByEmotionGraph as Any)]) + return ("messageStats", [("viewsGraph", ConstructorParameterDescription(_data.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph))]) } } @@ -1616,8 +1616,8 @@ public extension Api.stats { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("publicForwards", [("flags", self.flags as Any), ("count", self.count as Any), ("forwards", self.forwards as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -1652,10 +1652,10 @@ public extension Api.stats { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .publicForwards(let _data): - return ("publicForwards", [("flags", _data.flags as Any), ("count", _data.count as Any), ("forwards", _data.forwards as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1704,8 +1704,8 @@ public extension Api.stats { self.viewsGraph = viewsGraph self.reactionsByEmotionGraph = reactionsByEmotionGraph } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyStats", [("viewsGraph", self.viewsGraph as Any), ("reactionsByEmotionGraph", self.reactionsByEmotionGraph as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyStats", [("viewsGraph", ConstructorParameterDescription(self.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(self.reactionsByEmotionGraph))]) } } case storyStats(Cons_storyStats) @@ -1722,10 +1722,10 @@ public extension Api.stats { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyStats(let _data): - return ("storyStats", [("viewsGraph", _data.viewsGraph as Any), ("reactionsByEmotionGraph", _data.reactionsByEmotionGraph as Any)]) + return ("storyStats", [("viewsGraph", ConstructorParameterDescription(_data.viewsGraph)), ("reactionsByEmotionGraph", ConstructorParameterDescription(_data.reactionsByEmotionGraph))]) } } @@ -1756,8 +1756,8 @@ public extension Api.stickers { public init(shortName: String) { self.shortName = shortName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("suggestedShortName", [("shortName", self.shortName as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("suggestedShortName", [("shortName", ConstructorParameterDescription(self.shortName))]) } } case suggestedShortName(Cons_suggestedShortName) @@ -1773,10 +1773,10 @@ public extension Api.stickers { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .suggestedShortName(let _data): - return ("suggestedShortName", [("shortName", _data.shortName as Any)]) + return ("suggestedShortName", [("shortName", ConstructorParameterDescription(_data.shortName))]) } } @@ -1861,7 +1861,7 @@ public extension Api.storage { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .fileGif: return ("fileGif", []) diff --git a/submodules/TelegramApi/Sources/Api39.swift b/submodules/TelegramApi/Sources/Api39.swift index d613584bff..e2afa538c0 100644 --- a/submodules/TelegramApi/Sources/Api39.swift +++ b/submodules/TelegramApi/Sources/Api39.swift @@ -7,8 +7,8 @@ public extension Api.stories { self.hash = hash self.albums = albums } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("albums", [("hash", self.hash as Any), ("albums", self.albums as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("albums", [("hash", ConstructorParameterDescription(self.hash)), ("albums", ConstructorParameterDescription(self.albums))]) } } case albums(Cons_albums) @@ -35,10 +35,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .albums(let _data): - return ("albums", [("hash", _data.hash as Any), ("albums", _data.albums as Any)]) + return ("albums", [("hash", ConstructorParameterDescription(_data.hash)), ("albums", ConstructorParameterDescription(_data.albums))]) case .albumsNotModified: return ("albumsNotModified", []) } @@ -84,8 +84,8 @@ public extension Api.stories { self.users = users self.stealthMode = stealthMode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("allStories", [("flags", self.flags as Any), ("count", self.count as Any), ("state", self.state as Any), ("peerStories", self.peerStories as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("stealthMode", self.stealthMode as Any)]) + 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 { @@ -97,8 +97,8 @@ public extension Api.stories { self.state = state self.stealthMode = stealthMode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("allStoriesNotModified", [("flags", self.flags as Any), ("state", self.state as Any), ("stealthMode", self.stealthMode as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("allStoriesNotModified", [("flags", ConstructorParameterDescription(self.flags)), ("state", ConstructorParameterDescription(self.state)), ("stealthMode", ConstructorParameterDescription(self.stealthMode))]) } } case allStories(Cons_allStories) @@ -141,12 +141,12 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .allStories(let _data): - return ("allStories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("state", _data.state as Any), ("peerStories", _data.peerStories as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("stealthMode", _data.stealthMode as Any)]) + 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", _data.flags as Any), ("state", _data.state as Any), ("stealthMode", _data.stealthMode as Any)]) + return ("allStoriesNotModified", [("flags", ConstructorParameterDescription(_data.flags)), ("state", ConstructorParameterDescription(_data.state)), ("stealthMode", ConstructorParameterDescription(_data.stealthMode))]) } } @@ -215,8 +215,8 @@ public extension Api.stories { public init(countRemains: Int32) { self.countRemains = countRemains } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("canSendStoryCount", [("countRemains", self.countRemains as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("canSendStoryCount", [("countRemains", ConstructorParameterDescription(self.countRemains))]) } } case canSendStoryCount(Cons_canSendStoryCount) @@ -232,10 +232,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .canSendStoryCount(let _data): - return ("canSendStoryCount", [("countRemains", _data.countRemains as Any)]) + return ("canSendStoryCount", [("countRemains", ConstructorParameterDescription(_data.countRemains))]) } } @@ -269,8 +269,8 @@ public extension Api.stories { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("foundStories", [("flags", self.flags as Any), ("count", self.count as Any), ("stories", self.stories as Any), ("nextOffset", self.nextOffset as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -305,10 +305,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .foundStories(let _data): - return ("foundStories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("stories", _data.stories as Any), ("nextOffset", _data.nextOffset as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -359,8 +359,8 @@ public extension Api.stories { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("peerStories", [("stories", self.stories as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("peerStories", [("stories", ConstructorParameterDescription(self.stories)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case peerStories(Cons_peerStories) @@ -386,10 +386,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .peerStories(let _data): - return ("peerStories", [("stories", _data.stories as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("peerStories", [("stories", ConstructorParameterDescription(_data.stories)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -435,8 +435,8 @@ public extension Api.stories { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("stories", [("flags", self.flags as Any), ("count", self.count as Any), ("stories", self.stories as Any), ("pinnedToTop", self.pinnedToTop as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -475,10 +475,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .stories(let _data): - return ("stories", [("flags", _data.flags as Any), ("count", _data.count as Any), ("stories", _data.stories as Any), ("pinnedToTop", _data.pinnedToTop as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -537,8 +537,8 @@ public extension Api.stories { self.users = users self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyReactionsList", [("flags", self.flags as Any), ("count", self.count as Any), ("reactions", self.reactions as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("nextOffset", self.nextOffset as Any)]) + 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) @@ -573,10 +573,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyReactionsList(let _data): - return ("storyReactionsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("reactions", _data.reactions as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + 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))]) } } @@ -625,8 +625,8 @@ public extension Api.stories { self.views = views self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyViews", [("views", self.views as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("storyViews", [("views", ConstructorParameterDescription(self.views)), ("users", ConstructorParameterDescription(self.users))]) } } case storyViews(Cons_storyViews) @@ -651,10 +651,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyViews(let _data): - return ("storyViews", [("views", _data.views as Any), ("users", _data.users as Any)]) + return ("storyViews", [("views", ConstructorParameterDescription(_data.views)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -701,8 +701,8 @@ public extension Api.stories { self.users = users self.nextOffset = nextOffset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("storyViewsList", [("flags", self.flags as Any), ("count", self.count as Any), ("viewsCount", self.viewsCount as Any), ("forwardsCount", self.forwardsCount as Any), ("reactionsCount", self.reactionsCount as Any), ("views", self.views as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("nextOffset", self.nextOffset as Any)]) + 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) @@ -740,10 +740,10 @@ public extension Api.stories { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .storyViewsList(let _data): - return ("storyViewsList", [("flags", _data.flags as Any), ("count", _data.count as Any), ("viewsCount", _data.viewsCount as Any), ("forwardsCount", _data.forwardsCount as Any), ("reactionsCount", _data.reactionsCount as Any), ("views", _data.views as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("nextOffset", _data.nextOffset as Any)]) + 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))]) } } @@ -811,8 +811,8 @@ public extension Api.updates { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelDifference", [("flags", self.flags as Any), ("pts", self.pts as Any), ("timeout", self.timeout as Any), ("newMessages", self.newMessages as Any), ("otherUpdates", self.otherUpdates as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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 { @@ -824,8 +824,8 @@ public extension Api.updates { self.pts = pts self.timeout = timeout } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelDifferenceEmpty", [("flags", self.flags as Any), ("pts", self.pts as Any), ("timeout", self.timeout as Any)]) + 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 { @@ -843,8 +843,8 @@ public extension Api.updates { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelDifferenceTooLong", [("flags", self.flags as Any), ("timeout", self.timeout as Any), ("dialog", self.dialog as Any), ("messages", self.messages as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + 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) @@ -921,14 +921,14 @@ public extension Api.updates { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelDifference(let _data): - return ("channelDifference", [("flags", _data.flags as Any), ("pts", _data.pts as Any), ("timeout", _data.timeout as Any), ("newMessages", _data.newMessages as Any), ("otherUpdates", _data.otherUpdates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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", _data.flags as Any), ("pts", _data.pts as Any), ("timeout", _data.timeout as Any)]) + return ("channelDifferenceEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("pts", ConstructorParameterDescription(_data.pts)), ("timeout", ConstructorParameterDescription(_data.timeout))]) case .channelDifferenceTooLong(let _data): - return ("channelDifferenceTooLong", [("flags", _data.flags as Any), ("timeout", _data.timeout as Any), ("dialog", _data.dialog as Any), ("messages", _data.messages as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + 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))]) } } @@ -1045,8 +1045,8 @@ public extension Api.updates { self.users = users self.state = state } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("difference", [("newMessages", self.newMessages as Any), ("newEncryptedMessages", self.newEncryptedMessages as Any), ("otherUpdates", self.otherUpdates as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("state", self.state as Any)]) + 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 { @@ -1056,8 +1056,8 @@ public extension Api.updates { self.date = date self.seq = seq } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("differenceEmpty", [("date", self.date as Any), ("seq", self.seq as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("differenceEmpty", [("date", ConstructorParameterDescription(self.date)), ("seq", ConstructorParameterDescription(self.seq))]) } } public class Cons_differenceSlice: TypeConstructorDescription { @@ -1075,8 +1075,8 @@ public extension Api.updates { self.users = users self.intermediateState = intermediateState } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("differenceSlice", [("newMessages", self.newMessages as Any), ("newEncryptedMessages", self.newEncryptedMessages as Any), ("otherUpdates", self.otherUpdates as Any), ("chats", self.chats as Any), ("users", self.users as Any), ("intermediateState", self.intermediateState as Any)]) + 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 { @@ -1084,8 +1084,8 @@ public extension Api.updates { public init(pts: Int32) { self.pts = pts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("differenceTooLong", [("pts", self.pts as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("differenceTooLong", [("pts", ConstructorParameterDescription(self.pts))]) } } case difference(Cons_difference) @@ -1173,16 +1173,16 @@ public extension Api.updates { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .difference(let _data): - return ("difference", [("newMessages", _data.newMessages as Any), ("newEncryptedMessages", _data.newEncryptedMessages as Any), ("otherUpdates", _data.otherUpdates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("state", _data.state as Any)]) + 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", _data.date as Any), ("seq", _data.seq as Any)]) + return ("differenceEmpty", [("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq))]) case .differenceSlice(let _data): - return ("differenceSlice", [("newMessages", _data.newMessages as Any), ("newEncryptedMessages", _data.newEncryptedMessages as Any), ("otherUpdates", _data.otherUpdates as Any), ("chats", _data.chats as Any), ("users", _data.users as Any), ("intermediateState", _data.intermediateState as Any)]) + 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", _data.pts as Any)]) + return ("differenceTooLong", [("pts", ConstructorParameterDescription(_data.pts))]) } } @@ -1304,8 +1304,8 @@ public extension Api.updates { self.seq = seq self.unreadCount = unreadCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("state", [("pts", self.pts as Any), ("qts", self.qts as Any), ("date", self.date as Any), ("seq", self.seq as Any), ("unreadCount", self.unreadCount as Any)]) + 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) @@ -1325,10 +1325,10 @@ public extension Api.updates { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .state(let _data): - return ("state", [("pts", _data.pts as Any), ("qts", _data.qts as Any), ("date", _data.date as Any), ("seq", _data.seq as Any), ("unreadCount", _data.unreadCount as Any)]) + return ("state", [("pts", ConstructorParameterDescription(_data.pts)), ("qts", ConstructorParameterDescription(_data.qts)), ("date", ConstructorParameterDescription(_data.date)), ("seq", ConstructorParameterDescription(_data.seq)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount))]) } } @@ -1364,8 +1364,8 @@ public extension Api.upload { public init(bytes: Buffer) { self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("cdnFile", [("bytes", self.bytes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("cdnFile", [("bytes", ConstructorParameterDescription(self.bytes))]) } } public class Cons_cdnFileReuploadNeeded: TypeConstructorDescription { @@ -1373,8 +1373,8 @@ public extension Api.upload { public init(requestToken: Buffer) { self.requestToken = requestToken } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("cdnFileReuploadNeeded", [("requestToken", self.requestToken as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("cdnFileReuploadNeeded", [("requestToken", ConstructorParameterDescription(self.requestToken))]) } } case cdnFile(Cons_cdnFile) @@ -1397,12 +1397,12 @@ public extension Api.upload { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .cdnFile(let _data): - return ("cdnFile", [("bytes", _data.bytes as Any)]) + return ("cdnFile", [("bytes", ConstructorParameterDescription(_data.bytes))]) case .cdnFileReuploadNeeded(let _data): - return ("cdnFileReuploadNeeded", [("requestToken", _data.requestToken as Any)]) + return ("cdnFileReuploadNeeded", [("requestToken", ConstructorParameterDescription(_data.requestToken))]) } } @@ -1441,8 +1441,8 @@ public extension Api.upload { self.mtime = mtime self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("file", [("type", self.type as Any), ("mtime", self.mtime as Any), ("bytes", self.bytes as Any)]) + 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 { @@ -1458,8 +1458,8 @@ public extension Api.upload { self.encryptionIv = encryptionIv self.fileHashes = fileHashes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("fileCdnRedirect", [("dcId", self.dcId as Any), ("fileToken", self.fileToken as Any), ("encryptionKey", self.encryptionKey as Any), ("encryptionIv", self.encryptionIv as Any), ("fileHashes", self.fileHashes as Any)]) + 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) @@ -1492,12 +1492,12 @@ public extension Api.upload { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .file(let _data): - return ("file", [("type", _data.type as Any), ("mtime", _data.mtime as Any), ("bytes", _data.bytes as Any)]) + return ("file", [("type", ConstructorParameterDescription(_data.type)), ("mtime", ConstructorParameterDescription(_data.mtime)), ("bytes", ConstructorParameterDescription(_data.bytes))]) case .fileCdnRedirect(let _data): - return ("fileCdnRedirect", [("dcId", _data.dcId as Any), ("fileToken", _data.fileToken as Any), ("encryptionKey", _data.encryptionKey as Any), ("encryptionIv", _data.encryptionIv as Any), ("fileHashes", _data.fileHashes as Any)]) + return ("fileCdnRedirect", [("dcId", ConstructorParameterDescription(_data.dcId)), ("fileToken", ConstructorParameterDescription(_data.fileToken)), ("encryptionKey", ConstructorParameterDescription(_data.encryptionKey)), ("encryptionIv", ConstructorParameterDescription(_data.encryptionIv)), ("fileHashes", ConstructorParameterDescription(_data.fileHashes))]) } } @@ -1562,8 +1562,8 @@ public extension Api.upload { self.mtime = mtime self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("webFile", [("size", self.size as Any), ("mimeType", self.mimeType as Any), ("fileType", self.fileType as Any), ("mtime", self.mtime as Any), ("bytes", self.bytes as Any)]) + 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) @@ -1583,10 +1583,10 @@ public extension Api.upload { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .webFile(let _data): - return ("webFile", [("size", _data.size as Any), ("mimeType", _data.mimeType as Any), ("fileType", _data.fileType as Any), ("mtime", _data.mtime as Any), ("bytes", _data.bytes as Any)]) + return ("webFile", [("size", ConstructorParameterDescription(_data.size)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("fileType", ConstructorParameterDescription(_data.fileType)), ("mtime", ConstructorParameterDescription(_data.mtime)), ("bytes", ConstructorParameterDescription(_data.bytes))]) } } @@ -1626,8 +1626,8 @@ public extension Api.users { self.count = count self.documents = documents } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedMusic", [("count", self.count as Any), ("documents", self.documents as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedMusic", [("count", ConstructorParameterDescription(self.count)), ("documents", ConstructorParameterDescription(self.documents))]) } } public class Cons_savedMusicNotModified: TypeConstructorDescription { @@ -1635,8 +1635,8 @@ public extension Api.users { public init(count: Int32) { self.count = count } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("savedMusicNotModified", [("count", self.count as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("savedMusicNotModified", [("count", ConstructorParameterDescription(self.count))]) } } case savedMusic(Cons_savedMusic) @@ -1664,12 +1664,12 @@ public extension Api.users { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .savedMusic(let _data): - return ("savedMusic", [("count", _data.count as Any), ("documents", _data.documents as Any)]) + return ("savedMusic", [("count", ConstructorParameterDescription(_data.count)), ("documents", ConstructorParameterDescription(_data.documents))]) case .savedMusicNotModified(let _data): - return ("savedMusicNotModified", [("count", _data.count as Any)]) + return ("savedMusicNotModified", [("count", ConstructorParameterDescription(_data.count))]) } } @@ -1713,8 +1713,8 @@ public extension Api.users { self.chats = chats self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("userFull", [("fullUser", self.fullUser as Any), ("chats", self.chats as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("userFull", [("fullUser", ConstructorParameterDescription(self.fullUser)), ("chats", ConstructorParameterDescription(self.chats)), ("users", ConstructorParameterDescription(self.users))]) } } case userFull(Cons_userFull) @@ -1740,10 +1740,10 @@ public extension Api.users { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .userFull(let _data): - return ("userFull", [("fullUser", _data.fullUser as Any), ("chats", _data.chats as Any), ("users", _data.users as Any)]) + return ("userFull", [("fullUser", ConstructorParameterDescription(_data.fullUser)), ("chats", ConstructorParameterDescription(_data.chats)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -1779,8 +1779,8 @@ public extension Api.users { public init(users: [Api.User]) { self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("users", [("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("users", [("users", ConstructorParameterDescription(self.users))]) } } public class Cons_usersSlice: TypeConstructorDescription { @@ -1790,8 +1790,8 @@ public extension Api.users { self.count = count self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("usersSlice", [("count", self.count as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("usersSlice", [("count", ConstructorParameterDescription(self.count)), ("users", ConstructorParameterDescription(self.users))]) } } case users(Cons_users) @@ -1823,12 +1823,12 @@ public extension Api.users { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .users(let _data): - return ("users", [("users", _data.users as Any)]) + return ("users", [("users", ConstructorParameterDescription(_data.users))]) case .usersSlice(let _data): - return ("usersSlice", [("count", _data.count as Any), ("users", _data.users as Any)]) + return ("usersSlice", [("count", ConstructorParameterDescription(_data.count)), ("users", ConstructorParameterDescription(_data.users))]) } } diff --git a/submodules/TelegramApi/Sources/Api4.swift b/submodules/TelegramApi/Sources/Api4.swift index 1f602530a1..1b2814cb3a 100644 --- a/submodules/TelegramApi/Sources/Api4.swift +++ b/submodules/TelegramApi/Sources/Api4.swift @@ -5,8 +5,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelAdminLogEventsFilter", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelAdminLogEventsFilter", [("flags", ConstructorParameterDescription(self.flags))]) } } case channelAdminLogEventsFilter(Cons_channelAdminLogEventsFilter) @@ -22,10 +22,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelAdminLogEventsFilter(let _data): - return ("channelAdminLogEventsFilter", [("flags", _data.flags as Any)]) + return ("channelAdminLogEventsFilter", [("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -51,8 +51,8 @@ public extension Api { self.geoPoint = geoPoint self.address = address } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelLocation", [("geoPoint", self.geoPoint as Any), ("address", self.address as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelLocation", [("geoPoint", ConstructorParameterDescription(self.geoPoint)), ("address", ConstructorParameterDescription(self.address))]) } } case channelLocation(Cons_channelLocation) @@ -75,10 +75,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelLocation(let _data): - return ("channelLocation", [("geoPoint", _data.geoPoint as Any), ("address", _data.address as Any)]) + return ("channelLocation", [("geoPoint", ConstructorParameterDescription(_data.geoPoint)), ("address", ConstructorParameterDescription(_data.address))]) case .channelLocationEmpty: return ("channelLocationEmpty", []) } @@ -114,8 +114,8 @@ public extension Api { self.flags = flags self.ranges = ranges } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelMessagesFilter", [("flags", self.flags as Any), ("ranges", self.ranges as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelMessagesFilter", [("flags", ConstructorParameterDescription(self.flags)), ("ranges", ConstructorParameterDescription(self.ranges))]) } } case channelMessagesFilter(Cons_channelMessagesFilter) @@ -142,10 +142,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelMessagesFilter(let _data): - return ("channelMessagesFilter", [("flags", _data.flags as Any), ("ranges", _data.ranges as Any)]) + return ("channelMessagesFilter", [("flags", ConstructorParameterDescription(_data.flags)), ("ranges", ConstructorParameterDescription(_data.ranges))]) case .channelMessagesFilterEmpty: return ("channelMessagesFilterEmpty", []) } @@ -187,8 +187,8 @@ public extension Api { self.subscriptionUntilDate = subscriptionUntilDate self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipant", [("flags", self.flags as Any), ("userId", self.userId as Any), ("date", self.date as Any), ("subscriptionUntilDate", self.subscriptionUntilDate as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipant", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.date)), ("subscriptionUntilDate", ConstructorParameterDescription(self.subscriptionUntilDate)), ("rank", ConstructorParameterDescription(self.rank))]) } } public class Cons_channelParticipantAdmin: TypeConstructorDescription { @@ -208,8 +208,8 @@ public extension Api { self.adminRights = adminRights self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantAdmin", [("flags", self.flags as Any), ("userId", self.userId as Any), ("inviterId", self.inviterId as Any), ("promotedBy", self.promotedBy as Any), ("date", self.date as Any), ("adminRights", self.adminRights as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantAdmin", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("inviterId", ConstructorParameterDescription(self.inviterId)), ("promotedBy", ConstructorParameterDescription(self.promotedBy)), ("date", ConstructorParameterDescription(self.date)), ("adminRights", ConstructorParameterDescription(self.adminRights)), ("rank", ConstructorParameterDescription(self.rank))]) } } public class Cons_channelParticipantBanned: TypeConstructorDescription { @@ -227,8 +227,8 @@ public extension Api { self.bannedRights = bannedRights self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantBanned", [("flags", self.flags as Any), ("peer", self.peer as Any), ("kickedBy", self.kickedBy as Any), ("date", self.date as Any), ("bannedRights", self.bannedRights as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantBanned", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("kickedBy", ConstructorParameterDescription(self.kickedBy)), ("date", ConstructorParameterDescription(self.date)), ("bannedRights", ConstructorParameterDescription(self.bannedRights)), ("rank", ConstructorParameterDescription(self.rank))]) } } public class Cons_channelParticipantCreator: TypeConstructorDescription { @@ -242,8 +242,8 @@ public extension Api { self.adminRights = adminRights self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantCreator", [("flags", self.flags as Any), ("userId", self.userId as Any), ("adminRights", self.adminRights as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantCreator", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("adminRights", ConstructorParameterDescription(self.adminRights)), ("rank", ConstructorParameterDescription(self.rank))]) } } public class Cons_channelParticipantLeft: TypeConstructorDescription { @@ -251,8 +251,8 @@ public extension Api { public init(peer: Api.Peer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantLeft", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantLeft", [("peer", ConstructorParameterDescription(self.peer))]) } } public class Cons_channelParticipantSelf: TypeConstructorDescription { @@ -270,8 +270,8 @@ public extension Api { self.subscriptionUntilDate = subscriptionUntilDate self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantSelf", [("flags", self.flags as Any), ("userId", self.userId as Any), ("inviterId", self.inviterId as Any), ("date", self.date as Any), ("subscriptionUntilDate", self.subscriptionUntilDate as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantSelf", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("inviterId", ConstructorParameterDescription(self.inviterId)), ("date", ConstructorParameterDescription(self.date)), ("subscriptionUntilDate", ConstructorParameterDescription(self.subscriptionUntilDate)), ("rank", ConstructorParameterDescription(self.rank))]) } } case channelParticipant(Cons_channelParticipant) @@ -361,20 +361,20 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelParticipant(let _data): - return ("channelParticipant", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("date", _data.date as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any), ("rank", _data.rank as Any)]) + return ("channelParticipant", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date)), ("subscriptionUntilDate", ConstructorParameterDescription(_data.subscriptionUntilDate)), ("rank", ConstructorParameterDescription(_data.rank))]) case .channelParticipantAdmin(let _data): - return ("channelParticipantAdmin", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("promotedBy", _data.promotedBy as Any), ("date", _data.date as Any), ("adminRights", _data.adminRights as Any), ("rank", _data.rank as Any)]) + return ("channelParticipantAdmin", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("inviterId", ConstructorParameterDescription(_data.inviterId)), ("promotedBy", ConstructorParameterDescription(_data.promotedBy)), ("date", ConstructorParameterDescription(_data.date)), ("adminRights", ConstructorParameterDescription(_data.adminRights)), ("rank", ConstructorParameterDescription(_data.rank))]) case .channelParticipantBanned(let _data): - return ("channelParticipantBanned", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("kickedBy", _data.kickedBy as Any), ("date", _data.date as Any), ("bannedRights", _data.bannedRights as Any), ("rank", _data.rank as Any)]) + return ("channelParticipantBanned", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("kickedBy", ConstructorParameterDescription(_data.kickedBy)), ("date", ConstructorParameterDescription(_data.date)), ("bannedRights", ConstructorParameterDescription(_data.bannedRights)), ("rank", ConstructorParameterDescription(_data.rank))]) case .channelParticipantCreator(let _data): - return ("channelParticipantCreator", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("adminRights", _data.adminRights as Any), ("rank", _data.rank as Any)]) + return ("channelParticipantCreator", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("adminRights", ConstructorParameterDescription(_data.adminRights)), ("rank", ConstructorParameterDescription(_data.rank))]) case .channelParticipantLeft(let _data): - return ("channelParticipantLeft", [("peer", _data.peer as Any)]) + return ("channelParticipantLeft", [("peer", ConstructorParameterDescription(_data.peer))]) case .channelParticipantSelf(let _data): - return ("channelParticipantSelf", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any), ("rank", _data.rank as Any)]) + return ("channelParticipantSelf", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("inviterId", ConstructorParameterDescription(_data.inviterId)), ("date", ConstructorParameterDescription(_data.date)), ("subscriptionUntilDate", ConstructorParameterDescription(_data.subscriptionUntilDate)), ("rank", ConstructorParameterDescription(_data.rank))]) } } @@ -548,8 +548,8 @@ public extension Api { public init(q: String) { self.q = q } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantsBanned", [("q", self.q as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantsBanned", [("q", ConstructorParameterDescription(self.q))]) } } public class Cons_channelParticipantsContacts: TypeConstructorDescription { @@ -557,8 +557,8 @@ public extension Api { public init(q: String) { self.q = q } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantsContacts", [("q", self.q as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantsContacts", [("q", ConstructorParameterDescription(self.q))]) } } public class Cons_channelParticipantsKicked: TypeConstructorDescription { @@ -566,8 +566,8 @@ public extension Api { public init(q: String) { self.q = q } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantsKicked", [("q", self.q as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantsKicked", [("q", ConstructorParameterDescription(self.q))]) } } public class Cons_channelParticipantsMentions: TypeConstructorDescription { @@ -579,8 +579,8 @@ public extension Api { self.q = q self.topMsgId = topMsgId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantsMentions", [("flags", self.flags as Any), ("q", self.q as Any), ("topMsgId", self.topMsgId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantsMentions", [("flags", ConstructorParameterDescription(self.flags)), ("q", ConstructorParameterDescription(self.q)), ("topMsgId", ConstructorParameterDescription(self.topMsgId))]) } } public class Cons_channelParticipantsSearch: TypeConstructorDescription { @@ -588,8 +588,8 @@ public extension Api { public init(q: String) { self.q = q } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelParticipantsSearch", [("q", self.q as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelParticipantsSearch", [("q", ConstructorParameterDescription(self.q))]) } } case channelParticipantsAdmins @@ -657,24 +657,24 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelParticipantsAdmins: return ("channelParticipantsAdmins", []) case .channelParticipantsBanned(let _data): - return ("channelParticipantsBanned", [("q", _data.q as Any)]) + return ("channelParticipantsBanned", [("q", ConstructorParameterDescription(_data.q))]) case .channelParticipantsBots: return ("channelParticipantsBots", []) case .channelParticipantsContacts(let _data): - return ("channelParticipantsContacts", [("q", _data.q as Any)]) + return ("channelParticipantsContacts", [("q", ConstructorParameterDescription(_data.q))]) case .channelParticipantsKicked(let _data): - return ("channelParticipantsKicked", [("q", _data.q as Any)]) + return ("channelParticipantsKicked", [("q", ConstructorParameterDescription(_data.q))]) case .channelParticipantsMentions(let _data): - return ("channelParticipantsMentions", [("flags", _data.flags as Any), ("q", _data.q as Any), ("topMsgId", _data.topMsgId as Any)]) + return ("channelParticipantsMentions", [("flags", ConstructorParameterDescription(_data.flags)), ("q", ConstructorParameterDescription(_data.q)), ("topMsgId", ConstructorParameterDescription(_data.topMsgId))]) case .channelParticipantsRecent: return ("channelParticipantsRecent", []) case .channelParticipantsSearch(let _data): - return ("channelParticipantsSearch", [("q", _data.q as Any)]) + return ("channelParticipantsSearch", [("q", ConstructorParameterDescription(_data.q))]) } } @@ -754,56 +754,6 @@ public extension Api { } } } -public extension Api { - enum ChannelTopic: TypeConstructorDescription { - public class Cons_channelTopic: TypeConstructorDescription { - public var id: Int32 - public var title: String - public init(id: Int32, title: String) { - self.id = id - self.title = title - } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelTopic", [("id", self.id as Any), ("title", self.title as Any)]) - } - } - case channelTopic(Cons_channelTopic) - - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { - switch self { - case .channelTopic(let _data): - if boxed { - buffer.appendInt32(-1817845901) - } - serializeInt32(_data.id, buffer: buffer, boxed: false) - serializeString(_data.title, buffer: buffer, boxed: false) - break - } - } - - public func descriptionFields() -> (String, [(String, Any)]) { - switch self { - case .channelTopic(let _data): - return ("channelTopic", [("id", _data.id as Any), ("title", _data.title as Any)]) - } - } - - public static func parse_channelTopic(_ reader: BufferReader) -> ChannelTopic? { - 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.ChannelTopic.channelTopic(Cons_channelTopic(id: _1!, title: _2!)) - } - else { - return nil - } - } - } -} public extension Api { indirect enum Chat: TypeConstructorDescription { public class Cons_channel: TypeConstructorDescription { @@ -855,8 +805,8 @@ public extension Api { self.sendPaidMessagesStars = sendPaidMessagesStars self.linkedMonoforumId = linkedMonoforumId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channel", [("flags", self.flags as Any), ("flags2", self.flags2 as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("title", self.title as Any), ("username", self.username as Any), ("photo", self.photo as Any), ("date", self.date as Any), ("restrictionReason", self.restrictionReason as Any), ("adminRights", self.adminRights as Any), ("bannedRights", self.bannedRights as Any), ("defaultBannedRights", self.defaultBannedRights as Any), ("participantsCount", self.participantsCount as Any), ("usernames", self.usernames as Any), ("storiesMaxId", self.storiesMaxId as Any), ("color", self.color as Any), ("profileColor", self.profileColor as Any), ("emojiStatus", self.emojiStatus as Any), ("level", self.level as Any), ("subscriptionUntilDate", self.subscriptionUntilDate as Any), ("botVerificationIcon", self.botVerificationIcon as Any), ("sendPaidMessagesStars", self.sendPaidMessagesStars as Any), ("linkedMonoforumId", self.linkedMonoforumId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channel", [("flags", ConstructorParameterDescription(self.flags)), ("flags2", ConstructorParameterDescription(self.flags2)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("title", ConstructorParameterDescription(self.title)), ("username", ConstructorParameterDescription(self.username)), ("photo", ConstructorParameterDescription(self.photo)), ("date", ConstructorParameterDescription(self.date)), ("restrictionReason", ConstructorParameterDescription(self.restrictionReason)), ("adminRights", ConstructorParameterDescription(self.adminRights)), ("bannedRights", ConstructorParameterDescription(self.bannedRights)), ("defaultBannedRights", ConstructorParameterDescription(self.defaultBannedRights)), ("participantsCount", ConstructorParameterDescription(self.participantsCount)), ("usernames", ConstructorParameterDescription(self.usernames)), ("storiesMaxId", ConstructorParameterDescription(self.storiesMaxId)), ("color", ConstructorParameterDescription(self.color)), ("profileColor", ConstructorParameterDescription(self.profileColor)), ("emojiStatus", ConstructorParameterDescription(self.emojiStatus)), ("level", ConstructorParameterDescription(self.level)), ("subscriptionUntilDate", ConstructorParameterDescription(self.subscriptionUntilDate)), ("botVerificationIcon", ConstructorParameterDescription(self.botVerificationIcon)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars)), ("linkedMonoforumId", ConstructorParameterDescription(self.linkedMonoforumId))]) } } public class Cons_channelForbidden: TypeConstructorDescription { @@ -872,8 +822,8 @@ public extension Api { self.title = title self.untilDate = untilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelForbidden", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("title", self.title as Any), ("untilDate", self.untilDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("channelForbidden", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("title", ConstructorParameterDescription(self.title)), ("untilDate", ConstructorParameterDescription(self.untilDate))]) } } public class Cons_chat: TypeConstructorDescription { @@ -899,8 +849,8 @@ public extension Api { self.adminRights = adminRights self.defaultBannedRights = defaultBannedRights } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chat", [("flags", self.flags as Any), ("id", self.id as Any), ("title", self.title as Any), ("photo", self.photo as Any), ("participantsCount", self.participantsCount as Any), ("date", self.date as Any), ("version", self.version as Any), ("migratedTo", self.migratedTo as Any), ("adminRights", self.adminRights as Any), ("defaultBannedRights", self.defaultBannedRights as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chat", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title)), ("photo", ConstructorParameterDescription(self.photo)), ("participantsCount", ConstructorParameterDescription(self.participantsCount)), ("date", ConstructorParameterDescription(self.date)), ("version", ConstructorParameterDescription(self.version)), ("migratedTo", ConstructorParameterDescription(self.migratedTo)), ("adminRights", ConstructorParameterDescription(self.adminRights)), ("defaultBannedRights", ConstructorParameterDescription(self.defaultBannedRights))]) } } public class Cons_chatEmpty: TypeConstructorDescription { @@ -908,8 +858,8 @@ public extension Api { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatEmpty", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatEmpty", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_chatForbidden: TypeConstructorDescription { @@ -919,8 +869,8 @@ public extension Api { self.id = id self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatForbidden", [("id", self.id as Any), ("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatForbidden", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title))]) } } case channel(Cons_channel) @@ -1050,18 +1000,18 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channel(let _data): - return ("channel", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("title", _data.title as Any), ("username", _data.username as Any), ("photo", _data.photo as Any), ("date", _data.date as Any), ("restrictionReason", _data.restrictionReason as Any), ("adminRights", _data.adminRights as Any), ("bannedRights", _data.bannedRights as Any), ("defaultBannedRights", _data.defaultBannedRights as Any), ("participantsCount", _data.participantsCount as Any), ("usernames", _data.usernames as Any), ("storiesMaxId", _data.storiesMaxId as Any), ("color", _data.color as Any), ("profileColor", _data.profileColor as Any), ("emojiStatus", _data.emojiStatus as Any), ("level", _data.level as Any), ("subscriptionUntilDate", _data.subscriptionUntilDate as Any), ("botVerificationIcon", _data.botVerificationIcon as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("linkedMonoforumId", _data.linkedMonoforumId as Any)]) + return ("channel", [("flags", ConstructorParameterDescription(_data.flags)), ("flags2", ConstructorParameterDescription(_data.flags2)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("title", ConstructorParameterDescription(_data.title)), ("username", ConstructorParameterDescription(_data.username)), ("photo", ConstructorParameterDescription(_data.photo)), ("date", ConstructorParameterDescription(_data.date)), ("restrictionReason", ConstructorParameterDescription(_data.restrictionReason)), ("adminRights", ConstructorParameterDescription(_data.adminRights)), ("bannedRights", ConstructorParameterDescription(_data.bannedRights)), ("defaultBannedRights", ConstructorParameterDescription(_data.defaultBannedRights)), ("participantsCount", ConstructorParameterDescription(_data.participantsCount)), ("usernames", ConstructorParameterDescription(_data.usernames)), ("storiesMaxId", ConstructorParameterDescription(_data.storiesMaxId)), ("color", ConstructorParameterDescription(_data.color)), ("profileColor", ConstructorParameterDescription(_data.profileColor)), ("emojiStatus", ConstructorParameterDescription(_data.emojiStatus)), ("level", ConstructorParameterDescription(_data.level)), ("subscriptionUntilDate", ConstructorParameterDescription(_data.subscriptionUntilDate)), ("botVerificationIcon", ConstructorParameterDescription(_data.botVerificationIcon)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars)), ("linkedMonoforumId", ConstructorParameterDescription(_data.linkedMonoforumId))]) case .channelForbidden(let _data): - return ("channelForbidden", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("title", _data.title as Any), ("untilDate", _data.untilDate as Any)]) + return ("channelForbidden", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("title", ConstructorParameterDescription(_data.title)), ("untilDate", ConstructorParameterDescription(_data.untilDate))]) case .chat(let _data): - return ("chat", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("photo", _data.photo as Any), ("participantsCount", _data.participantsCount as Any), ("date", _data.date as Any), ("version", _data.version as Any), ("migratedTo", _data.migratedTo as Any), ("adminRights", _data.adminRights as Any), ("defaultBannedRights", _data.defaultBannedRights as Any)]) + return ("chat", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title)), ("photo", ConstructorParameterDescription(_data.photo)), ("participantsCount", ConstructorParameterDescription(_data.participantsCount)), ("date", ConstructorParameterDescription(_data.date)), ("version", ConstructorParameterDescription(_data.version)), ("migratedTo", ConstructorParameterDescription(_data.migratedTo)), ("adminRights", ConstructorParameterDescription(_data.adminRights)), ("defaultBannedRights", ConstructorParameterDescription(_data.defaultBannedRights))]) case .chatEmpty(let _data): - return ("chatEmpty", [("id", _data.id as Any)]) + return ("chatEmpty", [("id", ConstructorParameterDescription(_data.id))]) case .chatForbidden(let _data): - return ("chatForbidden", [("id", _data.id as Any), ("title", _data.title as Any)]) + return ("chatForbidden", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title))]) } } @@ -1307,8 +1257,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatAdminRights", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatAdminRights", [("flags", ConstructorParameterDescription(self.flags))]) } } case chatAdminRights(Cons_chatAdminRights) @@ -1324,10 +1274,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatAdminRights(let _data): - return ("chatAdminRights", [("flags", _data.flags as Any)]) + return ("chatAdminRights", [("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -1355,8 +1305,8 @@ public extension Api { self.invitesCount = invitesCount self.revokedInvitesCount = revokedInvitesCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatAdminWithInvites", [("adminId", self.adminId as Any), ("invitesCount", self.invitesCount as Any), ("revokedInvitesCount", self.revokedInvitesCount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatAdminWithInvites", [("adminId", ConstructorParameterDescription(self.adminId)), ("invitesCount", ConstructorParameterDescription(self.invitesCount)), ("revokedInvitesCount", ConstructorParameterDescription(self.revokedInvitesCount))]) } } case chatAdminWithInvites(Cons_chatAdminWithInvites) @@ -1374,10 +1324,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatAdminWithInvites(let _data): - return ("chatAdminWithInvites", [("adminId", _data.adminId as Any), ("invitesCount", _data.invitesCount as Any), ("revokedInvitesCount", _data.revokedInvitesCount as Any)]) + return ("chatAdminWithInvites", [("adminId", ConstructorParameterDescription(_data.adminId)), ("invitesCount", ConstructorParameterDescription(_data.invitesCount)), ("revokedInvitesCount", ConstructorParameterDescription(_data.revokedInvitesCount))]) } } @@ -1409,8 +1359,8 @@ public extension Api { self.flags = flags self.untilDate = untilDate } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatBannedRights", [("flags", self.flags as Any), ("untilDate", self.untilDate as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatBannedRights", [("flags", ConstructorParameterDescription(self.flags)), ("untilDate", ConstructorParameterDescription(self.untilDate))]) } } case chatBannedRights(Cons_chatBannedRights) @@ -1427,10 +1377,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatBannedRights(let _data): - return ("chatBannedRights", [("flags", _data.flags as Any), ("untilDate", _data.untilDate as Any)]) + return ("chatBannedRights", [("flags", ConstructorParameterDescription(_data.flags)), ("untilDate", ConstructorParameterDescription(_data.untilDate))]) } } @@ -1549,8 +1499,8 @@ public extension Api { self.sendPaidMessagesStars = sendPaidMessagesStars self.mainTab = mainTab } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("channelFull", [("flags", self.flags as Any), ("flags2", self.flags2 as Any), ("id", self.id as Any), ("about", self.about as Any), ("participantsCount", self.participantsCount as Any), ("adminsCount", self.adminsCount as Any), ("kickedCount", self.kickedCount as Any), ("bannedCount", self.bannedCount as Any), ("onlineCount", self.onlineCount as Any), ("readInboxMaxId", self.readInboxMaxId as Any), ("readOutboxMaxId", self.readOutboxMaxId as Any), ("unreadCount", self.unreadCount as Any), ("chatPhoto", self.chatPhoto as Any), ("notifySettings", self.notifySettings as Any), ("exportedInvite", self.exportedInvite as Any), ("botInfo", self.botInfo as Any), ("migratedFromChatId", self.migratedFromChatId as Any), ("migratedFromMaxId", self.migratedFromMaxId as Any), ("pinnedMsgId", self.pinnedMsgId as Any), ("stickerset", self.stickerset as Any), ("availableMinId", self.availableMinId as Any), ("folderId", self.folderId as Any), ("linkedChatId", self.linkedChatId as Any), ("location", self.location as Any), ("slowmodeSeconds", self.slowmodeSeconds as Any), ("slowmodeNextSendDate", self.slowmodeNextSendDate as Any), ("statsDc", self.statsDc as Any), ("pts", self.pts as Any), ("call", self.call as Any), ("ttlPeriod", self.ttlPeriod as Any), ("pendingSuggestions", self.pendingSuggestions as Any), ("groupcallDefaultJoinAs", self.groupcallDefaultJoinAs as Any), ("themeEmoticon", self.themeEmoticon as Any), ("requestsPending", self.requestsPending as Any), ("recentRequesters", self.recentRequesters as Any), ("defaultSendAs", self.defaultSendAs as Any), ("availableReactions", self.availableReactions as Any), ("reactionsLimit", self.reactionsLimit as Any), ("stories", self.stories as Any), ("wallpaper", self.wallpaper as Any), ("boostsApplied", self.boostsApplied as Any), ("boostsUnrestrict", self.boostsUnrestrict as Any), ("emojiset", self.emojiset as Any), ("botVerification", self.botVerification as Any), ("stargiftsCount", self.stargiftsCount as Any), ("sendPaidMessagesStars", self.sendPaidMessagesStars as Any), ("mainTab", self.mainTab as Any)]) + 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))]) } } public class Cons_chatFull: TypeConstructorDescription { @@ -1592,8 +1542,8 @@ public extension Api { self.availableReactions = availableReactions self.reactionsLimit = reactionsLimit } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatFull", [("flags", self.flags as Any), ("id", self.id as Any), ("about", self.about as Any), ("participants", self.participants as Any), ("chatPhoto", self.chatPhoto as Any), ("notifySettings", self.notifySettings as Any), ("exportedInvite", self.exportedInvite as Any), ("botInfo", self.botInfo as Any), ("pinnedMsgId", self.pinnedMsgId as Any), ("folderId", self.folderId as Any), ("call", self.call as Any), ("ttlPeriod", self.ttlPeriod as Any), ("groupcallDefaultJoinAs", self.groupcallDefaultJoinAs as Any), ("themeEmoticon", self.themeEmoticon as Any), ("requestsPending", self.requestsPending as Any), ("recentRequesters", self.recentRequesters as Any), ("availableReactions", self.availableReactions as Any), ("reactionsLimit", self.reactionsLimit as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatFull", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("about", ConstructorParameterDescription(self.about)), ("participants", ConstructorParameterDescription(self.participants)), ("chatPhoto", ConstructorParameterDescription(self.chatPhoto)), ("notifySettings", ConstructorParameterDescription(self.notifySettings)), ("exportedInvite", ConstructorParameterDescription(self.exportedInvite)), ("botInfo", ConstructorParameterDescription(self.botInfo)), ("pinnedMsgId", ConstructorParameterDescription(self.pinnedMsgId)), ("folderId", ConstructorParameterDescription(self.folderId)), ("call", ConstructorParameterDescription(self.call)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod)), ("groupcallDefaultJoinAs", ConstructorParameterDescription(self.groupcallDefaultJoinAs)), ("themeEmoticon", ConstructorParameterDescription(self.themeEmoticon)), ("requestsPending", ConstructorParameterDescription(self.requestsPending)), ("recentRequesters", ConstructorParameterDescription(self.recentRequesters)), ("availableReactions", ConstructorParameterDescription(self.availableReactions)), ("reactionsLimit", ConstructorParameterDescription(self.reactionsLimit))]) } } case channelFull(Cons_channelFull) @@ -1797,12 +1747,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .channelFull(let _data): - return ("channelFull", [("flags", _data.flags as Any), ("flags2", _data.flags2 as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("participantsCount", _data.participantsCount as Any), ("adminsCount", _data.adminsCount as Any), ("kickedCount", _data.kickedCount as Any), ("bannedCount", _data.bannedCount as Any), ("onlineCount", _data.onlineCount as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("chatPhoto", _data.chatPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("exportedInvite", _data.exportedInvite as Any), ("botInfo", _data.botInfo as Any), ("migratedFromChatId", _data.migratedFromChatId as Any), ("migratedFromMaxId", _data.migratedFromMaxId as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("stickerset", _data.stickerset as Any), ("availableMinId", _data.availableMinId as Any), ("folderId", _data.folderId as Any), ("linkedChatId", _data.linkedChatId as Any), ("location", _data.location as Any), ("slowmodeSeconds", _data.slowmodeSeconds as Any), ("slowmodeNextSendDate", _data.slowmodeNextSendDate as Any), ("statsDc", _data.statsDc as Any), ("pts", _data.pts as Any), ("call", _data.call as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("pendingSuggestions", _data.pendingSuggestions as Any), ("groupcallDefaultJoinAs", _data.groupcallDefaultJoinAs as Any), ("themeEmoticon", _data.themeEmoticon as Any), ("requestsPending", _data.requestsPending as Any), ("recentRequesters", _data.recentRequesters as Any), ("defaultSendAs", _data.defaultSendAs as Any), ("availableReactions", _data.availableReactions as Any), ("reactionsLimit", _data.reactionsLimit as Any), ("stories", _data.stories as Any), ("wallpaper", _data.wallpaper as Any), ("boostsApplied", _data.boostsApplied as Any), ("boostsUnrestrict", _data.boostsUnrestrict as Any), ("emojiset", _data.emojiset as Any), ("botVerification", _data.botVerification as Any), ("stargiftsCount", _data.stargiftsCount as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("mainTab", _data.mainTab as Any)]) + 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))]) case .chatFull(let _data): - return ("chatFull", [("flags", _data.flags as Any), ("id", _data.id as Any), ("about", _data.about as Any), ("participants", _data.participants as Any), ("chatPhoto", _data.chatPhoto as Any), ("notifySettings", _data.notifySettings as Any), ("exportedInvite", _data.exportedInvite as Any), ("botInfo", _data.botInfo as Any), ("pinnedMsgId", _data.pinnedMsgId as Any), ("folderId", _data.folderId as Any), ("call", _data.call as Any), ("ttlPeriod", _data.ttlPeriod as Any), ("groupcallDefaultJoinAs", _data.groupcallDefaultJoinAs as Any), ("themeEmoticon", _data.themeEmoticon as Any), ("requestsPending", _data.requestsPending as Any), ("recentRequesters", _data.recentRequesters as Any), ("availableReactions", _data.availableReactions as Any), ("reactionsLimit", _data.reactionsLimit as Any)]) + 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))]) } } @@ -2194,8 +2144,8 @@ public extension Api { self.subscriptionFormId = subscriptionFormId self.botVerification = botVerification } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatInvite", [("flags", self.flags as Any), ("title", self.title as Any), ("about", self.about as Any), ("photo", self.photo as Any), ("participantsCount", self.participantsCount as Any), ("participants", self.participants as Any), ("color", self.color as Any), ("subscriptionPricing", self.subscriptionPricing as Any), ("subscriptionFormId", self.subscriptionFormId as Any), ("botVerification", self.botVerification as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInvite", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("about", ConstructorParameterDescription(self.about)), ("photo", ConstructorParameterDescription(self.photo)), ("participantsCount", ConstructorParameterDescription(self.participantsCount)), ("participants", ConstructorParameterDescription(self.participants)), ("color", ConstructorParameterDescription(self.color)), ("subscriptionPricing", ConstructorParameterDescription(self.subscriptionPricing)), ("subscriptionFormId", ConstructorParameterDescription(self.subscriptionFormId)), ("botVerification", ConstructorParameterDescription(self.botVerification))]) } } public class Cons_chatInviteAlready: TypeConstructorDescription { @@ -2203,8 +2153,8 @@ public extension Api { public init(chat: Api.Chat) { self.chat = chat } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatInviteAlready", [("chat", self.chat as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInviteAlready", [("chat", ConstructorParameterDescription(self.chat))]) } } public class Cons_chatInvitePeek: TypeConstructorDescription { @@ -2214,8 +2164,8 @@ public extension Api { self.chat = chat self.expires = expires } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatInvitePeek", [("chat", self.chat as Any), ("expires", self.expires as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInvitePeek", [("chat", ConstructorParameterDescription(self.chat)), ("expires", ConstructorParameterDescription(self.expires))]) } } case chatInvite(Cons_chatInvite) @@ -2269,14 +2219,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatInvite(let _data): - return ("chatInvite", [("flags", _data.flags as Any), ("title", _data.title as Any), ("about", _data.about as Any), ("photo", _data.photo as Any), ("participantsCount", _data.participantsCount as Any), ("participants", _data.participants as Any), ("color", _data.color as Any), ("subscriptionPricing", _data.subscriptionPricing as Any), ("subscriptionFormId", _data.subscriptionFormId as Any), ("botVerification", _data.botVerification as Any)]) + return ("chatInvite", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("about", ConstructorParameterDescription(_data.about)), ("photo", ConstructorParameterDescription(_data.photo)), ("participantsCount", ConstructorParameterDescription(_data.participantsCount)), ("participants", ConstructorParameterDescription(_data.participants)), ("color", ConstructorParameterDescription(_data.color)), ("subscriptionPricing", ConstructorParameterDescription(_data.subscriptionPricing)), ("subscriptionFormId", ConstructorParameterDescription(_data.subscriptionFormId)), ("botVerification", ConstructorParameterDescription(_data.botVerification))]) case .chatInviteAlready(let _data): - return ("chatInviteAlready", [("chat", _data.chat as Any)]) + return ("chatInviteAlready", [("chat", ConstructorParameterDescription(_data.chat))]) case .chatInvitePeek(let _data): - return ("chatInvitePeek", [("chat", _data.chat as Any), ("expires", _data.expires as Any)]) + return ("chatInvitePeek", [("chat", ConstructorParameterDescription(_data.chat)), ("expires", ConstructorParameterDescription(_data.expires))]) } } diff --git a/submodules/TelegramApi/Sources/Api40.swift b/submodules/TelegramApi/Sources/Api40.swift index 8522caec56..cc6a0f7a60 100644 --- a/submodules/TelegramApi/Sources/Api40.swift +++ b/submodules/TelegramApi/Sources/Api40.swift @@ -11,7 +11,7 @@ public extension Api.functions.account { item.serialize(buffer, true) } credentials.serialize(buffer, true) - return (FunctionDescription(name: "account.acceptAuthorization", parameters: [("botId", String(describing: botId)), ("scope", String(describing: scope)), ("publicKey", String(describing: publicKey)), ("valueHashes", String(describing: valueHashes)), ("credentials", String(describing: credentials))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -47,7 +47,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 1) != 0 { callRequestsDisabled!.serialize(buffer, true) } - return (FunctionDescription(name: "account.changeAuthorizationSettings", parameters: [("flags", String(describing: flags)), ("hash", String(describing: hash)), ("encryptedRequestsDisabled", String(describing: encryptedRequestsDisabled)), ("callRequestsDisabled", String(describing: callRequestsDisabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -64,7 +64,7 @@ public extension Api.functions.account { serializeString(phoneNumber, buffer: buffer, boxed: false) serializeString(phoneCodeHash, buffer: buffer, boxed: false) serializeString(phoneCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.changePhone", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + 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() { @@ -79,7 +79,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(655677548) serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.checkUsername", parameters: [("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -108,7 +108,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-1881204448) serializeString(code, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.confirmPasswordEmail", parameters: [("code", String(describing: code))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -124,7 +124,7 @@ public extension Api.functions.account { buffer.appendInt32(1596029123) serializeString(phoneCodeHash, buffer: buffer, boxed: false) serializeString(phoneCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.confirmPhone", parameters: [("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -139,7 +139,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-2007898482) link.serialize(buffer, true) - return (FunctionDescription(name: "account.createBusinessChatLink", parameters: [("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BusinessChatLink? in + 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() { @@ -166,7 +166,7 @@ public extension Api.functions.account { item.serialize(buffer, true) } } - return (FunctionDescription(name: "account.createTheme", parameters: [("flags", String(describing: flags)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("document", String(describing: document)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in + 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() { @@ -199,7 +199,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { password!.serialize(buffer, true) } - return (FunctionDescription(name: "account.deleteAccount", parameters: [("flags", String(describing: flags)), ("reason", String(describing: reason)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -228,7 +228,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1611085428) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.deleteBusinessChatLink", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -243,7 +243,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-172665281) serializeString(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.deletePasskey", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -262,7 +262,7 @@ public extension Api.functions.account { for item in types { item.serialize(buffer, true) } - return (FunctionDescription(name: "account.deleteSecureValue", parameters: [("types", String(describing: types))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -277,7 +277,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1581481689) peer.serialize(buffer, true) - return (FunctionDescription(name: "account.disablePeerConnectedBot", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -293,7 +293,7 @@ public extension Api.functions.account { buffer.appendInt32(-1942744913) serializeString(slug, buffer: buffer, boxed: false) link.serialize(buffer, true) - return (FunctionDescription(name: "account.editBusinessChatLink", parameters: [("slug", String(describing: slug)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BusinessChatLink? in + 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() { @@ -308,7 +308,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(489050862) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.finishTakeoutSession", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -353,7 +353,7 @@ public extension Api.functions.account { serializeInt64(botId, buffer: buffer, boxed: false) serializeString(scope, buffer: buffer, boxed: false) serializeString(publicKey, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getAuthorizationForm", parameters: [("botId", String(describing: botId)), ("scope", String(describing: scope)), ("publicKey", String(describing: publicKey))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.AuthorizationForm? in + 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() { @@ -410,7 +410,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1990746736) serializeString(connectionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getBotBusinessConnection", parameters: [("connectionId", String(describing: connectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -439,7 +439,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1999087573) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getChannelDefaultEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + 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() { @@ -454,7 +454,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(900325589) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getChannelRestrictedStatusEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + 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() { @@ -469,7 +469,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-700916087) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getChatThemes", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Themes? in + 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() { @@ -484,7 +484,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(779830595) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getCollectibleEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + 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() { @@ -541,7 +541,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-1509246514) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultBackgroundEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + 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() { @@ -556,7 +556,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-696962170) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + 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() { @@ -571,7 +571,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-1856479058) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultGroupPhotoEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + 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() { @@ -586,7 +586,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-495647960) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getDefaultProfilePhotoEmojis", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + 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() { @@ -619,7 +619,7 @@ public extension Api.functions.account { for item in wallpapers { item.serialize(buffer, true) } - return (FunctionDescription(name: "account.getMultiWallPapers", parameters: [("wallpapers", String(describing: wallpapers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.WallPaper]? in + 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() { @@ -637,7 +637,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { peer!.serialize(buffer, true) } - return (FunctionDescription(name: "account.getNotifyExceptions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -652,7 +652,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(313765169) peer.serialize(buffer, true) - return (FunctionDescription(name: "account.getNotifySettings", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.PeerNotifySettings? in + 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() { @@ -671,7 +671,7 @@ public extension Api.functions.account { parentPeer!.serialize(buffer, true) } userId.serialize(buffer, true) - return (FunctionDescription(name: "account.getPaidMessagesRevenue", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PaidMessagesRevenue? in + 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() { @@ -714,7 +714,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-1663767815) password.serialize(buffer, true) - return (FunctionDescription(name: "account.getPasswordSettings", parameters: [("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PasswordSettings? in + 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() { @@ -729,7 +729,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-623130288) key.serialize(buffer, true) - return (FunctionDescription(name: "account.getPrivacy", parameters: [("key", String(describing: key))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PrivacyRules? in + 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() { @@ -758,7 +758,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(257392901) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getRecentEmojiStatuses", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmojiStatuses? in + 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() { @@ -773,7 +773,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-526557265) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getSavedMusicIds", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedMusicIds? in + 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() { @@ -788,7 +788,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-510647672) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getSavedRingtones", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedRingtones? in + 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() { @@ -807,7 +807,7 @@ public extension Api.functions.account { for item in types { item.serialize(buffer, true) } - return (FunctionDescription(name: "account.getSecureValue", parameters: [("types", String(describing: types))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.SecureValue]? in + 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() { @@ -823,7 +823,7 @@ public extension Api.functions.account { buffer.appendInt32(978872812) serializeString(format, buffer: buffer, boxed: false) theme.serialize(buffer, true) - return (FunctionDescription(name: "account.getTheme", parameters: [("format", String(describing: format)), ("theme", String(describing: theme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in + 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() { @@ -839,7 +839,7 @@ public extension Api.functions.account { buffer.appendInt32(1913054296) serializeString(format, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getThemes", parameters: [("format", String(describing: format)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Themes? in + 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() { @@ -855,7 +855,7 @@ public extension Api.functions.account { buffer.appendInt32(1151208273) password.serialize(buffer, true) serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getTmpPassword", parameters: [("password", String(describing: password)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.TmpPassword? in + 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() { @@ -872,7 +872,7 @@ public extension Api.functions.account { serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getUniqueGiftChatThemes", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ChatThemes? in + 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() { @@ -887,7 +887,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-57811990) wallpaper.serialize(buffer, true) - return (FunctionDescription(name: "account.getWallPaper", parameters: [("wallpaper", String(describing: wallpaper))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WallPaper? in + 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() { @@ -902,7 +902,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(127302966) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.getWallPapers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.WallPapers? in + 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() { @@ -948,7 +948,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 5) != 0 { serializeInt64(fileMaxSize!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "account.initTakeoutSession", parameters: [("flags", String(describing: flags)), ("fileMaxSize", String(describing: fileMaxSize))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.Takeout? in + 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() { @@ -972,7 +972,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 3) != 0 { baseTheme!.serialize(buffer, true) } - return (FunctionDescription(name: "account.installTheme", parameters: [("flags", String(describing: flags)), ("theme", String(describing: theme)), ("format", String(describing: format)), ("baseTheme", String(describing: baseTheme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -988,7 +988,7 @@ public extension Api.functions.account { buffer.appendInt32(-18000023) wallpaper.serialize(buffer, true) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.installWallPaper", parameters: [("wallpaper", String(describing: wallpaper)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1007,7 +1007,7 @@ public extension Api.functions.account { for item in codes { serializeString(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "account.invalidateSignInCodes", parameters: [("codes", String(describing: codes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1031,7 +1031,7 @@ public extension Api.functions.account { for item in otherUids { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "account.registerDevice", parameters: [("flags", String(describing: flags)), ("tokenType", String(describing: tokenType)), ("token", String(describing: token)), ("appSandbox", String(describing: appSandbox)), ("secret", String(describing: secret)), ("otherUids", String(describing: otherUids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1046,7 +1046,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1437867990) credential.serialize(buffer, true) - return (FunctionDescription(name: "account.registerPasskey", parameters: [("credential", String(describing: credential))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Passkey? in + 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() { @@ -1065,7 +1065,7 @@ public extension Api.functions.account { for item in order { serializeString(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "account.reorderUsernames", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1082,7 +1082,7 @@ public extension Api.functions.account { peer.serialize(buffer, true) reason.serialize(buffer, true) serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.reportPeer", parameters: [("peer", String(describing: peer)), ("reason", String(describing: reason)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1100,7 +1100,7 @@ public extension Api.functions.account { photoId.serialize(buffer, true) reason.serialize(buffer, true) serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.reportProfilePhoto", parameters: [("peer", String(describing: peer)), ("photoId", String(describing: photoId)), ("reason", String(describing: reason)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1129,7 +1129,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-545786948) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.resetAuthorization", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1186,7 +1186,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(755087855) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.resetWebAuthorization", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1215,7 +1215,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1418913262) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.resolveBusinessChatLink", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.ResolvedBusinessChatLinks? in + 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() { @@ -1231,7 +1231,7 @@ public extension Api.functions.account { buffer.appendInt32(1995661875) serializeInt32(flags, buffer: buffer, boxed: false) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.saveAutoDownloadSettings", parameters: [("flags", String(describing: flags)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1250,7 +1250,7 @@ public extension Api.functions.account { peer!.serialize(buffer, true) } settings.serialize(buffer, true) - return (FunctionDescription(name: "account.saveAutoSaveSettings", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1269,7 +1269,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 1) != 0 { afterId!.serialize(buffer, true) } - return (FunctionDescription(name: "account.saveMusic", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("afterId", String(describing: afterId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1285,7 +1285,7 @@ public extension Api.functions.account { buffer.appendInt32(1038768899) id.serialize(buffer, true) unsave.serialize(buffer, true) - return (FunctionDescription(name: "account.saveRingtone", parameters: [("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SavedRingtone? in + 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() { @@ -1301,7 +1301,7 @@ public extension Api.functions.account { buffer.appendInt32(-1986010339) value.serialize(buffer, true) serializeInt64(secureSecretId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.saveSecureValue", parameters: [("value", String(describing: value)), ("secureSecretId", String(describing: secureSecretId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SecureValue? in + 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() { @@ -1317,7 +1317,7 @@ public extension Api.functions.account { buffer.appendInt32(-229175188) theme.serialize(buffer, true) unsave.serialize(buffer, true) - return (FunctionDescription(name: "account.saveTheme", parameters: [("theme", String(describing: theme)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1334,7 +1334,7 @@ public extension Api.functions.account { wallpaper.serialize(buffer, true) unsave.serialize(buffer, true) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.saveWallPaper", parameters: [("wallpaper", String(describing: wallpaper)), ("unsave", String(describing: unsave)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1350,7 +1350,7 @@ public extension Api.functions.account { buffer.appendInt32(-2108208411) serializeString(phoneNumber, buffer: buffer, boxed: false) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.sendChangePhoneCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + 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() { @@ -1366,7 +1366,7 @@ public extension Api.functions.account { buffer.appendInt32(457157256) serializeString(hash, buffer: buffer, boxed: false) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.sendConfirmPhoneCode", parameters: [("hash", String(describing: hash)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + 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() { @@ -1382,7 +1382,7 @@ public extension Api.functions.account { buffer.appendInt32(-1730136133) purpose.serialize(buffer, true) serializeString(email, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.sendVerifyEmailCode", parameters: [("purpose", String(describing: purpose)), ("email", String(describing: email))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.SentEmailCode? in + 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() { @@ -1398,7 +1398,7 @@ public extension Api.functions.account { buffer.appendInt32(-1516022023) serializeString(phoneNumber, buffer: buffer, boxed: false) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.sendVerifyPhoneCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + 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() { @@ -1413,7 +1413,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(608323678) ttl.serialize(buffer, true) - return (FunctionDescription(name: "account.setAccountTTL", parameters: [("ttl", String(describing: ttl))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1428,7 +1428,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-1081501024) serializeInt32(authorizationTtlDays, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.setAuthorizationTTL", parameters: [("authorizationTtlDays", String(describing: authorizationTtlDays))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1443,7 +1443,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-806076575) silent.serialize(buffer, true) - return (FunctionDescription(name: "account.setContactSignUpNotification", parameters: [("silent", String(describing: silent))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1458,7 +1458,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-1250643605) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.setContentSettings", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1473,7 +1473,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(517647042) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.setGlobalPrivacySettings", parameters: [("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.GlobalPrivacySettings? in + 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() { @@ -1488,7 +1488,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1575909552) tab.serialize(buffer, true) - return (FunctionDescription(name: "account.setMainProfileTab", parameters: [("tab", String(describing: tab))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1508,7 +1508,7 @@ public extension Api.functions.account { for item in rules { item.serialize(buffer, true) } - return (FunctionDescription(name: "account.setPrivacy", parameters: [("key", String(describing: key)), ("rules", String(describing: rules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.PrivacyRules? in + 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() { @@ -1523,7 +1523,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(829220168) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.setReactionsNotifySettings", parameters: [("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReactionsNotifySettings? in + 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() { @@ -1539,7 +1539,7 @@ public extension Api.functions.account { buffer.appendInt32(1684934807) peer.serialize(buffer, true) paused.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleConnectedBotPaused", parameters: [("peer", String(describing: peer)), ("paused", String(describing: paused))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1558,7 +1558,7 @@ public extension Api.functions.account { parentPeer!.serialize(buffer, true) } userId.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleNoPaidMessagesException", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1573,7 +1573,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-1176919155) enabled.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleSponsoredMessages", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1589,7 +1589,7 @@ public extension Api.functions.account { buffer.appendInt32(1490465654) serializeString(username, buffer: buffer, boxed: false) active.serialize(buffer, true) - return (FunctionDescription(name: "account.toggleUsername", parameters: [("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1610,7 +1610,7 @@ public extension Api.functions.account { for item in otherUids { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "account.unregisterDevice", parameters: [("tokenType", String(describing: tokenType)), ("token", String(describing: token)), ("otherUids", String(describing: otherUids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1628,7 +1628,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { birthday!.serialize(buffer, true) } - return (FunctionDescription(name: "account.updateBirthday", parameters: [("flags", String(describing: flags)), ("birthday", String(describing: birthday))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1646,7 +1646,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { message!.serialize(buffer, true) } - return (FunctionDescription(name: "account.updateBusinessAwayMessage", parameters: [("flags", String(describing: flags)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1664,7 +1664,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { message!.serialize(buffer, true) } - return (FunctionDescription(name: "account.updateBusinessGreetingMessage", parameters: [("flags", String(describing: flags)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1682,7 +1682,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { intro!.serialize(buffer, true) } - return (FunctionDescription(name: "account.updateBusinessIntro", parameters: [("flags", String(describing: flags)), ("intro", String(describing: intro))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1703,7 +1703,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { serializeString(address!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "account.updateBusinessLocation", parameters: [("flags", String(describing: flags)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1721,7 +1721,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 0) != 0 { businessWorkHours!.serialize(buffer, true) } - return (FunctionDescription(name: "account.updateBusinessWorkHours", parameters: [("flags", String(describing: flags)), ("businessWorkHours", String(describing: businessWorkHours))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1739,7 +1739,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 2) != 0 { color!.serialize(buffer, true) } - return (FunctionDescription(name: "account.updateColor", parameters: [("flags", String(describing: flags)), ("color", String(describing: color))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1759,7 +1759,7 @@ public extension Api.functions.account { } bot.serialize(buffer, true) recipients.serialize(buffer, true) - return (FunctionDescription(name: "account.updateConnectedBot", parameters: [("flags", String(describing: flags)), ("rights", String(describing: rights)), ("bot", String(describing: bot)), ("recipients", String(describing: recipients))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -1774,7 +1774,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(954152242) serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.updateDeviceLocked", parameters: [("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1789,7 +1789,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-70001045) emojiStatus.serialize(buffer, true) - return (FunctionDescription(name: "account.updateEmojiStatus", parameters: [("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1805,7 +1805,7 @@ public extension Api.functions.account { buffer.appendInt32(-2067899501) peer.serialize(buffer, true) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.updateNotifySettings", parameters: [("peer", String(describing: peer)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1821,7 +1821,7 @@ public extension Api.functions.account { buffer.appendInt32(-1516564433) password.serialize(buffer, true) newSettings.serialize(buffer, true) - return (FunctionDescription(name: "account.updatePasswordSettings", parameters: [("password", String(describing: password)), ("newSettings", String(describing: newSettings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1836,7 +1836,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(-649919008) channel.serialize(buffer, true) - return (FunctionDescription(name: "account.updatePersonalChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1860,7 +1860,7 @@ public extension Api.functions.account { if Int(flags) & Int(1 << 2) != 0 { serializeString(about!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "account.updateProfile", parameters: [("flags", String(describing: flags)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName)), ("about", String(describing: about))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + 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() { @@ -1875,7 +1875,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1713919532) offline.serialize(buffer, true) - return (FunctionDescription(name: "account.updateStatus", parameters: [("offline", String(describing: offline))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -1908,7 +1908,7 @@ public extension Api.functions.account { item.serialize(buffer, true) } } - return (FunctionDescription(name: "account.updateTheme", parameters: [("flags", String(describing: flags)), ("format", String(describing: format)), ("theme", String(describing: theme)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("document", String(describing: document)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Theme? in + 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() { @@ -1923,7 +1923,7 @@ public extension Api.functions.account { let buffer = Buffer() buffer.appendInt32(1040964988) serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.updateUsername", parameters: [("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + 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() { @@ -1940,7 +1940,7 @@ public extension Api.functions.account { file.serialize(buffer, true) serializeString(fileName, buffer: buffer, boxed: false) serializeString(mimeType, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.uploadRingtone", parameters: [("file", String(describing: file)), ("fileName", String(describing: fileName)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in + 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() { @@ -1961,7 +1961,7 @@ public extension Api.functions.account { } serializeString(fileName, buffer: buffer, boxed: false) serializeString(mimeType, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.uploadTheme", parameters: [("flags", String(describing: flags)), ("file", String(describing: file)), ("thumb", String(describing: thumb)), ("fileName", String(describing: fileName)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in + 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() { @@ -1979,7 +1979,7 @@ public extension Api.functions.account { file.serialize(buffer, true) serializeString(mimeType, buffer: buffer, boxed: false) settings.serialize(buffer, true) - return (FunctionDescription(name: "account.uploadWallPaper", parameters: [("flags", String(describing: flags)), ("file", String(describing: file)), ("mimeType", String(describing: mimeType)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WallPaper? in + 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() { @@ -1995,7 +1995,7 @@ public extension Api.functions.account { buffer.appendInt32(53322959) purpose.serialize(buffer, true) verification.serialize(buffer, true) - return (FunctionDescription(name: "account.verifyEmail", parameters: [("purpose", String(describing: purpose)), ("verification", String(describing: verification))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.account.EmailVerified? in + 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() { @@ -2012,7 +2012,7 @@ public extension Api.functions.account { serializeString(phoneNumber, buffer: buffer, boxed: false) serializeString(phoneCodeHash, buffer: buffer, boxed: false) serializeString(phoneCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "account.verifyPhone", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2027,7 +2027,7 @@ public extension Api.functions.auth { let buffer = Buffer() buffer.appendInt32(-392909491) serializeBytes(token, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.acceptLoginToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Authorization? in + 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() { @@ -2045,7 +2045,7 @@ public extension Api.functions.auth { serializeInt64(nonce, buffer: buffer, boxed: false) serializeInt32(expiresAt, buffer: buffer, boxed: false) serializeBytes(encryptedMessage, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.bindTempAuthKey", parameters: [("permAuthKeyId", String(describing: permAuthKeyId)), ("nonce", String(describing: nonce)), ("expiresAt", String(describing: expiresAt)), ("encryptedMessage", String(describing: encryptedMessage))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2061,7 +2061,7 @@ public extension Api.functions.auth { buffer.appendInt32(520357240) serializeString(phoneNumber, buffer: buffer, boxed: false) serializeString(phoneCodeHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.cancelCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2078,7 +2078,7 @@ public extension Api.functions.auth { serializeString(phoneNumber, buffer: buffer, boxed: false) serializeString(phoneCodeHash, buffer: buffer, boxed: false) serializeInt64(formId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.checkPaidAuth", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("formId", String(describing: formId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + 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() { @@ -2093,7 +2093,7 @@ public extension Api.functions.auth { let buffer = Buffer() buffer.appendInt32(-779399914) password.serialize(buffer, true) - return (FunctionDescription(name: "auth.checkPassword", parameters: [("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2108,7 +2108,7 @@ public extension Api.functions.auth { let buffer = Buffer() buffer.appendInt32(221691769) serializeString(code, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.checkRecoveryPassword", parameters: [("code", String(describing: code))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2127,7 +2127,7 @@ public extension Api.functions.auth { for item in exceptAuthKeys { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "auth.dropTempAuthKeys", parameters: [("exceptAuthKeys", String(describing: exceptAuthKeys))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2142,7 +2142,7 @@ public extension Api.functions.auth { let buffer = Buffer() buffer.appendInt32(-440401971) serializeInt32(dcId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.exportAuthorization", parameters: [("dcId", String(describing: dcId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.ExportedAuthorization? in + 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() { @@ -2163,7 +2163,7 @@ public extension Api.functions.auth { for item in exceptIds { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "auth.exportLoginToken", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("exceptIds", String(describing: exceptIds))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoginToken? in + 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() { @@ -2185,7 +2185,7 @@ public extension Api.functions.auth { if Int(flags) & Int(1 << 0) != 0 { serializeInt64(fromAuthKeyId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "auth.finishPasskeyLogin", parameters: [("flags", String(describing: flags)), ("credential", String(describing: credential)), ("fromDcId", String(describing: fromDcId)), ("fromAuthKeyId", String(describing: fromAuthKeyId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2201,7 +2201,7 @@ public extension Api.functions.auth { buffer.appendInt32(-1518699091) serializeInt64(id, buffer: buffer, boxed: false) serializeBytes(bytes, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importAuthorization", parameters: [("id", String(describing: id)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2219,7 +2219,7 @@ public extension Api.functions.auth { serializeInt32(apiId, buffer: buffer, boxed: false) serializeString(apiHash, buffer: buffer, boxed: false) serializeString(botAuthToken, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importBotAuthorization", parameters: [("flags", String(describing: flags)), ("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("botAuthToken", String(describing: botAuthToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2234,7 +2234,7 @@ public extension Api.functions.auth { let buffer = Buffer() buffer.appendInt32(-1783866140) serializeBytes(token, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importLoginToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.LoginToken? in + 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() { @@ -2251,7 +2251,7 @@ public extension Api.functions.auth { serializeInt32(apiId, buffer: buffer, boxed: false) serializeString(apiHash, buffer: buffer, boxed: false) serializeString(webAuthToken, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.importWebTokenAuthorization", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("webAuthToken", String(describing: webAuthToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2267,7 +2267,7 @@ public extension Api.functions.auth { buffer.appendInt32(1368051895) serializeInt32(apiId, buffer: buffer, boxed: false) serializeString(apiHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.initPasskeyLogin", parameters: [("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.PasskeyLoginOptions? in + 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() { @@ -2300,7 +2300,7 @@ public extension Api.functions.auth { if Int(flags) & Int(1 << 0) != 0 { newSettings!.serialize(buffer, true) } - return (FunctionDescription(name: "auth.recoverPassword", parameters: [("flags", String(describing: flags)), ("code", String(describing: code)), ("newSettings", String(describing: newSettings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2317,7 +2317,7 @@ public extension Api.functions.auth { serializeString(phoneNumber, buffer: buffer, boxed: false) serializeString(phoneCodeHash, buffer: buffer, boxed: false) serializeString(mnc, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.reportMissingCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("mnc", String(describing: mnc))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2343,7 +2343,7 @@ public extension Api.functions.auth { if Int(flags) & Int(1 << 1) != 0 { serializeString(iosPushSecret!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "auth.requestFirebaseSms", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("safetyNetToken", String(describing: safetyNetToken)), ("playIntegrityToken", String(describing: playIntegrityToken)), ("iosPushSecret", String(describing: iosPushSecret))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2377,7 +2377,7 @@ public extension Api.functions.auth { if Int(flags) & Int(1 << 0) != 0 { serializeString(reason!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "auth.resendCode", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("reason", String(describing: reason))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + 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() { @@ -2407,7 +2407,7 @@ public extension Api.functions.auth { buffer.appendInt32(2123760019) serializeString(phoneNumber, buffer: buffer, boxed: false) serializeString(phoneCodeHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.resetLoginEmail", parameters: [("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + 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() { @@ -2425,7 +2425,7 @@ public extension Api.functions.auth { serializeInt32(apiId, buffer: buffer, boxed: false) serializeString(apiHash, buffer: buffer, boxed: false) settings.serialize(buffer, true) - return (FunctionDescription(name: "auth.sendCode", parameters: [("phoneNumber", String(describing: phoneNumber)), ("apiId", String(describing: apiId)), ("apiHash", String(describing: apiHash)), ("settings", String(describing: settings))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.SentCode? in + 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() { @@ -2448,7 +2448,7 @@ public extension Api.functions.auth { if Int(flags) & Int(1 << 1) != 0 { emailVerification!.serialize(buffer, true) } - return (FunctionDescription(name: "auth.signIn", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("phoneCode", String(describing: phoneCode)), ("emailVerification", String(describing: emailVerification))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2467,7 +2467,7 @@ public extension Api.functions.auth { serializeString(phoneCodeHash, buffer: buffer, boxed: false) serializeString(firstName, buffer: buffer, boxed: false) serializeString(lastName, buffer: buffer, boxed: false) - return (FunctionDescription(name: "auth.signUp", parameters: [("flags", String(describing: flags)), ("phoneNumber", String(describing: phoneNumber)), ("phoneCodeHash", String(describing: phoneCodeHash)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.auth.Authorization? in + 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() { @@ -2484,7 +2484,7 @@ public extension Api.functions.bots { bot.serialize(buffer, true) serializeString(langCode, buffer: buffer, boxed: false) media.serialize(buffer, true) - return (FunctionDescription(name: "bots.addPreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotPreviewMedia? in + 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() { @@ -2499,7 +2499,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(-248323089) bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.allowSendMessage", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -2515,7 +2515,7 @@ public extension Api.functions.bots { buffer.appendInt32(-434028723) serializeInt64(queryId, buffer: buffer, boxed: false) data.serialize(buffer, true) - return (FunctionDescription(name: "bots.answerWebhookJSONQuery", parameters: [("queryId", String(describing: queryId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2530,7 +2530,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(324662502) bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.canSendMessage", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2547,7 +2547,7 @@ public extension Api.functions.bots { bot.serialize(buffer, true) serializeString(fileName, buffer: buffer, boxed: false) serializeString(url, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.checkDownloadFileParams", parameters: [("bot", String(describing: bot)), ("fileName", String(describing: fileName)), ("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2562,7 +2562,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(-2014174821) serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.checkUsername", parameters: [("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2580,7 +2580,7 @@ public extension Api.functions.bots { serializeString(name, buffer: buffer, boxed: false) serializeString(username, buffer: buffer, boxed: false) managerId.serialize(buffer, true) - return (FunctionDescription(name: "bots.createBot", parameters: [("flags", String(describing: flags)), ("name", String(describing: name)), ("username", String(describing: username)), ("managerId", String(describing: managerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + 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() { @@ -2601,7 +2601,7 @@ public extension Api.functions.bots { for item in media { item.serialize(buffer, true) } - return (FunctionDescription(name: "bots.deletePreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2619,7 +2619,7 @@ public extension Api.functions.bots { serializeString(langCode, buffer: buffer, boxed: false) media.serialize(buffer, true) newMedia.serialize(buffer, true) - return (FunctionDescription(name: "bots.editPreviewMedia", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("media", String(describing: media)), ("newMedia", String(describing: newMedia))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotPreviewMedia? in + 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() { @@ -2635,7 +2635,7 @@ public extension Api.functions.bots { buffer.appendInt32(-1123182101) bot.serialize(buffer, true) revoke.serialize(buffer, true) - return (FunctionDescription(name: "bots.exportBotToken", parameters: [("bot", String(describing: bot)), ("revoke", String(describing: revoke))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.ExportedBotToken? in + 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() { @@ -2665,7 +2665,7 @@ public extension Api.functions.bots { buffer.appendInt32(-481554986) scope.serialize(buffer, true) serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotCommand]? in + 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() { @@ -2684,7 +2684,7 @@ public extension Api.functions.bots { bot!.serialize(buffer, true) } serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getBotInfo", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.BotInfo? in + 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() { @@ -2699,7 +2699,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(-1671369944) userId.serialize(buffer, true) - return (FunctionDescription(name: "bots.getBotMenuButton", parameters: [("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.BotMenuButton? in + 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() { @@ -2714,7 +2714,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(-1581840363) bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.getBotRecommendations", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.Users? in + 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() { @@ -2730,7 +2730,7 @@ public extension Api.functions.bots { buffer.appendInt32(-1034878574) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getPopularAppBots", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.PopularAppBots? in + 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() { @@ -2746,7 +2746,7 @@ public extension Api.functions.bots { buffer.appendInt32(1111143341) bot.serialize(buffer, true) serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getPreviewInfo", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.PreviewInfo? in + 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() { @@ -2761,7 +2761,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(-1566222003) bot.serialize(buffer, true) - return (FunctionDescription(name: "bots.getPreviewMedias", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.BotPreviewMedia]? in + 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() { @@ -2777,7 +2777,7 @@ public extension Api.functions.bots { buffer.appendInt32(-1088047117) bot.serialize(buffer, true) serializeString(webappReqId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.getRequestedWebViewButton", parameters: [("bot", String(describing: bot)), ("webappReqId", String(describing: webappReqId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.KeyboardButton? in + 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() { @@ -2794,7 +2794,7 @@ public extension Api.functions.bots { bot.serialize(buffer, true) serializeString(customMethod, buffer: buffer, boxed: false) params.serialize(buffer, true) - return (FunctionDescription(name: "bots.invokeWebViewCustomMethod", parameters: [("bot", String(describing: bot)), ("customMethod", String(describing: customMethod)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in + 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() { @@ -2815,7 +2815,7 @@ public extension Api.functions.bots { for item in order { item.serialize(buffer, true) } - return (FunctionDescription(name: "bots.reorderPreviewMedias", parameters: [("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2835,7 +2835,7 @@ public extension Api.functions.bots { for item in order { serializeString(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "bots.reorderUsernames", parameters: [("bot", String(describing: bot)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2851,7 +2851,7 @@ public extension Api.functions.bots { buffer.appendInt32(832742238) userId.serialize(buffer, true) button.serialize(buffer, true) - return (FunctionDescription(name: "bots.requestWebViewButton", parameters: [("userId", String(describing: userId)), ("button", String(describing: button))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.bots.RequestedButton? in + 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() { @@ -2867,7 +2867,7 @@ public extension Api.functions.bots { buffer.appendInt32(1032708345) scope.serialize(buffer, true) serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "bots.resetBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2883,7 +2883,7 @@ public extension Api.functions.bots { buffer.appendInt32(-1440257555) serializeString(customMethod, buffer: buffer, boxed: false) params.serialize(buffer, true) - return (FunctionDescription(name: "bots.sendCustomRequest", parameters: [("customMethod", String(describing: customMethod)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.DataJSON? in + 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() { @@ -2898,7 +2898,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(2021942497) adminRights.serialize(buffer, true) - return (FunctionDescription(name: "bots.setBotBroadcastDefaultAdminRights", parameters: [("adminRights", String(describing: adminRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2919,7 +2919,7 @@ public extension Api.functions.bots { for item in commands { item.serialize(buffer, true) } - return (FunctionDescription(name: "bots.setBotCommands", parameters: [("scope", String(describing: scope)), ("langCode", String(describing: langCode)), ("commands", String(describing: commands))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2934,7 +2934,7 @@ public extension Api.functions.bots { let buffer = Buffer() buffer.appendInt32(-1839281686) adminRights.serialize(buffer, true) - return (FunctionDescription(name: "bots.setBotGroupDefaultAdminRights", parameters: [("adminRights", String(describing: adminRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2962,7 +2962,7 @@ public extension Api.functions.bots { if Int(flags) & Int(1 << 1) != 0 { serializeString(description!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "bots.setBotInfo", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("langCode", String(describing: langCode)), ("name", String(describing: name)), ("about", String(describing: about)), ("description", String(describing: description))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -2978,7 +2978,7 @@ public extension Api.functions.bots { buffer.appendInt32(1157944655) userId.serialize(buffer, true) button.serialize(buffer, true) - return (FunctionDescription(name: "bots.setBotMenuButton", parameters: [("userId", String(describing: userId)), ("button", String(describing: button))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3000,7 +3000,7 @@ public extension Api.functions.bots { if Int(flags) & Int(1 << 2) != 0 { serializeString(customDescription!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "bots.setCustomVerification", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("peer", String(describing: peer)), ("customDescription", String(describing: customDescription))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3016,7 +3016,7 @@ public extension Api.functions.bots { buffer.appendInt32(115237778) bot.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "bots.toggleUserEmojiStatusPermission", parameters: [("bot", String(describing: bot)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3033,7 +3033,7 @@ public extension Api.functions.bots { bot.serialize(buffer, true) serializeString(username, buffer: buffer, boxed: false) active.serialize(buffer, true) - return (FunctionDescription(name: "bots.toggleUsername", parameters: [("bot", String(describing: bot)), ("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3053,7 +3053,7 @@ public extension Api.functions.bots { if Int(flags) & Int(1 << 0) != 0 { serializeInt32(durationMonths!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "bots.updateStarRefProgram", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("commissionPermille", String(describing: commissionPermille)), ("durationMonths", String(describing: durationMonths))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarRefProgram? in + 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() { @@ -3069,7 +3069,7 @@ public extension Api.functions.bots { buffer.appendInt32(-308334395) userId.serialize(buffer, true) emojiStatus.serialize(buffer, true) - return (FunctionDescription(name: "bots.updateUserEmojiStatus", parameters: [("userId", String(describing: userId)), ("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3087,7 +3087,7 @@ public extension Api.functions.channels { if Int(flags) & Int(1 << 0) != 0 { serializeString(query!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.checkSearchPostsFlood", parameters: [("flags", String(describing: flags)), ("query", String(describing: query))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SearchPostsFlood? in + 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() { @@ -3103,7 +3103,7 @@ public extension Api.functions.channels { buffer.appendInt32(283557164) channel.serialize(buffer, true) serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.checkUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3118,7 +3118,7 @@ public extension Api.functions.channels { let buffer = Buffer() buffer.appendInt32(187239529) channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.convertToGigagroup", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3144,7 +3144,7 @@ public extension Api.functions.channels { if Int(flags) & Int(1 << 4) != 0 { serializeInt32(ttlPeriod!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.createChannel", parameters: [("flags", String(describing: flags)), ("title", String(describing: title)), ("about", String(describing: about)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address)), ("ttlPeriod", String(describing: ttlPeriod))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3159,7 +3159,7 @@ public extension Api.functions.channels { let buffer = Buffer() buffer.appendInt32(170155475) channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.deactivateAllUsernames", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3174,7 +3174,7 @@ public extension Api.functions.channels { let buffer = Buffer() buffer.appendInt32(-1072619549) channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.deleteChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3191,7 +3191,7 @@ public extension Api.functions.channels { serializeInt32(flags, buffer: buffer, boxed: false) channel.serialize(buffer, true) serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.deleteHistory", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3211,7 +3211,7 @@ public extension Api.functions.channels { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.deleteMessages", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + 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() { @@ -3227,7 +3227,7 @@ public extension Api.functions.channels { buffer.appendInt32(913655003) channel.serialize(buffer, true) participant.serialize(buffer, true) - return (FunctionDescription(name: "channels.deleteParticipantHistory", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -3248,7 +3248,7 @@ public extension Api.functions.channels { if Int(flags) & Int(1 << 0) != 0 { serializeString(rank!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.editAdmin", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("userId", String(describing: userId)), ("adminRights", String(describing: adminRights)), ("rank", String(describing: rank))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3265,7 +3265,7 @@ public extension Api.functions.channels { channel.serialize(buffer, true) participant.serialize(buffer, true) bannedRights.serialize(buffer, true) - return (FunctionDescription(name: "channels.editBanned", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant)), ("bannedRights", String(describing: bannedRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3282,7 +3282,7 @@ public extension Api.functions.channels { channel.serialize(buffer, true) geoPoint.serialize(buffer, true) serializeString(address, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.editLocation", parameters: [("channel", String(describing: channel)), ("geoPoint", String(describing: geoPoint)), ("address", String(describing: address))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3298,7 +3298,7 @@ public extension Api.functions.channels { buffer.appendInt32(-248621111) channel.serialize(buffer, true) photo.serialize(buffer, true) - return (FunctionDescription(name: "channels.editPhoto", parameters: [("channel", String(describing: channel)), ("photo", String(describing: photo))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3314,7 +3314,7 @@ public extension Api.functions.channels { buffer.appendInt32(1450044624) channel.serialize(buffer, true) serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.editTitle", parameters: [("channel", String(describing: channel)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3331,7 +3331,7 @@ public extension Api.functions.channels { serializeInt32(flags, buffer: buffer, boxed: false) channel.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.exportMessageLink", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedMessageLink? in + 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() { @@ -3361,7 +3361,7 @@ public extension Api.functions.channels { serializeInt64(maxId, buffer: buffer, boxed: false) serializeInt64(minId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getAdminLog", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("q", String(describing: q)), ("eventsFilter", String(describing: eventsFilter)), ("admins", String(describing: admins)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.AdminLogResults? in + 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() { @@ -3376,7 +3376,7 @@ public extension Api.functions.channels { let buffer = Buffer() buffer.appendInt32(-122669393) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getAdminedPublicChannels", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + 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() { @@ -3394,7 +3394,7 @@ public extension Api.functions.channels { if Int(flags) & Int(1 << 0) != 0 { channel!.serialize(buffer, true) } - return (FunctionDescription(name: "channels.getChannelRecommendations", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + 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() { @@ -3413,7 +3413,7 @@ public extension Api.functions.channels { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "channels.getChannels", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + 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() { @@ -3423,26 +3423,12 @@ public extension Api.functions.channels { }) } } -public extension Api.functions.channels { - static func getContactPersonalChannels() -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(1352350822) - return (FunctionDescription(name: "channels.getContactPersonalChannels", parameters: []), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.PersonalChannels? in - let reader = BufferReader(buffer) - var result: Api.channels.PersonalChannels? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.PersonalChannels - } - return result - }) - } -} public extension Api.functions.channels { static func getFullChannel(channel: Api.InputChannel) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() buffer.appendInt32(141781513) channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.getFullChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatFull? in + 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() { @@ -3485,7 +3471,7 @@ public extension Api.functions.channels { let buffer = Buffer() buffer.appendInt32(-2092831552) serializeInt32(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getLeftChannels", parameters: [("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + 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() { @@ -3501,7 +3487,7 @@ public extension Api.functions.channels { buffer.appendInt32(-320691994) channel.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getMessageAuthor", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + 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() { @@ -3521,7 +3507,7 @@ public extension Api.functions.channels { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "channels.getMessages", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -3537,7 +3523,7 @@ public extension Api.functions.channels { buffer.appendInt32(-1599378234) channel.serialize(buffer, true) participant.serialize(buffer, true) - return (FunctionDescription(name: "channels.getParticipant", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.ChannelParticipant? in + 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() { @@ -3556,7 +3542,7 @@ public extension Api.functions.channels { serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getParticipants", parameters: [("channel", String(describing: channel)), ("filter", String(describing: filter)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.ChannelParticipants? in + 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() { @@ -3572,7 +3558,7 @@ public extension Api.functions.channels { buffer.appendInt32(-410672065) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - return (FunctionDescription(name: "channels.getSendAs", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.SendAsPeers? in + 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() { @@ -3582,21 +3568,6 @@ public extension Api.functions.channels { }) } } -public extension Api.functions.channels { - static func getTopics(langCode: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<[Api.ChannelTopic]>) { - let buffer = Buffer() - buffer.appendInt32(2058456524) - serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.getTopics", parameters: [("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ChannelTopic]? in - let reader = BufferReader(buffer) - var result: [Api.ChannelTopic]? - if let _ = reader.readInt32() { - result = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChannelTopic.self) - } - return result - }) - } -} public extension Api.functions.channels { static func inviteToChannel(channel: Api.InputChannel, users: [Api.InputUser]) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { let buffer = Buffer() @@ -3607,7 +3578,7 @@ public extension Api.functions.channels { for item in users { item.serialize(buffer, true) } - return (FunctionDescription(name: "channels.inviteToChannel", parameters: [("channel", String(describing: channel)), ("users", String(describing: users))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in + 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() { @@ -3622,7 +3593,7 @@ public extension Api.functions.channels { let buffer = Buffer() buffer.appendInt32(615851205) channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.joinChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3637,7 +3608,7 @@ public extension Api.functions.channels { let buffer = Buffer() buffer.appendInt32(-130635115) channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.leaveChannel", parameters: [("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3653,7 +3624,7 @@ public extension Api.functions.channels { buffer.appendInt32(-871347913) channel.serialize(buffer, true) serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.readHistory", parameters: [("channel", String(describing: channel)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3673,7 +3644,7 @@ public extension Api.functions.channels { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.readMessageContents", parameters: [("channel", String(describing: channel)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3693,7 +3664,7 @@ public extension Api.functions.channels { for item in order { serializeString(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.reorderUsernames", parameters: [("channel", String(describing: channel)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3709,7 +3680,7 @@ public extension Api.functions.channels { buffer.appendInt32(-1471109485) channel.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.reportAntiSpamFalsePositive", parameters: [("channel", String(describing: channel)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3730,7 +3701,7 @@ public extension Api.functions.channels { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.reportSpam", parameters: [("channel", String(describing: channel)), ("participant", String(describing: participant)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3746,7 +3717,7 @@ public extension Api.functions.channels { buffer.appendInt32(-1696000743) channel.serialize(buffer, true) restricted.serialize(buffer, true) - return (FunctionDescription(name: "channels.restrictSponsoredMessages", parameters: [("channel", String(describing: channel)), ("restricted", String(describing: restricted))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3756,28 +3727,6 @@ public extension Api.functions.channels { }) } } -public extension Api.functions.channels { - static func search(flags: Int32, q: String?, topicId: Int32?, offset: String) -> (FunctionDescription, Buffer, DeserializeFunctionResponse) { - let buffer = Buffer() - buffer.appendInt32(668439895) - serializeInt32(flags, buffer: buffer, boxed: false) - if Int(flags) & Int(1 << 0) != 0 { - serializeString(q!, buffer: buffer, boxed: false) - } - if Int(flags) & Int(1 << 1) != 0 { - serializeInt32(topicId!, buffer: buffer, boxed: false) - } - serializeString(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.search", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("topicId", String(describing: topicId)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.Found? in - let reader = BufferReader(buffer) - var result: Api.channels.Found? - if let signature = reader.readInt32() { - result = Api.parse(reader, signature: signature) as? Api.channels.Found - } - 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() @@ -3796,7 +3745,7 @@ public extension Api.functions.channels { if Int(flags) & Int(1 << 2) != 0 { serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.searchPosts", parameters: [("flags", String(describing: flags)), ("hashtag", String(describing: hashtag)), ("query", String(describing: query)), ("offsetRate", String(describing: offsetRate)), ("offsetPeer", String(describing: offsetPeer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -3812,7 +3761,7 @@ public extension Api.functions.channels { buffer.appendInt32(-1388733202) channel.serialize(buffer, true) serializeInt32(boosts, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.setBoostsToUnblockRestrictions", parameters: [("channel", String(describing: channel)), ("boosts", String(describing: boosts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3828,7 +3777,7 @@ public extension Api.functions.channels { buffer.appendInt32(1079520178) broadcast.serialize(buffer, true) group.serialize(buffer, true) - return (FunctionDescription(name: "channels.setDiscussionGroup", parameters: [("broadcast", String(describing: broadcast)), ("group", String(describing: group))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3844,7 +3793,7 @@ public extension Api.functions.channels { buffer.appendInt32(1020866743) channel.serialize(buffer, true) stickerset.serialize(buffer, true) - return (FunctionDescription(name: "channels.setEmojiStickers", parameters: [("channel", String(describing: channel)), ("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3860,7 +3809,7 @@ public extension Api.functions.channels { buffer.appendInt32(897842353) channel.serialize(buffer, true) tab.serialize(buffer, true) - return (FunctionDescription(name: "channels.setMainProfileTab", parameters: [("channel", String(describing: channel)), ("tab", String(describing: tab))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3876,7 +3825,7 @@ public extension Api.functions.channels { buffer.appendInt32(-359881479) channel.serialize(buffer, true) stickerset.serialize(buffer, true) - return (FunctionDescription(name: "channels.setStickers", parameters: [("channel", String(describing: channel)), ("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -3892,7 +3841,7 @@ public extension Api.functions.channels { buffer.appendInt32(1760814315) channel.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleAntiSpam", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3908,7 +3857,7 @@ public extension Api.functions.channels { buffer.appendInt32(377471137) channel.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleAutotranslation", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3925,7 +3874,7 @@ public extension Api.functions.channels { channel.serialize(buffer, true) enabled.serialize(buffer, true) tabs.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleForum", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled)), ("tabs", String(describing: tabs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3941,7 +3890,7 @@ public extension Api.functions.channels { buffer.appendInt32(1277789622) channel.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleJoinRequest", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3957,7 +3906,7 @@ public extension Api.functions.channels { buffer.appendInt32(-456419968) channel.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleJoinToSend", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3973,7 +3922,7 @@ public extension Api.functions.channels { buffer.appendInt32(1785624660) channel.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleParticipantsHidden", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -3989,7 +3938,7 @@ public extension Api.functions.channels { buffer.appendInt32(-356796084) channel.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.togglePreHistoryHidden", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4005,7 +3954,7 @@ public extension Api.functions.channels { buffer.appendInt32(1099781276) serializeInt32(flags, buffer: buffer, boxed: false) channel.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleSignatures", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4021,7 +3970,7 @@ public extension Api.functions.channels { buffer.appendInt32(-304832784) channel.serialize(buffer, true) serializeInt32(seconds, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.toggleSlowMode", parameters: [("channel", String(describing: channel)), ("seconds", String(describing: seconds))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4038,7 +3987,7 @@ public extension Api.functions.channels { channel.serialize(buffer, true) serializeString(username, buffer: buffer, boxed: false) active.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username)), ("active", String(describing: active))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4054,7 +4003,7 @@ public extension Api.functions.channels { buffer.appendInt32(-1757889771) channel.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "channels.toggleViewForumAsMessages", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4076,7 +4025,7 @@ public extension Api.functions.channels { if Int(flags) & Int(1 << 0) != 0 { serializeInt64(backgroundEmojiId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "channels.updateColor", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("color", String(describing: color)), ("backgroundEmojiId", String(describing: backgroundEmojiId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4092,7 +4041,7 @@ public extension Api.functions.channels { buffer.appendInt32(-254548312) channel.serialize(buffer, true) emojiStatus.serialize(buffer, true) - return (FunctionDescription(name: "channels.updateEmojiStatus", parameters: [("channel", String(describing: channel)), ("emojiStatus", String(describing: emojiStatus))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4109,7 +4058,7 @@ public extension Api.functions.channels { serializeInt32(flags, buffer: buffer, boxed: false) channel.serialize(buffer, true) serializeInt64(sendPaidMessagesStars, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.updatePaidMessagesPrice", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4125,7 +4074,7 @@ public extension Api.functions.channels { buffer.appendInt32(890549214) channel.serialize(buffer, true) serializeString(username, buffer: buffer, boxed: false) - return (FunctionDescription(name: "channels.updateUsername", parameters: [("channel", String(describing: channel)), ("username", String(describing: username))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4140,7 +4089,7 @@ public extension Api.functions.chatlists { let buffer = Buffer() buffer.appendInt32(1103171583) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "chatlists.checkChatlistInvite", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ChatlistInvite? in + 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() { @@ -4156,7 +4105,7 @@ public extension Api.functions.chatlists { buffer.appendInt32(1906072670) chatlist.serialize(buffer, true) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "chatlists.deleteExportedInvite", parameters: [("chatlist", String(describing: chatlist)), ("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4183,7 +4132,7 @@ public extension Api.functions.chatlists { item.serialize(buffer, true) } } - return (FunctionDescription(name: "chatlists.editExportedInvite", parameters: [("flags", String(describing: flags)), ("chatlist", String(describing: chatlist)), ("slug", String(describing: slug)), ("title", String(describing: title)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedChatlistInvite? in + 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() { @@ -4204,7 +4153,7 @@ public extension Api.functions.chatlists { for item in peers { item.serialize(buffer, true) } - return (FunctionDescription(name: "chatlists.exportChatlistInvite", parameters: [("chatlist", String(describing: chatlist)), ("title", String(describing: title)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ExportedChatlistInvite? in + 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() { @@ -4219,7 +4168,7 @@ public extension Api.functions.chatlists { let buffer = Buffer() buffer.appendInt32(-1992190687) chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.getChatlistUpdates", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ChatlistUpdates? in + 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() { @@ -4234,7 +4183,7 @@ public extension Api.functions.chatlists { let buffer = Buffer() buffer.appendInt32(-838608253) chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.getExportedInvites", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.chatlists.ExportedInvites? in + 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() { @@ -4249,7 +4198,7 @@ public extension Api.functions.chatlists { let buffer = Buffer() buffer.appendInt32(-37955820) chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.getLeaveChatlistSuggestions", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Peer]? in + 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() { @@ -4264,7 +4213,7 @@ public extension Api.functions.chatlists { let buffer = Buffer() buffer.appendInt32(1726252795) chatlist.serialize(buffer, true) - return (FunctionDescription(name: "chatlists.hideChatlistUpdates", parameters: [("chatlist", String(describing: chatlist))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4284,7 +4233,7 @@ public extension Api.functions.chatlists { for item in peers { item.serialize(buffer, true) } - return (FunctionDescription(name: "chatlists.joinChatlistInvite", parameters: [("slug", String(describing: slug)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4304,7 +4253,7 @@ public extension Api.functions.chatlists { for item in peers { item.serialize(buffer, true) } - return (FunctionDescription(name: "chatlists.joinChatlistUpdates", parameters: [("chatlist", String(describing: chatlist)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4324,7 +4273,7 @@ public extension Api.functions.chatlists { for item in peers { item.serialize(buffer, true) } - return (FunctionDescription(name: "chatlists.leaveChatlist", parameters: [("chatlist", String(describing: chatlist)), ("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4339,7 +4288,7 @@ public extension Api.functions.contacts { let buffer = Buffer() buffer.appendInt32(-130964977) id.serialize(buffer, true) - return (FunctionDescription(name: "contacts.acceptContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4361,7 +4310,7 @@ public extension Api.functions.contacts { if Int(flags) & Int(1 << 1) != 0 { note!.serialize(buffer, true) } - return (FunctionDescription(name: "contacts.addContact", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("firstName", String(describing: firstName)), ("lastName", String(describing: lastName)), ("phone", String(describing: phone)), ("note", String(describing: note))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4377,7 +4326,7 @@ public extension Api.functions.contacts { buffer.appendInt32(774801204) serializeInt32(flags, buffer: buffer, boxed: false) id.serialize(buffer, true) - return (FunctionDescription(name: "contacts.block", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4393,7 +4342,7 @@ public extension Api.functions.contacts { buffer.appendInt32(698914348) serializeInt32(flags, buffer: buffer, boxed: false) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.blockFromReplies", parameters: [("flags", String(describing: flags)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4412,7 +4361,7 @@ public extension Api.functions.contacts { for item in phones { serializeString(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "contacts.deleteByPhones", parameters: [("phones", String(describing: phones))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4431,7 +4380,7 @@ public extension Api.functions.contacts { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "contacts.deleteContacts", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4450,7 +4399,7 @@ public extension Api.functions.contacts { for item in id { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "contacts.editCloseFriends", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4495,7 +4444,7 @@ public extension Api.functions.contacts { serializeInt32(flags, buffer: buffer, boxed: false) serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getBlocked", parameters: [("flags", String(describing: flags)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Blocked? in + 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() { @@ -4510,7 +4459,7 @@ public extension Api.functions.contacts { let buffer = Buffer() buffer.appendInt32(2061264541) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getContactIDs", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + 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() { @@ -4525,7 +4474,7 @@ public extension Api.functions.contacts { let buffer = Buffer() buffer.appendInt32(1574346258) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getContacts", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Contacts? in + 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() { @@ -4544,7 +4493,7 @@ public extension Api.functions.contacts { if Int(flags) & Int(1 << 0) != 0 { serializeInt32(selfExpires!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "contacts.getLocated", parameters: [("flags", String(describing: flags)), ("geoPoint", String(describing: geoPoint)), ("selfExpires", String(describing: selfExpires))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4573,7 +4522,7 @@ public extension Api.functions.contacts { let buffer = Buffer() buffer.appendInt32(-1228356717) serializeString(q, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getSponsoredPeers", parameters: [("q", String(describing: q))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.SponsoredPeers? in + 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() { @@ -4605,7 +4554,7 @@ public extension Api.functions.contacts { serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.getTopPeers", parameters: [("flags", String(describing: flags)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.TopPeers? in + 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() { @@ -4620,7 +4569,7 @@ public extension Api.functions.contacts { let buffer = Buffer() buffer.appendInt32(318789512) serializeString(token, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.importContactToken", parameters: [("token", String(describing: token))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + 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() { @@ -4639,7 +4588,7 @@ public extension Api.functions.contacts { for item in contacts { item.serialize(buffer, true) } - return (FunctionDescription(name: "contacts.importContacts", parameters: [("contacts", String(describing: contacts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ImportedContacts? in + 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() { @@ -4669,7 +4618,7 @@ public extension Api.functions.contacts { buffer.appendInt32(451113900) category.serialize(buffer, true) peer.serialize(buffer, true) - return (FunctionDescription(name: "contacts.resetTopPeerRating", parameters: [("category", String(describing: category)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4684,7 +4633,7 @@ public extension Api.functions.contacts { let buffer = Buffer() buffer.appendInt32(-1963375804) serializeString(phone, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.resolvePhone", parameters: [("phone", String(describing: phone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ResolvedPeer? in + 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() { @@ -4703,7 +4652,7 @@ public extension Api.functions.contacts { if Int(flags) & Int(1 << 0) != 0 { serializeString(referer!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "contacts.resolveUsername", parameters: [("flags", String(describing: flags)), ("username", String(describing: username)), ("referer", String(describing: referer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.ResolvedPeer? in + 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() { @@ -4719,7 +4668,7 @@ public extension Api.functions.contacts { buffer.appendInt32(301470424) serializeString(q, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.search", parameters: [("q", String(describing: q)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.contacts.Found? in + 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() { @@ -4740,7 +4689,7 @@ public extension Api.functions.contacts { item.serialize(buffer, true) } serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "contacts.setBlocked", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4755,7 +4704,7 @@ public extension Api.functions.contacts { let buffer = Buffer() buffer.appendInt32(-2062238246) enabled.serialize(buffer, true) - return (FunctionDescription(name: "contacts.toggleTopPeers", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4771,7 +4720,7 @@ public extension Api.functions.contacts { buffer.appendInt32(-1252994264) serializeInt32(flags, buffer: buffer, boxed: false) id.serialize(buffer, true) - return (FunctionDescription(name: "contacts.unblock", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4787,7 +4736,7 @@ public extension Api.functions.contacts { buffer.appendInt32(329212923) id.serialize(buffer, true) note.serialize(buffer, true) - return (FunctionDescription(name: "contacts.updateContactNote", parameters: [("id", String(describing: id)), ("note", String(describing: note))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4806,7 +4755,7 @@ public extension Api.functions.folders { for item in folderPeers { item.serialize(buffer, true) } - return (FunctionDescription(name: "folders.editPeerFolders", parameters: [("folderPeers", String(describing: folderPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -4821,7 +4770,7 @@ public extension Api.functions.fragment { let buffer = Buffer() buffer.appendInt32(-1105295942) collectible.serialize(buffer, true) - return (FunctionDescription(name: "fragment.getCollectibleInfo", parameters: [("collectible", String(describing: collectible))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.fragment.CollectibleInfo? in + 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() { @@ -4836,7 +4785,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(-294455398) id.serialize(buffer, true) - return (FunctionDescription(name: "help.acceptTermsOfService", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4852,7 +4801,7 @@ public extension Api.functions.help { buffer.appendInt32(-183649631) peer.serialize(buffer, true) serializeString(suggestion, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.dismissSuggestion", parameters: [("peer", String(describing: peer)), ("suggestion", String(describing: suggestion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -4873,7 +4822,7 @@ public extension Api.functions.help { for item in entities { item.serialize(buffer, true) } - return (FunctionDescription(name: "help.editUserInfo", parameters: [("userId", String(describing: userId)), ("message", String(describing: message)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.UserInfo? in + 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() { @@ -4888,7 +4837,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(1642330196) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getAppConfig", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.AppConfig? in + 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() { @@ -4903,7 +4852,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(1378703997) serializeString(source, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getAppUpdate", parameters: [("source", String(describing: source))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.AppUpdate? in + 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() { @@ -4947,7 +4896,7 @@ public extension Api.functions.help { buffer.appendInt32(1935116200) serializeString(langCode, buffer: buffer, boxed: false) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getCountriesList", parameters: [("langCode", String(describing: langCode)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.CountriesList? in + 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() { @@ -4962,7 +4911,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(1072547679) serializeString(path, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getDeepLinkInfo", parameters: [("path", String(describing: path))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.DeepLinkInfo? in + 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() { @@ -5005,7 +4954,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(-966677240) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getPassportConfig", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PassportConfig? in + 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() { @@ -5020,7 +4969,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(-629083089) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getPeerColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in + 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() { @@ -5035,7 +4984,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(-1412453891) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getPeerProfileColors", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.PeerColors? in + 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() { @@ -5078,7 +5027,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(1036054804) serializeString(referer, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getRecentMeUrls", parameters: [("referer", String(describing: referer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.RecentMeUrls? in + 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() { @@ -5135,7 +5084,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(1236468288) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.getTimezonesList", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.TimezonesList? in + 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() { @@ -5150,7 +5099,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(59377875) userId.serialize(buffer, true) - return (FunctionDescription(name: "help.getUserInfo", parameters: [("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.help.UserInfo? in + 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() { @@ -5165,7 +5114,7 @@ public extension Api.functions.help { let buffer = Buffer() buffer.appendInt32(505748629) peer.serialize(buffer, true) - return (FunctionDescription(name: "help.hidePromoData", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5184,7 +5133,7 @@ public extension Api.functions.help { for item in events { item.serialize(buffer, true) } - return (FunctionDescription(name: "help.saveAppLog", parameters: [("events", String(describing: events))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5200,7 +5149,7 @@ public extension Api.functions.help { buffer.appendInt32(-333262899) serializeInt32(pendingUpdatesCount, buffer: buffer, boxed: false) serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "help.setBotUpdatesStatus", parameters: [("pendingUpdatesCount", String(describing: pendingUpdatesCount)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5231,7 +5180,7 @@ public extension Api.functions.langpack { serializeString(langPack, buffer: buffer, boxed: false) serializeString(langCode, buffer: buffer, boxed: false) serializeInt32(fromVersion, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getDifference", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode)), ("fromVersion", String(describing: fromVersion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackDifference? in + 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() { @@ -5247,7 +5196,7 @@ public extension Api.functions.langpack { buffer.appendInt32(-219008246) serializeString(langPack, buffer: buffer, boxed: false) serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getLangPack", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackDifference? in + 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() { @@ -5263,7 +5212,7 @@ public extension Api.functions.langpack { buffer.appendInt32(1784243458) serializeString(langPack, buffer: buffer, boxed: false) serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getLanguage", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.LangPackLanguage? in + 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() { @@ -5278,7 +5227,7 @@ public extension Api.functions.langpack { let buffer = Buffer() buffer.appendInt32(1120311183) serializeString(langPack, buffer: buffer, boxed: false) - return (FunctionDescription(name: "langpack.getLanguages", parameters: [("langPack", String(describing: langPack))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackLanguage]? in + 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() { @@ -5299,7 +5248,7 @@ public extension Api.functions.langpack { for item in keys { serializeString(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "langpack.getStrings", parameters: [("langPack", String(describing: langPack)), ("langCode", String(describing: langCode)), ("keys", String(describing: keys))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.LangPackString]? in + 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() { @@ -5316,7 +5265,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeBytes(gB, buffer: buffer, boxed: false) serializeInt64(keyFingerprint, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.acceptEncryption", parameters: [("peer", String(describing: peer)), ("gB", String(describing: gB)), ("keyFingerprint", String(describing: keyFingerprint))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedChat? in + 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() { @@ -5346,7 +5295,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 4) != 0 { serializeString(matchCode!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.acceptUrlAuth", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("url", String(describing: url)), ("matchCode", String(describing: matchCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.UrlAuthResult? in + 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() { @@ -5363,7 +5312,7 @@ public extension Api.functions.messages { serializeInt64(chatId, buffer: buffer, boxed: false) userId.serialize(buffer, true) serializeInt32(fwdLimit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.addChatUser", parameters: [("chatId", String(describing: chatId)), ("userId", String(describing: userId)), ("fwdLimit", String(describing: fwdLimit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in + 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() { @@ -5380,7 +5329,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) answer.serialize(buffer, true) - return (FunctionDescription(name: "messages.addPollAnswer", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("answer", String(describing: answer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5401,7 +5350,7 @@ public extension Api.functions.messages { for item in list { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.appendTodoList", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("list", String(describing: list))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5416,7 +5365,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1051570619) serializeString(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkChatInvite", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ChatInvite? in + 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() { @@ -5431,7 +5380,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1140726259) serializeString(importHead, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkHistoryImport", parameters: [("importHead", String(describing: importHead))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HistoryImportParsed? in + 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() { @@ -5446,7 +5395,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1573261059) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.checkHistoryImportPeer", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.CheckedHistoryImportPeer? in + 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() { @@ -5461,7 +5410,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-237962285) serializeString(shortcut, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkQuickReplyShortcut", parameters: [("shortcut", String(describing: shortcut))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5477,7 +5426,7 @@ public extension Api.functions.messages { buffer.appendInt32(-911967477) serializeString(url, buffer: buffer, boxed: false) serializeString(matchCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.checkUrlAuthMatchCode", parameters: [("url", String(describing: url)), ("matchCode", String(describing: matchCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5520,7 +5469,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-1986437075) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.clearRecentStickers", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5536,7 +5485,7 @@ public extension Api.functions.messages { buffer.appendInt32(-2110454402) serializeInt32(flags, buffer: buffer, boxed: false) serializeBytes(randomId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.clickSponsoredMessage", parameters: [("flags", String(describing: flags)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5558,7 +5507,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 2) != 0 { serializeString(changeTone!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.composeMessageWithAI", parameters: [("flags", String(describing: flags)), ("text", String(describing: text)), ("translateToLang", String(describing: translateToLang)), ("changeTone", String(describing: changeTone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ComposedMessageWithAI? in + return (FunctionDescription(name: "messages.composeMessageWithAI", parameters: [("flags", ConstructorParameterDescription(flags)), ("text", ConstructorParameterDescription(text)), ("translateToLang", ConstructorParameterDescription(translateToLang)), ("changeTone", ConstructorParameterDescription(changeTone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ComposedMessageWithAI? in let reader = BufferReader(buffer) var result: Api.messages.ComposedMessageWithAI? if let signature = reader.readInt32() { @@ -5582,7 +5531,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { serializeInt32(ttlPeriod!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.createChat", parameters: [("flags", String(describing: flags)), ("users", String(describing: users)), ("title", String(describing: title)), ("ttlPeriod", String(describing: ttlPeriod))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.InvitedUsers? in + 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() { @@ -5609,7 +5558,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 2) != 0 { sendAs!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.createForumTopic", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("title", String(describing: title)), ("iconColor", String(describing: iconColor)), ("iconEmojiId", String(describing: iconEmojiId)), ("randomId", String(describing: randomId)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5624,7 +5573,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(893610940) serializeString(url, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.declineUrlAuth", parameters: [("url", String(describing: url))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5639,7 +5588,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1540419152) serializeInt64(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5656,7 +5605,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) serializeInt64(chatId, buffer: buffer, boxed: false) userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.deleteChatUser", parameters: [("flags", String(describing: flags)), ("chatId", String(describing: chatId)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5672,7 +5621,7 @@ public extension Api.functions.messages { buffer.appendInt32(-731601877) peer.serialize(buffer, true) serializeString(link, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteExportedChatInvite", parameters: [("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5688,7 +5637,7 @@ public extension Api.functions.messages { buffer.appendInt32(-774204404) peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5711,7 +5660,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 3) != 0 { serializeInt32(maxDate!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.deleteHistory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -5731,7 +5680,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.deleteMessages", parameters: [("flags", String(describing: flags)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + 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() { @@ -5746,7 +5695,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-104078327) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deletePhoneCallHistory", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedFoundMessages? in + 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() { @@ -5763,7 +5712,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) serializeBytes(option, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deletePollAnswer", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("option", String(describing: option))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5783,7 +5732,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.deleteQuickReplyMessages", parameters: [("shortcutId", String(describing: shortcutId)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5798,7 +5747,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1019234112) serializeInt32(shortcutId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteQuickReplyShortcut", parameters: [("shortcutId", String(describing: shortcutId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5814,7 +5763,7 @@ public extension Api.functions.messages { buffer.appendInt32(1452833749) peer.serialize(buffer, true) adminId.serialize(buffer, true) - return (FunctionDescription(name: "messages.deleteRevokedExportedChatInvites", parameters: [("peer", String(describing: peer)), ("adminId", String(describing: adminId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5840,7 +5789,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 3) != 0 { serializeInt32(maxDate!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.deleteSavedHistory", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -5860,7 +5809,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.deleteScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5876,7 +5825,7 @@ public extension Api.functions.messages { buffer.appendInt32(-763269360) peer.serialize(buffer, true) serializeInt32(topMsgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.deleteTopicHistory", parameters: [("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -5892,7 +5841,7 @@ public extension Api.functions.messages { buffer.appendInt32(-208425312) serializeInt32(flags, buffer: buffer, boxed: false) serializeInt32(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.discardEncryption", parameters: [("flags", String(describing: flags)), ("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5908,7 +5857,7 @@ public extension Api.functions.messages { buffer.appendInt32(-554301545) peer.serialize(buffer, true) serializeString(about, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editChatAbout", parameters: [("peer", String(describing: peer)), ("about", String(describing: about))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5925,7 +5874,7 @@ public extension Api.functions.messages { serializeInt64(chatId, buffer: buffer, boxed: false) userId.serialize(buffer, true) isAdmin.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatAdmin", parameters: [("chatId", String(describing: chatId)), ("userId", String(describing: userId)), ("isAdmin", String(describing: isAdmin))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -5942,7 +5891,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) userId.serialize(buffer, true) password.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatCreator", parameters: [("peer", String(describing: peer)), ("userId", String(describing: userId)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5958,7 +5907,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1517917375) peer.serialize(buffer, true) bannedRights.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatDefaultBannedRights", parameters: [("peer", String(describing: peer)), ("bannedRights", String(describing: bannedRights))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5975,7 +5924,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) participant.serialize(buffer, true) serializeString(rank, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editChatParticipantRank", parameters: [("peer", String(describing: peer)), ("participant", String(describing: participant)), ("rank", String(describing: rank))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -5991,7 +5940,7 @@ public extension Api.functions.messages { buffer.appendInt32(903730804) serializeInt64(chatId, buffer: buffer, boxed: false) photo.serialize(buffer, true) - return (FunctionDescription(name: "messages.editChatPhoto", parameters: [("chatId", String(describing: chatId)), ("photo", String(describing: photo))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -6007,7 +5956,7 @@ public extension Api.functions.messages { buffer.appendInt32(1937260541) serializeInt64(chatId, buffer: buffer, boxed: false) serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editChatTitle", parameters: [("chatId", String(describing: chatId)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -6036,7 +5985,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 4) != 0 { serializeString(title!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.editExportedChatInvite", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link)), ("expireDate", String(describing: expireDate)), ("usageLimit", String(describing: usageLimit)), ("requestNeeded", String(describing: requestNeeded)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvite? in + 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() { @@ -6053,7 +6002,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) text.serialize(buffer, true) - return (FunctionDescription(name: "messages.editFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("text", String(describing: text))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -6082,7 +6031,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 3) != 0 { hidden!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.editForumTopic", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topicId", String(describing: topicId)), ("title", String(describing: title)), ("iconEmojiId", String(describing: iconEmojiId)), ("closed", String(describing: closed)), ("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -6114,7 +6063,7 @@ public extension Api.functions.messages { item.serialize(buffer, true) } } - return (FunctionDescription(name: "messages.editInlineBotMessage", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("message", String(describing: message)), ("media", String(describing: media)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -6156,7 +6105,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 17) != 0 { serializeInt32(quickReplyShortcutId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.editMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("message", String(describing: message)), ("media", String(describing: media)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("quickReplyShortcutId", String(describing: quickReplyShortcutId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -6172,7 +6121,7 @@ public extension Api.functions.messages { buffer.appendInt32(1543519471) serializeInt32(shortcutId, buffer: buffer, boxed: false) serializeString(shortcut, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.editQuickReplyShortcut", parameters: [("shortcutId", String(describing: shortcutId)), ("shortcut", String(describing: shortcut))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -6200,7 +6149,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 5) != 0 { subscriptionPricing!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.exportChatInvite", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("expireDate", String(describing: expireDate)), ("usageLimit", String(describing: usageLimit)), ("title", String(describing: title)), ("subscriptionPricing", String(describing: subscriptionPricing))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedChatInvite? in + 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() { @@ -6216,7 +6165,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1174420133) id.serialize(buffer, true) unfave.serialize(buffer, true) - return (FunctionDescription(name: "messages.faveSticker", parameters: [("id", String(describing: id)), ("unfave", String(describing: unfave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -6273,7 +6222,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 23) != 0 { suggestedPost!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.forwardMessages", parameters: [("flags", String(describing: flags)), ("fromPeer", String(describing: fromPeer)), ("id", String(describing: id)), ("randomId", String(describing: randomId)), ("toPeer", String(describing: toPeer)), ("topMsgId", String(describing: topMsgId)), ("replyTo", String(describing: replyTo)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("videoTimestamp", String(describing: videoTimestamp)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -6288,7 +6237,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(958457583) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getAdminsWithInvites", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatAdminsWithInvites? in + 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() { @@ -6317,7 +6266,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-1197432408) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAllStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in + 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() { @@ -6334,7 +6283,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) serializeInt64(offsetId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getArchivedStickers", parameters: [("flags", String(describing: flags)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ArchivedStickers? in + 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() { @@ -6349,7 +6298,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1998676370) bot.serialize(buffer, true) - return (FunctionDescription(name: "messages.getAttachMenuBot", parameters: [("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AttachMenuBotsBot? in + 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() { @@ -6364,7 +6313,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(385663691) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAttachMenuBots", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.AttachMenuBots? in + 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() { @@ -6379,7 +6328,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-866424884) media.serialize(buffer, true) - return (FunctionDescription(name: "messages.getAttachedStickers", parameters: [("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StickerSetCovered]? in + 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() { @@ -6394,7 +6343,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-559805895) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAvailableEffects", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AvailableEffects? in + 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() { @@ -6409,7 +6358,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(417243308) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getAvailableReactions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AvailableReactions? in + 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() { @@ -6425,7 +6374,7 @@ public extension Api.functions.messages { buffer.appendInt32(889046467) app.serialize(buffer, true) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getBotApp", parameters: [("app", String(describing: app)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotApp? in + 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() { @@ -6448,7 +6397,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 2) != 0 { password!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.getBotCallbackAnswer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("data", String(describing: data)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotCallbackAnswer? in + 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() { @@ -6473,7 +6422,7 @@ public extension Api.functions.messages { serializeInt32(offsetDate, buffer: buffer, boxed: false) offsetUser.serialize(buffer, true) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getChatInviteImporters", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link)), ("q", String(describing: q)), ("offsetDate", String(describing: offsetDate)), ("offsetUser", String(describing: offsetUser)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatInviteImporters? in + 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() { @@ -6492,7 +6441,7 @@ public extension Api.functions.messages { for item in id { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getChats", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + 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() { @@ -6509,7 +6458,7 @@ public extension Api.functions.messages { userId.serialize(buffer, true) serializeInt64(maxId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getCommonChats", parameters: [("userId", String(describing: userId)), ("maxId", String(describing: maxId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Chats? in + 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() { @@ -6528,7 +6477,7 @@ public extension Api.functions.messages { for item in documentId { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getCustomEmojiDocuments", parameters: [("documentId", String(describing: documentId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.Document]? in + 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() { @@ -6557,7 +6506,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-1107741656) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDefaultTagReactions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in + 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() { @@ -6573,7 +6522,7 @@ public extension Api.functions.messages { buffer.appendInt32(651135312) serializeInt32(version, buffer: buffer, boxed: false) serializeInt32(randomLength, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDhConfig", parameters: [("version", String(describing: version)), ("randomLength", String(describing: randomLength))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DhConfig? in + 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() { @@ -6605,7 +6554,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { parentPeer!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.getDialogUnreadMarks", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.DialogPeer]? in + 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() { @@ -6628,7 +6577,7 @@ public extension Api.functions.messages { offsetPeer.serialize(buffer, true) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDialogs", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetPeer", String(describing: offsetPeer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Dialogs? in + 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() { @@ -6644,7 +6593,7 @@ public extension Api.functions.messages { buffer.appendInt32(1147761405) peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDiscussionMessage", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.DiscussionMessage? in + 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() { @@ -6661,7 +6610,7 @@ public extension Api.functions.messages { serializeBytes(sha256, buffer: buffer, boxed: false) serializeInt64(size, buffer: buffer, boxed: false) serializeString(mimeType, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getDocumentByHash", parameters: [("sha256", String(describing: sha256)), ("size", String(describing: size)), ("mimeType", String(describing: mimeType))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Document? in + 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() { @@ -6690,7 +6639,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1955122779) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + 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() { @@ -6705,7 +6654,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(899735650) serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiKeywords", parameters: [("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiKeywordsDifference? in + 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() { @@ -6721,7 +6670,7 @@ public extension Api.functions.messages { buffer.appendInt32(352892591) serializeString(langCode, buffer: buffer, boxed: false) serializeInt32(fromVersion, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiKeywordsDifference", parameters: [("langCode", String(describing: langCode)), ("fromVersion", String(describing: fromVersion))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiKeywordsDifference? in + 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() { @@ -6740,7 +6689,7 @@ public extension Api.functions.messages { for item in langCodes { serializeString(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getEmojiKeywordsLanguages", parameters: [("langCodes", String(describing: langCodes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.EmojiLanguage]? in + 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() { @@ -6755,7 +6704,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(564480243) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiProfilePhotoGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + 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() { @@ -6770,7 +6719,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(785209037) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiStatusGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + 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() { @@ -6785,7 +6734,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(500711669) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiStickerGroups", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.EmojiGroups? in + 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() { @@ -6800,7 +6749,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-67329649) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in + 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() { @@ -6815,7 +6764,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-709817306) serializeString(langCode, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getEmojiURL", parameters: [("langCode", String(describing: langCode))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiURL? in + 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() { @@ -6831,7 +6780,7 @@ public extension Api.functions.messages { buffer.appendInt32(1937010524) peer.serialize(buffer, true) serializeString(link, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getExportedChatInvite", parameters: [("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvite? in + 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() { @@ -6855,7 +6804,7 @@ public extension Api.functions.messages { serializeString(offsetLink!, buffer: buffer, boxed: false) } serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getExportedChatInvites", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("adminId", String(describing: adminId)), ("offsetDate", String(describing: offsetDate)), ("offsetLink", String(describing: offsetLink)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ExportedChatInvites? in + 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() { @@ -6875,7 +6824,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getExtendedMedia", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -6895,7 +6844,7 @@ public extension Api.functions.messages { for item in msgId { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getFactCheck", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FactCheck]? in + 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() { @@ -6910,7 +6859,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(82946729) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFavedStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FavedStickers? in + 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() { @@ -6925,7 +6874,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(248473398) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFeaturedEmojiStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in + 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() { @@ -6940,7 +6889,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1685588756) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFeaturedStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in + 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() { @@ -6963,7 +6912,7 @@ public extension Api.functions.messages { serializeInt32(offsetId, buffer: buffer, boxed: false) serializeInt32(offsetTopic, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getForumTopics", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetTopic", String(describing: offsetTopic)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ForumTopics? in + 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() { @@ -6983,7 +6932,7 @@ public extension Api.functions.messages { for item in topics { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getForumTopicsByID", parameters: [("peer", String(describing: peer)), ("topics", String(describing: topics))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ForumTopics? in + 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() { @@ -6998,7 +6947,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-1364194508) serializeInt64(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getFullChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.ChatFull? in + 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() { @@ -7013,7 +6962,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(998051494) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getFutureChatCreatorAfterLeave", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.User? in + 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() { @@ -7030,7 +6979,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.getGameHighScores", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HighScores? in + 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() { @@ -7052,7 +7001,7 @@ public extension Api.functions.messages { serializeInt32(maxId, buffer: buffer, boxed: false) serializeInt32(minId, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getHistory", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7074,7 +7023,7 @@ public extension Api.functions.messages { } serializeString(query, buffer: buffer, boxed: false) serializeString(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getInlineBotResults", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("peer", String(describing: peer)), ("geoPoint", String(describing: geoPoint)), ("query", String(describing: query)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotResults? in + 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() { @@ -7090,7 +7039,7 @@ public extension Api.functions.messages { buffer.appendInt32(258170395) id.serialize(buffer, true) userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.getInlineGameHighScores", parameters: [("id", String(describing: id)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HighScores? in + 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() { @@ -7105,7 +7054,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1678738104) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMaskStickers", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AllStickers? in + 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() { @@ -7121,7 +7070,7 @@ public extension Api.functions.messages { buffer.appendInt32(-39416522) peer.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMessageEditData", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageEditData? in + 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() { @@ -7145,7 +7094,7 @@ public extension Api.functions.messages { serializeString(offset!, buffer: buffer, boxed: false) } serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMessageReactionsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("reaction", String(describing: reaction)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageReactionsList? in + 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() { @@ -7161,7 +7110,7 @@ public extension Api.functions.messages { buffer.appendInt32(834782287) peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMessageReadParticipants", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReadParticipantDate]? in + 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() { @@ -7180,7 +7129,7 @@ public extension Api.functions.messages { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.getMessages", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7200,7 +7149,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getMessagesReactions", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -7221,7 +7170,7 @@ public extension Api.functions.messages { serializeInt32(item, buffer: buffer, boxed: false) } increment.serialize(buffer, true) - return (FunctionDescription(name: "messages.getMessagesViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("increment", String(describing: increment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MessageViews? in + 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() { @@ -7237,7 +7186,7 @@ public extension Api.functions.messages { buffer.appendInt32(-793386500) serializeInt64(offsetId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getMyStickers", parameters: [("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.MyStickers? in + 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() { @@ -7254,7 +7203,7 @@ public extension Api.functions.messages { serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getOldFeaturedStickers", parameters: [("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FeaturedStickers? in + 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() { @@ -7269,7 +7218,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1848369232) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getOnlines", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ChatOnlines? in + 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() { @@ -7285,7 +7234,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1941176739) peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getOutboxReadDate", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.OutboxReadDate? in + 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() { @@ -7318,7 +7267,7 @@ public extension Api.functions.messages { for item in peers { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.getPeerDialogs", parameters: [("peers", String(describing: peers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerDialogs? in + 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() { @@ -7333,7 +7282,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-270948702) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.getPeerSettings", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerSettings? in + 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() { @@ -7348,7 +7297,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-692498958) serializeInt32(folderId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPinnedDialogs", parameters: [("folderId", String(describing: folderId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PeerDialogs? in + 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() { @@ -7379,7 +7328,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) serializeInt64(pollHash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPollResults", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("pollHash", String(describing: pollHash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -7403,7 +7352,7 @@ public extension Api.functions.messages { serializeString(offset!, buffer: buffer, boxed: false) } serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPollVotes", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.VotesList? in + 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() { @@ -7419,7 +7368,7 @@ public extension Api.functions.messages { buffer.appendInt32(-2055291464) bot.serialize(buffer, true) serializeString(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getPreparedInlineMessage", parameters: [("bot", String(describing: bot)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.PreparedInlineMessage? in + 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() { @@ -7434,7 +7383,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-729550168) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getQuickReplies", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.QuickReplies? in + 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() { @@ -7458,7 +7407,7 @@ public extension Api.functions.messages { } } serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getQuickReplyMessages", parameters: [("flags", String(describing: flags)), ("shortcutId", String(describing: shortcutId)), ("id", String(describing: id)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7475,7 +7424,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getRecentLocations", parameters: [("peer", String(describing: peer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7491,7 +7440,7 @@ public extension Api.functions.messages { buffer.appendInt32(960896434) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getRecentReactions", parameters: [("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in + 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() { @@ -7507,7 +7456,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1649852357) serializeInt32(flags, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getRecentStickers", parameters: [("flags", String(describing: flags)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.RecentStickers? in + 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() { @@ -7530,7 +7479,7 @@ public extension Api.functions.messages { serializeInt32(maxId, buffer: buffer, boxed: false) serializeInt32(minId, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getReplies", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7553,7 +7502,7 @@ public extension Api.functions.messages { offsetPeer.serialize(buffer, true) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedDialogs", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("offsetDate", String(describing: offsetDate)), ("offsetId", String(describing: offsetId)), ("offsetPeer", String(describing: offsetPeer)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in + 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() { @@ -7576,7 +7525,7 @@ public extension Api.functions.messages { for item in ids { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.getSavedDialogsByID", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("ids", String(describing: ids))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedDialogs? in + 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() { @@ -7591,7 +7540,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1559270965) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedGifs", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedGifs? in + 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() { @@ -7617,7 +7566,7 @@ public extension Api.functions.messages { serializeInt32(maxId, buffer: buffer, boxed: false) serializeInt32(minId, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedHistory", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7636,7 +7585,7 @@ public extension Api.functions.messages { peer!.serialize(buffer, true) } serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSavedReactionTags", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SavedReactionTags? in + 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() { @@ -7652,7 +7601,7 @@ public extension Api.functions.messages { buffer.appendInt32(-183077365) peer.serialize(buffer, true) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getScheduledHistory", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7672,7 +7621,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7699,7 +7648,7 @@ public extension Api.functions.messages { for item in filters { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.getSearchCounters", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("topMsgId", String(describing: topMsgId)), ("filters", String(describing: filters))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.messages.SearchCounter]? in + 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() { @@ -7721,7 +7670,7 @@ public extension Api.functions.messages { filter.serialize(buffer, true) serializeInt32(offsetId, buffer: buffer, boxed: false) serializeInt32(offsetDate, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSearchResultsCalendar", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("filter", String(describing: filter)), ("offsetId", String(describing: offsetId)), ("offsetDate", String(describing: offsetDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SearchResultsCalendar? in + 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() { @@ -7743,7 +7692,7 @@ public extension Api.functions.messages { filter.serialize(buffer, true) serializeInt32(offsetId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getSearchResultsPositions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("savedPeerId", String(describing: savedPeerId)), ("filter", String(describing: filter)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SearchResultsPositions? in + 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() { @@ -7776,7 +7725,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { serializeInt32(msgId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.getSponsoredMessages", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SponsoredMessages? in + 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() { @@ -7792,7 +7741,7 @@ public extension Api.functions.messages { buffer.appendInt32(-928977804) stickerset.serialize(buffer, true) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -7808,7 +7757,7 @@ public extension Api.functions.messages { buffer.appendInt32(-710552671) serializeString(emoticon, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getStickers", parameters: [("emoticon", String(describing: emoticon)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Stickers? in + 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() { @@ -7838,7 +7787,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1149164102) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getTopReactions", parameters: [("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Reactions? in + 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() { @@ -7862,7 +7811,7 @@ public extension Api.functions.messages { serializeInt32(limit, buffer: buffer, boxed: false) serializeInt32(maxId, buffer: buffer, boxed: false) serializeInt32(minId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getUnreadMentions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7886,7 +7835,7 @@ public extension Api.functions.messages { 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", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7913,7 +7862,7 @@ public extension Api.functions.messages { serializeInt32(limit, buffer: buffer, boxed: false) serializeInt32(maxId, buffer: buffer, boxed: false) serializeInt32(minId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getUnreadReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -7929,7 +7878,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1919511901) serializeString(url, buffer: buffer, boxed: false) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.getWebPage", parameters: [("url", String(describing: url)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.WebPage? in + 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() { @@ -7952,7 +7901,7 @@ public extension Api.functions.messages { item.serialize(buffer, true) } } - return (FunctionDescription(name: "messages.getWebPagePreview", parameters: [("flags", String(describing: flags)), ("message", String(describing: message)), ("entities", String(describing: entities))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.WebPagePreview? in + 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() { @@ -7971,7 +7920,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 1) != 0 { serializeString(link!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.hideAllChatJoinRequests", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -7988,7 +7937,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) userId.serialize(buffer, true) - return (FunctionDescription(name: "messages.hideChatJoinRequest", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -8003,7 +7952,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1336717624) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.hidePeerSettingsBar", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8018,7 +7967,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1817183516) serializeString(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.importChatInvite", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -8035,7 +7984,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) file.serialize(buffer, true) serializeInt32(mediaCount, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.initHistoryImport", parameters: [("peer", String(describing: peer)), ("file", String(describing: file)), ("mediaCount", String(describing: mediaCount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.HistoryImport? in + 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() { @@ -8051,7 +8000,7 @@ public extension Api.functions.messages { buffer.appendInt32(-946871200) stickerset.serialize(buffer, true) archived.serialize(buffer, true) - return (FunctionDescription(name: "messages.installStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("archived", String(describing: archived))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSetInstallResult? in + 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() { @@ -8070,7 +8019,7 @@ public extension Api.functions.messages { parentPeer!.serialize(buffer, true) } peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.markDialogUnread", parameters: [("flags", String(describing: flags)), ("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8085,7 +8034,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-1568189671) serializeInt64(chatId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.migrateChat", parameters: [("chatId", String(describing: chatId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -8109,7 +8058,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 13) != 0 { sendAs!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.prolongWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("queryId", String(describing: queryId)), ("replyTo", String(describing: replyTo)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8127,7 +8076,7 @@ public extension Api.functions.messages { serializeInt32(msgId, buffer: buffer, boxed: false) serializeInt64(transcriptionId, buffer: buffer, boxed: false) good.serialize(buffer, true) - return (FunctionDescription(name: "messages.rateTranscribedAudio", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("transcriptionId", String(describing: transcriptionId)), ("good", String(describing: good))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8144,7 +8093,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) serializeInt32(readMaxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readDiscussion", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("readMaxId", String(describing: readMaxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8160,7 +8109,7 @@ public extension Api.functions.messages { buffer.appendInt32(2135648522) peer.serialize(buffer, true) serializeInt32(maxDate, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readEncryptedHistory", parameters: [("peer", String(describing: peer)), ("maxDate", String(describing: maxDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8179,7 +8128,7 @@ public extension Api.functions.messages { for item in id { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.readFeaturedStickers", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8195,7 +8144,7 @@ public extension Api.functions.messages { buffer.appendInt32(238054714) peer.serialize(buffer, true) serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readHistory", parameters: [("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + 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() { @@ -8214,7 +8163,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { serializeInt32(topMsgId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.readMentions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -8233,7 +8182,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.readMessageContents", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedMessages? in + 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() { @@ -8252,7 +8201,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { serializeInt32(topMsgId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.readPollVotes", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -8274,7 +8223,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 1) != 0 { savedPeerId!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.readReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -8291,7 +8240,7 @@ public extension Api.functions.messages { parentPeer.serialize(buffer, true) peer.serialize(buffer, true) serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.readSavedHistory", parameters: [("parentPeer", String(describing: parentPeer)), ("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8306,7 +8255,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(94983360) serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.receivedMessages", parameters: [("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.ReceivedNotifyMessage]? in + 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() { @@ -8321,7 +8270,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1436924774) serializeInt32(maxQts, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.receivedQueue", parameters: [("maxQts", String(describing: maxQts))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in + 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() { @@ -8342,7 +8291,7 @@ public extension Api.functions.messages { for item in order { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.reorderPinnedDialogs", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8363,7 +8312,7 @@ public extension Api.functions.messages { for item in order { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.reorderPinnedForumTopics", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -8383,7 +8332,7 @@ public extension Api.functions.messages { for item in order { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.reorderPinnedSavedDialogs", parameters: [("flags", String(describing: flags)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8402,7 +8351,7 @@ public extension Api.functions.messages { for item in order { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.reorderQuickReplies", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8422,7 +8371,7 @@ public extension Api.functions.messages { for item in order { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.reorderStickerSets", parameters: [("flags", String(describing: flags)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8444,7 +8393,7 @@ public extension Api.functions.messages { } serializeBytes(option, buffer: buffer, boxed: false) serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.report", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReportResult? in + 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() { @@ -8459,7 +8408,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1259113487) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.reportEncryptedSpam", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8480,7 +8429,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.reportMessagesDelivery", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8496,7 +8445,7 @@ public extension Api.functions.messages { buffer.appendInt32(-574826471) id.serialize(buffer, true) serializeInt32(listenedDuration, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.reportMusicListen", parameters: [("id", String(describing: id)), ("listenedDuration", String(describing: listenedDuration))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8513,7 +8462,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) reactionPeer.serialize(buffer, true) - return (FunctionDescription(name: "messages.reportReaction", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("reactionPeer", String(describing: reactionPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8533,7 +8482,7 @@ public extension Api.functions.messages { for item in metrics { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.reportReadMetrics", parameters: [("peer", String(describing: peer)), ("metrics", String(describing: metrics))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8548,7 +8497,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-820669733) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.reportSpam", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8564,7 +8513,7 @@ public extension Api.functions.messages { buffer.appendInt32(315355332) serializeBytes(randomId, buffer: buffer, boxed: false) serializeBytes(option, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.reportSponsoredMessage", parameters: [("randomId", String(describing: randomId)), ("option", String(describing: option))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.channels.SponsoredMessageReportResult? in + 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() { @@ -8588,7 +8537,7 @@ public extension Api.functions.messages { themeParams!.serialize(buffer, true) } serializeString(platform, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestAppWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("app", String(describing: app)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + 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() { @@ -8605,7 +8554,7 @@ public extension Api.functions.messages { userId.serialize(buffer, true) serializeInt32(randomId, buffer: buffer, boxed: false) serializeBytes(gA, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestEncryption", parameters: [("userId", String(describing: userId)), ("randomId", String(describing: randomId)), ("gA", String(describing: gA))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedChat? in + 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() { @@ -8629,7 +8578,7 @@ public extension Api.functions.messages { themeParams!.serialize(buffer, true) } serializeString(platform, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestMainWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + 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() { @@ -8655,7 +8604,7 @@ public extension Api.functions.messages { themeParams!.serialize(buffer, true) } serializeString(platform, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.requestSimpleWebView", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("url", String(describing: url)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + 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() { @@ -8685,7 +8634,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 3) != 0 { serializeString(inAppOrigin!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.requestUrlAuth", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("buttonId", String(describing: buttonId)), ("url", String(describing: url)), ("inAppOrigin", String(describing: inAppOrigin))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.UrlAuthResult? in + 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() { @@ -8718,7 +8667,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 13) != 0 { sendAs!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.requestWebView", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("bot", String(describing: bot)), ("url", String(describing: url)), ("startParam", String(describing: startParam)), ("themeParams", String(describing: themeParams)), ("platform", String(describing: platform)), ("replyTo", String(describing: replyTo)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewResult? in + 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() { @@ -8734,7 +8683,7 @@ public extension Api.functions.messages { buffer.appendInt32(-855777386) peer.serialize(buffer, true) sendAs.serialize(buffer, true) - return (FunctionDescription(name: "messages.saveDefaultSendAs", parameters: [("peer", String(describing: peer)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8770,7 +8719,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 8) != 0 { suggestedPost!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.saveDraft", parameters: [("flags", String(describing: flags)), ("replyTo", String(describing: replyTo)), ("peer", String(describing: peer)), ("message", String(describing: message)), ("entities", String(describing: entities)), ("media", String(describing: media)), ("effect", String(describing: effect)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8786,7 +8735,7 @@ public extension Api.functions.messages { buffer.appendInt32(846868683) id.serialize(buffer, true) unsave.serialize(buffer, true) - return (FunctionDescription(name: "messages.saveGif", parameters: [("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8810,7 +8759,7 @@ public extension Api.functions.messages { item.serialize(buffer, true) } } - return (FunctionDescription(name: "messages.savePreparedInlineMessage", parameters: [("flags", String(describing: flags)), ("result", String(describing: result)), ("userId", String(describing: userId)), ("peerTypes", String(describing: peerTypes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.BotPreparedInlineMessage? in + 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() { @@ -8827,7 +8776,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) id.serialize(buffer, true) unsave.serialize(buffer, true) - return (FunctionDescription(name: "messages.saveRecentSticker", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("unsave", String(describing: unsave))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -8869,7 +8818,7 @@ public extension Api.functions.messages { serializeInt32(maxId, buffer: buffer, boxed: false) serializeInt32(minId, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.search", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("fromId", String(describing: fromId)), ("savedPeerId", String(describing: savedPeerId)), ("savedReaction", String(describing: savedReaction)), ("topMsgId", String(describing: topMsgId)), ("filter", String(describing: filter)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate)), ("offsetId", String(describing: offsetId)), ("addOffset", String(describing: addOffset)), ("limit", String(describing: limit)), ("maxId", String(describing: maxId)), ("minId", String(describing: minId)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -8885,7 +8834,7 @@ public extension Api.functions.messages { buffer.appendInt32(739360983) serializeString(emoticon, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchCustomEmoji", parameters: [("emoticon", String(describing: emoticon)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EmojiList? in + 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() { @@ -8902,7 +8851,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) serializeString(q, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchEmojiStickerSets", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickerSets? in + 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() { @@ -8928,7 +8877,7 @@ public extension Api.functions.messages { offsetPeer.serialize(buffer, true) serializeInt32(offsetId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchGlobal", parameters: [("flags", String(describing: flags)), ("folderId", String(describing: folderId)), ("q", String(describing: q)), ("filter", String(describing: filter)), ("minDate", String(describing: minDate)), ("maxDate", String(describing: maxDate)), ("offsetRate", String(describing: offsetRate)), ("offsetPeer", String(describing: offsetPeer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -8945,7 +8894,7 @@ public extension Api.functions.messages { serializeString(q, buffer: buffer, boxed: false) filter.serialize(buffer, true) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchSentMedia", parameters: [("q", String(describing: q)), ("filter", String(describing: filter)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.Messages? in + 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() { @@ -8962,7 +8911,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) serializeString(q, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchStickerSets", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickerSets? in + 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() { @@ -8987,7 +8936,7 @@ public extension Api.functions.messages { serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.searchStickers", parameters: [("flags", String(describing: flags)), ("q", String(describing: q)), ("emoticon", String(describing: emoticon)), ("langCode", String(describing: langCode)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.FoundStickers? in + 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() { @@ -9015,7 +8964,7 @@ public extension Api.functions.messages { for item in requestedPeers { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.sendBotRequestedPeer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("webappReqId", String(describing: webappReqId)), ("buttonId", String(describing: buttonId)), ("requestedPeers", String(describing: requestedPeers))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9033,7 +8982,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt64(randomId, buffer: buffer, boxed: false) serializeBytes(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendEncrypted", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in + 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() { @@ -9052,7 +9001,7 @@ public extension Api.functions.messages { serializeInt64(randomId, buffer: buffer, boxed: false) serializeBytes(data, buffer: buffer, boxed: false) file.serialize(buffer, true) - return (FunctionDescription(name: "messages.sendEncryptedFile", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in + 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() { @@ -9069,7 +9018,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt64(randomId, buffer: buffer, boxed: false) serializeBytes(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendEncryptedService", parameters: [("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.SentEncryptedMessage? in + 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() { @@ -9103,7 +9052,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 21) != 0 { serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.sendInlineBotResult", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("randomId", String(describing: randomId)), ("queryId", String(describing: queryId)), ("id", String(describing: id)), ("scheduleDate", String(describing: scheduleDate)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9156,7 +9105,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 22) != 0 { suggestedPost!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.sendMedia", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("media", String(describing: media)), ("message", String(describing: message)), ("randomId", String(describing: randomId)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9208,7 +9157,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 22) != 0 { suggestedPost!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.sendMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("message", String(describing: message)), ("randomId", String(describing: randomId)), ("replyMarkup", String(describing: replyMarkup)), ("entities", String(describing: entities)), ("scheduleDate", String(describing: scheduleDate)), ("scheduleRepeatPeriod", String(describing: scheduleRepeatPeriod)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars)), ("suggestedPost", String(describing: suggestedPost))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9247,7 +9196,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 21) != 0 { serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.sendMultiMedia", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("multiMedia", String(describing: multiMedia)), ("scheduleDate", String(describing: scheduleDate)), ("sendAs", String(describing: sendAs)), ("quickReplyShortcut", String(describing: quickReplyShortcut)), ("effect", String(describing: effect)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9269,7 +9218,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { `private`!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.sendPaidReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("count", String(describing: count)), ("randomId", String(describing: randomId)), ("`private`", String(describing: `private`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9295,7 +9244,7 @@ public extension Api.functions.messages { for item in randomId { serializeInt64(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.sendQuickReplyMessages", parameters: [("peer", String(describing: peer)), ("shortcutId", String(describing: shortcutId)), ("id", String(describing: id)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9319,7 +9268,7 @@ public extension Api.functions.messages { item.serialize(buffer, true) } } - return (FunctionDescription(name: "messages.sendReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9339,7 +9288,7 @@ public extension Api.functions.messages { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.sendScheduledMessages", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9356,7 +9305,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) replyTo.serialize(buffer, true) serializeInt64(randomId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendScreenshotNotification", parameters: [("peer", String(describing: peer)), ("replyTo", String(describing: replyTo)), ("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9377,7 +9326,7 @@ public extension Api.functions.messages { for item in options { serializeBytes(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.sendVote", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("options", String(describing: options))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9395,7 +9344,7 @@ public extension Api.functions.messages { serializeInt64(randomId, buffer: buffer, boxed: false) serializeString(buttonText, buffer: buffer, boxed: false) serializeString(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.sendWebViewData", parameters: [("bot", String(describing: bot)), ("randomId", String(describing: randomId)), ("buttonText", String(describing: buttonText)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9411,7 +9360,7 @@ public extension Api.functions.messages { buffer.appendInt32(172168437) serializeString(botQueryId, buffer: buffer, boxed: false) result.serialize(buffer, true) - return (FunctionDescription(name: "messages.sendWebViewResultMessage", parameters: [("botQueryId", String(describing: botQueryId)), ("result", String(describing: result))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.WebViewMessageSent? in + 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() { @@ -9434,7 +9383,7 @@ public extension Api.functions.messages { serializeString(url!, buffer: buffer, boxed: false) } serializeInt32(cacheTime, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setBotCallbackAnswer", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("message", String(describing: message)), ("url", String(describing: url)), ("cacheTime", String(describing: cacheTime))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9453,7 +9402,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { serializeString(error!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.setBotPrecheckoutResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("error", String(describing: error))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9479,7 +9428,7 @@ public extension Api.functions.messages { item.serialize(buffer, true) } } - return (FunctionDescription(name: "messages.setBotShippingResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("error", String(describing: error)), ("shippingOptions", String(describing: shippingOptions))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9502,7 +9451,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 1) != 0 { paidEnabled!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.setChatAvailableReactions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("availableReactions", String(describing: availableReactions)), ("reactionsLimit", String(describing: reactionsLimit)), ("paidEnabled", String(describing: paidEnabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9518,7 +9467,7 @@ public extension Api.functions.messages { buffer.appendInt32(135398089) peer.serialize(buffer, true) theme.serialize(buffer, true) - return (FunctionDescription(name: "messages.setChatTheme", parameters: [("peer", String(describing: peer)), ("theme", String(describing: theme))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9543,7 +9492,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 1) != 0 { serializeInt32(id!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.setChatWallPaper", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("wallpaper", String(describing: wallpaper)), ("settings", String(describing: settings)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9558,7 +9507,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-1632299963) serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setDefaultHistoryTTL", parameters: [("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9573,7 +9522,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(1330094102) reaction.serialize(buffer, true) - return (FunctionDescription(name: "messages.setDefaultReaction", parameters: [("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9589,7 +9538,7 @@ public extension Api.functions.messages { buffer.appendInt32(2031374829) peer.serialize(buffer, true) typing.serialize(buffer, true) - return (FunctionDescription(name: "messages.setEncryptedTyping", parameters: [("peer", String(describing: peer)), ("typing", String(describing: typing))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9608,7 +9557,7 @@ public extension Api.functions.messages { serializeInt32(id, buffer: buffer, boxed: false) userId.serialize(buffer, true) serializeInt32(score, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setGameScore", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("userId", String(describing: userId)), ("score", String(describing: score))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9624,7 +9573,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1207017500) peer.serialize(buffer, true) serializeInt32(period, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setHistoryTTL", parameters: [("peer", String(describing: peer)), ("period", String(describing: period))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9655,7 +9604,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 4) != 0 { switchWebview!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.setInlineBotResults", parameters: [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("results", String(describing: results)), ("cacheTime", String(describing: cacheTime)), ("nextOffset", String(describing: nextOffset)), ("switchPm", String(describing: switchPm)), ("switchWebview", String(describing: switchWebview))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9673,7 +9622,7 @@ public extension Api.functions.messages { id.serialize(buffer, true) userId.serialize(buffer, true) serializeInt32(score, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.setInlineGameScore", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("userId", String(describing: userId)), ("score", String(describing: score))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9693,7 +9642,7 @@ public extension Api.functions.messages { serializeInt32(topMsgId!, buffer: buffer, boxed: false) } action.serialize(buffer, true) - return (FunctionDescription(name: "messages.setTyping", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("action", String(describing: action))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9711,7 +9660,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt64(randomId, buffer: buffer, boxed: false) serializeString(startParam, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.startBot", parameters: [("bot", String(describing: bot)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("startParam", String(describing: startParam))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9727,7 +9676,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1271008444) peer.serialize(buffer, true) serializeInt64(importId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.startHistoryImport", parameters: [("peer", String(describing: peer)), ("importId", String(describing: importId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9750,7 +9699,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 2) != 0 { serializeString(tone!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.summarizeText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("toLang", String(describing: toLang)), ("tone", String(describing: tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.TextWithEntities? in + 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() { @@ -9767,7 +9716,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) bot.serialize(buffer, true) enabled.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleBotInAttachMenu", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9782,7 +9731,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-47326647) enabled.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleDialogFilterTags", parameters: [("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9798,7 +9747,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1489903017) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleDialogPin", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9818,7 +9767,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { serializeInt32(requestMsgId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.toggleNoForwards", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("enabled", String(describing: enabled)), ("requestMsgId", String(describing: requestMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9835,7 +9784,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) `private`.serialize(buffer, true) - return (FunctionDescription(name: "messages.togglePaidReactionPrivacy", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("`private`", String(describing: `private`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9851,7 +9800,7 @@ public extension Api.functions.messages { buffer.appendInt32(-461589127) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.togglePeerTranslations", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9867,7 +9816,7 @@ public extension Api.functions.messages { buffer.appendInt32(-1400783906) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - return (FunctionDescription(name: "messages.toggleSavedDialogPin", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9887,7 +9836,7 @@ public extension Api.functions.messages { for item in stickersets { item.serialize(buffer, true) } - return (FunctionDescription(name: "messages.toggleStickerSets", parameters: [("flags", String(describing: flags)), ("stickersets", String(describing: stickersets))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -9910,7 +9859,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 2) != 0 { serializeString(rejectComment!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.toggleSuggestedPostApproval", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("scheduleDate", String(describing: scheduleDate)), ("rejectComment", String(describing: rejectComment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9936,7 +9885,7 @@ public extension Api.functions.messages { for item in incompleted { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.toggleTodoCompleted", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("completed", String(describing: completed)), ("incompleted", String(describing: incompleted))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -9952,7 +9901,7 @@ public extension Api.functions.messages { buffer.appendInt32(647928393) peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.transcribeAudio", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranscribedAudio? in + 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() { @@ -9988,7 +9937,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 2) != 0 { serializeString(tone!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.translateText", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("text", String(describing: text)), ("toLang", String(describing: toLang)), ("tone", String(describing: tone))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.TranslatedText? in + 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() { @@ -10003,7 +9952,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(-110209570) stickerset.serialize(buffer, true) - return (FunctionDescription(name: "messages.uninstallStickerSet", parameters: [("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10025,7 +9974,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 1) != 0 { savedPeerId!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.unpinAllMessages", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("topMsgId", String(describing: topMsgId)), ("savedPeerId", String(describing: savedPeerId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.AffectedHistory? in + 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() { @@ -10044,7 +9993,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { filter!.serialize(buffer, true) } - return (FunctionDescription(name: "messages.updateDialogFilter", parameters: [("flags", String(describing: flags)), ("id", String(describing: id)), ("filter", String(describing: filter))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10063,7 +10012,7 @@ public extension Api.functions.messages { for item in order { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.updateDialogFiltersOrder", parameters: [("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10080,7 +10029,7 @@ public extension Api.functions.messages { peer.serialize(buffer, true) serializeInt32(topicId, buffer: buffer, boxed: false) pinned.serialize(buffer, true) - return (FunctionDescription(name: "messages.updatePinnedForumTopic", parameters: [("peer", String(describing: peer)), ("topicId", String(describing: topicId)), ("pinned", String(describing: pinned))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -10097,7 +10046,7 @@ public extension Api.functions.messages { serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.updatePinnedMessage", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -10116,7 +10065,7 @@ public extension Api.functions.messages { if Int(flags) & Int(1 << 0) != 0 { serializeString(title!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "messages.updateSavedReactionTag", parameters: [("flags", String(describing: flags)), ("reaction", String(describing: reaction)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10132,7 +10081,7 @@ public extension Api.functions.messages { buffer.appendInt32(1347929239) peer.serialize(buffer, true) file.serialize(buffer, true) - return (FunctionDescription(name: "messages.uploadEncryptedFile", parameters: [("peer", String(describing: peer)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.EncryptedFile? in + 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() { @@ -10150,7 +10099,7 @@ public extension Api.functions.messages { serializeInt64(importId, buffer: buffer, boxed: false) serializeString(fileName, buffer: buffer, boxed: false) media.serialize(buffer, true) - return (FunctionDescription(name: "messages.uploadImportedMedia", parameters: [("peer", String(describing: peer)), ("importId", String(describing: importId)), ("fileName", String(describing: fileName)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.MessageMedia? in + 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() { @@ -10170,7 +10119,7 @@ public extension Api.functions.messages { } peer.serialize(buffer, true) media.serialize(buffer, true) - return (FunctionDescription(name: "messages.uploadMedia", parameters: [("flags", String(describing: flags)), ("businessConnectionId", String(describing: businessConnectionId)), ("peer", String(describing: peer)), ("media", String(describing: media))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.MessageMedia? in + 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() { @@ -10185,7 +10134,7 @@ public extension Api.functions.messages { let buffer = Buffer() buffer.appendInt32(647902787) serializeBytes(randomId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "messages.viewSponsoredMessage", parameters: [("randomId", String(describing: randomId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10200,7 +10149,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-152934316) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.applyGiftCode", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -10216,7 +10165,7 @@ public extension Api.functions.payments { buffer.appendInt32(-2131921795) serializeBytes(receipt, buffer: buffer, boxed: false) purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.assignAppStoreTransaction", parameters: [("receipt", String(describing: receipt)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -10232,7 +10181,7 @@ public extension Api.functions.payments { buffer.appendInt32(-537046829) receipt.serialize(buffer, true) purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.assignPlayMarketTransaction", parameters: [("receipt", String(describing: receipt)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -10249,7 +10198,7 @@ public extension Api.functions.payments { serializeInt32(flags, buffer: buffer, boxed: false) userId.serialize(buffer, true) serializeString(chargeId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.botCancelStarsSubscription", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("chargeId", String(describing: chargeId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10264,7 +10213,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(1339842215) purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.canPurchaseStore", parameters: [("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10284,7 +10233,7 @@ public extension Api.functions.payments { if Int(flags) & Int(1 << 0) != 0 { canceled!.serialize(buffer, true) } - return (FunctionDescription(name: "payments.changeStarsSubscription", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("subscriptionId", String(describing: subscriptionId)), ("canceled", String(describing: canceled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10299,7 +10248,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-1060835895) serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.checkCanSendGift", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.CheckCanSendGiftResult? in + 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() { @@ -10314,7 +10263,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-1907247935) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.checkGiftCode", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.CheckedGiftCode? in + 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() { @@ -10329,7 +10278,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-667062079) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.clearSavedInfo", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10345,7 +10294,7 @@ public extension Api.functions.payments { buffer.appendInt32(2127901834) peer.serialize(buffer, true) bot.serialize(buffer, true) - return (FunctionDescription(name: "payments.connectStarRefBot", parameters: [("peer", String(describing: peer)), ("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + 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() { @@ -10360,7 +10309,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(1958676331) stargift.serialize(buffer, true) - return (FunctionDescription(name: "payments.convertStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10379,7 +10328,7 @@ public extension Api.functions.payments { for item in stargift { item.serialize(buffer, true) } - return (FunctionDescription(name: "payments.craftStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -10400,7 +10349,7 @@ public extension Api.functions.payments { for item in stargift { item.serialize(buffer, true) } - return (FunctionDescription(name: "payments.createStarGiftCollection", parameters: [("peer", String(describing: peer)), ("title", String(describing: title)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarGiftCollection? in + 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() { @@ -10416,7 +10365,7 @@ public extension Api.functions.payments { buffer.appendInt32(-1386854168) peer.serialize(buffer, true) serializeInt32(collectionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.deleteStarGiftCollection", parameters: [("peer", String(describing: peer)), ("collectionId", String(describing: collectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10433,7 +10382,7 @@ public extension Api.functions.payments { serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) serializeString(link, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.editConnectedStarRefBot", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("link", String(describing: link))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + 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() { @@ -10448,7 +10397,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(261206117) invoiceMedia.serialize(buffer, true) - return (FunctionDescription(name: "payments.exportInvoice", parameters: [("invoiceMedia", String(describing: invoiceMedia))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ExportedInvoice? in + 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() { @@ -10464,7 +10413,7 @@ public extension Api.functions.payments { buffer.appendInt32(-866391117) peer.serialize(buffer, true) serializeString(subscriptionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.fulfillStarsSubscription", parameters: [("peer", String(describing: peer)), ("subscriptionId", String(describing: subscriptionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -10479,7 +10428,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(779736953) serializeString(number, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getBankCardData", parameters: [("number", String(describing: number))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.BankCardData? in + 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() { @@ -10495,7 +10444,7 @@ public extension Api.functions.payments { buffer.appendInt32(-1210476304) peer.serialize(buffer, true) bot.serialize(buffer, true) - return (FunctionDescription(name: "payments.getConnectedStarRefBot", parameters: [("peer", String(describing: peer)), ("bot", String(describing: bot))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + 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() { @@ -10518,7 +10467,7 @@ public extension Api.functions.payments { serializeString(offsetLink!, buffer: buffer, boxed: false) } serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getConnectedStarRefBots", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offsetDate", String(describing: offsetDate)), ("offsetLink", String(describing: offsetLink)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ConnectedStarRefBots? in + 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() { @@ -10535,7 +10484,7 @@ public extension Api.functions.payments { serializeInt64(giftId, buffer: buffer, boxed: false) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getCraftStarGifts", parameters: [("giftId", String(describing: giftId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in + 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() { @@ -10551,7 +10500,7 @@ public extension Api.functions.payments { buffer.appendInt32(-198994907) peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getGiveawayInfo", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.GiveawayInfo? in + 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() { @@ -10570,7 +10519,7 @@ public extension Api.functions.payments { if Int(flags) & Int(1 << 0) != 0 { themeParams!.serialize(buffer, true) } - return (FunctionDescription(name: "payments.getPaymentForm", parameters: [("flags", String(describing: flags)), ("invoice", String(describing: invoice)), ("themeParams", String(describing: themeParams))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentForm? in + 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() { @@ -10586,7 +10535,7 @@ public extension Api.functions.payments { buffer.appendInt32(611897804) peer.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getPaymentReceipt", parameters: [("peer", String(describing: peer)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentReceipt? in + 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() { @@ -10604,7 +10553,7 @@ public extension Api.functions.payments { if Int(flags) & Int(1 << 0) != 0 { boostPeer!.serialize(buffer, true) } - return (FunctionDescription(name: "payments.getPremiumGiftCodeOptions", parameters: [("flags", String(describing: flags)), ("boostPeer", String(describing: boostPeer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.PremiumGiftCodeOption]? in + 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() { @@ -10632,7 +10581,7 @@ public extension Api.functions.payments { } serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getResaleStarGifts", parameters: [("flags", String(describing: flags)), ("attributesHash", String(describing: attributesHash)), ("giftId", String(describing: giftId)), ("attributes", String(describing: attributes)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ResaleStarGifts? in + 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() { @@ -10665,7 +10614,7 @@ public extension Api.functions.payments { for item in stargift { item.serialize(buffer, true) } - return (FunctionDescription(name: "payments.getSavedStarGift", parameters: [("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in + 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() { @@ -10686,7 +10635,7 @@ public extension Api.functions.payments { } serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getSavedStarGifts", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("collectionId", String(describing: collectionId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SavedStarGifts? in + 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() { @@ -10701,7 +10650,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-1513074355) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftActiveAuctions", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftActiveAuctions? in + 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() { @@ -10716,7 +10665,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(1805831148) serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftAuctionAcquiredGifts", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftAuctionAcquiredGifts? in + 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() { @@ -10732,7 +10681,7 @@ public extension Api.functions.payments { buffer.appendInt32(1553986774) auction.serialize(buffer, true) serializeInt32(version, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftAuctionState", parameters: [("auction", String(describing: auction)), ("version", String(describing: version))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftAuctionState? in + 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() { @@ -10748,7 +10697,7 @@ public extension Api.functions.payments { buffer.appendInt32(-1743023651) peer.serialize(buffer, true) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftCollections", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftCollections? in + 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() { @@ -10763,7 +10712,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(1828948824) serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftUpgradeAttributes", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftUpgradeAttributes? in + 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() { @@ -10778,7 +10727,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-1667580751) serializeInt64(giftId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGiftUpgradePreview", parameters: [("giftId", String(describing: giftId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftUpgradePreview? in + 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() { @@ -10794,7 +10743,7 @@ public extension Api.functions.payments { buffer.appendInt32(-798059608) stargift.serialize(buffer, true) password.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarGiftWithdrawalUrl", parameters: [("stargift", String(describing: stargift)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGiftWithdrawalUrl? in + 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() { @@ -10809,7 +10758,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-1000983152) serializeInt32(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarGifts", parameters: [("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarGifts? in + 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() { @@ -10827,7 +10776,7 @@ public extension Api.functions.payments { if Int(flags) & Int(1 << 0) != 0 { userId!.serialize(buffer, true) } - return (FunctionDescription(name: "payments.getStarsGiftOptions", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.StarsGiftOption]? in + 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() { @@ -10856,7 +10805,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-774377531) peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsRevenueAdsAccountUrl", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueAdsAccountUrl? in + 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() { @@ -10872,7 +10821,7 @@ public extension Api.functions.payments { buffer.appendInt32(-652215594) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsRevenueStats", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueStats? in + 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() { @@ -10892,7 +10841,7 @@ public extension Api.functions.payments { serializeInt64(amount!, buffer: buffer, boxed: false) } password.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsRevenueWithdrawalUrl", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("amount", String(describing: amount)), ("password", String(describing: password))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsRevenueWithdrawalUrl? in + 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() { @@ -10908,7 +10857,7 @@ public extension Api.functions.payments { buffer.appendInt32(1319744447) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.getStarsStatus", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + 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() { @@ -10925,7 +10874,7 @@ public extension Api.functions.payments { serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) serializeString(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarsSubscriptions", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + 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() { @@ -10960,7 +10909,7 @@ public extension Api.functions.payments { peer.serialize(buffer, true) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getStarsTransactions", parameters: [("flags", String(describing: flags)), ("subscriptionId", String(describing: subscriptionId)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + 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() { @@ -10981,7 +10930,7 @@ public extension Api.functions.payments { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "payments.getStarsTransactionsByID", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.StarsStatus? in + 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() { @@ -10999,7 +10948,7 @@ public extension Api.functions.payments { peer.serialize(buffer, true) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getSuggestedStarRefBots", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.SuggestedStarRefBots? in + 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() { @@ -11014,7 +10963,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(-1583919758) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getUniqueStarGift", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.UniqueStarGift? in + 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() { @@ -11029,7 +10978,7 @@ public extension Api.functions.payments { let buffer = Buffer() buffer.appendInt32(1130737515) serializeString(slug, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.getUniqueStarGiftValueInfo", parameters: [("slug", String(describing: slug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.UniqueStarGiftValueInfo? in + 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() { @@ -11046,7 +10995,7 @@ public extension Api.functions.payments { peer.serialize(buffer, true) serializeInt64(giveawayId, buffer: buffer, boxed: false) purpose.serialize(buffer, true) - return (FunctionDescription(name: "payments.launchPrepaidGiveaway", parameters: [("peer", String(describing: peer)), ("giveawayId", String(describing: giveawayId)), ("purpose", String(describing: purpose))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11062,7 +11011,7 @@ public extension Api.functions.payments { buffer.appendInt32(632196938) userId.serialize(buffer, true) serializeString(chargeId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.refundStarsCharge", parameters: [("userId", String(describing: userId)), ("chargeId", String(describing: chargeId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11082,7 +11031,7 @@ public extension Api.functions.payments { for item in order { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "payments.reorderStarGiftCollections", parameters: [("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11098,7 +11047,7 @@ public extension Api.functions.payments { buffer.appendInt32(-372344804) serializeInt32(flags, buffer: buffer, boxed: false) serializeInt32(offerMsgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "payments.resolveStarGiftOffer", parameters: [("flags", String(describing: flags)), ("offerMsgId", String(describing: offerMsgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11114,7 +11063,7 @@ public extension Api.functions.payments { buffer.appendInt32(707422588) serializeInt32(flags, buffer: buffer, boxed: false) stargift.serialize(buffer, true) - return (FunctionDescription(name: "payments.saveStarGift", parameters: [("flags", String(describing: flags)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11141,7 +11090,7 @@ public extension Api.functions.payments { if Int(flags) & Int(1 << 2) != 0 { serializeInt64(tipAmount!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "payments.sendPaymentForm", parameters: [("flags", String(describing: flags)), ("formId", String(describing: formId)), ("invoice", String(describing: invoice)), ("requestedInfoId", String(describing: requestedInfoId)), ("shippingOptionId", String(describing: shippingOptionId)), ("credentials", String(describing: credentials)), ("tipAmount", String(describing: tipAmount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentResult? in + 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() { @@ -11164,7 +11113,7 @@ public extension Api.functions.payments { if Int(flags) & Int(1 << 0) != 0 { serializeInt64(allowPaidStars!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "payments.sendStarGiftOffer", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("slug", String(describing: slug)), ("price", String(describing: price)), ("duration", String(describing: duration)), ("randomId", String(describing: randomId)), ("allowPaidStars", String(describing: allowPaidStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11180,7 +11129,7 @@ public extension Api.functions.payments { buffer.appendInt32(2040056084) serializeInt64(formId, buffer: buffer, boxed: false) invoice.serialize(buffer, true) - return (FunctionDescription(name: "payments.sendStarsForm", parameters: [("formId", String(describing: formId)), ("invoice", String(describing: invoice))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.PaymentResult? in + 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() { @@ -11196,7 +11145,7 @@ public extension Api.functions.payments { buffer.appendInt32(1626009505) serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) - return (FunctionDescription(name: "payments.toggleChatStarGiftNotifications", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11216,7 +11165,7 @@ public extension Api.functions.payments { for item in stargift { item.serialize(buffer, true) } - return (FunctionDescription(name: "payments.toggleStarGiftsPinnedToTop", parameters: [("peer", String(describing: peer)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11232,7 +11181,7 @@ public extension Api.functions.payments { buffer.appendInt32(2132285290) stargift.serialize(buffer, true) toId.serialize(buffer, true) - return (FunctionDescription(name: "payments.transferStarGift", parameters: [("stargift", String(describing: stargift)), ("toId", String(describing: toId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11273,7 +11222,7 @@ public extension Api.functions.payments { item.serialize(buffer, true) } } - return (FunctionDescription(name: "payments.updateStarGiftCollection", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("collectionId", String(describing: collectionId)), ("title", String(describing: title)), ("deleteStargift", String(describing: deleteStargift)), ("addStargift", String(describing: addStargift)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StarGiftCollection? in + 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() { @@ -11289,7 +11238,7 @@ public extension Api.functions.payments { buffer.appendInt32(-306287413) stargift.serialize(buffer, true) resellAmount.serialize(buffer, true) - return (FunctionDescription(name: "payments.updateStarGiftPrice", parameters: [("stargift", String(describing: stargift)), ("resellAmount", String(describing: resellAmount))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11305,7 +11254,7 @@ public extension Api.functions.payments { buffer.appendInt32(-1361648395) serializeInt32(flags, buffer: buffer, boxed: false) stargift.serialize(buffer, true) - return (FunctionDescription(name: "payments.upgradeStarGift", parameters: [("flags", String(describing: flags)), ("stargift", String(describing: stargift))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11322,7 +11271,7 @@ public extension Api.functions.payments { serializeInt32(flags, buffer: buffer, boxed: false) invoice.serialize(buffer, true) info.serialize(buffer, true) - return (FunctionDescription(name: "payments.validateRequestedInfo", parameters: [("flags", String(describing: flags)), ("invoice", String(describing: invoice)), ("info", String(describing: info))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.payments.ValidatedRequestedInfo? in + 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() { @@ -11339,7 +11288,7 @@ public extension Api.functions.phone { peer.serialize(buffer, true) serializeBytes(gB, buffer: buffer, boxed: false) `protocol`.serialize(buffer, true) - return (FunctionDescription(name: "phone.acceptCall", parameters: [("peer", String(describing: peer)), ("gB", String(describing: gB)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in + 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() { @@ -11359,7 +11308,7 @@ public extension Api.functions.phone { for item in sources { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "phone.checkGroupCall", parameters: [("call", String(describing: call)), ("sources", String(describing: sources))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + 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() { @@ -11377,7 +11326,7 @@ public extension Api.functions.phone { serializeBytes(gA, buffer: buffer, boxed: false) serializeInt64(keyFingerprint, buffer: buffer, boxed: false) `protocol`.serialize(buffer, true) - return (FunctionDescription(name: "phone.confirmCall", parameters: [("peer", String(describing: peer)), ("gA", String(describing: gA)), ("keyFingerprint", String(describing: keyFingerprint)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in + 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() { @@ -11402,7 +11351,7 @@ public extension Api.functions.phone { if Int(flags) & Int(1 << 3) != 0 { params!.serialize(buffer, true) } - return (FunctionDescription(name: "phone.createConferenceCall", parameters: [("flags", String(describing: flags)), ("randomId", String(describing: randomId)), ("publicKey", String(describing: publicKey)), ("block", String(describing: block)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11425,7 +11374,7 @@ public extension Api.functions.phone { if Int(flags) & Int(1 << 1) != 0 { serializeInt32(scheduleDate!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "phone.createGroupCall", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("randomId", String(describing: randomId)), ("title", String(describing: title)), ("scheduleDate", String(describing: scheduleDate))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11440,7 +11389,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(1011325297) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.declineConferenceCallInvite", parameters: [("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11462,7 +11411,7 @@ public extension Api.functions.phone { serializeInt64(item, buffer: buffer, boxed: false) } serializeBytes(block, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.deleteConferenceCallParticipants", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("ids", String(describing: ids)), ("block", String(describing: block))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11483,7 +11432,7 @@ public extension Api.functions.phone { for item in messages { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "phone.deleteGroupCallMessages", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("messages", String(describing: messages))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11500,7 +11449,7 @@ public extension Api.functions.phone { serializeInt32(flags, buffer: buffer, boxed: false) call.serialize(buffer, true) participant.serialize(buffer, true) - return (FunctionDescription(name: "phone.deleteGroupCallParticipantMessages", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("participant", String(describing: participant))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11519,7 +11468,7 @@ public extension Api.functions.phone { serializeInt32(duration, buffer: buffer, boxed: false) reason.serialize(buffer, true) serializeInt64(connectionId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.discardCall", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("duration", String(describing: duration)), ("reason", String(describing: reason)), ("connectionId", String(describing: connectionId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11534,7 +11483,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(2054648117) call.serialize(buffer, true) - return (FunctionDescription(name: "phone.discardGroupCall", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11569,7 +11518,7 @@ public extension Api.functions.phone { if Int(flags) & Int(1 << 5) != 0 { presentationPaused!.serialize(buffer, true) } - return (FunctionDescription(name: "phone.editGroupCallParticipant", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("participant", String(describing: participant)), ("muted", String(describing: muted)), ("volume", String(describing: volume)), ("raiseHand", String(describing: raiseHand)), ("videoStopped", String(describing: videoStopped)), ("videoPaused", String(describing: videoPaused)), ("presentationPaused", String(describing: presentationPaused))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11585,7 +11534,7 @@ public extension Api.functions.phone { buffer.appendInt32(480685066) call.serialize(buffer, true) serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.editGroupCallTitle", parameters: [("call", String(describing: call)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11601,7 +11550,7 @@ public extension Api.functions.phone { buffer.appendInt32(-425040769) serializeInt32(flags, buffer: buffer, boxed: false) call.serialize(buffer, true) - return (FunctionDescription(name: "phone.exportGroupCallInvite", parameters: [("flags", String(describing: flags)), ("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.ExportedGroupCallInvite? in + 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() { @@ -11631,7 +11580,7 @@ public extension Api.functions.phone { buffer.appendInt32(68699611) call.serialize(buffer, true) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.getGroupCall", parameters: [("call", String(describing: call)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCall? in + 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() { @@ -11649,7 +11598,7 @@ public extension Api.functions.phone { serializeInt32(subChainId, buffer: buffer, boxed: false) serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.getGroupCallChainBlocks", parameters: [("call", String(describing: call)), ("subChainId", String(describing: subChainId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11664,7 +11613,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(-277077702) peer.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallJoinAs", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.JoinAsPeers? in + 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() { @@ -11679,7 +11628,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(1868784386) call.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallStars", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStars? in + 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() { @@ -11694,7 +11643,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(447879488) call.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallStreamChannels", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStreamChannels? in + 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() { @@ -11711,7 +11660,7 @@ public extension Api.functions.phone { serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) revoke.serialize(buffer, true) - return (FunctionDescription(name: "phone.getGroupCallStreamRtmpUrl", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("revoke", String(describing: revoke))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupCallStreamRtmpUrl? in + 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() { @@ -11738,7 +11687,7 @@ public extension Api.functions.phone { } serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.getGroupParticipants", parameters: [("call", String(describing: call)), ("ids", String(describing: ids)), ("sources", String(describing: sources)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.GroupParticipants? in + 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() { @@ -11755,7 +11704,7 @@ public extension Api.functions.phone { serializeInt32(flags, buffer: buffer, boxed: false) call.serialize(buffer, true) userId.serialize(buffer, true) - return (FunctionDescription(name: "phone.inviteConferenceCallParticipant", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11775,7 +11724,7 @@ public extension Api.functions.phone { for item in users { item.serialize(buffer, true) } - return (FunctionDescription(name: "phone.inviteToGroupCall", parameters: [("call", String(describing: call)), ("users", String(describing: users))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11802,7 +11751,7 @@ public extension Api.functions.phone { serializeBytes(block!, buffer: buffer, boxed: false) } params.serialize(buffer, true) - return (FunctionDescription(name: "phone.joinGroupCall", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("joinAs", String(describing: joinAs)), ("inviteHash", String(describing: inviteHash)), ("publicKey", String(describing: publicKey)), ("block", String(describing: block)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11818,7 +11767,7 @@ public extension Api.functions.phone { buffer.appendInt32(-873829436) call.serialize(buffer, true) params.serialize(buffer, true) - return (FunctionDescription(name: "phone.joinGroupCallPresentation", parameters: [("call", String(describing: call)), ("params", String(describing: params))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11834,7 +11783,7 @@ public extension Api.functions.phone { buffer.appendInt32(1342404601) call.serialize(buffer, true) serializeInt32(source, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.leaveGroupCall", parameters: [("call", String(describing: call)), ("source", String(describing: source))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11849,7 +11798,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(475058500) call.serialize(buffer, true) - return (FunctionDescription(name: "phone.leaveGroupCallPresentation", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11864,7 +11813,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(399855457) peer.serialize(buffer, true) - return (FunctionDescription(name: "phone.receivedCall", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11883,7 +11832,7 @@ public extension Api.functions.phone { serializeInt32(randomId, buffer: buffer, boxed: false) serializeBytes(gAHash, buffer: buffer, boxed: false) `protocol`.serialize(buffer, true) - return (FunctionDescription(name: "phone.requestCall", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("randomId", String(describing: randomId)), ("gAHash", String(describing: gAHash)), ("`protocol`", String(describing: `protocol`))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.phone.PhoneCall? in + 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() { @@ -11899,7 +11848,7 @@ public extension Api.functions.phone { buffer.appendInt32(662363518) peer.serialize(buffer, true) debug.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveCallDebug", parameters: [("peer", String(describing: peer)), ("debug", String(describing: debug))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11915,7 +11864,7 @@ public extension Api.functions.phone { buffer.appendInt32(1092913030) peer.serialize(buffer, true) file.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveCallLog", parameters: [("peer", String(describing: peer)), ("file", String(describing: file))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11931,7 +11880,7 @@ public extension Api.functions.phone { buffer.appendInt32(1465786252) peer.serialize(buffer, true) joinAs.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveDefaultGroupCallJoinAs", parameters: [("peer", String(describing: peer)), ("joinAs", String(describing: joinAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11947,7 +11896,7 @@ public extension Api.functions.phone { buffer.appendInt32(1097313745) call.serialize(buffer, true) sendAs.serialize(buffer, true) - return (FunctionDescription(name: "phone.saveDefaultSendAs", parameters: [("call", String(describing: call)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -11963,7 +11912,7 @@ public extension Api.functions.phone { buffer.appendInt32(-965732096) call.serialize(buffer, true) serializeBytes(block, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.sendConferenceCallBroadcast", parameters: [("call", String(describing: call)), ("block", String(describing: block))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -11979,7 +11928,7 @@ public extension Api.functions.phone { buffer.appendInt32(-441473683) call.serialize(buffer, true) serializeBytes(encryptedMessage, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.sendGroupCallEncryptedMessage", parameters: [("call", String(describing: call)), ("encryptedMessage", String(describing: encryptedMessage))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -12003,7 +11952,7 @@ public extension Api.functions.phone { if Int(flags) & Int(1 << 1) != 0 { sendAs!.serialize(buffer, true) } - return (FunctionDescription(name: "phone.sendGroupCallMessage", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("randomId", String(describing: randomId)), ("message", String(describing: message)), ("allowPaidStars", String(describing: allowPaidStars)), ("sendAs", String(describing: sendAs))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -12019,7 +11968,7 @@ public extension Api.functions.phone { buffer.appendInt32(-8744061) peer.serialize(buffer, true) serializeBytes(data, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.sendSignalingData", parameters: [("peer", String(describing: peer)), ("data", String(describing: data))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -12037,7 +11986,7 @@ public extension Api.functions.phone { peer.serialize(buffer, true) serializeInt32(rating, buffer: buffer, boxed: false) serializeString(comment, buffer: buffer, boxed: false) - return (FunctionDescription(name: "phone.setCallRating", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("rating", String(describing: rating)), ("comment", String(describing: comment))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -12052,7 +12001,7 @@ public extension Api.functions.phone { let buffer = Buffer() buffer.appendInt32(1451287362) call.serialize(buffer, true) - return (FunctionDescription(name: "phone.startScheduledGroupCall", parameters: [("call", String(describing: call))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -12074,7 +12023,7 @@ public extension Api.functions.phone { if Int(flags) & Int(1 << 2) != 0 { videoPortrait!.serialize(buffer, true) } - return (FunctionDescription(name: "phone.toggleGroupCallRecord", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("title", String(describing: title)), ("videoPortrait", String(describing: videoPortrait))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -12099,7 +12048,7 @@ public extension Api.functions.phone { if Int(flags) & Int(1 << 3) != 0 { serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "phone.toggleGroupCallSettings", parameters: [("flags", String(describing: flags)), ("call", String(describing: call)), ("joinMuted", String(describing: joinMuted)), ("messagesEnabled", String(describing: messagesEnabled)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -12115,7 +12064,7 @@ public extension Api.functions.phone { buffer.appendInt32(563885286) call.serialize(buffer, true) subscribed.serialize(buffer, true) - return (FunctionDescription(name: "phone.toggleGroupCallStartSubscription", parameters: [("call", String(describing: call)), ("subscribed", String(describing: subscribed))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -12134,7 +12083,7 @@ public extension Api.functions.photos { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "photos.deletePhotos", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int64]? in + 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() { @@ -12152,7 +12101,7 @@ public extension Api.functions.photos { serializeInt32(offset, buffer: buffer, boxed: false) serializeInt64(maxId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "photos.getUserPhotos", parameters: [("userId", String(describing: userId)), ("offset", String(describing: offset)), ("maxId", String(describing: maxId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photos? in + 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() { @@ -12171,7 +12120,7 @@ public extension Api.functions.photos { bot!.serialize(buffer, true) } id.serialize(buffer, true) - return (FunctionDescription(name: "photos.updateProfilePhoto", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in + 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() { @@ -12199,7 +12148,7 @@ public extension Api.functions.photos { if Int(flags) & Int(1 << 5) != 0 { videoEmojiMarkup!.serialize(buffer, true) } - return (FunctionDescription(name: "photos.uploadContactProfilePhoto", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("file", String(describing: file)), ("video", String(describing: video)), ("videoStartTs", String(describing: videoStartTs)), ("videoEmojiMarkup", String(describing: videoEmojiMarkup))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in + 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() { @@ -12229,7 +12178,7 @@ public extension Api.functions.photos { if Int(flags) & Int(1 << 4) != 0 { videoEmojiMarkup!.serialize(buffer, true) } - return (FunctionDescription(name: "photos.uploadProfilePhoto", parameters: [("flags", String(describing: flags)), ("bot", String(describing: bot)), ("file", String(describing: file)), ("video", String(describing: video)), ("videoStartTs", String(describing: videoStartTs)), ("videoEmojiMarkup", String(describing: videoEmojiMarkup))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.photos.Photo? in + 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() { @@ -12252,7 +12201,7 @@ public extension Api.functions.premium { } } peer.serialize(buffer, true) - return (FunctionDescription(name: "premium.applyBoost", parameters: [("flags", String(describing: flags)), ("slots", String(describing: slots)), ("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.MyBoosts? in + 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() { @@ -12270,7 +12219,7 @@ public extension Api.functions.premium { peer.serialize(buffer, true) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "premium.getBoostsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsList? in + 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() { @@ -12285,7 +12234,7 @@ public extension Api.functions.premium { let buffer = Buffer() buffer.appendInt32(70197089) peer.serialize(buffer, true) - return (FunctionDescription(name: "premium.getBoostsStatus", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsStatus? in + 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() { @@ -12315,7 +12264,7 @@ public extension Api.functions.premium { buffer.appendInt32(965037343) peer.serialize(buffer, true) userId.serialize(buffer, true) - return (FunctionDescription(name: "premium.getUserBoosts", parameters: [("peer", String(describing: peer)), ("userId", String(describing: userId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.premium.BoostsList? in + 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() { @@ -12334,7 +12283,7 @@ public extension Api.functions.smsjobs { if Int(flags) & Int(1 << 0) != 0 { serializeString(error!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "smsjobs.finishJob", parameters: [("flags", String(describing: flags)), ("jobId", String(describing: jobId)), ("error", String(describing: error))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -12349,7 +12298,7 @@ public extension Api.functions.smsjobs { let buffer = Buffer() buffer.appendInt32(2005766191) serializeString(jobId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "smsjobs.getSmsJob", parameters: [("jobId", String(describing: jobId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.SmsJob? in + 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() { @@ -12420,7 +12369,7 @@ public extension Api.functions.smsjobs { let buffer = Buffer() buffer.appendInt32(155164863) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "smsjobs.updateSettings", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -12436,7 +12385,7 @@ public extension Api.functions.stats { buffer.appendInt32(-1421720550) serializeInt32(flags, buffer: buffer, boxed: false) channel.serialize(buffer, true) - return (FunctionDescription(name: "stats.getBroadcastStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.BroadcastStats? in + 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() { @@ -12452,7 +12401,7 @@ public extension Api.functions.stats { buffer.appendInt32(-589330937) serializeInt32(flags, buffer: buffer, boxed: false) channel.serialize(buffer, true) - return (FunctionDescription(name: "stats.getMegagroupStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.MegagroupStats? in + 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() { @@ -12470,7 +12419,7 @@ public extension Api.functions.stats { serializeInt32(msgId, buffer: buffer, boxed: false) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getMessagePublicForwards", parameters: [("channel", String(describing: channel)), ("msgId", String(describing: msgId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PublicForwards? in + 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() { @@ -12487,7 +12436,7 @@ public extension Api.functions.stats { serializeInt32(flags, buffer: buffer, boxed: false) channel.serialize(buffer, true) serializeInt32(msgId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getMessageStats", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("msgId", String(describing: msgId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.MessageStats? in + 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() { @@ -12505,7 +12454,7 @@ public extension Api.functions.stats { serializeInt32(id, buffer: buffer, boxed: false) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getStoryPublicForwards", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.PublicForwards? in + 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() { @@ -12522,7 +12471,7 @@ public extension Api.functions.stats { serializeInt32(flags, buffer: buffer, boxed: false) peer.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stats.getStoryStats", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stats.StoryStats? in + 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() { @@ -12541,7 +12490,7 @@ public extension Api.functions.stats { if Int(flags) & Int(1 << 0) != 0 { serializeInt64(x!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stats.loadAsyncGraph", parameters: [("flags", String(describing: flags)), ("token", String(describing: token)), ("x", String(describing: x))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StatsGraph? in + 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() { @@ -12557,7 +12506,7 @@ public extension Api.functions.stickers { buffer.appendInt32(-2041315650) stickerset.serialize(buffer, true) sticker.serialize(buffer, true) - return (FunctionDescription(name: "stickers.addStickerToSet", parameters: [("stickerset", String(describing: stickerset)), ("sticker", String(describing: sticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12582,7 +12531,7 @@ public extension Api.functions.stickers { if Int(flags) & Int(1 << 2) != 0 { serializeString(keywords!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stickers.changeSticker", parameters: [("flags", String(describing: flags)), ("sticker", String(describing: sticker)), ("emoji", String(describing: emoji)), ("maskCoords", String(describing: maskCoords)), ("keywords", String(describing: keywords))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12598,7 +12547,7 @@ public extension Api.functions.stickers { buffer.appendInt32(-4795190) sticker.serialize(buffer, true) serializeInt32(position, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.changeStickerPosition", parameters: [("sticker", String(describing: sticker)), ("position", String(describing: position))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12613,7 +12562,7 @@ public extension Api.functions.stickers { let buffer = Buffer() buffer.appendInt32(676017721) serializeString(shortName, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.checkShortName", parameters: [("shortName", String(describing: shortName))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -12642,7 +12591,7 @@ public extension Api.functions.stickers { if Int(flags) & Int(1 << 3) != 0 { serializeString(software!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stickers.createStickerSet", parameters: [("flags", String(describing: flags)), ("userId", String(describing: userId)), ("title", String(describing: title)), ("shortName", String(describing: shortName)), ("thumb", String(describing: thumb)), ("stickers", String(describing: stickers)), ("software", String(describing: software))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12657,7 +12606,7 @@ public extension Api.functions.stickers { let buffer = Buffer() buffer.appendInt32(-2022685804) stickerset.serialize(buffer, true) - return (FunctionDescription(name: "stickers.deleteStickerSet", parameters: [("stickerset", String(describing: stickerset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -12672,7 +12621,7 @@ public extension Api.functions.stickers { let buffer = Buffer() buffer.appendInt32(-143257775) sticker.serialize(buffer, true) - return (FunctionDescription(name: "stickers.removeStickerFromSet", parameters: [("sticker", String(describing: sticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12688,7 +12637,7 @@ public extension Api.functions.stickers { buffer.appendInt32(306912256) stickerset.serialize(buffer, true) serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.renameStickerSet", parameters: [("stickerset", String(describing: stickerset)), ("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12704,7 +12653,7 @@ public extension Api.functions.stickers { buffer.appendInt32(1184253338) sticker.serialize(buffer, true) newSticker.serialize(buffer, true) - return (FunctionDescription(name: "stickers.replaceSticker", parameters: [("sticker", String(describing: sticker)), ("newSticker", String(describing: newSticker))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12726,7 +12675,7 @@ public extension Api.functions.stickers { if Int(flags) & Int(1 << 1) != 0 { serializeInt64(thumbDocumentId!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stickers.setStickerSetThumb", parameters: [("flags", String(describing: flags)), ("stickerset", String(describing: stickerset)), ("thumb", String(describing: thumb)), ("thumbDocumentId", String(describing: thumbDocumentId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.messages.StickerSet? in + 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() { @@ -12741,7 +12690,7 @@ public extension Api.functions.stickers { let buffer = Buffer() buffer.appendInt32(1303364867) serializeString(title, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stickers.suggestShortName", parameters: [("title", String(describing: title))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stickers.SuggestedShortName? in + 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() { @@ -12756,7 +12705,7 @@ public extension Api.functions.stories { let buffer = Buffer() buffer.appendInt32(1471926630) serializeInt32(flags, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.activateStealthMode", parameters: [("flags", String(describing: flags))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -12771,7 +12720,7 @@ public extension Api.functions.stories { let buffer = Buffer() buffer.appendInt32(820732912) peer.serialize(buffer, true) - return (FunctionDescription(name: "stories.canSendStory", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.CanSendStoryCount? in + 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() { @@ -12792,7 +12741,7 @@ public extension Api.functions.stories { for item in stories { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.createAlbum", parameters: [("peer", String(describing: peer)), ("title", String(describing: title)), ("stories", String(describing: stories))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StoryAlbum? in + 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() { @@ -12808,7 +12757,7 @@ public extension Api.functions.stories { buffer.appendInt32(-1925949744) peer.serialize(buffer, true) serializeInt32(albumId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.deleteAlbum", parameters: [("peer", String(describing: peer)), ("albumId", String(describing: albumId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -12828,7 +12777,7 @@ public extension Api.functions.stories { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.deleteStories", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + 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() { @@ -12872,7 +12821,7 @@ public extension Api.functions.stories { item.serialize(buffer, true) } } - return (FunctionDescription(name: "stories.editStory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in let reader = BufferReader(buffer) var result: Api.Updates? if let signature = reader.readInt32() { @@ -12888,7 +12837,7 @@ public extension Api.functions.stories { buffer.appendInt32(2072899360) peer.serialize(buffer, true) serializeInt32(id, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.exportStoryLink", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ExportedStoryLink? in + 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() { @@ -12906,7 +12855,7 @@ public extension Api.functions.stories { serializeInt32(albumId, buffer: buffer, boxed: false) serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getAlbumStories", parameters: [("peer", String(describing: peer)), ("albumId", String(describing: albumId)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + 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() { @@ -12922,7 +12871,7 @@ public extension Api.functions.stories { buffer.appendInt32(632548039) peer.serialize(buffer, true) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getAlbums", parameters: [("peer", String(describing: peer)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Albums? in + 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() { @@ -12954,7 +12903,7 @@ public extension Api.functions.stories { if Int(flags) & Int(1 << 0) != 0 { serializeString(state!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.getAllStories", parameters: [("flags", String(describing: flags)), ("state", String(describing: state))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.AllStories? in + 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() { @@ -12987,7 +12936,7 @@ public extension Api.functions.stories { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "stories.getPeerMaxIDs", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.RecentStory]? in + 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() { @@ -13002,7 +12951,7 @@ public extension Api.functions.stories { let buffer = Buffer() buffer.appendInt32(743103056) peer.serialize(buffer, true) - return (FunctionDescription(name: "stories.getPeerStories", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.PeerStories? in + 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() { @@ -13019,7 +12968,7 @@ public extension Api.functions.stories { peer.serialize(buffer, true) serializeInt32(offsetId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getPinnedStories", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + 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() { @@ -13036,7 +12985,7 @@ public extension Api.functions.stories { peer.serialize(buffer, true) serializeInt32(offsetId, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getStoriesArchive", parameters: [("peer", String(describing: peer)), ("offsetId", String(describing: offsetId)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + 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() { @@ -13056,7 +13005,7 @@ public extension Api.functions.stories { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.getStoriesByID", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.Stories? in + 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() { @@ -13076,7 +13025,7 @@ public extension Api.functions.stories { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.getStoriesViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryViews? in + 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() { @@ -13100,7 +13049,7 @@ public extension Api.functions.stories { serializeString(offset!, buffer: buffer, boxed: false) } serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getStoryReactionsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("id", String(describing: id)), ("reaction", String(describing: reaction)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryReactionsList? in + 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() { @@ -13122,7 +13071,7 @@ public extension Api.functions.stories { serializeInt32(id, buffer: buffer, boxed: false) serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.getStoryViewsList", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("q", String(describing: q)), ("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.StoryViewsList? in + 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() { @@ -13142,7 +13091,7 @@ public extension Api.functions.stories { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.incrementStoryViews", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13158,7 +13107,7 @@ public extension Api.functions.stories { buffer.appendInt32(-1521034552) peer.serialize(buffer, true) serializeInt32(maxId, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.readStories", parameters: [("peer", String(describing: peer)), ("maxId", String(describing: maxId))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + 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() { @@ -13178,7 +13127,7 @@ public extension Api.functions.stories { for item in order { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.reorderAlbums", parameters: [("peer", String(describing: peer)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13200,7 +13149,7 @@ public extension Api.functions.stories { } serializeBytes(option, buffer: buffer, boxed: false) serializeString(message, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.report", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("option", String(describing: option)), ("message", String(describing: message))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.ReportResult? in + 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() { @@ -13226,7 +13175,7 @@ public extension Api.functions.stories { } serializeString(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "stories.searchPosts", parameters: [("flags", String(describing: flags)), ("hashtag", String(describing: hashtag)), ("area", String(describing: area)), ("peer", String(describing: peer)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.FoundStories? in + 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() { @@ -13244,7 +13193,7 @@ public extension Api.functions.stories { peer.serialize(buffer, true) serializeInt32(storyId, buffer: buffer, boxed: false) reaction.serialize(buffer, true) - return (FunctionDescription(name: "stories.sendReaction", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("storyId", String(describing: storyId)), ("reaction", String(describing: reaction))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -13300,7 +13249,7 @@ public extension Api.functions.stories { serializeInt32(item, buffer: buffer, boxed: false) } } - return (FunctionDescription(name: "stories.sendStory", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("media", String(describing: media)), ("mediaAreas", String(describing: mediaAreas)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("period", String(describing: period)), ("fwdFromId", String(describing: fwdFromId)), ("fwdFromStory", String(describing: fwdFromStory)), ("albums", String(describing: albums))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in let reader = BufferReader(buffer) var result: Api.Updates? if let signature = reader.readInt32() { @@ -13338,7 +13287,7 @@ public extension Api.functions.stories { if Int(flags) & Int(1 << 7) != 0 { serializeInt64(sendPaidMessagesStars!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.startLive", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("caption", String(describing: caption)), ("entities", String(describing: entities)), ("privacyRules", String(describing: privacyRules)), ("randomId", String(describing: randomId)), ("messagesEnabled", String(describing: messagesEnabled)), ("sendPaidMessagesStars", String(describing: sendPaidMessagesStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { @@ -13353,7 +13302,7 @@ public extension Api.functions.stories { let buffer = Buffer() buffer.appendInt32(2082822084) hidden.serialize(buffer, true) - return (FunctionDescription(name: "stories.toggleAllStoriesHidden", parameters: [("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13369,7 +13318,7 @@ public extension Api.functions.stories { buffer.appendInt32(-1123805756) peer.serialize(buffer, true) hidden.serialize(buffer, true) - return (FunctionDescription(name: "stories.togglePeerStoriesHidden", parameters: [("peer", String(describing: peer)), ("hidden", String(describing: hidden))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13390,7 +13339,7 @@ public extension Api.functions.stories { serializeInt32(item, buffer: buffer, boxed: false) } pinned.serialize(buffer, true) - return (FunctionDescription(name: "stories.togglePinned", parameters: [("peer", String(describing: peer)), ("id", String(describing: id)), ("pinned", String(describing: pinned))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Int32]? in + 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() { @@ -13410,7 +13359,7 @@ public extension Api.functions.stories { for item in id { serializeInt32(item, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "stories.togglePinnedToTop", parameters: [("peer", String(describing: peer)), ("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13451,7 +13400,7 @@ public extension Api.functions.stories { serializeInt32(item, buffer: buffer, boxed: false) } } - return (FunctionDescription(name: "stories.updateAlbum", parameters: [("flags", String(describing: flags)), ("peer", String(describing: peer)), ("albumId", String(describing: albumId)), ("title", String(describing: title)), ("deleteStories", String(describing: deleteStories)), ("addStories", String(describing: addStories)), ("order", String(describing: order))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.StoryAlbum? in + 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() { @@ -13470,7 +13419,7 @@ public extension Api.functions.updates { filter.serialize(buffer, true) serializeInt32(pts, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "updates.getChannelDifference", parameters: [("flags", String(describing: flags)), ("channel", String(describing: channel)), ("filter", String(describing: filter)), ("pts", String(describing: pts)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.ChannelDifference? in + 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() { @@ -13497,7 +13446,7 @@ public extension Api.functions.updates { if Int(flags) & Int(1 << 2) != 0 { serializeInt32(qtsLimit!, buffer: buffer, boxed: false) } - return (FunctionDescription(name: "updates.getDifference", parameters: [("flags", String(describing: flags)), ("pts", String(describing: pts)), ("ptsLimit", String(describing: ptsLimit)), ("ptsTotalLimit", String(describing: ptsTotalLimit)), ("date", String(describing: date)), ("qts", String(describing: qts)), ("qtsLimit", String(describing: qtsLimit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.updates.Difference? in + 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() { @@ -13528,7 +13477,7 @@ public extension Api.functions.upload { serializeBytes(fileToken, buffer: buffer, boxed: false) serializeInt64(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getCdnFile", parameters: [("fileToken", String(describing: fileToken)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.CdnFile? in + 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() { @@ -13544,7 +13493,7 @@ public extension Api.functions.upload { buffer.appendInt32(-1847836879) serializeBytes(fileToken, buffer: buffer, boxed: false) serializeInt64(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getCdnFileHashes", parameters: [("fileToken", String(describing: fileToken)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in + 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() { @@ -13562,7 +13511,7 @@ public extension Api.functions.upload { location.serialize(buffer, true) serializeInt64(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getFile", parameters: [("flags", String(describing: flags)), ("location", String(describing: location)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.File? in + 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() { @@ -13578,7 +13527,7 @@ public extension Api.functions.upload { buffer.appendInt32(-1856595926) location.serialize(buffer, true) serializeInt64(offset, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getFileHashes", parameters: [("location", String(describing: location)), ("offset", String(describing: offset))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in + 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() { @@ -13595,7 +13544,7 @@ public extension Api.functions.upload { location.serialize(buffer, true) serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.getWebFile", parameters: [("location", String(describing: location)), ("offset", String(describing: offset)), ("limit", String(describing: limit))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.upload.WebFile? in + 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() { @@ -13611,7 +13560,7 @@ public extension Api.functions.upload { buffer.appendInt32(-1691921240) serializeBytes(fileToken, buffer: buffer, boxed: false) serializeBytes(requestToken, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.reuploadCdnFile", parameters: [("fileToken", String(describing: fileToken)), ("requestToken", String(describing: requestToken))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.FileHash]? in + 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() { @@ -13629,7 +13578,7 @@ public extension Api.functions.upload { serializeInt32(filePart, buffer: buffer, boxed: false) serializeInt32(fileTotalParts, buffer: buffer, boxed: false) serializeBytes(bytes, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.saveBigFilePart", parameters: [("fileId", String(describing: fileId)), ("filePart", String(describing: filePart)), ("fileTotalParts", String(describing: fileTotalParts)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13646,7 +13595,7 @@ public extension Api.functions.upload { serializeInt64(fileId, buffer: buffer, boxed: false) serializeInt32(filePart, buffer: buffer, boxed: false) serializeBytes(bytes, buffer: buffer, boxed: false) - return (FunctionDescription(name: "upload.saveFilePart", parameters: [("fileId", String(describing: fileId)), ("filePart", String(describing: filePart)), ("bytes", String(describing: bytes))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13661,7 +13610,7 @@ public extension Api.functions.users { let buffer = Buffer() buffer.appendInt32(-1240508136) id.serialize(buffer, true) - return (FunctionDescription(name: "users.getFullUser", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.UserFull? in + 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() { @@ -13680,7 +13629,7 @@ public extension Api.functions.users { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "users.getRequirementsToContact", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.RequirementToContact]? in + 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() { @@ -13698,7 +13647,7 @@ public extension Api.functions.users { serializeInt32(offset, buffer: buffer, boxed: false) serializeInt32(limit, buffer: buffer, boxed: false) serializeInt64(hash, buffer: buffer, boxed: false) - return (FunctionDescription(name: "users.getSavedMusic", parameters: [("id", String(describing: id)), ("offset", String(describing: offset)), ("limit", String(describing: limit)), ("hash", String(describing: hash))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.SavedMusic? in + 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() { @@ -13718,7 +13667,7 @@ public extension Api.functions.users { for item in documents { item.serialize(buffer, true) } - return (FunctionDescription(name: "users.getSavedMusicByID", parameters: [("id", String(describing: id)), ("documents", String(describing: documents))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.users.SavedMusic? in + 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() { @@ -13737,7 +13686,7 @@ public extension Api.functions.users { for item in id { item.serialize(buffer, true) } - return (FunctionDescription(name: "users.getUsers", parameters: [("id", String(describing: id))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> [Api.User]? in + 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() { @@ -13757,7 +13706,7 @@ public extension Api.functions.users { for item in errors { item.serialize(buffer, true) } - return (FunctionDescription(name: "users.setSecureValueErrors", parameters: [("id", String(describing: id)), ("errors", String(describing: errors))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in + 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() { @@ -13773,7 +13722,7 @@ public extension Api.functions.users { buffer.appendInt32(-61656206) id.serialize(buffer, true) birthday.serialize(buffer, true) - return (FunctionDescription(name: "users.suggestBirthday", parameters: [("id", String(describing: id)), ("birthday", String(describing: birthday))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in + 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() { diff --git a/submodules/TelegramApi/Sources/Api5.swift b/submodules/TelegramApi/Sources/Api5.swift index 99d09c7a9b..d5bc6b26a1 100644 --- a/submodules/TelegramApi/Sources/Api5.swift +++ b/submodules/TelegramApi/Sources/Api5.swift @@ -13,8 +13,8 @@ public extension Api { self.about = about self.approvedBy = approvedBy } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatInviteImporter", [("flags", self.flags as Any), ("userId", self.userId as Any), ("date", self.date as Any), ("about", self.about as Any), ("approvedBy", self.approvedBy as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInviteImporter", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("date", ConstructorParameterDescription(self.date)), ("about", ConstructorParameterDescription(self.about)), ("approvedBy", ConstructorParameterDescription(self.approvedBy))]) } } case chatInviteImporter(Cons_chatInviteImporter) @@ -38,10 +38,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatInviteImporter(let _data): - return ("chatInviteImporter", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("date", _data.date as Any), ("about", _data.about as Any), ("approvedBy", _data.approvedBy as Any)]) + return ("chatInviteImporter", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("date", ConstructorParameterDescription(_data.date)), ("about", ConstructorParameterDescription(_data.about)), ("approvedBy", ConstructorParameterDescription(_data.approvedBy))]) } } @@ -81,8 +81,8 @@ public extension Api { public init(onlines: Int32) { self.onlines = onlines } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatOnlines", [("onlines", self.onlines as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatOnlines", [("onlines", ConstructorParameterDescription(self.onlines))]) } } case chatOnlines(Cons_chatOnlines) @@ -98,10 +98,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatOnlines(let _data): - return ("chatOnlines", [("onlines", _data.onlines as Any)]) + return ("chatOnlines", [("onlines", ConstructorParameterDescription(_data.onlines))]) } } @@ -133,8 +133,8 @@ public extension Api { self.date = date self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatParticipant", [("flags", self.flags as Any), ("userId", self.userId as Any), ("inviterId", self.inviterId as Any), ("date", self.date as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatParticipant", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("inviterId", ConstructorParameterDescription(self.inviterId)), ("date", ConstructorParameterDescription(self.date)), ("rank", ConstructorParameterDescription(self.rank))]) } } public class Cons_chatParticipantAdmin: TypeConstructorDescription { @@ -150,8 +150,8 @@ public extension Api { self.date = date self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatParticipantAdmin", [("flags", self.flags as Any), ("userId", self.userId as Any), ("inviterId", self.inviterId as Any), ("date", self.date as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatParticipantAdmin", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("inviterId", ConstructorParameterDescription(self.inviterId)), ("date", ConstructorParameterDescription(self.date)), ("rank", ConstructorParameterDescription(self.rank))]) } } public class Cons_chatParticipantCreator: TypeConstructorDescription { @@ -163,8 +163,8 @@ public extension Api { self.userId = userId self.rank = rank } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatParticipantCreator", [("flags", self.flags as Any), ("userId", self.userId as Any), ("rank", self.rank as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatParticipantCreator", [("flags", ConstructorParameterDescription(self.flags)), ("userId", ConstructorParameterDescription(self.userId)), ("rank", ConstructorParameterDescription(self.rank))]) } } case chatParticipant(Cons_chatParticipant) @@ -210,14 +210,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatParticipant(let _data): - return ("chatParticipant", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any), ("rank", _data.rank as Any)]) + return ("chatParticipant", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("inviterId", ConstructorParameterDescription(_data.inviterId)), ("date", ConstructorParameterDescription(_data.date)), ("rank", ConstructorParameterDescription(_data.rank))]) case .chatParticipantAdmin(let _data): - return ("chatParticipantAdmin", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("inviterId", _data.inviterId as Any), ("date", _data.date as Any), ("rank", _data.rank as Any)]) + return ("chatParticipantAdmin", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("inviterId", ConstructorParameterDescription(_data.inviterId)), ("date", ConstructorParameterDescription(_data.date)), ("rank", ConstructorParameterDescription(_data.rank))]) case .chatParticipantCreator(let _data): - return ("chatParticipantCreator", [("flags", _data.flags as Any), ("userId", _data.userId as Any), ("rank", _data.rank as Any)]) + return ("chatParticipantCreator", [("flags", ConstructorParameterDescription(_data.flags)), ("userId", ConstructorParameterDescription(_data.userId)), ("rank", ConstructorParameterDescription(_data.rank))]) } } @@ -303,8 +303,8 @@ public extension Api { self.participants = participants self.version = version } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatParticipants", [("chatId", self.chatId as Any), ("participants", self.participants as Any), ("version", self.version as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatParticipants", [("chatId", ConstructorParameterDescription(self.chatId)), ("participants", ConstructorParameterDescription(self.participants)), ("version", ConstructorParameterDescription(self.version))]) } } public class Cons_chatParticipantsForbidden: TypeConstructorDescription { @@ -316,8 +316,8 @@ public extension Api { self.chatId = chatId self.selfParticipant = selfParticipant } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatParticipantsForbidden", [("flags", self.flags as Any), ("chatId", self.chatId as Any), ("selfParticipant", self.selfParticipant as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatParticipantsForbidden", [("flags", ConstructorParameterDescription(self.flags)), ("chatId", ConstructorParameterDescription(self.chatId)), ("selfParticipant", ConstructorParameterDescription(self.selfParticipant))]) } } case chatParticipants(Cons_chatParticipants) @@ -350,12 +350,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatParticipants(let _data): - return ("chatParticipants", [("chatId", _data.chatId as Any), ("participants", _data.participants as Any), ("version", _data.version as Any)]) + return ("chatParticipants", [("chatId", ConstructorParameterDescription(_data.chatId)), ("participants", ConstructorParameterDescription(_data.participants)), ("version", ConstructorParameterDescription(_data.version))]) case .chatParticipantsForbidden(let _data): - return ("chatParticipantsForbidden", [("flags", _data.flags as Any), ("chatId", _data.chatId as Any), ("selfParticipant", _data.selfParticipant as Any)]) + return ("chatParticipantsForbidden", [("flags", ConstructorParameterDescription(_data.flags)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("selfParticipant", ConstructorParameterDescription(_data.selfParticipant))]) } } @@ -414,8 +414,8 @@ public extension Api { self.strippedThumb = strippedThumb self.dcId = dcId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatPhoto", [("flags", self.flags as Any), ("photoId", self.photoId as Any), ("strippedThumb", self.strippedThumb as Any), ("dcId", self.dcId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("photoId", ConstructorParameterDescription(self.photoId)), ("strippedThumb", ConstructorParameterDescription(self.strippedThumb)), ("dcId", ConstructorParameterDescription(self.dcId))]) } } case chatPhoto(Cons_chatPhoto) @@ -442,10 +442,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatPhoto(let _data): - return ("chatPhoto", [("flags", _data.flags as Any), ("photoId", _data.photoId as Any), ("strippedThumb", _data.strippedThumb as Any), ("dcId", _data.dcId as Any)]) + return ("chatPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("strippedThumb", ConstructorParameterDescription(_data.strippedThumb)), ("dcId", ConstructorParameterDescription(_data.dcId))]) case .chatPhotoEmpty: return ("chatPhotoEmpty", []) } @@ -485,8 +485,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatReactionsAll", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatReactionsAll", [("flags", ConstructorParameterDescription(self.flags))]) } } public class Cons_chatReactionsSome: TypeConstructorDescription { @@ -494,8 +494,8 @@ public extension Api { public init(reactions: [Api.Reaction]) { self.reactions = reactions } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatReactionsSome", [("reactions", self.reactions as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatReactionsSome", [("reactions", ConstructorParameterDescription(self.reactions))]) } } case chatReactionsAll(Cons_chatReactionsAll) @@ -528,14 +528,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatReactionsAll(let _data): - return ("chatReactionsAll", [("flags", _data.flags as Any)]) + return ("chatReactionsAll", [("flags", ConstructorParameterDescription(_data.flags))]) case .chatReactionsNone: return ("chatReactionsNone", []) case .chatReactionsSome(let _data): - return ("chatReactionsSome", [("reactions", _data.reactions as Any)]) + return ("chatReactionsSome", [("reactions", ConstructorParameterDescription(_data.reactions))]) } } @@ -575,8 +575,8 @@ public extension Api { public init(emoticon: String) { self.emoticon = emoticon } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatTheme", [("emoticon", self.emoticon as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatTheme", [("emoticon", ConstructorParameterDescription(self.emoticon))]) } } public class Cons_chatThemeUniqueGift: TypeConstructorDescription { @@ -586,8 +586,8 @@ public extension Api { self.gift = gift self.themeSettings = themeSettings } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatThemeUniqueGift", [("gift", self.gift as Any), ("themeSettings", self.themeSettings as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatThemeUniqueGift", [("gift", ConstructorParameterDescription(self.gift)), ("themeSettings", ConstructorParameterDescription(self.themeSettings))]) } } case chatTheme(Cons_chatTheme) @@ -615,12 +615,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatTheme(let _data): - return ("chatTheme", [("emoticon", _data.emoticon as Any)]) + return ("chatTheme", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) case .chatThemeUniqueGift(let _data): - return ("chatThemeUniqueGift", [("gift", _data.gift as Any), ("themeSettings", _data.themeSettings as Any)]) + return ("chatThemeUniqueGift", [("gift", ConstructorParameterDescription(_data.gift)), ("themeSettings", ConstructorParameterDescription(_data.themeSettings))]) } } @@ -668,8 +668,8 @@ public extension Api { self.token = token self.appSandbox = appSandbox } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("codeSettings", [("flags", self.flags as Any), ("logoutTokens", self.logoutTokens as Any), ("token", self.token as Any), ("appSandbox", self.appSandbox as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("codeSettings", [("flags", ConstructorParameterDescription(self.flags)), ("logoutTokens", ConstructorParameterDescription(self.logoutTokens)), ("token", ConstructorParameterDescription(self.token)), ("appSandbox", ConstructorParameterDescription(self.appSandbox))]) } } case codeSettings(Cons_codeSettings) @@ -698,10 +698,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .codeSettings(let _data): - return ("codeSettings", [("flags", _data.flags as Any), ("logoutTokens", _data.logoutTokens as Any), ("token", _data.token as Any), ("appSandbox", _data.appSandbox as Any)]) + return ("codeSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("logoutTokens", ConstructorParameterDescription(_data.logoutTokens)), ("token", ConstructorParameterDescription(_data.token)), ("appSandbox", ConstructorParameterDescription(_data.appSandbox))]) } } @@ -828,8 +828,8 @@ public extension Api { self.reactionsDefault = reactionsDefault self.autologinToken = autologinToken } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("config", [("flags", self.flags as Any), ("date", self.date as Any), ("expires", self.expires as Any), ("testMode", self.testMode as Any), ("thisDc", self.thisDc as Any), ("dcOptions", self.dcOptions as Any), ("dcTxtDomainName", self.dcTxtDomainName as Any), ("chatSizeMax", self.chatSizeMax as Any), ("megagroupSizeMax", self.megagroupSizeMax as Any), ("forwardedCountMax", self.forwardedCountMax as Any), ("onlineUpdatePeriodMs", self.onlineUpdatePeriodMs as Any), ("offlineBlurTimeoutMs", self.offlineBlurTimeoutMs as Any), ("offlineIdleTimeoutMs", self.offlineIdleTimeoutMs as Any), ("onlineCloudTimeoutMs", self.onlineCloudTimeoutMs as Any), ("notifyCloudDelayMs", self.notifyCloudDelayMs as Any), ("notifyDefaultDelayMs", self.notifyDefaultDelayMs as Any), ("pushChatPeriodMs", self.pushChatPeriodMs as Any), ("pushChatLimit", self.pushChatLimit as Any), ("editTimeLimit", self.editTimeLimit as Any), ("revokeTimeLimit", self.revokeTimeLimit as Any), ("revokePmTimeLimit", self.revokePmTimeLimit as Any), ("ratingEDecay", self.ratingEDecay as Any), ("stickersRecentLimit", self.stickersRecentLimit as Any), ("channelsReadMediaPeriod", self.channelsReadMediaPeriod as Any), ("tmpSessions", self.tmpSessions as Any), ("callReceiveTimeoutMs", self.callReceiveTimeoutMs as Any), ("callRingTimeoutMs", self.callRingTimeoutMs as Any), ("callConnectTimeoutMs", self.callConnectTimeoutMs as Any), ("callPacketTimeoutMs", self.callPacketTimeoutMs as Any), ("meUrlPrefix", self.meUrlPrefix as Any), ("autoupdateUrlPrefix", self.autoupdateUrlPrefix as Any), ("gifSearchUsername", self.gifSearchUsername as Any), ("venueSearchUsername", self.venueSearchUsername as Any), ("imgSearchUsername", self.imgSearchUsername as Any), ("staticMapsProvider", self.staticMapsProvider as Any), ("captionLengthMax", self.captionLengthMax as Any), ("messageLengthMax", self.messageLengthMax as Any), ("webfileDcId", self.webfileDcId as Any), ("suggestedLangCode", self.suggestedLangCode as Any), ("langPackVersion", self.langPackVersion as Any), ("baseLangPackVersion", self.baseLangPackVersion as Any), ("reactionsDefault", self.reactionsDefault as Any), ("autologinToken", self.autologinToken as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("config", [("flags", ConstructorParameterDescription(self.flags)), ("date", ConstructorParameterDescription(self.date)), ("expires", ConstructorParameterDescription(self.expires)), ("testMode", ConstructorParameterDescription(self.testMode)), ("thisDc", ConstructorParameterDescription(self.thisDc)), ("dcOptions", ConstructorParameterDescription(self.dcOptions)), ("dcTxtDomainName", ConstructorParameterDescription(self.dcTxtDomainName)), ("chatSizeMax", ConstructorParameterDescription(self.chatSizeMax)), ("megagroupSizeMax", ConstructorParameterDescription(self.megagroupSizeMax)), ("forwardedCountMax", ConstructorParameterDescription(self.forwardedCountMax)), ("onlineUpdatePeriodMs", ConstructorParameterDescription(self.onlineUpdatePeriodMs)), ("offlineBlurTimeoutMs", ConstructorParameterDescription(self.offlineBlurTimeoutMs)), ("offlineIdleTimeoutMs", ConstructorParameterDescription(self.offlineIdleTimeoutMs)), ("onlineCloudTimeoutMs", ConstructorParameterDescription(self.onlineCloudTimeoutMs)), ("notifyCloudDelayMs", ConstructorParameterDescription(self.notifyCloudDelayMs)), ("notifyDefaultDelayMs", ConstructorParameterDescription(self.notifyDefaultDelayMs)), ("pushChatPeriodMs", ConstructorParameterDescription(self.pushChatPeriodMs)), ("pushChatLimit", ConstructorParameterDescription(self.pushChatLimit)), ("editTimeLimit", ConstructorParameterDescription(self.editTimeLimit)), ("revokeTimeLimit", ConstructorParameterDescription(self.revokeTimeLimit)), ("revokePmTimeLimit", ConstructorParameterDescription(self.revokePmTimeLimit)), ("ratingEDecay", ConstructorParameterDescription(self.ratingEDecay)), ("stickersRecentLimit", ConstructorParameterDescription(self.stickersRecentLimit)), ("channelsReadMediaPeriod", ConstructorParameterDescription(self.channelsReadMediaPeriod)), ("tmpSessions", ConstructorParameterDescription(self.tmpSessions)), ("callReceiveTimeoutMs", ConstructorParameterDescription(self.callReceiveTimeoutMs)), ("callRingTimeoutMs", ConstructorParameterDescription(self.callRingTimeoutMs)), ("callConnectTimeoutMs", ConstructorParameterDescription(self.callConnectTimeoutMs)), ("callPacketTimeoutMs", ConstructorParameterDescription(self.callPacketTimeoutMs)), ("meUrlPrefix", ConstructorParameterDescription(self.meUrlPrefix)), ("autoupdateUrlPrefix", ConstructorParameterDescription(self.autoupdateUrlPrefix)), ("gifSearchUsername", ConstructorParameterDescription(self.gifSearchUsername)), ("venueSearchUsername", ConstructorParameterDescription(self.venueSearchUsername)), ("imgSearchUsername", ConstructorParameterDescription(self.imgSearchUsername)), ("staticMapsProvider", ConstructorParameterDescription(self.staticMapsProvider)), ("captionLengthMax", ConstructorParameterDescription(self.captionLengthMax)), ("messageLengthMax", ConstructorParameterDescription(self.messageLengthMax)), ("webfileDcId", ConstructorParameterDescription(self.webfileDcId)), ("suggestedLangCode", ConstructorParameterDescription(self.suggestedLangCode)), ("langPackVersion", ConstructorParameterDescription(self.langPackVersion)), ("baseLangPackVersion", ConstructorParameterDescription(self.baseLangPackVersion)), ("reactionsDefault", ConstructorParameterDescription(self.reactionsDefault)), ("autologinToken", ConstructorParameterDescription(self.autologinToken))]) } } case config(Cons_config) @@ -913,10 +913,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .config(let _data): - return ("config", [("flags", _data.flags as Any), ("date", _data.date as Any), ("expires", _data.expires as Any), ("testMode", _data.testMode as Any), ("thisDc", _data.thisDc as Any), ("dcOptions", _data.dcOptions as Any), ("dcTxtDomainName", _data.dcTxtDomainName as Any), ("chatSizeMax", _data.chatSizeMax as Any), ("megagroupSizeMax", _data.megagroupSizeMax as Any), ("forwardedCountMax", _data.forwardedCountMax as Any), ("onlineUpdatePeriodMs", _data.onlineUpdatePeriodMs as Any), ("offlineBlurTimeoutMs", _data.offlineBlurTimeoutMs as Any), ("offlineIdleTimeoutMs", _data.offlineIdleTimeoutMs as Any), ("onlineCloudTimeoutMs", _data.onlineCloudTimeoutMs as Any), ("notifyCloudDelayMs", _data.notifyCloudDelayMs as Any), ("notifyDefaultDelayMs", _data.notifyDefaultDelayMs as Any), ("pushChatPeriodMs", _data.pushChatPeriodMs as Any), ("pushChatLimit", _data.pushChatLimit as Any), ("editTimeLimit", _data.editTimeLimit as Any), ("revokeTimeLimit", _data.revokeTimeLimit as Any), ("revokePmTimeLimit", _data.revokePmTimeLimit as Any), ("ratingEDecay", _data.ratingEDecay as Any), ("stickersRecentLimit", _data.stickersRecentLimit as Any), ("channelsReadMediaPeriod", _data.channelsReadMediaPeriod as Any), ("tmpSessions", _data.tmpSessions as Any), ("callReceiveTimeoutMs", _data.callReceiveTimeoutMs as Any), ("callRingTimeoutMs", _data.callRingTimeoutMs as Any), ("callConnectTimeoutMs", _data.callConnectTimeoutMs as Any), ("callPacketTimeoutMs", _data.callPacketTimeoutMs as Any), ("meUrlPrefix", _data.meUrlPrefix as Any), ("autoupdateUrlPrefix", _data.autoupdateUrlPrefix as Any), ("gifSearchUsername", _data.gifSearchUsername as Any), ("venueSearchUsername", _data.venueSearchUsername as Any), ("imgSearchUsername", _data.imgSearchUsername as Any), ("staticMapsProvider", _data.staticMapsProvider as Any), ("captionLengthMax", _data.captionLengthMax as Any), ("messageLengthMax", _data.messageLengthMax as Any), ("webfileDcId", _data.webfileDcId as Any), ("suggestedLangCode", _data.suggestedLangCode as Any), ("langPackVersion", _data.langPackVersion as Any), ("baseLangPackVersion", _data.baseLangPackVersion as Any), ("reactionsDefault", _data.reactionsDefault as Any), ("autologinToken", _data.autologinToken as Any)]) + return ("config", [("flags", ConstructorParameterDescription(_data.flags)), ("date", ConstructorParameterDescription(_data.date)), ("expires", ConstructorParameterDescription(_data.expires)), ("testMode", ConstructorParameterDescription(_data.testMode)), ("thisDc", ConstructorParameterDescription(_data.thisDc)), ("dcOptions", ConstructorParameterDescription(_data.dcOptions)), ("dcTxtDomainName", ConstructorParameterDescription(_data.dcTxtDomainName)), ("chatSizeMax", ConstructorParameterDescription(_data.chatSizeMax)), ("megagroupSizeMax", ConstructorParameterDescription(_data.megagroupSizeMax)), ("forwardedCountMax", ConstructorParameterDescription(_data.forwardedCountMax)), ("onlineUpdatePeriodMs", ConstructorParameterDescription(_data.onlineUpdatePeriodMs)), ("offlineBlurTimeoutMs", ConstructorParameterDescription(_data.offlineBlurTimeoutMs)), ("offlineIdleTimeoutMs", ConstructorParameterDescription(_data.offlineIdleTimeoutMs)), ("onlineCloudTimeoutMs", ConstructorParameterDescription(_data.onlineCloudTimeoutMs)), ("notifyCloudDelayMs", ConstructorParameterDescription(_data.notifyCloudDelayMs)), ("notifyDefaultDelayMs", ConstructorParameterDescription(_data.notifyDefaultDelayMs)), ("pushChatPeriodMs", ConstructorParameterDescription(_data.pushChatPeriodMs)), ("pushChatLimit", ConstructorParameterDescription(_data.pushChatLimit)), ("editTimeLimit", ConstructorParameterDescription(_data.editTimeLimit)), ("revokeTimeLimit", ConstructorParameterDescription(_data.revokeTimeLimit)), ("revokePmTimeLimit", ConstructorParameterDescription(_data.revokePmTimeLimit)), ("ratingEDecay", ConstructorParameterDescription(_data.ratingEDecay)), ("stickersRecentLimit", ConstructorParameterDescription(_data.stickersRecentLimit)), ("channelsReadMediaPeriod", ConstructorParameterDescription(_data.channelsReadMediaPeriod)), ("tmpSessions", ConstructorParameterDescription(_data.tmpSessions)), ("callReceiveTimeoutMs", ConstructorParameterDescription(_data.callReceiveTimeoutMs)), ("callRingTimeoutMs", ConstructorParameterDescription(_data.callRingTimeoutMs)), ("callConnectTimeoutMs", ConstructorParameterDescription(_data.callConnectTimeoutMs)), ("callPacketTimeoutMs", ConstructorParameterDescription(_data.callPacketTimeoutMs)), ("meUrlPrefix", ConstructorParameterDescription(_data.meUrlPrefix)), ("autoupdateUrlPrefix", ConstructorParameterDescription(_data.autoupdateUrlPrefix)), ("gifSearchUsername", ConstructorParameterDescription(_data.gifSearchUsername)), ("venueSearchUsername", ConstructorParameterDescription(_data.venueSearchUsername)), ("imgSearchUsername", ConstructorParameterDescription(_data.imgSearchUsername)), ("staticMapsProvider", ConstructorParameterDescription(_data.staticMapsProvider)), ("captionLengthMax", ConstructorParameterDescription(_data.captionLengthMax)), ("messageLengthMax", ConstructorParameterDescription(_data.messageLengthMax)), ("webfileDcId", ConstructorParameterDescription(_data.webfileDcId)), ("suggestedLangCode", ConstructorParameterDescription(_data.suggestedLangCode)), ("langPackVersion", ConstructorParameterDescription(_data.langPackVersion)), ("baseLangPackVersion", ConstructorParameterDescription(_data.baseLangPackVersion)), ("reactionsDefault", ConstructorParameterDescription(_data.reactionsDefault)), ("autologinToken", ConstructorParameterDescription(_data.autologinToken))]) } } @@ -1100,8 +1100,8 @@ public extension Api { self.recipients = recipients self.rights = rights } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("connectedBot", [("flags", self.flags as Any), ("botId", self.botId as Any), ("recipients", self.recipients as Any), ("rights", self.rights as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("connectedBot", [("flags", ConstructorParameterDescription(self.flags)), ("botId", ConstructorParameterDescription(self.botId)), ("recipients", ConstructorParameterDescription(self.recipients)), ("rights", ConstructorParameterDescription(self.rights))]) } } case connectedBot(Cons_connectedBot) @@ -1120,10 +1120,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .connectedBot(let _data): - return ("connectedBot", [("flags", _data.flags as Any), ("botId", _data.botId as Any), ("recipients", _data.recipients as Any), ("rights", _data.rights as Any)]) + return ("connectedBot", [("flags", ConstructorParameterDescription(_data.flags)), ("botId", ConstructorParameterDescription(_data.botId)), ("recipients", ConstructorParameterDescription(_data.recipients)), ("rights", ConstructorParameterDescription(_data.rights))]) } } @@ -1174,8 +1174,8 @@ public extension Api { self.participants = participants self.revenue = revenue } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("connectedBotStarRef", [("flags", self.flags as Any), ("url", self.url as Any), ("date", self.date as Any), ("botId", self.botId as Any), ("commissionPermille", self.commissionPermille as Any), ("durationMonths", self.durationMonths as Any), ("participants", self.participants as Any), ("revenue", self.revenue as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("connectedBotStarRef", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("date", ConstructorParameterDescription(self.date)), ("botId", ConstructorParameterDescription(self.botId)), ("commissionPermille", ConstructorParameterDescription(self.commissionPermille)), ("durationMonths", ConstructorParameterDescription(self.durationMonths)), ("participants", ConstructorParameterDescription(self.participants)), ("revenue", ConstructorParameterDescription(self.revenue))]) } } case connectedBotStarRef(Cons_connectedBotStarRef) @@ -1200,10 +1200,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .connectedBotStarRef(let _data): - return ("connectedBotStarRef", [("flags", _data.flags as Any), ("url", _data.url as Any), ("date", _data.date as Any), ("botId", _data.botId as Any), ("commissionPermille", _data.commissionPermille as Any), ("durationMonths", _data.durationMonths as Any), ("participants", _data.participants as Any), ("revenue", _data.revenue as Any)]) + return ("connectedBotStarRef", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("date", ConstructorParameterDescription(_data.date)), ("botId", ConstructorParameterDescription(_data.botId)), ("commissionPermille", ConstructorParameterDescription(_data.commissionPermille)), ("durationMonths", ConstructorParameterDescription(_data.durationMonths)), ("participants", ConstructorParameterDescription(_data.participants)), ("revenue", ConstructorParameterDescription(_data.revenue))]) } } @@ -1252,8 +1252,8 @@ public extension Api { self.userId = userId self.mutual = mutual } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("contact", [("userId", self.userId as Any), ("mutual", self.mutual as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("contact", [("userId", ConstructorParameterDescription(self.userId)), ("mutual", ConstructorParameterDescription(self.mutual))]) } } case contact(Cons_contact) @@ -1270,10 +1270,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .contact(let _data): - return ("contact", [("userId", _data.userId as Any), ("mutual", _data.mutual as Any)]) + return ("contact", [("userId", ConstructorParameterDescription(_data.userId)), ("mutual", ConstructorParameterDescription(_data.mutual))]) } } @@ -1304,8 +1304,8 @@ public extension Api { self.contactId = contactId self.birthday = birthday } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("contactBirthday", [("contactId", self.contactId as Any), ("birthday", self.birthday as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("contactBirthday", [("contactId", ConstructorParameterDescription(self.contactId)), ("birthday", ConstructorParameterDescription(self.birthday))]) } } case contactBirthday(Cons_contactBirthday) @@ -1322,10 +1322,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .contactBirthday(let _data): - return ("contactBirthday", [("contactId", _data.contactId as Any), ("birthday", _data.birthday as Any)]) + return ("contactBirthday", [("contactId", ConstructorParameterDescription(_data.contactId)), ("birthday", ConstructorParameterDescription(_data.birthday))]) } } @@ -1356,8 +1356,8 @@ public extension Api { self.userId = userId self.status = status } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("contactStatus", [("userId", self.userId as Any), ("status", self.status as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("contactStatus", [("userId", ConstructorParameterDescription(self.userId)), ("status", ConstructorParameterDescription(self.status))]) } } case contactStatus(Cons_contactStatus) @@ -1374,10 +1374,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .contactStatus(let _data): - return ("contactStatus", [("userId", _data.userId as Any), ("status", _data.status as Any)]) + return ("contactStatus", [("userId", ConstructorParameterDescription(_data.userId)), ("status", ConstructorParameterDescription(_data.status))]) } } @@ -1406,8 +1406,8 @@ public extension Api { public init(data: String) { self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dataJSON", [("data", self.data as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dataJSON", [("data", ConstructorParameterDescription(self.data))]) } } case dataJSON(Cons_dataJSON) @@ -1423,10 +1423,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dataJSON(let _data): - return ("dataJSON", [("data", _data.data as Any)]) + return ("dataJSON", [("data", ConstructorParameterDescription(_data.data))]) } } @@ -1458,8 +1458,8 @@ public extension Api { self.port = port self.secret = secret } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dcOption", [("flags", self.flags as Any), ("id", self.id as Any), ("ipAddress", self.ipAddress as Any), ("port", self.port as Any), ("secret", self.secret as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dcOption", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("ipAddress", ConstructorParameterDescription(self.ipAddress)), ("port", ConstructorParameterDescription(self.port)), ("secret", ConstructorParameterDescription(self.secret))]) } } case dcOption(Cons_dcOption) @@ -1481,10 +1481,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dcOption(let _data): - return ("dcOption", [("flags", _data.flags as Any), ("id", _data.id as Any), ("ipAddress", _data.ipAddress as Any), ("port", _data.port as Any), ("secret", _data.secret as Any)]) + return ("dcOption", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("ipAddress", ConstructorParameterDescription(_data.ipAddress)), ("port", ConstructorParameterDescription(_data.port)), ("secret", ConstructorParameterDescription(_data.secret))]) } } @@ -1522,8 +1522,8 @@ public extension Api { public init(period: Int32) { self.period = period } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("defaultHistoryTTL", [("period", self.period as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("defaultHistoryTTL", [("period", ConstructorParameterDescription(self.period))]) } } case defaultHistoryTTL(Cons_defaultHistoryTTL) @@ -1539,10 +1539,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .defaultHistoryTTL(let _data): - return ("defaultHistoryTTL", [("period", _data.period as Any)]) + return ("defaultHistoryTTL", [("period", ConstructorParameterDescription(_data.period))]) } } @@ -1592,8 +1592,8 @@ public extension Api { self.folderId = folderId self.ttlPeriod = ttlPeriod } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialog", [("flags", self.flags as Any), ("peer", self.peer as Any), ("topMessage", self.topMessage as Any), ("readInboxMaxId", self.readInboxMaxId as Any), ("readOutboxMaxId", self.readOutboxMaxId as Any), ("unreadCount", self.unreadCount as Any), ("unreadMentionsCount", self.unreadMentionsCount as Any), ("unreadReactionsCount", self.unreadReactionsCount as Any), ("unreadPollVotesCount", self.unreadPollVotesCount as Any), ("notifySettings", self.notifySettings as Any), ("pts", self.pts as Any), ("draft", self.draft as Any), ("folderId", self.folderId as Any), ("ttlPeriod", self.ttlPeriod as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialog", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("topMessage", ConstructorParameterDescription(self.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("unreadMentionsCount", ConstructorParameterDescription(self.unreadMentionsCount)), ("unreadReactionsCount", ConstructorParameterDescription(self.unreadReactionsCount)), ("unreadPollVotesCount", ConstructorParameterDescription(self.unreadPollVotesCount)), ("notifySettings", ConstructorParameterDescription(self.notifySettings)), ("pts", ConstructorParameterDescription(self.pts)), ("draft", ConstructorParameterDescription(self.draft)), ("folderId", ConstructorParameterDescription(self.folderId)), ("ttlPeriod", ConstructorParameterDescription(self.ttlPeriod))]) } } public class Cons_dialogFolder: TypeConstructorDescription { @@ -1615,8 +1615,8 @@ public extension Api { self.unreadMutedMessagesCount = unreadMutedMessagesCount self.unreadUnmutedMessagesCount = unreadUnmutedMessagesCount } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogFolder", [("flags", self.flags as Any), ("folder", self.folder as Any), ("peer", self.peer as Any), ("topMessage", self.topMessage as Any), ("unreadMutedPeersCount", self.unreadMutedPeersCount as Any), ("unreadUnmutedPeersCount", self.unreadUnmutedPeersCount as Any), ("unreadMutedMessagesCount", self.unreadMutedMessagesCount as Any), ("unreadUnmutedMessagesCount", self.unreadUnmutedMessagesCount as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogFolder", [("flags", ConstructorParameterDescription(self.flags)), ("folder", ConstructorParameterDescription(self.folder)), ("peer", ConstructorParameterDescription(self.peer)), ("topMessage", ConstructorParameterDescription(self.topMessage)), ("unreadMutedPeersCount", ConstructorParameterDescription(self.unreadMutedPeersCount)), ("unreadUnmutedPeersCount", ConstructorParameterDescription(self.unreadUnmutedPeersCount)), ("unreadMutedMessagesCount", ConstructorParameterDescription(self.unreadMutedMessagesCount)), ("unreadUnmutedMessagesCount", ConstructorParameterDescription(self.unreadUnmutedMessagesCount))]) } } case dialog(Cons_dialog) @@ -1667,12 +1667,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dialog(let _data): - return ("dialog", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadMentionsCount", _data.unreadMentionsCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("unreadPollVotesCount", _data.unreadPollVotesCount as Any), ("notifySettings", _data.notifySettings as Any), ("pts", _data.pts as Any), ("draft", _data.draft as Any), ("folderId", _data.folderId as Any), ("ttlPeriod", _data.ttlPeriod as Any)]) + return ("dialog", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMessage", ConstructorParameterDescription(_data.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("unreadMentionsCount", ConstructorParameterDescription(_data.unreadMentionsCount)), ("unreadReactionsCount", ConstructorParameterDescription(_data.unreadReactionsCount)), ("unreadPollVotesCount", ConstructorParameterDescription(_data.unreadPollVotesCount)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings)), ("pts", ConstructorParameterDescription(_data.pts)), ("draft", ConstructorParameterDescription(_data.draft)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("ttlPeriod", ConstructorParameterDescription(_data.ttlPeriod))]) case .dialogFolder(let _data): - return ("dialogFolder", [("flags", _data.flags as Any), ("folder", _data.folder as Any), ("peer", _data.peer as Any), ("topMessage", _data.topMessage as Any), ("unreadMutedPeersCount", _data.unreadMutedPeersCount as Any), ("unreadUnmutedPeersCount", _data.unreadUnmutedPeersCount as Any), ("unreadMutedMessagesCount", _data.unreadMutedMessagesCount as Any), ("unreadUnmutedMessagesCount", _data.unreadUnmutedMessagesCount as Any)]) + return ("dialogFolder", [("flags", ConstructorParameterDescription(_data.flags)), ("folder", ConstructorParameterDescription(_data.folder)), ("peer", ConstructorParameterDescription(_data.peer)), ("topMessage", ConstructorParameterDescription(_data.topMessage)), ("unreadMutedPeersCount", ConstructorParameterDescription(_data.unreadMutedPeersCount)), ("unreadUnmutedPeersCount", ConstructorParameterDescription(_data.unreadUnmutedPeersCount)), ("unreadMutedMessagesCount", ConstructorParameterDescription(_data.unreadMutedMessagesCount)), ("unreadUnmutedMessagesCount", ConstructorParameterDescription(_data.unreadUnmutedMessagesCount))]) } } @@ -1799,8 +1799,8 @@ public extension Api { self.includePeers = includePeers self.excludePeers = excludePeers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogFilter", [("flags", self.flags as Any), ("id", self.id as Any), ("title", self.title as Any), ("emoticon", self.emoticon as Any), ("color", self.color as Any), ("pinnedPeers", self.pinnedPeers as Any), ("includePeers", self.includePeers as Any), ("excludePeers", self.excludePeers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogFilter", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("color", ConstructorParameterDescription(self.color)), ("pinnedPeers", ConstructorParameterDescription(self.pinnedPeers)), ("includePeers", ConstructorParameterDescription(self.includePeers)), ("excludePeers", ConstructorParameterDescription(self.excludePeers))]) } } public class Cons_dialogFilterChatlist: TypeConstructorDescription { @@ -1820,8 +1820,8 @@ public extension Api { self.pinnedPeers = pinnedPeers self.includePeers = includePeers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogFilterChatlist", [("flags", self.flags as Any), ("id", self.id as Any), ("title", self.title as Any), ("emoticon", self.emoticon as Any), ("color", self.color as Any), ("pinnedPeers", self.pinnedPeers as Any), ("includePeers", self.includePeers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogFilterChatlist", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title)), ("emoticon", ConstructorParameterDescription(self.emoticon)), ("color", ConstructorParameterDescription(self.color)), ("pinnedPeers", ConstructorParameterDescription(self.pinnedPeers)), ("includePeers", ConstructorParameterDescription(self.includePeers))]) } } case dialogFilter(Cons_dialogFilter) @@ -1891,12 +1891,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dialogFilter(let _data): - return ("dialogFilter", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("emoticon", _data.emoticon as Any), ("color", _data.color as Any), ("pinnedPeers", _data.pinnedPeers as Any), ("includePeers", _data.includePeers as Any), ("excludePeers", _data.excludePeers as Any)]) + return ("dialogFilter", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("color", ConstructorParameterDescription(_data.color)), ("pinnedPeers", ConstructorParameterDescription(_data.pinnedPeers)), ("includePeers", ConstructorParameterDescription(_data.includePeers)), ("excludePeers", ConstructorParameterDescription(_data.excludePeers))]) case .dialogFilterChatlist(let _data): - return ("dialogFilterChatlist", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("emoticon", _data.emoticon as Any), ("color", _data.color as Any), ("pinnedPeers", _data.pinnedPeers as Any), ("includePeers", _data.includePeers as Any)]) + return ("dialogFilterChatlist", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title)), ("emoticon", ConstructorParameterDescription(_data.emoticon)), ("color", ConstructorParameterDescription(_data.color)), ("pinnedPeers", ConstructorParameterDescription(_data.pinnedPeers)), ("includePeers", ConstructorParameterDescription(_data.includePeers))]) case .dialogFilterDefault: return ("dialogFilterDefault", []) } @@ -1999,8 +1999,8 @@ public extension Api { self.filter = filter self.description = description } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogFilterSuggested", [("filter", self.filter as Any), ("description", self.description as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogFilterSuggested", [("filter", ConstructorParameterDescription(self.filter)), ("description", ConstructorParameterDescription(self.description))]) } } case dialogFilterSuggested(Cons_dialogFilterSuggested) @@ -2017,10 +2017,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dialogFilterSuggested(let _data): - return ("dialogFilterSuggested", [("filter", _data.filter as Any), ("description", _data.description as Any)]) + return ("dialogFilterSuggested", [("filter", ConstructorParameterDescription(_data.filter)), ("description", ConstructorParameterDescription(_data.description))]) } } @@ -2049,8 +2049,8 @@ public extension Api { public init(peer: Api.Peer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogPeer", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogPeer", [("peer", ConstructorParameterDescription(self.peer))]) } } public class Cons_dialogPeerFolder: TypeConstructorDescription { @@ -2058,8 +2058,8 @@ public extension Api { public init(folderId: Int32) { self.folderId = folderId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("dialogPeerFolder", [("folderId", self.folderId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("dialogPeerFolder", [("folderId", ConstructorParameterDescription(self.folderId))]) } } case dialogPeer(Cons_dialogPeer) @@ -2082,12 +2082,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .dialogPeer(let _data): - return ("dialogPeer", [("peer", _data.peer as Any)]) + return ("dialogPeer", [("peer", ConstructorParameterDescription(_data.peer))]) case .dialogPeerFolder(let _data): - return ("dialogPeerFolder", [("folderId", _data.folderId as Any)]) + return ("dialogPeerFolder", [("folderId", ConstructorParameterDescription(_data.folderId))]) } } diff --git a/submodules/TelegramApi/Sources/Api6.swift b/submodules/TelegramApi/Sources/Api6.swift index e43d7bf078..355cd7863e 100644 --- a/submodules/TelegramApi/Sources/Api6.swift +++ b/submodules/TelegramApi/Sources/Api6.swift @@ -5,8 +5,8 @@ public extension Api { public init(flags: Int32) { self.flags = flags } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("disallowedGiftsSettings", [("flags", self.flags as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("disallowedGiftsSettings", [("flags", ConstructorParameterDescription(self.flags))]) } } case disallowedGiftsSettings(Cons_disallowedGiftsSettings) @@ -22,10 +22,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .disallowedGiftsSettings(let _data): - return ("disallowedGiftsSettings", [("flags", _data.flags as Any)]) + return ("disallowedGiftsSettings", [("flags", ConstructorParameterDescription(_data.flags))]) } } @@ -69,8 +69,8 @@ public extension Api { self.dcId = dcId self.attributes = attributes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("document", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("fileReference", self.fileReference as Any), ("date", self.date as Any), ("mimeType", self.mimeType as Any), ("size", self.size as Any), ("thumbs", self.thumbs as Any), ("videoThumbs", self.videoThumbs as Any), ("dcId", self.dcId as Any), ("attributes", self.attributes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("document", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference)), ("date", ConstructorParameterDescription(self.date)), ("mimeType", ConstructorParameterDescription(self.mimeType)), ("size", ConstructorParameterDescription(self.size)), ("thumbs", ConstructorParameterDescription(self.thumbs)), ("videoThumbs", ConstructorParameterDescription(self.videoThumbs)), ("dcId", ConstructorParameterDescription(self.dcId)), ("attributes", ConstructorParameterDescription(self.attributes))]) } } public class Cons_documentEmpty: TypeConstructorDescription { @@ -78,8 +78,8 @@ public extension Api { public init(id: Int64) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("documentEmpty", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("documentEmpty", [("id", ConstructorParameterDescription(self.id))]) } } case document(Cons_document) @@ -128,12 +128,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .document(let _data): - return ("document", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any), ("date", _data.date as Any), ("mimeType", _data.mimeType as Any), ("size", _data.size as Any), ("thumbs", _data.thumbs as Any), ("videoThumbs", _data.videoThumbs as Any), ("dcId", _data.dcId as Any), ("attributes", _data.attributes as Any)]) + return ("document", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference)), ("date", ConstructorParameterDescription(_data.date)), ("mimeType", ConstructorParameterDescription(_data.mimeType)), ("size", ConstructorParameterDescription(_data.size)), ("thumbs", ConstructorParameterDescription(_data.thumbs)), ("videoThumbs", ConstructorParameterDescription(_data.videoThumbs)), ("dcId", ConstructorParameterDescription(_data.dcId)), ("attributes", ConstructorParameterDescription(_data.attributes))]) case .documentEmpty(let _data): - return ("documentEmpty", [("id", _data.id as Any)]) + return ("documentEmpty", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -216,8 +216,8 @@ public extension Api { self.performer = performer self.waveform = waveform } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("documentAttributeAudio", [("flags", self.flags as Any), ("duration", self.duration as Any), ("title", self.title as Any), ("performer", self.performer as Any), ("waveform", self.waveform as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("documentAttributeAudio", [("flags", ConstructorParameterDescription(self.flags)), ("duration", ConstructorParameterDescription(self.duration)), ("title", ConstructorParameterDescription(self.title)), ("performer", ConstructorParameterDescription(self.performer)), ("waveform", ConstructorParameterDescription(self.waveform))]) } } public class Cons_documentAttributeCustomEmoji: TypeConstructorDescription { @@ -229,8 +229,8 @@ public extension Api { self.alt = alt self.stickerset = stickerset } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("documentAttributeCustomEmoji", [("flags", self.flags as Any), ("alt", self.alt as Any), ("stickerset", self.stickerset as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("documentAttributeCustomEmoji", [("flags", ConstructorParameterDescription(self.flags)), ("alt", ConstructorParameterDescription(self.alt)), ("stickerset", ConstructorParameterDescription(self.stickerset))]) } } public class Cons_documentAttributeFilename: TypeConstructorDescription { @@ -238,8 +238,8 @@ public extension Api { public init(fileName: String) { self.fileName = fileName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("documentAttributeFilename", [("fileName", self.fileName as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("documentAttributeFilename", [("fileName", ConstructorParameterDescription(self.fileName))]) } } public class Cons_documentAttributeImageSize: TypeConstructorDescription { @@ -249,8 +249,8 @@ public extension Api { self.w = w self.h = h } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("documentAttributeImageSize", [("w", self.w as Any), ("h", self.h as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("documentAttributeImageSize", [("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h))]) } } public class Cons_documentAttributeSticker: TypeConstructorDescription { @@ -264,8 +264,8 @@ public extension Api { self.stickerset = stickerset self.maskCoords = maskCoords } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("documentAttributeSticker", [("flags", self.flags as Any), ("alt", self.alt as Any), ("stickerset", self.stickerset as Any), ("maskCoords", self.maskCoords as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("documentAttributeSticker", [("flags", ConstructorParameterDescription(self.flags)), ("alt", ConstructorParameterDescription(self.alt)), ("stickerset", ConstructorParameterDescription(self.stickerset)), ("maskCoords", ConstructorParameterDescription(self.maskCoords))]) } } public class Cons_documentAttributeVideo: TypeConstructorDescription { @@ -285,8 +285,8 @@ public extension Api { self.videoStartTs = videoStartTs self.videoCodec = videoCodec } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("documentAttributeVideo", [("flags", self.flags as Any), ("duration", self.duration as Any), ("w", self.w as Any), ("h", self.h as Any), ("preloadPrefixSize", self.preloadPrefixSize as Any), ("videoStartTs", self.videoStartTs as Any), ("videoCodec", self.videoCodec as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("documentAttributeVideo", [("flags", ConstructorParameterDescription(self.flags)), ("duration", ConstructorParameterDescription(self.duration)), ("w", ConstructorParameterDescription(self.w)), ("h", ConstructorParameterDescription(self.h)), ("preloadPrefixSize", ConstructorParameterDescription(self.preloadPrefixSize)), ("videoStartTs", ConstructorParameterDescription(self.videoStartTs)), ("videoCodec", ConstructorParameterDescription(self.videoCodec))]) } } case documentAttributeAnimated @@ -379,24 +379,24 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .documentAttributeAnimated: return ("documentAttributeAnimated", []) case .documentAttributeAudio(let _data): - return ("documentAttributeAudio", [("flags", _data.flags as Any), ("duration", _data.duration as Any), ("title", _data.title as Any), ("performer", _data.performer as Any), ("waveform", _data.waveform as Any)]) + return ("documentAttributeAudio", [("flags", ConstructorParameterDescription(_data.flags)), ("duration", ConstructorParameterDescription(_data.duration)), ("title", ConstructorParameterDescription(_data.title)), ("performer", ConstructorParameterDescription(_data.performer)), ("waveform", ConstructorParameterDescription(_data.waveform))]) case .documentAttributeCustomEmoji(let _data): - return ("documentAttributeCustomEmoji", [("flags", _data.flags as Any), ("alt", _data.alt as Any), ("stickerset", _data.stickerset as Any)]) + return ("documentAttributeCustomEmoji", [("flags", ConstructorParameterDescription(_data.flags)), ("alt", ConstructorParameterDescription(_data.alt)), ("stickerset", ConstructorParameterDescription(_data.stickerset))]) case .documentAttributeFilename(let _data): - return ("documentAttributeFilename", [("fileName", _data.fileName as Any)]) + return ("documentAttributeFilename", [("fileName", ConstructorParameterDescription(_data.fileName))]) case .documentAttributeHasStickers: return ("documentAttributeHasStickers", []) case .documentAttributeImageSize(let _data): - return ("documentAttributeImageSize", [("w", _data.w as Any), ("h", _data.h as Any)]) + return ("documentAttributeImageSize", [("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h))]) case .documentAttributeSticker(let _data): - return ("documentAttributeSticker", [("flags", _data.flags as Any), ("alt", _data.alt as Any), ("stickerset", _data.stickerset as Any), ("maskCoords", _data.maskCoords as Any)]) + return ("documentAttributeSticker", [("flags", ConstructorParameterDescription(_data.flags)), ("alt", ConstructorParameterDescription(_data.alt)), ("stickerset", ConstructorParameterDescription(_data.stickerset)), ("maskCoords", ConstructorParameterDescription(_data.maskCoords))]) case .documentAttributeVideo(let _data): - return ("documentAttributeVideo", [("flags", _data.flags as Any), ("duration", _data.duration as Any), ("w", _data.w as Any), ("h", _data.h as Any), ("preloadPrefixSize", _data.preloadPrefixSize as Any), ("videoStartTs", _data.videoStartTs as Any), ("videoCodec", _data.videoCodec as Any)]) + return ("documentAttributeVideo", [("flags", ConstructorParameterDescription(_data.flags)), ("duration", ConstructorParameterDescription(_data.duration)), ("w", ConstructorParameterDescription(_data.w)), ("h", ConstructorParameterDescription(_data.h)), ("preloadPrefixSize", ConstructorParameterDescription(_data.preloadPrefixSize)), ("videoStartTs", ConstructorParameterDescription(_data.videoStartTs)), ("videoCodec", ConstructorParameterDescription(_data.videoCodec))]) } } @@ -563,8 +563,8 @@ public extension Api { self.effect = effect self.suggestedPost = suggestedPost } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("draftMessage", [("flags", self.flags as Any), ("replyTo", self.replyTo as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("media", self.media as Any), ("date", self.date as Any), ("effect", self.effect as Any), ("suggestedPost", self.suggestedPost as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("draftMessage", [("flags", ConstructorParameterDescription(self.flags)), ("replyTo", ConstructorParameterDescription(self.replyTo)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("media", ConstructorParameterDescription(self.media)), ("date", ConstructorParameterDescription(self.date)), ("effect", ConstructorParameterDescription(self.effect)), ("suggestedPost", ConstructorParameterDescription(self.suggestedPost))]) } } public class Cons_draftMessageEmpty: TypeConstructorDescription { @@ -574,8 +574,8 @@ public extension Api { self.flags = flags self.date = date } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("draftMessageEmpty", [("flags", self.flags as Any), ("date", self.date as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("draftMessageEmpty", [("flags", ConstructorParameterDescription(self.flags)), ("date", ConstructorParameterDescription(self.date))]) } } case draftMessage(Cons_draftMessage) @@ -622,12 +622,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .draftMessage(let _data): - return ("draftMessage", [("flags", _data.flags as Any), ("replyTo", _data.replyTo as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("media", _data.media as Any), ("date", _data.date as Any), ("effect", _data.effect as Any), ("suggestedPost", _data.suggestedPost as Any)]) + return ("draftMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("replyTo", ConstructorParameterDescription(_data.replyTo)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("media", ConstructorParameterDescription(_data.media)), ("date", ConstructorParameterDescription(_data.date)), ("effect", ConstructorParameterDescription(_data.effect)), ("suggestedPost", ConstructorParameterDescription(_data.suggestedPost))]) case .draftMessageEmpty(let _data): - return ("draftMessageEmpty", [("flags", _data.flags as Any), ("date", _data.date as Any)]) + return ("draftMessageEmpty", [("flags", ConstructorParameterDescription(_data.flags)), ("date", ConstructorParameterDescription(_data.date))]) } } @@ -706,8 +706,8 @@ public extension Api { public init(token: String) { self.token = token } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emailVerificationApple", [("token", self.token as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerificationApple", [("token", ConstructorParameterDescription(self.token))]) } } public class Cons_emailVerificationCode: TypeConstructorDescription { @@ -715,8 +715,8 @@ public extension Api { public init(code: String) { self.code = code } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emailVerificationCode", [("code", self.code as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerificationCode", [("code", ConstructorParameterDescription(self.code))]) } } public class Cons_emailVerificationGoogle: TypeConstructorDescription { @@ -724,8 +724,8 @@ public extension Api { public init(token: String) { self.token = token } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emailVerificationGoogle", [("token", self.token as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerificationGoogle", [("token", ConstructorParameterDescription(self.token))]) } } case emailVerificationApple(Cons_emailVerificationApple) @@ -755,14 +755,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emailVerificationApple(let _data): - return ("emailVerificationApple", [("token", _data.token as Any)]) + return ("emailVerificationApple", [("token", ConstructorParameterDescription(_data.token))]) case .emailVerificationCode(let _data): - return ("emailVerificationCode", [("code", _data.code as Any)]) + return ("emailVerificationCode", [("code", ConstructorParameterDescription(_data.code))]) case .emailVerificationGoogle(let _data): - return ("emailVerificationGoogle", [("token", _data.token as Any)]) + return ("emailVerificationGoogle", [("token", ConstructorParameterDescription(_data.token))]) } } @@ -810,8 +810,8 @@ public extension Api { self.phoneNumber = phoneNumber self.phoneCodeHash = phoneCodeHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emailVerifyPurposeLoginSetup", [("phoneNumber", self.phoneNumber as Any), ("phoneCodeHash", self.phoneCodeHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emailVerifyPurposeLoginSetup", [("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(self.phoneCodeHash))]) } } case emailVerifyPurposeLoginChange @@ -840,12 +840,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emailVerifyPurposeLoginChange: return ("emailVerifyPurposeLoginChange", []) case .emailVerifyPurposeLoginSetup(let _data): - return ("emailVerifyPurposeLoginSetup", [("phoneNumber", _data.phoneNumber as Any), ("phoneCodeHash", _data.phoneCodeHash as Any)]) + return ("emailVerifyPurposeLoginSetup", [("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("phoneCodeHash", ConstructorParameterDescription(_data.phoneCodeHash))]) case .emailVerifyPurposePassport: return ("emailVerifyPurposePassport", []) } @@ -884,8 +884,8 @@ public extension Api { self.iconEmojiId = iconEmojiId self.emoticons = emoticons } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiGroup", [("title", self.title as Any), ("iconEmojiId", self.iconEmojiId as Any), ("emoticons", self.emoticons as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiGroup", [("title", ConstructorParameterDescription(self.title)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId)), ("emoticons", ConstructorParameterDescription(self.emoticons))]) } } public class Cons_emojiGroupGreeting: TypeConstructorDescription { @@ -897,8 +897,8 @@ public extension Api { self.iconEmojiId = iconEmojiId self.emoticons = emoticons } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiGroupGreeting", [("title", self.title as Any), ("iconEmojiId", self.iconEmojiId as Any), ("emoticons", self.emoticons as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiGroupGreeting", [("title", ConstructorParameterDescription(self.title)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId)), ("emoticons", ConstructorParameterDescription(self.emoticons))]) } } public class Cons_emojiGroupPremium: TypeConstructorDescription { @@ -908,8 +908,8 @@ public extension Api { self.title = title self.iconEmojiId = iconEmojiId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiGroupPremium", [("title", self.title as Any), ("iconEmojiId", self.iconEmojiId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiGroupPremium", [("title", ConstructorParameterDescription(self.title)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId))]) } } case emojiGroup(Cons_emojiGroup) @@ -952,14 +952,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiGroup(let _data): - return ("emojiGroup", [("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("emoticons", _data.emoticons as Any)]) + return ("emojiGroup", [("title", ConstructorParameterDescription(_data.title)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId)), ("emoticons", ConstructorParameterDescription(_data.emoticons))]) case .emojiGroupGreeting(let _data): - return ("emojiGroupGreeting", [("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("emoticons", _data.emoticons as Any)]) + return ("emojiGroupGreeting", [("title", ConstructorParameterDescription(_data.title)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId)), ("emoticons", ConstructorParameterDescription(_data.emoticons))]) case .emojiGroupPremium(let _data): - return ("emojiGroupPremium", [("title", _data.title as Any), ("iconEmojiId", _data.iconEmojiId as Any)]) + return ("emojiGroupPremium", [("title", ConstructorParameterDescription(_data.title)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId))]) } } @@ -1026,8 +1026,8 @@ public extension Api { self.keyword = keyword self.emoticons = emoticons } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiKeyword", [("keyword", self.keyword as Any), ("emoticons", self.emoticons as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiKeyword", [("keyword", ConstructorParameterDescription(self.keyword)), ("emoticons", ConstructorParameterDescription(self.emoticons))]) } } public class Cons_emojiKeywordDeleted: TypeConstructorDescription { @@ -1037,8 +1037,8 @@ public extension Api { self.keyword = keyword self.emoticons = emoticons } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiKeywordDeleted", [("keyword", self.keyword as Any), ("emoticons", self.emoticons as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiKeywordDeleted", [("keyword", ConstructorParameterDescription(self.keyword)), ("emoticons", ConstructorParameterDescription(self.emoticons))]) } } case emojiKeyword(Cons_emojiKeyword) @@ -1071,12 +1071,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiKeyword(let _data): - return ("emojiKeyword", [("keyword", _data.keyword as Any), ("emoticons", _data.emoticons as Any)]) + return ("emojiKeyword", [("keyword", ConstructorParameterDescription(_data.keyword)), ("emoticons", ConstructorParameterDescription(_data.emoticons))]) case .emojiKeywordDeleted(let _data): - return ("emojiKeywordDeleted", [("keyword", _data.keyword as Any), ("emoticons", _data.emoticons as Any)]) + return ("emojiKeywordDeleted", [("keyword", ConstructorParameterDescription(_data.keyword)), ("emoticons", ConstructorParameterDescription(_data.emoticons))]) } } @@ -1127,8 +1127,8 @@ public extension Api { self.version = version self.keywords = keywords } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiKeywordsDifference", [("langCode", self.langCode as Any), ("fromVersion", self.fromVersion as Any), ("version", self.version as Any), ("keywords", self.keywords as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiKeywordsDifference", [("langCode", ConstructorParameterDescription(self.langCode)), ("fromVersion", ConstructorParameterDescription(self.fromVersion)), ("version", ConstructorParameterDescription(self.version)), ("keywords", ConstructorParameterDescription(self.keywords))]) } } case emojiKeywordsDifference(Cons_emojiKeywordsDifference) @@ -1151,10 +1151,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiKeywordsDifference(let _data): - return ("emojiKeywordsDifference", [("langCode", _data.langCode as Any), ("fromVersion", _data.fromVersion as Any), ("version", _data.version as Any), ("keywords", _data.keywords as Any)]) + return ("emojiKeywordsDifference", [("langCode", ConstructorParameterDescription(_data.langCode)), ("fromVersion", ConstructorParameterDescription(_data.fromVersion)), ("version", ConstructorParameterDescription(_data.version)), ("keywords", ConstructorParameterDescription(_data.keywords))]) } } @@ -1189,8 +1189,8 @@ public extension Api { public init(langCode: String) { self.langCode = langCode } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiLanguage", [("langCode", self.langCode as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiLanguage", [("langCode", ConstructorParameterDescription(self.langCode))]) } } case emojiLanguage(Cons_emojiLanguage) @@ -1206,10 +1206,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiLanguage(let _data): - return ("emojiLanguage", [("langCode", _data.langCode as Any)]) + return ("emojiLanguage", [("langCode", ConstructorParameterDescription(_data.langCode))]) } } @@ -1235,8 +1235,8 @@ public extension Api { self.hash = hash self.documentId = documentId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiList", [("hash", self.hash as Any), ("documentId", self.documentId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiList", [("hash", ConstructorParameterDescription(self.hash)), ("documentId", ConstructorParameterDescription(self.documentId))]) } } case emojiList(Cons_emojiList) @@ -1263,10 +1263,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiList(let _data): - return ("emojiList", [("hash", _data.hash as Any), ("documentId", _data.documentId as Any)]) + return ("emojiList", [("hash", ConstructorParameterDescription(_data.hash)), ("documentId", ConstructorParameterDescription(_data.documentId))]) case .emojiListNotModified: return ("emojiListNotModified", []) } @@ -1304,8 +1304,8 @@ public extension Api { self.documentId = documentId self.until = until } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiStatus", [("flags", self.flags as Any), ("documentId", self.documentId as Any), ("until", self.until as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiStatus", [("flags", ConstructorParameterDescription(self.flags)), ("documentId", ConstructorParameterDescription(self.documentId)), ("until", ConstructorParameterDescription(self.until))]) } } public class Cons_emojiStatusCollectible: TypeConstructorDescription { @@ -1333,8 +1333,8 @@ public extension Api { self.textColor = textColor self.until = until } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiStatusCollectible", [("flags", self.flags as Any), ("collectibleId", self.collectibleId as Any), ("documentId", self.documentId as Any), ("title", self.title as Any), ("slug", self.slug as Any), ("patternDocumentId", self.patternDocumentId as Any), ("centerColor", self.centerColor as Any), ("edgeColor", self.edgeColor as Any), ("patternColor", self.patternColor as Any), ("textColor", self.textColor as Any), ("until", self.until as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiStatusCollectible", [("flags", ConstructorParameterDescription(self.flags)), ("collectibleId", ConstructorParameterDescription(self.collectibleId)), ("documentId", ConstructorParameterDescription(self.documentId)), ("title", ConstructorParameterDescription(self.title)), ("slug", ConstructorParameterDescription(self.slug)), ("patternDocumentId", ConstructorParameterDescription(self.patternDocumentId)), ("centerColor", ConstructorParameterDescription(self.centerColor)), ("edgeColor", ConstructorParameterDescription(self.edgeColor)), ("patternColor", ConstructorParameterDescription(self.patternColor)), ("textColor", ConstructorParameterDescription(self.textColor)), ("until", ConstructorParameterDescription(self.until))]) } } public class Cons_inputEmojiStatusCollectible: TypeConstructorDescription { @@ -1346,8 +1346,8 @@ public extension Api { self.collectibleId = collectibleId self.until = until } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputEmojiStatusCollectible", [("flags", self.flags as Any), ("collectibleId", self.collectibleId as Any), ("until", self.until as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputEmojiStatusCollectible", [("flags", ConstructorParameterDescription(self.flags)), ("collectibleId", ConstructorParameterDescription(self.collectibleId)), ("until", ConstructorParameterDescription(self.until))]) } } case emojiStatus(Cons_emojiStatus) @@ -1403,16 +1403,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiStatus(let _data): - return ("emojiStatus", [("flags", _data.flags as Any), ("documentId", _data.documentId as Any), ("until", _data.until as Any)]) + return ("emojiStatus", [("flags", ConstructorParameterDescription(_data.flags)), ("documentId", ConstructorParameterDescription(_data.documentId)), ("until", ConstructorParameterDescription(_data.until))]) case .emojiStatusCollectible(let _data): - return ("emojiStatusCollectible", [("flags", _data.flags as Any), ("collectibleId", _data.collectibleId as Any), ("documentId", _data.documentId as Any), ("title", _data.title as Any), ("slug", _data.slug as Any), ("patternDocumentId", _data.patternDocumentId as Any), ("centerColor", _data.centerColor as Any), ("edgeColor", _data.edgeColor as Any), ("patternColor", _data.patternColor as Any), ("textColor", _data.textColor as Any), ("until", _data.until as Any)]) + return ("emojiStatusCollectible", [("flags", ConstructorParameterDescription(_data.flags)), ("collectibleId", ConstructorParameterDescription(_data.collectibleId)), ("documentId", ConstructorParameterDescription(_data.documentId)), ("title", ConstructorParameterDescription(_data.title)), ("slug", ConstructorParameterDescription(_data.slug)), ("patternDocumentId", ConstructorParameterDescription(_data.patternDocumentId)), ("centerColor", ConstructorParameterDescription(_data.centerColor)), ("edgeColor", ConstructorParameterDescription(_data.edgeColor)), ("patternColor", ConstructorParameterDescription(_data.patternColor)), ("textColor", ConstructorParameterDescription(_data.textColor)), ("until", ConstructorParameterDescription(_data.until))]) case .emojiStatusEmpty: return ("emojiStatusEmpty", []) case .inputEmojiStatusCollectible(let _data): - return ("inputEmojiStatusCollectible", [("flags", _data.flags as Any), ("collectibleId", _data.collectibleId as Any), ("until", _data.until as Any)]) + return ("inputEmojiStatusCollectible", [("flags", ConstructorParameterDescription(_data.flags)), ("collectibleId", ConstructorParameterDescription(_data.collectibleId)), ("until", ConstructorParameterDescription(_data.until))]) } } diff --git a/submodules/TelegramApi/Sources/Api7.swift b/submodules/TelegramApi/Sources/Api7.swift index 2dd2a6c5bb..035ec1c502 100644 --- a/submodules/TelegramApi/Sources/Api7.swift +++ b/submodules/TelegramApi/Sources/Api7.swift @@ -5,8 +5,8 @@ public extension Api { public init(url: String) { self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("emojiURL", [("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("emojiURL", [("url", ConstructorParameterDescription(self.url))]) } } case emojiURL(Cons_emojiURL) @@ -22,10 +22,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .emojiURL(let _data): - return ("emojiURL", [("url", _data.url as Any)]) + return ("emojiURL", [("url", ConstructorParameterDescription(_data.url))]) } } @@ -61,8 +61,8 @@ public extension Api { self.gAOrB = gAOrB self.keyFingerprint = keyFingerprint } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedChat", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("date", self.date as Any), ("adminId", self.adminId as Any), ("participantId", self.participantId as Any), ("gAOrB", self.gAOrB as Any), ("keyFingerprint", self.keyFingerprint as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedChat", [("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))]) } } public class Cons_encryptedChatDiscarded: TypeConstructorDescription { @@ -72,8 +72,8 @@ public extension Api { self.flags = flags self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedChatDiscarded", [("flags", self.flags as Any), ("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedChatDiscarded", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id))]) } } public class Cons_encryptedChatEmpty: TypeConstructorDescription { @@ -81,8 +81,8 @@ public extension Api { public init(id: Int32) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedChatEmpty", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedChatEmpty", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_encryptedChatRequested: TypeConstructorDescription { @@ -104,8 +104,8 @@ public extension Api { self.participantId = participantId self.gA = gA } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedChatRequested", [("flags", self.flags as Any), ("folderId", self.folderId as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("date", self.date as Any), ("adminId", self.adminId as Any), ("participantId", self.participantId as Any), ("gA", self.gA as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedChatRequested", [("flags", ConstructorParameterDescription(self.flags)), ("folderId", ConstructorParameterDescription(self.folderId)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId)), ("gA", ConstructorParameterDescription(self.gA))]) } } public class Cons_encryptedChatWaiting: TypeConstructorDescription { @@ -121,8 +121,8 @@ public extension Api { self.adminId = adminId self.participantId = participantId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedChatWaiting", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("date", self.date as Any), ("adminId", self.adminId as Any), ("participantId", self.participantId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedChatWaiting", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("date", ConstructorParameterDescription(self.date)), ("adminId", ConstructorParameterDescription(self.adminId)), ("participantId", ConstructorParameterDescription(self.participantId))]) } } case encryptedChat(Cons_encryptedChat) @@ -186,18 +186,18 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .encryptedChat(let _data): - return ("encryptedChat", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gAOrB", _data.gAOrB as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + return ("encryptedChat", [("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))]) case .encryptedChatDiscarded(let _data): - return ("encryptedChatDiscarded", [("flags", _data.flags as Any), ("id", _data.id as Any)]) + return ("encryptedChatDiscarded", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id))]) case .encryptedChatEmpty(let _data): - return ("encryptedChatEmpty", [("id", _data.id as Any)]) + return ("encryptedChatEmpty", [("id", ConstructorParameterDescription(_data.id))]) case .encryptedChatRequested(let _data): - return ("encryptedChatRequested", [("flags", _data.flags as Any), ("folderId", _data.folderId as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any), ("gA", _data.gA as Any)]) + return ("encryptedChatRequested", [("flags", ConstructorParameterDescription(_data.flags)), ("folderId", ConstructorParameterDescription(_data.folderId)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId)), ("gA", ConstructorParameterDescription(_data.gA))]) case .encryptedChatWaiting(let _data): - return ("encryptedChatWaiting", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("date", _data.date as Any), ("adminId", _data.adminId as Any), ("participantId", _data.participantId as Any)]) + return ("encryptedChatWaiting", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("date", ConstructorParameterDescription(_data.date)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("participantId", ConstructorParameterDescription(_data.participantId))]) } } @@ -329,8 +329,8 @@ public extension Api { self.dcId = dcId self.keyFingerprint = keyFingerprint } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedFile", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("size", self.size as Any), ("dcId", self.dcId as Any), ("keyFingerprint", self.keyFingerprint as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedFile", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("size", ConstructorParameterDescription(self.size)), ("dcId", ConstructorParameterDescription(self.dcId)), ("keyFingerprint", ConstructorParameterDescription(self.keyFingerprint))]) } } case encryptedFile(Cons_encryptedFile) @@ -356,10 +356,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .encryptedFile(let _data): - return ("encryptedFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("size", _data.size as Any), ("dcId", _data.dcId as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + return ("encryptedFile", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("size", ConstructorParameterDescription(_data.size)), ("dcId", ConstructorParameterDescription(_data.dcId)), ("keyFingerprint", ConstructorParameterDescription(_data.keyFingerprint))]) case .encryptedFileEmpty: return ("encryptedFileEmpty", []) } @@ -408,8 +408,8 @@ public extension Api { self.bytes = bytes self.file = file } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedMessage", [("randomId", self.randomId as Any), ("chatId", self.chatId as Any), ("date", self.date as Any), ("bytes", self.bytes as Any), ("file", self.file as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedMessage", [("randomId", ConstructorParameterDescription(self.randomId)), ("chatId", ConstructorParameterDescription(self.chatId)), ("date", ConstructorParameterDescription(self.date)), ("bytes", ConstructorParameterDescription(self.bytes)), ("file", ConstructorParameterDescription(self.file))]) } } public class Cons_encryptedMessageService: TypeConstructorDescription { @@ -423,8 +423,8 @@ public extension Api { self.date = date self.bytes = bytes } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("encryptedMessageService", [("randomId", self.randomId as Any), ("chatId", self.chatId as Any), ("date", self.date as Any), ("bytes", self.bytes as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("encryptedMessageService", [("randomId", ConstructorParameterDescription(self.randomId)), ("chatId", ConstructorParameterDescription(self.chatId)), ("date", ConstructorParameterDescription(self.date)), ("bytes", ConstructorParameterDescription(self.bytes))]) } } case encryptedMessage(Cons_encryptedMessage) @@ -454,12 +454,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .encryptedMessage(let _data): - return ("encryptedMessage", [("randomId", _data.randomId as Any), ("chatId", _data.chatId as Any), ("date", _data.date as Any), ("bytes", _data.bytes as Any), ("file", _data.file as Any)]) + return ("encryptedMessage", [("randomId", ConstructorParameterDescription(_data.randomId)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("date", ConstructorParameterDescription(_data.date)), ("bytes", ConstructorParameterDescription(_data.bytes)), ("file", ConstructorParameterDescription(_data.file))]) case .encryptedMessageService(let _data): - return ("encryptedMessageService", [("randomId", _data.randomId as Any), ("chatId", _data.chatId as Any), ("date", _data.date as Any), ("bytes", _data.bytes as Any)]) + return ("encryptedMessageService", [("randomId", ConstructorParameterDescription(_data.randomId)), ("chatId", ConstructorParameterDescription(_data.chatId)), ("date", ConstructorParameterDescription(_data.date)), ("bytes", ConstructorParameterDescription(_data.bytes))]) } } @@ -539,8 +539,8 @@ public extension Api { self.title = title self.subscriptionPricing = subscriptionPricing } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("chatInviteExported", [("flags", self.flags as Any), ("link", self.link as Any), ("adminId", self.adminId as Any), ("date", self.date as Any), ("startDate", self.startDate as Any), ("expireDate", self.expireDate as Any), ("usageLimit", self.usageLimit as Any), ("usage", self.usage as Any), ("requested", self.requested as Any), ("subscriptionExpired", self.subscriptionExpired as Any), ("title", self.title as Any), ("subscriptionPricing", self.subscriptionPricing as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("chatInviteExported", [("flags", ConstructorParameterDescription(self.flags)), ("link", ConstructorParameterDescription(self.link)), ("adminId", ConstructorParameterDescription(self.adminId)), ("date", ConstructorParameterDescription(self.date)), ("startDate", ConstructorParameterDescription(self.startDate)), ("expireDate", ConstructorParameterDescription(self.expireDate)), ("usageLimit", ConstructorParameterDescription(self.usageLimit)), ("usage", ConstructorParameterDescription(self.usage)), ("requested", ConstructorParameterDescription(self.requested)), ("subscriptionExpired", ConstructorParameterDescription(self.subscriptionExpired)), ("title", ConstructorParameterDescription(self.title)), ("subscriptionPricing", ConstructorParameterDescription(self.subscriptionPricing))]) } } case chatInviteExported(Cons_chatInviteExported) @@ -589,10 +589,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .chatInviteExported(let _data): - return ("chatInviteExported", [("flags", _data.flags as Any), ("link", _data.link as Any), ("adminId", _data.adminId as Any), ("date", _data.date as Any), ("startDate", _data.startDate as Any), ("expireDate", _data.expireDate as Any), ("usageLimit", _data.usageLimit as Any), ("usage", _data.usage as Any), ("requested", _data.requested as Any), ("subscriptionExpired", _data.subscriptionExpired as Any), ("title", _data.title as Any), ("subscriptionPricing", _data.subscriptionPricing as Any)]) + return ("chatInviteExported", [("flags", ConstructorParameterDescription(_data.flags)), ("link", ConstructorParameterDescription(_data.link)), ("adminId", ConstructorParameterDescription(_data.adminId)), ("date", ConstructorParameterDescription(_data.date)), ("startDate", ConstructorParameterDescription(_data.startDate)), ("expireDate", ConstructorParameterDescription(_data.expireDate)), ("usageLimit", ConstructorParameterDescription(_data.usageLimit)), ("usage", ConstructorParameterDescription(_data.usage)), ("requested", ConstructorParameterDescription(_data.requested)), ("subscriptionExpired", ConstructorParameterDescription(_data.subscriptionExpired)), ("title", ConstructorParameterDescription(_data.title)), ("subscriptionPricing", ConstructorParameterDescription(_data.subscriptionPricing))]) case .chatInvitePublicJoinRequests: return ("chatInvitePublicJoinRequests", []) } @@ -678,8 +678,8 @@ public extension Api { self.url = url self.peers = peers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedChatlistInvite", [("flags", self.flags as Any), ("title", self.title as Any), ("url", self.url as Any), ("peers", self.peers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedChatlistInvite", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("url", ConstructorParameterDescription(self.url)), ("peers", ConstructorParameterDescription(self.peers))]) } } case exportedChatlistInvite(Cons_exportedChatlistInvite) @@ -702,10 +702,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedChatlistInvite(let _data): - return ("exportedChatlistInvite", [("flags", _data.flags as Any), ("title", _data.title as Any), ("url", _data.url as Any), ("peers", _data.peers as Any)]) + return ("exportedChatlistInvite", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("url", ConstructorParameterDescription(_data.url)), ("peers", ConstructorParameterDescription(_data.peers))]) } } @@ -742,8 +742,8 @@ public extension Api { self.url = url self.expires = expires } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedContactToken", [("url", self.url as Any), ("expires", self.expires as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedContactToken", [("url", ConstructorParameterDescription(self.url)), ("expires", ConstructorParameterDescription(self.expires))]) } } case exportedContactToken(Cons_exportedContactToken) @@ -760,10 +760,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedContactToken(let _data): - return ("exportedContactToken", [("url", _data.url as Any), ("expires", _data.expires as Any)]) + return ("exportedContactToken", [("url", ConstructorParameterDescription(_data.url)), ("expires", ConstructorParameterDescription(_data.expires))]) } } @@ -792,8 +792,8 @@ public extension Api { self.link = link self.html = html } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedMessageLink", [("link", self.link as Any), ("html", self.html as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedMessageLink", [("link", ConstructorParameterDescription(self.link)), ("html", ConstructorParameterDescription(self.html))]) } } case exportedMessageLink(Cons_exportedMessageLink) @@ -810,10 +810,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedMessageLink(let _data): - return ("exportedMessageLink", [("link", _data.link as Any), ("html", _data.html as Any)]) + return ("exportedMessageLink", [("link", ConstructorParameterDescription(_data.link)), ("html", ConstructorParameterDescription(_data.html))]) } } @@ -840,8 +840,8 @@ public extension Api { public init(link: String) { self.link = link } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("exportedStoryLink", [("link", self.link as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("exportedStoryLink", [("link", ConstructorParameterDescription(self.link))]) } } case exportedStoryLink(Cons_exportedStoryLink) @@ -857,10 +857,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .exportedStoryLink(let _data): - return ("exportedStoryLink", [("link", _data.link as Any)]) + return ("exportedStoryLink", [("link", ConstructorParameterDescription(_data.link))]) } } @@ -890,8 +890,8 @@ public extension Api { self.text = text self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("factCheck", [("flags", self.flags as Any), ("country", self.country as Any), ("text", self.text as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("factCheck", [("flags", ConstructorParameterDescription(self.flags)), ("country", ConstructorParameterDescription(self.country)), ("text", ConstructorParameterDescription(self.text)), ("hash", ConstructorParameterDescription(self.hash))]) } } case factCheck(Cons_factCheck) @@ -914,10 +914,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .factCheck(let _data): - return ("factCheck", [("flags", _data.flags as Any), ("country", _data.country as Any), ("text", _data.text as Any), ("hash", _data.hash as Any)]) + return ("factCheck", [("flags", ConstructorParameterDescription(_data.flags)), ("country", ConstructorParameterDescription(_data.country)), ("text", ConstructorParameterDescription(_data.text)), ("hash", ConstructorParameterDescription(_data.hash))]) } } @@ -960,8 +960,8 @@ public extension Api { self.limit = limit self.hash = hash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("fileHash", [("offset", self.offset as Any), ("limit", self.limit as Any), ("hash", self.hash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("fileHash", [("offset", ConstructorParameterDescription(self.offset)), ("limit", ConstructorParameterDescription(self.limit)), ("hash", ConstructorParameterDescription(self.hash))]) } } case fileHash(Cons_fileHash) @@ -979,10 +979,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .fileHash(let _data): - return ("fileHash", [("offset", _data.offset as Any), ("limit", _data.limit as Any), ("hash", _data.hash as Any)]) + return ("fileHash", [("offset", ConstructorParameterDescription(_data.offset)), ("limit", ConstructorParameterDescription(_data.limit)), ("hash", ConstructorParameterDescription(_data.hash))]) } } @@ -1018,8 +1018,8 @@ public extension Api { self.title = title self.photo = photo } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("folder", [("flags", self.flags as Any), ("id", self.id as Any), ("title", self.title as Any), ("photo", self.photo as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("folder", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title)), ("photo", ConstructorParameterDescription(self.photo))]) } } case folder(Cons_folder) @@ -1040,10 +1040,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .folder(let _data): - return ("folder", [("flags", _data.flags as Any), ("id", _data.id as Any), ("title", _data.title as Any), ("photo", _data.photo as Any)]) + return ("folder", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title)), ("photo", ConstructorParameterDescription(_data.photo))]) } } @@ -1082,8 +1082,8 @@ public extension Api { self.peer = peer self.folderId = folderId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("folderPeer", [("peer", self.peer as Any), ("folderId", self.folderId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("folderPeer", [("peer", ConstructorParameterDescription(self.peer)), ("folderId", ConstructorParameterDescription(self.folderId))]) } } case folderPeer(Cons_folderPeer) @@ -1100,10 +1100,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .folderPeer(let _data): - return ("folderPeer", [("peer", _data.peer as Any), ("folderId", _data.folderId as Any)]) + return ("folderPeer", [("peer", ConstructorParameterDescription(_data.peer)), ("folderId", ConstructorParameterDescription(_data.folderId))]) } } @@ -1164,8 +1164,8 @@ public extension Api { self.notifySettings = notifySettings self.draft = draft } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("forumTopic", [("flags", self.flags as Any), ("id", self.id as Any), ("date", self.date as Any), ("peer", self.peer as Any), ("title", self.title as Any), ("iconColor", self.iconColor as Any), ("iconEmojiId", self.iconEmojiId as Any), ("topMessage", self.topMessage as Any), ("readInboxMaxId", self.readInboxMaxId as Any), ("readOutboxMaxId", self.readOutboxMaxId as Any), ("unreadCount", self.unreadCount as Any), ("unreadMentionsCount", self.unreadMentionsCount as Any), ("unreadReactionsCount", self.unreadReactionsCount as Any), ("unreadPollVotesCount", self.unreadPollVotesCount as Any), ("fromId", self.fromId as Any), ("notifySettings", self.notifySettings as Any), ("draft", self.draft as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("forumTopic", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("date", ConstructorParameterDescription(self.date)), ("peer", ConstructorParameterDescription(self.peer)), ("title", ConstructorParameterDescription(self.title)), ("iconColor", ConstructorParameterDescription(self.iconColor)), ("iconEmojiId", ConstructorParameterDescription(self.iconEmojiId)), ("topMessage", ConstructorParameterDescription(self.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(self.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(self.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(self.unreadCount)), ("unreadMentionsCount", ConstructorParameterDescription(self.unreadMentionsCount)), ("unreadReactionsCount", ConstructorParameterDescription(self.unreadReactionsCount)), ("unreadPollVotesCount", ConstructorParameterDescription(self.unreadPollVotesCount)), ("fromId", ConstructorParameterDescription(self.fromId)), ("notifySettings", ConstructorParameterDescription(self.notifySettings)), ("draft", ConstructorParameterDescription(self.draft))]) } } public class Cons_forumTopicDeleted: TypeConstructorDescription { @@ -1173,8 +1173,8 @@ public extension Api { public init(id: Int32) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("forumTopicDeleted", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("forumTopicDeleted", [("id", ConstructorParameterDescription(self.id))]) } } case forumTopic(Cons_forumTopic) @@ -1217,12 +1217,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .forumTopic(let _data): - return ("forumTopic", [("flags", _data.flags as Any), ("id", _data.id as Any), ("date", _data.date as Any), ("peer", _data.peer as Any), ("title", _data.title as Any), ("iconColor", _data.iconColor as Any), ("iconEmojiId", _data.iconEmojiId as Any), ("topMessage", _data.topMessage as Any), ("readInboxMaxId", _data.readInboxMaxId as Any), ("readOutboxMaxId", _data.readOutboxMaxId as Any), ("unreadCount", _data.unreadCount as Any), ("unreadMentionsCount", _data.unreadMentionsCount as Any), ("unreadReactionsCount", _data.unreadReactionsCount as Any), ("unreadPollVotesCount", _data.unreadPollVotesCount as Any), ("fromId", _data.fromId as Any), ("notifySettings", _data.notifySettings as Any), ("draft", _data.draft as Any)]) + return ("forumTopic", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("date", ConstructorParameterDescription(_data.date)), ("peer", ConstructorParameterDescription(_data.peer)), ("title", ConstructorParameterDescription(_data.title)), ("iconColor", ConstructorParameterDescription(_data.iconColor)), ("iconEmojiId", ConstructorParameterDescription(_data.iconEmojiId)), ("topMessage", ConstructorParameterDescription(_data.topMessage)), ("readInboxMaxId", ConstructorParameterDescription(_data.readInboxMaxId)), ("readOutboxMaxId", ConstructorParameterDescription(_data.readOutboxMaxId)), ("unreadCount", ConstructorParameterDescription(_data.unreadCount)), ("unreadMentionsCount", ConstructorParameterDescription(_data.unreadMentionsCount)), ("unreadReactionsCount", ConstructorParameterDescription(_data.unreadReactionsCount)), ("unreadPollVotesCount", ConstructorParameterDescription(_data.unreadPollVotesCount)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("notifySettings", ConstructorParameterDescription(_data.notifySettings)), ("draft", ConstructorParameterDescription(_data.draft))]) case .forumTopicDeleted(let _data): - return ("forumTopicDeleted", [("id", _data.id as Any)]) + return ("forumTopicDeleted", [("id", ConstructorParameterDescription(_data.id))]) } } @@ -1319,8 +1319,8 @@ public extension Api { self.peer = peer self.story = story } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("foundStory", [("peer", self.peer as Any), ("story", self.story as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("foundStory", [("peer", ConstructorParameterDescription(self.peer)), ("story", ConstructorParameterDescription(self.story))]) } } case foundStory(Cons_foundStory) @@ -1337,10 +1337,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .foundStory(let _data): - return ("foundStory", [("peer", _data.peer as Any), ("story", _data.story as Any)]) + return ("foundStory", [("peer", ConstructorParameterDescription(_data.peer)), ("story", ConstructorParameterDescription(_data.story))]) } } @@ -1385,8 +1385,8 @@ public extension Api { self.photo = photo self.document = document } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("game", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("shortName", self.shortName as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("document", self.document as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("game", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("shortName", ConstructorParameterDescription(self.shortName)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("document", ConstructorParameterDescription(self.document))]) } } case game(Cons_game) @@ -1411,10 +1411,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .game(let _data): - return ("game", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("shortName", _data.shortName as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("document", _data.document as Any)]) + return ("game", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("shortName", ConstructorParameterDescription(_data.shortName)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("document", ConstructorParameterDescription(_data.document))]) } } @@ -1473,8 +1473,8 @@ public extension Api { self.accessHash = accessHash self.accuracyRadius = accuracyRadius } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("geoPoint", [("flags", self.flags as Any), ("long", self.long as Any), ("lat", self.lat as Any), ("accessHash", self.accessHash as Any), ("accuracyRadius", self.accuracyRadius as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("geoPoint", [("flags", ConstructorParameterDescription(self.flags)), ("long", ConstructorParameterDescription(self.long)), ("lat", ConstructorParameterDescription(self.lat)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("accuracyRadius", ConstructorParameterDescription(self.accuracyRadius))]) } } case geoPoint(Cons_geoPoint) @@ -1502,10 +1502,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .geoPoint(let _data): - return ("geoPoint", [("flags", _data.flags as Any), ("long", _data.long as Any), ("lat", _data.lat as Any), ("accessHash", _data.accessHash as Any), ("accuracyRadius", _data.accuracyRadius as Any)]) + return ("geoPoint", [("flags", ConstructorParameterDescription(_data.flags)), ("long", ConstructorParameterDescription(_data.long)), ("lat", ConstructorParameterDescription(_data.lat)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("accuracyRadius", ConstructorParameterDescription(_data.accuracyRadius))]) case .geoPointEmpty: return ("geoPointEmpty", []) } @@ -1556,8 +1556,8 @@ public extension Api { self.city = city self.street = street } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("geoPointAddress", [("flags", self.flags as Any), ("countryIso2", self.countryIso2 as Any), ("state", self.state as Any), ("city", self.city as Any), ("street", self.street as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("geoPointAddress", [("flags", ConstructorParameterDescription(self.flags)), ("countryIso2", ConstructorParameterDescription(self.countryIso2)), ("state", ConstructorParameterDescription(self.state)), ("city", ConstructorParameterDescription(self.city)), ("street", ConstructorParameterDescription(self.street))]) } } case geoPointAddress(Cons_geoPointAddress) @@ -1583,10 +1583,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .geoPointAddress(let _data): - return ("geoPointAddress", [("flags", _data.flags as Any), ("countryIso2", _data.countryIso2 as Any), ("state", _data.state as Any), ("city", _data.city as Any), ("street", _data.street as Any)]) + return ("geoPointAddress", [("flags", ConstructorParameterDescription(_data.flags)), ("countryIso2", ConstructorParameterDescription(_data.countryIso2)), ("state", ConstructorParameterDescription(_data.state)), ("city", ConstructorParameterDescription(_data.city)), ("street", ConstructorParameterDescription(_data.street))]) } } @@ -1632,8 +1632,8 @@ public extension Api { self.noncontactPeersPaidStars = noncontactPeersPaidStars self.disallowedGifts = disallowedGifts } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("globalPrivacySettings", [("flags", self.flags as Any), ("noncontactPeersPaidStars", self.noncontactPeersPaidStars as Any), ("disallowedGifts", self.disallowedGifts as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("globalPrivacySettings", [("flags", ConstructorParameterDescription(self.flags)), ("noncontactPeersPaidStars", ConstructorParameterDescription(self.noncontactPeersPaidStars)), ("disallowedGifts", ConstructorParameterDescription(self.disallowedGifts))]) } } case globalPrivacySettings(Cons_globalPrivacySettings) @@ -1655,10 +1655,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .globalPrivacySettings(let _data): - return ("globalPrivacySettings", [("flags", _data.flags as Any), ("noncontactPeersPaidStars", _data.noncontactPeersPaidStars as Any), ("disallowedGifts", _data.disallowedGifts as Any)]) + return ("globalPrivacySettings", [("flags", ConstructorParameterDescription(_data.flags)), ("noncontactPeersPaidStars", ConstructorParameterDescription(_data.noncontactPeersPaidStars)), ("disallowedGifts", ConstructorParameterDescription(_data.disallowedGifts))]) } } @@ -1720,8 +1720,8 @@ public extension Api { self.sendPaidMessagesStars = sendPaidMessagesStars self.defaultSendAs = defaultSendAs } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCall", [("flags", self.flags as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any), ("participantsCount", self.participantsCount as Any), ("title", self.title as Any), ("streamDcId", self.streamDcId as Any), ("recordStartDate", self.recordStartDate as Any), ("scheduleDate", self.scheduleDate as Any), ("unmutedVideoCount", self.unmutedVideoCount as Any), ("unmutedVideoLimit", self.unmutedVideoLimit as Any), ("version", self.version as Any), ("inviteLink", self.inviteLink as Any), ("sendPaidMessagesStars", self.sendPaidMessagesStars as Any), ("defaultSendAs", self.defaultSendAs as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCall", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("participantsCount", ConstructorParameterDescription(self.participantsCount)), ("title", ConstructorParameterDescription(self.title)), ("streamDcId", ConstructorParameterDescription(self.streamDcId)), ("recordStartDate", ConstructorParameterDescription(self.recordStartDate)), ("scheduleDate", ConstructorParameterDescription(self.scheduleDate)), ("unmutedVideoCount", ConstructorParameterDescription(self.unmutedVideoCount)), ("unmutedVideoLimit", ConstructorParameterDescription(self.unmutedVideoLimit)), ("version", ConstructorParameterDescription(self.version)), ("inviteLink", ConstructorParameterDescription(self.inviteLink)), ("sendPaidMessagesStars", ConstructorParameterDescription(self.sendPaidMessagesStars)), ("defaultSendAs", ConstructorParameterDescription(self.defaultSendAs))]) } } public class Cons_groupCallDiscarded: TypeConstructorDescription { @@ -1733,8 +1733,8 @@ public extension Api { self.accessHash = accessHash self.duration = duration } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallDiscarded", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("duration", self.duration as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallDiscarded", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("duration", ConstructorParameterDescription(self.duration))]) } } case groupCall(Cons_groupCall) @@ -1788,12 +1788,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCall(let _data): - return ("groupCall", [("flags", _data.flags as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("participantsCount", _data.participantsCount as Any), ("title", _data.title as Any), ("streamDcId", _data.streamDcId as Any), ("recordStartDate", _data.recordStartDate as Any), ("scheduleDate", _data.scheduleDate as Any), ("unmutedVideoCount", _data.unmutedVideoCount as Any), ("unmutedVideoLimit", _data.unmutedVideoLimit as Any), ("version", _data.version as Any), ("inviteLink", _data.inviteLink as Any), ("sendPaidMessagesStars", _data.sendPaidMessagesStars as Any), ("defaultSendAs", _data.defaultSendAs as Any)]) + return ("groupCall", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("participantsCount", ConstructorParameterDescription(_data.participantsCount)), ("title", ConstructorParameterDescription(_data.title)), ("streamDcId", ConstructorParameterDescription(_data.streamDcId)), ("recordStartDate", ConstructorParameterDescription(_data.recordStartDate)), ("scheduleDate", ConstructorParameterDescription(_data.scheduleDate)), ("unmutedVideoCount", ConstructorParameterDescription(_data.unmutedVideoCount)), ("unmutedVideoLimit", ConstructorParameterDescription(_data.unmutedVideoLimit)), ("version", ConstructorParameterDescription(_data.version)), ("inviteLink", ConstructorParameterDescription(_data.inviteLink)), ("sendPaidMessagesStars", ConstructorParameterDescription(_data.sendPaidMessagesStars)), ("defaultSendAs", ConstructorParameterDescription(_data.defaultSendAs))]) case .groupCallDiscarded(let _data): - return ("groupCallDiscarded", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("duration", _data.duration as Any)]) + return ("groupCallDiscarded", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("duration", ConstructorParameterDescription(_data.duration))]) } } @@ -1895,8 +1895,8 @@ public extension Api { self.peerId = peerId self.stars = stars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallDonor", [("flags", self.flags as Any), ("peerId", self.peerId as Any), ("stars", self.stars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallDonor", [("flags", ConstructorParameterDescription(self.flags)), ("peerId", ConstructorParameterDescription(self.peerId)), ("stars", ConstructorParameterDescription(self.stars))]) } } case groupCallDonor(Cons_groupCallDonor) @@ -1916,10 +1916,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallDonor(let _data): - return ("groupCallDonor", [("flags", _data.flags as Any), ("peerId", _data.peerId as Any), ("stars", _data.stars as Any)]) + return ("groupCallDonor", [("flags", ConstructorParameterDescription(_data.flags)), ("peerId", ConstructorParameterDescription(_data.peerId)), ("stars", ConstructorParameterDescription(_data.stars))]) } } @@ -1963,8 +1963,8 @@ public extension Api { self.message = message self.paidMessageStars = paidMessageStars } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallMessage", [("flags", self.flags as Any), ("id", self.id as Any), ("fromId", self.fromId as Any), ("date", self.date as Any), ("message", self.message as Any), ("paidMessageStars", self.paidMessageStars as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallMessage", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("fromId", ConstructorParameterDescription(self.fromId)), ("date", ConstructorParameterDescription(self.date)), ("message", ConstructorParameterDescription(self.message)), ("paidMessageStars", ConstructorParameterDescription(self.paidMessageStars))]) } } case groupCallMessage(Cons_groupCallMessage) @@ -1987,10 +1987,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallMessage(let _data): - return ("groupCallMessage", [("flags", _data.flags as Any), ("id", _data.id as Any), ("fromId", _data.fromId as Any), ("date", _data.date as Any), ("message", _data.message as Any), ("paidMessageStars", _data.paidMessageStars as Any)]) + return ("groupCallMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("fromId", ConstructorParameterDescription(_data.fromId)), ("date", ConstructorParameterDescription(_data.date)), ("message", ConstructorParameterDescription(_data.message)), ("paidMessageStars", ConstructorParameterDescription(_data.paidMessageStars))]) } } diff --git a/submodules/TelegramApi/Sources/Api8.swift b/submodules/TelegramApi/Sources/Api8.swift index a09f994b5b..0a41db4fc6 100644 --- a/submodules/TelegramApi/Sources/Api8.swift +++ b/submodules/TelegramApi/Sources/Api8.swift @@ -25,8 +25,8 @@ public extension Api { self.presentation = presentation self.paidStarsTotal = paidStarsTotal } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallParticipant", [("flags", self.flags as Any), ("peer", self.peer as Any), ("date", self.date as Any), ("activeDate", self.activeDate as Any), ("source", self.source as Any), ("volume", self.volume as Any), ("about", self.about as Any), ("raiseHandRating", self.raiseHandRating as Any), ("video", self.video as Any), ("presentation", self.presentation as Any), ("paidStarsTotal", self.paidStarsTotal as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallParticipant", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("date", ConstructorParameterDescription(self.date)), ("activeDate", ConstructorParameterDescription(self.activeDate)), ("source", ConstructorParameterDescription(self.source)), ("volume", ConstructorParameterDescription(self.volume)), ("about", ConstructorParameterDescription(self.about)), ("raiseHandRating", ConstructorParameterDescription(self.raiseHandRating)), ("video", ConstructorParameterDescription(self.video)), ("presentation", ConstructorParameterDescription(self.presentation)), ("paidStarsTotal", ConstructorParameterDescription(self.paidStarsTotal))]) } } case groupCallParticipant(Cons_groupCallParticipant) @@ -66,10 +66,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallParticipant(let _data): - return ("groupCallParticipant", [("flags", _data.flags as Any), ("peer", _data.peer as Any), ("date", _data.date as Any), ("activeDate", _data.activeDate as Any), ("source", _data.source as Any), ("volume", _data.volume as Any), ("about", _data.about as Any), ("raiseHandRating", _data.raiseHandRating as Any), ("video", _data.video as Any), ("presentation", _data.presentation as Any), ("paidStarsTotal", _data.paidStarsTotal as Any)]) + return ("groupCallParticipant", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("date", ConstructorParameterDescription(_data.date)), ("activeDate", ConstructorParameterDescription(_data.activeDate)), ("source", ConstructorParameterDescription(_data.source)), ("volume", ConstructorParameterDescription(_data.volume)), ("about", ConstructorParameterDescription(_data.about)), ("raiseHandRating", ConstructorParameterDescription(_data.raiseHandRating)), ("video", ConstructorParameterDescription(_data.video)), ("presentation", ConstructorParameterDescription(_data.presentation)), ("paidStarsTotal", ConstructorParameterDescription(_data.paidStarsTotal))]) } } @@ -149,8 +149,8 @@ public extension Api { self.sourceGroups = sourceGroups self.audioSource = audioSource } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallParticipantVideo", [("flags", self.flags as Any), ("endpoint", self.endpoint as Any), ("sourceGroups", self.sourceGroups as Any), ("audioSource", self.audioSource as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallParticipantVideo", [("flags", ConstructorParameterDescription(self.flags)), ("endpoint", ConstructorParameterDescription(self.endpoint)), ("sourceGroups", ConstructorParameterDescription(self.sourceGroups)), ("audioSource", ConstructorParameterDescription(self.audioSource))]) } } case groupCallParticipantVideo(Cons_groupCallParticipantVideo) @@ -175,10 +175,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallParticipantVideo(let _data): - return ("groupCallParticipantVideo", [("flags", _data.flags as Any), ("endpoint", _data.endpoint as Any), ("sourceGroups", _data.sourceGroups as Any), ("audioSource", _data.audioSource as Any)]) + return ("groupCallParticipantVideo", [("flags", ConstructorParameterDescription(_data.flags)), ("endpoint", ConstructorParameterDescription(_data.endpoint)), ("sourceGroups", ConstructorParameterDescription(_data.sourceGroups)), ("audioSource", ConstructorParameterDescription(_data.audioSource))]) } } @@ -217,8 +217,8 @@ public extension Api { self.semantics = semantics self.sources = sources } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallParticipantVideoSourceGroup", [("semantics", self.semantics as Any), ("sources", self.sources as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallParticipantVideoSourceGroup", [("semantics", ConstructorParameterDescription(self.semantics)), ("sources", ConstructorParameterDescription(self.sources))]) } } case groupCallParticipantVideoSourceGroup(Cons_groupCallParticipantVideoSourceGroup) @@ -239,10 +239,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallParticipantVideoSourceGroup(let _data): - return ("groupCallParticipantVideoSourceGroup", [("semantics", _data.semantics as Any), ("sources", _data.sources as Any)]) + return ("groupCallParticipantVideoSourceGroup", [("semantics", ConstructorParameterDescription(_data.semantics)), ("sources", ConstructorParameterDescription(_data.sources))]) } } @@ -275,8 +275,8 @@ public extension Api { self.scale = scale self.lastTimestampMs = lastTimestampMs } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("groupCallStreamChannel", [("channel", self.channel as Any), ("scale", self.scale as Any), ("lastTimestampMs", self.lastTimestampMs as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("groupCallStreamChannel", [("channel", ConstructorParameterDescription(self.channel)), ("scale", ConstructorParameterDescription(self.scale)), ("lastTimestampMs", ConstructorParameterDescription(self.lastTimestampMs))]) } } case groupCallStreamChannel(Cons_groupCallStreamChannel) @@ -294,10 +294,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .groupCallStreamChannel(let _data): - return ("groupCallStreamChannel", [("channel", _data.channel as Any), ("scale", _data.scale as Any), ("lastTimestampMs", _data.lastTimestampMs as Any)]) + return ("groupCallStreamChannel", [("channel", ConstructorParameterDescription(_data.channel)), ("scale", ConstructorParameterDescription(_data.scale)), ("lastTimestampMs", ConstructorParameterDescription(_data.lastTimestampMs))]) } } @@ -331,8 +331,8 @@ public extension Api { self.userId = userId self.score = score } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("highScore", [("pos", self.pos as Any), ("userId", self.userId as Any), ("score", self.score as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("highScore", [("pos", ConstructorParameterDescription(self.pos)), ("userId", ConstructorParameterDescription(self.userId)), ("score", ConstructorParameterDescription(self.score))]) } } case highScore(Cons_highScore) @@ -350,10 +350,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .highScore(let _data): - return ("highScore", [("pos", _data.pos as Any), ("userId", _data.userId as Any), ("score", _data.score as Any)]) + return ("highScore", [("pos", ConstructorParameterDescription(_data.pos)), ("userId", ConstructorParameterDescription(_data.userId)), ("score", ConstructorParameterDescription(_data.score))]) } } @@ -385,8 +385,8 @@ public extension Api { self.userId = userId self.clientId = clientId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("importedContact", [("userId", self.userId as Any), ("clientId", self.clientId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("importedContact", [("userId", ConstructorParameterDescription(self.userId)), ("clientId", ConstructorParameterDescription(self.clientId))]) } } case importedContact(Cons_importedContact) @@ -403,10 +403,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .importedContact(let _data): - return ("importedContact", [("userId", _data.userId as Any), ("clientId", _data.clientId as Any)]) + return ("importedContact", [("userId", ConstructorParameterDescription(_data.userId)), ("clientId", ConstructorParameterDescription(_data.clientId))]) } } @@ -435,8 +435,8 @@ public extension Api { self.text = text self.startParam = startParam } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inlineBotSwitchPM", [("text", self.text as Any), ("startParam", self.startParam as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inlineBotSwitchPM", [("text", ConstructorParameterDescription(self.text)), ("startParam", ConstructorParameterDescription(self.startParam))]) } } case inlineBotSwitchPM(Cons_inlineBotSwitchPM) @@ -453,10 +453,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inlineBotSwitchPM(let _data): - return ("inlineBotSwitchPM", [("text", _data.text as Any), ("startParam", _data.startParam as Any)]) + return ("inlineBotSwitchPM", [("text", ConstructorParameterDescription(_data.text)), ("startParam", ConstructorParameterDescription(_data.startParam))]) } } @@ -485,8 +485,8 @@ public extension Api { self.text = text self.url = url } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inlineBotWebView", [("text", self.text as Any), ("url", self.url as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inlineBotWebView", [("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url))]) } } case inlineBotWebView(Cons_inlineBotWebView) @@ -503,10 +503,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inlineBotWebView(let _data): - return ("inlineBotWebView", [("text", _data.text as Any), ("url", _data.url as Any)]) + return ("inlineBotWebView", [("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))]) } } @@ -570,7 +570,7 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inlineQueryPeerTypeBotPM: return ("inlineQueryPeerTypeBotPM", []) @@ -620,8 +620,8 @@ public extension Api { self.peer = peer self.data = data } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputAppEvent", [("time", self.time as Any), ("type", self.type as Any), ("peer", self.peer as Any), ("data", self.data as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputAppEvent", [("time", ConstructorParameterDescription(self.time)), ("type", ConstructorParameterDescription(self.type)), ("peer", ConstructorParameterDescription(self.peer)), ("data", ConstructorParameterDescription(self.data))]) } } case inputAppEvent(Cons_inputAppEvent) @@ -640,10 +640,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputAppEvent(let _data): - return ("inputAppEvent", [("time", _data.time as Any), ("type", _data.type as Any), ("peer", _data.peer as Any), ("data", _data.data as Any)]) + return ("inputAppEvent", [("time", ConstructorParameterDescription(_data.time)), ("type", ConstructorParameterDescription(_data.type)), ("peer", ConstructorParameterDescription(_data.peer)), ("data", ConstructorParameterDescription(_data.data))]) } } @@ -680,8 +680,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotAppID", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotAppID", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputBotAppShortName: TypeConstructorDescription { @@ -691,8 +691,8 @@ public extension Api { self.botId = botId self.shortName = shortName } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotAppShortName", [("botId", self.botId as Any), ("shortName", self.shortName as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotAppShortName", [("botId", ConstructorParameterDescription(self.botId)), ("shortName", ConstructorParameterDescription(self.shortName))]) } } case inputBotAppID(Cons_inputBotAppID) @@ -717,12 +717,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBotAppID(let _data): - return ("inputBotAppID", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputBotAppID", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputBotAppShortName(let _data): - return ("inputBotAppShortName", [("botId", _data.botId as Any), ("shortName", _data.shortName as Any)]) + return ("inputBotAppShortName", [("botId", ConstructorParameterDescription(_data.botId)), ("shortName", ConstructorParameterDescription(_data.shortName))]) } } @@ -767,8 +767,8 @@ public extension Api { self.flags = flags self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageGame", [("flags", self.flags as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageGame", [("flags", ConstructorParameterDescription(self.flags)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_inputBotInlineMessageMediaAuto: TypeConstructorDescription { @@ -782,8 +782,8 @@ public extension Api { self.entities = entities self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageMediaAuto", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageMediaAuto", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_inputBotInlineMessageMediaContact: TypeConstructorDescription { @@ -801,8 +801,8 @@ public extension Api { self.vcard = vcard self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageMediaContact", [("flags", self.flags as Any), ("phoneNumber", self.phoneNumber as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("vcard", self.vcard as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageMediaContact", [("flags", ConstructorParameterDescription(self.flags)), ("phoneNumber", ConstructorParameterDescription(self.phoneNumber)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("vcard", ConstructorParameterDescription(self.vcard)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_inputBotInlineMessageMediaGeo: TypeConstructorDescription { @@ -820,8 +820,8 @@ public extension Api { self.proximityNotificationRadius = proximityNotificationRadius self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageMediaGeo", [("flags", self.flags as Any), ("geoPoint", self.geoPoint as Any), ("heading", self.heading as Any), ("period", self.period as Any), ("proximityNotificationRadius", self.proximityNotificationRadius as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageMediaGeo", [("flags", ConstructorParameterDescription(self.flags)), ("geoPoint", ConstructorParameterDescription(self.geoPoint)), ("heading", ConstructorParameterDescription(self.heading)), ("period", ConstructorParameterDescription(self.period)), ("proximityNotificationRadius", ConstructorParameterDescription(self.proximityNotificationRadius)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_inputBotInlineMessageMediaInvoice: TypeConstructorDescription { @@ -845,8 +845,8 @@ public extension Api { self.providerData = providerData self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageMediaInvoice", [("flags", self.flags as Any), ("title", self.title as Any), ("description", self.description as Any), ("photo", self.photo as Any), ("invoice", self.invoice as Any), ("payload", self.payload as Any), ("provider", self.provider as Any), ("providerData", self.providerData as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageMediaInvoice", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photo", ConstructorParameterDescription(self.photo)), ("invoice", ConstructorParameterDescription(self.invoice)), ("payload", ConstructorParameterDescription(self.payload)), ("provider", ConstructorParameterDescription(self.provider)), ("providerData", ConstructorParameterDescription(self.providerData)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_inputBotInlineMessageMediaVenue: TypeConstructorDescription { @@ -868,8 +868,8 @@ public extension Api { self.venueType = venueType self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageMediaVenue", [("flags", self.flags as Any), ("geoPoint", self.geoPoint as Any), ("title", self.title as Any), ("address", self.address as Any), ("provider", self.provider as Any), ("venueId", self.venueId as Any), ("venueType", self.venueType as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageMediaVenue", [("flags", ConstructorParameterDescription(self.flags)), ("geoPoint", ConstructorParameterDescription(self.geoPoint)), ("title", ConstructorParameterDescription(self.title)), ("address", ConstructorParameterDescription(self.address)), ("provider", ConstructorParameterDescription(self.provider)), ("venueId", ConstructorParameterDescription(self.venueId)), ("venueType", ConstructorParameterDescription(self.venueType)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_inputBotInlineMessageMediaWebPage: TypeConstructorDescription { @@ -885,8 +885,8 @@ public extension Api { self.url = url self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageMediaWebPage", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("url", self.url as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageMediaWebPage", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("url", ConstructorParameterDescription(self.url)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } public class Cons_inputBotInlineMessageText: TypeConstructorDescription { @@ -900,8 +900,8 @@ public extension Api { self.entities = entities self.replyMarkup = replyMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageText", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("replyMarkup", self.replyMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageText", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))]) } } case inputBotInlineMessageGame(Cons_inputBotInlineMessageGame) @@ -1044,24 +1044,24 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBotInlineMessageGame(let _data): - return ("inputBotInlineMessageGame", [("flags", _data.flags as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageGame", [("flags", ConstructorParameterDescription(_data.flags)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .inputBotInlineMessageMediaAuto(let _data): - return ("inputBotInlineMessageMediaAuto", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageMediaAuto", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .inputBotInlineMessageMediaContact(let _data): - return ("inputBotInlineMessageMediaContact", [("flags", _data.flags as Any), ("phoneNumber", _data.phoneNumber as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("vcard", _data.vcard as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageMediaContact", [("flags", ConstructorParameterDescription(_data.flags)), ("phoneNumber", ConstructorParameterDescription(_data.phoneNumber)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("vcard", ConstructorParameterDescription(_data.vcard)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .inputBotInlineMessageMediaGeo(let _data): - return ("inputBotInlineMessageMediaGeo", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("heading", _data.heading as Any), ("period", _data.period as Any), ("proximityNotificationRadius", _data.proximityNotificationRadius as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageMediaGeo", [("flags", ConstructorParameterDescription(_data.flags)), ("geoPoint", ConstructorParameterDescription(_data.geoPoint)), ("heading", ConstructorParameterDescription(_data.heading)), ("period", ConstructorParameterDescription(_data.period)), ("proximityNotificationRadius", ConstructorParameterDescription(_data.proximityNotificationRadius)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .inputBotInlineMessageMediaInvoice(let _data): - return ("inputBotInlineMessageMediaInvoice", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("photo", _data.photo as Any), ("invoice", _data.invoice as Any), ("payload", _data.payload as Any), ("provider", _data.provider as Any), ("providerData", _data.providerData as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageMediaInvoice", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photo", ConstructorParameterDescription(_data.photo)), ("invoice", ConstructorParameterDescription(_data.invoice)), ("payload", ConstructorParameterDescription(_data.payload)), ("provider", ConstructorParameterDescription(_data.provider)), ("providerData", ConstructorParameterDescription(_data.providerData)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .inputBotInlineMessageMediaVenue(let _data): - return ("inputBotInlineMessageMediaVenue", [("flags", _data.flags as Any), ("geoPoint", _data.geoPoint as Any), ("title", _data.title as Any), ("address", _data.address as Any), ("provider", _data.provider as Any), ("venueId", _data.venueId as Any), ("venueType", _data.venueType as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageMediaVenue", [("flags", ConstructorParameterDescription(_data.flags)), ("geoPoint", ConstructorParameterDescription(_data.geoPoint)), ("title", ConstructorParameterDescription(_data.title)), ("address", ConstructorParameterDescription(_data.address)), ("provider", ConstructorParameterDescription(_data.provider)), ("venueId", ConstructorParameterDescription(_data.venueId)), ("venueType", ConstructorParameterDescription(_data.venueType)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .inputBotInlineMessageMediaWebPage(let _data): - return ("inputBotInlineMessageMediaWebPage", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("url", _data.url as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageMediaWebPage", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("url", ConstructorParameterDescription(_data.url)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) case .inputBotInlineMessageText(let _data): - return ("inputBotInlineMessageText", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("replyMarkup", _data.replyMarkup as Any)]) + return ("inputBotInlineMessageText", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))]) } } @@ -1336,8 +1336,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageID", [("dcId", self.dcId as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageID", [("dcId", ConstructorParameterDescription(self.dcId)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputBotInlineMessageID64: TypeConstructorDescription { @@ -1351,8 +1351,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineMessageID64", [("dcId", self.dcId as Any), ("ownerId", self.ownerId as Any), ("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineMessageID64", [("dcId", ConstructorParameterDescription(self.dcId)), ("ownerId", ConstructorParameterDescription(self.ownerId)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } case inputBotInlineMessageID(Cons_inputBotInlineMessageID) @@ -1380,12 +1380,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBotInlineMessageID(let _data): - return ("inputBotInlineMessageID", [("dcId", _data.dcId as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputBotInlineMessageID", [("dcId", ConstructorParameterDescription(_data.dcId)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputBotInlineMessageID64(let _data): - return ("inputBotInlineMessageID64", [("dcId", _data.dcId as Any), ("ownerId", _data.ownerId as Any), ("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputBotInlineMessageID64", [("dcId", ConstructorParameterDescription(_data.dcId)), ("ownerId", ConstructorParameterDescription(_data.ownerId)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) } } @@ -1451,8 +1451,8 @@ public extension Api { self.content = content self.sendMessage = sendMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineResult", [("flags", self.flags as Any), ("id", self.id as Any), ("type", self.type as Any), ("title", self.title as Any), ("description", self.description as Any), ("url", self.url as Any), ("thumb", self.thumb as Any), ("content", self.content as Any), ("sendMessage", self.sendMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineResult", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("type", ConstructorParameterDescription(self.type)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("url", ConstructorParameterDescription(self.url)), ("thumb", ConstructorParameterDescription(self.thumb)), ("content", ConstructorParameterDescription(self.content)), ("sendMessage", ConstructorParameterDescription(self.sendMessage))]) } } public class Cons_inputBotInlineResultDocument: TypeConstructorDescription { @@ -1472,8 +1472,8 @@ public extension Api { self.document = document self.sendMessage = sendMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineResultDocument", [("flags", self.flags as Any), ("id", self.id as Any), ("type", self.type as Any), ("title", self.title as Any), ("description", self.description as Any), ("document", self.document as Any), ("sendMessage", self.sendMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineResultDocument", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("type", ConstructorParameterDescription(self.type)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("document", ConstructorParameterDescription(self.document)), ("sendMessage", ConstructorParameterDescription(self.sendMessage))]) } } public class Cons_inputBotInlineResultGame: TypeConstructorDescription { @@ -1485,8 +1485,8 @@ public extension Api { self.shortName = shortName self.sendMessage = sendMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineResultGame", [("id", self.id as Any), ("shortName", self.shortName as Any), ("sendMessage", self.sendMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineResultGame", [("id", ConstructorParameterDescription(self.id)), ("shortName", ConstructorParameterDescription(self.shortName)), ("sendMessage", ConstructorParameterDescription(self.sendMessage))]) } } public class Cons_inputBotInlineResultPhoto: TypeConstructorDescription { @@ -1500,8 +1500,8 @@ public extension Api { self.photo = photo self.sendMessage = sendMessage } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBotInlineResultPhoto", [("id", self.id as Any), ("type", self.type as Any), ("photo", self.photo as Any), ("sendMessage", self.sendMessage as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBotInlineResultPhoto", [("id", ConstructorParameterDescription(self.id)), ("type", ConstructorParameterDescription(self.type)), ("photo", ConstructorParameterDescription(self.photo)), ("sendMessage", ConstructorParameterDescription(self.sendMessage))]) } } case inputBotInlineResult(Cons_inputBotInlineResult) @@ -1571,16 +1571,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBotInlineResult(let _data): - return ("inputBotInlineResult", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("url", _data.url as Any), ("thumb", _data.thumb as Any), ("content", _data.content as Any), ("sendMessage", _data.sendMessage as Any)]) + return ("inputBotInlineResult", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("type", ConstructorParameterDescription(_data.type)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("url", ConstructorParameterDescription(_data.url)), ("thumb", ConstructorParameterDescription(_data.thumb)), ("content", ConstructorParameterDescription(_data.content)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))]) case .inputBotInlineResultDocument(let _data): - return ("inputBotInlineResultDocument", [("flags", _data.flags as Any), ("id", _data.id as Any), ("type", _data.type as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("document", _data.document as Any), ("sendMessage", _data.sendMessage as Any)]) + return ("inputBotInlineResultDocument", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("type", ConstructorParameterDescription(_data.type)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("document", ConstructorParameterDescription(_data.document)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))]) case .inputBotInlineResultGame(let _data): - return ("inputBotInlineResultGame", [("id", _data.id as Any), ("shortName", _data.shortName as Any), ("sendMessage", _data.sendMessage as Any)]) + return ("inputBotInlineResultGame", [("id", ConstructorParameterDescription(_data.id)), ("shortName", ConstructorParameterDescription(_data.shortName)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))]) case .inputBotInlineResultPhoto(let _data): - return ("inputBotInlineResultPhoto", [("id", _data.id as Any), ("type", _data.type as Any), ("photo", _data.photo as Any), ("sendMessage", _data.sendMessage as Any)]) + return ("inputBotInlineResultPhoto", [("id", ConstructorParameterDescription(_data.id)), ("type", ConstructorParameterDescription(_data.type)), ("photo", ConstructorParameterDescription(_data.photo)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))]) } } @@ -1730,8 +1730,8 @@ public extension Api { self.schedule = schedule self.recipients = recipients } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBusinessAwayMessage", [("flags", self.flags as Any), ("shortcutId", self.shortcutId as Any), ("schedule", self.schedule as Any), ("recipients", self.recipients as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBusinessAwayMessage", [("flags", ConstructorParameterDescription(self.flags)), ("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("schedule", ConstructorParameterDescription(self.schedule)), ("recipients", ConstructorParameterDescription(self.recipients))]) } } case inputBusinessAwayMessage(Cons_inputBusinessAwayMessage) @@ -1750,10 +1750,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBusinessAwayMessage(let _data): - return ("inputBusinessAwayMessage", [("flags", _data.flags as Any), ("shortcutId", _data.shortcutId as Any), ("schedule", _data.schedule as Any), ("recipients", _data.recipients as Any)]) + return ("inputBusinessAwayMessage", [("flags", ConstructorParameterDescription(_data.flags)), ("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("schedule", ConstructorParameterDescription(_data.schedule)), ("recipients", ConstructorParameterDescription(_data.recipients))]) } } diff --git a/submodules/TelegramApi/Sources/Api9.swift b/submodules/TelegramApi/Sources/Api9.swift index c2c1716eff..c31a55774b 100644 --- a/submodules/TelegramApi/Sources/Api9.swift +++ b/submodules/TelegramApi/Sources/Api9.swift @@ -9,8 +9,8 @@ public extension Api { self.users = users self.excludeUsers = excludeUsers } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBusinessBotRecipients", [("flags", self.flags as Any), ("users", self.users as Any), ("excludeUsers", self.excludeUsers as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBusinessBotRecipients", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users)), ("excludeUsers", ConstructorParameterDescription(self.excludeUsers))]) } } case inputBusinessBotRecipients(Cons_inputBusinessBotRecipients) @@ -40,10 +40,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBusinessBotRecipients(let _data): - return ("inputBusinessBotRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any), ("excludeUsers", _data.excludeUsers as Any)]) + return ("inputBusinessBotRecipients", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users)), ("excludeUsers", ConstructorParameterDescription(_data.excludeUsers))]) } } @@ -87,8 +87,8 @@ public extension Api { self.entities = entities self.title = title } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBusinessChatLink", [("flags", self.flags as Any), ("message", self.message as Any), ("entities", self.entities as Any), ("title", self.title as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBusinessChatLink", [("flags", ConstructorParameterDescription(self.flags)), ("message", ConstructorParameterDescription(self.message)), ("entities", ConstructorParameterDescription(self.entities)), ("title", ConstructorParameterDescription(self.title))]) } } case inputBusinessChatLink(Cons_inputBusinessChatLink) @@ -115,10 +115,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBusinessChatLink(let _data): - return ("inputBusinessChatLink", [("flags", _data.flags as Any), ("message", _data.message as Any), ("entities", _data.entities as Any), ("title", _data.title as Any)]) + return ("inputBusinessChatLink", [("flags", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("title", ConstructorParameterDescription(_data.title))]) } } @@ -161,8 +161,8 @@ public extension Api { self.recipients = recipients self.noActivityDays = noActivityDays } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBusinessGreetingMessage", [("shortcutId", self.shortcutId as Any), ("recipients", self.recipients as Any), ("noActivityDays", self.noActivityDays as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBusinessGreetingMessage", [("shortcutId", ConstructorParameterDescription(self.shortcutId)), ("recipients", ConstructorParameterDescription(self.recipients)), ("noActivityDays", ConstructorParameterDescription(self.noActivityDays))]) } } case inputBusinessGreetingMessage(Cons_inputBusinessGreetingMessage) @@ -180,10 +180,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBusinessGreetingMessage(let _data): - return ("inputBusinessGreetingMessage", [("shortcutId", _data.shortcutId as Any), ("recipients", _data.recipients as Any), ("noActivityDays", _data.noActivityDays as Any)]) + return ("inputBusinessGreetingMessage", [("shortcutId", ConstructorParameterDescription(_data.shortcutId)), ("recipients", ConstructorParameterDescription(_data.recipients)), ("noActivityDays", ConstructorParameterDescription(_data.noActivityDays))]) } } @@ -221,8 +221,8 @@ public extension Api { self.description = description self.sticker = sticker } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBusinessIntro", [("flags", self.flags as Any), ("title", self.title as Any), ("description", self.description as Any), ("sticker", self.sticker as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBusinessIntro", [("flags", ConstructorParameterDescription(self.flags)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("sticker", ConstructorParameterDescription(self.sticker))]) } } case inputBusinessIntro(Cons_inputBusinessIntro) @@ -243,10 +243,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBusinessIntro(let _data): - return ("inputBusinessIntro", [("flags", _data.flags as Any), ("title", _data.title as Any), ("description", _data.description as Any), ("sticker", _data.sticker as Any)]) + return ("inputBusinessIntro", [("flags", ConstructorParameterDescription(_data.flags)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("sticker", ConstructorParameterDescription(_data.sticker))]) } } @@ -285,8 +285,8 @@ public extension Api { self.flags = flags self.users = users } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputBusinessRecipients", [("flags", self.flags as Any), ("users", self.users as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputBusinessRecipients", [("flags", ConstructorParameterDescription(self.flags)), ("users", ConstructorParameterDescription(self.users))]) } } case inputBusinessRecipients(Cons_inputBusinessRecipients) @@ -309,10 +309,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputBusinessRecipients(let _data): - return ("inputBusinessRecipients", [("flags", _data.flags as Any), ("users", _data.users as Any)]) + return ("inputBusinessRecipients", [("flags", ConstructorParameterDescription(_data.flags)), ("users", ConstructorParameterDescription(_data.users))]) } } @@ -345,8 +345,8 @@ public extension Api { self.channelId = channelId self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputChannel", [("channelId", self.channelId as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputChannel", [("channelId", ConstructorParameterDescription(self.channelId)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputChannelFromMessage: TypeConstructorDescription { @@ -358,8 +358,8 @@ public extension Api { self.msgId = msgId self.channelId = channelId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputChannelFromMessage", [("peer", self.peer as Any), ("msgId", self.msgId as Any), ("channelId", self.channelId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputChannelFromMessage", [("peer", ConstructorParameterDescription(self.peer)), ("msgId", ConstructorParameterDescription(self.msgId)), ("channelId", ConstructorParameterDescription(self.channelId))]) } } case inputChannel(Cons_inputChannel) @@ -391,14 +391,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputChannel(let _data): - return ("inputChannel", [("channelId", _data.channelId as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputChannel", [("channelId", ConstructorParameterDescription(_data.channelId)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputChannelEmpty: return ("inputChannelEmpty", []) case .inputChannelFromMessage(let _data): - return ("inputChannelFromMessage", [("peer", _data.peer as Any), ("msgId", _data.msgId as Any), ("channelId", _data.channelId as Any)]) + return ("inputChannelFromMessage", [("peer", ConstructorParameterDescription(_data.peer)), ("msgId", ConstructorParameterDescription(_data.msgId)), ("channelId", ConstructorParameterDescription(_data.channelId))]) } } @@ -447,8 +447,8 @@ public extension Api { public init(id: Api.InputPhoto) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputChatPhoto", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputChatPhoto", [("id", ConstructorParameterDescription(self.id))]) } } public class Cons_inputChatUploadedPhoto: TypeConstructorDescription { @@ -464,8 +464,8 @@ public extension Api { self.videoStartTs = videoStartTs self.videoEmojiMarkup = videoEmojiMarkup } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputChatUploadedPhoto", [("flags", self.flags as Any), ("file", self.file as Any), ("video", self.video as Any), ("videoStartTs", self.videoStartTs as Any), ("videoEmojiMarkup", self.videoEmojiMarkup as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputChatUploadedPhoto", [("flags", ConstructorParameterDescription(self.flags)), ("file", ConstructorParameterDescription(self.file)), ("video", ConstructorParameterDescription(self.video)), ("videoStartTs", ConstructorParameterDescription(self.videoStartTs)), ("videoEmojiMarkup", ConstructorParameterDescription(self.videoEmojiMarkup))]) } } case inputChatPhoto(Cons_inputChatPhoto) @@ -506,14 +506,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputChatPhoto(let _data): - return ("inputChatPhoto", [("id", _data.id as Any)]) + return ("inputChatPhoto", [("id", ConstructorParameterDescription(_data.id))]) case .inputChatPhotoEmpty: return ("inputChatPhotoEmpty", []) case .inputChatUploadedPhoto(let _data): - return ("inputChatUploadedPhoto", [("flags", _data.flags as Any), ("file", _data.file as Any), ("video", _data.video as Any), ("videoStartTs", _data.videoStartTs as Any), ("videoEmojiMarkup", _data.videoEmojiMarkup as Any)]) + return ("inputChatUploadedPhoto", [("flags", ConstructorParameterDescription(_data.flags)), ("file", ConstructorParameterDescription(_data.file)), ("video", ConstructorParameterDescription(_data.video)), ("videoStartTs", ConstructorParameterDescription(_data.videoStartTs)), ("videoEmojiMarkup", ConstructorParameterDescription(_data.videoEmojiMarkup))]) } } @@ -579,8 +579,8 @@ public extension Api { public init(emoticon: String) { self.emoticon = emoticon } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputChatTheme", [("emoticon", self.emoticon as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputChatTheme", [("emoticon", ConstructorParameterDescription(self.emoticon))]) } } public class Cons_inputChatThemeUniqueGift: TypeConstructorDescription { @@ -588,8 +588,8 @@ public extension Api { public init(slug: String) { self.slug = slug } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputChatThemeUniqueGift", [("slug", self.slug as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputChatThemeUniqueGift", [("slug", ConstructorParameterDescription(self.slug))]) } } case inputChatTheme(Cons_inputChatTheme) @@ -618,14 +618,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputChatTheme(let _data): - return ("inputChatTheme", [("emoticon", _data.emoticon as Any)]) + return ("inputChatTheme", [("emoticon", ConstructorParameterDescription(_data.emoticon))]) case .inputChatThemeEmpty: return ("inputChatThemeEmpty", []) case .inputChatThemeUniqueGift(let _data): - return ("inputChatThemeUniqueGift", [("slug", _data.slug as Any)]) + return ("inputChatThemeUniqueGift", [("slug", ConstructorParameterDescription(_data.slug))]) } } @@ -663,8 +663,8 @@ public extension Api { public init(filterId: Int32) { self.filterId = filterId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputChatlistDialogFilter", [("filterId", self.filterId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputChatlistDialogFilter", [("filterId", ConstructorParameterDescription(self.filterId))]) } } case inputChatlistDialogFilter(Cons_inputChatlistDialogFilter) @@ -680,10 +680,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputChatlistDialogFilter(let _data): - return ("inputChatlistDialogFilter", [("filterId", _data.filterId as Any)]) + return ("inputChatlistDialogFilter", [("filterId", ConstructorParameterDescription(_data.filterId))]) } } @@ -711,8 +711,8 @@ public extension Api { self.A = A self.M1 = M1 } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputCheckPasswordSRP", [("srpId", self.srpId as Any), ("A", self.A as Any), ("M1", self.M1 as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputCheckPasswordSRP", [("srpId", ConstructorParameterDescription(self.srpId)), ("A", ConstructorParameterDescription(self.A)), ("M1", ConstructorParameterDescription(self.M1))]) } } case inputCheckPasswordEmpty @@ -736,12 +736,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputCheckPasswordEmpty: return ("inputCheckPasswordEmpty", []) case .inputCheckPasswordSRP(let _data): - return ("inputCheckPasswordSRP", [("srpId", _data.srpId as Any), ("A", _data.A as Any), ("M1", _data.M1 as Any)]) + return ("inputCheckPasswordSRP", [("srpId", ConstructorParameterDescription(_data.srpId)), ("A", ConstructorParameterDescription(_data.A)), ("M1", ConstructorParameterDescription(_data.M1))]) } } @@ -776,8 +776,8 @@ public extension Api { self.address = address self.port = port } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputClientProxy", [("address", self.address as Any), ("port", self.port as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputClientProxy", [("address", ConstructorParameterDescription(self.address)), ("port", ConstructorParameterDescription(self.port))]) } } case inputClientProxy(Cons_inputClientProxy) @@ -794,10 +794,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputClientProxy(let _data): - return ("inputClientProxy", [("address", _data.address as Any), ("port", _data.port as Any)]) + return ("inputClientProxy", [("address", ConstructorParameterDescription(_data.address)), ("port", ConstructorParameterDescription(_data.port))]) } } @@ -824,8 +824,8 @@ public extension Api { public init(phone: String) { self.phone = phone } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputCollectiblePhone", [("phone", self.phone as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputCollectiblePhone", [("phone", ConstructorParameterDescription(self.phone))]) } } public class Cons_inputCollectibleUsername: TypeConstructorDescription { @@ -833,8 +833,8 @@ public extension Api { public init(username: String) { self.username = username } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputCollectibleUsername", [("username", self.username as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputCollectibleUsername", [("username", ConstructorParameterDescription(self.username))]) } } case inputCollectiblePhone(Cons_inputCollectiblePhone) @@ -857,12 +857,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputCollectiblePhone(let _data): - return ("inputCollectiblePhone", [("phone", _data.phone as Any)]) + return ("inputCollectiblePhone", [("phone", ConstructorParameterDescription(_data.phone))]) case .inputCollectibleUsername(let _data): - return ("inputCollectibleUsername", [("username", _data.username as Any)]) + return ("inputCollectibleUsername", [("username", ConstructorParameterDescription(_data.username))]) } } @@ -907,8 +907,8 @@ public extension Api { self.lastName = lastName self.note = note } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputPhoneContact", [("flags", self.flags as Any), ("clientId", self.clientId as Any), ("phone", self.phone as Any), ("firstName", self.firstName as Any), ("lastName", self.lastName as Any), ("note", self.note as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputPhoneContact", [("flags", ConstructorParameterDescription(self.flags)), ("clientId", ConstructorParameterDescription(self.clientId)), ("phone", ConstructorParameterDescription(self.phone)), ("firstName", ConstructorParameterDescription(self.firstName)), ("lastName", ConstructorParameterDescription(self.lastName)), ("note", ConstructorParameterDescription(self.note))]) } } case inputPhoneContact(Cons_inputPhoneContact) @@ -931,10 +931,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputPhoneContact(let _data): - return ("inputPhoneContact", [("flags", _data.flags as Any), ("clientId", _data.clientId as Any), ("phone", _data.phone as Any), ("firstName", _data.firstName as Any), ("lastName", _data.lastName as Any), ("note", _data.note as Any)]) + return ("inputPhoneContact", [("flags", ConstructorParameterDescription(_data.flags)), ("clientId", ConstructorParameterDescription(_data.clientId)), ("phone", ConstructorParameterDescription(_data.phone)), ("firstName", ConstructorParameterDescription(_data.firstName)), ("lastName", ConstructorParameterDescription(_data.lastName)), ("note", ConstructorParameterDescription(_data.note))]) } } @@ -977,8 +977,8 @@ public extension Api { public init(peer: Api.InputPeer) { self.peer = peer } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputDialogPeer", [("peer", self.peer as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputDialogPeer", [("peer", ConstructorParameterDescription(self.peer))]) } } public class Cons_inputDialogPeerFolder: TypeConstructorDescription { @@ -986,8 +986,8 @@ public extension Api { public init(folderId: Int32) { self.folderId = folderId } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputDialogPeerFolder", [("folderId", self.folderId as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputDialogPeerFolder", [("folderId", ConstructorParameterDescription(self.folderId))]) } } case inputDialogPeer(Cons_inputDialogPeer) @@ -1010,12 +1010,12 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputDialogPeer(let _data): - return ("inputDialogPeer", [("peer", _data.peer as Any)]) + return ("inputDialogPeer", [("peer", ConstructorParameterDescription(_data.peer))]) case .inputDialogPeerFolder(let _data): - return ("inputDialogPeerFolder", [("folderId", _data.folderId as Any)]) + return ("inputDialogPeerFolder", [("folderId", ConstructorParameterDescription(_data.folderId))]) } } @@ -1056,8 +1056,8 @@ public extension Api { self.accessHash = accessHash self.fileReference = fileReference } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputDocument", [("id", self.id as Any), ("accessHash", self.accessHash as Any), ("fileReference", self.fileReference as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputDocument", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash)), ("fileReference", ConstructorParameterDescription(self.fileReference))]) } } case inputDocument(Cons_inputDocument) @@ -1081,10 +1081,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputDocument(let _data): - return ("inputDocument", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any), ("fileReference", _data.fileReference as Any)]) + return ("inputDocument", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash)), ("fileReference", ConstructorParameterDescription(_data.fileReference))]) case .inputDocumentEmpty: return ("inputDocumentEmpty", []) } @@ -1121,8 +1121,8 @@ public extension Api { self.chatId = chatId self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputEncryptedChat", [("chatId", self.chatId as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputEncryptedChat", [("chatId", ConstructorParameterDescription(self.chatId)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } case inputEncryptedChat(Cons_inputEncryptedChat) @@ -1139,10 +1139,10 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputEncryptedChat(let _data): - return ("inputEncryptedChat", [("chatId", _data.chatId as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputEncryptedChat", [("chatId", ConstructorParameterDescription(_data.chatId)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) } } @@ -1171,8 +1171,8 @@ public extension Api { self.id = id self.accessHash = accessHash } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputEncryptedFile", [("id", self.id as Any), ("accessHash", self.accessHash as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputEncryptedFile", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))]) } } public class Cons_inputEncryptedFileBigUploaded: TypeConstructorDescription { @@ -1184,8 +1184,8 @@ public extension Api { self.parts = parts self.keyFingerprint = keyFingerprint } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputEncryptedFileBigUploaded", [("id", self.id as Any), ("parts", self.parts as Any), ("keyFingerprint", self.keyFingerprint as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputEncryptedFileBigUploaded", [("id", ConstructorParameterDescription(self.id)), ("parts", ConstructorParameterDescription(self.parts)), ("keyFingerprint", ConstructorParameterDescription(self.keyFingerprint))]) } } public class Cons_inputEncryptedFileUploaded: TypeConstructorDescription { @@ -1199,8 +1199,8 @@ public extension Api { self.md5Checksum = md5Checksum self.keyFingerprint = keyFingerprint } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputEncryptedFileUploaded", [("id", self.id as Any), ("parts", self.parts as Any), ("md5Checksum", self.md5Checksum as Any), ("keyFingerprint", self.keyFingerprint as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputEncryptedFileUploaded", [("id", ConstructorParameterDescription(self.id)), ("parts", ConstructorParameterDescription(self.parts)), ("md5Checksum", ConstructorParameterDescription(self.md5Checksum)), ("keyFingerprint", ConstructorParameterDescription(self.keyFingerprint))]) } } case inputEncryptedFile(Cons_inputEncryptedFile) @@ -1242,16 +1242,16 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputEncryptedFile(let _data): - return ("inputEncryptedFile", [("id", _data.id as Any), ("accessHash", _data.accessHash as Any)]) + return ("inputEncryptedFile", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))]) case .inputEncryptedFileBigUploaded(let _data): - return ("inputEncryptedFileBigUploaded", [("id", _data.id as Any), ("parts", _data.parts as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + return ("inputEncryptedFileBigUploaded", [("id", ConstructorParameterDescription(_data.id)), ("parts", ConstructorParameterDescription(_data.parts)), ("keyFingerprint", ConstructorParameterDescription(_data.keyFingerprint))]) case .inputEncryptedFileEmpty: return ("inputEncryptedFileEmpty", []) case .inputEncryptedFileUploaded(let _data): - return ("inputEncryptedFileUploaded", [("id", _data.id as Any), ("parts", _data.parts as Any), ("md5Checksum", _data.md5Checksum as Any), ("keyFingerprint", _data.keyFingerprint as Any)]) + return ("inputEncryptedFileUploaded", [("id", ConstructorParameterDescription(_data.id)), ("parts", ConstructorParameterDescription(_data.parts)), ("md5Checksum", ConstructorParameterDescription(_data.md5Checksum)), ("keyFingerprint", ConstructorParameterDescription(_data.keyFingerprint))]) } } @@ -1324,8 +1324,8 @@ public extension Api { self.name = name self.md5Checksum = md5Checksum } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputFile", [("id", self.id as Any), ("parts", self.parts as Any), ("name", self.name as Any), ("md5Checksum", self.md5Checksum as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputFile", [("id", ConstructorParameterDescription(self.id)), ("parts", ConstructorParameterDescription(self.parts)), ("name", ConstructorParameterDescription(self.name)), ("md5Checksum", ConstructorParameterDescription(self.md5Checksum))]) } } public class Cons_inputFileBig: TypeConstructorDescription { @@ -1337,8 +1337,8 @@ public extension Api { self.parts = parts self.name = name } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputFileBig", [("id", self.id as Any), ("parts", self.parts as Any), ("name", self.name as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputFileBig", [("id", ConstructorParameterDescription(self.id)), ("parts", ConstructorParameterDescription(self.parts)), ("name", ConstructorParameterDescription(self.name))]) } } public class Cons_inputFileStoryDocument: TypeConstructorDescription { @@ -1346,8 +1346,8 @@ public extension Api { public init(id: Api.InputDocument) { self.id = id } - public func descriptionFields() -> (String, [(String, Any)]) { - return ("inputFileStoryDocument", [("id", self.id as Any)]) + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { + return ("inputFileStoryDocument", [("id", ConstructorParameterDescription(self.id))]) } } case inputFile(Cons_inputFile) @@ -1382,14 +1382,14 @@ public extension Api { } } - public func descriptionFields() -> (String, [(String, Any)]) { + public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) { switch self { case .inputFile(let _data): - return ("inputFile", [("id", _data.id as Any), ("parts", _data.parts as Any), ("name", _data.name as Any), ("md5Checksum", _data.md5Checksum as Any)]) + return ("inputFile", [("id", ConstructorParameterDescription(_data.id)), ("parts", ConstructorParameterDescription(_data.parts)), ("name", ConstructorParameterDescription(_data.name)), ("md5Checksum", ConstructorParameterDescription(_data.md5Checksum))]) case .inputFileBig(let _data): - return ("inputFileBig", [("id", _data.id as Any), ("parts", _data.parts as Any), ("name", _data.name as Any)]) + return ("inputFileBig", [("id", ConstructorParameterDescription(_data.id)), ("parts", ConstructorParameterDescription(_data.parts)), ("name", ConstructorParameterDescription(_data.name))]) case .inputFileStoryDocument(let _data): - return ("inputFileStoryDocument", [("id", _data.id as Any)]) + return ("inputFileStoryDocument", [("id", ConstructorParameterDescription(_data.id))]) } } diff --git a/submodules/TelegramApi/Sources/DeserializeFunctionResponse.swift b/submodules/TelegramApi/Sources/DeserializeFunctionResponse.swift index e4831be62f..bcaf9f498a 100644 --- a/submodules/TelegramApi/Sources/DeserializeFunctionResponse.swift +++ b/submodules/TelegramApi/Sources/DeserializeFunctionResponse.swift @@ -1,10 +1,18 @@ import Foundation +public final class ConstructorParameterDescription { + public let value: Optional + + init(_ value: Optional) { + self.value = value + } +} + public final class FunctionDescription { public let name: String - public let parameters: [(String, Any)] + public let parameters: [(String, ConstructorParameterDescription)] - init(name: String, parameters: [(String, Any)]) { + init(name: String, parameters: [(String, ConstructorParameterDescription)]) { self.name = name self.parameters = parameters } @@ -23,5 +31,5 @@ public final class DeserializeFunctionResponse { } public protocol TypeConstructorDescription { - func descriptionFields() -> (String, [(String, Any)]) + func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) } diff --git a/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift b/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift index f76522b5b3..e36aff5d0c 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/StoreMessage_Telegram.swift @@ -39,6 +39,8 @@ public func tagsForStoreMessage(incoming: Bool, attributes: [MessageAttribute], tags.insert(.pinned) } + var hasUnseenPollVotes: Bool = false + for attachment in media { if let _ = attachment as? TelegramMediaImage { if !isSecret { @@ -108,8 +110,11 @@ public func tagsForStoreMessage(incoming: Bool, attributes: [MessageAttribute], } } else if let location = attachment as? TelegramMediaMap, location.liveBroadcastingTimeout != nil { tags.insert(.liveLocation) - } else if let _ = attachment as? TelegramMediaPoll { + } else if let poll = attachment as? TelegramMediaPoll { tags.insert(.polls) + if poll.results.hasUnseenVotes == true { + hasUnseenPollVotes = true + } } } if let textEntities = textEntities, !textEntities.isEmpty && !tags.contains(.webPage) { @@ -125,6 +130,10 @@ public func tagsForStoreMessage(incoming: Bool, attributes: [MessageAttribute], } } + if hasUnseenPollVotes { + tags.insert(.unseenPollVote) + } + return (tags, globalTags) } diff --git a/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaPoll.swift b/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaPoll.swift index 168553630c..7e5d355ecb 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaPoll.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/TelegramMediaPoll.swift @@ -58,7 +58,7 @@ extension TelegramMediaPollResults { init(apiResults: Api.PollResults) { switch apiResults { case let .pollResults(pollResultsData): - let (results, totalVoters, recentVoters, solution, solutionEntities) = (pollResultsData.results, pollResultsData.totalVoters, pollResultsData.recentVoters, pollResultsData.solution, pollResultsData.solutionEntities) + let (flags, results, totalVoters, recentVoters, solution, solutionEntities) = (pollResultsData.flags, pollResultsData.results, pollResultsData.totalVoters, pollResultsData.recentVoters, pollResultsData.solution, pollResultsData.solutionEntities) var parsedSolution: TelegramMediaPollResults.Solution? if let solution = solution, let solutionEntities = solutionEntities, !solution.isEmpty { var solutionMedia: Media? @@ -67,10 +67,14 @@ extension TelegramMediaPollResults { } parsedSolution = TelegramMediaPollResults.Solution(text: solution, entities: messageTextEntitiesFromApiEntities(solutionEntities), media: solutionMedia) } + var hasUnseenVotes: Bool? + if (flags & (1 << 0)) == 0 {//isMin + hasUnseenVotes = (flags & (1 << 6)) != 0 + } self.init(voters: results.flatMap({ $0.map(TelegramMediaPollOptionVoters.init(apiVoters:)) }), totalVoters: totalVoters, recentVoters: recentVoters.flatMap { recentVoters in return recentVoters.map { $0.peerId } - } ?? [], solution: parsedSolution) + } ?? [], solution: parsedSolution, hasUnseenVotes: hasUnseenVotes) } } } diff --git a/submodules/TelegramCore/Sources/ApiUtils/TelegramUser.swift b/submodules/TelegramCore/Sources/ApiUtils/TelegramUser.swift index 7dc05dbdee..e19c5f723f 100644 --- a/submodules/TelegramCore/Sources/ApiUtils/TelegramUser.swift +++ b/submodules/TelegramCore/Sources/ApiUtils/TelegramUser.swift @@ -128,6 +128,9 @@ extension TelegramUser { if (flags2 & (1 << 17)) != 0 { botFlags.insert(.forumManagedByUser) } + if (flags2 & (1 << 18)) != 0 { + botFlags.insert(.canManageBots) + } botInfo = BotUserInfo(flags: botFlags, inlinePlaceholder: botInlinePlaceholder) } diff --git a/submodules/TelegramCore/Sources/ForumChannels.swift b/submodules/TelegramCore/Sources/ForumChannels.swift index 6bfdef66bb..c922b6669c 100644 --- a/submodules/TelegramCore/Sources/ForumChannels.swift +++ b/submodules/TelegramCore/Sources/ForumChannels.swift @@ -178,6 +178,7 @@ struct StoreMessageHistoryThreadData { var topMessageId: Int32 var unreadMentionCount: Int32 var unreadReactionCount: Int32 + var unreadPollVoteCount: Int32 } struct PeerThreadCombinedState: Equatable, Codable { @@ -567,6 +568,7 @@ struct LoadMessageHistoryThreadsResult { var topMessage: Int32 var unreadMentionsCount: Int32 var unreadReactionsCount: Int32 + var unreadPollVoteCount: Int32 var index: StoredPeerThreadCombinedState.Index? var threadPeer: Peer? @@ -576,6 +578,7 @@ struct LoadMessageHistoryThreadsResult { topMessage: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, + unreadPollVoteCount: Int32, index: StoredPeerThreadCombinedState.Index, threadPeer: Peer? ) { @@ -584,6 +587,7 @@ struct LoadMessageHistoryThreadsResult { self.topMessage = topMessage self.unreadMentionsCount = unreadMentionsCount self.unreadReactionsCount = unreadReactionsCount + self.unreadPollVoteCount = unreadPollVoteCount self.index = index self.threadPeer = threadPeer } @@ -695,6 +699,7 @@ public func _internal_fillSavedMessageHistory(accountPeerId: PeerId, postbox: Po topMessage: message.id.id, unreadMentionsCount: 0, unreadReactionsCount: 0, + unreadPollVoteCount: 0, index: StoredPeerThreadCombinedState.Index(timestamp: message.timestamp, threadId: threadId, messageId: message.id.id), threadPeer: nil )) @@ -844,6 +849,7 @@ func _internal_requestMessageHistoryThreads(accountPeerId: PeerId, postbox: Post topMessage: topMessage, unreadMentionsCount: 0, unreadReactionsCount: 0, + unreadPollVoteCount: 0, index: topicIndex, threadPeer: threadPeer )) @@ -900,6 +906,7 @@ func _internal_requestMessageHistoryThreads(accountPeerId: PeerId, postbox: Post topMessage: topMessage, unreadMentionsCount: 0, unreadReactionsCount: unreadReactionsCount, + unreadPollVoteCount: 0, index: topicIndex, threadPeer: threadPeer )) @@ -1001,6 +1008,7 @@ func _internal_requestMessageHistoryThreads(accountPeerId: PeerId, postbox: Post topMessage: topMessage, unreadMentionsCount: 0, unreadReactionsCount: 0, + unreadPollVoteCount: 0, index: topicIndex, threadPeer: threadPeer )) @@ -1057,6 +1065,7 @@ func _internal_requestMessageHistoryThreads(accountPeerId: PeerId, postbox: Post topMessage: topMessage, unreadMentionsCount: 0, unreadReactionsCount: unreadReactionsCount, + unreadPollVoteCount: 0, index: topicIndex, threadPeer: threadPeer )) @@ -1158,7 +1167,7 @@ func _internal_requestMessageHistoryThreads(accountPeerId: PeerId, postbox: Post for topic in topics { switch topic { case let .forumTopic(forumTopicData): - let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) + let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.unreadPollVotesCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) let _ = draft let _ = peer @@ -1208,6 +1217,7 @@ func _internal_requestMessageHistoryThreads(accountPeerId: PeerId, postbox: Post topMessage: topMessage, unreadMentionsCount: unreadMentionsCount, unreadReactionsCount: unreadReactionsCount, + unreadPollVoteCount: unreadPollVoteCount, index: topicIndex, threadPeer: nil )) @@ -1274,6 +1284,7 @@ func applyLoadMessageHistoryThreadsResults(accountPeerId: PeerId, transaction: T transaction.replaceMessageTagSummary(peerId: result.peerId, threadId: item.threadId, tagMask: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, customTag: nil, count: item.unreadMentionsCount, maxId: item.topMessage) transaction.replaceMessageTagSummary(peerId: result.peerId, threadId: item.threadId, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: item.unreadReactionsCount, maxId: item.topMessage) + transaction.replaceMessageTagSummary(peerId: result.peerId, threadId: item.threadId, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: item.unreadPollVoteCount, maxId: item.topMessage) if item.topMessage != 0 { //transaction.removeHole(peerId: result.peerId, threadId: item.threadId, namespace: Namespaces.Message.Cloud, space: .everywhere, range: item.topMessage ... (Int32.max - 1)) @@ -1428,6 +1439,7 @@ public func _internal_searchForumTopics(account: Account, peerId: EnginePeer.Id, presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, forumTopicData: EngineChatList.ForumTopicData( id: item.threadId, title: itemData.info.title, diff --git a/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift b/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift index a1e65f94f9..393b23d09f 100644 --- a/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift +++ b/submodules/TelegramCore/Sources/State/AccountStateManagementUtils.swift @@ -2260,7 +2260,7 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM case let .forum(topic): switch topic { case let .forumTopic(forumTopicData): - let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) + let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.unreadPollVotesCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) let _ = peer let _ = draft @@ -2288,7 +2288,8 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM ), topMessageId: topMessage, unreadMentionCount: unreadMentionsCount, - unreadReactionCount: unreadReactionsCount + unreadReactionCount: unreadReactionsCount, + unreadPollVoteCount: unreadPollVoteCount ), pts: result.pts )) @@ -2323,7 +2324,8 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM ), topMessageId: topMessage, unreadMentionCount: 0, - unreadReactionCount: unreadReactionsCount + unreadReactionCount: unreadReactionsCount, + unreadPollVoteCount: 0 ), pts: result.pts )) @@ -2427,7 +2429,7 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM case let .forum(topic): switch topic { case let .forumTopic(forumTopicData): - let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) + let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.unreadPollVotesCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) let _ = peer let _ = draft @@ -2456,6 +2458,7 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM transaction.replaceMessageTagSummary(peerId: peerId, threadId: Int64(id), tagMask: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, customTag: nil, count: unreadMentionsCount, maxId: topMessage) transaction.replaceMessageTagSummary(peerId: peerId, threadId: Int64(id), tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: unreadReactionsCount, maxId: topMessage) + transaction.replaceMessageTagSummary(peerId: peerId, threadId: Int64(id), tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: unreadPollVoteCount, maxId: topMessage) case .forumTopicDeleted: break } @@ -2488,6 +2491,7 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM transaction.replaceMessageTagSummary(peerId: peerId, threadId: peer.peerId.toInt64(), tagMask: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, customTag: nil, count: 0, maxId: topMessage) transaction.replaceMessageTagSummary(peerId: peerId, threadId: peer.peerId.toInt64(), tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: unreadReactionsCount, maxId: topMessage) + transaction.replaceMessageTagSummary(peerId: peerId, threadId: peer.peerId.toInt64(), tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: 0, maxId: topMessage) case .savedDialog: break } @@ -2596,7 +2600,7 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM case let .forum(topic): switch topic { case let .forumTopic(forumTopicData): - let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) + let (flags, id, date, peer, title, iconColor, iconEmojiId, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, fromId, notifySettings, draft) = (forumTopicData.flags, forumTopicData.id, forumTopicData.date, forumTopicData.peer, forumTopicData.title, forumTopicData.iconColor, forumTopicData.iconEmojiId, forumTopicData.topMessage, forumTopicData.readInboxMaxId, forumTopicData.readOutboxMaxId, forumTopicData.unreadCount, forumTopicData.unreadMentionsCount, forumTopicData.unreadReactionsCount, forumTopicData.unreadPollVotesCount, forumTopicData.fromId, forumTopicData.notifySettings, forumTopicData.draft) let _ = peer let _ = draft @@ -2622,7 +2626,8 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM ), topMessageId: topMessage, unreadMentionCount: unreadMentionsCount, - unreadReactionCount: unreadReactionsCount + unreadReactionCount: unreadReactionsCount, + unreadPollVoteCount: unreadPollVoteCount ) case .forumTopicDeleted: break @@ -2654,7 +2659,8 @@ func resolveForumThreads(accountPeerId: PeerId, postbox: Postbox, source: FetchM ), topMessageId: topMessage, unreadMentionCount: 0, - unreadReactionCount: unreadReactionsCount + unreadReactionCount: unreadReactionsCount, + unreadPollVoteCount: 0 ) case .savedDialog: break @@ -2997,7 +3003,7 @@ private func resolveMissingPeerChatInfos(accountPeerId: PeerId, network: Network for dialog in dialogs { switch dialog { case let .dialog(dialogData): - let (peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, notifySettings, pts, folderId, ttlPeriod) = (dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.notifySettings, dialogData.pts, dialogData.folderId, dialogData.ttlPeriod) + let (peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, notifySettings, pts, folderId, ttlPeriod) = (dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.unreadPollVotesCount, dialogData.notifySettings, dialogData.pts, dialogData.folderId, dialogData.ttlPeriod) let peerId = peer.peerId updatedState.setNeedsHoleFromPreviousState(peerId: peerId, namespace: Namespaces.Message.Cloud, validateChannelPts: pts) @@ -3046,6 +3052,7 @@ private func resolveMissingPeerChatInfos(accountPeerId: PeerId, network: Network updatedState.resetReadState(peer.peerId, namespace: Namespaces.Message.Cloud, maxIncomingReadId: readInboxMaxId, maxOutgoingReadId: readOutboxMaxId, maxKnownId: topMessage, count: unreadCount, markedUnread: nil) updatedState.resetMessageTagSummary(peer.peerId, tag: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, count: unreadMentionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: topMessage)) updatedState.resetMessageTagSummary(peer.peerId, tag: .unseenReaction, namespace: Namespaces.Message.Cloud, count: unreadReactionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: topMessage)) + updatedState.resetMessageTagSummary(peer.peerId, tag: .unseenPollVote, namespace: Namespaces.Message.Cloud, count: unreadPollVoteCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: topMessage)) updatedState.peerChatInfos[peer.peerId] = PeerChatInfo(notificationSettings: notificationSettings) if let pts = pts { channelStates[peer.peerId] = ChannelState(pts: pts, invalidatedPts: pts, synchronizedUntilMessageId: nil) @@ -3224,7 +3231,7 @@ func resetChannels(accountPeerId: PeerId, postbox: Postbox, network: Network, pe var storeMessages: [StoreMessage] = [] var readStates: [PeerId: [MessageId.Namespace: PeerReadState]] = [:] - var mentionTagSummaries: [PeerId: (tag: MessageTags, summary: MessageHistoryTagNamespaceSummary)] = [:] + var mentionTagSummaries: [PeerId: [(tag: MessageTags, summary: MessageHistoryTagNamespaceSummary)]] = [:] var channelStates: [PeerId: AccountStateChannelState] = [:] var invalidateChannelStates: [PeerId: Int32] = [:] var channelSynchronizedUntilMessage: [PeerId: MessageId.Id] = [:] @@ -3247,6 +3254,7 @@ func resetChannels(accountPeerId: PeerId, postbox: Postbox, network: Network, pe let apiUnreadCount: Int32 let apiUnreadMentionsCount: Int32 let apiUnreadReactionsCount: Int32 + let apiUnreadPollVoteCount: Int32 var apiChannelPts: Int32? let apiNotificationSettings: Api.PeerNotifySettings let apiMarkedUnread: Bool @@ -3254,7 +3262,7 @@ func resetChannels(accountPeerId: PeerId, postbox: Postbox, network: Network, pe let apiTtlPeriod: Int32? switch dialog { case let .dialog(dialogData): - let (flags, peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, peerNotificationSettings, pts, folderId, ttlPeriod) = (dialogData.flags, dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.notifySettings, dialogData.pts, dialogData.folderId, dialogData.ttlPeriod) + let (flags, peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, peerNotificationSettings, pts, folderId, ttlPeriod) = (dialogData.flags, dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.unreadPollVotesCount, dialogData.notifySettings, dialogData.pts, dialogData.folderId, dialogData.ttlPeriod) apiPeer = peer apiTopMessage = topMessage apiReadInboxMaxId = readInboxMaxId @@ -3263,6 +3271,7 @@ func resetChannels(accountPeerId: PeerId, postbox: Postbox, network: Network, pe apiMarkedUnread = (flags & (1 << 3)) != 0 apiUnreadMentionsCount = unreadMentionsCount apiUnreadReactionsCount = unreadReactionsCount + apiUnreadPollVoteCount = unreadPollVoteCount apiNotificationSettings = peerNotificationSettings apiChannelPts = pts groupId = PeerGroupId(rawValue: folderId ?? 0) @@ -3280,8 +3289,11 @@ func resetChannels(accountPeerId: PeerId, postbox: Postbox, network: Network, pe readStates[peerId]![Namespaces.Message.Cloud] = .idBased(maxIncomingReadId: apiReadInboxMaxId, maxOutgoingReadId: apiReadOutboxMaxId, maxKnownId: apiTopMessage, count: apiUnreadCount, markedUnread: apiMarkedUnread) if apiTopMessage != 0 { - mentionTagSummaries[peerId] = (MessageTags.unseenPersonalMessage, MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadMentionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage))) - mentionTagSummaries[peerId] = (MessageTags.unseenReaction, MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadReactionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage))) + mentionTagSummaries[peerId] = [ + (MessageTags.unseenPersonalMessage, MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadMentionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage))), + (MessageTags.unseenReaction, MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadReactionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage))), + (MessageTags.unseenPollVote, MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadPollVoteCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage))) + ] } if let apiChannelPts = apiChannelPts { @@ -3346,8 +3358,10 @@ func resetChannels(accountPeerId: PeerId, postbox: Postbox, network: Network, pe } } - for (peerId, tagSummary) in mentionTagSummaries { - updatedState.resetMessageTagSummary(peerId, tag: tagSummary.tag, namespace: Namespaces.Message.Cloud, count: tagSummary.summary.count, range: tagSummary.summary.range) + for (peerId, tagSummaries) in mentionTagSummaries { + for tagSummary in tagSummaries { + updatedState.resetMessageTagSummary(peerId, tag: tagSummary.tag, namespace: Namespaces.Message.Cloud, count: tagSummary.summary.count, range: tagSummary.summary.range) + } } for (peerId, channelState) in channelStates { @@ -3596,13 +3610,13 @@ private func pollChannel(accountPeerId: PeerId, postbox: Postbox, network: Netwo apiTimeout = timeout - var parameters: (peer: Api.Peer, pts: Int32, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, ttlPeriod: Int32?)? + var parameters: (peer: Api.Peer, pts: Int32, topMessage: Int32, readInboxMaxId: Int32, readOutboxMaxId: Int32, unreadCount: Int32, unreadMentionsCount: Int32, unreadReactionsCount: Int32, unreadPollVoteCount: Int32, ttlPeriod: Int32?)? switch dialog { case let .dialog(dialogData): - let (peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, pts, ttlPeriod) = (dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.pts, dialogData.ttlPeriod) + let (peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, pts, ttlPeriod) = (dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.unreadPollVotesCount, dialogData.pts, dialogData.ttlPeriod) if let pts = pts { - parameters = (peer, pts, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, ttlPeriod) + parameters = (peer, pts, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, ttlPeriod) } case .dialogFolder: break @@ -3615,7 +3629,7 @@ private func pollChannel(accountPeerId: PeerId, postbox: Postbox, network: Netwo peerIsForum = true } - if let (peer, pts, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, ttlPeriod) = parameters { + if let (peer, pts, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, ttlPeriod) = parameters { updatedState.updateChannelState(peer.peerId, pts: pts) updatedState.updateChannelInvalidationPts(peer.peerId, invalidationPts: pts) @@ -3659,6 +3673,7 @@ private func pollChannel(accountPeerId: PeerId, postbox: Postbox, network: Netwo updatedState.resetMessageTagSummary(peer.peerId, tag: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, count: unreadMentionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: topMessage)) updatedState.resetMessageTagSummary(peer.peerId, tag: .unseenReaction, namespace: Namespaces.Message.Cloud, count: unreadReactionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: topMessage)) + updatedState.resetMessageTagSummary(peer.peerId, tag: .unseenPollVote, namespace: Namespaces.Message.Cloud, count: unreadPollVoteCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: topMessage)) } else { assertionFailure() } @@ -5338,6 +5353,7 @@ func replayFinalState( } transaction.replaceMessageTagSummary(peerId: topicId.peerId, threadId: topicId.threadId, tagMask: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadMentionCount, maxId: data.topMessageId) transaction.replaceMessageTagSummary(peerId: topicId.peerId, threadId: topicId.threadId, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadReactionCount, maxId: data.topMessageId) + transaction.replaceMessageTagSummary(peerId: topicId.peerId, threadId: topicId.threadId, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadPollVoteCount, maxId: data.topMessageId) } case let .UpdateStory(peerId, story): var updatedPeerEntries: [StoryItemsTableEntry] = transaction.getStoryItems(peerId: peerId) diff --git a/submodules/TelegramCore/Sources/State/AccountTaskManager.swift b/submodules/TelegramCore/Sources/State/AccountTaskManager.swift index 1b64408434..84ba2acf28 100644 --- a/submodules/TelegramCore/Sources/State/AccountTaskManager.swift +++ b/submodules/TelegramCore/Sources/State/AccountTaskManager.swift @@ -84,9 +84,10 @@ final class AccountTaskManager { tasks.add(_internal_managedRecentlyUsedInlineBots(postbox: self.stateManager.postbox, network: self.stateManager.network, accountPeerId: self.stateManager.accountPeerId).start()) tasks.add(managedSynchronizeConsumeMessageContentOperations(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) tasks.add(managedConsumePersonalMessagesActions(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) - tasks.add(managedReadReactionActions(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) + tasks.add(managedReadReactionOrPollVoteActions(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) tasks.add(managedSynchronizeMarkAllUnseenPersonalMessagesOperations(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) tasks.add(managedSynchronizeMarkAllUnseenReactionsOperations(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) + tasks.add(managedSynchronizeMarkAllUnseenPollVotesOperations(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) tasks.add(managedApplyPendingMessageReactionsActions(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) tasks.add(managedApplyPendingMessageStarsReactionsActions(postbox: self.stateManager.postbox, network: self.stateManager.network, stateManager: self.stateManager).start()) diff --git a/submodules/TelegramCore/Sources/State/AccountViewTracker.swift b/submodules/TelegramCore/Sources/State/AccountViewTracker.swift index d74509c22b..6a04fe9f61 100644 --- a/submodules/TelegramCore/Sources/State/AccountViewTracker.swift +++ b/submodules/TelegramCore/Sources/State/AccountViewTracker.swift @@ -1684,13 +1684,16 @@ public final class AccountViewTracker { } } - public func updateMarkAllReactionsSeen(peerId: PeerId, threadId: Int64?) { + public func updateMarkAllReactionsAndPollVotesSeen(peerId: PeerId, threadId: Int64?) { self.queue.async { guard let account = self.account else { return } let _ = (account.postbox.transaction { transaction -> Set in - let ids = Set(transaction.getMessageIndicesWithTag(peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, tag: .unseenReaction).map({ $0.id })) + let reactionIds = Set(transaction.getMessageIndicesWithTag(peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, tag: .unseenReaction).map({ $0.id })) + let pollVoteIds = Set(transaction.getMessageIndicesWithTag(peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, tag: .unseenPollVote).map({ $0.id })) + + let ids = reactionIds.union(pollVoteIds) for id in ids { transaction.updateMessage(id, update: { currentMessage in @@ -1702,9 +1705,16 @@ public final class AccountViewTracker { break } } + var media = currentMessage.media + for i in 0 ..< media.count { + if let poll = media[i] as? TelegramMediaPoll { + media[i] = poll.withoutUnreadResults() + } + } var tags = currentMessage.tags tags.remove(.unseenReaction) - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) + tags.remove(.unseenPollVote) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: media)) }) } @@ -1718,13 +1728,23 @@ public final class AccountViewTracker { addSynchronizeMarkAllUnseenReactionsOperation(transaction: transaction, peerId: peerId, maxId: summary.range.maxId, threadId: threadId) } + if let summary = transaction.getMessageTagSummary(peerId: peerId, threadId: threadId, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil) { + var maxId: Int32 = summary.range.maxId + if let index = transaction.getTopPeerMessageIndex(peerId: peerId, namespace: Namespaces.Message.Cloud) { + maxId = index.id.id + } + + transaction.replaceMessageTagSummary(peerId: peerId, threadId: threadId, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: 0, maxId: maxId) + addSynchronizeMarkAllUnseenPollVotesOperation(transaction: transaction, peerId: peerId, maxId: summary.range.maxId, threadId: threadId) + } + return ids } |> deliverOn(self.queue)).start() } } - public func updateMarkReactionsSeenForMessageIds(messageIds: Set) { + public func updateMarkReactionsAndVotesSeenForMessageIds(messageIds: Set) { self.queue.async { let addedMessageIds: [MessageId] = Array(messageIds) if !addedMessageIds.isEmpty { @@ -1733,7 +1753,7 @@ public final class AccountViewTracker { for id in addedMessageIds { if let _ = transaction.getMessage(id) { transaction.updateMessage(id, update: { currentMessage in - if !currentMessage.tags.contains(.unseenReaction) { + if !currentMessage.tags.contains(.unseenReaction) && !currentMessage.tags.contains(.unseenPollVote) { return .skip } var attributes = currentMessage.attributes @@ -1743,13 +1763,21 @@ public final class AccountViewTracker { break loop } } + var media = currentMessage.media + loop: for j in 0 ..< media.count { + if let poll = media[j] as? TelegramMediaPoll { + media[j] = poll.withoutUnreadResults() + break loop + } + } var tags = currentMessage.tags tags.remove(.unseenReaction) - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) + tags.remove(.unseenPollVote) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: media)) }) - if transaction.getPendingMessageAction(type: .readReaction, id: id) == nil { - transaction.setPendingMessageAction(type: .readReaction, id: id, action: ReadReactionAction()) + if transaction.getPendingMessageAction(type: .readReactionOrPollVote, id: id) == nil { + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: id, action: ReadReactionAction()) } } } @@ -2540,16 +2568,19 @@ public final class AccountViewTracker { } } - public func unseenPersonalMessagesAndReactionCount(peerId: PeerId, threadId: Int64?) -> Signal<(mentionCount: Int32, reactionCount: Int32), NoError> { + public func unseenPersonalMessagesAndReactionCount(peerId: PeerId, threadId: Int64?) -> Signal<(mentionCount: Int32, reactionCount: Int32, pollVoteCount: Int32), NoError> { if let account = self.account { let pendingMentionsKey: PostboxViewKey = .pendingMessageActionsSummary(type: .consumeUnseenPersonalMessage, peerId: peerId, namespace: Namespaces.Message.Cloud) let summaryMentionsKey: PostboxViewKey = .historyTagSummaryView(tag: .unseenPersonalMessage, peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, customTag: nil) - let pendingReactionsKey: PostboxViewKey = .pendingMessageActionsSummary(type: .readReaction, peerId: peerId, namespace: Namespaces.Message.Cloud) + let pendingReactionsKey: PostboxViewKey = .pendingMessageActionsSummary(type: .readReactionOrPollVote, peerId: peerId, namespace: Namespaces.Message.Cloud) let summaryReactionsKey: PostboxViewKey = .historyTagSummaryView(tag: .unseenReaction, peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, customTag: nil) - return account.postbox.combinedView(keys: [pendingMentionsKey, summaryMentionsKey, pendingReactionsKey, summaryReactionsKey]) - |> map { views -> (mentionCount: Int32, reactionCount: Int32) in + let pendingPollVotesKey: PostboxViewKey = .pendingMessageActionsSummary(type: .readReactionOrPollVote, peerId: peerId, namespace: Namespaces.Message.Cloud) + let summaryPollVotesKey: PostboxViewKey = .historyTagSummaryView(tag: .unseenPollVote, peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, customTag: nil) + + return account.postbox.combinedView(keys: [pendingMentionsKey, summaryMentionsKey, pendingReactionsKey, summaryReactionsKey, pendingPollVotesKey, summaryPollVotesKey]) + |> map { views -> (mentionCount: Int32, reactionCount: Int32, pollVoteCount: Int32) in var mentionCount: Int32 = 0 if let view = views.views[pendingMentionsKey] as? PendingMessageActionsSummaryView { mentionCount -= view.count @@ -2565,7 +2596,16 @@ public final class AccountViewTracker { reactionCount += unseenCount } } - return (max(0, mentionCount), max(0, reactionCount)) + var pollVoteCount: Int32 = 0 + if let view = views.views[pendingPollVotesKey] as? PendingMessageActionsSummaryView { + pollVoteCount -= view.count + } + if let view = views.views[summaryPollVotesKey] as? MessageHistoryTagSummaryView { + if let unseenCount = view.count { + pollVoteCount += unseenCount + } + } + return (max(0, mentionCount), max(0, reactionCount), max(0, pollVoteCount)) } |> distinctUntilChanged(isEqual: { lhs, rhs in if lhs.mentionCount != rhs.mentionCount { @@ -2574,6 +2614,9 @@ public final class AccountViewTracker { if lhs.reactionCount != rhs.reactionCount { return false } + if lhs.pollVoteCount != rhs.pollVoteCount { + return false + } return true }) } else { @@ -2620,7 +2663,14 @@ public final class AccountViewTracker { ), ChatListEntryMessageTagSummaryKey( tag: .unseenReaction, - actionType: PendingMessageActionType.readReaction + actionType: PendingMessageActionType.readReactionOrPollVote + ): ChatListEntrySummaryComponents.Component( + tagSummary: ChatListEntryMessageTagSummaryComponent(namespace: Namespaces.Message.Cloud), + actionsSummary: ChatListEntryPendingMessageActionsSummaryComponent(namespace: Namespaces.Message.Cloud) + ), + ChatListEntryMessageTagSummaryKey( + tag: .unseenPollVote, + actionType: PendingMessageActionType.readReactionOrPollVote ): ChatListEntrySummaryComponents.Component( tagSummary: ChatListEntryMessageTagSummaryComponent(namespace: Namespaces.Message.Cloud), actionsSummary: ChatListEntryPendingMessageActionsSummaryComponent(namespace: Namespaces.Message.Cloud) @@ -2653,7 +2703,14 @@ public final class AccountViewTracker { ), ChatListEntryMessageTagSummaryKey( tag: .unseenReaction, - actionType: PendingMessageActionType.readReaction + actionType: PendingMessageActionType.readReactionOrPollVote + ): ChatListEntrySummaryComponents.Component( + tagSummary: ChatListEntryMessageTagSummaryComponent(namespace: Namespaces.Message.Cloud), + actionsSummary: ChatListEntryPendingMessageActionsSummaryComponent(namespace: Namespaces.Message.Cloud) + ), + ChatListEntryMessageTagSummaryKey( + tag: .unseenPollVote, + actionType: PendingMessageActionType.readReactionOrPollVote ): ChatListEntrySummaryComponents.Component( tagSummary: ChatListEntryMessageTagSummaryComponent(namespace: Namespaces.Message.Cloud), actionsSummary: ChatListEntryPendingMessageActionsSummaryComponent(namespace: Namespaces.Message.Cloud) diff --git a/submodules/TelegramCore/Sources/State/FetchChatList.swift b/submodules/TelegramCore/Sources/State/FetchChatList.swift index 829272a583..9393458ca0 100644 --- a/submodules/TelegramCore/Sources/State/FetchChatList.swift +++ b/submodules/TelegramCore/Sources/State/FetchChatList.swift @@ -18,6 +18,7 @@ struct ParsedDialogs { let readStates: [PeerId: [MessageId.Namespace: PeerReadState]] let mentionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] let reactionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] + let pollVoteTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] let channelStates: [PeerId: Int32] let topMessageIds: [PeerId: MessageId] let storeMessages: [StoreMessage] @@ -55,6 +56,7 @@ private func parseDialogs(accountPeerId: PeerId, apiDialogs: [Api.Dialog], apiMe var readStates: [PeerId: [MessageId.Namespace: PeerReadState]] = [:] var mentionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] = [:] var reactionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] = [:] + var pollVoteTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] = [:] var channelStates: [PeerId: Int32] = [:] var topMessageIds: [PeerId: MessageId] = [:] var ttlPeriods: [PeerId: CachedPeerAutoremoveTimeout] = [:] @@ -77,11 +79,12 @@ private func parseDialogs(accountPeerId: PeerId, apiDialogs: [Api.Dialog], apiMe let apiMarkedUnread: Bool let apiUnreadMentionsCount: Int32 let apiUnreadReactionsCount: Int32 + let apiUnreadPollVoteCount: Int32 var apiChannelPts: Int32? let apiNotificationSettings: Api.PeerNotifySettings switch dialog { case let .dialog(dialogData): - let (flags, peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, peerNotificationSettings, pts, ttlPeriod) = (dialogData.flags, dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.notifySettings, dialogData.pts, dialogData.ttlPeriod) + let (flags, peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, peerNotificationSettings, pts, ttlPeriod) = (dialogData.flags, dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.unreadPollVotesCount, dialogData.notifySettings, dialogData.pts, dialogData.ttlPeriod) if let peer = peers.get(peer.peerId) { var isExluded = false if let group = peer as? TelegramGroup { @@ -101,6 +104,7 @@ private func parseDialogs(accountPeerId: PeerId, apiDialogs: [Api.Dialog], apiMe apiMarkedUnread = (flags & (1 << 3)) != 0 apiUnreadMentionsCount = unreadMentionsCount apiUnreadReactionsCount = unreadReactionsCount + apiUnreadPollVoteCount = unreadPollVoteCount apiNotificationSettings = peerNotificationSettings apiChannelPts = pts @@ -132,6 +136,7 @@ private func parseDialogs(accountPeerId: PeerId, apiDialogs: [Api.Dialog], apiMe if apiTopMessage != 0 { mentionTagSummaries[peerId] = MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadMentionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage)) reactionTagSummaries[peerId] = MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadReactionsCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage)) + pollVoteTagSummaries[peerId] = MessageHistoryTagNamespaceSummary(version: 1, count: apiUnreadPollVoteCount, range: MessageHistoryTagNamespaceCountValidityRange(maxId: apiTopMessage)) topMessageIds[peerId] = MessageId(peerId: peerId, namespace: Namespaces.Message.Cloud, id: apiTopMessage) } @@ -184,6 +189,7 @@ private func parseDialogs(accountPeerId: PeerId, apiDialogs: [Api.Dialog], apiMe readStates: readStates, mentionTagSummaries: mentionTagSummaries, reactionTagSummaries: reactionTagSummaries, + pollVoteTagSummaries: pollVoteTagSummaries, channelStates: channelStates, topMessageIds: topMessageIds, storeMessages: storeMessages, @@ -204,6 +210,7 @@ struct FetchedChatList { var readStates: [PeerId: [MessageId.Namespace: PeerReadState]] var mentionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] var reactionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] + var pollVoteTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] var channelStates: [PeerId: Int32] var storeMessages: [StoreMessage] var topMessageIds: [PeerId: MessageId] @@ -311,6 +318,7 @@ func fetchChatList(accountPeerId: PeerId, postbox: Postbox, network: Network, lo var readStates: [PeerId: [MessageId.Namespace: PeerReadState]] = [:] var mentionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] = [:] var reactionTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] = [:] + var pollVoteTagSummaries: [PeerId: MessageHistoryTagNamespaceSummary] = [:] var channelStates: [PeerId: Int32] = [:] var storeMessages: [StoreMessage] = [] var topMessageIds: [PeerId: MessageId] = [:] @@ -322,6 +330,7 @@ func fetchChatList(accountPeerId: PeerId, postbox: Postbox, network: Network, lo readStates.merge(parsedRemoteChats.readStates, uniquingKeysWith: { _, updated in updated }) mentionTagSummaries.merge(parsedRemoteChats.mentionTagSummaries, uniquingKeysWith: { _, updated in updated }) reactionTagSummaries.merge(parsedRemoteChats.reactionTagSummaries, uniquingKeysWith: { _, updated in updated }) + pollVoteTagSummaries.merge(parsedRemoteChats.pollVoteTagSummaries, uniquingKeysWith: { _, updated in updated }) channelStates.merge(parsedRemoteChats.channelStates, uniquingKeysWith: { _, updated in updated }) storeMessages.append(contentsOf: parsedRemoteChats.storeMessages) topMessageIds.merge(parsedRemoteChats.topMessageIds, uniquingKeysWith: { _, updated in updated }) @@ -334,6 +343,7 @@ func fetchChatList(accountPeerId: PeerId, postbox: Postbox, network: Network, lo readStates.merge(parsedPinnedChats.readStates, uniquingKeysWith: { _, updated in updated }) mentionTagSummaries.merge(parsedPinnedChats.mentionTagSummaries, uniquingKeysWith: { _, updated in updated }) reactionTagSummaries.merge(parsedPinnedChats.reactionTagSummaries, uniquingKeysWith: { _, updated in updated }) + pollVoteTagSummaries.merge(parsedPinnedChats.pollVoteTagSummaries, uniquingKeysWith: { _, updated in updated }) channelStates.merge(parsedPinnedChats.channelStates, uniquingKeysWith: { _, updated in updated }) storeMessages.append(contentsOf: parsedPinnedChats.storeMessages) topMessageIds.merge(parsedPinnedChats.topMessageIds, uniquingKeysWith: { _, updated in updated }) @@ -358,6 +368,7 @@ func fetchChatList(accountPeerId: PeerId, postbox: Postbox, network: Network, lo readStates.merge(folderChats.readStates, uniquingKeysWith: { _, updated in updated }) mentionTagSummaries.merge(folderChats.mentionTagSummaries, uniquingKeysWith: { _, updated in updated }) reactionTagSummaries.merge(folderChats.reactionTagSummaries, uniquingKeysWith: { _, updated in updated }) + pollVoteTagSummaries.merge(folderChats.pollVoteTagSummaries, uniquingKeysWith: { _, updated in updated }) channelStates.merge(folderChats.channelStates, uniquingKeysWith: { _, updated in updated }) storeMessages.append(contentsOf: folderChats.storeMessages) } @@ -393,6 +404,7 @@ func fetchChatList(accountPeerId: PeerId, postbox: Postbox, network: Network, lo readStates: readStates, mentionTagSummaries: mentionTagSummaries, reactionTagSummaries: reactionTagSummaries, + pollVoteTagSummaries: pollVoteTagSummaries, channelStates: channelStates, storeMessages: storeMessages, topMessageIds: topMessageIds, diff --git a/submodules/TelegramCore/Sources/State/HistoryViewStateValidation.swift b/submodules/TelegramCore/Sources/State/HistoryViewStateValidation.swift index 8b1c545985..23b2cfdf43 100644 --- a/submodules/TelegramCore/Sources/State/HistoryViewStateValidation.swift +++ b/submodules/TelegramCore/Sources/State/HistoryViewStateValidation.swift @@ -135,7 +135,7 @@ final class HistoryViewStateValidationContexts { return } - guard view.tag == nil || view.tag == .tag(MessageTags.unseenPersonalMessage) || view.tag == .tag(MessageTags.unseenReaction) || view.tag == .tag(MessageTags.music) || view.tag == .tag(MessageTags.pinned) else { + guard view.tag == nil || view.tag == .tag(MessageTags.unseenPersonalMessage) || view.tag == .tag(MessageTags.unseenReaction) || view.tag == .tag(MessageTags.unseenPollVote) || view.tag == .tag(MessageTags.music) || view.tag == .tag(MessageTags.pinned) else { if self.contexts[id] != nil { self.contexts.removeValue(forKey: id) } @@ -540,6 +540,8 @@ private func validateChannelMessagesBatch(postbox: Postbox, network: Network, ac requestSignal = network.request(Api.functions.messages.getUnreadMentions(flags: 0, peer: inputPeer, topMsgId: nil, offsetId: messageIds[messageIds.count - 1].id + 1, addOffset: 0, limit: Int32(messageIds.count), maxId: messageIds[messageIds.count - 1].id + 1, minId: messageIds[0].id - 1)) } else if tag == MessageTags.unseenReaction { requestSignal = network.request(Api.functions.messages.getUnreadReactions(flags: 0, peer: inputPeer, topMsgId: nil, savedPeerId: nil, offsetId: messageIds[messageIds.count - 1].id + 1, addOffset: 0, limit: Int32(messageIds.count), maxId: messageIds[messageIds.count - 1].id + 1, minId: messageIds[0].id - 1)) + } else if tag == MessageTags.unseenPollVote { + requestSignal = network.request(Api.functions.messages.getUnreadPollVotes(flags: 0, peer: inputPeer, topMsgId: nil, offsetId: messageIds[messageIds.count - 1].id + 1, addOffset: 0, limit: Int32(messageIds.count), maxId: messageIds[messageIds.count - 1].id + 1, minId: messageIds[0].id - 1)) } else if let filter = messageFilterForTagMask(tag) { requestSignal = network.request(Api.functions.messages.search(flags: 0, peer: inputPeer, q: "", fromId: nil, savedPeerId: nil, savedReaction: nil, topMsgId: nil, filter: filter, minDate: 0, maxDate: 0, offsetId: messageIds[messageIds.count - 1].id + 1, addOffset: 0, limit: Int32(messageIds.count), maxId: messageIds[messageIds.count - 1].id + 1, minId: messageIds[0].id - 1, hash: hash)) } else { diff --git a/submodules/TelegramCore/Sources/State/Holes.swift b/submodules/TelegramCore/Sources/State/Holes.swift index 116ed63f4e..5c7b05a8a7 100644 --- a/submodules/TelegramCore/Sources/State/Holes.swift +++ b/submodules/TelegramCore/Sources/State/Holes.swift @@ -736,6 +736,70 @@ func fetchMessageHistoryHole(accountPeerId: PeerId, source: FetchMessageHistoryH } request = source.request(Api.functions.messages.getUnreadReactions(flags: flags, peer: inputPeer, topMsgId: topMsgId, savedPeerId: savedPeerId, offsetId: offsetId, addOffset: addOffset, limit: Int32(selectedLimit), maxId: maxId, minId: minId)) + } else if tag == .unseenPollVote { + let offsetId: Int32 + let addOffset: Int32 + let selectedLimit = count + let maxId: Int32 + let minId: Int32 + + switch direction { + case let .range(start, end): + if start.id <= end.id { + offsetId = start.id <= 1 ? 1 : (start.id - 1) + addOffset = Int32(-selectedLimit) + maxId = end.id + minId = start.id - 1 + + let rangeStartId = start.id + let rangeEndId = min(end.id, Int32.max - 1) + if rangeStartId <= rangeEndId { + minMaxRange = rangeStartId ... rangeEndId + } else { + minMaxRange = rangeStartId ... rangeStartId + assertionFailure() + } + } else { + offsetId = start.id == Int32.max ? start.id : (start.id + 1) + addOffset = 0 + maxId = start.id == Int32.max ? start.id : (start.id + 1) + minId = end.id + + let rangeStartId = end.id + let rangeEndId = min(start.id, Int32.max - 1) + if rangeStartId <= rangeEndId { + minMaxRange = rangeStartId ... rangeEndId + } else { + minMaxRange = rangeStartId ... rangeStartId + assertionFailure() + } + } + case let .aroundId(id): + offsetId = id.id + addOffset = Int32(-selectedLimit / 2) + maxId = Int32.max + minId = 1 + + minMaxRange = 1 ... Int32.max - 1 + } + + var flags: Int32 = 0 + var topMsgId: Int32? + if let threadId = peerInput.requestThreadId(accountPeerId: accountPeerId, peer: peer) { + flags |= (1 << 0) + topMsgId = Int32(clamping: threadId) + } + var savedPeerId: Api.InputPeer? + if let subPeerId = peerInput.requestSubPeerId(accountPeerId: accountPeerId, peer: peer), let subPeer = subPeer, subPeer.id == subPeerId { + flags |= (1 << 1) + if let inputPeer = apiInputPeer(subPeer) { + flags |= 1 << 2 + savedPeerId = inputPeer + } + } + let _ = savedPeerId + + request = source.request(Api.functions.messages.getUnreadPollVotes(flags: flags, peer: inputPeer, topMsgId: topMsgId, offsetId: offsetId, addOffset: addOffset, limit: Int32(selectedLimit), maxId: maxId, minId: minId)) } else if tag == .liveLocation { let selectedLimit = count @@ -1135,6 +1199,7 @@ func fetchChatListHole(postbox: Postbox, network: Network, accountPeerId: PeerId } transaction.replaceMessageTagSummary(peerId: threadMessageId.peerId, threadId: threadMessageId.threadId, tagMask: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadMentionCount, maxId: data.topMessageId) transaction.replaceMessageTagSummary(peerId: threadMessageId.peerId, threadId: threadMessageId.threadId, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadReactionCount, maxId: data.topMessageId) + transaction.replaceMessageTagSummary(peerId: threadMessageId.peerId, threadId: threadMessageId.threadId, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadPollVoteCount, maxId: data.topMessageId) } transaction.updateCurrentPeerNotificationSettings(fetchedChats.notificationSettings) @@ -1207,6 +1272,9 @@ func fetchChatListHole(postbox: Postbox, network: Network, accountPeerId: PeerId for (peerId, summary) in fetchedChats.reactionTagSummaries { transaction.replaceMessageTagSummary(peerId: peerId, threadId: nil, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: summary.count, maxId: summary.range.maxId) } + for (peerId, summary) in fetchedChats.pollVoteTagSummaries { + transaction.replaceMessageTagSummary(peerId: peerId, threadId: nil, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: summary.count, maxId: summary.range.maxId) + } for (groupId, summary) in fetchedChats.folderSummaries { transaction.resetPeerGroupSummary(groupId: groupId, namespace: Namespaces.Message.Cloud, summary: summary) diff --git a/submodules/TelegramCore/Sources/State/ManagedConsumePersonalMessagesActions.swift b/submodules/TelegramCore/Sources/State/ManagedConsumePersonalMessagesActions.swift index f5e9efbd60..3c451be441 100644 --- a/submodules/TelegramCore/Sources/State/ManagedConsumePersonalMessagesActions.swift +++ b/submodules/TelegramCore/Sources/State/ManagedConsumePersonalMessagesActions.swift @@ -183,24 +183,29 @@ func managedConsumePersonalMessagesActions(postbox: Postbox, network: Network, s } } -func managedReadReactionActions(postbox: Postbox, network: Network, stateManager: AccountStateManager) -> Signal { +func managedReadReactionOrPollVoteActions(postbox: Postbox, network: Network, stateManager: AccountStateManager) -> Signal { return Signal { _ in let helper = Atomic(value: ManagedConsumePersonalMessagesActionsHelper()) - let actionsKey = PostboxViewKey.pendingMessageActions(type: .readReaction) - let invalidateKey = PostboxViewKey.invalidatedMessageHistoryTagSummaries(peerId: nil, threadId: nil, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud) - let disposable = postbox.combinedView(keys: [actionsKey, invalidateKey]).start(next: { view in + let actionsKey = PostboxViewKey.pendingMessageActions(type: .readReactionOrPollVote) + let invalidateReactionsKey = PostboxViewKey.invalidatedMessageHistoryTagSummaries(peerId: nil, threadId: nil, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud) + let invalidatePollVotesKey = PostboxViewKey.invalidatedMessageHistoryTagSummaries(peerId: nil, threadId: nil, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud) + let disposable = postbox.combinedView(keys: [actionsKey, invalidateReactionsKey, invalidatePollVotesKey]).start(next: { view in var entries: [PendingMessageActionsEntry] = [] - var invalidateEntries = Set() + var invalidateReactionEntries = Set() + var invalidatePollVoteEntries = Set() if let v = view.views[actionsKey] as? PendingMessageActionsView { entries = v.entries } - if let v = view.views[invalidateKey] as? InvalidatedMessageHistoryTagSummariesView { - invalidateEntries = v.entries + if let v = view.views[invalidateReactionsKey] as? InvalidatedMessageHistoryTagSummariesView { + invalidateReactionEntries = v.entries + } + if let v = view.views[invalidatePollVotesKey] as? InvalidatedMessageHistoryTagSummariesView { + invalidatePollVoteEntries = v.entries } let (disposeOperations, beginOperations, beginValidateOperations) = helper.with { helper -> (disposeOperations: [Disposable], beginOperations: [(PendingMessageActionsEntry, MetaDisposable)], beginValidateOperations: [(InvalidatedMessageHistoryTagsSummaryEntry, MetaDisposable)]) in - return helper.update(entries: entries, invalidateEntries: invalidateEntries) + return helper.update(entries: entries, invalidateEntries: invalidateReactionEntries.union(invalidatePollVoteEntries)) } for disposable in disposeOperations { @@ -208,10 +213,10 @@ func managedReadReactionActions(postbox: Postbox, network: Network, stateManager } for (entry, disposable) in beginOperations { - let signal = withTakenAction(postbox: postbox, type: .readReaction, actionType: ReadReactionAction.self, id: entry.id, { transaction, entry -> Signal in + let signal = withTakenAction(postbox: postbox, type: .readReactionOrPollVote, actionType: ReadReactionAction.self, id: entry.id, { transaction, entry -> Signal in if let entry = entry { if let _ = entry.action as? ReadReactionAction { - return synchronizeReadMessageReactions(transaction: transaction, postbox: postbox, network: network, stateManager: stateManager, id: entry.id) + return synchronizeReadMessageReactionsOrPollVotes(transaction: transaction, postbox: postbox, network: network, stateManager: stateManager, id: entry.id) } else { assertionFailure() } @@ -219,14 +224,14 @@ func managedReadReactionActions(postbox: Postbox, network: Network, stateManager return .complete() }) |> then(postbox.transaction { transaction -> Void in - transaction.setPendingMessageAction(type: .readReaction, id: entry.id, action: nil) + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: entry.id, action: nil) }) disposable.set(signal.start()) } for (entry, disposable) in beginValidateOperations { - let signal = synchronizeUnseenReactionsTag(postbox: postbox, network: network, entry: entry) + let signal = synchronizeUnseenReactionsAndPollVotesTag(postbox: postbox, network: network, entry: entry) |> then(postbox.transaction { transaction -> Void in transaction.removeInvalidatedMessageHistoryTagsSummaryEntry(entry) }) @@ -315,7 +320,7 @@ private func synchronizeConsumeMessageContents(transaction: Transaction, postbox } } -private func synchronizeReadMessageReactions(transaction: Transaction, postbox: Postbox, network: Network, stateManager: AccountStateManager, id: MessageId) -> Signal { +private func synchronizeReadMessageReactionsOrPollVotes(transaction: Transaction, postbox: Postbox, network: Network, stateManager: AccountStateManager, id: MessageId) -> Signal { if id.peerId.namespace == Namespaces.Peer.CloudUser || id.peerId.namespace == Namespaces.Peer.CloudGroup { return network.request(Api.functions.messages.readMessageContents(id: [id.id])) |> map(Optional.init) @@ -331,7 +336,7 @@ private func synchronizeReadMessageReactions(transaction: Transaction, postbox: } } return postbox.transaction { transaction -> Void in - transaction.setPendingMessageAction(type: .readReaction, id: id, action: nil) + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: id, action: nil) transaction.updateMessage(id, update: { currentMessage in var storeForwardInfo: StoreMessageForwardInfo? if let forwardInfo = currentMessage.forwardInfo { @@ -344,9 +349,17 @@ private func synchronizeReadMessageReactions(transaction: Transaction, postbox: break loop } } + var media = currentMessage.media + loop: for j in 0 ..< media.count { + if let poll = media[j] as? TelegramMediaPoll { + media[j] = poll.withoutUnreadResults() + } + } + var updatedTags = currentMessage.tags updatedTags.remove(.unseenReaction) - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: updatedTags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) + updatedTags.remove(.unseenPollVote) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: updatedTags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: media)) }) } } @@ -358,7 +371,7 @@ private func synchronizeReadMessageReactions(transaction: Transaction, postbox: } |> mapToSignal { result -> Signal in return postbox.transaction { transaction -> Void in - transaction.setPendingMessageAction(type: .readReaction, id: id, action: nil) + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: id, action: nil) transaction.updateMessage(id, update: { currentMessage in var storeForwardInfo: StoreMessageForwardInfo? if let forwardInfo = currentMessage.forwardInfo { @@ -371,9 +384,16 @@ private func synchronizeReadMessageReactions(transaction: Transaction, postbox: break loop } } + var media = currentMessage.media + loop: for j in 0 ..< media.count { + if let poll = media[j] as? TelegramMediaPoll { + media[j] = poll.withoutUnreadResults() + } + } var updatedTags = currentMessage.tags updatedTags.remove(.unseenReaction) - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: updatedTags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) + updatedTags.remove(.unseenPollVote) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: updatedTags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: media)) }) } } @@ -429,7 +449,7 @@ private func synchronizeUnseenPersonalMentionsTag(postbox: Postbox, network: Net } |> switchToLatest } -private func synchronizeUnseenReactionsTag(postbox: Postbox, network: Network, entry: InvalidatedMessageHistoryTagsSummaryEntry) -> Signal { +private func synchronizeUnseenReactionsAndPollVotesTag(postbox: Postbox, network: Network, entry: InvalidatedMessageHistoryTagsSummaryEntry) -> Signal { return postbox.transaction { transaction -> Signal in if let peer = transaction.getPeer(entry.key.peerId), let inputPeer = apiInputPeer(peer) { return network.request(Api.functions.messages.getPeerDialogs(peers: [.inputDialogPeer(.init(peer: inputPeer))])) @@ -445,11 +465,13 @@ private func synchronizeUnseenReactionsTag(postbox: Postbox, network: Network, e if let dialog = dialogs.filter({ $0.peerId == entry.key.peerId }).first { let apiTopMessage: Int32 let apiUnreadReactionsCount: Int32 + let apiUnreadPollVoteCount: Int32 switch dialog { case let .dialog(dialogData): - let (topMessage, unreadReactionsCount) = (dialogData.topMessage, dialogData.unreadReactionsCount) + let (topMessage, unreadReactionsCount, unreadPollVoteCount) = (dialogData.topMessage, dialogData.unreadReactionsCount, dialogData.unreadPollVotesCount) apiTopMessage = topMessage apiUnreadReactionsCount = unreadReactionsCount + apiUnreadPollVoteCount = unreadPollVoteCount case .dialogFolder: assertionFailure() @@ -457,7 +479,12 @@ private func synchronizeUnseenReactionsTag(postbox: Postbox, network: Network, e } return postbox.transaction { transaction -> Void in - transaction.replaceMessageTagSummary(peerId: entry.key.peerId, threadId: nil, tagMask: entry.key.tagMask, namespace: entry.key.namespace, customTag: nil, count: apiUnreadReactionsCount, maxId: apiTopMessage) + transaction.replaceMessageTagSummary(peerId: entry.key.peerId, threadId: nil, tagMask: .unseenReaction, namespace: entry.key.namespace, customTag: nil, count: apiUnreadReactionsCount, maxId: apiTopMessage) + #if DEBUG + #else + //let _ = this_is_an_error + transaction.replaceMessageTagSummary(peerId: entry.key.peerId, threadId: nil, tagMask: .unseenPollVote, namespace: entry.key.namespace, customTag: nil, count: apiUnreadPollVoteCount, maxId: apiTopMessage) + #endif } } else { return .complete() diff --git a/submodules/TelegramCore/Sources/State/ManagedSynchronizeMarkAllUnseenPersonalMessagesOperations.swift b/submodules/TelegramCore/Sources/State/ManagedSynchronizeMarkAllUnseenPersonalMessagesOperations.swift index 754e773200..0e7be2ad28 100644 --- a/submodules/TelegramCore/Sources/State/ManagedSynchronizeMarkAllUnseenPersonalMessagesOperations.swift +++ b/submodules/TelegramCore/Sources/State/ManagedSynchronizeMarkAllUnseenPersonalMessagesOperations.swift @@ -333,15 +333,119 @@ private func synchronizeMarkAllUnseenReactions(transaction: Transaction, postbox } } -func markUnseenReactionMessage(transaction: Transaction, id: MessageId, addSynchronizeAction: Bool) { +func managedSynchronizeMarkAllUnseenPollVotesOperations(postbox: Postbox, network: Network, stateManager: AccountStateManager) -> Signal { + return Signal { _ in + let tag: PeerOperationLogTag = OperationLogTags.SynchronizeMarkAllUnseenPollVotes + + let helper = Atomic(value: ManagedSynchronizeMarkAllUnseenPersonalMessagesOperationsHelper()) + + let disposable = postbox.mergedOperationLogView(tag: tag, limit: 10).start(next: { view in + let (disposeOperations, beginOperations) = helper.with { helper -> (disposeOperations: [Disposable], beginOperations: [(PeerMergedOperationLogEntry, MetaDisposable)]) in + return helper.update(view.entries) + } + + for disposable in disposeOperations { + disposable.dispose() + } + + for (entry, disposable) in beginOperations { + let signal = withTakenOperation(postbox: postbox, peerId: entry.peerId, operationType: SynchronizeMarkAllUnseenReactionsOperation.self, tag: tag, tagLocalIndex: entry.tagLocalIndex, { transaction, entry -> Signal in + if let entry = entry { + if let operation = entry.contents as? SynchronizeMarkAllUnseenReactionsOperation { + return synchronizeMarkAllUnseenPollVotes(transaction: transaction, postbox: postbox, network: network, stateManager: stateManager, peerId: entry.peerId, operation: operation) + } else { + assertionFailure() + } + } + return .complete() + }) + |> then(postbox.transaction { transaction -> Void in + let _ = transaction.operationLogRemoveEntry(peerId: entry.peerId, tag: tag, tagLocalIndex: entry.tagLocalIndex) + }) + + disposable.set(signal.start()) + } + }) + + return ActionDisposable { + let disposables = helper.with { helper -> [Disposable] in + return helper.reset() + } + for disposable in disposables { + disposable.dispose() + } + disposable.dispose() + } + } +} + +private func synchronizeMarkAllUnseenPollVotes(transaction: Transaction, postbox: Postbox, network: Network, stateManager: AccountStateManager, peerId: PeerId, operation: SynchronizeMarkAllUnseenReactionsOperation) -> Signal { + guard let peer = transaction.getPeer(peerId) else { + return .complete() + } + guard let inputPeer = apiInputPeer(peer) else { + return .complete() + } + + var flags: Int32 = 0 + var topMsgId: Int32? + var savedPeerId: Api.InputPeer? + if let threadId = operation.threadId { + if peer.isMonoForum { + if let subPeerId = transaction.getPeer(PeerId(threadId)).flatMap(apiInputPeer) { + flags |= 1 << 1 + savedPeerId = subPeerId + } + } else { + flags |= 1 << 0 + topMsgId = Int32(clamping: threadId) + } + } + let _ = savedPeerId + + let signal = network.request(Api.functions.messages.readPollVotes(flags: flags, peer: inputPeer, topMsgId: topMsgId)) + |> map(Optional.init) + |> `catch` { _ -> Signal in + return .fail(true) + } + |> mapToSignal { result -> Signal in + if let result = result { + switch result { + case let .affectedHistory(affectedHistoryData): + let (pts, ptsCount, offset) = (affectedHistoryData.pts, affectedHistoryData.ptsCount, affectedHistoryData.offset) + stateManager.addUpdateGroups([.updatePts(pts: pts, ptsCount: ptsCount)]) + if offset == 0 { + return .fail(true) + } else { + return .complete() + } + } + } else { + return .fail(true) + } + } + return (signal |> restart) + |> `catch` { _ -> Signal in + return .complete() + } +} + +func markUnseenReactionOrPollVotesMessage(transaction: Transaction, id: MessageId, addSynchronizeAction: Bool) { if let message = transaction.getMessage(id) { var consume = false inner: for attribute in message.attributes { - if let attribute = attribute as? ReactionsMessageAttribute, !attribute.hasUnseen { + if let attribute = attribute as? ReactionsMessageAttribute, attribute.hasUnseen { consume = true break inner } } + inner: for media in message.media { + if let poll = media as? TelegramMediaPoll, poll.results.hasUnseenVotes == true { + consume = true + break inner + } + } + if consume { transaction.updateMessage(id, update: { currentMessage in var attributes = currentMessage.attributes @@ -351,13 +455,21 @@ func markUnseenReactionMessage(transaction: Transaction, id: MessageId, addSynch break loop } } + var media = currentMessage.media + loop: for j in 0 ..< media.count { + if let poll = media[j] as? TelegramMediaPoll { + media[j] = poll.withoutUnreadResults() + break loop + } + } var tags = currentMessage.tags tags.remove(.unseenReaction) - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) + tags.remove(.unseenPollVote) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: media)) }) if addSynchronizeAction { - transaction.setPendingMessageAction(type: .readReaction, id: id, action: ReadReactionAction()) + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: id, action: ReadReactionAction()) } } } diff --git a/submodules/TelegramCore/Sources/State/ResetState.swift b/submodules/TelegramCore/Sources/State/ResetState.swift index 58176e95f9..17ecf38997 100644 --- a/submodules/TelegramCore/Sources/State/ResetState.swift +++ b/submodules/TelegramCore/Sources/State/ResetState.swift @@ -48,6 +48,7 @@ func _internal_resetAccountState(postbox: Postbox, network: Network, accountPeer } transaction.replaceMessageTagSummary(peerId: threadMessageId.peerId, threadId: threadMessageId.threadId, tagMask: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadMentionCount, maxId: data.topMessageId) transaction.replaceMessageTagSummary(peerId: threadMessageId.peerId, threadId: threadMessageId.threadId, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadReactionCount, maxId: data.topMessageId) + transaction.replaceMessageTagSummary(peerId: threadMessageId.peerId, threadId: threadMessageId.threadId, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: data.unreadPollVoteCount, maxId: data.topMessageId) } transaction.updateCurrentPeerNotificationSettings(fetchedChats.notificationSettings) @@ -130,6 +131,9 @@ func _internal_resetAccountState(postbox: Postbox, network: Network, accountPeer for (peerId, summary) in fetchedChats.reactionTagSummaries { transaction.replaceMessageTagSummary(peerId: peerId, threadId: nil, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: summary.count, maxId: summary.range.maxId) } + for (peerId, summary) in fetchedChats.pollVoteTagSummaries { + transaction.replaceMessageTagSummary(peerId: peerId, threadId: nil, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: summary.count, maxId: summary.range.maxId) + } for (groupId, summary) in fetchedChats.folderSummaries { transaction.resetPeerGroupSummary(groupId: groupId, namespace: Namespaces.Message.Cloud, summary: summary) diff --git a/submodules/TelegramCore/Sources/State/Serialization.swift b/submodules/TelegramCore/Sources/State/Serialization.swift index dc7b329822..913e49ab09 100644 --- a/submodules/TelegramCore/Sources/State/Serialization.swift +++ b/submodules/TelegramCore/Sources/State/Serialization.swift @@ -186,6 +186,56 @@ private func recursiveDescription(redact: Bool, of value: Any) -> String { result.append(recursiveDescription(redact: redact, of: child.value)) } result.append("]") + case .class: + if let value = value as? ConstructorParameterDescription { + if let v = value.value { + result.append(recursiveDescription(redact: redact, of: v)) + } else { + result.append("nil") + } + } else if let value = value as? TypeConstructorDescription { + let (consName, fields) = value.descriptionFields() + result.append(".") + result.append(consName) + + let redactChildren: Set? + if redact { + redactChildren = redactChildrenOfType[result] + } else { + redactChildren = nil + } + + if !fields.isEmpty { + result.append("(") + var first = true + for (fieldName, fieldValue) in fields { + if first { + first = false + } else { + result.append(", ") + } + var redactValue: Bool = false + if let redactChildren = redactChildren, redactChildren.contains("*") { + redactValue = true + } + + result.append(fieldName) + result.append(": ") + if let redactChildren = redactChildren, redactChildren.contains(fieldName) { + redactValue = true + } + + if redactValue { + result.append("[[redacted]]") + } else { + result.append(recursiveDescription(redact: redact, of: fieldValue)) + } + } + result.append(")") + } + } else { + result.append("\(value)") + } default: result.append("\(value)") } diff --git a/submodules/TelegramCore/Sources/State/SynchronizeMarkAllUnseenPersonalMessagesOperation.swift b/submodules/TelegramCore/Sources/State/SynchronizeMarkAllUnseenPersonalMessagesOperation.swift index 1183e351eb..9914df6097 100644 --- a/submodules/TelegramCore/Sources/State/SynchronizeMarkAllUnseenPersonalMessagesOperation.swift +++ b/submodules/TelegramCore/Sources/State/SynchronizeMarkAllUnseenPersonalMessagesOperation.swift @@ -46,3 +46,25 @@ func addSynchronizeMarkAllUnseenReactionsOperation(transaction: Transaction, pee transaction.operationLogAddEntry(peerId: peerId, tag: tag, tagLocalIndex: .automatic, tagMergedIndex: .automatic, contents: SynchronizeMarkAllUnseenReactionsOperation(threadId: threadId, maxId: maxId)) } + +func addSynchronizeMarkAllUnseenPollVotesOperation(transaction: Transaction, peerId: PeerId, maxId: MessageId.Id, threadId: Int64?) { + let tag: PeerOperationLogTag = OperationLogTags.SynchronizeMarkAllUnseenPollVotes + var topLocalIndex: Int32? + var currentMaxId: MessageId.Id? + transaction.operationLogEnumerateEntries(peerId: peerId, tag: tag, { entry in + topLocalIndex = entry.tagLocalIndex + if let operation = entry.contents as? SynchronizeMarkAllUnseenReactionsOperation, operation.threadId == threadId { + currentMaxId = operation.maxId + } + return false + }) + + if let topLocalIndex = topLocalIndex { + if let currentMaxId = currentMaxId, currentMaxId >= maxId { + return + } + let _ = transaction.operationLogRemoveEntry(peerId: peerId, tag: tag, tagLocalIndex: topLocalIndex) + } + + transaction.operationLogAddEntry(peerId: peerId, tag: tag, tagLocalIndex: .automatic, tagMergedIndex: .automatic, contents: SynchronizeMarkAllUnseenReactionsOperation(threadId: threadId, maxId: maxId)) +} diff --git a/submodules/TelegramCore/Sources/SyncCore/SyncCore_Namespaces.swift b/submodules/TelegramCore/Sources/SyncCore/SyncCore_Namespaces.swift index 9d292c137b..d066310c99 100644 --- a/submodules/TelegramCore/Sources/SyncCore/SyncCore_Namespaces.swift +++ b/submodules/TelegramCore/Sources/SyncCore/SyncCore_Namespaces.swift @@ -180,8 +180,9 @@ public extension MessageTags { static let voice = MessageTags(rawValue: 1 << 12) static let roundVideo = MessageTags(rawValue: 1 << 13) static let polls = MessageTags(rawValue: 1 << 14) + static let unseenPollVote = MessageTags(rawValue: 1 << 15) - static let all: MessageTags = [.photoOrVideo, .file, .music, .webPage, .voiceOrInstantVideo, .unseenPersonalMessage, .liveLocation, .gif, .photo, .video, .pinned, .unseenReaction, .voice, .roundVideo, .polls] + static let all: MessageTags = [.photoOrVideo, .file, .music, .webPage, .voiceOrInstantVideo, .unseenPersonalMessage, .liveLocation, .gif, .photo, .video, .pinned, .unseenReaction, .voice, .roundVideo, .polls, .unseenPollVote] } public extension GlobalMessageTags { @@ -200,7 +201,7 @@ public extension PendingMessageActionType { static let consumeUnseenPersonalMessage = PendingMessageActionType(rawValue: 0) static let updateReaction = PendingMessageActionType(rawValue: 1) static let sendScheduledMessageImmediately = PendingMessageActionType(rawValue: 2) - static let readReaction = PendingMessageActionType(rawValue: 3) + static let readReactionOrPollVote = PendingMessageActionType(rawValue: 3) static let sendStarsReaction = PendingMessageActionType(rawValue: 4) static let sendPostponedPaidMessage = PendingMessageActionType(rawValue: 5) } @@ -235,6 +236,7 @@ public struct OperationLogTags { public static let SynchronizeViewStories = PeerOperationLogTag(value: 24) public static let SynchronizePeerStories = PeerOperationLogTag(value: 25) public static let SynchronizePinnedSavedChats = PeerOperationLogTag(value: 26) + public static let SynchronizeMarkAllUnseenPollVotes = PeerOperationLogTag(value: 27) } public struct LegacyPeerSummaryCounterTags: OptionSet, Sequence, Hashable { diff --git a/submodules/TelegramCore/Sources/SyncCore/SyncCore_StandaloneAccountTransaction.swift b/submodules/TelegramCore/Sources/SyncCore/SyncCore_StandaloneAccountTransaction.swift index 8a14130c4d..cbb1035e4c 100644 --- a/submodules/TelegramCore/Sources/SyncCore/SyncCore_StandaloneAccountTransaction.swift +++ b/submodules/TelegramCore/Sources/SyncCore/SyncCore_StandaloneAccountTransaction.swift @@ -45,8 +45,8 @@ public let telegramPostboxSeedConfiguration: SeedConfiguration = { return nil }, existingMessageTags: MessageTags.all, - messageTagsWithSummary: [.unseenPersonalMessage, .pinned, .video, .photo, .gif, .music, .voiceOrInstantVideo, .webPage, .file, .unseenReaction], - messageTagsWithThreadSummary: [.unseenPersonalMessage, .unseenReaction], + messageTagsWithSummary: [.unseenPersonalMessage, .pinned, .video, .photo, .gif, .music, .voiceOrInstantVideo, .webPage, .file, .unseenReaction, .unseenPollVote], + messageTagsWithThreadSummary: [.unseenPersonalMessage, .unseenReaction, .unseenPollVote], existingGlobalMessageTags: GlobalMessageTags.all, peerNamespacesRequiringMessageTextIndex: [Namespaces.Peer.SecretChat], peerSummaryCounterTags: { peer, isContact in diff --git a/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaPoll.swift b/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaPoll.swift index 99912bcd06..703a6a0f46 100644 --- a/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaPoll.swift +++ b/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaPoll.swift @@ -139,12 +139,14 @@ public struct TelegramMediaPollResults: Equatable, PostboxCoding { public let totalVoters: Int32? public let recentVoters: [PeerId] public let solution: TelegramMediaPollResults.Solution? + public let hasUnseenVotes: Bool? - public init(voters: [TelegramMediaPollOptionVoters]?, totalVoters: Int32?, recentVoters: [PeerId], solution: TelegramMediaPollResults.Solution?) { + public init(voters: [TelegramMediaPollOptionVoters]?, totalVoters: Int32?, recentVoters: [PeerId], solution: TelegramMediaPollResults.Solution?, hasUnseenVotes: Bool?) { self.voters = voters self.totalVoters = totalVoters self.recentVoters = recentVoters self.solution = solution + self.hasUnseenVotes = hasUnseenVotes } public init(decoder: PostboxDecoder) { @@ -158,6 +160,7 @@ public struct TelegramMediaPollResults: Equatable, PostboxCoding { } else { self.solution = nil } + self.hasUnseenVotes = decoder.decodeOptionalBoolForKey("uns") } public func encode(_ encoder: PostboxEncoder) { @@ -183,6 +186,11 @@ public struct TelegramMediaPollResults: Equatable, PostboxCoding { } else { encoder.encodeNil(forKey: "sol") } + if let hasUnseenVotes = self.hasUnseenVotes { + encoder.encodeBool(hasUnseenVotes, forKey: "uns") + } else { + encoder.encodeNil(forKey: "uns") + } } } @@ -299,7 +307,7 @@ public final class TelegramMediaPoll: Media, Equatable { self.textEntities = decoder.decodeObjectArrayWithDecoderForKey("te") self.options = decoder.decodeObjectArrayWithDecoderForKey("os") self.correctAnswers = decoder.decodeOptionalDataArrayForKey("ca") - self.results = decoder.decodeObjectForKey("rs", decoder: { TelegramMediaPollResults(decoder: $0) }) as? TelegramMediaPollResults ?? TelegramMediaPollResults(voters: nil, totalVoters: nil, recentVoters: [], solution: nil) + self.results = decoder.decodeObjectForKey("rs", decoder: { TelegramMediaPollResults(decoder: $0) }) as? TelegramMediaPollResults ?? TelegramMediaPollResults(voters: nil, totalVoters: nil, recentVoters: [], solution: nil, hasUnseenVotes: nil) self.isClosed = decoder.decodeInt32ForKey("ic", orElse: 0) != 0 self.deadlineTimeout = decoder.decodeOptionalInt32ForKey("dt") self.deadlineDate = decoder.decodeOptionalInt32ForKey("dd") @@ -438,15 +446,21 @@ public final class TelegramMediaPoll: Media, Equatable { } updatedResults = TelegramMediaPollResults(voters: updatedVoters.map({ voters in return TelegramMediaPollOptionVoters(selected: selectedOpaqueIdentifiers.contains(voters.opaqueIdentifier), opaqueIdentifier: voters.opaqueIdentifier, count: voters.count, isCorrect: correctOpaqueIdentifiers.contains(voters.opaqueIdentifier), recentVoters: voters.recentVoters) - }), totalVoters: results.totalVoters, recentVoters: results.recentVoters, solution: results.solution ?? self.results.solution) + }), totalVoters: results.totalVoters, recentVoters: results.recentVoters, solution: results.solution ?? self.results.solution, hasUnseenVotes: results.hasUnseenVotes ?? self.results.hasUnseenVotes) } else if let updatedVoters = results.voters { - updatedResults = TelegramMediaPollResults(voters: updatedVoters, totalVoters: results.totalVoters, recentVoters: results.recentVoters, solution: results.solution ?? self.results.solution) + updatedResults = TelegramMediaPollResults(voters: updatedVoters, totalVoters: results.totalVoters, recentVoters: results.recentVoters, solution: results.solution ?? self.results.solution, hasUnseenVotes: results.hasUnseenVotes ?? self.results.hasUnseenVotes) } else { - updatedResults = TelegramMediaPollResults(voters: self.results.voters, totalVoters: results.totalVoters, recentVoters: results.recentVoters, solution: results.solution ?? self.results.solution) + updatedResults = TelegramMediaPollResults(voters: self.results.voters, totalVoters: results.totalVoters, recentVoters: results.recentVoters, solution: results.solution ?? self.results.solution, hasUnseenVotes: results.hasUnseenVotes ?? self.results.hasUnseenVotes) } } else { updatedResults = results } return TelegramMediaPoll(pollId: self.pollId, publicity: self.publicity, kind: self.kind, text: self.text, textEntities: self.textEntities, options: self.options, correctAnswers: self.correctAnswers, results: updatedResults, isClosed: self.isClosed, deadlineTimeout: self.deadlineTimeout, deadlineDate: self.deadlineDate, pollHash: self.pollHash, openAnswers: self.openAnswers, revotingDisabled: self.revotingDisabled, shuffleAnswers: self.shuffleAnswers, hideResultsUntilClose: self.hideResultsUntilClose, isCreator: self.isCreator, attachedMedia: self.attachedMedia) } + + public func withoutUnreadResults() -> TelegramMediaPoll { + let updatedResults = TelegramMediaPollResults(voters: self.results.voters, totalVoters: self.results.totalVoters, recentVoters: self.results.recentVoters, solution: self.results.solution, hasUnseenVotes: false) + return TelegramMediaPoll(pollId: self.pollId, publicity: self.publicity, kind: self.kind, text: self.text, textEntities: self.textEntities, options: self.options, correctAnswers: self.correctAnswers, results: updatedResults, isClosed: self.isClosed, deadlineTimeout: self.deadlineTimeout, deadlineDate: self.deadlineDate, pollHash: self.pollHash, openAnswers: self.openAnswers, revotingDisabled: self.revotingDisabled, shuffleAnswers: self.shuffleAnswers, hideResultsUntilClose: self.hideResultsUntilClose, isCreator: self.isCreator, attachedMedia: self.attachedMedia) + } } + diff --git a/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramUser.swift b/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramUser.swift index be2637e7d4..bcc02ef022 100644 --- a/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramUser.swift +++ b/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramUser.swift @@ -44,6 +44,7 @@ public struct BotUserInfoFlags: OptionSet { public static let hasWebApp = BotUserInfoFlags(rawValue: (1 << 7)) public static let hasForum = BotUserInfoFlags(rawValue: (1 << 8)) public static let forumManagedByUser = BotUserInfoFlags(rawValue: (1 << 9)) + public static let canManageBots = BotUserInfoFlags(rawValue: (1 << 10)) } public struct BotUserInfo: PostboxCoding, Equatable { diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/ApplyMaxReadIndexInteractively.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/ApplyMaxReadIndexInteractively.swift index a9ccb61451..ba4fea3d0b 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/ApplyMaxReadIndexInteractively.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/ApplyMaxReadIndexInteractively.swift @@ -319,12 +319,12 @@ public func clearPeerUnseenPersonalMessagesInteractively(account: Account, peerI |> ignoreValues } -public func clearPeerUnseenReactionsInteractively(account: Account, peerId: PeerId, threadId: Int64?) -> Signal { +public func clearPeerUnseenReactionsAndPollVotesInteractively(account: Account, peerId: PeerId, threadId: Int64?) -> Signal { return account.postbox.transaction { transaction -> Void in if peerId.namespace == Namespaces.Peer.SecretChat { return } - account.viewTracker.updateMarkAllReactionsSeen(peerId: peerId, threadId: threadId) + account.viewTracker.updateMarkAllReactionsAndPollVotesSeen(peerId: peerId, threadId: threadId) } |> ignoreValues } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/ChatList.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/ChatList.swift index a893ace4dc..65a2d3a3d2 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/ChatList.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/ChatList.swift @@ -155,6 +155,7 @@ public final class EngineChatList: Equatable { public let presence: EnginePeer.Presence? public let hasUnseenMentions: Bool public let hasUnseenReactions: Bool + public let hasUnseenPollVotes: Bool public let forumTopicData: ForumTopicData? public let topForumTopicItems: [EngineChatList.ForumTopicData] public let hasFailed: Bool @@ -177,6 +178,7 @@ public final class EngineChatList: Equatable { presence: EnginePeer.Presence?, hasUnseenMentions: Bool, hasUnseenReactions: Bool, + hasUnseenPollVotes: Bool, forumTopicData: ForumTopicData?, topForumTopicItems: [EngineChatList.ForumTopicData], hasFailed: Bool, @@ -198,6 +200,7 @@ public final class EngineChatList: Equatable { self.presence = presence self.hasUnseenMentions = hasUnseenMentions self.hasUnseenReactions = hasUnseenReactions + self.hasUnseenPollVotes = hasUnseenPollVotes self.forumTopicData = forumTopicData self.topForumTopicItems = topForumTopicItems self.hasFailed = hasFailed @@ -243,6 +246,9 @@ public final class EngineChatList: Equatable { if lhs.hasUnseenReactions != rhs.hasUnseenReactions { return false } + if lhs.hasUnseenPollVotes != rhs.hasUnseenPollVotes { + return false + } if lhs.forumTopicData != rhs.forumTopicData { return false } @@ -526,9 +532,17 @@ extension EngineChatList.Item { var hasUnseenReactions = false if let info = tagSummaryInfo[ChatListEntryMessageTagSummaryKey( tag: .unseenReaction, - actionType: PendingMessageActionType.readReaction + actionType: PendingMessageActionType.readReactionOrPollVote )] { - hasUnseenReactions = (info.tagSummaryCount ?? 0) != 0// > (info.actionsSummaryCount ?? 0) + hasUnseenReactions = (info.tagSummaryCount ?? 0) != 0 + } + + var hasUnseenPollVotes = false + if let info = tagSummaryInfo[ChatListEntryMessageTagSummaryKey( + tag: .unseenPollVote, + actionType: PendingMessageActionType.readReactionOrPollVote + )] { + hasUnseenPollVotes = (info.tagSummaryCount ?? 0) != 0 } var forumTopicDataValue: EngineChatList.ForumTopicData? @@ -569,6 +583,7 @@ extension EngineChatList.Item { presence: presence.flatMap(EnginePeer.Presence.init), hasUnseenMentions: hasUnseenMentions, hasUnseenReactions: hasUnseenReactions, + hasUnseenPollVotes: hasUnseenPollVotes, forumTopicData: forumTopicDataValue, topForumTopicItems: topForumTopicItems, hasFailed: hasFailed, diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/EarliestUnseenPersonalMentionMessage.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/EarliestUnseenPersonalMentionMessage.swift index f150b9cb93..da4635e46f 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/EarliestUnseenPersonalMentionMessage.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/EarliestUnseenPersonalMentionMessage.swift @@ -125,7 +125,74 @@ func _internal_earliestUnseenPersonalReactionMessage(account: Account, peerId: P transaction.removeHole(peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, space: .tag(.unseenReaction), range: 1 ... (Int32.max - 1)) let ids = transaction.getMessageIndicesWithTag(peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, tag: .unseenReaction).map({ $0.id }) for id in ids { - markUnseenReactionMessage(transaction: transaction, id: id, addSynchronizeAction: false) + markUnseenReactionOrPollVotesMessage(transaction: transaction, id: id, addSynchronizeAction: false) + } + } + + return .result(nil) + } + } + } + |> distinctUntilChanged + |> take(until: { value in + if case .result = value { + return SignalTakeAction(passthrough: true, complete: true) + } else { + return SignalTakeAction(passthrough: true, complete: false) + } + }) +} + +func _internal_earliestUnseenPollVoteMessage(account: Account, peerId: PeerId, threadId: Int64?) -> Signal { + return account.viewTracker.aroundMessageHistoryViewForLocation(.peer(peerId: peerId, threadId: threadId), index: .lowerBound, anchorIndex: .lowerBound, count: 4, fixedCombinedReadStates: nil, tag: .tag(.unseenPollVote), additionalData: [.peerChatState(peerId)]) + |> mapToSignal { view -> Signal in + if view.0.isLoading { + return .single(.loading) + } + if case .FillHole = view.1 { + return _internal_earliestUnseenPollVoteMessage(account: account, peerId: peerId, threadId: threadId) + } + if let message = view.0.entries.first?.message { + if peerId.namespace == Namespaces.Peer.CloudChannel { + var invalidatedPts: Int32? + for data in view.0.additionalData { + switch data { + case let .peerChatState(_, state): + if let state = state as? ChannelState { + invalidatedPts = state.invalidatedPts + } + default: + break + } + } + if let invalidatedPts = invalidatedPts { + var messagePts: Int32? + for attribute in message.attributes { + if let attribute = attribute as? ChannelMessageStateVersionAttribute { + messagePts = attribute.pts + break + } + } + + if let messagePts = messagePts { + if messagePts < invalidatedPts { + return .single(.loading) + } + } + } + return .single(.result(message.id)) + } else { + return .single(.result(message.id)) + } + } else { + return account.postbox.transaction { transaction -> EarliestUnseenPersonalMentionMessageResult in + if let topId = transaction.getTopPeerMessageId(peerId: peerId, namespace: Namespaces.Message.Cloud) { + transaction.replaceMessageTagSummary(peerId: peerId, threadId: threadId, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: 0, maxId: topId.id) + + transaction.removeHole(peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, space: .tag(.unseenPollVote), range: 1 ... (Int32.max - 1)) + let ids = transaction.getMessageIndicesWithTag(peerId: peerId, threadId: threadId, namespace: Namespaces.Message.Cloud, tag: .unseenPollVote).map({ $0.id }) + for id in ids { + markUnseenReactionOrPollVotesMessage(transaction: transaction, id: id, addSynchronizeAction: false) } } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/InstallInteractiveReadMessagesAction.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/InstallInteractiveReadMessagesAction.swift index 82b0b75c7a..b53c8606d3 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/InstallInteractiveReadMessagesAction.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/InstallInteractiveReadMessagesAction.swift @@ -6,8 +6,7 @@ import SwiftSignalKit func _internal_installInteractiveReadMessagesAction(postbox: Postbox, stateManager: AccountStateManager, peerId: PeerId, threadId: Int64?) -> Disposable { return postbox.installStoreMessageAction(peerId: peerId, { messages, transaction in var consumeMessageIds: [MessageId] = [] - var readReactionIds: [MessageId] = [] - readReactionIds.removeAll() + var readReactionOrPollVotesIds: [MessageId] = [] var readMessageIndexByNamespace: [MessageId.Namespace: MessageIndex] = [:] @@ -21,9 +20,10 @@ func _internal_installInteractiveReadMessagesAction(postbox: Postbox, stateManag var hasUnconsumedMention = false var hasUnconsumedContent = false var hasUnseenReactions = false + var hasUnseenPollVotes = false - if message.tags.contains(.unseenPersonalMessage) || message.tags.contains(.unseenReaction) { - inner: for attribute in message.attributes { + if message.tags.contains(.unseenPersonalMessage) || message.tags.contains(.unseenReaction) || message.tags.contains(.unseenPollVote) { + for attribute in message.attributes { if let attribute = attribute as? ConsumablePersonalMentionMessageAttribute, !attribute.consumed, !attribute.pending { hasUnconsumedMention = true } else if let attribute = attribute as? ConsumableContentMessageAttribute, !attribute.consumed { @@ -32,13 +32,20 @@ func _internal_installInteractiveReadMessagesAction(postbox: Postbox, stateManag hasUnseenReactions = true } } + for media in message.media { + if let poll = media as? TelegramMediaPoll { + if poll.results.hasUnseenVotes == true { + hasUnseenPollVotes = true + } + } + } } if hasUnconsumedMention && !hasUnconsumedContent { consumeMessageIds.append(id) } - if hasUnseenReactions { - //readReactionIds.append(id) + if hasUnseenReactions || hasUnseenPollVotes { + readReactionOrPollVotesIds.append(id) } if !message.flags.intersection(.IsIncomingMask).isEmpty { @@ -51,7 +58,7 @@ func _internal_installInteractiveReadMessagesAction(postbox: Postbox, stateManag } } - for id in Set(consumeMessageIds + readReactionIds) { + for id in Set(consumeMessageIds + readReactionOrPollVotesIds) { transaction.updateMessage(id, update: { currentMessage in var attributes = currentMessage.attributes if consumeMessageIds.contains(id) { @@ -63,23 +70,31 @@ func _internal_installInteractiveReadMessagesAction(postbox: Postbox, stateManag } } var tags = currentMessage.tags - if readReactionIds.contains(id) { + var media = currentMessage.media + if readReactionOrPollVotesIds.contains(id) { reactionsLoop: for j in 0 ..< attributes.count { if let attribute = attributes[j] as? ReactionsMessageAttribute { attributes[j] = attribute.withAllSeen() break reactionsLoop } } + pollVoteLoop: for j in 0 ..< media.count { + if let poll = media[j] as? TelegramMediaPoll { + media[j] = poll.withoutUnreadResults() + break pollVoteLoop + } + } tags.remove(.unseenReaction) + tags.remove(.unseenPollVote) } - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: media)) }) if consumeMessageIds.contains(id) { transaction.setPendingMessageAction(type: .consumeUnseenPersonalMessage, id: id, action: ConsumePersonalMessageAction()) } - if readReactionIds.contains(id) { - transaction.setPendingMessageAction(type: .readReaction, id: id, action: ReadReactionAction()) + if readReactionOrPollVotesIds.contains(id) { + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: id, action: ReadReactionAction()) } } @@ -149,6 +164,7 @@ private final class StoreOrUpdateMessageActionImpl: StoreOrUpdateMessageAction { func addOrUpdate(messages: [StoreMessage], transaction: Transaction) { var readReactionIds: [MessageId: [ReactionsMessageAttribute.RecentPeer]] = [:] + var readPollVoteIds = Set() guard let visibleRange = self.getVisibleRange() else { return @@ -170,22 +186,33 @@ private final class StoreOrUpdateMessageActionImpl: StoreOrUpdateMessageAction { } } } + if message.tags.contains(.unseenPollVote) { + readPollVoteIds.insert(index.id) + } } - for id in readReactionIds.keys { + for id in Set(readReactionIds.keys).union(readPollVoteIds) { transaction.updateMessage(id, update: { currentMessage in var attributes = currentMessage.attributes + var media = currentMessage.media reactionsLoop: for j in 0 ..< attributes.count { if let attribute = attributes[j] as? ReactionsMessageAttribute { attributes[j] = attribute.withAllSeen() break reactionsLoop } } + pollVotesLoop: for j in 0 ..< media.count { + if let poll = media[j] as? TelegramMediaPoll { + media[j] = poll.withoutUnreadResults() + break pollVotesLoop + } + } var tags = currentMessage.tags tags.remove(.unseenReaction) - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: currentMessage.media)) + tags.remove(.unseenPollVote) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: currentMessage.forwardInfo.flatMap(StoreMessageForwardInfo.init), authorId: currentMessage.author?.id, text: currentMessage.text, attributes: attributes, media: media)) }) - transaction.setPendingMessageAction(type: .readReaction, id: id, action: ReadReactionAction()) + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: id, action: ReadReactionAction()) } self.didReadReactionsInMessages(readReactionIds) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/MarkMessageContentAsConsumedInteractively.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/MarkMessageContentAsConsumedInteractively.swift index 57d89f8f5e..43408c150c 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/MarkMessageContentAsConsumedInteractively.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/MarkMessageContentAsConsumedInteractively.swift @@ -127,11 +127,12 @@ func _internal_markMessageContentAsConsumedInteractively(postbox: Postbox, messa } } -func _internal_markReactionsAsSeenInteractively(postbox: Postbox, messageId: MessageId) -> Signal { +func _internal_markReactionsOrPollVotesAsSeenInteractively(postbox: Postbox, messageId: MessageId) -> Signal { return postbox.transaction { transaction -> Void in - if let message = transaction.getMessage(messageId), message.tags.contains(.unseenReaction) { + if let message = transaction.getMessage(messageId), (message.tags.contains(.unseenReaction) || message.tags.contains(.unseenPollVote)) { var updateMessage = false var updatedAttributes = message.attributes + var updatedMedia = message.media for i in 0 ..< updatedAttributes.count { if let attribute = updatedAttributes[i] as? ReactionsMessageAttribute, attribute.hasUnseen { @@ -140,7 +141,18 @@ func _internal_markReactionsAsSeenInteractively(postbox: Postbox, messageId: Mes if message.id.peerId.namespace == Namespaces.Peer.SecretChat { } else { - transaction.setPendingMessageAction(type: .readReaction, id: messageId, action: ReadReactionAction()) + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: messageId, action: ReadReactionAction()) + } + } + } + for i in 0 ..< updatedMedia.count { + if let poll = updatedMedia[i] as? TelegramMediaPoll { + updatedMedia[i] = poll.withoutUnreadResults() + updateMessage = true + + if message.id.peerId.namespace == Namespaces.Peer.SecretChat { + } else { + transaction.setPendingMessageAction(type: .readReactionOrPollVote, id: messageId, action: ReadReactionAction()) } } } @@ -153,7 +165,8 @@ func _internal_markReactionsAsSeenInteractively(postbox: Postbox, messageId: Mes } var tags = currentMessage.tags tags.remove(.unseenReaction) - return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: updatedAttributes, media: currentMessage.media)) + tags.remove(.unseenPollVote) + return .update(StoreMessage(id: currentMessage.id, customStableId: nil, globallyUniqueId: currentMessage.globallyUniqueId, groupingKey: currentMessage.groupingKey, threadId: currentMessage.threadId, timestamp: currentMessage.timestamp, flags: StoreMessageFlags(currentMessage.flags), tags: tags, globalTags: currentMessage.globalTags, localTags: currentMessage.localTags, forwardInfo: storeForwardInfo, authorId: currentMessage.author?.id, text: currentMessage.text, attributes: updatedAttributes, media: updatedMedia)) }) } } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift index 4af384589e..8543ebfa2c 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/TelegramEngineMessages.swift @@ -301,7 +301,23 @@ public extension TelegramEngine { return .single(result) case let .result(messageId): if messageId == nil { - let _ = clearPeerUnseenReactionsInteractively(account: account, peerId: peerId, threadId: threadId).start() + let _ = clearPeerUnseenReactionsAndPollVotesInteractively(account: account, peerId: peerId, threadId: threadId).start() + } + return .single(result) + } + } + } + + public func earliestUnseenPollVoteMessage(peerId: PeerId, threadId: Int64?) -> Signal { + let account = self.account + return _internal_earliestUnseenPollVoteMessage(account: self.account, peerId: peerId, threadId: threadId) + |> mapToSignal { result -> Signal in + switch result { + case .loading: + return .single(result) + case let .result(messageId): + if messageId == nil { + let _ = clearPeerUnseenReactionsAndPollVotesInteractively(account: account, peerId: peerId, threadId: threadId).start() } return .single(result) } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/Translate.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/Translate.swift index 8e0f16f60e..ee447599d6 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/Translate.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/Translate.swift @@ -417,14 +417,16 @@ public enum TelegramComposeAIMessageMode { public struct Style: Equatable { public let name: String public let emoji: String + public let emojiFileId: Int64? public var id: StyleId { return .style(self.name) } - public init(name: String, emoji: String) { + public init(name: String, emoji: String, emojiFileId: Int64?) { self.name = name self.emoji = emoji + self.emojiFileId = emojiFileId } } @@ -458,7 +460,8 @@ func _internal_composeAIMessageStyles(account: Account) -> Signal<[TelegramCompo if let data = currentAppConfiguration(transaction: transaction).data, let value = data["ai_compose_styles"] as? [[String]] { for item in value { if item.count >= 2 { - result.append(TelegramComposeAIMessageMode.Style(name: item[1], emoji: item[0])) + let emojiFileId: Int64? = item.count > 2 ? Int64(item[2]) : nil + result.append(TelegramComposeAIMessageMode.Style(name: item[1], emoji: item[0], emojiFileId: emojiFileId)) } } } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift index 1412c0c9ea..a1a5efa82f 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift @@ -388,6 +388,7 @@ func _internal_sendBotRequestedPeer(account: Account, peerId: PeerId, messageId: public enum CreateBotError { case generic case occupied + case limitExceeded } func _internal_createBot(account: Account, name: String, username: String, managerPeerId: PeerId, viaDeeplink: Bool) -> Signal { @@ -410,6 +411,8 @@ func _internal_createBot(account: Account, name: String, username: String, manag |> mapError { error -> CreateBotError in if error.errorDescription == "USERNAME_OCCUPIED" { return .occupied + } else if error.errorDescription == "BOT_CREATE_LIMIT_EXCEEDED" { + return .limitExceeded } else { return .generic } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChatListFiltering.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChatListFiltering.swift index 6865fd2c14..8629381181 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChatListFiltering.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/ChatListFiltering.swift @@ -853,7 +853,7 @@ private func loadAndStorePeerChatInfos(accountPeerId: PeerId, postbox: Postbox, for dialog in dialogs { switch dialog { case let .dialog(dialogData): - let (peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, notifySettings, pts, folderId, ttlPeriod) = (dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.notifySettings, dialogData.pts, dialogData.folderId, dialogData.ttlPeriod) + let (peer, topMessage, readInboxMaxId, readOutboxMaxId, unreadCount, unreadMentionsCount, unreadReactionsCount, unreadPollVoteCount, notifySettings, pts, folderId, ttlPeriod) = (dialogData.peer, dialogData.topMessage, dialogData.readInboxMaxId, dialogData.readOutboxMaxId, dialogData.unreadCount, dialogData.unreadMentionsCount, dialogData.unreadReactionsCount, dialogData.unreadPollVotesCount, dialogData.notifySettings, dialogData.pts, dialogData.folderId, dialogData.ttlPeriod) let peerId = peer.peerId if topMessage != 0 { @@ -913,6 +913,7 @@ private func loadAndStorePeerChatInfos(accountPeerId: PeerId, postbox: Postbox, transaction.replaceMessageTagSummary(peerId: peerId, threadId: nil, tagMask: .unseenPersonalMessage, namespace: Namespaces.Message.Cloud, customTag: nil, count: unreadMentionsCount, maxId: topMessage) transaction.replaceMessageTagSummary(peerId: peerId, threadId: nil, tagMask: .unseenReaction, namespace: Namespaces.Message.Cloud, customTag: nil, count: unreadReactionsCount, maxId: topMessage) + transaction.replaceMessageTagSummary(peerId: peerId, threadId: nil, tagMask: .unseenPollVote, namespace: Namespaces.Message.Cloud, customTag: nil, count: unreadPollVoteCount, maxId: topMessage) if let pts = pts { if transaction.getPeerChatState(peerId) == nil { diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift index 9204713413..51173eea52 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourceKey.swift @@ -256,6 +256,7 @@ public enum PresentationResourceKey: Int32 { case chatHistoryNavigationUpButtonImage case chatHistoryMentionsButtonImage case chatHistoryReactionsButtonImage + case chatHistoryPollVotesButtonImage case chatHistoryNavigationButtonBadgeImage case chatMessageAttachedContentButtonIncoming @@ -394,6 +395,8 @@ public enum PresentationResourceParameterKey: Hashable { case chatListBadgeBackgroundMention(CGFloat) case badgeBackgroundReactions(CGFloat) case badgeBackgroundInactiveReactions(CGFloat) + case badgeBackgroundPollVotes(CGFloat) + case badgeBackgroundInactivePollVotes(CGFloat) case chatListBadgeBackgroundInactiveMention(CGFloat) case chatListBadgeBackgroundPinned(CGFloat) case badgeBackgroundBorder(CGFloat) diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift index 6bb379aa4a..3bb0f88571 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChat.swift @@ -669,7 +669,19 @@ public struct PresentationResourcesChat { return generateImage(CGSize(width: 38.0, height: 38.0), contextGenerator: { size, context in context.clear(CGRect(origin: CGPoint(), size: size)) - if let image = generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Reactions"), color: UIColor.white), let cgImage = image.cgImage { + if let image = generateTintedImage(image: UIImage(bundleImageName: "Chat/NavigateToReactions"), color: UIColor.white), let cgImage = image.cgImage { + context.draw(cgImage, in: CGRect(origin: CGPoint(x: floor((size.width - image.size.width) / 2.0), y: floor((size.height - image.size.height) / 2.0)), size: image.size)) + } + })?.withRenderingMode(.alwaysTemplate) + }) + } + + public static func chatHistoryPollVotesButtonImage(_ theme: PresentationTheme) -> UIImage? { + return theme.image(PresentationResourceKey.chatHistoryPollVotesButtonImage.rawValue, { theme in + return generateImage(CGSize(width: 38.0, height: 38.0), contextGenerator: { size, context in + context.clear(CGRect(origin: CGPoint(), size: size)) + + if let image = generateTintedImage(image: UIImage(bundleImageName: "Chat/NavigateToPollVotes"), color: UIColor.white), let cgImage = image.cgImage { context.draw(cgImage, in: CGRect(origin: CGPoint(x: floor((size.width - image.size.width) / 2.0), y: floor((size.height - image.size.height) / 2.0)), size: image.size)) } })?.withRenderingMode(.alwaysTemplate) diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift index 8e5c2cc67f..9a09cfb296 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift @@ -230,6 +230,18 @@ public struct PresentationResourcesChatList { }) } + public static func badgeBackgroundPollVotes(_ theme: PresentationTheme, diameter: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.badgeBackgroundPollVotes(diameter), { theme in + return generateTintedImage(image: UIImage(bundleImageName: "Chat List/PollVotesBadgeIcon"), color: theme.chatList.unreadBadgeActiveBackgroundColor) + }) + } + + public static func badgeBackgroundInactivePollVotes(_ theme: PresentationTheme, diameter: CGFloat) -> UIImage? { + return theme.image(PresentationResourceParameterKey.badgeBackgroundInactivePollVotes(diameter), { theme in + return generateTintedImage(image: UIImage(bundleImageName: "Chat List/PollVotesBadgeIcon"), color: theme.chatList.unreadBadgeInactiveBackgroundColor) + }) + } + public static func badgeBackgroundPinned(_ theme: PresentationTheme, diameter: CGFloat) -> UIImage? { return theme.image(PresentationResourceParameterKey.chatListBadgeBackgroundPinned(diameter), { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat List/PeerPinnedIcon"), color: theme.chatList.pinnedBadgeColor) diff --git a/submodules/TelegramUI/Components/Chat/ChatInlineSearchResultsListComponent/Sources/ChatInlineSearchResultsListComponent.swift b/submodules/TelegramUI/Components/Chat/ChatInlineSearchResultsListComponent/Sources/ChatInlineSearchResultsListComponent.swift index cf160abb9f..f1cd0c2990 100644 --- a/submodules/TelegramUI/Components/Chat/ChatInlineSearchResultsListComponent/Sources/ChatInlineSearchResultsListComponent.swift +++ b/submodules/TelegramUI/Components/Chat/ChatInlineSearchResultsListComponent/Sources/ChatInlineSearchResultsListComponent.swift @@ -1043,6 +1043,7 @@ public final class ChatInlineSearchResultsListComponent: Component { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, @@ -1082,6 +1083,7 @@ public final class ChatInlineSearchResultsListComponent: Component { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: item.draft.flatMap(ChatListItemContent.DraftState.init(draft:)), mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift index 68a8987f95..f0465c0afe 100644 --- a/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatTextInputPanelNode/Sources/ChatTextInputPanelNode.swift @@ -248,6 +248,9 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg private var aiButton: (button: HighlightTrackingButton, icon: UIImageView)? private var heightDependentAiButtonAlpha: CGFloat = 0.0 + private var inlineAiButtonAlpha: CGFloat = 0.0 + private var inlineAiButton: (button: HighlightTrackingButton, icon: UIImageView)? + private let aiButtonMinTextLength: Int = 50 public let menuButton: HighlightTrackingButtonNode private let menuButtonBackgroundView: GlassBackgroundView @@ -1209,6 +1212,15 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg break } } + if self.isAIEnabled && width >= 500.0 { + if firstButton { + firstButton = false + accessoryButtonsWidth += self.accessoryButtonInset + } else { + accessoryButtonsWidth += self.accessoryButtonSpacing + } + accessoryButtonsWidth += 32.0 + } var textFieldMinHeight: CGFloat = 35.0 var textInputViewRealInsets = UIEdgeInsets() @@ -3559,28 +3571,78 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg transition.updateFrame(view: aiButton.button, frame: aiButtonFrame) transition.updateFrame(view: aiButton.icon, frame: image.size.centered(in: aiButtonFrame)) } - var aiButtonAlpha: CGFloat = actualTextFieldFrame.height >= 70.0 ? 1.0 : 0.0 - self.heightDependentAiButtonAlpha = aiButtonAlpha - var inputHasText = false - if let textInputNode = self.textInputNode, let attributedText = textInputNode.attributedText, !attributedText.string.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { - inputHasText = true + let isWidePanel = width >= 500.0 + let isTallPanel = actualTextFieldFrame.height >= 70.0 + var inputText = "" + if let textInputNode = self.textInputNode, let attributedText = textInputNode.attributedText { + inputText = attributedText.string.trimmingCharacters(in: .whitespacesAndNewlines) } - if !inputHasText { - aiButtonAlpha = 0.0 + let inputHasText = !inputText.isEmpty + + let cornerAlpha: CGFloat = (!isWidePanel && isTallPanel && inputHasText) ? 1.0 : 0.0 + self.heightDependentAiButtonAlpha = (!isWidePanel && isTallPanel) ? 1.0 : 0.0 + ComponentTransition(transition).setAlpha(view: aiButton.button, alpha: cornerAlpha) + ComponentTransition(transition).setAlpha(view: aiButton.icon, alpha: cornerAlpha) + + let inlineAiButton: (button: HighlightTrackingButton, icon: UIImageView) + if let current = self.inlineAiButton { + inlineAiButton = current + } else { + inlineAiButton = (HighlightTrackingButton(), GlassBackgroundView.ContentImageView()) + self.inlineAiButton = inlineAiButton + inlineAiButton.button.highligthedChanged = { [weak self] highlighted in + guard let self, let inlineAiButton = self.inlineAiButton else { + return + } + if highlighted { + inlineAiButton.icon.alpha = 0.6 + } else { + let transition: ContainedViewLayoutTransition = .animated(duration: 0.25, curve: .easeInOut) + transition.updateAlpha(layer: inlineAiButton.icon.layer, alpha: 1.0) + } + } + inlineAiButton.button.addTarget(self, action: #selector(self.aiButtonPressed), for: .touchUpInside) + inlineAiButton.button.addSubview(inlineAiButton.icon) + inlineAiButton.icon.image = UIImage(bundleImageName: "Chat/Input/Text/InputAIIcon")?.withRenderingMode(.alwaysTemplate) + self.textInputContainerBackgroundView.contentView.addSubview(inlineAiButton.icon) + self.textInputContainerBackgroundView.contentView.addSubview(inlineAiButton.button) + } + inlineAiButton.icon.tintColor = interfaceState.theme.chat.inputPanel.inputControlColor + let inlineAiButtonSize = CGSize(width: 40.0, height: 40.0) + let inlineAiButtonFrame = CGRect(origin: CGPoint(x: nextButtonTopRight.x - inlineAiButtonSize.width + 1.0, y: nextButtonTopRight.y + floor((minimalInputHeight - inlineAiButtonSize.height) / 2.0) - 2.0), size: inlineAiButtonSize) + transition.updateFrame(view: inlineAiButton.button, frame: inlineAiButtonFrame) + if let image = inlineAiButton.icon.image { + transition.updateFrame(view: inlineAiButton.icon, frame: image.size.centered(in: inlineAiButtonFrame)) + } + self.inlineAiButtonAlpha = isWidePanel ? 1.0 : 0.0 + let inlineAlpha: CGFloat = isWidePanel && inputText.count >= self.aiButtonMinTextLength ? 1.0 : 0.0 + ComponentTransition(transition).setAlpha(view: inlineAiButton.button, alpha: inlineAlpha) + ComponentTransition(transition).setAlpha(view: inlineAiButton.icon, alpha: inlineAlpha) + } else { + if let aiButton = self.aiButton { + self.aiButton = nil + let aiButtonView = aiButton.button + let aiButtonIconView = aiButton.icon + transition.updateAlpha(layer: aiButton.button.layer, alpha: 0.0, completion: { [weak aiButtonView] _ in + aiButtonView?.removeFromSuperview() + }) + transition.updateAlpha(layer: aiButton.icon.layer, alpha: 0.0, completion: { [weak aiButtonIconView] _ in + aiButtonIconView?.removeFromSuperview() + }) + self.heightDependentAiButtonAlpha = 0.0 + } + + if let inlineAiButton = self.inlineAiButton { + self.inlineAiButton = nil + let inlineButtonView = inlineAiButton.button + let inlineIconView = inlineAiButton.icon + transition.updateAlpha(layer: inlineAiButton.button.layer, alpha: 0.0, completion: { [weak inlineButtonView] _ in + inlineButtonView?.removeFromSuperview() + }) + transition.updateAlpha(layer: inlineAiButton.icon.layer, alpha: 0.0, completion: { [weak inlineIconView] _ in + inlineIconView?.removeFromSuperview() + }) } - ComponentTransition(transition).setAlpha(view: aiButton.button, alpha: aiButtonAlpha) - ComponentTransition(transition).setAlpha(view: aiButton.icon, alpha: aiButtonAlpha) - } else if let aiButton = self.aiButton { - self.aiButton = nil - let aiButtonView = aiButton.button - let aiButtonIconView = aiButton.button - transition.updateAlpha(layer: aiButton.button.layer, alpha: 0.0, completion: { [weak aiButtonView] _ in - aiButtonView?.removeFromSuperview() - }) - transition.updateAlpha(layer: aiButton.icon.layer, alpha: 0.0, completion: { [weak aiButtonIconView] _ in - aiButtonIconView?.removeFromSuperview() - }) - self.heightDependentAiButtonAlpha = 0.0 } let containerFrame = CGRect(origin: CGPoint(), size: CGSize(width: width, height: contentHeight + 64.0)) @@ -4397,12 +4459,21 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg if let aiButton = self.aiButton { let transition: ContainedViewLayoutTransition = .immediate - var aiButtonAlpha: CGFloat = self.heightDependentAiButtonAlpha - if let textInputNode = self.textInputNode, let attributedText = textInputNode.attributedText, attributedText.string.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { - aiButtonAlpha = 0.0 + var inputText = "" + if let textInputNode = self.textInputNode, let attributedText = textInputNode.attributedText { + inputText = attributedText.string.trimmingCharacters(in: .whitespacesAndNewlines) + } + let inputHasText = !inputText.isEmpty + + let cornerAlpha: CGFloat = inputHasText ? self.heightDependentAiButtonAlpha : 0.0 + ComponentTransition(transition).setAlpha(view: aiButton.button, alpha: cornerAlpha) + ComponentTransition(transition).setAlpha(view: aiButton.icon, alpha: cornerAlpha) + + if let inlineAiButton = self.inlineAiButton { + let inlineAlpha: CGFloat = self.inlineAiButtonAlpha > 0.0 && inputText.count >= self.aiButtonMinTextLength ? 1.0 : 0.0 + ComponentTransition(transition).setAlpha(view: inlineAiButton.button, alpha: inlineAlpha) + ComponentTransition(transition).setAlpha(view: inlineAiButton.icon, alpha: inlineAlpha) } - ComponentTransition(transition).setAlpha(view: aiButton.button, alpha: aiButtonAlpha) - ComponentTransition(transition).setAlpha(view: aiButton.icon, alpha: aiButtonAlpha) } self.updateTextHeight(animated: animated) @@ -5478,7 +5549,13 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg return result } } - + + if let inlineAiButton = self.inlineAiButton, !inlineAiButton.button.alpha.isZero { + if let result = inlineAiButton.button.hitTest(self.view.convert(point, to: inlineAiButton.button), with: event) { + return result + } + } + if !self.searchLayoutClearButton.alpha.isZero { if let result = self.searchLayoutClearButton.hitTest(self.view.convert(point, to: self.searchLayoutClearButton), with: event) { return result diff --git a/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift b/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift index 999a785075..061ffff5a0 100644 --- a/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift +++ b/submodules/TelegramUI/Components/ComposePollScreen/Sources/ComposePollScreen.swift @@ -620,7 +620,8 @@ final class ComposePollScreenComponent: Component { entities: mappedSolution.1, media: mappedSolution.2?.media ) - } + }, + hasUnseenVotes: false ), deadlineTimeout: deadlineTimeout, deadlineDate: deadlineDate, diff --git a/submodules/TelegramUI/Components/LegacyMessageInputPanel/BUILD b/submodules/TelegramUI/Components/LegacyMessageInputPanel/BUILD index c367df9585..97f4042d3c 100644 --- a/submodules/TelegramUI/Components/LegacyMessageInputPanel/BUILD +++ b/submodules/TelegramUI/Components/LegacyMessageInputPanel/BUILD @@ -25,6 +25,9 @@ swift_library( "//submodules/TelegramUI/Components/MessageInputPanelComponent", "//submodules/TelegramUI/Components/LegacyMessageInputPanelInputView", "//submodules/TelegramNotices", + "//submodules/TextFormat", + "//submodules/TelegramUIPreferences", + "//submodules/Pasteboard", ], visibility = [ "//visibility:public", diff --git a/submodules/TelegramUI/Components/LegacyMessageInputPanel/Sources/LegacyMessageInputPanel.swift b/submodules/TelegramUI/Components/LegacyMessageInputPanel/Sources/LegacyMessageInputPanel.swift index b456f4e9f5..659867c267 100644 --- a/submodules/TelegramUI/Components/LegacyMessageInputPanel/Sources/LegacyMessageInputPanel.swift +++ b/submodules/TelegramUI/Components/LegacyMessageInputPanel/Sources/LegacyMessageInputPanel.swift @@ -16,6 +16,9 @@ import TooltipUI import LegacyMessageInputPanelInputView import UndoUI import TelegramNotices +import TextFormat +import TelegramUIPreferences +import Pasteboard public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView { private let context: AccountContext @@ -23,6 +26,7 @@ public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView { private let isScheduledMessages: Bool private let isFile: Bool private let hasTimer: Bool + private let pushViewController: (ViewController) -> Void private let present: (ViewController) -> Void private let presentInGlobalOverlay: (ViewController) -> Void private let makeEntityInputView: () -> LegacyMessageInputPanelInputView? @@ -51,6 +55,8 @@ public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView { private weak var undoController: UndoOverlayController? private weak var tooltipController: TooltipScreen? + private var isAIEnabled: Bool = false + private var validLayout: (width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, keyboardHeight: CGFloat, additionalSideInsets: UIEdgeInsets, maxHeight: CGFloat, isSecondary: Bool, metrics: LayoutMetrics)? public init( @@ -59,6 +65,7 @@ public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView { isScheduledMessages: Bool, isFile: Bool, hasTimer: Bool, + pushViewController: @escaping (ViewController) -> Void, present: @escaping (ViewController) -> Void, presentInGlobalOverlay: @escaping (ViewController) -> Void, makeEntityInputView: @escaping () -> LegacyMessageInputPanelInputView? @@ -68,12 +75,18 @@ public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView { self.isScheduledMessages = isScheduledMessages self.isFile = isFile self.hasTimer = hasTimer + self.pushViewController = pushViewController self.present = present self.presentInGlobalOverlay = presentInGlobalOverlay self.makeEntityInputView = makeEntityInputView super.init() + if let data = context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_attach"] as? Double, value == 1.0 { + } else { + self.isAIEnabled = true + } + self.state._updated = { [weak self] transition, _ in if let self { self.update(transition: transition.containedViewLayoutTransition) @@ -294,7 +307,13 @@ public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView { header: nil, isChannel: false, storyItem: nil, - chatLocation: self.chatLocation + chatLocation: self.chatLocation, + aiCompose: self.isAIEnabled ? { [weak self] in + guard let self else { + return + } + self.openAICompose() + } : nil ) ), environment: {}, @@ -321,6 +340,59 @@ public class LegacyMessageInputPanelNode: ASDisplayNode, TGCaptionPanelView { return inputPanelSize.height - 8.0 } + private func openAICompose() { + Task { @MainActor [weak self] in + guard let self else { + return + } + + let effectiveInputText: NSAttributedString = self.caption() + if effectiveInputText.length == 0 { + return + } + + let inputText = trimChatInputText(effectiveInputText) + var entities: [MessageTextEntity] = [] + if inputText.length != 0 { + entities = generateTextEntities(inputText.string, enabledTypes: .all, currentEntities: generateChatInputTextEntities(inputText, maxAnimatedEmojisInText: 0)) + } + + let sharedDataEntries = await self.context.sharedContext.accountManager.sharedData(keys: [ApplicationSpecificSharedDataKeys.translationSettings]).get() + let translationSettings: TranslationSettings + if let value = sharedDataEntries.entries[ApplicationSpecificSharedDataKeys.translationSettings], let parsedValue = value.get(TranslationSettings.self) { + translationSettings = parsedValue + } else { + translationSettings = .defaultSettings + } + + self.pushViewController(await self.context.sharedContext.makeTextProcessingScreen( + context: self.context, + theme: defaultDarkColorPresentationTheme, + mode: .edit( + saveRestoreStateId: self.chatLocation.peerId, + completion: { [weak self] text in + guard let self else { + return + } + self.setCaption(chatInputStateStringWithAppliedEntities(text.text, entities: text.entities)) + }, + send: nil, + sendContextActions: nil + ), + ignoredTranslationLanguages: translationSettings.ignoredLanguages ?? [], + inputText: TextWithEntities(text: inputText.string, entities: entities), + copyResult: { [weak self] text in + guard let self else { + return + } + let _ = self + storeMessageTextInPasteboard(text.text, entities: text.entities) + }, + translateChat: nil + )) + } + } + private func toggleInputMode() { self.isEmojiKeyboardActive = !self.isEmojiKeyboardActive diff --git a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift index b26aa585bb..6a5074fdc5 100644 --- a/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift +++ b/submodules/TelegramUI/Components/MessageInputPanelComponent/Sources/MessageInputPanelComponent.swift @@ -298,6 +298,7 @@ public final class MessageInputPanelComponent: Component { public let sendAsConfiguration: SendAsConfiguration? public let openSettings: (() -> Void)? public let call: AnyObject? + public let aiCompose: (() -> Void)? public init( externalState: ExternalState, @@ -366,7 +367,8 @@ public final class MessageInputPanelComponent: Component { starStars: StarStats? = nil, sendAsConfiguration: SendAsConfiguration? = nil, openSettings: (() -> Void)? = nil, - call: AnyObject? = nil + call: AnyObject? = nil, + aiCompose: (() -> Void)? = nil ) { self.externalState = externalState self.context = context @@ -435,6 +437,7 @@ public final class MessageInputPanelComponent: Component { self.sendAsConfiguration = sendAsConfiguration self.openSettings = openSettings self.call = call + self.aiCompose = aiCompose } public static func ==(lhs: MessageInputPanelComponent, rhs: MessageInputPanelComponent) -> Bool { @@ -579,6 +582,9 @@ public final class MessageInputPanelComponent: Component { if (lhs.call == nil) != (rhs.call == nil) { return false } + if (lhs.aiCompose == nil) != (rhs.aiCompose == nil) { + return false + } return true } @@ -615,7 +621,8 @@ public final class MessageInputPanelComponent: Component { private let stickerButton = ComponentView() private var paidMessageButton: ComponentView? private let timeoutButton = ComponentView() - + private var aiButton: ComponentView? + private var mediaRecordingVibrancyContainer: UIView private var mediaRecordingPanel: ComponentView? private weak var dismissingMediaRecordingPanel: UIView? @@ -1689,7 +1696,86 @@ public final class MessageInputPanelComponent: Component { transition.setFrame(view: viewForOverlayContent, frame: textFieldFrame) } } - + + // AI Button + do { + let isTallPanel = textFieldSize.height >= 70.0 + let textLength = self.textFieldExternalState.textLength + let hasText = !self.textFieldExternalState.text.string.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty + let aiButtonMinTextLength: Int = 50 + let _ = textLength + let _ = aiButtonMinTextLength + + let showCorner = isTallPanel && hasText + let shouldShow = showCorner && component.aiCompose != nil + + if shouldShow { + let aiButton: ComponentView + var aiButtonTransition = transition + if let current = self.aiButton { + aiButton = current + } else { + aiButtonTransition = aiButtonTransition.withAnimation(.none) + aiButton = ComponentView() + self.aiButton = aiButton + } + + let tintColor: UIColor + switch component.style { + case .gift: + tintColor = component.theme.chat.inputPanel.inputControlColor + default: + tintColor = UIColor(rgb: 0xffffff, alpha: 0.6) + } + + let aiButtonSize = aiButton.update( + transition: aiButtonTransition, + component: AnyComponent(PlainButtonComponent( + content: AnyComponent(BundleIconComponent( + name: "Chat/Input/Text/InputAIIcon", + tintColor: tintColor + )), + effectAlignment: .center, + action: { [weak self] in + guard let self, let component = self.component else { + return + } + component.aiCompose?() + } + )), + environment: {}, + containerSize: CGSize(width: 40.0, height: 40.0) + ) + + if let aiButtonView = aiButton.view { + if aiButtonView.superview == nil { + aiButtonView.alpha = 0.0 + self.textClippingView.addSubview(aiButtonView) + } + + let aiButtonFrame: CGRect + aiButtonFrame = CGRect( + origin: CGPoint( + x: textFieldSize.width - aiButtonSize.width - 9.0, + y: 6.0 + ), + size: aiButtonSize + ) + + aiButtonTransition.setPosition(view: aiButtonView, position: aiButtonFrame.center) + aiButtonTransition.setBounds(view: aiButtonView, bounds: CGRect(origin: CGPoint(), size: aiButtonFrame.size)) + transition.setAlpha(view: aiButtonView, alpha: 1.0) + } + } else if let aiButton = self.aiButton { + self.aiButton = nil + if let aiButtonView = aiButton.view { + transition.setAlpha(view: aiButtonView, alpha: 0.0, completion: { [weak aiButtonView] _ in + aiButtonView?.removeFromSuperview() + }) + } + } + } + if let disabledPlaceholderValue = component.disabledPlaceholder, !component.isChannel { let disabledPlaceholder: ComponentView var disabledPlaceholderTransition = transition diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenPersonalChannelItem.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenPersonalChannelItem.swift index 80f58c4fec..02862baafc 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenPersonalChannelItem.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenPersonalChannelItem.swift @@ -229,6 +229,7 @@ public final class LoadingOverlayNode: ASDisplayNode { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, @@ -581,6 +582,7 @@ private final class PeerInfoScreenPersonalChannelItemNode: PeerInfoScreenItemNod presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/AutomaticBusinessMessageListItemComponent.swift b/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/AutomaticBusinessMessageListItemComponent.swift index 6e6048012d..12d3e1bca0 100644 --- a/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/AutomaticBusinessMessageListItemComponent.swift +++ b/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/AutomaticBusinessMessageListItemComponent.swift @@ -236,6 +236,7 @@ final class GreetingMessageListItemComponent: Component { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/QuickReplySetupScreen.swift b/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/QuickReplySetupScreen.swift index 95b256ae73..f9a8a6cdf4 100644 --- a/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/QuickReplySetupScreen.swift +++ b/submodules/TelegramUI/Components/Settings/AutomaticBusinessMessageSetupScreen/Sources/QuickReplySetupScreen.swift @@ -266,6 +266,7 @@ final class QuickReplySetupScreenComponent: Component { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/TelegramUI/Components/Settings/ThemeAccentColorScreen/Sources/ThemeAccentColorControllerNode.swift b/submodules/TelegramUI/Components/Settings/ThemeAccentColorScreen/Sources/ThemeAccentColorControllerNode.swift index 5f5eac2573..75b2184144 100644 --- a/submodules/TelegramUI/Components/Settings/ThemeAccentColorScreen/Sources/ThemeAccentColorControllerNode.swift +++ b/submodules/TelegramUI/Components/Settings/ThemeAccentColorScreen/Sources/ThemeAccentColorControllerNode.swift @@ -934,6 +934,7 @@ final class ThemeAccentColorControllerNode: ASDisplayNode, ASScrollViewDelegate }, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: hasInputActivity ? [(author, .typingText)] : [], diff --git a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift index 57e946a677..1d9f246881 100644 --- a/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift +++ b/submodules/TelegramUI/Components/Stories/StoryContainerScreen/Sources/StoryItemSetContainerViewSendMessage.swift @@ -2728,7 +2728,12 @@ final class StoryItemSetContainerSendMessage: @unchecked(Sendable) { return nil } //TODO:self.presentationInterfaceState.customEmojiAvailable - return component.context.sharedContext.makeGalleryCaptionPanelView(context: component.context, chatLocation: .peer(id: peer.id), isScheduledMessages: false, isFile: false, hasTimer: true, customEmojiAvailable: true, present: { [weak view] c in + return component.context.sharedContext.makeGalleryCaptionPanelView(context: component.context, chatLocation: .peer(id: peer.id), isScheduledMessages: false, isFile: false, hasTimer: true, customEmojiAvailable: true, pushViewController: { [weak view] c in + guard let view else { + return + } + view.component?.controller()?.push(c) + }, present: { [weak view] c in guard let view else { return } diff --git a/submodules/TelegramUI/Components/TextProcessingScreen/BUILD b/submodules/TelegramUI/Components/TextProcessingScreen/BUILD index a9b6476a76..547c1c3acc 100644 --- a/submodules/TelegramUI/Components/TextProcessingScreen/BUILD +++ b/submodules/TelegramUI/Components/TextProcessingScreen/BUILD @@ -27,7 +27,6 @@ swift_library( "//submodules/TelegramUI/Components/GlassBackgroundComponent", "//submodules/TelegramUI/Components/TabBarComponent", "//submodules/TranslateUI", - "//submodules/Components/MultilineTextWithEntitiesComponent", "//submodules/TextFormat", "//submodules/TelegramUI/Components/PlainButtonComponent", "//submodules/TelegramUI/Components/CheckComponent", @@ -38,6 +37,7 @@ swift_library( "//submodules/TelegramUI/Components/TooltipComponent", "//submodules/TelegramUI/Components/ToastComponent", "//submodules/TelegramUI/Components/InteractiveTextComponent", + "//submodules/TelegramUI/Components/EmojiStatusComponent", "//submodules/TelegramNotices", "//submodules/Markdown", "//submodules/TelegramUIPreferences", diff --git a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingLanguageSelectionComponent.swift b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingLanguageSelectionComponent.swift index 4649bdfa59..96b43edbb8 100644 --- a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingLanguageSelectionComponent.swift +++ b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingLanguageSelectionComponent.swift @@ -8,6 +8,8 @@ import MultilineTextComponent import BundleIconComponent import TelegramCore import TranslateUI +import EmojiStatusComponent +import AccountContext final class TextProcessingLanguageSelectionComponent: Component { public struct Language: Equatable { @@ -22,34 +24,40 @@ final class TextProcessingLanguageSelectionComponent: Component { } } + let context: AccountContext let theme: PresentationTheme let strings: PresentationStrings let sourceView: UIView let topLanguages: [Language] let selectedLanguageCode: String + let ignoredTranslationLanguages: [String] let currentStyle: TelegramComposeAIMessageMode.StyleId - let displayStyles: [TelegramComposeAIMessageMode.Style]? + let displayStyles: [TextProcessingScreen.Style]? let completion: (String, TelegramComposeAIMessageMode.StyleId) -> Void let dismissed: () -> Void let inputHeight: CGFloat init( + context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, sourceView: UIView, topLanguages: [Language], selectedLanguageCode: String, + ignoredTranslationLanguages: [String], currentStyle: TelegramComposeAIMessageMode.StyleId, - displayStyles: [TelegramComposeAIMessageMode.Style]?, + displayStyles: [TextProcessingScreen.Style]?, completion: @escaping (String, TelegramComposeAIMessageMode.StyleId) -> Void, dismissed: @escaping () -> Void, inputHeight: CGFloat ) { + self.context = context self.theme = theme self.strings = strings self.sourceView = sourceView self.topLanguages = topLanguages self.selectedLanguageCode = selectedLanguageCode + self.ignoredTranslationLanguages = ignoredTranslationLanguages self.currentStyle = currentStyle self.displayStyles = displayStyles self.completion = completion @@ -70,6 +78,9 @@ final class TextProcessingLanguageSelectionComponent: Component { if lhs.selectedLanguageCode != rhs.selectedLanguageCode { return false } + if lhs.ignoredTranslationLanguages != rhs.ignoredTranslationLanguages { + return false + } if lhs.currentStyle != rhs.currentStyle { return false } @@ -396,6 +407,9 @@ final class TextProcessingLanguageSelectionComponent: Component { if self.mainItems.isEmpty { self.mainItems = supportedTranslationLanguages.compactMap { item in + if component.ignoredTranslationLanguages.contains(item) { + return nil + } return Language(id: item, languageCode: item, name: localizedLanguageName(strings: component.strings, language: item)) } var topIds: [String] = [] @@ -451,7 +465,8 @@ final class TextProcessingLanguageSelectionComponent: Component { let filteredItems = self.filteredMainItems let effectiveTopItemCount = self.searchQuery.isEmpty ? self.mainTopItemCount : 0 let searchSeparatorHeight: CGFloat = 20.0 - let mainContentHeight = mainContainerInset * 2.0 + searchItemHeight + searchSeparatorHeight + CGFloat(filteredItems.count) * mainItemSize.height + (effectiveTopItemCount != 0 ? 20.0 : 0.0) + let totalTopItemCount = self.mainTopItemCount + let mainContentHeight = mainContainerInset * 2.0 + searchItemHeight + searchSeparatorHeight + CGFloat(self.mainItems.count) * mainItemSize.height + (totalTopItemCount != 0 ? 20.0 : 0.0) let maxAvailableHeight = max(mainItemSize.height * 2.0, availableSize.height - component.inputHeight - containerSideInset * 2.0) var mainSize = CGSize(width: mainWidth, height: min(min(370.0, maxAvailableHeight), mainContentHeight)) @@ -460,10 +475,10 @@ final class TextProcessingLanguageSelectionComponent: Component { var selectedStyleItemFrame: CGRect? let stylesSpacing: CGFloat = 8.0 if let displayStyles = component.displayStyles { - var styleData: [(id: TelegramComposeAIMessageMode.StyleId, icon: String, title: String)] = [] - styleData.append((.neutral, "🏳️", localizedStyleName(strings: component.strings, styleId: .neutral))) + var styleData: [(id: TelegramComposeAIMessageMode.StyleId, icon: String, iconFileId: Int64?, iconFile: TelegramMediaFile?, title: String)] = [] + styleData.append((.neutral, "🏳️", nil, nil, localizedStyleName(strings: component.strings, styleId: .neutral))) for item in displayStyles { - styleData.append((item.id, item.emoji, localizedStyleName(strings: component.strings, styleId: item.id))) + styleData.append((item.id, item.emoji, item.emojiFileId, item.emojiFile, localizedStyleName(strings: component.strings, styleId: item.id))) } let stylesItemSize = CGSize(width: 82.0, height: 60.0) @@ -483,8 +498,11 @@ final class TextProcessingLanguageSelectionComponent: Component { let _ = itemView.update( transition: itemViewTransition, component: AnyComponent(StyleItemComponent( + context: component.context, theme: component.theme, icon: item.icon, + iconFileId: item.iconFileId, + iconFile: item.iconFile, title: item.title, action: { [weak self] in guard let self else { @@ -834,23 +852,32 @@ private final class LanguageItemComponent: Component { } private final class StyleItemComponent: Component { + let context: AccountContext let theme: PresentationTheme let icon: String + let iconFileId: Int64? + let iconFile: TelegramMediaFile? let title: String let action: () -> Void - + init( + context: AccountContext, theme: PresentationTheme, icon: String, + iconFileId: Int64?, + iconFile: TelegramMediaFile?, title: String, action: @escaping () -> Void ) { + self.context = context self.theme = theme self.icon = icon + self.iconFileId = iconFileId + self.iconFile = iconFile self.title = title self.action = action } - + static func ==(lhs: StyleItemComponent, rhs: StyleItemComponent) -> Bool { if lhs.theme !== rhs.theme { return false @@ -858,6 +885,12 @@ private final class StyleItemComponent: Component { if lhs.icon != rhs.icon { return false } + if lhs.iconFileId != rhs.iconFileId { + return false + } + if lhs.iconFile?.fileId != rhs.iconFile?.fileId { + return false + } if lhs.title != rhs.title { return false } @@ -891,11 +924,19 @@ private final class StyleItemComponent: Component { } func update(component: StyleItemComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: ComponentTransition) -> CGSize { + let previousComponent = self.component self.component = component self.state = state let iconTintColor = component.theme.list.itemPrimaryTextColor + if previousComponent?.iconFileId != component.iconFileId { + if let imageIcon = self.imageIcon { + self.imageIcon = nil + imageIcon.view?.removeFromSuperview() + } + } + let imageIcon: ComponentView var iconTransition = transition if let current = self.imageIcon { @@ -906,11 +947,39 @@ private final class StyleItemComponent: Component { self.imageIcon = imageIcon } + let iconComponent: AnyComponent + if let iconFileId = component.iconFileId { + let iconSize = CGSize(width: 34.0, height: 34.0) + let content: EmojiStatusComponent.AnimationContent + if let file = component.iconFile { + content = .file(file: file) + } else { + content = .customEmoji(fileId: iconFileId) + } + iconComponent = AnyComponent(EmojiStatusComponent( + context: component.context, + animationCache: component.context.animationCache, + animationRenderer: component.context.animationRenderer, + content: .animation( + content: content, + size: iconSize, + placeholderColor: component.theme.list.mediaPlaceholderColor, + themeColor: component.theme.list.itemAccentColor, + loopMode: .count(0) + ), + size: iconSize, + isVisibleForAnimations: true, + action: nil + )) + } else { + iconComponent = AnyComponent(MultilineTextComponent( + text: .plain(NSAttributedString(string: component.icon, font: Font.regular(25.0), textColor: .black)) + )) + } + let iconSize = imageIcon.update( transition: .immediate, - component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: component.icon, font: Font.regular(25.0), textColor: .black)) - )), + component: iconComponent, environment: {}, containerSize: CGSize(width: 100.0, height: 100.0) ) diff --git a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingScreen.swift b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingScreen.swift index f2e3a5857d..572d71e4ea 100644 --- a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingScreen.swift +++ b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingScreen.swift @@ -40,7 +40,7 @@ final class TextProcessingContentComponent: Component { let externalState: ExternalState let context: AccountContext let mode: TextProcessingScreen.Mode - let styles: [TelegramComposeAIMessageMode.Style] + let styles: [TextProcessingScreen.Style] let inputText: TextWithEntities let initialEditState: TextProcessingScreen.EditState? let shouldDisplayStyleNotice: Bool @@ -52,7 +52,7 @@ final class TextProcessingContentComponent: Component { externalState: ExternalState, context: AccountContext, mode: TextProcessingScreen.Mode, - styles: [TelegramComposeAIMessageMode.Style], + styles: [TextProcessingScreen.Style], inputText: TextWithEntities, initialEditState: TextProcessingScreen.EditState?, shouldDisplayStyleNotice: Bool, @@ -553,7 +553,7 @@ private final class TextProcessingSheetComponent: Component { let context: AccountContext let mode: TextProcessingScreen.Mode let ignoredTranslationLanguages: [String] - let styles: [TelegramComposeAIMessageMode.Style] + let styles: [TextProcessingScreen.Style] let inputText: TextWithEntities let initialEditState: TextProcessingScreen.EditState? let shouldDisplayStyleNotice: Bool @@ -564,7 +564,7 @@ private final class TextProcessingSheetComponent: Component { context: AccountContext, mode: TextProcessingScreen.Mode, ignoredTranslationLanguages: [String], - styles: [TelegramComposeAIMessageMode.Style], + styles: [TextProcessingScreen.Style], inputText: TextWithEntities, initialEditState: TextProcessingScreen.EditState?, shouldDisplayStyleNotice: Bool, @@ -1031,11 +1031,13 @@ private final class TextProcessingSheetComponent: Component { let menuSize = languageSelectionMenu.update( transition: transition, component: AnyComponent(TextProcessingLanguageSelectionComponent( + context: component.context, theme: theme, strings: environmentValue.strings, sourceView: languageSelectionMenuDataValue.sourceView, topLanguages: [], selectedLanguageCode: languageSelectionMenuDataValue.currentLanguage, + ignoredTranslationLanguages: component.ignoredTranslationLanguages, currentStyle: languageSelectionMenuDataValue.currentStyle, displayStyles: languageSelectionMenuDataValue.displayStyle ? component.styles : nil, completion: languageSelectionMenuDataValue.completion, @@ -1087,10 +1089,29 @@ public class TextProcessingScreen: ViewControllerComponentContainer { } } + public struct Style: Equatable { + public let name: String + public let emoji: String + public let emojiFileId: Int64? + public let emojiFile: TelegramMediaFile? + + public var id: TelegramComposeAIMessageMode.StyleId { + return .style(self.name) + } + + public init(name: String, emoji: String, emojiFileId: Int64?, emojiFile: TelegramMediaFile?) { + self.name = name + self.emoji = emoji + self.emojiFileId = emojiFileId + self.emojiFile = emojiFile + } + } + private let context: AccountContext public init( context: AccountContext, + theme: PresentationTheme? = nil, mode: Mode, ignoredTranslationLanguages: [String], inputText: TextWithEntities, @@ -1099,7 +1120,18 @@ public class TextProcessingScreen: ViewControllerComponentContainer { ) async { self.context = context - let styles = await context.engine.messages.composeAIMessageStyles().get() + let rawStyles = await context.engine.messages.composeAIMessageStyles().get() + var styles: [Style] = [] + let resolvedEmojiFiles: [Int64: TelegramMediaFile] = await context.engine.stickers.resolveInlineStickersLocal(fileIds: Array(Set(rawStyles.compactMap({ $0.emojiFileId })))).get() + for value in rawStyles { + styles.append(Style( + name: value.name, + emoji: value.emoji, + emojiFileId: value.emojiFileId, + emojiFile: value.emojiFileId.flatMap { resolvedEmojiFiles[$0] } + )) + } + let shouldDisplayStyleNotice = await ApplicationSpecificNotice.getAITextProcessingStyleSelection(accountManager: context.sharedContext.accountManager).get() < 3 var initialEditState: EditState? @@ -1124,7 +1156,7 @@ public class TextProcessingScreen: ViewControllerComponentContainer { ), navigationBarAppearance: .none, statusBarStyle: .ignore, - theme: .default + theme: theme.flatMap({ .custom($0) }) ?? .default ) self.statusBar.statusBarStyle = .Ignore diff --git a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingStyleSelectionComponent.swift b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingStyleSelectionComponent.swift index 64ca03a335..cb7fa7c87c 100644 --- a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingStyleSelectionComponent.swift +++ b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingStyleSelectionComponent.swift @@ -5,6 +5,8 @@ import TelegramPresentationData import ComponentFlow import MultilineTextComponent import TelegramCore +import EmojiStatusComponent +import AccountContext func localizedStyleName(strings: PresentationStrings, styleId: TelegramComposeAIMessageMode.StyleId) -> String { switch styleId { @@ -20,19 +22,22 @@ func localizedStyleName(strings: PresentationStrings, styleId: TelegramComposeAI } final class TextProcessingStyleSelectionComponent: Component { + let context: AccountContext let theme: PresentationTheme let strings: PresentationStrings - let styles: [TelegramComposeAIMessageMode.Style] + let styles: [TextProcessingScreen.Style] let selectedStyle: TelegramComposeAIMessageMode.StyleId let updateStyle: (TelegramComposeAIMessageMode.StyleId) -> Void init( + context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, - styles: [TelegramComposeAIMessageMode.Style], + styles: [TextProcessingScreen.Style], selectedStyle: TelegramComposeAIMessageMode.StyleId, updateStyle: @escaping (TelegramComposeAIMessageMode.StyleId) -> Void ) { + self.context = context self.theme = theme self.strings = strings self.styles = styles @@ -132,11 +137,6 @@ final class TextProcessingStyleSelectionComponent: Component { self.component = component self.state = state - var styleData: [(id: TelegramComposeAIMessageMode.StyleId, icon: String, title: String)] = [] - for item in component.styles { - styleData.append((item.id, item.emoji, localizedStyleName(strings: component.strings, styleId: item.id))) - } - let maxItemWidth: CGFloat = 80.0 let itemPadding: CGFloat = 0.0 let minSlotWidth: CGFloat = 50.0 @@ -144,8 +144,8 @@ final class TextProcessingStyleSelectionComponent: Component { // First pass: measure all items to find intrinsic sizes var itemSizes: [TelegramComposeAIMessageMode.StyleId: CGSize] = [:] - for i in 0 ..< styleData.count { - let style = styleData[i] + for i in 0 ..< component.styles.count { + let style = component.styles[i] let itemView: ComponentView var itemTransition = transition if let current = self.itemViews[style.id] { @@ -158,9 +158,12 @@ final class TextProcessingStyleSelectionComponent: Component { let measuredSize = itemView.update( transition: itemTransition, component: AnyComponent(ItemComponent( + context: component.context, theme: component.theme, - icon: style.icon, - title: style.title + icon: style.emoji, + iconFileId: style.emojiFileId, + iconFile: style.emojiFile, + title: localizedStyleName(strings: component.strings, styleId: .style(style.name)) )), environment: {}, containerSize: CGSize(width: maxItemWidth, height: availableSize.height) @@ -175,8 +178,8 @@ final class TextProcessingStyleSelectionComponent: Component { } let contentBasedWidth = min(maxSlotWidth, max(minSlotWidth, largestItemWidth + itemPadding)) let slotWidth: CGFloat - if CGFloat(styleData.count) * contentBasedWidth <= availableSize.width { - slotWidth = floor(availableSize.width / CGFloat(styleData.count)) + if CGFloat(component.styles.count) * contentBasedWidth <= availableSize.width { + slotWidth = floor(availableSize.width / CGFloat(component.styles.count)) } else { var resolved: CGFloat = contentBasedWidth var targetVisible: CGFloat = min(7.5, floor((availableSize.width + 16.0) / (contentBasedWidth + 10.0)) + 0.5) @@ -190,7 +193,7 @@ final class TextProcessingStyleSelectionComponent: Component { } slotWidth = resolved } - let contentWidth = slotWidth * CGFloat(styleData.count) + let contentWidth = slotWidth * CGFloat(component.styles.count) self.scrollView.frame = CGRect(origin: CGPoint(), size: availableSize) self.scrollView.contentSize = CGSize(width: contentWidth, height: availableSize.height) @@ -198,8 +201,8 @@ final class TextProcessingStyleSelectionComponent: Component { // Second pass: position items centered in their slots var selectedItemFrame: CGRect? - for i in 0 ..< styleData.count { - let style = styleData[i] + for i in 0 ..< component.styles.count { + let style = component.styles[i] guard let itemView = self.itemViews[style.id], let naturalSize = itemSizes[style.id] else { continue @@ -220,7 +223,7 @@ final class TextProcessingStyleSelectionComponent: Component { var removedIds: [TelegramComposeAIMessageMode.StyleId] = [] for (id, itemView) in self.itemViews { - if !styleData.contains(where: { $0.id == id }) { + if !component.styles.contains(where: { $0.id == id }) { removedIds.append(id) itemView.view?.removeFromSuperview() } @@ -267,17 +270,26 @@ final class TextProcessingStyleSelectionComponent: Component { } private final class ItemComponent: Component { + let context: AccountContext let theme: PresentationTheme let icon: String + let iconFileId: Int64? + let iconFile: TelegramMediaFile? let title: String init( + context: AccountContext, theme: PresentationTheme, icon: String, + iconFileId: Int64?, + iconFile: TelegramMediaFile?, title: String ) { + self.context = context self.theme = theme self.icon = icon + self.iconFileId = iconFileId + self.iconFile = iconFile self.title = title } @@ -288,6 +300,12 @@ private final class ItemComponent: Component { if lhs.icon != rhs.icon { return false } + if lhs.iconFileId != rhs.iconFileId { + return false + } + if lhs.iconFile?.fileId != rhs.iconFile?.fileId { + return false + } if lhs.title != rhs.title { return false } @@ -310,10 +328,18 @@ private final class ItemComponent: Component { } func update(component: ItemComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment, transition: ComponentTransition) -> CGSize { + let previousComponent = self.component self.component = component self.state = state let iconTintColor = component.theme.list.itemPrimaryTextColor + + if previousComponent?.iconFileId != component.iconFileId { + if let imageIcon = self.imageIcon { + self.imageIcon = nil + imageIcon.view?.removeFromSuperview() + } + } let imageIcon: ComponentView var iconTransition = transition @@ -324,19 +350,47 @@ private final class ItemComponent: Component { imageIcon = ComponentView() self.imageIcon = imageIcon } + + let iconComponent: AnyComponent + if let iconFileId = component.iconFileId { + let iconSize = CGSize(width: 34.0, height: 34.0) + let content: EmojiStatusComponent.AnimationContent + if let file = component.iconFile { + content = .file(file: file) + } else { + content = .customEmoji(fileId: iconFileId) + } + iconComponent = AnyComponent(EmojiStatusComponent( + context: component.context, + animationCache: component.context.animationCache, + animationRenderer: component.context.animationRenderer, + content: .animation( + content: content, + size: iconSize, + placeholderColor: component.theme.list.mediaPlaceholderColor, + themeColor: component.theme.list.itemAccentColor, + loopMode: .count(0) + ), + size: iconSize, + isVisibleForAnimations: true, + action: nil + )) + } else { + iconComponent = AnyComponent(MultilineTextComponent( + text: .plain(NSAttributedString(string: component.icon, font: Font.regular(25.0), textColor: .black)) + )) + } let iconSize = imageIcon.update( transition: .immediate, - component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: component.icon, font: Font.regular(25.0), textColor: .black)) - )), + component: iconComponent, environment: {}, containerSize: CGSize(width: 100.0, height: 100.0) ) let titleSize = self.title.update( transition: .immediate, component: AnyComponent(MultilineTextComponent( - text: .plain(NSAttributedString(string: component.title, font: Font.semibold(10.0), textColor: iconTintColor)) + text: .plain(NSAttributedString(string: component.title, font: Font.medium(10.0), textColor: iconTintColor)) )), environment: {}, containerSize: CGSize(width: availableSize.width, height: 100.0) @@ -344,7 +398,7 @@ private final class ItemComponent: Component { let contentWidth = max(iconSize.width, titleSize.width) - let iconFrame = CGRect(origin: CGPoint(x: floor((contentWidth - iconSize.width) * 0.5), y: -1.0), size: iconSize) + let iconFrame = CGRect(origin: CGPoint(x: floor((contentWidth - iconSize.width) * 0.5), y: -3.0), size: iconSize) if let imageIconView = imageIcon.view { if imageIconView.superview == nil { self.addSubview(imageIconView) diff --git a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingTranslateContentComponent.swift b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingTranslateContentComponent.swift index ca8fb65863..31f7ed3fcb 100644 --- a/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingTranslateContentComponent.swift +++ b/submodules/TelegramUI/Components/TextProcessingScreen/Sources/TextProcessingTranslateContentComponent.swift @@ -22,7 +22,7 @@ func localizedLanguageName(strings: PresentationStrings, language: String) -> St translateTitle = string } else { let languageLocale = Locale(identifier: language) - let toLanguage = languageLocale.localizedString(forLanguageCode: toLang) ?? "" + let toLanguage = languageLocale.localizedString(forLanguageCode: toLang)?.capitalized ?? "" return toLanguage } return translateTitle @@ -77,7 +77,7 @@ final class TextProcessingTranslateContentComponent: Component { let context: AccountContext let theme: PresentationTheme let strings: PresentationStrings - let styles: [TelegramComposeAIMessageMode.Style] + let styles: [TextProcessingScreen.Style] let inputText: TextWithEntities let externalState: ExternalState let mode: Mode @@ -90,7 +90,7 @@ final class TextProcessingTranslateContentComponent: Component { context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, - styles: [TelegramComposeAIMessageMode.Style], + styles: [TextProcessingScreen.Style], externalState: ExternalState, inputText: TextWithEntities, mode: Mode, @@ -310,6 +310,7 @@ final class TextProcessingTranslateContentComponent: Component { let sourceTextSize = self.sourceText.update( transition: transition, component: AnyComponent(TextProcessingStyleSelectionComponent( + context: component.context, theme: component.theme, strings: component.strings, styles: component.styles, diff --git a/submodules/TelegramUI/Images.xcassets/Chat List/PollVotesBadgeIcon.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Chat List/PollVotesBadgeIcon.imageset/Contents.json new file mode 100644 index 0000000000..412e4ae9c9 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Chat List/PollVotesBadgeIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "polllist.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Chat List/PollVotesBadgeIcon.imageset/polllist.pdf b/submodules/TelegramUI/Images.xcassets/Chat List/PollVotesBadgeIcon.imageset/polllist.pdf new file mode 100644 index 0000000000..9910e59eb5 Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Chat List/PollVotesBadgeIcon.imageset/polllist.pdf differ diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/Contents.json index 84caad5eb9..6a5c288ea5 100644 --- a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/Contents.json @@ -1,22 +1,12 @@ { "images" : [ { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "ic_mention@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "ic_mention@3x.png", - "scale" : "3x" + "filename" : "mentionchat.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/ic_mention@2x.png b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/ic_mention@2x.png deleted file mode 100644 index 222b36ebd0..0000000000 Binary files a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/ic_mention@2x.png and /dev/null differ diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/ic_mention@3x.png b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/ic_mention@3x.png deleted file mode 100644 index 2056c65b93..0000000000 Binary files a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/ic_mention@3x.png and /dev/null differ diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/mentionchat.pdf b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/mentionchat.pdf new file mode 100644 index 0000000000..18ae27c5bb Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToMentions.imageset/mentionchat.pdf differ diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToPollVotes.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToPollVotes.imageset/Contents.json new file mode 100644 index 0000000000..08707adb80 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToPollVotes.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "pollchat.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToPollVotes.imageset/pollchat.pdf b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToPollVotes.imageset/pollchat.pdf new file mode 100644 index 0000000000..411e155e5d Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToPollVotes.imageset/pollchat.pdf differ diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/Contents.json index 3b4540719d..2cb976d2c3 100644 --- a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "reactionbutton_30.pdf", + "filename" : "reactionchat.pdf", "idiom" : "universal" } ], diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/reactionbutton_30.pdf b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/reactionbutton_30.pdf deleted file mode 100644 index 514fec72b2..0000000000 --- a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/reactionbutton_30.pdf +++ /dev/null @@ -1,135 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 6.370117 5.673876 cm -0.000000 0.000000 0.000000 scn -9.430104 1.654882 m -9.785924 1.093061 l -9.790163 1.095791 l -9.430104 1.654882 l -h -8.635000 14.975010 m -8.049028 14.660586 l -8.164477 14.445433 8.388550 14.310852 8.632719 14.310015 c -8.876888 14.309176 9.101879 14.442217 9.218801 14.656574 c -8.635000 14.975010 l -h -7.839896 1.654882 m -7.479837 1.095791 l -7.483993 1.093115 7.488178 1.090485 7.492393 1.087902 c -7.839896 1.654882 l -h -8.635000 0.665001 m -8.884944 0.665001 9.121070 0.749847 9.286764 0.822496 c -9.466847 0.901457 9.640889 1.001228 9.785913 1.093077 c -9.074295 2.216687 l -8.962834 2.146095 8.850468 2.083426 8.752692 2.040556 c -8.704361 2.019364 8.667226 2.006400 8.641413 1.999336 c -8.613549 1.991711 8.613501 1.995001 8.635000 1.995001 c -8.635000 0.665001 l -h -9.790163 1.095791 m -14.600021 4.193375 17.935001 7.974546 17.935001 11.999783 c -16.605000 11.999783 l -16.605000 8.706644 13.818534 5.272034 9.070045 2.213973 c -9.790163 1.095791 l -h -17.935001 11.999783 m -17.935001 15.464374 15.513333 17.991125 12.379683 17.991125 c -12.379683 16.661123 l -14.700618 16.661123 16.605000 14.810528 16.605000 11.999783 c -17.935001 11.999783 l -h -12.379683 17.991125 m -10.390571 17.991125 8.914253 16.875711 8.051200 15.293447 c -9.218801 14.656574 l -9.894658 15.895646 10.966094 16.661123 12.379683 16.661123 c -12.379683 17.991125 l -h -9.220972 15.289434 m -8.374290 16.867342 6.887577 17.991125 4.898867 17.991125 c -4.898867 16.661123 l -6.312860 16.661123 7.390997 15.886917 8.049028 14.660586 c -9.220972 15.289434 l -h -4.898867 17.991125 m -1.766684 17.991125 -0.665000 15.465936 -0.665000 11.999783 c -0.665000 11.999783 l -0.665000 14.808967 2.576465 16.661123 4.898867 16.661123 c -4.898867 17.991125 l -h --0.665000 11.999783 m --0.665000 7.974546 2.669979 4.193375 7.479837 1.095791 c -8.199955 2.213973 l -3.451467 5.272034 0.665000 8.706644 0.665000 11.999783 c --0.665000 11.999783 l -h -7.492393 1.087902 m -7.638123 0.998585 7.812093 0.900349 7.989649 0.822496 c -8.150764 0.751854 8.386635 0.665001 8.635000 0.665001 c -8.635000 1.995001 l -8.661109 1.995001 8.664042 1.990815 8.636125 1.998583 c -8.610722 2.005651 8.573330 2.018805 8.523721 2.040556 c -8.423417 2.084536 8.306705 2.148740 8.187400 2.221862 c -7.492393 1.087902 l -h -f -n -Q - -endstream -endobj - -3 0 obj - 2302 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 30.000000 30.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000002392 00000 n -0000002415 00000 n -0000002588 00000 n -0000002662 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -2721 -%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/reactionchat.pdf b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/reactionchat.pdf new file mode 100644 index 0000000000..1946439255 Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Chat/NavigateToReactions.imageset/reactionchat.pdf differ diff --git a/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift b/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift index 650f4bf758..9e0e64b24f 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatControllerLoadDisplayNode.swift @@ -1565,7 +1565,7 @@ extension ChatControllerImpl { guard let strongSelf = self, let peerId = strongSelf.chatLocation.peerId else { return } - let _ = clearPeerUnseenReactionsInteractively(account: strongSelf.context.account, peerId: peerId, threadId: strongSelf.chatLocation.threadId).startStandalone() + let _ = clearPeerUnseenReactionsAndPollVotesInteractively(account: strongSelf.context.account, peerId: peerId, threadId: strongSelf.chatLocation.threadId).startStandalone() } ))) let items = ContextController.Items(content: .list(menuItems)) @@ -1581,6 +1581,67 @@ extension ChatControllerImpl { strongSelf.window?.presentInGlobalOverlay(controller) } + self.chatDisplayNode.navigateButtons.pollVotesPressed = { [weak self] in + if let strongSelf = self, strongSelf.isNodeLoaded, let peerId = strongSelf.chatLocation.peerId { + let signal = strongSelf.context.engine.messages.earliestUnseenPollVoteMessage(peerId: peerId, threadId: strongSelf.chatLocation.threadId) + strongSelf.navigationActionDisposable.set((signal |> deliverOnMainQueue).startStrict(next: { result in + if let strongSelf = self { + switch result { + case let .result(messageId): + if let messageId = messageId { + strongSelf.chatDisplayNode.historyNode.suspendReadingReactions = true + strongSelf.navigateToMessage(from: nil, to: .id(messageId, NavigateToMessageParams(timestamp: nil, quote: nil)), scrollPosition: .center(.top), completion: { + strongSelf.chatDisplayNode.historyNode.suspendReadingReactions = false + }) + } + case .loading: + break + } + } + })) + } + } + + self.chatDisplayNode.navigateButtons.pollVotesButton.activated = { [weak self] gesture, _ in + guard let strongSelf = self else { + gesture.cancel() + return + } + + strongSelf.chatDisplayNode.messageTransitionNode.dismissMessageReactionContexts() + + var menuItems: [ContextMenuItem] = [] + //TODO:localize + menuItems.append(.action(ContextMenuActionItem( + id: nil, + text: "Read All Poll Votes", + textColor: .primary, + textLayout: .singleLine, + icon: { theme in + return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Read"), color: theme.contextMenu.primaryColor) + }, + action: { _, f in + f(.dismissWithoutContent) + + guard let strongSelf = self, let peerId = strongSelf.chatLocation.peerId else { + return + } + let _ = clearPeerUnseenReactionsAndPollVotesInteractively(account: strongSelf.context.account, peerId: peerId, threadId: strongSelf.chatLocation.threadId).startStandalone() + } + ))) + let items = ContextController.Items(content: .list(menuItems)) + + let controller = makeContextController(presentationData: strongSelf.presentationData, source: .extracted(ChatMessageNavigationButtonContextExtractedContentSource(chatNode: strongSelf.chatDisplayNode, contentNode: strongSelf.chatDisplayNode.navigateButtons.pollVotesButton.containerNode)), items: .single(items), recognizer: nil, gesture: gesture) + + strongSelf.forEachController({ controller in + if let controller = controller as? TooltipScreen { + controller.dismiss() + } + return true + }) + strongSelf.window?.presentInGlobalOverlay(controller) + } + let interfaceInteraction = ChatPanelInterfaceInteraction(setupReplyMessage: { [weak self] messageId, innerSubject, completion in guard let strongSelf = self, strongSelf.isNodeLoaded else { return @@ -4866,27 +4927,31 @@ extension ChatControllerImpl { }) self.chatUnreadMentionCountDisposable?.dispose() - self.chatUnreadMentionCountDisposable = (self.context.account.viewTracker.unseenPersonalMessagesAndReactionCount(peerId: peerId, threadId: nil) |> deliverOnMainQueue).startStrict(next: { [weak self] mentionCount, reactionCount in + self.chatUnreadMentionCountDisposable = (self.context.account.viewTracker.unseenPersonalMessagesAndReactionCount(peerId: peerId, threadId: nil) |> deliverOnMainQueue).startStrict(next: { [weak self] mentionCount, reactionCount, pollVoteCount in if let strongSelf = self { if case .standard(.previewing) = strongSelf.presentationInterfaceState.mode { strongSelf.chatDisplayNode.navigateButtons.mentionCount = 0 strongSelf.chatDisplayNode.navigateButtons.reactionsCount = 0 + strongSelf.chatDisplayNode.navigateButtons.pollVotesCount = 0 } else { strongSelf.chatDisplayNode.navigateButtons.mentionCount = mentionCount strongSelf.chatDisplayNode.navigateButtons.reactionsCount = reactionCount + strongSelf.chatDisplayNode.navigateButtons.pollVotesCount = pollVoteCount } } }) } else if let peerId = self.chatLocation.peerId, let threadId = self.chatLocation.threadId { self.chatUnreadMentionCountDisposable?.dispose() - self.chatUnreadMentionCountDisposable = (self.context.account.viewTracker.unseenPersonalMessagesAndReactionCount(peerId: peerId, threadId: threadId) |> deliverOnMainQueue).startStrict(next: { [weak self] mentionCount, reactionCount in + self.chatUnreadMentionCountDisposable = (self.context.account.viewTracker.unseenPersonalMessagesAndReactionCount(peerId: peerId, threadId: threadId) |> deliverOnMainQueue).startStrict(next: { [weak self] mentionCount, reactionCount, pollVoteCount in if let strongSelf = self { if case .standard(.previewing) = strongSelf.presentationInterfaceState.mode { strongSelf.chatDisplayNode.navigateButtons.mentionCount = 0 strongSelf.chatDisplayNode.navigateButtons.reactionsCount = 0 + strongSelf.chatDisplayNode.navigateButtons.pollVotesCount = 0 } else { strongSelf.chatDisplayNode.navigateButtons.mentionCount = mentionCount strongSelf.chatDisplayNode.navigateButtons.reactionsCount = reactionCount + strongSelf.chatDisplayNode.navigateButtons.pollVotesCount = pollVoteCount } } }) diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index c470f280c7..d1fe1ef37a 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -554,7 +554,7 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { } if let poll = media as? TelegramMediaPoll { var updatedMedia = message.media.filter { !($0 is TelegramMediaPoll) } - updatedMedia.append(TelegramMediaPoll(pollId: poll.pollId, publicity: poll.publicity, kind: poll.kind, text: poll.text, textEntities: poll.textEntities, options: poll.options, correctAnswers: poll.correctAnswers, results: TelegramMediaPollResults(voters: nil, totalVoters: nil, recentVoters: [], solution: nil), isClosed: false, deadlineTimeout: nil, deadlineDate: nil, pollHash: poll.pollHash)) + updatedMedia.append(TelegramMediaPoll(pollId: poll.pollId, publicity: poll.publicity, kind: poll.kind, text: poll.text, textEntities: poll.textEntities, options: poll.options, correctAnswers: poll.correctAnswers, results: TelegramMediaPollResults(voters: nil, totalVoters: nil, recentVoters: [], solution: nil, hasUnseenVotes: false), isClosed: false, deadlineTimeout: nil, deadlineDate: nil, pollHash: poll.pollHash)) messageMedia = updatedMedia } if let _ = media as? TelegramMediaDice { @@ -887,7 +887,10 @@ class ChatControllerNode: ASDisplayNode, ASScrollViewDelegate { self.textInputPanelNode = ChatTextInputPanelNode(context: context, presentationInterfaceState: chatPresentationInterfaceState, presentationContext: ChatPresentationContext(context: context, backgroundNode: backgroundNode), presentController: { [weak self] controller in self?.interfaceInteraction?.presentController(controller, nil) }) - self.textInputPanelNode?.isAIEnabled = true + if let data = self.context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_chat"] as? Double, value == 1.0 { + } else { + self.textInputPanelNode?.isAIEnabled = true + } self.textInputPanelNode?.textInputAccessoryPanel = textInputAccessoryPanel self.textInputPanelNode?.textInputContextPanel = textInputContextPanel self.textInputPanelNode?.storedInputLanguage = chatPresentationInterfaceState.interfaceState.inputLanguage diff --git a/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift b/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift index 9e2c3f4809..b63e67f68b 100644 --- a/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift +++ b/submodules/TelegramUI/Sources/ChatControllerOpenAttachmentMenu.swift @@ -1890,7 +1890,9 @@ extension ChatControllerImpl { if case .scheduledMessages = self.presentationInterfaceState.subject { isScheduledMessages = true } - return self.context.sharedContext.makeGalleryCaptionPanelView(context: self.context, chatLocation: self.presentationInterfaceState.chatLocation, isScheduledMessages: isScheduledMessages, isFile: isFile, hasTimer: hasTimer, customEmojiAvailable: self.presentationInterfaceState.customEmojiAvailable, present: { [weak self] c in + return self.context.sharedContext.makeGalleryCaptionPanelView(context: self.context, chatLocation: self.presentationInterfaceState.chatLocation, isScheduledMessages: isScheduledMessages, isFile: isFile, hasTimer: hasTimer, customEmojiAvailable: self.presentationInterfaceState.customEmojiAvailable, pushViewController: { [weak self] c in + self?.push(c) + }, present: { [weak self] c in self?.present(c, in: .window(.root)) }, presentInGlobalOverlay: { [weak self] c in guard let self else { diff --git a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift index 72cde46ac7..5f97ca701d 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryListNode.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryListNode.swift @@ -978,7 +978,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH return } if strongSelf.canReadHistoryValue && !strongSelf.suspendReadingReactions && !strongSelf.context.sharedContext.immediateExperimentalUISettings.skipReadHistory { - strongSelf.context.account.viewTracker.updateMarkReactionsSeenForMessageIds(messageIds: Set(messageIds.map(\.messageId))) + strongSelf.context.account.viewTracker.updateMarkReactionsAndVotesSeenForMessageIds(messageIds: Set(messageIds.map(\.messageId))) } else { strongSelf.messageIdsWithReactionsScheduledForMarkAsSeen.formUnion(messageIds.map(\.messageId)) } @@ -2510,7 +2510,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH let _ = self.displayUnseenReactionAnimations(messageIds: Array(messageIds)) self.messageIdsWithReactionsScheduledForMarkAsSeen.removeAll() - self.context.account.viewTracker.updateMarkReactionsSeenForMessageIds(messageIds: messageIds) + self.context.account.viewTracker.updateMarkReactionsAndVotesSeenForMessageIds(messageIds: messageIds) } if self.canReadHistoryValue { @@ -2851,7 +2851,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH } var contentRequiredValidation = false var mediaRequiredValidation = false - var hasUnseenReactions = false + var hasUnseenReactionsOrPollVotes = false var storiesRequiredValidation = false var factCheckRequired = false for attribute in message.attributes { @@ -2868,7 +2868,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH } else if let _ = attribute as? ContentRequiresValidationMessageAttribute { contentRequiredValidation = true } else if let attribute = attribute as? ReactionsMessageAttribute, attribute.hasUnseen { - hasUnseenReactions = true + hasUnseenReactionsOrPollVotes = true } else if let attribute = attribute as? AdMessageAttribute { if message.stableId != ChatHistoryListNodeImpl.fixedAdMessageStableId { visibleAdOpaqueIds.append(attribute.opaqueId) @@ -2922,6 +2922,10 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH storiesRequiredValidation = true } else if let webpage = media as? TelegramMediaWebpage, case let .Loaded(content) = webpage.content, let _ = content.story { storiesRequiredValidation = true + } else if let poll = media as? TelegramMediaPoll { + if poll.results.hasUnseenVotes == true { + hasUnseenReactionsOrPollVotes = true + } } } if contentRequiredValidation { @@ -2936,7 +2940,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH if hasUnconsumedMention && !hasUnconsumedContent { messageIdsWithUnseenPersonalMention.append(message.id) } - if hasUnseenReactions { + if hasUnseenReactionsOrPollVotes { messageIdsWithUnseenReactions.append(message.id) } if factCheckRequired { @@ -2962,7 +2966,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH for (message, _, _, _, _) in messages { var hasUnconsumedMention = false var hasUnconsumedContent = false - var hasUnseenReactions = false + var hasUnseenReactionsOrPollVotes = false var factCheckRequired = false if message.tags.contains(.unseenPersonalMessage) { for attribute in message.attributes { @@ -2978,6 +2982,10 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH if let representation = image.representations.last { downloadableResourceIds.append((message.id, representation.resource.id.stringRepresentation)) } + } else if let poll = media as? TelegramMediaPoll { + if poll.results.hasUnseenVotes == true { + hasUnseenReactionsOrPollVotes = true + } } } for attribute in message.attributes { @@ -2992,7 +3000,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH } else if let attribute = attribute as? ConsumableContentMessageAttribute, !attribute.consumed { hasUnconsumedContent = true } else if let attribute = attribute as? ReactionsMessageAttribute, attribute.hasUnseen { - hasUnseenReactions = true + hasUnseenReactionsOrPollVotes = true } else if let attribute = attribute as? FactCheckMessageAttribute, case .Pending = attribute.content { factCheckRequired = true } @@ -3000,7 +3008,7 @@ public final class ChatHistoryListNodeImpl: ListViewImpl, ChatHistoryNode, ChatH if hasUnconsumedMention && !hasUnconsumedContent { messageIdsWithUnseenPersonalMention.append(message.id) } - if hasUnseenReactions { + if hasUnseenReactionsOrPollVotes { messageIdsWithUnseenReactions.append(message.id) } if factCheckRequired { diff --git a/submodules/TelegramUI/Sources/ChatHistoryNavigationButtonNode.swift b/submodules/TelegramUI/Sources/ChatHistoryNavigationButtonNode.swift index 5d8436bc89..53e1f93698 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryNavigationButtonNode.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryNavigationButtonNode.swift @@ -16,6 +16,7 @@ enum ChatHistoryNavigationButtonType { case up case mentions case reactions + case pollVotes } class ChatHistoryNavigationButtonNode: ContextControllerSourceNode { @@ -69,6 +70,8 @@ class ChatHistoryNavigationButtonNode: ContextControllerSourceNode { self.imageView.image = PresentationResourcesChat.chatHistoryMentionsButtonImage(theme) case .reactions: self.imageView.image = PresentationResourcesChat.chatHistoryReactionsButtonImage(theme) + case .pollVotes: + self.imageView.image = PresentationResourcesChat.chatHistoryPollVotesButtonImage(theme) } self.badgeBackgroundView = GlassBackgroundView() @@ -126,6 +129,8 @@ class ChatHistoryNavigationButtonNode: ContextControllerSourceNode { self.imageView.image = PresentationResourcesChat.chatHistoryMentionsButtonImage(theme) case .reactions: self.imageView.image = PresentationResourcesChat.chatHistoryReactionsButtonImage(theme) + case .pollVotes: + self.imageView.image = PresentationResourcesChat.chatHistoryPollVotesButtonImage(theme) } self.badgeBackgroundView.update(size: self.badgeBackgroundView.bounds.size, cornerRadius: self.badgeBackgroundView.bounds.height * 0.5, isDark: theme.overallDarkAppearance, tintColor: .init(kind: .custom(style: .default, color: theme.chat.inputPanel.actionControlFillColor)), transition: .immediate) diff --git a/submodules/TelegramUI/Sources/ChatHistoryNavigationButtons.swift b/submodules/TelegramUI/Sources/ChatHistoryNavigationButtons.swift index 4a01de75a8..de472c88f3 100644 --- a/submodules/TelegramUI/Sources/ChatHistoryNavigationButtons.swift +++ b/submodules/TelegramUI/Sources/ChatHistoryNavigationButtons.swift @@ -31,6 +31,7 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { private let isChatRotated: Bool let reactionsButton: ChatHistoryNavigationButtonNode + let pollVotesButton: ChatHistoryNavigationButtonNode let mentionsButton: ChatHistoryNavigationButtonNode let downButton: ChatHistoryNavigationButtonNode let upButton: ChatHistoryNavigationButtonNode @@ -48,6 +49,7 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { } var reactionsPressed: (() -> Void)? + var pollVotesPressed: (() -> Void)? var mentionsPressed: (() -> Void)? var directionButtonState: DirectionState = DirectionState(up: nil, down: nil) { @@ -96,6 +98,20 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { } } + var pollVotesCount: Int32 = 0 { + didSet { + if self.pollVotesCount != 0 { + self.pollVotesButton.badge = compactNumericCountString(Int(self.pollVotesCount), decimalSeparator: self.dateTimeFormat.decimalSeparator) + } else { + self.pollVotesButton.badge = "" + } + + if (oldValue != 0) != (self.pollVotesCount != 0) { + let _ = self.updateLayout(transition: .animated(duration: 0.3, curve: .spring)) + } + } + } + init(theme: PresentationTheme, preferClearGlass: Bool, dateTimeFormat: PresentationDateTimeFormat, backgroundNode: WallpaperBackgroundNode, isChatRotated: Bool) { self.isChatRotated = isChatRotated self.theme = theme @@ -110,6 +126,10 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { self.reactionsButton.alpha = 0.0 self.reactionsButton.isHidden = true + self.pollVotesButton = ChatHistoryNavigationButtonNode(theme: theme, preferClearGlass: preferClearGlass, backgroundNode: backgroundNode, type: .pollVotes) + self.pollVotesButton.alpha = 0.0 + self.pollVotesButton.isHidden = true + self.downButton = ChatHistoryNavigationButtonNode(theme: theme, preferClearGlass: preferClearGlass, backgroundNode: backgroundNode, type: isChatRotated ? .down : .up) self.downButton.alpha = 0.0 self.downButton.isHidden = true @@ -121,6 +141,7 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { super.init() self.addSubnode(self.reactionsButton) + self.addSubnode(self.pollVotesButton) self.addSubnode(self.mentionsButton) self.addSubnode(self.downButton) self.addSubnode(self.upButton) @@ -129,6 +150,10 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { self?.reactionsPressed?() } + self.pollVotesButton.tapped = { [weak self] in + self?.pollVotesPressed?() + } + self.mentionsButton.tapped = { [weak self] in self?.mentionsPressed?() } @@ -147,6 +172,7 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { self.dateTimeFormat = dateTimeFormat self.reactionsButton.updateTheme(theme: theme, preferClearGlass: preferClearGlass, backgroundNode: backgroundNode) + self.pollVotesButton.updateTheme(theme: theme, preferClearGlass: preferClearGlass, backgroundNode: backgroundNode) self.mentionsButton.updateTheme(theme: theme, preferClearGlass: preferClearGlass, backgroundNode: backgroundNode) self.downButton.updateTheme(theme: theme, preferClearGlass: preferClearGlass, backgroundNode: backgroundNode) self.upButton.updateTheme(theme: theme, preferClearGlass: preferClearGlass, backgroundNode: backgroundNode) @@ -161,6 +187,11 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { reactionsFrame.origin.y += rect.minY self.reactionsButton.update(rect: reactionsFrame, within: containerSize, transition: transition) + var pollVotesFrame = self.pollVotesButton.frame + pollVotesFrame.origin.x += rect.minX + pollVotesFrame.origin.y += rect.minY + self.pollVotesButton.update(rect: pollVotesFrame, within: containerSize, transition: transition) + var mentionsFrame = self.mentionsButton.frame mentionsFrame.origin.x += rect.minX mentionsFrame.origin.y += rect.minY @@ -183,6 +214,7 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { var upOffset: CGFloat = 0.0 var mentionsOffset: CGFloat = 0.0 var reactionsOffset: CGFloat = 0.0 + var pollVotesOffset: CGFloat = 0.0 if let down = self.directionButtonState.down { self.downButton.imageView.alpha = down.isEnabled ? 1.0 : 0.5 @@ -240,6 +272,7 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { } if self.reactionsCount != 0 { + pollVotesOffset += buttonSize.height + 12.0 self.reactionsButton.isHidden = false transition.updateAlpha(node: self.reactionsButton, alpha: 1.0) transition.updateTransformScale(node: self.reactionsButton, scale: 1.0) @@ -253,16 +286,32 @@ final class ChatHistoryNavigationButtons: ASDisplayNode { transition.updateTransformScale(node: self.reactionsButton, scale: 0.2) } + if self.pollVotesCount != 0 { + self.pollVotesButton.isHidden = false + transition.updateAlpha(node: self.pollVotesButton, alpha: 1.0) + transition.updateTransformScale(node: self.pollVotesButton, scale: 1.0) + } else { + transition.updateAlpha(node: self.pollVotesButton, alpha: 0.0, completion: { [weak self] completed in + guard let strongSelf = self, completed else { + return + } + strongSelf.pollVotesButton.isHidden = true + }) + transition.updateTransformScale(node: self.pollVotesButton, scale: 0.2) + } + if self.isChatRotated { transition.updatePosition(node: self.downButton, position: CGRect(origin: CGPoint(x: 0.0, y: completeSize.height - buttonSize.height), size: buttonSize).center) transition.updatePosition(node: self.upButton, position: CGRect(origin: CGPoint(x: 0.0, y: completeSize.height - buttonSize.height - upOffset), size: buttonSize).center) transition.updatePosition(node: self.mentionsButton, position: CGRect(origin: CGPoint(x: 0.0, y: completeSize.height - buttonSize.height - mentionsOffset), size: buttonSize).center) transition.updatePosition(node: self.reactionsButton, position: CGRect(origin: CGPoint(x: 0.0, y: completeSize.height - buttonSize.height - mentionsOffset - reactionsOffset), size: buttonSize).center) + transition.updatePosition(node: self.pollVotesButton, position: CGRect(origin: CGPoint(x: 0.0, y: completeSize.height - buttonSize.height - mentionsOffset - reactionsOffset - pollVotesOffset), size: buttonSize).center) } else { transition.updatePosition(node: self.downButton, position: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: buttonSize).center) transition.updatePosition(node: self.upButton, position: CGRect(origin: CGPoint(x: 0.0, y: upOffset), size: buttonSize).center) transition.updatePosition(node: self.mentionsButton, position: CGRect(origin: CGPoint(x: 0.0, y: mentionsOffset), size: buttonSize).center) transition.updatePosition(node: self.reactionsButton, position: CGRect(origin: CGPoint(x: 0.0, y: mentionsOffset + reactionsOffset), size: buttonSize).center) + transition.updatePosition(node: self.pollVotesButton, position: CGRect(origin: CGPoint(x: 0.0, y: mentionsOffset + reactionsOffset + pollVotesOffset), size: buttonSize).center) } if let (rect, containerSize) = self.absoluteRect { diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateInputPanels.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateInputPanels.swift index 59f0ccc7f9..8a6217278f 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateInputPanels.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateInputPanels.swift @@ -464,7 +464,10 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState let panel = ChatTextInputPanelNode(context: context, presentationInterfaceState: chatPresentationInterfaceState, presentationContext: nil, presentController: { [weak interfaceInteraction] controller in interfaceInteraction?.presentController(controller, nil) }) - panel.isAIEnabled = true + if let data = context.currentAppConfiguration.with({ $0 }).data, let value = data["ios_disable_ai_chat"] as? Double, value == 1.0 { + } else { + panel.isAIEnabled = true + } panel.textInputAccessoryPanel = textInputAccessoryPanel panel.textInputContextPanel = textInputContextPanel panel.chatControllerInteraction = chatControllerInteraction diff --git a/submodules/TelegramUI/Sources/ChatSearchResultsContollerNode.swift b/submodules/TelegramUI/Sources/ChatSearchResultsContollerNode.swift index 447afbdc96..be9444e201 100644 --- a/submodules/TelegramUI/Sources/ChatSearchResultsContollerNode.swift +++ b/submodules/TelegramUI/Sources/ChatSearchResultsContollerNode.swift @@ -99,6 +99,7 @@ private enum ChatListSearchEntry: Comparable, Identifiable { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/TelegramUI/Sources/CommandChatInputContextPanelNode.swift b/submodules/TelegramUI/Sources/CommandChatInputContextPanelNode.swift index 534f29ac7f..aef09615e3 100644 --- a/submodules/TelegramUI/Sources/CommandChatInputContextPanelNode.swift +++ b/submodules/TelegramUI/Sources/CommandChatInputContextPanelNode.swift @@ -221,6 +221,7 @@ private struct CommandChatInputContextPanelEntry: Comparable, Identifiable { presence: nil, hasUnseenMentions: false, hasUnseenReactions: false, + hasUnseenPollVotes: false, draftState: nil, mediaDraftContentType: nil, inputActivities: nil, diff --git a/submodules/TelegramUI/Sources/SharedAccountContext.swift b/submodules/TelegramUI/Sources/SharedAccountContext.swift index 480e50635c..1fb7b7476a 100644 --- a/submodules/TelegramUI/Sources/SharedAccountContext.swift +++ b/submodules/TelegramUI/Sources/SharedAccountContext.swift @@ -2756,13 +2756,14 @@ public final class SharedAccountContextImpl: SharedAccountContext { return makeAttachmentFileControllerImpl(context: context, updatedPresentationData: updatedPresentationData, mode: audio ? .audio(.chat) : .recent, bannedSendMedia: bannedSendMedia, presentGallery: presentGallery, presentFiles: presentFiles, presentDocumentScanner: presentDocumentScanner, send: send) } - public func makeGalleryCaptionPanelView(context: AccountContext, chatLocation: ChatLocation, isScheduledMessages: Bool, isFile: Bool, hasTimer: Bool, customEmojiAvailable: Bool, present: @escaping (ViewController) -> Void, presentInGlobalOverlay: @escaping (ViewController) -> Void) -> NSObject? { + public func makeGalleryCaptionPanelView(context: AccountContext, chatLocation: ChatLocation, isScheduledMessages: Bool, isFile: Bool, hasTimer: Bool, customEmojiAvailable: Bool, pushViewController: @escaping (ViewController) -> Void, present: @escaping (ViewController) -> Void, presentInGlobalOverlay: @escaping (ViewController) -> Void) -> NSObject? { let inputPanelNode = LegacyMessageInputPanelNode( context: context, chatLocation: chatLocation, isScheduledMessages: isScheduledMessages, isFile: isFile, hasTimer: hasTimer, + pushViewController: pushViewController, present: present, presentInGlobalOverlay: presentInGlobalOverlay, makeEntityInputView: { @@ -4372,6 +4373,7 @@ public final class SharedAccountContextImpl: SharedAccountContext { public func makeTextProcessingScreen( context: AccountContext, + theme: PresentationTheme?, mode: TextProcessingScreenMode, ignoredTranslationLanguages: [String], inputText: TextWithEntities, @@ -4380,6 +4382,7 @@ public final class SharedAccountContextImpl: SharedAccountContext { ) async -> ViewController { return await TextProcessingScreen( context: context, + theme: theme, mode: mode, ignoredTranslationLanguages: ignoredTranslationLanguages, inputText: inputText,