[WIP] Email authorization

This commit is contained in:
Ilya Laktyushin
2022-08-13 01:11:48 +03:00
parent e795194a8f
commit aea7e12813
36 changed files with 3416 additions and 2385 deletions

View File

@@ -1,3 +1,281 @@
public extension Api {
enum InputPeerNotifySettings: TypeConstructorDescription {
case inputPeerNotifySettings(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, sound: Api.NotificationSound?)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputPeerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let sound):
if boxed {
buffer.appendInt32(-551616469)
}
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)}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputPeerNotifySettings(let flags, let showPreviews, let silent, let muteUntil, let sound):
return ("inputPeerNotifySettings", [("flags", String(describing: flags)), ("showPreviews", String(describing: showPreviews)), ("silent", String(describing: silent)), ("muteUntil", String(describing: muteUntil)), ("sound", String(describing: sound))])
}
}
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
} }
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.InputPeerNotifySettings.inputPeerNotifySettings(flags: _1!, showPreviews: _2, silent: _3, muteUntil: _4, sound: _5)
}
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", String(describing: id)), ("accessHash", String(describing: accessHash))])
}
}
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", String(describing: id)), ("accessHash", String(describing: accessHash)), ("fileReference", String(describing: fileReference))])
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 inputPrivacyKeyAddedByPhone
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 .inputPrivacyKeyAddedByPhone:
if boxed {
buffer.appendInt32(-786326563)
}
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 .inputPrivacyKeyAddedByPhone:
return ("inputPrivacyKeyAddedByPhone", [])
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_inputPrivacyKeyAddedByPhone(_ reader: BufferReader) -> InputPrivacyKey? {
return Api.InputPrivacyKey.inputPrivacyKeyAddedByPhone
}
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
@@ -522,487 +800,3 @@ public extension Api {
}
}
public extension Api {
enum InputStickerSetItem: TypeConstructorDescription {
case inputStickerSetItem(flags: Int32, document: Api.InputDocument, emoji: String, maskCoords: Api.MaskCoords?)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputStickerSetItem(let flags, let document, let emoji, let maskCoords):
if boxed {
buffer.appendInt32(-6249322)
}
serializeInt32(flags, buffer: buffer, boxed: false)
document.serialize(buffer, true)
serializeString(emoji, buffer: buffer, boxed: false)
if Int(flags) & Int(1 << 0) != 0 {maskCoords!.serialize(buffer, true)}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputStickerSetItem(let flags, let document, let emoji, let maskCoords):
return ("inputStickerSetItem", [("flags", String(describing: flags)), ("document", String(describing: document)), ("emoji", String(describing: emoji)), ("maskCoords", String(describing: maskCoords))])
}
}
public static func parse_inputStickerSetItem(_ reader: BufferReader) -> InputStickerSetItem? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.InputDocument?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.InputDocument
}
var _3: String?
_3 = parseString(reader)
var _4: Api.MaskCoords?
if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() {
_4 = Api.parse(reader, signature: signature) as? Api.MaskCoords
} }
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.InputStickerSetItem.inputStickerSetItem(flags: _1!, document: _2!, emoji: _3!, maskCoords: _4)
}
else {
return nil
}
}
}
}
public extension Api {
enum InputStickeredMedia: TypeConstructorDescription {
case inputStickeredMediaDocument(id: Api.InputDocument)
case inputStickeredMediaPhoto(id: Api.InputPhoto)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputStickeredMediaDocument(let id):
if boxed {
buffer.appendInt32(70813275)
}
id.serialize(buffer, true)
break
case .inputStickeredMediaPhoto(let id):
if boxed {
buffer.appendInt32(1251549527)
}
id.serialize(buffer, true)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputStickeredMediaDocument(let id):
return ("inputStickeredMediaDocument", [("id", String(describing: id))])
case .inputStickeredMediaPhoto(let id):
return ("inputStickeredMediaPhoto", [("id", String(describing: id))])
}
}
public static func parse_inputStickeredMediaDocument(_ reader: BufferReader) -> InputStickeredMedia? {
var _1: Api.InputDocument?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.InputDocument
}
let _c1 = _1 != nil
if _c1 {
return Api.InputStickeredMedia.inputStickeredMediaDocument(id: _1!)
}
else {
return nil
}
}
public static func parse_inputStickeredMediaPhoto(_ reader: BufferReader) -> InputStickeredMedia? {
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.InputStickeredMedia.inputStickeredMediaPhoto(id: _1!)
}
else {
return nil
}
}
}
}
public extension Api {
enum InputStorePaymentPurpose: TypeConstructorDescription {
case inputStorePaymentGiftPremium(userId: Api.InputUser, currency: String, amount: Int64)
case inputStorePaymentPremiumSubscription(flags: Int32)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputStorePaymentGiftPremium(let userId, let currency, let amount):
if boxed {
buffer.appendInt32(1634697192)
}
userId.serialize(buffer, true)
serializeString(currency, buffer: buffer, boxed: false)
serializeInt64(amount, buffer: buffer, boxed: false)
break
case .inputStorePaymentPremiumSubscription(let flags):
if boxed {
buffer.appendInt32(-1502273946)
}
serializeInt32(flags, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputStorePaymentGiftPremium(let userId, let currency, let amount):
return ("inputStorePaymentGiftPremium", [("userId", String(describing: userId)), ("currency", String(describing: currency)), ("amount", String(describing: amount))])
case .inputStorePaymentPremiumSubscription(let flags):
return ("inputStorePaymentPremiumSubscription", [("flags", String(describing: flags))])
}
}
public static func parse_inputStorePaymentGiftPremium(_ reader: BufferReader) -> InputStorePaymentPurpose? {
var _1: Api.InputUser?
if let signature = reader.readInt32() {
_1 = Api.parse(reader, signature: signature) as? Api.InputUser
}
var _2: String?
_2 = parseString(reader)
var _3: Int64?
_3 = reader.readInt64()
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
if _c1 && _c2 && _c3 {
return Api.InputStorePaymentPurpose.inputStorePaymentGiftPremium(userId: _1!, currency: _2!, amount: _3!)
}
else {
return nil
}
}
public static func parse_inputStorePaymentPremiumSubscription(_ reader: BufferReader) -> InputStorePaymentPurpose? {
var _1: Int32?
_1 = reader.readInt32()
let _c1 = _1 != nil
if _c1 {
return Api.InputStorePaymentPurpose.inputStorePaymentPremiumSubscription(flags: _1!)
}
else {
return nil
}
}
}
}
public extension Api {
enum InputTheme: TypeConstructorDescription {
case inputTheme(id: Int64, accessHash: Int64)
case inputThemeSlug(slug: String)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputTheme(let id, let accessHash):
if boxed {
buffer.appendInt32(1012306921)
}
serializeInt64(id, buffer: buffer, boxed: false)
serializeInt64(accessHash, buffer: buffer, boxed: false)
break
case .inputThemeSlug(let slug):
if boxed {
buffer.appendInt32(-175567375)
}
serializeString(slug, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputTheme(let id, let accessHash):
return ("inputTheme", [("id", String(describing: id)), ("accessHash", String(describing: accessHash))])
case .inputThemeSlug(let slug):
return ("inputThemeSlug", [("slug", String(describing: slug))])
}
}
public static func parse_inputTheme(_ reader: BufferReader) -> InputTheme? {
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.InputTheme.inputTheme(id: _1!, accessHash: _2!)
}
else {
return nil
}
}
public static func parse_inputThemeSlug(_ reader: BufferReader) -> InputTheme? {
var _1: String?
_1 = parseString(reader)
let _c1 = _1 != nil
if _c1 {
return Api.InputTheme.inputThemeSlug(slug: _1!)
}
else {
return nil
}
}
}
}
public extension Api {
enum InputThemeSettings: TypeConstructorDescription {
case inputThemeSettings(flags: Int32, baseTheme: Api.BaseTheme, accentColor: Int32, outboxAccentColor: Int32?, messageColors: [Int32]?, wallpaper: Api.InputWallPaper?, wallpaperSettings: Api.WallPaperSettings?)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputThemeSettings(let flags, let baseTheme, let accentColor, let outboxAccentColor, let messageColors, let wallpaper, let wallpaperSettings):
if boxed {
buffer.appendInt32(-1881255857)
}
serializeInt32(flags, buffer: buffer, boxed: false)
baseTheme.serialize(buffer, true)
serializeInt32(accentColor, buffer: buffer, boxed: false)
if Int(flags) & Int(1 << 3) != 0 {serializeInt32(outboxAccentColor!, buffer: buffer, boxed: false)}
if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261)
buffer.appendInt32(Int32(messageColors!.count))
for item in messageColors! {
serializeInt32(item, buffer: buffer, boxed: false)
}}
if Int(flags) & Int(1 << 1) != 0 {wallpaper!.serialize(buffer, true)}
if Int(flags) & Int(1 << 1) != 0 {wallpaperSettings!.serialize(buffer, true)}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputThemeSettings(let flags, let baseTheme, let accentColor, let outboxAccentColor, let messageColors, let wallpaper, let wallpaperSettings):
return ("inputThemeSettings", [("flags", String(describing: flags)), ("baseTheme", String(describing: baseTheme)), ("accentColor", String(describing: accentColor)), ("outboxAccentColor", String(describing: outboxAccentColor)), ("messageColors", String(describing: messageColors)), ("wallpaper", String(describing: wallpaper)), ("wallpaperSettings", String(describing: wallpaperSettings))])
}
}
public static func parse_inputThemeSettings(_ reader: BufferReader) -> InputThemeSettings? {
var _1: Int32?
_1 = reader.readInt32()
var _2: Api.BaseTheme?
if let signature = reader.readInt32() {
_2 = Api.parse(reader, signature: signature) as? Api.BaseTheme
}
var _3: Int32?
_3 = reader.readInt32()
var _4: Int32?
if Int(_1!) & Int(1 << 3) != 0 {_4 = reader.readInt32() }
var _5: [Int32]?
if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() {
_5 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self)
} }
var _6: Api.InputWallPaper?
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
_6 = Api.parse(reader, signature: signature) as? Api.InputWallPaper
} }
var _7: Api.WallPaperSettings?
if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() {
_7 = Api.parse(reader, signature: signature) as? Api.WallPaperSettings
} }
let _c1 = _1 != nil
let _c2 = _2 != nil
let _c3 = _3 != nil
let _c4 = (Int(_1!) & Int(1 << 3) == 0) || _4 != nil
let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil
let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil
let _c7 = (Int(_1!) & Int(1 << 1) == 0) || _7 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
return Api.InputThemeSettings.inputThemeSettings(flags: _1!, baseTheme: _2!, accentColor: _3!, outboxAccentColor: _4, messageColors: _5, wallpaper: _6, wallpaperSettings: _7)
}
else {
return nil
}
}
}
}
public extension Api {
enum InputUser: TypeConstructorDescription {
case inputUser(userId: Int64, accessHash: Int64)
case inputUserEmpty
case inputUserFromMessage(peer: Api.InputPeer, msgId: Int32, userId: Int64)
case inputUserSelf
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputUser(let userId, let accessHash):
if boxed {
buffer.appendInt32(-233744186)
}
serializeInt64(userId, buffer: buffer, boxed: false)
serializeInt64(accessHash, buffer: buffer, boxed: false)
break
case .inputUserEmpty:
if boxed {
buffer.appendInt32(-1182234929)
}
break
case .inputUserFromMessage(let peer, let msgId, let userId):
if boxed {
buffer.appendInt32(497305826)
}
peer.serialize(buffer, true)
serializeInt32(msgId, buffer: buffer, boxed: false)
serializeInt64(userId, buffer: buffer, boxed: false)
break
case .inputUserSelf:
if boxed {
buffer.appendInt32(-138301121)
}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputUser(let userId, let accessHash):
return ("inputUser", [("userId", String(describing: userId)), ("accessHash", String(describing: accessHash))])
case .inputUserEmpty:
return ("inputUserEmpty", [])
case .inputUserFromMessage(let peer, let msgId, let userId):
return ("inputUserFromMessage", [("peer", String(describing: peer)), ("msgId", String(describing: msgId)), ("userId", String(describing: userId))])
case .inputUserSelf:
return ("inputUserSelf", [])
}
}
public static func parse_inputUser(_ reader: BufferReader) -> InputUser? {
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.InputUser.inputUser(userId: _1!, accessHash: _2!)
}
else {
return nil
}
}
public static func parse_inputUserEmpty(_ reader: BufferReader) -> InputUser? {
return Api.InputUser.inputUserEmpty
}
public static func parse_inputUserFromMessage(_ reader: BufferReader) -> InputUser? {
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.InputUser.inputUserFromMessage(peer: _1!, msgId: _2!, userId: _3!)
}
else {
return nil
}
}
public static func parse_inputUserSelf(_ reader: BufferReader) -> InputUser? {
return Api.InputUser.inputUserSelf
}
}
}
public extension Api {
enum InputWallPaper: TypeConstructorDescription {
case inputWallPaper(id: Int64, accessHash: Int64)
case inputWallPaperNoFile(id: Int64)
case inputWallPaperSlug(slug: String)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .inputWallPaper(let id, let accessHash):
if boxed {
buffer.appendInt32(-433014407)
}
serializeInt64(id, buffer: buffer, boxed: false)
serializeInt64(accessHash, buffer: buffer, boxed: false)
break
case .inputWallPaperNoFile(let id):
if boxed {
buffer.appendInt32(-1770371538)
}
serializeInt64(id, buffer: buffer, boxed: false)
break
case .inputWallPaperSlug(let slug):
if boxed {
buffer.appendInt32(1913199744)
}
serializeString(slug, buffer: buffer, boxed: false)
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .inputWallPaper(let id, let accessHash):
return ("inputWallPaper", [("id", String(describing: id)), ("accessHash", String(describing: accessHash))])
case .inputWallPaperNoFile(let id):
return ("inputWallPaperNoFile", [("id", String(describing: id))])
case .inputWallPaperSlug(let slug):
return ("inputWallPaperSlug", [("slug", String(describing: slug))])
}
}
public static func parse_inputWallPaper(_ reader: BufferReader) -> InputWallPaper? {
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.InputWallPaper.inputWallPaper(id: _1!, accessHash: _2!)
}
else {
return nil
}
}
public static func parse_inputWallPaperNoFile(_ reader: BufferReader) -> InputWallPaper? {
var _1: Int64?
_1 = reader.readInt64()
let _c1 = _1 != nil
if _c1 {
return Api.InputWallPaper.inputWallPaperNoFile(id: _1!)
}
else {
return nil
}
}
public static func parse_inputWallPaperSlug(_ reader: BufferReader) -> InputWallPaper? {
var _1: String?
_1 = parseString(reader)
let _c1 = _1 != nil
if _c1 {
return Api.InputWallPaper.inputWallPaperSlug(slug: _1!)
}
else {
return nil
}
}
}
}