mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
831 lines
37 KiB
Swift
831 lines
37 KiB
Swift
public extension Api {
|
|
enum InputPeerNotifySettings: TypeConstructorDescription {
|
|
case inputPeerNotifySettings(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, sound: Api.NotificationSound?, storiesMuted: Api.Bool?, storiesHideSender: Api.Bool?, storiesSound: Api.NotificationSound?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputPeerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let sound, let storiesMuted, let storiesHideSender, let storiesSound):
|
|
if boxed {
|
|
buffer.appendInt32(-892638494)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {showPreviews!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 1) != 0 {silent!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 2) != 0 {serializeInt32(muteUntil!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 3) != 0 {sound!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 6) != 0 {storiesMuted!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 7) != 0 {storiesHideSender!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 8) != 0 {storiesSound!.serialize(buffer, true)}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputPeerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let sound, let storiesMuted, let storiesHideSender, let storiesSound):
|
|
return ("inputPeerNotifySettings", [("flags", flags as Any), ("showPreviews", showPreviews as Any), ("silent", silent as Any), ("muteUntil", muteUntil as Any), ("sound", sound as Any), ("storiesMuted", storiesMuted as Any), ("storiesHideSender", storiesHideSender as Any), ("storiesSound", storiesSound as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputPeerNotifySettings(_ reader: BufferReader) -> InputPeerNotifySettings? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.Bool?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
} }
|
|
var _3: Api.Bool?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
|
_3 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
} }
|
|
var _4: Int32?
|
|
if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() }
|
|
var _5: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
|
_5 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
} }
|
|
var _6: Api.Bool?
|
|
if Int(_1!) & Int(1 << 6) != 0 {if let signature = reader.readInt32() {
|
|
_6 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
} }
|
|
var _7: Api.Bool?
|
|
if Int(_1!) & Int(1 << 7) != 0 {if let signature = reader.readInt32() {
|
|
_7 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
} }
|
|
var _8: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 8) != 0 {if let signature = reader.readInt32() {
|
|
_8 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
} }
|
|
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
|
|
let _c6 = (Int(_1!) & Int(1 << 6) == 0) || _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 7) == 0) || _7 != nil
|
|
let _c8 = (Int(_1!) & Int(1 << 8) == 0) || _8 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
|
|
return Api.InputPeerNotifySettings.inputPeerNotifySettings(flags: _1!, showPreviews: _2, silent: _3, muteUntil: _4, sound: _5, storiesMuted: _6, storiesHideSender: _7, storiesSound: _8)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputPhoneCall: TypeConstructorDescription {
|
|
case inputPhoneCall(id: Int64, accessHash: Int64)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputPhoneCall(let id, let accessHash):
|
|
if boxed {
|
|
buffer.appendInt32(506920429)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputPhoneCall(let id, let accessHash):
|
|
return ("inputPhoneCall", [("id", id as Any), ("accessHash", accessHash as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputPhoneCall(_ reader: BufferReader) -> InputPhoneCall? {
|
|
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.InputPhoneCall.inputPhoneCall(id: _1!, accessHash: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputPhoto: TypeConstructorDescription {
|
|
case inputPhoto(id: Int64, accessHash: Int64, fileReference: Buffer)
|
|
case inputPhotoEmpty
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputPhoto(let id, let accessHash, let fileReference):
|
|
if boxed {
|
|
buffer.appendInt32(1001634122)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
serializeBytes(fileReference, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputPhotoEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(483901197)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputPhoto(let id, let accessHash, let fileReference):
|
|
return ("inputPhoto", [("id", id as Any), ("accessHash", accessHash as Any), ("fileReference", fileReference as Any)])
|
|
case .inputPhotoEmpty:
|
|
return ("inputPhotoEmpty", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputPhoto(_ reader: BufferReader) -> InputPhoto? {
|
|
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.InputPhoto.inputPhoto(id: _1!, accessHash: _2!, fileReference: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputPhotoEmpty(_ reader: BufferReader) -> InputPhoto? {
|
|
return Api.InputPhoto.inputPhotoEmpty
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputPrivacyKey: TypeConstructorDescription {
|
|
case inputPrivacyKeyAbout
|
|
case inputPrivacyKeyAddedByPhone
|
|
case inputPrivacyKeyBirthday
|
|
case inputPrivacyKeyChatInvite
|
|
case inputPrivacyKeyForwards
|
|
case inputPrivacyKeyPhoneCall
|
|
case inputPrivacyKeyPhoneNumber
|
|
case inputPrivacyKeyPhoneP2P
|
|
case inputPrivacyKeyProfilePhoto
|
|
case inputPrivacyKeyStatusTimestamp
|
|
case inputPrivacyKeyVoiceMessages
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputPrivacyKeyAbout:
|
|
if boxed {
|
|
buffer.appendInt32(941870144)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyAddedByPhone:
|
|
if boxed {
|
|
buffer.appendInt32(-786326563)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyBirthday:
|
|
if boxed {
|
|
buffer.appendInt32(-698740276)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyChatInvite:
|
|
if boxed {
|
|
buffer.appendInt32(-1107622874)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyForwards:
|
|
if boxed {
|
|
buffer.appendInt32(-1529000952)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyPhoneCall:
|
|
if boxed {
|
|
buffer.appendInt32(-88417185)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyPhoneNumber:
|
|
if boxed {
|
|
buffer.appendInt32(55761658)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyPhoneP2P:
|
|
if boxed {
|
|
buffer.appendInt32(-610373422)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyProfilePhoto:
|
|
if boxed {
|
|
buffer.appendInt32(1461304012)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyStatusTimestamp:
|
|
if boxed {
|
|
buffer.appendInt32(1335282456)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyKeyVoiceMessages:
|
|
if boxed {
|
|
buffer.appendInt32(-1360618136)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputPrivacyKeyAbout:
|
|
return ("inputPrivacyKeyAbout", [])
|
|
case .inputPrivacyKeyAddedByPhone:
|
|
return ("inputPrivacyKeyAddedByPhone", [])
|
|
case .inputPrivacyKeyBirthday:
|
|
return ("inputPrivacyKeyBirthday", [])
|
|
case .inputPrivacyKeyChatInvite:
|
|
return ("inputPrivacyKeyChatInvite", [])
|
|
case .inputPrivacyKeyForwards:
|
|
return ("inputPrivacyKeyForwards", [])
|
|
case .inputPrivacyKeyPhoneCall:
|
|
return ("inputPrivacyKeyPhoneCall", [])
|
|
case .inputPrivacyKeyPhoneNumber:
|
|
return ("inputPrivacyKeyPhoneNumber", [])
|
|
case .inputPrivacyKeyPhoneP2P:
|
|
return ("inputPrivacyKeyPhoneP2P", [])
|
|
case .inputPrivacyKeyProfilePhoto:
|
|
return ("inputPrivacyKeyProfilePhoto", [])
|
|
case .inputPrivacyKeyStatusTimestamp:
|
|
return ("inputPrivacyKeyStatusTimestamp", [])
|
|
case .inputPrivacyKeyVoiceMessages:
|
|
return ("inputPrivacyKeyVoiceMessages", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputPrivacyKeyAbout(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyAbout
|
|
}
|
|
public static func parse_inputPrivacyKeyAddedByPhone(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyAddedByPhone
|
|
}
|
|
public static func parse_inputPrivacyKeyBirthday(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyBirthday
|
|
}
|
|
public static func parse_inputPrivacyKeyChatInvite(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyChatInvite
|
|
}
|
|
public static func parse_inputPrivacyKeyForwards(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyForwards
|
|
}
|
|
public static func parse_inputPrivacyKeyPhoneCall(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyPhoneCall
|
|
}
|
|
public static func parse_inputPrivacyKeyPhoneNumber(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyPhoneNumber
|
|
}
|
|
public static func parse_inputPrivacyKeyPhoneP2P(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyPhoneP2P
|
|
}
|
|
public static func parse_inputPrivacyKeyProfilePhoto(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyProfilePhoto
|
|
}
|
|
public static func parse_inputPrivacyKeyStatusTimestamp(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyStatusTimestamp
|
|
}
|
|
public static func parse_inputPrivacyKeyVoiceMessages(_ reader: BufferReader) -> InputPrivacyKey? {
|
|
return Api.InputPrivacyKey.inputPrivacyKeyVoiceMessages
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputPrivacyRule: TypeConstructorDescription {
|
|
case inputPrivacyValueAllowAll
|
|
case inputPrivacyValueAllowChatParticipants(chats: [Int64])
|
|
case inputPrivacyValueAllowCloseFriends
|
|
case inputPrivacyValueAllowContacts
|
|
case inputPrivacyValueAllowPremium
|
|
case inputPrivacyValueAllowUsers(users: [Api.InputUser])
|
|
case inputPrivacyValueDisallowAll
|
|
case inputPrivacyValueDisallowChatParticipants(chats: [Int64])
|
|
case inputPrivacyValueDisallowContacts
|
|
case inputPrivacyValueDisallowUsers(users: [Api.InputUser])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputPrivacyValueAllowAll:
|
|
if boxed {
|
|
buffer.appendInt32(407582158)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyValueAllowChatParticipants(let chats):
|
|
if boxed {
|
|
buffer.appendInt32(-2079962673)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(chats.count))
|
|
for item in chats {
|
|
serializeInt64(item, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
case .inputPrivacyValueAllowCloseFriends:
|
|
if boxed {
|
|
buffer.appendInt32(793067081)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyValueAllowContacts:
|
|
if boxed {
|
|
buffer.appendInt32(218751099)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyValueAllowPremium:
|
|
if boxed {
|
|
buffer.appendInt32(2009975281)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyValueAllowUsers(let users):
|
|
if boxed {
|
|
buffer.appendInt32(320652927)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(users.count))
|
|
for item in users {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
case .inputPrivacyValueDisallowAll:
|
|
if boxed {
|
|
buffer.appendInt32(-697604407)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyValueDisallowChatParticipants(let chats):
|
|
if boxed {
|
|
buffer.appendInt32(-380694650)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(chats.count))
|
|
for item in chats {
|
|
serializeInt64(item, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
case .inputPrivacyValueDisallowContacts:
|
|
if boxed {
|
|
buffer.appendInt32(195371015)
|
|
}
|
|
|
|
break
|
|
case .inputPrivacyValueDisallowUsers(let users):
|
|
if boxed {
|
|
buffer.appendInt32(-1877932953)
|
|
}
|
|
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 .inputPrivacyValueAllowAll:
|
|
return ("inputPrivacyValueAllowAll", [])
|
|
case .inputPrivacyValueAllowChatParticipants(let chats):
|
|
return ("inputPrivacyValueAllowChatParticipants", [("chats", chats as Any)])
|
|
case .inputPrivacyValueAllowCloseFriends:
|
|
return ("inputPrivacyValueAllowCloseFriends", [])
|
|
case .inputPrivacyValueAllowContacts:
|
|
return ("inputPrivacyValueAllowContacts", [])
|
|
case .inputPrivacyValueAllowPremium:
|
|
return ("inputPrivacyValueAllowPremium", [])
|
|
case .inputPrivacyValueAllowUsers(let users):
|
|
return ("inputPrivacyValueAllowUsers", [("users", users as Any)])
|
|
case .inputPrivacyValueDisallowAll:
|
|
return ("inputPrivacyValueDisallowAll", [])
|
|
case .inputPrivacyValueDisallowChatParticipants(let chats):
|
|
return ("inputPrivacyValueDisallowChatParticipants", [("chats", chats as Any)])
|
|
case .inputPrivacyValueDisallowContacts:
|
|
return ("inputPrivacyValueDisallowContacts", [])
|
|
case .inputPrivacyValueDisallowUsers(let users):
|
|
return ("inputPrivacyValueDisallowUsers", [("users", users as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputPrivacyValueAllowAll(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
return Api.InputPrivacyRule.inputPrivacyValueAllowAll
|
|
}
|
|
public static func parse_inputPrivacyValueAllowChatParticipants(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
var _1: [Int64]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputPrivacyRule.inputPrivacyValueAllowChatParticipants(chats: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputPrivacyValueAllowCloseFriends(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
return Api.InputPrivacyRule.inputPrivacyValueAllowCloseFriends
|
|
}
|
|
public static func parse_inputPrivacyValueAllowContacts(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
return Api.InputPrivacyRule.inputPrivacyValueAllowContacts
|
|
}
|
|
public static func parse_inputPrivacyValueAllowPremium(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
return Api.InputPrivacyRule.inputPrivacyValueAllowPremium
|
|
}
|
|
public static func parse_inputPrivacyValueAllowUsers(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
var _1: [Api.InputUser]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputPrivacyRule.inputPrivacyValueAllowUsers(users: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputPrivacyValueDisallowAll(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
return Api.InputPrivacyRule.inputPrivacyValueDisallowAll
|
|
}
|
|
public static func parse_inputPrivacyValueDisallowChatParticipants(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
var _1: [Int64]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputPrivacyRule.inputPrivacyValueDisallowChatParticipants(chats: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputPrivacyValueDisallowContacts(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
return Api.InputPrivacyRule.inputPrivacyValueDisallowContacts
|
|
}
|
|
public static func parse_inputPrivacyValueDisallowUsers(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
var _1: [Api.InputUser]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputPrivacyRule.inputPrivacyValueDisallowUsers(users: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputQuickReplyShortcut: TypeConstructorDescription {
|
|
case inputQuickReplyShortcut(shortcut: String)
|
|
case inputQuickReplyShortcutId(shortcutId: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputQuickReplyShortcut(let shortcut):
|
|
if boxed {
|
|
buffer.appendInt32(609840449)
|
|
}
|
|
serializeString(shortcut, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputQuickReplyShortcutId(let shortcutId):
|
|
if boxed {
|
|
buffer.appendInt32(18418929)
|
|
}
|
|
serializeInt32(shortcutId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputQuickReplyShortcut(let shortcut):
|
|
return ("inputQuickReplyShortcut", [("shortcut", shortcut as Any)])
|
|
case .inputQuickReplyShortcutId(let shortcutId):
|
|
return ("inputQuickReplyShortcutId", [("shortcutId", shortcutId as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputQuickReplyShortcut(_ reader: BufferReader) -> InputQuickReplyShortcut? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputQuickReplyShortcut.inputQuickReplyShortcut(shortcut: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputQuickReplyShortcutId(_ reader: BufferReader) -> InputQuickReplyShortcut? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.InputQuickReplyShortcut.inputQuickReplyShortcutId(shortcutId: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
indirect enum InputReplyTo: TypeConstructorDescription {
|
|
case inputReplyToMessage(flags: Int32, replyToMsgId: Int32, topMsgId: Int32?, replyToPeerId: Api.InputPeer?, quoteText: String?, quoteEntities: [Api.MessageEntity]?, quoteOffset: Int32?)
|
|
case inputReplyToStory(peer: Api.InputPeer, storyId: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputReplyToMessage(let flags, let replyToMsgId, let topMsgId, let replyToPeerId, let quoteText, let quoteEntities, let quoteOffset):
|
|
if boxed {
|
|
buffer.appendInt32(583071445)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeInt32(replyToMsgId, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {serializeInt32(topMsgId!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 1) != 0 {replyToPeerId!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 2) != 0 {serializeString(quoteText!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 3) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(quoteEntities!.count))
|
|
for item in quoteEntities! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
if Int(flags) & Int(1 << 4) != 0 {serializeInt32(quoteOffset!, buffer: buffer, boxed: false)}
|
|
break
|
|
case .inputReplyToStory(let peer, let storyId):
|
|
if boxed {
|
|
buffer.appendInt32(1484862010)
|
|
}
|
|
peer.serialize(buffer, true)
|
|
serializeInt32(storyId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputReplyToMessage(let flags, let replyToMsgId, let topMsgId, let replyToPeerId, let quoteText, let quoteEntities, let quoteOffset):
|
|
return ("inputReplyToMessage", [("flags", flags as Any), ("replyToMsgId", replyToMsgId as Any), ("topMsgId", topMsgId as Any), ("replyToPeerId", replyToPeerId as Any), ("quoteText", quoteText as Any), ("quoteEntities", quoteEntities as Any), ("quoteOffset", quoteOffset as Any)])
|
|
case .inputReplyToStory(let peer, let storyId):
|
|
return ("inputReplyToStory", [("peer", peer as Any), ("storyId", storyId as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputReplyToMessage(_ reader: BufferReader) -> InputReplyTo? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: Int32?
|
|
if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt32() }
|
|
var _4: Api.InputPeer?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
|
} }
|
|
var _5: String?
|
|
if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) }
|
|
var _6: [Api.MessageEntity]?
|
|
if Int(_1!) & Int(1 << 3) != 0 {if let _ = reader.readInt32() {
|
|
_6 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
} }
|
|
var _7: Int32?
|
|
if Int(_1!) & Int(1 << 4) != 0 {_7 = reader.readInt32() }
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
|
|
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
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
|
return Api.InputReplyTo.inputReplyToMessage(flags: _1!, replyToMsgId: _2!, topMsgId: _3, replyToPeerId: _4, quoteText: _5, quoteEntities: _6, quoteOffset: _7)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputReplyToStory(_ reader: BufferReader) -> InputReplyTo? {
|
|
var _1: Api.InputPeer?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
|
}
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.InputReplyTo.inputReplyToStory(peer: _1!, storyId: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputSecureFile: TypeConstructorDescription {
|
|
case inputSecureFile(id: Int64, accessHash: Int64)
|
|
case inputSecureFileUploaded(id: Int64, parts: Int32, md5Checksum: String, fileHash: Buffer, secret: Buffer)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputSecureFile(let id, let accessHash):
|
|
if boxed {
|
|
buffer.appendInt32(1399317950)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
break
|
|
case .inputSecureFileUploaded(let id, let parts, let md5Checksum, let fileHash, let secret):
|
|
if boxed {
|
|
buffer.appendInt32(859091184)
|
|
}
|
|
serializeInt64(id, buffer: buffer, boxed: false)
|
|
serializeInt32(parts, buffer: buffer, boxed: false)
|
|
serializeString(md5Checksum, buffer: buffer, boxed: false)
|
|
serializeBytes(fileHash, buffer: buffer, boxed: false)
|
|
serializeBytes(secret, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputSecureFile(let id, let accessHash):
|
|
return ("inputSecureFile", [("id", id as Any), ("accessHash", accessHash as Any)])
|
|
case .inputSecureFileUploaded(let id, let parts, let md5Checksum, let fileHash, let secret):
|
|
return ("inputSecureFileUploaded", [("id", id as Any), ("parts", parts as Any), ("md5Checksum", md5Checksum as Any), ("fileHash", fileHash as Any), ("secret", secret as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputSecureFile(_ reader: BufferReader) -> InputSecureFile? {
|
|
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.InputSecureFile.inputSecureFile(id: _1!, accessHash: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_inputSecureFileUploaded(_ reader: BufferReader) -> InputSecureFile? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: Buffer?
|
|
_4 = parseBytes(reader)
|
|
var _5: Buffer?
|
|
_5 = parseBytes(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
let _c5 = _5 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
|
return Api.InputSecureFile.inputSecureFileUploaded(id: _1!, parts: _2!, md5Checksum: _3!, fileHash: _4!, secret: _5!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum InputSecureValue: TypeConstructorDescription {
|
|
case inputSecureValue(flags: Int32, type: Api.SecureValueType, data: Api.SecureData?, frontSide: Api.InputSecureFile?, reverseSide: Api.InputSecureFile?, selfie: Api.InputSecureFile?, translation: [Api.InputSecureFile]?, files: [Api.InputSecureFile]?, plainData: Api.SecurePlainData?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputSecureValue(let flags, let type, let data, let frontSide, let reverseSide, let selfie, let translation, let files, let plainData):
|
|
if boxed {
|
|
buffer.appendInt32(-618540889)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
type.serialize(buffer, true)
|
|
if Int(flags) & Int(1 << 0) != 0 {data!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 1) != 0 {frontSide!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 2) != 0 {reverseSide!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 3) != 0 {selfie!.serialize(buffer, true)}
|
|
if Int(flags) & Int(1 << 6) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(translation!.count))
|
|
for item in translation! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
if Int(flags) & Int(1 << 4) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(files!.count))
|
|
for item in files! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
if Int(flags) & Int(1 << 5) != 0 {plainData!.serialize(buffer, true)}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inputSecureValue(let flags, let type, let data, let frontSide, let reverseSide, let selfie, let translation, let files, let plainData):
|
|
return ("inputSecureValue", [("flags", flags as Any), ("type", type as Any), ("data", data as Any), ("frontSide", frontSide as Any), ("reverseSide", reverseSide as Any), ("selfie", selfie as Any), ("translation", translation as Any), ("files", files as Any), ("plainData", plainData as Any)])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputSecureValue(_ reader: BufferReader) -> InputSecureValue? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.SecureValueType?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.SecureValueType
|
|
}
|
|
var _3: Api.SecureData?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
|
|
_3 = Api.parse(reader, signature: signature) as? Api.SecureData
|
|
} }
|
|
var _4: Api.InputSecureFile?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.InputSecureFile
|
|
} }
|
|
var _5: Api.InputSecureFile?
|
|
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
|
_5 = Api.parse(reader, signature: signature) as? Api.InputSecureFile
|
|
} }
|
|
var _6: Api.InputSecureFile?
|
|
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
|
_6 = Api.parse(reader, signature: signature) as? Api.InputSecureFile
|
|
} }
|
|
var _7: [Api.InputSecureFile]?
|
|
if Int(_1!) & Int(1 << 6) != 0 {if let _ = reader.readInt32() {
|
|
_7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputSecureFile.self)
|
|
} }
|
|
var _8: [Api.InputSecureFile]?
|
|
if Int(_1!) & Int(1 << 4) != 0 {if let _ = reader.readInt32() {
|
|
_8 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputSecureFile.self)
|
|
} }
|
|
var _9: Api.SecurePlainData?
|
|
if Int(_1!) & Int(1 << 5) != 0 {if let signature = reader.readInt32() {
|
|
_9 = Api.parse(reader, signature: signature) as? Api.SecurePlainData
|
|
} }
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil
|
|
let _c6 = (Int(_1!) & Int(1 << 3) == 0) || _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 6) == 0) || _7 != nil
|
|
let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil
|
|
let _c9 = (Int(_1!) & Int(1 << 5) == 0) || _9 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 {
|
|
return Api.InputSecureValue.inputSecureValue(flags: _1!, type: _2!, data: _3, frontSide: _4, reverseSide: _5, selfie: _6, translation: _7, files: _8, plainData: _9)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|