mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
1219 lines
56 KiB
Swift
1219 lines
56 KiB
Swift
public extension Api {
|
|
indirect enum BotCommandScope: TypeConstructorDescription {
|
|
case botCommandScopeChatAdmins
|
|
case botCommandScopeChats
|
|
case botCommandScopeDefault
|
|
case botCommandScopePeer(peer: Api.InputPeer)
|
|
case botCommandScopePeerAdmins(peer: Api.InputPeer)
|
|
case botCommandScopePeerUser(peer: Api.InputPeer, userId: Api.InputUser)
|
|
case botCommandScopeUsers
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .botCommandScopeChatAdmins:
|
|
if boxed {
|
|
buffer.appendInt32(-1180016534)
|
|
}
|
|
|
|
break
|
|
case .botCommandScopeChats:
|
|
if boxed {
|
|
buffer.appendInt32(1877059713)
|
|
}
|
|
|
|
break
|
|
case .botCommandScopeDefault:
|
|
if boxed {
|
|
buffer.appendInt32(795652779)
|
|
}
|
|
|
|
break
|
|
case .botCommandScopePeer(let peer):
|
|
if boxed {
|
|
buffer.appendInt32(-610432643)
|
|
}
|
|
peer.serialize(buffer, true)
|
|
break
|
|
case .botCommandScopePeerAdmins(let peer):
|
|
if boxed {
|
|
buffer.appendInt32(1071145937)
|
|
}
|
|
peer.serialize(buffer, true)
|
|
break
|
|
case .botCommandScopePeerUser(let peer, let userId):
|
|
if boxed {
|
|
buffer.appendInt32(169026035)
|
|
}
|
|
peer.serialize(buffer, true)
|
|
userId.serialize(buffer, true)
|
|
break
|
|
case .botCommandScopeUsers:
|
|
if boxed {
|
|
buffer.appendInt32(1011811544)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .botCommandScopeChatAdmins:
|
|
return ("botCommandScopeChatAdmins", [])
|
|
case .botCommandScopeChats:
|
|
return ("botCommandScopeChats", [])
|
|
case .botCommandScopeDefault:
|
|
return ("botCommandScopeDefault", [])
|
|
case .botCommandScopePeer(let peer):
|
|
return ("botCommandScopePeer", [("peer", peer as Any)])
|
|
case .botCommandScopePeerAdmins(let peer):
|
|
return ("botCommandScopePeerAdmins", [("peer", peer as Any)])
|
|
case .botCommandScopePeerUser(let peer, let userId):
|
|
return ("botCommandScopePeerUser", [("peer", peer as Any), ("userId", userId as Any)])
|
|
case .botCommandScopeUsers:
|
|
return ("botCommandScopeUsers", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_botCommandScopeChatAdmins(_ reader: BufferReader) -> BotCommandScope? {
|
|
return Api.BotCommandScope.botCommandScopeChatAdmins
|
|
}
|
|
public static func parse_botCommandScopeChats(_ reader: BufferReader) -> BotCommandScope? {
|
|
return Api.BotCommandScope.botCommandScopeChats
|
|
}
|
|
public static func parse_botCommandScopeDefault(_ reader: BufferReader) -> BotCommandScope? {
|
|
return Api.BotCommandScope.botCommandScopeDefault
|
|
}
|
|
public static func parse_botCommandScopePeer(_ reader: BufferReader) -> BotCommandScope? {
|
|
var _1: Api.InputPeer?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.BotCommandScope.botCommandScopePeer(peer: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botCommandScopePeerAdmins(_ reader: BufferReader) -> BotCommandScope? {
|
|
var _1: Api.InputPeer?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.BotCommandScope.botCommandScopePeerAdmins(peer: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botCommandScopePeerUser(_ reader: BufferReader) -> BotCommandScope? {
|
|
var _1: Api.InputPeer?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
|
}
|
|
var _2: Api.InputUser?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.InputUser
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.BotCommandScope.botCommandScopePeerUser(peer: _1!, userId: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botCommandScopeUsers(_ reader: BufferReader) -> BotCommandScope? {
|
|
return Api.BotCommandScope.botCommandScopeUsers
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BotInfo: TypeConstructorDescription {
|
|
case botInfo(flags: Int32, userId: Int64?, description: String?, descriptionPhoto: Api.Photo?, descriptionDocument: Api.Document?, commands: [Api.BotCommand]?, menuButton: Api.BotMenuButton?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton):
|
|
if boxed {
|
|
buffer.appendInt32(-1892676777)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {serializeInt64(userId!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 1) != 0 {serializeString(description!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 4) != 0 {descriptionPhoto!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 5) != 0 {descriptionDocument!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 2) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(commands!.count))
|
|
for item in commands! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
if Int(flags) & Int(1 << 3) != 0 {menuButton!.serialize(buffer, true)}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .botInfo(let flags, let userId, let description, let descriptionPhoto, let descriptionDocument, let commands, let menuButton):
|
|
return ("botInfo", [("flags", flags as Any), ("userId", userId as Any), ("description", description as Any), ("descriptionPhoto", descriptionPhoto as Any), ("descriptionDocument", descriptionDocument as Any), ("commands", commands as Any), ("menuButton", menuButton as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_botInfo(_ reader: BufferReader) -> BotInfo? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int64?
|
|
if Int(_1!) & Int(1 << 0) != 0 {_2 = reader.readInt64() }
|
|
var _3: String?
|
|
if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) }
|
|
var _4: Api.Photo?
|
|
if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.Photo
|
|
} }
|
|
var _5: Api.Document?
|
|
if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() {
|
|
_5 = Api.parse(reader, signature: signature) as? Api.Document
|
|
} }
|
|
var _6: [Api.BotCommand]?
|
|
if Int(_1!) & Int(1 << 2) != 0 {if let _ = reader.readInt32() {
|
|
_6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotCommand.self)
|
|
} }
|
|
var _7: Api.BotMenuButton?
|
|
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
|
_7 = Api.parse(reader, signature: signature) as? Api.BotMenuButton
|
|
} }
|
|
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 << 4) == 0) || _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 5) == 0) || _5 != nil
|
|
let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
|
return Api.BotInfo.botInfo(flags: _1!, userId: _2, description: _3, descriptionPhoto: _4, descriptionDocument: _5, commands: _6, menuButton: _7)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BotInlineMessage: TypeConstructorDescription {
|
|
case botInlineMessageMediaAuto(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?)
|
|
case botInlineMessageMediaContact(flags: Int32, phoneNumber: String, firstName: String, lastName: String, vcard: String, replyMarkup: Api.ReplyMarkup?)
|
|
case botInlineMessageMediaGeo(flags: Int32, geo: Api.GeoPoint, heading: Int32?, period: Int32?, proximityNotificationRadius: Int32?, replyMarkup: Api.ReplyMarkup?)
|
|
case botInlineMessageMediaInvoice(flags: Int32, title: String, description: String, photo: Api.WebDocument?, currency: String, totalAmount: Int64, replyMarkup: Api.ReplyMarkup?)
|
|
case botInlineMessageMediaVenue(flags: Int32, geo: Api.GeoPoint, title: String, address: String, provider: String, venueId: String, venueType: String, replyMarkup: Api.ReplyMarkup?)
|
|
case botInlineMessageMediaWebPage(flags: Int32, message: String, entities: [Api.MessageEntity]?, url: String, replyMarkup: Api.ReplyMarkup?)
|
|
case botInlineMessageText(flags: Int32, message: String, entities: [Api.MessageEntity]?, replyMarkup: Api.ReplyMarkup?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .botInlineMessageMediaAuto(let flags, let message, let entities, let replyMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(1984755728)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(message, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(entities!.count))
|
|
for item in entities! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
|
break
|
|
case .botInlineMessageMediaContact(let flags, let phoneNumber, let firstName, let lastName, let vcard, let replyMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(416402882)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(phoneNumber, buffer: buffer, boxed: false)
|
|
serializeString(firstName, buffer: buffer, boxed: false)
|
|
serializeString(lastName, buffer: buffer, boxed: false)
|
|
serializeString(vcard, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
|
break
|
|
case .botInlineMessageMediaGeo(let flags, let geo, let heading, let period, let proximityNotificationRadius, let replyMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(85477117)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
geo.serialize(buffer, true)
|
|
if Int(flags) & Int(1 << 0) != 0 {serializeInt32(heading!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 1) != 0 {serializeInt32(period!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 3) != 0 {serializeInt32(proximityNotificationRadius!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
|
break
|
|
case .botInlineMessageMediaInvoice(let flags, let title, let description, let photo, let currency, let totalAmount, let replyMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(894081801)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(title, buffer: buffer, boxed: false)
|
|
serializeString(description, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)}
|
|
serializeString(currency, buffer: buffer, boxed: false)
|
|
serializeInt64(totalAmount, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
|
break
|
|
case .botInlineMessageMediaVenue(let flags, let geo, let title, let address, let provider, let venueId, let venueType, let replyMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(-1970903652)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
geo.serialize(buffer, true)
|
|
serializeString(title, buffer: buffer, boxed: false)
|
|
serializeString(address, buffer: buffer, boxed: false)
|
|
serializeString(provider, buffer: buffer, boxed: false)
|
|
serializeString(venueId, buffer: buffer, boxed: false)
|
|
serializeString(venueType, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
|
break
|
|
case .botInlineMessageMediaWebPage(let flags, let message, let entities, let url, let replyMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(-2137335386)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(message, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(entities!.count))
|
|
for item in entities! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
serializeString(url, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
|
break
|
|
case .botInlineMessageText(let flags, let message, let entities, let replyMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(-1937807902)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(message, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(entities!.count))
|
|
for item in entities! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
if Int(flags) & Int(1 << 2) != 0 {replyMarkup!.serialize(buffer, true)}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .botInlineMessageMediaAuto(let flags, let message, let entities, let replyMarkup):
|
|
return ("botInlineMessageMediaAuto", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("replyMarkup", replyMarkup as Any)])
|
|
case .botInlineMessageMediaContact(let flags, let phoneNumber, let firstName, let lastName, let vcard, let replyMarkup):
|
|
return ("botInlineMessageMediaContact", [("flags", flags as Any), ("phoneNumber", phoneNumber as Any), ("firstName", firstName as Any), ("lastName", lastName as Any), ("vcard", vcard as Any), ("replyMarkup", replyMarkup as Any)])
|
|
case .botInlineMessageMediaGeo(let flags, let geo, let heading, let period, let proximityNotificationRadius, let replyMarkup):
|
|
return ("botInlineMessageMediaGeo", [("flags", flags as Any), ("geo", geo as Any), ("heading", heading as Any), ("period", period as Any), ("proximityNotificationRadius", proximityNotificationRadius as Any), ("replyMarkup", replyMarkup as Any)])
|
|
case .botInlineMessageMediaInvoice(let flags, let title, let description, let photo, let currency, let totalAmount, let replyMarkup):
|
|
return ("botInlineMessageMediaInvoice", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("photo", photo as Any), ("currency", currency as Any), ("totalAmount", totalAmount as Any), ("replyMarkup", replyMarkup as Any)])
|
|
case .botInlineMessageMediaVenue(let flags, let geo, let title, let address, let provider, let venueId, let venueType, let replyMarkup):
|
|
return ("botInlineMessageMediaVenue", [("flags", flags as Any), ("geo", geo as Any), ("title", title as Any), ("address", address as Any), ("provider", provider as Any), ("venueId", venueId as Any), ("venueType", venueType as Any), ("replyMarkup", replyMarkup as Any)])
|
|
case .botInlineMessageMediaWebPage(let flags, let message, let entities, let url, let replyMarkup):
|
|
return ("botInlineMessageMediaWebPage", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("url", url as Any), ("replyMarkup", replyMarkup as Any)])
|
|
case .botInlineMessageText(let flags, let message, let entities, let replyMarkup):
|
|
return ("botInlineMessageText", [("flags", flags as Any), ("message", message as Any), ("entities", entities as Any), ("replyMarkup", replyMarkup as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_botInlineMessageMediaAuto(_ reader: BufferReader) -> BotInlineMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: [Api.MessageEntity]?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
} }
|
|
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.BotInlineMessage.botInlineMessageMediaAuto(flags: _1!, message: _2!, entities: _3, replyMarkup: _4)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botInlineMessageMediaContact(_ reader: BufferReader) -> BotInlineMessage? {
|
|
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.BotInlineMessage.botInlineMessageMediaContact(flags: _1!, phoneNumber: _2!, firstName: _3!, lastName: _4!, vcard: _5!, replyMarkup: _6)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botInlineMessageMediaGeo(_ reader: BufferReader) -> BotInlineMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.GeoPoint?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.GeoPoint
|
|
}
|
|
var _3: Int32?
|
|
if Int(_1!) & 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.BotInlineMessage.botInlineMessageMediaGeo(flags: _1!, geo: _2!, heading: _3, period: _4, proximityNotificationRadius: _5, replyMarkup: _6)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botInlineMessageMediaInvoice(_ reader: BufferReader) -> BotInlineMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: Api.WebDocument?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.WebDocument
|
|
} }
|
|
var _5: String?
|
|
_5 = parseString(reader)
|
|
var _6: Int64?
|
|
_6 = reader.readInt64()
|
|
var _7: Api.ReplyMarkup?
|
|
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
|
_7 = Api.parse(reader, signature: signature) as? Api.ReplyMarkup
|
|
} }
|
|
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 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
|
return Api.BotInlineMessage.botInlineMessageMediaInvoice(flags: _1!, title: _2!, description: _3!, photo: _4, currency: _5!, totalAmount: _6!, replyMarkup: _7)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botInlineMessageMediaVenue(_ reader: BufferReader) -> BotInlineMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.GeoPoint?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.GeoPoint
|
|
}
|
|
var _3: 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.BotInlineMessage.botInlineMessageMediaVenue(flags: _1!, geo: _2!, title: _3!, address: _4!, provider: _5!, venueId: _6!, venueType: _7!, replyMarkup: _8)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botInlineMessageMediaWebPage(_ reader: BufferReader) -> BotInlineMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: [Api.MessageEntity]?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
} }
|
|
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.BotInlineMessage.botInlineMessageMediaWebPage(flags: _1!, message: _2!, entities: _3, url: _4!, replyMarkup: _5)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botInlineMessageText(_ reader: BufferReader) -> BotInlineMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: [Api.MessageEntity]?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
} }
|
|
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.BotInlineMessage.botInlineMessageText(flags: _1!, message: _2!, entities: _3, replyMarkup: _4)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BotInlineResult: TypeConstructorDescription {
|
|
case botInlineMediaResult(flags: Int32, id: String, type: String, photo: Api.Photo?, document: Api.Document?, title: String?, description: String?, sendMessage: Api.BotInlineMessage)
|
|
case botInlineResult(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.WebDocument?, content: Api.WebDocument?, sendMessage: Api.BotInlineMessage)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .botInlineMediaResult(let flags, let id, let type, let photo, let document, let title, let description, let sendMessage):
|
|
if boxed {
|
|
buffer.appendInt32(400266251)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(id, buffer: buffer, boxed: false)
|
|
serializeString(type, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {photo!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 1) != 0 {document!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 2) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 3) != 0 {serializeString(description!, buffer: buffer, boxed: false)}
|
|
sendMessage.serialize(buffer, true)
|
|
break
|
|
case .botInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage):
|
|
if boxed {
|
|
buffer.appendInt32(295067450)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(id, buffer: buffer, boxed: false)
|
|
serializeString(type, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 1) != 0 {serializeString(title!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 2) != 0 {serializeString(description!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 3) != 0 {serializeString(url!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 4) != 0 {thumb!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 5) != 0 {content!.serialize(buffer, true)}
|
|
sendMessage.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .botInlineMediaResult(let flags, let id, let type, let photo, let document, let title, let description, let sendMessage):
|
|
return ("botInlineMediaResult", [("flags", flags as Any), ("id", id as Any), ("type", type as Any), ("photo", photo as Any), ("document", document as Any), ("title", title as Any), ("description", description as Any), ("sendMessage", sendMessage as Any)])
|
|
case .botInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage):
|
|
return ("botInlineResult", [("flags", flags as Any), ("id", id as Any), ("type", type as Any), ("title", title as Any), ("description", description as Any), ("url", url as Any), ("thumb", thumb as Any), ("content", content as Any), ("sendMessage", sendMessage as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_botInlineMediaResult(_ reader: BufferReader) -> BotInlineResult? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: Api.Photo?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.Photo
|
|
} }
|
|
var _5: Api.Document?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
|
_5 = Api.parse(reader, signature: signature) as? Api.Document
|
|
} }
|
|
var _6: String?
|
|
if Int(_1!) & Int(1 << 2) != 0 {_6 = parseString(reader) }
|
|
var _7: String?
|
|
if Int(_1!) & Int(1 << 3) != 0 {_7 = parseString(reader) }
|
|
var _8: Api.BotInlineMessage?
|
|
if let signature = reader.readInt32() {
|
|
_8 = Api.parse(reader, signature: signature) as? Api.BotInlineMessage
|
|
}
|
|
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
|
|
let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil
|
|
let _c8 = _8 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
|
|
return Api.BotInlineResult.botInlineMediaResult(flags: _1!, id: _2!, type: _3!, photo: _4, document: _5, title: _6, description: _7, sendMessage: _8!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botInlineResult(_ reader: BufferReader) -> BotInlineResult? {
|
|
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.WebDocument?
|
|
if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() {
|
|
_7 = Api.parse(reader, signature: signature) as? Api.WebDocument
|
|
} }
|
|
var _8: Api.WebDocument?
|
|
if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() {
|
|
_8 = Api.parse(reader, signature: signature) as? Api.WebDocument
|
|
} }
|
|
var _9: Api.BotInlineMessage?
|
|
if let signature = reader.readInt32() {
|
|
_9 = Api.parse(reader, signature: signature) as? Api.BotInlineMessage
|
|
}
|
|
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.BotInlineResult.botInlineResult(flags: _1!, id: _2!, type: _3!, title: _4, description: _5, url: _6, thumb: _7, content: _8, sendMessage: _9!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BotMenuButton: TypeConstructorDescription {
|
|
case botMenuButton(text: String, url: String)
|
|
case botMenuButtonCommands
|
|
case botMenuButtonDefault
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .botMenuButton(let text, let url):
|
|
if boxed {
|
|
buffer.appendInt32(-944407322)
|
|
}
|
|
serializeString(text, buffer: buffer, boxed: false)
|
|
serializeString(url, buffer: buffer, boxed: false)
|
|
break
|
|
case .botMenuButtonCommands:
|
|
if boxed {
|
|
buffer.appendInt32(1113113093)
|
|
}
|
|
|
|
break
|
|
case .botMenuButtonDefault:
|
|
if boxed {
|
|
buffer.appendInt32(1966318984)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .botMenuButton(let text, let url):
|
|
return ("botMenuButton", [("text", text as Any), ("url", url as Any)])
|
|
case .botMenuButtonCommands:
|
|
return ("botMenuButtonCommands", [])
|
|
case .botMenuButtonDefault:
|
|
return ("botMenuButtonDefault", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_botMenuButton(_ reader: BufferReader) -> BotMenuButton? {
|
|
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.BotMenuButton.botMenuButton(text: _1!, url: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_botMenuButtonCommands(_ reader: BufferReader) -> BotMenuButton? {
|
|
return Api.BotMenuButton.botMenuButtonCommands
|
|
}
|
|
public static func parse_botMenuButtonDefault(_ reader: BufferReader) -> BotMenuButton? {
|
|
return Api.BotMenuButton.botMenuButtonDefault
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessAwayMessage: TypeConstructorDescription {
|
|
case businessAwayMessage(flags: Int32, shortcutId: Int32, schedule: Api.BusinessAwayMessageSchedule, recipients: Api.BusinessRecipients)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessAwayMessage(let flags, let shortcutId, let schedule, let recipients):
|
|
if boxed {
|
|
buffer.appendInt32(-283809188)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeInt32(shortcutId, buffer: buffer, boxed: false)
|
|
schedule.serialize(buffer, true)
|
|
recipients.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessAwayMessage(let flags, let shortcutId, let schedule, let recipients):
|
|
return ("businessAwayMessage", [("flags", flags as Any), ("shortcutId", shortcutId as Any), ("schedule", schedule as Any), ("recipients", recipients as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessAwayMessage(_ reader: BufferReader) -> BusinessAwayMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: Api.BusinessAwayMessageSchedule?
|
|
if let signature = reader.readInt32() {
|
|
_3 = Api.parse(reader, signature: signature) as? Api.BusinessAwayMessageSchedule
|
|
}
|
|
var _4: Api.BusinessRecipients?
|
|
if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.BusinessRecipients
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.BusinessAwayMessage.businessAwayMessage(flags: _1!, shortcutId: _2!, schedule: _3!, recipients: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessAwayMessageSchedule: TypeConstructorDescription {
|
|
case businessAwayMessageScheduleAlways
|
|
case businessAwayMessageScheduleCustom(startDate: Int32, endDate: Int32)
|
|
case businessAwayMessageScheduleOutsideWorkHours
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessAwayMessageScheduleAlways:
|
|
if boxed {
|
|
buffer.appendInt32(-910564679)
|
|
}
|
|
|
|
break
|
|
case .businessAwayMessageScheduleCustom(let startDate, let endDate):
|
|
if boxed {
|
|
buffer.appendInt32(-867328308)
|
|
}
|
|
serializeInt32(startDate, buffer: buffer, boxed: false)
|
|
serializeInt32(endDate, buffer: buffer, boxed: false)
|
|
break
|
|
case .businessAwayMessageScheduleOutsideWorkHours:
|
|
if boxed {
|
|
buffer.appendInt32(-1007487743)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessAwayMessageScheduleAlways:
|
|
return ("businessAwayMessageScheduleAlways", [])
|
|
case .businessAwayMessageScheduleCustom(let startDate, let endDate):
|
|
return ("businessAwayMessageScheduleCustom", [("startDate", startDate as Any), ("endDate", endDate as Any)])
|
|
case .businessAwayMessageScheduleOutsideWorkHours:
|
|
return ("businessAwayMessageScheduleOutsideWorkHours", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessAwayMessageScheduleAlways(_ reader: BufferReader) -> BusinessAwayMessageSchedule? {
|
|
return Api.BusinessAwayMessageSchedule.businessAwayMessageScheduleAlways
|
|
}
|
|
public static func parse_businessAwayMessageScheduleCustom(_ reader: BufferReader) -> BusinessAwayMessageSchedule? {
|
|
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.BusinessAwayMessageSchedule.businessAwayMessageScheduleCustom(startDate: _1!, endDate: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_businessAwayMessageScheduleOutsideWorkHours(_ reader: BufferReader) -> BusinessAwayMessageSchedule? {
|
|
return Api.BusinessAwayMessageSchedule.businessAwayMessageScheduleOutsideWorkHours
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessBotRecipients: TypeConstructorDescription {
|
|
case businessBotRecipients(flags: Int32, users: [Int64]?, excludeUsers: [Int64]?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessBotRecipients(let flags, let users, let excludeUsers):
|
|
if boxed {
|
|
buffer.appendInt32(-1198722189)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(users!.count))
|
|
for item in users! {
|
|
serializeInt64(item, buffer: buffer, boxed: false)
|
|
}}
|
|
if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(excludeUsers!.count))
|
|
for item in excludeUsers! {
|
|
serializeInt64(item, buffer: buffer, boxed: false)
|
|
}}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessBotRecipients(let flags, let users, let excludeUsers):
|
|
return ("businessBotRecipients", [("flags", flags as Any), ("users", users as Any), ("excludeUsers", excludeUsers as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessBotRecipients(_ reader: BufferReader) -> BusinessBotRecipients? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Int64]?
|
|
if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
} }
|
|
var _3: [Int64]?
|
|
if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
} }
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 6) == 0) || _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.BusinessBotRecipients.businessBotRecipients(flags: _1!, users: _2, excludeUsers: _3)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessGreetingMessage: TypeConstructorDescription {
|
|
case businessGreetingMessage(shortcutId: Int32, recipients: Api.BusinessRecipients, noActivityDays: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessGreetingMessage(let shortcutId, let recipients, let noActivityDays):
|
|
if boxed {
|
|
buffer.appendInt32(-451302485)
|
|
}
|
|
serializeInt32(shortcutId, buffer: buffer, boxed: false)
|
|
recipients.serialize(buffer, true)
|
|
serializeInt32(noActivityDays, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessGreetingMessage(let shortcutId, let recipients, let noActivityDays):
|
|
return ("businessGreetingMessage", [("shortcutId", shortcutId as Any), ("recipients", recipients as Any), ("noActivityDays", noActivityDays as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessGreetingMessage(_ reader: BufferReader) -> BusinessGreetingMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.BusinessRecipients?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.BusinessRecipients
|
|
}
|
|
var _3: Int32?
|
|
_3 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.BusinessGreetingMessage.businessGreetingMessage(shortcutId: _1!, recipients: _2!, noActivityDays: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessIntro: TypeConstructorDescription {
|
|
case businessIntro(flags: Int32, title: String, description: String, sticker: Api.Document?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessIntro(let flags, let title, let description, let sticker):
|
|
if boxed {
|
|
buffer.appendInt32(1510606445)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(title, buffer: buffer, boxed: false)
|
|
serializeString(description, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {sticker!.serialize(buffer, true)}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessIntro(let flags, let title, let description, let sticker):
|
|
return ("businessIntro", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("sticker", sticker as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessIntro(_ reader: BufferReader) -> BusinessIntro? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
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
|
|
} }
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.BusinessIntro.businessIntro(flags: _1!, title: _2!, description: _3!, sticker: _4)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessLocation: TypeConstructorDescription {
|
|
case businessLocation(flags: Int32, geoPoint: Api.GeoPoint?, address: String)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessLocation(let flags, let geoPoint, let address):
|
|
if boxed {
|
|
buffer.appendInt32(-1403249929)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {geoPoint!.serialize(buffer, true)}
|
|
serializeString(address, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessLocation(let flags, let geoPoint, let address):
|
|
return ("businessLocation", [("flags", flags as Any), ("geoPoint", geoPoint as Any), ("address", address as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessLocation(_ reader: BufferReader) -> BusinessLocation? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.GeoPoint?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.GeoPoint
|
|
} }
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.BusinessLocation.businessLocation(flags: _1!, geoPoint: _2, address: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessRecipients: TypeConstructorDescription {
|
|
case businessRecipients(flags: Int32, users: [Int64]?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessRecipients(let flags, let users):
|
|
if boxed {
|
|
buffer.appendInt32(554733559)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(users!.count))
|
|
for item in users! {
|
|
serializeInt64(item, buffer: buffer, boxed: false)
|
|
}}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessRecipients(let flags, let users):
|
|
return ("businessRecipients", [("flags", flags as Any), ("users", users as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessRecipients(_ reader: BufferReader) -> BusinessRecipients? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Int64]?
|
|
if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
} }
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.BusinessRecipients.businessRecipients(flags: _1!, users: _2)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessWeeklyOpen: TypeConstructorDescription {
|
|
case businessWeeklyOpen(startMinute: Int32, endMinute: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessWeeklyOpen(let startMinute, let endMinute):
|
|
if boxed {
|
|
buffer.appendInt32(302717625)
|
|
}
|
|
serializeInt32(startMinute, buffer: buffer, boxed: false)
|
|
serializeInt32(endMinute, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessWeeklyOpen(let startMinute, let endMinute):
|
|
return ("businessWeeklyOpen", [("startMinute", startMinute as Any), ("endMinute", endMinute as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessWeeklyOpen(_ reader: BufferReader) -> BusinessWeeklyOpen? {
|
|
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.BusinessWeeklyOpen.businessWeeklyOpen(startMinute: _1!, endMinute: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum BusinessWorkHours: TypeConstructorDescription {
|
|
case businessWorkHours(flags: Int32, timezoneId: String, weeklyOpen: [Api.BusinessWeeklyOpen])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .businessWorkHours(let flags, let timezoneId, let weeklyOpen):
|
|
if boxed {
|
|
buffer.appendInt32(-1936543592)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(timezoneId, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(weeklyOpen.count))
|
|
for item in weeklyOpen {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .businessWorkHours(let flags, let timezoneId, let weeklyOpen):
|
|
return ("businessWorkHours", [("flags", flags as Any), ("timezoneId", timezoneId as Any), ("weeklyOpen", weeklyOpen as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_businessWorkHours(_ reader: BufferReader) -> BusinessWorkHours? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: [Api.BusinessWeeklyOpen]?
|
|
if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BusinessWeeklyOpen.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.BusinessWorkHours.businessWorkHours(flags: _1!, timezoneId: _2!, weeklyOpen: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum CdnConfig: TypeConstructorDescription {
|
|
case cdnConfig(publicKeys: [Api.CdnPublicKey])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .cdnConfig(let publicKeys):
|
|
if boxed {
|
|
buffer.appendInt32(1462101002)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(publicKeys.count))
|
|
for item in publicKeys {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .cdnConfig(let publicKeys):
|
|
return ("cdnConfig", [("publicKeys", publicKeys as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_cdnConfig(_ reader: BufferReader) -> CdnConfig? {
|
|
var _1: [Api.CdnPublicKey]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.CdnPublicKey.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.CdnConfig.cdnConfig(publicKeys: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|