mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
1369 lines
54 KiB
Swift
1369 lines
54 KiB
Swift
public extension Api.help {
|
|
enum CountryCode: TypeConstructorDescription {
|
|
case countryCode(flags: Int32, countryCode: String, prefixes: [String]?, patterns: [String]?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .countryCode(let flags, let countryCode, let prefixes, let patterns):
|
|
if boxed {
|
|
buffer.appendInt32(1107543535)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(countryCode, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(prefixes!.count))
|
|
for item in prefixes! {
|
|
serializeString(item, buffer: buffer, boxed: false)
|
|
}}
|
|
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(patterns!.count))
|
|
for item in patterns! {
|
|
serializeString(item, buffer: buffer, boxed: false)
|
|
}}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .countryCode(let flags, let countryCode, let prefixes, let patterns):
|
|
return ("countryCode", [("flags", String(describing: flags)), ("countryCode", String(describing: countryCode)), ("prefixes", String(describing: prefixes)), ("patterns", String(describing: patterns))])
|
|
}
|
|
}
|
|
|
|
public static func parse_countryCode(_ reader: BufferReader) -> CountryCode? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: [String]?
|
|
if Int(_1!) & Int(1 << 0) != 0 {if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self)
|
|
} }
|
|
var _4: [String]?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() {
|
|
_4 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self)
|
|
} }
|
|
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
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.help.CountryCode.countryCode(flags: _1!, countryCode: _2!, prefixes: _3, patterns: _4)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum DeepLinkInfo: TypeConstructorDescription {
|
|
case deepLinkInfo(flags: Int32, message: String, entities: [Api.MessageEntity]?)
|
|
case deepLinkInfoEmpty
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .deepLinkInfo(let flags, let message, let entities):
|
|
if boxed {
|
|
buffer.appendInt32(1783556146)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeString(message, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 1) != 0 {buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(entities!.count))
|
|
for item in entities! {
|
|
item.serialize(buffer, true)
|
|
}}
|
|
break
|
|
case .deepLinkInfoEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(1722786150)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .deepLinkInfo(let flags, let message, let entities):
|
|
return ("deepLinkInfo", [("flags", String(describing: flags)), ("message", String(describing: message)), ("entities", String(describing: entities))])
|
|
case .deepLinkInfoEmpty:
|
|
return ("deepLinkInfoEmpty", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_deepLinkInfo(_ reader: BufferReader) -> DeepLinkInfo? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: [Api.MessageEntity]?
|
|
if Int(_1!) & Int(1 << 1) != 0 {if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
} }
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.help.DeepLinkInfo.deepLinkInfo(flags: _1!, message: _2!, entities: _3)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_deepLinkInfoEmpty(_ reader: BufferReader) -> DeepLinkInfo? {
|
|
return Api.help.DeepLinkInfo.deepLinkInfoEmpty
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum InviteText: TypeConstructorDescription {
|
|
case inviteText(message: String)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inviteText(let message):
|
|
if boxed {
|
|
buffer.appendInt32(415997816)
|
|
}
|
|
serializeString(message, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .inviteText(let message):
|
|
return ("inviteText", [("message", String(describing: message))])
|
|
}
|
|
}
|
|
|
|
public static func parse_inviteText(_ reader: BufferReader) -> InviteText? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.help.InviteText.inviteText(message: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum PassportConfig: TypeConstructorDescription {
|
|
case passportConfig(hash: Int32, countriesLangs: Api.DataJSON)
|
|
case passportConfigNotModified
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .passportConfig(let hash, let countriesLangs):
|
|
if boxed {
|
|
buffer.appendInt32(-1600596305)
|
|
}
|
|
serializeInt32(hash, buffer: buffer, boxed: false)
|
|
countriesLangs.serialize(buffer, true)
|
|
break
|
|
case .passportConfigNotModified:
|
|
if boxed {
|
|
buffer.appendInt32(-1078332329)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .passportConfig(let hash, let countriesLangs):
|
|
return ("passportConfig", [("hash", String(describing: hash)), ("countriesLangs", String(describing: countriesLangs))])
|
|
case .passportConfigNotModified:
|
|
return ("passportConfigNotModified", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_passportConfig(_ reader: BufferReader) -> PassportConfig? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.DataJSON?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.DataJSON
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.help.PassportConfig.passportConfig(hash: _1!, countriesLangs: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_passportConfigNotModified(_ reader: BufferReader) -> PassportConfig? {
|
|
return Api.help.PassportConfig.passportConfigNotModified
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum PremiumPromo: TypeConstructorDescription {
|
|
case premiumPromo(statusText: String, statusEntities: [Api.MessageEntity], videoSections: [String], videos: [Api.Document], currency: String, monthlyAmount: Int64)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .premiumPromo(let statusText, let statusEntities, let videoSections, let videos, let currency, let monthlyAmount):
|
|
if boxed {
|
|
buffer.appendInt32(-533328101)
|
|
}
|
|
serializeString(statusText, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(statusEntities.count))
|
|
for item in statusEntities {
|
|
item.serialize(buffer, true)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(videoSections.count))
|
|
for item in videoSections {
|
|
serializeString(item, buffer: buffer, boxed: false)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(videos.count))
|
|
for item in videos {
|
|
item.serialize(buffer, true)
|
|
}
|
|
serializeString(currency, buffer: buffer, boxed: false)
|
|
serializeInt64(monthlyAmount, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .premiumPromo(let statusText, let statusEntities, let videoSections, let videos, let currency, let monthlyAmount):
|
|
return ("premiumPromo", [("statusText", String(describing: statusText)), ("statusEntities", String(describing: statusEntities)), ("videoSections", String(describing: videoSections)), ("videos", String(describing: videos)), ("currency", String(describing: currency)), ("monthlyAmount", String(describing: monthlyAmount))])
|
|
}
|
|
}
|
|
|
|
public static func parse_premiumPromo(_ reader: BufferReader) -> PremiumPromo? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: [Api.MessageEntity]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
}
|
|
var _3: [String]?
|
|
if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self)
|
|
}
|
|
var _4: [Api.Document]?
|
|
if let _ = reader.readInt32() {
|
|
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Document.self)
|
|
}
|
|
var _5: String?
|
|
_5 = parseString(reader)
|
|
var _6: Int64?
|
|
_6 = reader.readInt64()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
let _c5 = _5 != nil
|
|
let _c6 = _6 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
|
return Api.help.PremiumPromo.premiumPromo(statusText: _1!, statusEntities: _2!, videoSections: _3!, videos: _4!, currency: _5!, monthlyAmount: _6!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum PromoData: TypeConstructorDescription {
|
|
case promoData(flags: Int32, expires: Int32, peer: Api.Peer, chats: [Api.Chat], users: [Api.User], psaType: String?, psaMessage: String?)
|
|
case promoDataEmpty(expires: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .promoData(let flags, let expires, let peer, let chats, let users, let psaType, let psaMessage):
|
|
if boxed {
|
|
buffer.appendInt32(-1942390465)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeInt32(expires, buffer: buffer, boxed: false)
|
|
peer.serialize(buffer, true)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(chats.count))
|
|
for item in chats {
|
|
item.serialize(buffer, true)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(users.count))
|
|
for item in users {
|
|
item.serialize(buffer, true)
|
|
}
|
|
if Int(flags) & Int(1 << 1) != 0 {serializeString(psaType!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 2) != 0 {serializeString(psaMessage!, buffer: buffer, boxed: false)}
|
|
break
|
|
case .promoDataEmpty(let expires):
|
|
if boxed {
|
|
buffer.appendInt32(-1728664459)
|
|
}
|
|
serializeInt32(expires, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .promoData(let flags, let expires, let peer, let chats, let users, let psaType, let psaMessage):
|
|
return ("promoData", [("flags", String(describing: flags)), ("expires", String(describing: expires)), ("peer", String(describing: peer)), ("chats", String(describing: chats)), ("users", String(describing: users)), ("psaType", String(describing: psaType)), ("psaMessage", String(describing: psaMessage))])
|
|
case .promoDataEmpty(let expires):
|
|
return ("promoDataEmpty", [("expires", String(describing: expires))])
|
|
}
|
|
}
|
|
|
|
public static func parse_promoData(_ reader: BufferReader) -> PromoData? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: Api.Peer?
|
|
if let signature = reader.readInt32() {
|
|
_3 = Api.parse(reader, signature: signature) as? Api.Peer
|
|
}
|
|
var _4: [Api.Chat]?
|
|
if let _ = reader.readInt32() {
|
|
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
|
}
|
|
var _5: [Api.User]?
|
|
if let _ = reader.readInt32() {
|
|
_5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
|
}
|
|
var _6: String?
|
|
if Int(_1!) & Int(1 << 1) != 0 {_6 = parseString(reader) }
|
|
var _7: String?
|
|
if Int(_1!) & Int(1 << 2) != 0 {_7 = parseString(reader) }
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
let _c5 = _5 != nil
|
|
let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
|
return Api.help.PromoData.promoData(flags: _1!, expires: _2!, peer: _3!, chats: _4!, users: _5!, psaType: _6, psaMessage: _7)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_promoDataEmpty(_ reader: BufferReader) -> PromoData? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.help.PromoData.promoDataEmpty(expires: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum RecentMeUrls: TypeConstructorDescription {
|
|
case recentMeUrls(urls: [Api.RecentMeUrl], chats: [Api.Chat], users: [Api.User])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .recentMeUrls(let urls, let chats, let users):
|
|
if boxed {
|
|
buffer.appendInt32(235081943)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(urls.count))
|
|
for item in urls {
|
|
item.serialize(buffer, true)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(chats.count))
|
|
for item in chats {
|
|
item.serialize(buffer, true)
|
|
}
|
|
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 .recentMeUrls(let urls, let chats, let users):
|
|
return ("recentMeUrls", [("urls", String(describing: urls)), ("chats", String(describing: chats)), ("users", String(describing: users))])
|
|
}
|
|
}
|
|
|
|
public static func parse_recentMeUrls(_ reader: BufferReader) -> RecentMeUrls? {
|
|
var _1: [Api.RecentMeUrl]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.RecentMeUrl.self)
|
|
}
|
|
var _2: [Api.Chat]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
|
}
|
|
var _3: [Api.User]?
|
|
if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.help.RecentMeUrls.recentMeUrls(urls: _1!, chats: _2!, users: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum Support: TypeConstructorDescription {
|
|
case support(phoneNumber: String, user: Api.User)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .support(let phoneNumber, let user):
|
|
if boxed {
|
|
buffer.appendInt32(398898678)
|
|
}
|
|
serializeString(phoneNumber, buffer: buffer, boxed: false)
|
|
user.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .support(let phoneNumber, let user):
|
|
return ("support", [("phoneNumber", String(describing: phoneNumber)), ("user", String(describing: user))])
|
|
}
|
|
}
|
|
|
|
public static func parse_support(_ reader: BufferReader) -> Support? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: Api.User?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.User
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.help.Support.support(phoneNumber: _1!, user: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum SupportName: TypeConstructorDescription {
|
|
case supportName(name: String)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .supportName(let name):
|
|
if boxed {
|
|
buffer.appendInt32(-1945767479)
|
|
}
|
|
serializeString(name, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .supportName(let name):
|
|
return ("supportName", [("name", String(describing: name))])
|
|
}
|
|
}
|
|
|
|
public static func parse_supportName(_ reader: BufferReader) -> SupportName? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.help.SupportName.supportName(name: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum TermsOfService: TypeConstructorDescription {
|
|
case termsOfService(flags: Int32, id: Api.DataJSON, text: String, entities: [Api.MessageEntity], minAgeConfirm: Int32?)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .termsOfService(let flags, let id, let text, let entities, let minAgeConfirm):
|
|
if boxed {
|
|
buffer.appendInt32(2013922064)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
id.serialize(buffer, true)
|
|
serializeString(text, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(entities.count))
|
|
for item in entities {
|
|
item.serialize(buffer, true)
|
|
}
|
|
if Int(flags) & Int(1 << 1) != 0 {serializeInt32(minAgeConfirm!, buffer: buffer, boxed: false)}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .termsOfService(let flags, let id, let text, let entities, let minAgeConfirm):
|
|
return ("termsOfService", [("flags", String(describing: flags)), ("id", String(describing: id)), ("text", String(describing: text)), ("entities", String(describing: entities)), ("minAgeConfirm", String(describing: minAgeConfirm))])
|
|
}
|
|
}
|
|
|
|
public static func parse_termsOfService(_ reader: BufferReader) -> TermsOfService? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.DataJSON?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.DataJSON
|
|
}
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: [Api.MessageEntity]?
|
|
if let _ = reader.readInt32() {
|
|
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
}
|
|
var _5: Int32?
|
|
if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() }
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
|
return Api.help.TermsOfService.termsOfService(flags: _1!, id: _2!, text: _3!, entities: _4!, minAgeConfirm: _5)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum TermsOfServiceUpdate: TypeConstructorDescription {
|
|
case termsOfServiceUpdate(expires: Int32, termsOfService: Api.help.TermsOfService)
|
|
case termsOfServiceUpdateEmpty(expires: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .termsOfServiceUpdate(let expires, let termsOfService):
|
|
if boxed {
|
|
buffer.appendInt32(686618977)
|
|
}
|
|
serializeInt32(expires, buffer: buffer, boxed: false)
|
|
termsOfService.serialize(buffer, true)
|
|
break
|
|
case .termsOfServiceUpdateEmpty(let expires):
|
|
if boxed {
|
|
buffer.appendInt32(-483352705)
|
|
}
|
|
serializeInt32(expires, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .termsOfServiceUpdate(let expires, let termsOfService):
|
|
return ("termsOfServiceUpdate", [("expires", String(describing: expires)), ("termsOfService", String(describing: termsOfService))])
|
|
case .termsOfServiceUpdateEmpty(let expires):
|
|
return ("termsOfServiceUpdateEmpty", [("expires", String(describing: expires))])
|
|
}
|
|
}
|
|
|
|
public static func parse_termsOfServiceUpdate(_ reader: BufferReader) -> TermsOfServiceUpdate? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.help.TermsOfService?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.help.TermsOfService
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.help.TermsOfServiceUpdate.termsOfServiceUpdate(expires: _1!, termsOfService: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_termsOfServiceUpdateEmpty(_ reader: BufferReader) -> TermsOfServiceUpdate? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.help.TermsOfServiceUpdate.termsOfServiceUpdateEmpty(expires: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.help {
|
|
enum UserInfo: TypeConstructorDescription {
|
|
case userInfo(message: String, entities: [Api.MessageEntity], author: String, date: Int32)
|
|
case userInfoEmpty
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .userInfo(let message, let entities, let author, let date):
|
|
if boxed {
|
|
buffer.appendInt32(32192344)
|
|
}
|
|
serializeString(message, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(entities.count))
|
|
for item in entities {
|
|
item.serialize(buffer, true)
|
|
}
|
|
serializeString(author, buffer: buffer, boxed: false)
|
|
serializeInt32(date, buffer: buffer, boxed: false)
|
|
break
|
|
case .userInfoEmpty:
|
|
if boxed {
|
|
buffer.appendInt32(-206688531)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .userInfo(let message, let entities, let author, let date):
|
|
return ("userInfo", [("message", String(describing: message)), ("entities", String(describing: entities)), ("author", String(describing: author)), ("date", String(describing: date))])
|
|
case .userInfoEmpty:
|
|
return ("userInfoEmpty", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_userInfo(_ reader: BufferReader) -> UserInfo? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: [Api.MessageEntity]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.MessageEntity.self)
|
|
}
|
|
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.help.UserInfo.userInfo(message: _1!, entities: _2!, author: _3!, date: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_userInfoEmpty(_ reader: BufferReader) -> UserInfo? {
|
|
return Api.help.UserInfo.userInfoEmpty
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum AffectedFoundMessages: TypeConstructorDescription {
|
|
case affectedFoundMessages(pts: Int32, ptsCount: Int32, offset: Int32, messages: [Int32])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .affectedFoundMessages(let pts, let ptsCount, let offset, let messages):
|
|
if boxed {
|
|
buffer.appendInt32(-275956116)
|
|
}
|
|
serializeInt32(pts, buffer: buffer, boxed: false)
|
|
serializeInt32(ptsCount, buffer: buffer, boxed: false)
|
|
serializeInt32(offset, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(messages.count))
|
|
for item in messages {
|
|
serializeInt32(item, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .affectedFoundMessages(let pts, let ptsCount, let offset, let messages):
|
|
return ("affectedFoundMessages", [("pts", String(describing: pts)), ("ptsCount", String(describing: ptsCount)), ("offset", String(describing: offset)), ("messages", String(describing: messages))])
|
|
}
|
|
}
|
|
|
|
public static func parse_affectedFoundMessages(_ reader: BufferReader) -> AffectedFoundMessages? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: Int32?
|
|
_3 = reader.readInt32()
|
|
var _4: [Int32]?
|
|
if let _ = reader.readInt32() {
|
|
_4 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.messages.AffectedFoundMessages.affectedFoundMessages(pts: _1!, ptsCount: _2!, offset: _3!, messages: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum AffectedHistory: TypeConstructorDescription {
|
|
case affectedHistory(pts: Int32, ptsCount: Int32, offset: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .affectedHistory(let pts, let ptsCount, let offset):
|
|
if boxed {
|
|
buffer.appendInt32(-1269012015)
|
|
}
|
|
serializeInt32(pts, buffer: buffer, boxed: false)
|
|
serializeInt32(ptsCount, buffer: buffer, boxed: false)
|
|
serializeInt32(offset, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .affectedHistory(let pts, let ptsCount, let offset):
|
|
return ("affectedHistory", [("pts", String(describing: pts)), ("ptsCount", String(describing: ptsCount)), ("offset", String(describing: offset))])
|
|
}
|
|
}
|
|
|
|
public static func parse_affectedHistory(_ reader: BufferReader) -> AffectedHistory? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
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.messages.AffectedHistory.affectedHistory(pts: _1!, ptsCount: _2!, offset: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum AffectedMessages: TypeConstructorDescription {
|
|
case affectedMessages(pts: Int32, ptsCount: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .affectedMessages(let pts, let ptsCount):
|
|
if boxed {
|
|
buffer.appendInt32(-2066640507)
|
|
}
|
|
serializeInt32(pts, buffer: buffer, boxed: false)
|
|
serializeInt32(ptsCount, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .affectedMessages(let pts, let ptsCount):
|
|
return ("affectedMessages", [("pts", String(describing: pts)), ("ptsCount", String(describing: ptsCount))])
|
|
}
|
|
}
|
|
|
|
public static func parse_affectedMessages(_ reader: BufferReader) -> AffectedMessages? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.messages.AffectedMessages.affectedMessages(pts: _1!, ptsCount: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum AllStickers: TypeConstructorDescription {
|
|
case allStickers(hash: Int64, sets: [Api.StickerSet])
|
|
case allStickersNotModified
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .allStickers(let hash, let sets):
|
|
if boxed {
|
|
buffer.appendInt32(-843329861)
|
|
}
|
|
serializeInt64(hash, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(sets.count))
|
|
for item in sets {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
case .allStickersNotModified:
|
|
if boxed {
|
|
buffer.appendInt32(-395967805)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .allStickers(let hash, let sets):
|
|
return ("allStickers", [("hash", String(describing: hash)), ("sets", String(describing: sets))])
|
|
case .allStickersNotModified:
|
|
return ("allStickersNotModified", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_allStickers(_ reader: BufferReader) -> AllStickers? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: [Api.StickerSet]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSet.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.messages.AllStickers.allStickers(hash: _1!, sets: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_allStickersNotModified(_ reader: BufferReader) -> AllStickers? {
|
|
return Api.messages.AllStickers.allStickersNotModified
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum ArchivedStickers: TypeConstructorDescription {
|
|
case archivedStickers(count: Int32, sets: [Api.StickerSetCovered])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .archivedStickers(let count, let sets):
|
|
if boxed {
|
|
buffer.appendInt32(1338747336)
|
|
}
|
|
serializeInt32(count, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(sets.count))
|
|
for item in sets {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .archivedStickers(let count, let sets):
|
|
return ("archivedStickers", [("count", String(describing: count)), ("sets", String(describing: sets))])
|
|
}
|
|
}
|
|
|
|
public static func parse_archivedStickers(_ reader: BufferReader) -> ArchivedStickers? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Api.StickerSetCovered]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StickerSetCovered.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.messages.ArchivedStickers.archivedStickers(count: _1!, sets: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum AvailableReactions: TypeConstructorDescription {
|
|
case availableReactions(hash: Int32, reactions: [Api.AvailableReaction])
|
|
case availableReactionsNotModified
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .availableReactions(let hash, let reactions):
|
|
if boxed {
|
|
buffer.appendInt32(1989032621)
|
|
}
|
|
serializeInt32(hash, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(reactions.count))
|
|
for item in reactions {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
case .availableReactionsNotModified:
|
|
if boxed {
|
|
buffer.appendInt32(-1626924713)
|
|
}
|
|
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .availableReactions(let hash, let reactions):
|
|
return ("availableReactions", [("hash", String(describing: hash)), ("reactions", String(describing: reactions))])
|
|
case .availableReactionsNotModified:
|
|
return ("availableReactionsNotModified", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_availableReactions(_ reader: BufferReader) -> AvailableReactions? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Api.AvailableReaction]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.AvailableReaction.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.messages.AvailableReactions.availableReactions(hash: _1!, reactions: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_availableReactionsNotModified(_ reader: BufferReader) -> AvailableReactions? {
|
|
return Api.messages.AvailableReactions.availableReactionsNotModified
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum BotCallbackAnswer: TypeConstructorDescription {
|
|
case botCallbackAnswer(flags: Int32, message: String?, url: String?, cacheTime: Int32)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .botCallbackAnswer(let flags, let message, let url, let cacheTime):
|
|
if boxed {
|
|
buffer.appendInt32(911761060)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 0) != 0 {serializeString(message!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 2) != 0 {serializeString(url!, buffer: buffer, boxed: false)}
|
|
serializeInt32(cacheTime, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .botCallbackAnswer(let flags, let message, let url, let cacheTime):
|
|
return ("botCallbackAnswer", [("flags", String(describing: flags)), ("message", String(describing: message)), ("url", String(describing: url)), ("cacheTime", String(describing: cacheTime))])
|
|
}
|
|
}
|
|
|
|
public static func parse_botCallbackAnswer(_ reader: BufferReader) -> BotCallbackAnswer? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
if Int(_1!) & Int(1 << 0) != 0 {_2 = parseString(reader) }
|
|
var _3: String?
|
|
if Int(_1!) & Int(1 << 2) != 0 {_3 = parseString(reader) }
|
|
var _4: Int32?
|
|
_4 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 2) == 0) || _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.messages.BotCallbackAnswer.botCallbackAnswer(flags: _1!, message: _2, url: _3, cacheTime: _4!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum BotResults: TypeConstructorDescription {
|
|
case botResults(flags: Int32, queryId: Int64, nextOffset: String?, switchPm: Api.InlineBotSwitchPM?, results: [Api.BotInlineResult], cacheTime: Int32, users: [Api.User])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .botResults(let flags, let queryId, let nextOffset, let switchPm, let results, let cacheTime, let users):
|
|
if boxed {
|
|
buffer.appendInt32(-1803769784)
|
|
}
|
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
serializeInt64(queryId, buffer: buffer, boxed: false)
|
|
if Int(flags) & Int(1 << 1) != 0 {serializeString(nextOffset!, buffer: buffer, boxed: false)}
|
|
if Int(flags) & Int(1 << 2) != 0 {switchPm!.serialize(buffer, true)}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(results.count))
|
|
for item in results {
|
|
item.serialize(buffer, true)
|
|
}
|
|
serializeInt32(cacheTime, buffer: buffer, boxed: false)
|
|
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 .botResults(let flags, let queryId, let nextOffset, let switchPm, let results, let cacheTime, let users):
|
|
return ("botResults", [("flags", String(describing: flags)), ("queryId", String(describing: queryId)), ("nextOffset", String(describing: nextOffset)), ("switchPm", String(describing: switchPm)), ("results", String(describing: results)), ("cacheTime", String(describing: cacheTime)), ("users", String(describing: users))])
|
|
}
|
|
}
|
|
|
|
public static func parse_botResults(_ reader: BufferReader) -> BotResults? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int64?
|
|
_2 = reader.readInt64()
|
|
var _3: String?
|
|
if Int(_1!) & Int(1 << 1) != 0 {_3 = parseString(reader) }
|
|
var _4: Api.InlineBotSwitchPM?
|
|
if Int(_1!) & Int(1 << 2) != 0 {if let signature = reader.readInt32() {
|
|
_4 = Api.parse(reader, signature: signature) as? Api.InlineBotSwitchPM
|
|
} }
|
|
var _5: [Api.BotInlineResult]?
|
|
if let _ = reader.readInt32() {
|
|
_5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.BotInlineResult.self)
|
|
}
|
|
var _6: Int32?
|
|
_6 = reader.readInt32()
|
|
var _7: [Api.User]?
|
|
if let _ = reader.readInt32() {
|
|
_7 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
|
let _c5 = _5 != nil
|
|
let _c6 = _6 != nil
|
|
let _c7 = _7 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
|
return Api.messages.BotResults.botResults(flags: _1!, queryId: _2!, nextOffset: _3, switchPm: _4, results: _5!, cacheTime: _6!, users: _7!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum ChatAdminsWithInvites: TypeConstructorDescription {
|
|
case chatAdminsWithInvites(admins: [Api.ChatAdminWithInvites], users: [Api.User])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .chatAdminsWithInvites(let admins, let users):
|
|
if boxed {
|
|
buffer.appendInt32(-1231326505)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(admins.count))
|
|
for item in admins {
|
|
item.serialize(buffer, true)
|
|
}
|
|
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 .chatAdminsWithInvites(let admins, let users):
|
|
return ("chatAdminsWithInvites", [("admins", String(describing: admins)), ("users", String(describing: users))])
|
|
}
|
|
}
|
|
|
|
public static func parse_chatAdminsWithInvites(_ reader: BufferReader) -> ChatAdminsWithInvites? {
|
|
var _1: [Api.ChatAdminWithInvites]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatAdminWithInvites.self)
|
|
}
|
|
var _2: [Api.User]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.messages.ChatAdminsWithInvites.chatAdminsWithInvites(admins: _1!, users: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum ChatFull: TypeConstructorDescription {
|
|
case chatFull(fullChat: Api.ChatFull, chats: [Api.Chat], users: [Api.User])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .chatFull(let fullChat, let chats, let users):
|
|
if boxed {
|
|
buffer.appendInt32(-438840932)
|
|
}
|
|
fullChat.serialize(buffer, true)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(chats.count))
|
|
for item in chats {
|
|
item.serialize(buffer, true)
|
|
}
|
|
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 .chatFull(let fullChat, let chats, let users):
|
|
return ("chatFull", [("fullChat", String(describing: fullChat)), ("chats", String(describing: chats)), ("users", String(describing: users))])
|
|
}
|
|
}
|
|
|
|
public static func parse_chatFull(_ reader: BufferReader) -> ChatFull? {
|
|
var _1: Api.ChatFull?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.ChatFull
|
|
}
|
|
var _2: [Api.Chat]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
|
}
|
|
var _3: [Api.User]?
|
|
if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.messages.ChatFull.chatFull(fullChat: _1!, chats: _2!, users: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum ChatInviteImporters: TypeConstructorDescription {
|
|
case chatInviteImporters(count: Int32, importers: [Api.ChatInviteImporter], users: [Api.User])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .chatInviteImporters(let count, let importers, let users):
|
|
if boxed {
|
|
buffer.appendInt32(-2118733814)
|
|
}
|
|
serializeInt32(count, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(importers.count))
|
|
for item in importers {
|
|
item.serialize(buffer, true)
|
|
}
|
|
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 .chatInviteImporters(let count, let importers, let users):
|
|
return ("chatInviteImporters", [("count", String(describing: count)), ("importers", String(describing: importers)), ("users", String(describing: users))])
|
|
}
|
|
}
|
|
|
|
public static func parse_chatInviteImporters(_ reader: BufferReader) -> ChatInviteImporters? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Api.ChatInviteImporter]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.ChatInviteImporter.self)
|
|
}
|
|
var _3: [Api.User]?
|
|
if let _ = reader.readInt32() {
|
|
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.messages.ChatInviteImporters.chatInviteImporters(count: _1!, importers: _2!, users: _3!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
public extension Api.messages {
|
|
enum Chats: TypeConstructorDescription {
|
|
case chats(chats: [Api.Chat])
|
|
case chatsSlice(count: Int32, chats: [Api.Chat])
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .chats(let chats):
|
|
if boxed {
|
|
buffer.appendInt32(1694474197)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(chats.count))
|
|
for item in chats {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
case .chatsSlice(let count, let chats):
|
|
if boxed {
|
|
buffer.appendInt32(-1663561404)
|
|
}
|
|
serializeInt32(count, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(chats.count))
|
|
for item in chats {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
switch self {
|
|
case .chats(let chats):
|
|
return ("chats", [("chats", String(describing: chats))])
|
|
case .chatsSlice(let count, let chats):
|
|
return ("chatsSlice", [("count", String(describing: count)), ("chats", String(describing: chats))])
|
|
}
|
|
}
|
|
|
|
public static func parse_chats(_ reader: BufferReader) -> Chats? {
|
|
var _1: [Api.Chat]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.messages.Chats.chats(chats: _1!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_chatsSlice(_ reader: BufferReader) -> Chats? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: [Api.Chat]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.messages.Chats.chatsSlice(count: _1!, chats: _2!)
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|