Telegram-iOS/submodules/TelegramApi/Sources/Api8.swift
Ilya Laktyushin 0df319742a Update API
2026-04-16 01:18:22 +02:00

1827 lines
91 KiB
Swift

public extension Api {
enum GroupCallParticipant: TypeConstructorDescription {
public class Cons_groupCallParticipant: TypeConstructorDescription {
public var flags: Int32
public var peer: Api.Peer
public var date: Int32
public var activeDate: Int32?
public var source: Int32
public var volume: Int32?
public var about: String?
public var raiseHandRating: Int64?
public var video: Api.GroupCallParticipantVideo?
public var presentation: Api.GroupCallParticipantVideo?
public var paidStarsTotal: Int64?
public init(flags: Int32, peer: Api.Peer, date: Int32, activeDate: Int32?, source: Int32, volume: Int32?, about: String?, raiseHandRating: Int64?, video: Api.GroupCallParticipantVideo?, presentation: Api.GroupCallParticipantVideo?, paidStarsTotal: Int64?) {
self.flags = flags
self.peer = peer
self.date = date
self.activeDate = activeDate
self.source = source
self.volume = volume
self.about = about
self.raiseHandRating = raiseHandRating
self.video = video
self.presentation = presentation
self.paidStarsTotal = paidStarsTotal
}
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)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .groupCallParticipant(let _data):
if boxed {
buffer.appendInt32(708691884)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
_data.peer.serialize(buffer, true)
serializeInt32(_data.date, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 3) != 0 {
serializeInt32(_data.activeDate!, buffer: buffer, boxed: false)
}
serializeInt32(_data.source, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 7) != 0 {
serializeInt32(_data.volume!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 11) != 0 {
serializeString(_data.about!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 13) != 0 {
serializeInt64(_data.raiseHandRating!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 6) != 0 {
_data.video!.serialize(buffer, true)
}
if Int(_data.flags) & Int(1 << 14) != 0 {
_data.presentation!.serialize(buffer, true)
}
if Int(_data.flags) & Int(1 << 16) != 0 {
serializeInt64(_data.paidStarsTotal!, buffer: buffer, boxed: false)
}
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .groupCallParticipant(let _data):
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))])
}
}
public static func parse_groupCallParticipant(_ reader: BufferReader) -> GroupCallParticipant? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.Peer?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.Peer
}
var _3: Int32?
_3 = reader.readInt32()
var _4: Int32?
if Int(_1!) & Int(1 << 3) != 0 {
_4 = reader.readInt32()
}
var _5: Int32?
_5 = reader.readInt32()
var _6: Int32?
if Int(_1!) & Int(1 << 7) != 0 {
_6 = reader.readInt32()
}
var _7: String?
if Int(_1!) & Int(1 << 11) != 0 {
_7 = parseString(reader)
}
var _8: Int64?
if Int(_1!) & Int(1 << 13) != 0 {
_8 = reader.readInt64()
}
var _9: Api.GroupCallParticipantVideo?
if Int(_1!) & Int(1 << 6) != 0 {
if let signature = reader.readInt32() {
_9 = Api.parse(reader, signature: signature) as? Api.GroupCallParticipantVideo
}
}
var _10: Api.GroupCallParticipantVideo?
if Int(_1!) & Int(1 << 14) != 0 {
if let signature = reader.readInt32() {
_10 = Api.parse(reader, signature: signature) as? Api.GroupCallParticipantVideo
}
}
var _11: Int64?
if Int(_1!) & Int(1 << 16) != 0 {
_11 = reader.readInt64()
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil
let _c5 = _5 != nil
let _c6 = (Int(_1!) & Int(1 << 7) == 0) || _6 != nil
let _c7 = (Int(_1!) & Int(1 << 11) == 0) || _7 != nil
let _c8 = (Int(_1!) & Int(1 << 13) == 0) || _8 != nil
let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil
let _c10 = (Int(_1!) & Int(1 << 14) == 0) || _10 != nil
let _c11 = (Int(_1!) & Int(1 << 16) == 0) || _11 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 {
return Api.GroupCallParticipant.groupCallParticipant(Cons_groupCallParticipant(flags: _1!, peer: _2!, date: _3!, activeDate: _4, source: _5!, volume: _6, about: _7, raiseHandRating: _8, video: _9, presentation: _10, paidStarsTotal: _11))
}
else {
return nil
}
}
}
}
public extension Api {
enum GroupCallParticipantVideo: TypeConstructorDescription {
public class Cons_groupCallParticipantVideo: TypeConstructorDescription {
public var flags: Int32
public var endpoint: String
public var sourceGroups: [Api.GroupCallParticipantVideoSourceGroup]
public var audioSource: Int32?
public init(flags: Int32, endpoint: String, sourceGroups: [Api.GroupCallParticipantVideoSourceGroup], audioSource: Int32?) {
self.flags = flags
self.endpoint = endpoint
self.sourceGroups = sourceGroups
self.audioSource = audioSource
}
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)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .groupCallParticipantVideo(let _data):
if boxed {
buffer.appendInt32(1735736008)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.endpoint, buffer: buffer, boxed: false)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(_data.sourceGroups.count))
for item in _data.sourceGroups {
item.serialize(buffer, true)
}
if Int(_data.flags) & Int(1 << 1) != 0 {
serializeInt32(_data.audioSource!, buffer: buffer, boxed: false)
}
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .groupCallParticipantVideo(let _data):
return ("groupCallParticipantVideo", [("flags", ConstructorParameterDescription(_data.flags)), ("endpoint", ConstructorParameterDescription(_data.endpoint)), ("sourceGroups", ConstructorParameterDescription(_data.sourceGroups)), ("audioSource", ConstructorParameterDescription(_data.audioSource))])
}
}
public static func parse_groupCallParticipantVideo(_ reader: BufferReader) -> GroupCallParticipantVideo? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: [Api.GroupCallParticipantVideoSourceGroup]?
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.GroupCallParticipantVideoSourceGroup.self)
}
var _4: Int32?
if Int(_1!) & Int(1 << 1) != 0 {
_4 = reader.readInt32()
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.GroupCallParticipantVideo.groupCallParticipantVideo(Cons_groupCallParticipantVideo(flags: _1!, endpoint: _2!, sourceGroups: _3!, audioSource: _4))
}
else {
return nil
}
}
}
}
public extension Api {
enum GroupCallParticipantVideoSourceGroup: TypeConstructorDescription {
public class Cons_groupCallParticipantVideoSourceGroup: TypeConstructorDescription {
public var semantics: String
public var sources: [Int32]
public init(semantics: String, sources: [Int32]) {
self.semantics = semantics
self.sources = sources
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("groupCallParticipantVideoSourceGroup", [("semantics", ConstructorParameterDescription(self.semantics)), ("sources", ConstructorParameterDescription(self.sources))])
}
}
case groupCallParticipantVideoSourceGroup(Cons_groupCallParticipantVideoSourceGroup)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .groupCallParticipantVideoSourceGroup(let _data):
if boxed {
buffer.appendInt32(-592373577)
}
serializeString(_data.semantics, buffer: buffer, boxed: false)
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(_data.sources.count))
for item in _data.sources {
serializeInt32(item, buffer: buffer, boxed: false)
}
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .groupCallParticipantVideoSourceGroup(let _data):
return ("groupCallParticipantVideoSourceGroup", [("semantics", ConstructorParameterDescription(_data.semantics)), ("sources", ConstructorParameterDescription(_data.sources))])
}
}
public static func parse_groupCallParticipantVideoSourceGroup(_ reader: BufferReader) -> GroupCallParticipantVideoSourceGroup? {
var _1: String?
_1 = parseString(reader)
var _2: [Int32]?
if let _ = reader.readInt32() {
_2 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self)
}
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.GroupCallParticipantVideoSourceGroup.groupCallParticipantVideoSourceGroup(Cons_groupCallParticipantVideoSourceGroup(semantics: _1!, sources: _2!))
}
else {
return nil
}
}
}
}
public extension Api {
enum GroupCallStreamChannel: TypeConstructorDescription {
public class Cons_groupCallStreamChannel: TypeConstructorDescription {
public var channel: Int32
public var scale: Int32
public var lastTimestampMs: Int64
public init(channel: Int32, scale: Int32, lastTimestampMs: Int64) {
self.channel = channel
self.scale = scale
self.lastTimestampMs = lastTimestampMs
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("groupCallStreamChannel", [("channel", ConstructorParameterDescription(self.channel)), ("scale", ConstructorParameterDescription(self.scale)), ("lastTimestampMs", ConstructorParameterDescription(self.lastTimestampMs))])
}
}
case groupCallStreamChannel(Cons_groupCallStreamChannel)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .groupCallStreamChannel(let _data):
if boxed {
buffer.appendInt32(-2132064081)
}
serializeInt32(_data.channel, buffer: buffer, boxed: false)
serializeInt32(_data.scale, buffer: buffer, boxed: false)
serializeInt64(_data.lastTimestampMs, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .groupCallStreamChannel(let _data):
return ("groupCallStreamChannel", [("channel", ConstructorParameterDescription(_data.channel)), ("scale", ConstructorParameterDescription(_data.scale)), ("lastTimestampMs", ConstructorParameterDescription(_data.lastTimestampMs))])
}
}
public static func parse_groupCallStreamChannel(_ reader: BufferReader) -> GroupCallStreamChannel? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int32?
_2 = reader.readInt32()
var _3: Int64?
_3 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.GroupCallStreamChannel.groupCallStreamChannel(Cons_groupCallStreamChannel(channel: _1!, scale: _2!, lastTimestampMs: _3!))
}
else {
return nil
}
}
}
}
public extension Api {
enum HighScore: TypeConstructorDescription {
public class Cons_highScore: TypeConstructorDescription {
public var pos: Int32
public var userId: Int64
public var score: Int32
public init(pos: Int32, userId: Int64, score: Int32) {
self.pos = pos
self.userId = userId
self.score = score
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("highScore", [("pos", ConstructorParameterDescription(self.pos)), ("userId", ConstructorParameterDescription(self.userId)), ("score", ConstructorParameterDescription(self.score))])
}
}
case highScore(Cons_highScore)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .highScore(let _data):
if boxed {
buffer.appendInt32(1940093419)
}
serializeInt32(_data.pos, buffer: buffer, boxed: false)
serializeInt64(_data.userId, buffer: buffer, boxed: false)
serializeInt32(_data.score, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .highScore(let _data):
return ("highScore", [("pos", ConstructorParameterDescription(_data.pos)), ("userId", ConstructorParameterDescription(_data.userId)), ("score", ConstructorParameterDescription(_data.score))])
}
}
public static func parse_highScore(_ reader: BufferReader) -> HighScore? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int64?
_2 = reader.readInt64()
var _3: Int32?
_3 = reader.readInt32()
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.HighScore.highScore(Cons_highScore(pos: _1!, userId: _2!, score: _3!))
}
else {
return nil
}
}
}
}
public extension Api {
enum ImportedContact: TypeConstructorDescription {
public class Cons_importedContact: TypeConstructorDescription {
public var userId: Int64
public var clientId: Int64
public init(userId: Int64, clientId: Int64) {
self.userId = userId
self.clientId = clientId
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("importedContact", [("userId", ConstructorParameterDescription(self.userId)), ("clientId", ConstructorParameterDescription(self.clientId))])
}
}
case importedContact(Cons_importedContact)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .importedContact(let _data):
if boxed {
buffer.appendInt32(-1052885936)
}
serializeInt64(_data.userId, buffer: buffer, boxed: false)
serializeInt64(_data.clientId, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .importedContact(let _data):
return ("importedContact", [("userId", ConstructorParameterDescription(_data.userId)), ("clientId", ConstructorParameterDescription(_data.clientId))])
}
}
public static func parse_importedContact(_ reader: BufferReader) -> ImportedContact? {
var _1: Int64?
_1 = reader.readInt64()
var _2: Int64?
_2 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.ImportedContact.importedContact(Cons_importedContact(userId: _1!, clientId: _2!))
}
else {
return nil
}
}
}
}
public extension Api {
enum InlineBotSwitchPM: TypeConstructorDescription {
public class Cons_inlineBotSwitchPM: TypeConstructorDescription {
public var text: String
public var startParam: String
public init(text: String, startParam: String) {
self.text = text
self.startParam = startParam
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inlineBotSwitchPM", [("text", ConstructorParameterDescription(self.text)), ("startParam", ConstructorParameterDescription(self.startParam))])
}
}
case inlineBotSwitchPM(Cons_inlineBotSwitchPM)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inlineBotSwitchPM(let _data):
if boxed {
buffer.appendInt32(1008755359)
}
serializeString(_data.text, buffer: buffer, boxed: false)
serializeString(_data.startParam, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inlineBotSwitchPM(let _data):
return ("inlineBotSwitchPM", [("text", ConstructorParameterDescription(_data.text)), ("startParam", ConstructorParameterDescription(_data.startParam))])
}
}
public static func parse_inlineBotSwitchPM(_ reader: BufferReader) -> InlineBotSwitchPM? {
var _1: String?
_1 = parseString(reader)
var _2: String?
_2 = parseString(reader)
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.InlineBotSwitchPM.inlineBotSwitchPM(Cons_inlineBotSwitchPM(text: _1!, startParam: _2!))
}
else {
return nil
}
}
}
}
public extension Api {
enum InlineBotWebView: TypeConstructorDescription {
public class Cons_inlineBotWebView: TypeConstructorDescription {
public var text: String
public var url: String
public init(text: String, url: String) {
self.text = text
self.url = url
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inlineBotWebView", [("text", ConstructorParameterDescription(self.text)), ("url", ConstructorParameterDescription(self.url))])
}
}
case inlineBotWebView(Cons_inlineBotWebView)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inlineBotWebView(let _data):
if boxed {
buffer.appendInt32(-1250781739)
}
serializeString(_data.text, buffer: buffer, boxed: false)
serializeString(_data.url, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inlineBotWebView(let _data):
return ("inlineBotWebView", [("text", ConstructorParameterDescription(_data.text)), ("url", ConstructorParameterDescription(_data.url))])
}
}
public static func parse_inlineBotWebView(_ reader: BufferReader) -> InlineBotWebView? {
var _1: String?
_1 = parseString(reader)
var _2: String?
_2 = parseString(reader)
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.InlineBotWebView.inlineBotWebView(Cons_inlineBotWebView(text: _1!, url: _2!))
}
else {
return nil
}
}
}
}
public extension Api {
enum InlineQueryPeerType: TypeConstructorDescription {
case inlineQueryPeerTypeBotPM
case inlineQueryPeerTypeBroadcast
case inlineQueryPeerTypeChat
case inlineQueryPeerTypeMegagroup
case inlineQueryPeerTypePM
case inlineQueryPeerTypeSameBotPM
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inlineQueryPeerTypeBotPM:
if boxed {
buffer.appendInt32(238759180)
}
break
case .inlineQueryPeerTypeBroadcast:
if boxed {
buffer.appendInt32(1664413338)
}
break
case .inlineQueryPeerTypeChat:
if boxed {
buffer.appendInt32(-681130742)
}
break
case .inlineQueryPeerTypeMegagroup:
if boxed {
buffer.appendInt32(1589952067)
}
break
case .inlineQueryPeerTypePM:
if boxed {
buffer.appendInt32(-2093215828)
}
break
case .inlineQueryPeerTypeSameBotPM:
if boxed {
buffer.appendInt32(813821341)
}
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inlineQueryPeerTypeBotPM:
return ("inlineQueryPeerTypeBotPM", [])
case .inlineQueryPeerTypeBroadcast:
return ("inlineQueryPeerTypeBroadcast", [])
case .inlineQueryPeerTypeChat:
return ("inlineQueryPeerTypeChat", [])
case .inlineQueryPeerTypeMegagroup:
return ("inlineQueryPeerTypeMegagroup", [])
case .inlineQueryPeerTypePM:
return ("inlineQueryPeerTypePM", [])
case .inlineQueryPeerTypeSameBotPM:
return ("inlineQueryPeerTypeSameBotPM", [])
}
}
public static func parse_inlineQueryPeerTypeBotPM(_ reader: BufferReader) -> InlineQueryPeerType? {
return Api.InlineQueryPeerType.inlineQueryPeerTypeBotPM
}
public static func parse_inlineQueryPeerTypeBroadcast(_ reader: BufferReader) -> InlineQueryPeerType? {
return Api.InlineQueryPeerType.inlineQueryPeerTypeBroadcast
}
public static func parse_inlineQueryPeerTypeChat(_ reader: BufferReader) -> InlineQueryPeerType? {
return Api.InlineQueryPeerType.inlineQueryPeerTypeChat
}
public static func parse_inlineQueryPeerTypeMegagroup(_ reader: BufferReader) -> InlineQueryPeerType? {
return Api.InlineQueryPeerType.inlineQueryPeerTypeMegagroup
}
public static func parse_inlineQueryPeerTypePM(_ reader: BufferReader) -> InlineQueryPeerType? {
return Api.InlineQueryPeerType.inlineQueryPeerTypePM
}
public static func parse_inlineQueryPeerTypeSameBotPM(_ reader: BufferReader) -> InlineQueryPeerType? {
return Api.InlineQueryPeerType.inlineQueryPeerTypeSameBotPM
}
}
}
public extension Api {
enum InputAiComposeTone: TypeConstructorDescription {
public class Cons_inputAiComposeToneDefault: TypeConstructorDescription {
public var tone: String
public init(tone: String) {
self.tone = tone
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputAiComposeToneDefault", [("tone", ConstructorParameterDescription(self.tone))])
}
}
public class Cons_inputAiComposeToneID: TypeConstructorDescription {
public var id: Int64
public var accessHash: Int64
public init(id: Int64, accessHash: Int64) {
self.id = id
self.accessHash = accessHash
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputAiComposeToneID", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))])
}
}
public class Cons_inputAiComposeToneSlug: TypeConstructorDescription {
public var slug: String
public init(slug: String) {
self.slug = slug
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputAiComposeToneSlug", [("slug", ConstructorParameterDescription(self.slug))])
}
}
case inputAiComposeToneDefault(Cons_inputAiComposeToneDefault)
case inputAiComposeToneID(Cons_inputAiComposeToneID)
case inputAiComposeToneSlug(Cons_inputAiComposeToneSlug)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputAiComposeToneDefault(let _data):
if boxed {
buffer.appendInt32(535407039)
}
serializeString(_data.tone, buffer: buffer, boxed: false)
break
case .inputAiComposeToneID(let _data):
if boxed {
buffer.appendInt32(125026432)
}
serializeInt64(_data.id, buffer: buffer, boxed: false)
serializeInt64(_data.accessHash, buffer: buffer, boxed: false)
break
case .inputAiComposeToneSlug(let _data):
if boxed {
buffer.appendInt32(530584407)
}
serializeString(_data.slug, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inputAiComposeToneDefault(let _data):
return ("inputAiComposeToneDefault", [("tone", ConstructorParameterDescription(_data.tone))])
case .inputAiComposeToneID(let _data):
return ("inputAiComposeToneID", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))])
case .inputAiComposeToneSlug(let _data):
return ("inputAiComposeToneSlug", [("slug", ConstructorParameterDescription(_data.slug))])
}
}
public static func parse_inputAiComposeToneDefault(_ reader: BufferReader) -> InputAiComposeTone? {
var _1: String?
_1 = parseString(reader)
let _c1 = _1 != nil
if _c1 {
return Api.InputAiComposeTone.inputAiComposeToneDefault(Cons_inputAiComposeToneDefault(tone: _1!))
}
else {
return nil
}
}
public static func parse_inputAiComposeToneID(_ reader: BufferReader) -> InputAiComposeTone? {
var _1: Int64?
_1 = reader.readInt64()
var _2: Int64?
_2 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.InputAiComposeTone.inputAiComposeToneID(Cons_inputAiComposeToneID(id: _1!, accessHash: _2!))
}
else {
return nil
}
}
public static func parse_inputAiComposeToneSlug(_ reader: BufferReader) -> InputAiComposeTone? {
var _1: String?
_1 = parseString(reader)
let _c1 = _1 != nil
if _c1 {
return Api.InputAiComposeTone.inputAiComposeToneSlug(Cons_inputAiComposeToneSlug(slug: _1!))
}
else {
return nil
}
}
}
}
public extension Api {
enum InputAppEvent: TypeConstructorDescription {
public class Cons_inputAppEvent: TypeConstructorDescription {
public var time: Double
public var type: String
public var peer: Int64
public var data: Api.JSONValue
public init(time: Double, type: String, peer: Int64, data: Api.JSONValue) {
self.time = time
self.type = type
self.peer = peer
self.data = data
}
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)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputAppEvent(let _data):
if boxed {
buffer.appendInt32(488313413)
}
serializeDouble(_data.time, buffer: buffer, boxed: false)
serializeString(_data.type, buffer: buffer, boxed: false)
serializeInt64(_data.peer, buffer: buffer, boxed: false)
_data.data.serialize(buffer, true)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inputAppEvent(let _data):
return ("inputAppEvent", [("time", ConstructorParameterDescription(_data.time)), ("type", ConstructorParameterDescription(_data.type)), ("peer", ConstructorParameterDescription(_data.peer)), ("data", ConstructorParameterDescription(_data.data))])
}
}
public static func parse_inputAppEvent(_ reader: BufferReader) -> InputAppEvent? {
var _1: Double?
_1 = reader.readDouble()
var _2: String?
_2 = parseString(reader)
var _3: Int64?
_3 = reader.readInt64()
var _4: Api.JSONValue?
if let signature = reader.readInt32() {
_4 = Api.parse(reader, signature: signature) as? Api.JSONValue
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.InputAppEvent.inputAppEvent(Cons_inputAppEvent(time: _1!, type: _2!, peer: _3!, data: _4!))
}
else {
return nil
}
}
}
}
public extension Api {
indirect enum InputBotApp: TypeConstructorDescription {
public class Cons_inputBotAppID: TypeConstructorDescription {
public var id: Int64
public var accessHash: Int64
public init(id: Int64, accessHash: Int64) {
self.id = id
self.accessHash = accessHash
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputBotAppID", [("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))])
}
}
public class Cons_inputBotAppShortName: TypeConstructorDescription {
public var botId: Api.InputUser
public var shortName: String
public init(botId: Api.InputUser, shortName: String) {
self.botId = botId
self.shortName = shortName
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputBotAppShortName", [("botId", ConstructorParameterDescription(self.botId)), ("shortName", ConstructorParameterDescription(self.shortName))])
}
}
case inputBotAppID(Cons_inputBotAppID)
case inputBotAppShortName(Cons_inputBotAppShortName)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputBotAppID(let _data):
if boxed {
buffer.appendInt32(-1457472134)
}
serializeInt64(_data.id, buffer: buffer, boxed: false)
serializeInt64(_data.accessHash, buffer: buffer, boxed: false)
break
case .inputBotAppShortName(let _data):
if boxed {
buffer.appendInt32(-1869872121)
}
_data.botId.serialize(buffer, true)
serializeString(_data.shortName, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inputBotAppID(let _data):
return ("inputBotAppID", [("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))])
case .inputBotAppShortName(let _data):
return ("inputBotAppShortName", [("botId", ConstructorParameterDescription(_data.botId)), ("shortName", ConstructorParameterDescription(_data.shortName))])
}
}
public static func parse_inputBotAppID(_ reader: BufferReader) -> InputBotApp? {
var _1: Int64?
_1 = reader.readInt64()
var _2: Int64?
_2 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.InputBotApp.inputBotAppID(Cons_inputBotAppID(id: _1!, accessHash: _2!))
}
else {
return nil
}
}
public static func parse_inputBotAppShortName(_ reader: BufferReader) -> InputBotApp? {
var _1: Api.InputUser?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.InputUser
}
var _2: String?
_2 = parseString(reader)
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.InputBotApp.inputBotAppShortName(Cons_inputBotAppShortName(botId: _1!, shortName: _2!))
}
else {
return nil
}
}
}
}
public extension Api {
enum InputBotInlineMessage: TypeConstructorDescription {
public class Cons_inputBotInlineMessageGame: TypeConstructorDescription {
public var flags: Int32
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.replyMarkup = replyMarkup
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputBotInlineMessageGame", [("flags", ConstructorParameterDescription(self.flags)), ("replyMarkup", ConstructorParameterDescription(self.replyMarkup))])
}
}
public class Cons_inputBotInlineMessageMediaAuto: TypeConstructorDescription {
public var flags: Int32
public var message: String
public var entities: [Api.MessageEntity]?
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.message = message
self.entities = entities
self.replyMarkup = replyMarkup
}
public 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 {
public var flags: Int32
public var phoneNumber: String
public var firstName: String
public var lastName: String
public var vcard: String
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, phoneNumber: String, firstName: String, lastName: String, vcard: String, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.phoneNumber = phoneNumber
self.firstName = firstName
self.lastName = lastName
self.vcard = vcard
self.replyMarkup = replyMarkup
}
public 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 {
public var flags: Int32
public var geoPoint: Api.InputGeoPoint
public var heading: Int32?
public var period: Int32?
public var proximityNotificationRadius: Int32?
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, geoPoint: Api.InputGeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.geoPoint = geoPoint
self.heading = heading
self.period = period
self.proximityNotificationRadius = proximityNotificationRadius
self.replyMarkup = replyMarkup
}
public 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 {
public var flags: Int32
public var title: String
public var description: String
public var photo: Api.InputWebDocument?
public var invoice: Api.Invoice
public var payload: Buffer
public var provider: String
public var providerData: Api.DataJSON
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, title: String, description: String, photo: Api.InputWebDocument?, invoice: Api.Invoice, payload: Buffer, provider: String, providerData: Api.DataJSON, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.title = title
self.description = description
self.photo = photo
self.invoice = invoice
self.payload = payload
self.provider = provider
self.providerData = providerData
self.replyMarkup = replyMarkup
}
public 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 {
public var flags: Int32
public var geoPoint: Api.InputGeoPoint
public var title: String
public var address: String
public var provider: String
public var venueId: String
public var venueType: String
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, geoPoint: Api.InputGeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.geoPoint = geoPoint
self.title = title
self.address = address
self.provider = provider
self.venueId = venueId
self.venueType = venueType
self.replyMarkup = replyMarkup
}
public 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 {
public var flags: Int32
public var message: String
public var entities: [Api.MessageEntity]?
public var url: String
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, url: String, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.message = message
self.entities = entities
self.url = url
self.replyMarkup = replyMarkup
}
public 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 {
public var flags: Int32
public var message: String
public var entities: [Api.MessageEntity]?
public var replyMarkup: Api.ReplyMarkup?
public init(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?) {
self.flags = flags
self.message = message
self.entities = entities
self.replyMarkup = replyMarkup
}
public 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)
case inputBotInlineMessageMediaAuto(Cons_inputBotInlineMessageMediaAuto)
case inputBotInlineMessageMediaContact(Cons_inputBotInlineMessageMediaContact)
case inputBotInlineMessageMediaGeo(Cons_inputBotInlineMessageMediaGeo)
case inputBotInlineMessageMediaInvoice(Cons_inputBotInlineMessageMediaInvoice)
case inputBotInlineMessageMediaVenue(Cons_inputBotInlineMessageMediaVenue)
case inputBotInlineMessageMediaWebPage(Cons_inputBotInlineMessageMediaWebPage)
case inputBotInlineMessageText(Cons_inputBotInlineMessageText)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputBotInlineMessageGame(let _data):
if boxed {
buffer.appendInt32(1262639204)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
case .inputBotInlineMessageMediaAuto(let _data):
if boxed {
buffer.appendInt32(864077702)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.message, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 1) != 0 {
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(_data.entities!.count))
for item in _data.entities! {
item.serialize(buffer, true)
}
}
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
case .inputBotInlineMessageMediaContact(let _data):
if boxed {
buffer.appendInt32(-1494368259)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.phoneNumber, buffer: buffer, boxed: false)
serializeString(_data.firstName, buffer: buffer, boxed: false)
serializeString(_data.lastName, buffer: buffer, boxed: false)
serializeString(_data.vcard, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
case .inputBotInlineMessageMediaGeo(let _data):
if boxed {
buffer.appendInt32(-1768777083)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
_data.geoPoint.serialize(buffer, true)
if Int(_data.flags) & Int(1 << 0) != 0 {
serializeInt32(_data.heading!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 1) != 0 {
serializeInt32(_data.period!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 3) != 0 {
serializeInt32(_data.proximityNotificationRadius!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
case .inputBotInlineMessageMediaInvoice(let _data):
if boxed {
buffer.appendInt32(-672693723)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.title, buffer: buffer, boxed: false)
serializeString(_data.description, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 0) != 0 {
_data.photo!.serialize(buffer, true)
}
_data.invoice.serialize(buffer, true)
serializeBytes(_data.payload, buffer: buffer, boxed: false)
serializeString(_data.provider, buffer: buffer, boxed: false)
_data.providerData.serialize(buffer, true)
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
case .inputBotInlineMessageMediaVenue(let _data):
if boxed {
buffer.appendInt32(1098628881)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
_data.geoPoint.serialize(buffer, true)
serializeString(_data.title, buffer: buffer, boxed: false)
serializeString(_data.address, buffer: buffer, boxed: false)
serializeString(_data.provider, buffer: buffer, boxed: false)
serializeString(_data.venueId, buffer: buffer, boxed: false)
serializeString(_data.venueType, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
case .inputBotInlineMessageMediaWebPage(let _data):
if boxed {
buffer.appendInt32(-1109605104)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.message, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 1) != 0 {
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(_data.entities!.count))
for item in _data.entities! {
item.serialize(buffer, true)
}
}
serializeString(_data.url, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
case .inputBotInlineMessageText(let _data):
if boxed {
buffer.appendInt32(1036876423)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.message, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 1) != 0 {
buffer.appendInt32(481674261)
buffer.appendInt32(Int32(_data.entities!.count))
for item in _data.entities! {
item.serialize(buffer, true)
}
}
if Int(_data.flags) & Int(1 << 2) != 0 {
_data.replyMarkup!.serialize(buffer, true)
}
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inputBotInlineMessageGame(let _data):
return ("inputBotInlineMessageGame", [("flags", ConstructorParameterDescription(_data.flags)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))])
case .inputBotInlineMessageMediaAuto(let _data):
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", 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", 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", 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", 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", 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", ConstructorParameterDescription(_data.flags)), ("message", ConstructorParameterDescription(_data.message)), ("entities", ConstructorParameterDescription(_data.entities)), ("replyMarkup", ConstructorParameterDescription(_data.replyMarkup))])
}
}
public static func parse_inputBotInlineMessageGame(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
let _c1 = _1 != nil
let _c2 = (Int(_1!) & Int(1 << 2) == 0) || _2 != nil
if _c1 && _c2 {
return Api.InputBotInlineMessage.inputBotInlineMessageGame(Cons_inputBotInlineMessageGame(flags: _1!, replyMarkup: _2))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageMediaAuto(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: [Api.MessageEntity]?
if Int(_1!) & Int(1 << 1) != 0 {
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
}
}
var _4: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.InputBotInlineMessage.inputBotInlineMessageMediaAuto(Cons_inputBotInlineMessageMediaAuto(flags: _1!, message: _2!, entities: _3, replyMarkup: _4))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageMediaContact(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: String?
_3 = parseString(reader)
var _4: String?
_4 = parseString(reader)
var _5: String?
_5 = parseString(reader)
var _6: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
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
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
return Api.InputBotInlineMessage.inputBotInlineMessageMediaContact(Cons_inputBotInlineMessageMediaContact(flags: _1!, phoneNumber: _2!, firstName: _3!, lastName: _4!, vcard: _5!, replyMarkup: _6))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageMediaGeo(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.InputGeoPoint?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.InputGeoPoint
}
var _3: Int32?
if Int(_1!) & Int(1 << 0) != 0 {
_3 = reader.readInt32()
}
var _4: Int32?
if Int(_1!) & Int(1 << 1) != 0 {
_4 = reader.readInt32()
}
var _5: Int32?
if Int(_1!) & Int(1 << 3) != 0 {
_5 = reader.readInt32()
}
var _6: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_6 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
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 << 3) == 0) || _5 != nil
let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
return Api.InputBotInlineMessage.inputBotInlineMessageMediaGeo(Cons_inputBotInlineMessageMediaGeo(flags: _1!, geoPoint: _2!, heading: _3, period: _4, proximityNotificationRadius: _5, replyMarkup: _6))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageMediaInvoice(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: String?
_3 = parseString(reader)
var _4: Api.InputWebDocument?
if Int(_1!) & Int(1 << 0) != 0 {
if let signature = reader.readInt32() {
_4 = Api.parse(reader, signature: signature) as? Api.InputWebDocument
}
}
var _5: Api.Invoice?
if let signature = reader.readInt32() {
_5 = Api.parse(reader, signature: signature) as? Api.Invoice
}
var _6: Buffer?
_6 = parseBytes(reader)
var _7: String?
_7 = parseString(reader)
var _8: Api.DataJSON?
if let signature = reader.readInt32() {
_8 = Api.parse(reader, signature: signature) as? Api.DataJSON
}
var _9: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_9 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
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
let _c7 = _7 != nil
let _c8 = _8 != nil
let _c9 = (Int(_1!) & Int(1 << 2) == 0) || _9 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 {
return Api.InputBotInlineMessage.inputBotInlineMessageMediaInvoice(Cons_inputBotInlineMessageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, invoice: _5!, payload: _6!, provider: _7!, providerData: _8!, replyMarkup: _9))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageMediaVenue(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.InputGeoPoint?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.InputGeoPoint
}
var _3: String?
_3 = parseString(reader)
var _4: String?
_4 = parseString(reader)
var _5: String?
_5 = parseString(reader)
var _6: String?
_6 = parseString(reader)
var _7: String?
_7 = parseString(reader)
var _8: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_8 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
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 << 2) == 0) || _8 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
return Api.InputBotInlineMessage.inputBotInlineMessageMediaVenue(Cons_inputBotInlineMessageMediaVenue(flags: _1!, geoPoint: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!, replyMarkup: _8))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageMediaWebPage(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: [Api.MessageEntity]?
if Int(_1!) & Int(1 << 1) != 0 {
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
}
}
var _4: String?
_4 = parseString(reader)
var _5: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_5 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
let _c4 = _4 != nil
let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 {
return Api.InputBotInlineMessage.inputBotInlineMessageMediaWebPage(Cons_inputBotInlineMessageMediaWebPage(flags: _1!, message: _2!, entities: _3, url: _4!, replyMarkup: _5))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageText(_ reader: BufferReader) -> InputBotInlineMessage? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: [Api.MessageEntity]?
if Int(_1!) & Int(1 << 1) != 0 {
if let _ = reader.readInt32() {
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
}
}
var _4: Api.ReplyMarkup?
if Int(_1!) & Int(1 << 2) != 0 {
if let signature = reader.readInt32() {
_4 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
}
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.InputBotInlineMessage.inputBotInlineMessageText(Cons_inputBotInlineMessageText(flags: _1!, message: _2!, entities: _3, replyMarkup: _4))
}
else {
return nil
}
}
}
}
public extension Api {
enum InputBotInlineMessageID: TypeConstructorDescription {
public class Cons_inputBotInlineMessageID: TypeConstructorDescription {
public var dcId: Int32
public var id: Int64
public var accessHash: Int64
public init(dcId: Int32, id: Int64, accessHash: Int64) {
self.dcId = dcId
self.id = id
self.accessHash = accessHash
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputBotInlineMessageID", [("dcId", ConstructorParameterDescription(self.dcId)), ("id", ConstructorParameterDescription(self.id)), ("accessHash", ConstructorParameterDescription(self.accessHash))])
}
}
public class Cons_inputBotInlineMessageID64: TypeConstructorDescription {
public var dcId: Int32
public var ownerId: Int64
public var id: Int32
public var accessHash: Int64
public init(dcId: Int32, ownerId: Int64, id: Int32, accessHash: Int64) {
self.dcId = dcId
self.ownerId = ownerId
self.id = id
self.accessHash = accessHash
}
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)
case inputBotInlineMessageID64(Cons_inputBotInlineMessageID64)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputBotInlineMessageID(let _data):
if boxed {
buffer.appendInt32(-1995686519)
}
serializeInt32(_data.dcId, buffer: buffer, boxed: false)
serializeInt64(_data.id, buffer: buffer, boxed: false)
serializeInt64(_data.accessHash, buffer: buffer, boxed: false)
break
case .inputBotInlineMessageID64(let _data):
if boxed {
buffer.appendInt32(-1227287081)
}
serializeInt32(_data.dcId, buffer: buffer, boxed: false)
serializeInt64(_data.ownerId, buffer: buffer, boxed: false)
serializeInt32(_data.id, buffer: buffer, boxed: false)
serializeInt64(_data.accessHash, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inputBotInlineMessageID(let _data):
return ("inputBotInlineMessageID", [("dcId", ConstructorParameterDescription(_data.dcId)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))])
case .inputBotInlineMessageID64(let _data):
return ("inputBotInlineMessageID64", [("dcId", ConstructorParameterDescription(_data.dcId)), ("ownerId", ConstructorParameterDescription(_data.ownerId)), ("id", ConstructorParameterDescription(_data.id)), ("accessHash", ConstructorParameterDescription(_data.accessHash))])
}
}
public static func parse_inputBotInlineMessageID(_ reader: BufferReader) -> InputBotInlineMessageID? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int64?
_2 = reader.readInt64()
var _3: Int64?
_3 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.InputBotInlineMessageID.inputBotInlineMessageID(Cons_inputBotInlineMessageID(dcId: _1!, id: _2!, accessHash: _3!))
}
else {
return nil
}
}
public static func parse_inputBotInlineMessageID64(_ reader: BufferReader) -> InputBotInlineMessageID? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Int64?
_2 = reader.readInt64()
var _3: Int32?
_3 = reader.readInt32()
var _4: Int64?
_4 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.InputBotInlineMessageID.inputBotInlineMessageID64(Cons_inputBotInlineMessageID64(dcId: _1!, ownerId: _2!, id: _3!, accessHash: _4!))
}
else {
return nil
}
}
}
}
public extension Api {
enum InputBotInlineResult: TypeConstructorDescription {
public class Cons_inputBotInlineResult: TypeConstructorDescription {
public var flags: Int32
public var id: String
public var type: String
public var title: String?
public var description: String?
public var url: String?
public var thumb: Api.InputWebDocument?
public var content: Api.InputWebDocument?
public var sendMessage: Api.InputBotInlineMessage
public init(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.InputWebDocument?, content: Api.InputWebDocument?, sendMessage: Api.InputBotInlineMessage) {
self.flags = flags
self.id = id
self.type = type
self.title = title
self.description = description
self.url = url
self.thumb = thumb
self.content = content
self.sendMessage = sendMessage
}
public 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 {
public var flags: Int32
public var id: String
public var type: String
public var title: String?
public var description: String?
public var document: Api.InputDocument
public var sendMessage: Api.InputBotInlineMessage
public init(flags: Int32, id: String, type: String, title: String?, description: String?, document: Api.InputDocument, sendMessage: Api.InputBotInlineMessage) {
self.flags = flags
self.id = id
self.type = type
self.title = title
self.description = description
self.document = document
self.sendMessage = sendMessage
}
public 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 {
public var id: String
public var shortName: String
public var sendMessage: Api.InputBotInlineMessage
public init(id: String, shortName: String, sendMessage: Api.InputBotInlineMessage) {
self.id = id
self.shortName = shortName
self.sendMessage = sendMessage
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
return ("inputBotInlineResultGame", [("id", ConstructorParameterDescription(self.id)), ("shortName", ConstructorParameterDescription(self.shortName)), ("sendMessage", ConstructorParameterDescription(self.sendMessage))])
}
}
public class Cons_inputBotInlineResultPhoto: TypeConstructorDescription {
public var id: String
public var type: String
public var photo: Api.InputPhoto
public var sendMessage: Api.InputBotInlineMessage
public init(id: String, type: String, photo: Api.InputPhoto, sendMessage: Api.InputBotInlineMessage) {
self.id = id
self.type = type
self.photo = photo
self.sendMessage = sendMessage
}
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)
case inputBotInlineResultDocument(Cons_inputBotInlineResultDocument)
case inputBotInlineResultGame(Cons_inputBotInlineResultGame)
case inputBotInlineResultPhoto(Cons_inputBotInlineResultPhoto)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputBotInlineResult(let _data):
if boxed {
buffer.appendInt32(-2000710887)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.id, buffer: buffer, boxed: false)
serializeString(_data.type, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 1) != 0 {
serializeString(_data.title!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 2) != 0 {
serializeString(_data.description!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 3) != 0 {
serializeString(_data.url!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 4) != 0 {
_data.thumb!.serialize(buffer, true)
}
if Int(_data.flags) & Int(1 << 5) != 0 {
_data.content!.serialize(buffer, true)
}
_data.sendMessage.serialize(buffer, true)
break
case .inputBotInlineResultDocument(let _data):
if boxed {
buffer.appendInt32(-459324)
}
serializeInt32(_data.flags, buffer: buffer, boxed: false)
serializeString(_data.id, buffer: buffer, boxed: false)
serializeString(_data.type, buffer: buffer, boxed: false)
if Int(_data.flags) & Int(1 << 1) != 0 {
serializeString(_data.title!, buffer: buffer, boxed: false)
}
if Int(_data.flags) & Int(1 << 2) != 0 {
serializeString(_data.description!, buffer: buffer, boxed: false)
}
_data.document.serialize(buffer, true)
_data.sendMessage.serialize(buffer, true)
break
case .inputBotInlineResultGame(let _data):
if boxed {
buffer.appendInt32(1336154098)
}
serializeString(_data.id, buffer: buffer, boxed: false)
serializeString(_data.shortName, buffer: buffer, boxed: false)
_data.sendMessage.serialize(buffer, true)
break
case .inputBotInlineResultPhoto(let _data):
if boxed {
buffer.appendInt32(-1462213465)
}
serializeString(_data.id, buffer: buffer, boxed: false)
serializeString(_data.type, buffer: buffer, boxed: false)
_data.photo.serialize(buffer, true)
_data.sendMessage.serialize(buffer, true)
break
}
}
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
switch self {
case .inputBotInlineResult(let _data):
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", 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", ConstructorParameterDescription(_data.id)), ("shortName", ConstructorParameterDescription(_data.shortName)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))])
case .inputBotInlineResultPhoto(let _data):
return ("inputBotInlineResultPhoto", [("id", ConstructorParameterDescription(_data.id)), ("type", ConstructorParameterDescription(_data.type)), ("photo", ConstructorParameterDescription(_data.photo)), ("sendMessage", ConstructorParameterDescription(_data.sendMessage))])
}
}
public static func parse_inputBotInlineResult(_ reader: BufferReader) -> InputBotInlineResult? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: String?
_3 = parseString(reader)
var _4: String?
if Int(_1!) & Int(1 << 1) != 0 {
_4 = parseString(reader)
}
var _5: String?
if Int(_1!) & Int(1 << 2) != 0 {
_5 = parseString(reader)
}
var _6: String?
if Int(_1!) & Int(1 << 3) != 0 {
_6 = parseString(reader)
}
var _7: Api.InputWebDocument?
if Int(_1!) & Int(1 << 4) != 0 {
if let signature = reader.readInt32() {
_7 = Api.parse(reader, signature: signature) as? Api.InputWebDocument
}
}
var _8: Api.InputWebDocument?
if Int(_1!) & Int(1 << 5) != 0 {
if let signature = reader.readInt32() {
_8 = Api.parse(reader, signature: signature) as? Api.InputWebDocument
}
}
var _9: Api.InputBotInlineMessage?
if let signature = reader.readInt32() {
_9 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessage
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil
let _c6 = (Int(_1!) & Int(1 << 3) == 0) || _6 != nil
let _c7 = (Int(_1!) & Int(1 << 4) == 0) || _7 != nil
let _c8 = (Int(_1!) & Int(1 << 5) == 0) || _8 != nil
let _c9 = _9 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 {
return Api.InputBotInlineResult.inputBotInlineResult(Cons_inputBotInlineResult(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, url: _6, thumb: _7, content: _8, sendMessage: _9!))
}
else {
return nil
}
}
public static func parse_inputBotInlineResultDocument(_ reader: BufferReader) -> InputBotInlineResult? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: String?
_3 = parseString(reader)
var _4: String?
if Int(_1!) & Int(1 << 1) != 0 {
_4 = parseString(reader)
}
var _5: String?
if Int(_1!) & Int(1 << 2) != 0 {
_5 = parseString(reader)
}
var _6: Api.InputDocument?
if let signature = reader.readInt32() {
_6 = Api.parse(reader, signature: signature) as? Api.InputDocument
}
var _7: Api.InputBotInlineMessage?
if let signature = reader.readInt32() {
_7 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessage
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil
let _c6 = _6 != nil
let _c7 = _7 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
return Api.InputBotInlineResult.inputBotInlineResultDocument(Cons_inputBotInlineResultDocument(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, document: _6!, sendMessage: _7!))
}
else {
return nil
}
}
public static func parse_inputBotInlineResultGame(_ reader: BufferReader) -> InputBotInlineResult? {
var _1: String?
_1 = parseString(reader)
var _2: String?
_2 = parseString(reader)
var _3: Api.InputBotInlineMessage?
if let signature = reader.readInt32() {
_3 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessage
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.InputBotInlineResult.inputBotInlineResultGame(Cons_inputBotInlineResultGame(id: _1!, shortName: _2!, sendMessage: _3!))
}
else {
return nil
}
}
public static func parse_inputBotInlineResultPhoto(_ reader: BufferReader) -> InputBotInlineResult? {
var _1: String?
_1 = parseString(reader)
var _2: String?
_2 = parseString(reader)
var _3: Api.InputPhoto?
if let signature = reader.readInt32() {
_3 = Api.parse(reader, signature: signature) as? Api.InputPhoto
}
var _4: Api.InputBotInlineMessage?
if let signature = reader.readInt32() {
_4 = Api.parse(reader, signature: signature) as? Api.InputBotInlineMessage
}
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = _4 != nil
if _c1 && _c2 && _c3 && _c4 {
return Api.InputBotInlineResult.inputBotInlineResultPhoto(Cons_inputBotInlineResultPhoto(id: _1!, type: _2!, photo: _3!, sendMessage: _4!))
}
else {
return nil
}
}
}
}