mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
1191 lines
50 KiB
Swift
1191 lines
50 KiB
Swift
public extension Api {
|
|
enum InputBotInlineMessageID: TypeConstructorDescription {
|
|
case inputBotInlineMessageID(dcId: Int32, id: Int64, accessHash: Int64)
|
|
case inputBotInlineMessageID64(dcId: Int32, ownerId: Int64, id: Int32, accessHash: Int64)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputBotInlineMessageID(let dcId, let id, let accessHash):
|
|
if boxed {
|
|
buffer.appendInt32(-1995686519)
|
|
}
|
|
serializeInt32(dcId, buffer: buffer, boxed: false)
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputBotInlineMessageID64(let dcId, let ownerId, let id, let accessHash):
|
|
if boxed {
|
|
buffer.appendInt32(-1227287081)
|
|
}
|
|
serializeInt32(dcId, buffer: buffer, boxed: false)
|
|
serializeInt64(ownerId, buffer: buffer, boxed: false)
|
|
serializeInt32(id, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputBotInlineMessageID(let dcId, let id, let accessHash):
|
|
return ("inputBotInlineMessageID", [("dcId", dcId as Any), ("id", id as Any), ("accessHash", accessHash as Any)])
|
|
case .inputBotInlineMessageID64(let dcId, let ownerId, let id, let accessHash):
|
|
return ("inputBotInlineMessageID64", [("dcId", dcId as Any), ("ownerId", ownerId as Any), ("id", id as Any), ("accessHash", accessHash as Any)])
|
|
}
|
|
}
|
|
|
|
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(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(dcId: _1!, ownerId: _2!, id: _3!, accessHash: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputBotInlineResult: TypeConstructorDescription {
|
|
case inputBotInlineResult(flags: Int32, id: String, type: String, title: String?, description: String?, url: String?, thumb: Api.InputWebDocument?, content: Api.InputWebDocument?, sendMessage: Api.InputBotInlineMessage)
|
|
case inputBotInlineResultDocument(flags: Int32, id: String, type: String, title: String?, description: String?, document: Api.InputDocument, sendMessage: Api.InputBotInlineMessage)
|
|
case inputBotInlineResultGame(id: String, shortName: String, sendMessage: Api.InputBotInlineMessage)
|
|
case inputBotInlineResultPhoto(id: String, type: String, photo: Api.InputPhoto, sendMessage: Api.InputBotInlineMessage)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputBotInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage):
|
|
if boxed {
|
|
buffer.appendInt32(-2000710887)
|
|
}
|
|
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
|
|
case .inputBotInlineResultDocument(let flags, let id, let type, let title, let description, let document, let sendMessage):
|
|
if boxed {
|
|
buffer.appendInt32(-459324)
|
|
}
|
|
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)}
|
|
document.serialize(buffer, true)
|
|
sendMessage.serialize(buffer, true)
|
|
break
|
|
case .inputBotInlineResultGame(let id, let shortName, let sendMessage):
|
|
if boxed {
|
|
buffer.appendInt32(1336154098)
|
|
}
|
|
serializeString(id, buffer: buffer, boxed: false)
|
|
serializeString(shortName, buffer: buffer, boxed: false)
|
|
sendMessage.serialize(buffer, true)
|
|
break
|
|
case .inputBotInlineResultPhoto(let id, let type, let photo, let sendMessage):
|
|
if boxed {
|
|
buffer.appendInt32(-1462213465)
|
|
}
|
|
serializeString(id, buffer: buffer, boxed: false)
|
|
serializeString(type, buffer: buffer, boxed: false)
|
|
photo.serialize(buffer, true)
|
|
sendMessage.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputBotInlineResult(let flags, let id, let type, let title, let description, let url, let thumb, let content, let sendMessage):
|
|
return ("inputBotInlineResult", [("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)])
|
|
case .inputBotInlineResultDocument(let flags, let id, let type, let title, let description, let document, let sendMessage):
|
|
return ("inputBotInlineResultDocument", [("flags", flags as Any), ("id", id as Any), ("type", type as Any), ("title", title as Any), ("description", description as Any), ("document", document as Any), ("sendMessage", sendMessage as Any)])
|
|
case .inputBotInlineResultGame(let id, let shortName, let sendMessage):
|
|
return ("inputBotInlineResultGame", [("id", id as Any), ("shortName", shortName as Any), ("sendMessage", sendMessage as Any)])
|
|
case .inputBotInlineResultPhoto(let id, let type, let photo, let sendMessage):
|
|
return ("inputBotInlineResultPhoto", [("id", id as Any), ("type", type as Any), ("photo", photo as Any), ("sendMessage", sendMessage as Any)])
|
|
}
|
|
}
|
|
|
|
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(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(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(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(id: _1!, type: _2!, photo: _3!, sendMessage: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputBusinessAwayMessage: TypeConstructorDescription {
|
|
case inputBusinessAwayMessage(flags: Int32, shortcutId: Int32, schedule: Api.BusinessAwayMessageSchedule, recipients: Api.InputBusinessRecipients)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputBusinessAwayMessage(let flags, let shortcutId, let schedule, let recipients):
|
|
if boxed {
|
|
buffer.appendInt32(-2094959136)
|
|
}
|
|
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 .inputBusinessAwayMessage(let flags, let shortcutId, let schedule, let recipients):
|
|
return ("inputBusinessAwayMessage", [("flags", flags as Any), ("shortcutId", shortcutId as Any), ("schedule", schedule as Any), ("recipients", recipients as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputBusinessAwayMessage(_ reader: BufferReader) -> InputBusinessAwayMessage? {
|
|
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.InputBusinessRecipients?
|
|
if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.InputBusinessRecipients
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.InputBusinessAwayMessage.inputBusinessAwayMessage(flags: _1!, shortcutId: _2!, schedule: _3!, recipients: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputBusinessBotRecipients: TypeConstructorDescription {
|
|
case inputBusinessBotRecipients(flags: Int32, users: [Api.InputUser]?, excludeUsers: [Api.InputUser]?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputBusinessBotRecipients(let flags, let users, let excludeUsers):
|
|
if boxed {
|
|
buffer.appendInt32(-991587810)
|
|
}
|
|
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! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(excludeUsers!.count))
|
|
for item in excludeUsers! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputBusinessBotRecipients(let flags, let users, let excludeUsers):
|
|
return ("inputBusinessBotRecipients", [("flags", flags as Any), ("users", users as Any), ("excludeUsers", excludeUsers as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputBusinessBotRecipients(_ reader: BufferReader) -> InputBusinessBotRecipients? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Api.InputUser]?
|
|
if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self)
|
|
} }
|
|
var _3: [Api.InputUser]?
|
|
if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.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.InputBusinessBotRecipients.inputBusinessBotRecipients(flags: _1!, users: _2, excludeUsers: _3)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputBusinessGreetingMessage: TypeConstructorDescription {
|
|
case inputBusinessGreetingMessage(shortcutId: Int32, recipients: Api.InputBusinessRecipients, noActivityDays: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputBusinessGreetingMessage(let shortcutId, let recipients, let noActivityDays):
|
|
if boxed {
|
|
buffer.appendInt32(26528571)
|
|
}
|
|
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 .inputBusinessGreetingMessage(let shortcutId, let recipients, let noActivityDays):
|
|
return ("inputBusinessGreetingMessage", [("shortcutId", shortcutId as Any), ("recipients", recipients as Any), ("noActivityDays", noActivityDays as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputBusinessGreetingMessage(_ reader: BufferReader) -> InputBusinessGreetingMessage? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.InputBusinessRecipients?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.InputBusinessRecipients
|
|
}
|
|
var _3: Int32?
|
|
_3 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.InputBusinessGreetingMessage.inputBusinessGreetingMessage(shortcutId: _1!, recipients: _2!, noActivityDays: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputBusinessIntro: TypeConstructorDescription {
|
|
case inputBusinessIntro(flags: Int32, title: String, description: String, sticker: Api.InputDocument?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputBusinessIntro(let flags, let title, let description, let sticker):
|
|
if boxed {
|
|
buffer.appendInt32(163867085)
|
|
}
|
|
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 .inputBusinessIntro(let flags, let title, let description, let sticker):
|
|
return ("inputBusinessIntro", [("flags", flags as Any), ("title", title as Any), ("description", description as Any), ("sticker", sticker as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputBusinessIntro(_ reader: BufferReader) -> InputBusinessIntro? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: Api.InputDocument?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.InputDocument
|
|
} }
|
|
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.InputBusinessIntro.inputBusinessIntro(flags: _1!, title: _2!, description: _3!, sticker: _4)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputBusinessRecipients: TypeConstructorDescription {
|
|
case inputBusinessRecipients(flags: Int32, users: [Api.InputUser]?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputBusinessRecipients(let flags, let users):
|
|
if boxed {
|
|
buffer.appendInt32(1871393450)
|
|
}
|
|
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! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputBusinessRecipients(let flags, let users):
|
|
return ("inputBusinessRecipients", [("flags", flags as Any), ("users", users as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputBusinessRecipients(_ reader: BufferReader) -> InputBusinessRecipients? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Api.InputUser]?
|
|
if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self)
|
|
} }
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 4) == 0) || _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.InputBusinessRecipients.inputBusinessRecipients(flags: _1!, users: _2)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
indirect enum InputChannel: TypeConstructorDescription {
|
|
case inputChannel(channelId: Int64, accessHash: Int64)
|
|
case inputChannelEmpty
|
|
case inputChannelFromMessage(peer: Api.InputPeer, msgId: Int32, channelId: Int64)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputChannel(let channelId, let accessHash):
|
|
if boxed {
|
|
buffer.appendInt32(-212145112)
|
|
}
|
|
serializeInt64(channelId, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputChannelEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(-292807034)
|
|
}
|
|
|
|
break
|
|
case .inputChannelFromMessage(let peer, let msgId, let channelId):
|
|
if boxed {
|
|
buffer.appendInt32(1536380829)
|
|
}
|
|
peer.serialize(buffer, true)
|
|
serializeInt32(msgId, buffer: buffer, boxed: false)
|
|
serializeInt64(channelId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputChannel(let channelId, let accessHash):
|
|
return ("inputChannel", [("channelId", channelId as Any), ("accessHash", accessHash as Any)])
|
|
case .inputChannelEmpty:
|
|
return ("inputChannelEmpty", [])
|
|
case .inputChannelFromMessage(let peer, let msgId, let channelId):
|
|
return ("inputChannelFromMessage", [("peer", peer as Any), ("msgId", msgId as Any), ("channelId", channelId as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputChannel(_ reader: BufferReader) -> InputChannel? {
|
|
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.InputChannel.inputChannel(channelId: _1!, accessHash: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputChannelEmpty(_ reader: BufferReader) -> InputChannel? {
|
|
return Api.InputChannel.inputChannelEmpty
|
|
}
|
|
public static func parse_inputChannelFromMessage(_ reader: BufferReader) -> InputChannel? {
|
|
var _1: Api.InputPeer?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
|
}
|
|
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.InputChannel.inputChannelFromMessage(peer: _1!, msgId: _2!, channelId: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputChatPhoto: TypeConstructorDescription {
|
|
case inputChatPhoto(id: Api.InputPhoto)
|
|
case inputChatPhotoEmpty
|
|
case inputChatUploadedPhoto(flags: Int32, file: Api.InputFile?, video: Api.InputFile?, videoStartTs: Double?, videoEmojiMarkup: Api.VideoSize?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputChatPhoto(let id):
|
|
if boxed {
|
|
buffer.appendInt32(-1991004873)
|
|
}
|
|
id.serialize(buffer, true)
|
|
break
|
|
case .inputChatPhotoEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(480546647)
|
|
}
|
|
|
|
break
|
|
case .inputChatUploadedPhoto(let flags, let file, let video, let videoStartTs, let videoEmojiMarkup):
|
|
if boxed {
|
|
buffer.appendInt32(-1110593856)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {file!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 1) != 0 {video!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 2) != 0 {serializeDouble(videoStartTs!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 3) != 0 {videoEmojiMarkup!.serialize(buffer, true)}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputChatPhoto(let id):
|
|
return ("inputChatPhoto", [("id", id as Any)])
|
|
case .inputChatPhotoEmpty:
|
|
return ("inputChatPhotoEmpty", [])
|
|
case .inputChatUploadedPhoto(let flags, let file, let video, let videoStartTs, let videoEmojiMarkup):
|
|
return ("inputChatUploadedPhoto", [("flags", flags as Any), ("file", file as Any), ("video", video as Any), ("videoStartTs", videoStartTs as Any), ("videoEmojiMarkup", videoEmojiMarkup as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputChatPhoto(_ reader: BufferReader) -> InputChatPhoto? {
|
|
var _1: Api.InputPhoto?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.InputPhoto
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputChatPhoto.inputChatPhoto(id: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputChatPhotoEmpty(_ reader: BufferReader) -> InputChatPhoto? {
|
|
return Api.InputChatPhoto.inputChatPhotoEmpty
|
|
}
|
|
public static func parse_inputChatUploadedPhoto(_ reader: BufferReader) -> InputChatPhoto? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.InputFile?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.InputFile
|
|
} }
|
|
var _3: Api.InputFile?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
|
_3 = Api.parse(reader, signature: signature) as? Api.InputFile
|
|
} }
|
|
var _4: Double?
|
|
if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readDouble() }
|
|
var _5: Api.VideoSize?
|
|
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
|
_5 = Api.parse(reader, signature: signature) as? Api.VideoSize
|
|
} }
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
|
return Api.InputChatPhoto.inputChatUploadedPhoto(flags: _1!, file: _2, video: _3, videoStartTs: _4, videoEmojiMarkup: _5)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputChatlist: TypeConstructorDescription {
|
|
case inputChatlistDialogFilter(filterId: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputChatlistDialogFilter(let filterId):
|
|
if boxed {
|
|
buffer.appendInt32(-203367885)
|
|
}
|
|
serializeInt32(filterId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputChatlistDialogFilter(let filterId):
|
|
return ("inputChatlistDialogFilter", [("filterId", filterId as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputChatlistDialogFilter(_ reader: BufferReader) -> InputChatlist? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputChatlist.inputChatlistDialogFilter(filterId: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputCheckPasswordSRP: TypeConstructorDescription {
|
|
case inputCheckPasswordEmpty
|
|
case inputCheckPasswordSRP(srpId: Int64, A: Buffer, M1: Buffer)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputCheckPasswordEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(-1736378792)
|
|
}
|
|
|
|
break
|
|
case .inputCheckPasswordSRP(let srpId, let A, let M1):
|
|
if boxed {
|
|
buffer.appendInt32(-763367294)
|
|
}
|
|
serializeInt64(srpId, buffer: buffer, boxed: false)
|
|
serializeBytes(A, buffer: buffer, boxed: false)
|
|
serializeBytes(M1, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputCheckPasswordEmpty:
|
|
return ("inputCheckPasswordEmpty", [])
|
|
case .inputCheckPasswordSRP(let srpId, let A, let M1):
|
|
return ("inputCheckPasswordSRP", [("srpId", srpId as Any), ("A", A as Any), ("M1", M1 as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputCheckPasswordEmpty(_ reader: BufferReader) -> InputCheckPasswordSRP? {
|
|
return Api.InputCheckPasswordSRP.inputCheckPasswordEmpty
|
|
}
|
|
public static func parse_inputCheckPasswordSRP(_ reader: BufferReader) -> InputCheckPasswordSRP? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: Buffer?
|
|
_2 = parseBytes(reader)
|
|
var _3: Buffer?
|
|
_3 = parseBytes(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.InputCheckPasswordSRP.inputCheckPasswordSRP(srpId: _1!, A: _2!, M1: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputClientProxy: TypeConstructorDescription {
|
|
case inputClientProxy(address: String, port: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputClientProxy(let address, let port):
|
|
if boxed {
|
|
buffer.appendInt32(1968737087)
|
|
}
|
|
serializeString(address, buffer: buffer, boxed: false)
|
|
serializeInt32(port, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputClientProxy(let address, let port):
|
|
return ("inputClientProxy", [("address", address as Any), ("port", port as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputClientProxy(_ reader: BufferReader) -> InputClientProxy? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.InputClientProxy.inputClientProxy(address: _1!, port: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputCollectible: TypeConstructorDescription {
|
|
case inputCollectiblePhone(phone: String)
|
|
case inputCollectibleUsername(username: String)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputCollectiblePhone(let phone):
|
|
if boxed {
|
|
buffer.appendInt32(-1562241884)
|
|
}
|
|
serializeString(phone, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputCollectibleUsername(let username):
|
|
if boxed {
|
|
buffer.appendInt32(-476815191)
|
|
}
|
|
serializeString(username, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputCollectiblePhone(let phone):
|
|
return ("inputCollectiblePhone", [("phone", phone as Any)])
|
|
case .inputCollectibleUsername(let username):
|
|
return ("inputCollectibleUsername", [("username", username as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputCollectiblePhone(_ reader: BufferReader) -> InputCollectible? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputCollectible.inputCollectiblePhone(phone: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputCollectibleUsername(_ reader: BufferReader) -> InputCollectible? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputCollectible.inputCollectibleUsername(username: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputContact: TypeConstructorDescription {
|
|
case inputPhoneContact(clientId: Int64, phone: String, firstName: String, lastName: String)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputPhoneContact(let clientId, let phone, let firstName, let lastName):
|
|
if boxed {
|
|
buffer.appendInt32(-208488460)
|
|
}
|
|
serializeInt64(clientId, buffer: buffer, boxed: false)
|
|
serializeString(phone, buffer: buffer, boxed: false)
|
|
serializeString(firstName, buffer: buffer, boxed: false)
|
|
serializeString(lastName, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputPhoneContact(let clientId, let phone, let firstName, let lastName):
|
|
return ("inputPhoneContact", [("clientId", clientId as Any), ("phone", phone as Any), ("firstName", firstName as Any), ("lastName", lastName as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputPhoneContact(_ reader: BufferReader) -> InputContact? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: String?
|
|
_4 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.InputContact.inputPhoneContact(clientId: _1!, phone: _2!, firstName: _3!, lastName: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
indirect enum InputDialogPeer: TypeConstructorDescription {
|
|
case inputDialogPeer(peer: Api.InputPeer)
|
|
case inputDialogPeerFolder(folderId: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputDialogPeer(let peer):
|
|
if boxed {
|
|
buffer.appendInt32(-55902537)
|
|
}
|
|
peer.serialize(buffer, true)
|
|
break
|
|
case .inputDialogPeerFolder(let folderId):
|
|
if boxed {
|
|
buffer.appendInt32(1684014375)
|
|
}
|
|
serializeInt32(folderId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputDialogPeer(let peer):
|
|
return ("inputDialogPeer", [("peer", peer as Any)])
|
|
case .inputDialogPeerFolder(let folderId):
|
|
return ("inputDialogPeerFolder", [("folderId", folderId as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputDialogPeer(_ reader: BufferReader) -> InputDialogPeer? {
|
|
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.InputDialogPeer.inputDialogPeer(peer: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputDialogPeerFolder(_ reader: BufferReader) -> InputDialogPeer? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputDialogPeer.inputDialogPeerFolder(folderId: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputDocument: TypeConstructorDescription {
|
|
case inputDocument(id: Int64, accessHash: Int64, fileReference: Buffer)
|
|
case inputDocumentEmpty
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputDocument(let id, let accessHash, let fileReference):
|
|
if boxed {
|
|
buffer.appendInt32(448771445)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
serializeBytes(fileReference, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputDocumentEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(1928391342)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputDocument(let id, let accessHash, let fileReference):
|
|
return ("inputDocument", [("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any)])
|
|
case .inputDocumentEmpty:
|
|
return ("inputDocumentEmpty", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputDocument(_ reader: BufferReader) -> InputDocument? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: Int64?
|
|
_2 = reader.readInt64()
|
|
var _3: Buffer?
|
|
_3 = parseBytes(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.InputDocument.inputDocument(id: _1!, accessHash: _2!, fileReference: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputDocumentEmpty(_ reader: BufferReader) -> InputDocument? {
|
|
return Api.InputDocument.inputDocumentEmpty
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputEncryptedChat: TypeConstructorDescription {
|
|
case inputEncryptedChat(chatId: Int32, accessHash: Int64)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputEncryptedChat(let chatId, let accessHash):
|
|
if boxed {
|
|
buffer.appendInt32(-247351839)
|
|
}
|
|
serializeInt32(chatId, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputEncryptedChat(let chatId, let accessHash):
|
|
return ("inputEncryptedChat", [("chatId", chatId as Any), ("accessHash", accessHash as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputEncryptedChat(_ reader: BufferReader) -> InputEncryptedChat? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int64?
|
|
_2 = reader.readInt64()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.InputEncryptedChat.inputEncryptedChat(chatId: _1!, accessHash: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputEncryptedFile: TypeConstructorDescription {
|
|
case inputEncryptedFile(id: Int64, accessHash: Int64)
|
|
case inputEncryptedFileBigUploaded(id: Int64, parts: Int32, keyFingerprint: Int32)
|
|
case inputEncryptedFileEmpty
|
|
case inputEncryptedFileUploaded(id: Int64, parts: Int32, md5Checksum: String, keyFingerprint: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputEncryptedFile(let id, let accessHash):
|
|
if boxed {
|
|
buffer.appendInt32(1511503333)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputEncryptedFileBigUploaded(let id, let parts, let keyFingerprint):
|
|
if boxed {
|
|
buffer.appendInt32(767652808)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt32(parts, buffer: buffer, boxed: false)
|
|
serializeInt32(keyFingerprint, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputEncryptedFileEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(406307684)
|
|
}
|
|
|
|
break
|
|
case .inputEncryptedFileUploaded(let id, let parts, let md5Checksum, let keyFingerprint):
|
|
if boxed {
|
|
buffer.appendInt32(1690108678)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt32(parts, buffer: buffer, boxed: false)
|
|
serializeString(md5Checksum, buffer: buffer, boxed: false)
|
|
serializeInt32(keyFingerprint, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputEncryptedFile(let id, let accessHash):
|
|
return ("inputEncryptedFile", [("id", id as Any), ("accessHash", accessHash as Any)])
|
|
case .inputEncryptedFileBigUploaded(let id, let parts, let keyFingerprint):
|
|
return ("inputEncryptedFileBigUploaded", [("id", id as Any), ("parts", parts as Any), ("keyFingerprint", keyFingerprint as Any)])
|
|
case .inputEncryptedFileEmpty:
|
|
return ("inputEncryptedFileEmpty", [])
|
|
case .inputEncryptedFileUploaded(let id, let parts, let md5Checksum, let keyFingerprint):
|
|
return ("inputEncryptedFileUploaded", [("id", id as Any), ("parts", parts as Any), ("md5Checksum", md5Checksum as Any), ("keyFingerprint", keyFingerprint as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputEncryptedFile(_ reader: BufferReader) -> InputEncryptedFile? {
|
|
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.InputEncryptedFile.inputEncryptedFile(id: _1!, accessHash: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputEncryptedFileBigUploaded(_ reader: BufferReader) -> InputEncryptedFile? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: Int32?
|
|
_3 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.InputEncryptedFile.inputEncryptedFileBigUploaded(id: _1!, parts: _2!, keyFingerprint: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputEncryptedFileEmpty(_ reader: BufferReader) -> InputEncryptedFile? {
|
|
return Api.InputEncryptedFile.inputEncryptedFileEmpty
|
|
}
|
|
public static func parse_inputEncryptedFileUploaded(_ reader: BufferReader) -> InputEncryptedFile? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: Int32?
|
|
_4 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.InputEncryptedFile.inputEncryptedFileUploaded(id: _1!, parts: _2!, md5Checksum: _3!, keyFingerprint: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|