mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Update API
This commit is contained in:
parent
74b5d4998c
commit
e70df961e1
@ -327,6 +327,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[-610373422] = { return Api.InputPrivacyKey.parse_inputPrivacyKeyPhoneP2P($0) }
|
dict[-610373422] = { return Api.InputPrivacyKey.parse_inputPrivacyKeyPhoneP2P($0) }
|
||||||
dict[1461304012] = { return Api.InputPrivacyKey.parse_inputPrivacyKeyProfilePhoto($0) }
|
dict[1461304012] = { return Api.InputPrivacyKey.parse_inputPrivacyKeyProfilePhoto($0) }
|
||||||
dict[1335282456] = { return Api.InputPrivacyKey.parse_inputPrivacyKeyStatusTimestamp($0) }
|
dict[1335282456] = { return Api.InputPrivacyKey.parse_inputPrivacyKeyStatusTimestamp($0) }
|
||||||
|
dict[-1360618136] = { return Api.InputPrivacyKey.parse_inputPrivacyKeyVoiceMessages($0) }
|
||||||
dict[407582158] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowAll($0) }
|
dict[407582158] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowAll($0) }
|
||||||
dict[-2079962673] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowChatParticipants($0) }
|
dict[-2079962673] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowChatParticipants($0) }
|
||||||
dict[218751099] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowContacts($0) }
|
dict[218751099] = { return Api.InputPrivacyRule.parse_inputPrivacyValueAllowContacts($0) }
|
||||||
@ -344,11 +345,12 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[-427863538] = { return Api.InputStickerSet.parse_inputStickerSetDice($0) }
|
dict[-427863538] = { return Api.InputStickerSet.parse_inputStickerSetDice($0) }
|
||||||
dict[-4838507] = { return Api.InputStickerSet.parse_inputStickerSetEmpty($0) }
|
dict[-4838507] = { return Api.InputStickerSet.parse_inputStickerSetEmpty($0) }
|
||||||
dict[-1645763991] = { return Api.InputStickerSet.parse_inputStickerSetID($0) }
|
dict[-1645763991] = { return Api.InputStickerSet.parse_inputStickerSetID($0) }
|
||||||
|
dict[-930399486] = { return Api.InputStickerSet.parse_inputStickerSetPremiumGifts($0) }
|
||||||
dict[-2044933984] = { return Api.InputStickerSet.parse_inputStickerSetShortName($0) }
|
dict[-2044933984] = { return Api.InputStickerSet.parse_inputStickerSetShortName($0) }
|
||||||
dict[-6249322] = { return Api.InputStickerSetItem.parse_inputStickerSetItem($0) }
|
dict[-6249322] = { return Api.InputStickerSetItem.parse_inputStickerSetItem($0) }
|
||||||
dict[70813275] = { return Api.InputStickeredMedia.parse_inputStickeredMediaDocument($0) }
|
dict[70813275] = { return Api.InputStickeredMedia.parse_inputStickeredMediaDocument($0) }
|
||||||
dict[1251549527] = { return Api.InputStickeredMedia.parse_inputStickeredMediaPhoto($0) }
|
dict[1251549527] = { return Api.InputStickeredMedia.parse_inputStickeredMediaPhoto($0) }
|
||||||
dict[1147243133] = { return Api.InputStorePaymentPurpose.parse_inputStorePaymentGiftPremium($0) }
|
dict[1634697192] = { return Api.InputStorePaymentPurpose.parse_inputStorePaymentGiftPremium($0) }
|
||||||
dict[-1502273946] = { return Api.InputStorePaymentPurpose.parse_inputStorePaymentPremiumSubscription($0) }
|
dict[-1502273946] = { return Api.InputStorePaymentPurpose.parse_inputStorePaymentPremiumSubscription($0) }
|
||||||
dict[1012306921] = { return Api.InputTheme.parse_inputTheme($0) }
|
dict[1012306921] = { return Api.InputTheme.parse_inputTheme($0) }
|
||||||
dict[-175567375] = { return Api.InputTheme.parse_inputThemeSlug($0) }
|
dict[-175567375] = { return Api.InputTheme.parse_inputThemeSlug($0) }
|
||||||
@ -588,6 +590,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[961092808] = { return Api.PrivacyKey.parse_privacyKeyPhoneP2P($0) }
|
dict[961092808] = { return Api.PrivacyKey.parse_privacyKeyPhoneP2P($0) }
|
||||||
dict[-1777000467] = { return Api.PrivacyKey.parse_privacyKeyProfilePhoto($0) }
|
dict[-1777000467] = { return Api.PrivacyKey.parse_privacyKeyProfilePhoto($0) }
|
||||||
dict[-1137792208] = { return Api.PrivacyKey.parse_privacyKeyStatusTimestamp($0) }
|
dict[-1137792208] = { return Api.PrivacyKey.parse_privacyKeyStatusTimestamp($0) }
|
||||||
|
dict[110621716] = { return Api.PrivacyKey.parse_privacyKeyVoiceMessages($0) }
|
||||||
dict[1698855810] = { return Api.PrivacyRule.parse_privacyValueAllowAll($0) }
|
dict[1698855810] = { return Api.PrivacyRule.parse_privacyValueAllowAll($0) }
|
||||||
dict[1796427406] = { return Api.PrivacyRule.parse_privacyValueAllowChatParticipants($0) }
|
dict[1796427406] = { return Api.PrivacyRule.parse_privacyValueAllowChatParticipants($0) }
|
||||||
dict[-123988] = { return Api.PrivacyRule.parse_privacyValueAllowContacts($0) }
|
dict[-123988] = { return Api.PrivacyRule.parse_privacyValueAllowContacts($0) }
|
||||||
@ -705,7 +708,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[-875679776] = { return Api.StatsPercentValue.parse_statsPercentValue($0) }
|
dict[-875679776] = { return Api.StatsPercentValue.parse_statsPercentValue($0) }
|
||||||
dict[1202287072] = { return Api.StatsURL.parse_statsURL($0) }
|
dict[1202287072] = { return Api.StatsURL.parse_statsURL($0) }
|
||||||
dict[313694676] = { return Api.StickerPack.parse_stickerPack($0) }
|
dict[313694676] = { return Api.StickerPack.parse_stickerPack($0) }
|
||||||
dict[-673242758] = { return Api.StickerSet.parse_stickerSet($0) }
|
dict[768691932] = { return Api.StickerSet.parse_stickerSet($0) }
|
||||||
dict[1678812626] = { return Api.StickerSetCovered.parse_stickerSetCovered($0) }
|
dict[1678812626] = { return Api.StickerSetCovered.parse_stickerSetCovered($0) }
|
||||||
dict[872932635] = { return Api.StickerSetCovered.parse_stickerSetMultiCovered($0) }
|
dict[872932635] = { return Api.StickerSetCovered.parse_stickerSetMultiCovered($0) }
|
||||||
dict[-1609668650] = { return Api.Theme.parse_theme($0) }
|
dict[-1609668650] = { return Api.Theme.parse_theme($0) }
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
7510
submodules/TelegramApi/Sources/Api28.swift
Normal file
7510
submodules/TelegramApi/Sources/Api28.swift
Normal file
File diff suppressed because it is too large
Load Diff
@ -606,6 +606,7 @@ public extension Api {
|
|||||||
case inputPrivacyKeyPhoneP2P
|
case inputPrivacyKeyPhoneP2P
|
||||||
case inputPrivacyKeyProfilePhoto
|
case inputPrivacyKeyProfilePhoto
|
||||||
case inputPrivacyKeyStatusTimestamp
|
case inputPrivacyKeyStatusTimestamp
|
||||||
|
case inputPrivacyKeyVoiceMessages
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
@ -656,6 +657,12 @@ public extension Api {
|
|||||||
buffer.appendInt32(1335282456)
|
buffer.appendInt32(1335282456)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break
|
||||||
|
case .inputPrivacyKeyVoiceMessages:
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(-1360618136)
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -678,6 +685,8 @@ public extension Api {
|
|||||||
return ("inputPrivacyKeyProfilePhoto", [])
|
return ("inputPrivacyKeyProfilePhoto", [])
|
||||||
case .inputPrivacyKeyStatusTimestamp:
|
case .inputPrivacyKeyStatusTimestamp:
|
||||||
return ("inputPrivacyKeyStatusTimestamp", [])
|
return ("inputPrivacyKeyStatusTimestamp", [])
|
||||||
|
case .inputPrivacyKeyVoiceMessages:
|
||||||
|
return ("inputPrivacyKeyVoiceMessages", [])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,173 +714,8 @@ public extension Api {
|
|||||||
public static func parse_inputPrivacyKeyStatusTimestamp(_ reader: BufferReader) -> InputPrivacyKey? {
|
public static func parse_inputPrivacyKeyStatusTimestamp(_ reader: BufferReader) -> InputPrivacyKey? {
|
||||||
return Api.InputPrivacyKey.inputPrivacyKeyStatusTimestamp
|
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 inputPrivacyValueAllowContacts
|
|
||||||
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 .inputPrivacyValueAllowContacts:
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(218751099)
|
|
||||||
}
|
|
||||||
|
|
||||||
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", String(describing: chats))])
|
|
||||||
case .inputPrivacyValueAllowContacts:
|
|
||||||
return ("inputPrivacyValueAllowContacts", [])
|
|
||||||
case .inputPrivacyValueAllowUsers(let users):
|
|
||||||
return ("inputPrivacyValueAllowUsers", [("users", String(describing: users))])
|
|
||||||
case .inputPrivacyValueDisallowAll:
|
|
||||||
return ("inputPrivacyValueDisallowAll", [])
|
|
||||||
case .inputPrivacyValueDisallowChatParticipants(let chats):
|
|
||||||
return ("inputPrivacyValueDisallowChatParticipants", [("chats", String(describing: chats))])
|
|
||||||
case .inputPrivacyValueDisallowContacts:
|
|
||||||
return ("inputPrivacyValueDisallowContacts", [])
|
|
||||||
case .inputPrivacyValueDisallowUsers(let users):
|
|
||||||
return ("inputPrivacyValueDisallowUsers", [("users", String(describing: users))])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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_inputPrivacyValueAllowContacts(_ reader: BufferReader) -> InputPrivacyRule? {
|
|
||||||
return Api.InputPrivacyRule.inputPrivacyValueAllowContacts
|
|
||||||
}
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,171 @@
|
|||||||
|
public extension Api {
|
||||||
|
enum InputPrivacyRule: TypeConstructorDescription {
|
||||||
|
case inputPrivacyValueAllowAll
|
||||||
|
case inputPrivacyValueAllowChatParticipants(chats: [Int64])
|
||||||
|
case inputPrivacyValueAllowContacts
|
||||||
|
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 .inputPrivacyValueAllowContacts:
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(218751099)
|
||||||
|
}
|
||||||
|
|
||||||
|
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", String(describing: chats))])
|
||||||
|
case .inputPrivacyValueAllowContacts:
|
||||||
|
return ("inputPrivacyValueAllowContacts", [])
|
||||||
|
case .inputPrivacyValueAllowUsers(let users):
|
||||||
|
return ("inputPrivacyValueAllowUsers", [("users", String(describing: users))])
|
||||||
|
case .inputPrivacyValueDisallowAll:
|
||||||
|
return ("inputPrivacyValueDisallowAll", [])
|
||||||
|
case .inputPrivacyValueDisallowChatParticipants(let chats):
|
||||||
|
return ("inputPrivacyValueDisallowChatParticipants", [("chats", String(describing: chats))])
|
||||||
|
case .inputPrivacyValueDisallowContacts:
|
||||||
|
return ("inputPrivacyValueDisallowContacts", [])
|
||||||
|
case .inputPrivacyValueDisallowUsers(let users):
|
||||||
|
return ("inputPrivacyValueDisallowUsers", [("users", String(describing: users))])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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_inputPrivacyValueAllowContacts(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||||
|
return Api.InputPrivacyRule.inputPrivacyValueAllowContacts
|
||||||
|
}
|
||||||
|
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 {
|
public extension Api {
|
||||||
enum InputSecureFile: TypeConstructorDescription {
|
enum InputSecureFile: TypeConstructorDescription {
|
||||||
case inputSecureFile(id: Int64, accessHash: Int64)
|
case inputSecureFile(id: Int64, accessHash: Int64)
|
||||||
@ -233,6 +401,7 @@ public extension Api {
|
|||||||
case inputStickerSetDice(emoticon: String)
|
case inputStickerSetDice(emoticon: String)
|
||||||
case inputStickerSetEmpty
|
case inputStickerSetEmpty
|
||||||
case inputStickerSetID(id: Int64, accessHash: Int64)
|
case inputStickerSetID(id: Int64, accessHash: Int64)
|
||||||
|
case inputStickerSetPremiumGifts
|
||||||
case inputStickerSetShortName(shortName: String)
|
case inputStickerSetShortName(shortName: String)
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
@ -267,6 +436,12 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
serializeInt64(id, buffer: buffer, boxed: false)
|
serializeInt64(id, buffer: buffer, boxed: false)
|
||||||
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
||||||
|
break
|
||||||
|
case .inputStickerSetPremiumGifts:
|
||||||
|
if boxed {
|
||||||
|
buffer.appendInt32(-930399486)
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
case .inputStickerSetShortName(let shortName):
|
case .inputStickerSetShortName(let shortName):
|
||||||
if boxed {
|
if boxed {
|
||||||
@ -289,6 +464,8 @@ public extension Api {
|
|||||||
return ("inputStickerSetEmpty", [])
|
return ("inputStickerSetEmpty", [])
|
||||||
case .inputStickerSetID(let id, let accessHash):
|
case .inputStickerSetID(let id, let accessHash):
|
||||||
return ("inputStickerSetID", [("id", String(describing: id)), ("accessHash", String(describing: accessHash))])
|
return ("inputStickerSetID", [("id", String(describing: id)), ("accessHash", String(describing: accessHash))])
|
||||||
|
case .inputStickerSetPremiumGifts:
|
||||||
|
return ("inputStickerSetPremiumGifts", [])
|
||||||
case .inputStickerSetShortName(let shortName):
|
case .inputStickerSetShortName(let shortName):
|
||||||
return ("inputStickerSetShortName", [("shortName", String(describing: shortName))])
|
return ("inputStickerSetShortName", [("shortName", String(describing: shortName))])
|
||||||
}
|
}
|
||||||
@ -328,6 +505,9 @@ public extension Api {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static func parse_inputStickerSetPremiumGifts(_ reader: BufferReader) -> InputStickerSet? {
|
||||||
|
return Api.InputStickerSet.inputStickerSetPremiumGifts
|
||||||
|
}
|
||||||
public static func parse_inputStickerSetShortName(_ reader: BufferReader) -> InputStickerSet? {
|
public static func parse_inputStickerSetShortName(_ reader: BufferReader) -> InputStickerSet? {
|
||||||
var _1: String?
|
var _1: String?
|
||||||
_1 = parseString(reader)
|
_1 = parseString(reader)
|
||||||
@ -456,16 +636,18 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
enum InputStorePaymentPurpose: TypeConstructorDescription {
|
enum InputStorePaymentPurpose: TypeConstructorDescription {
|
||||||
case inputStorePaymentGiftPremium(userId: Api.InputUser)
|
case inputStorePaymentGiftPremium(userId: Api.InputUser, currency: String, amount: Int64)
|
||||||
case inputStorePaymentPremiumSubscription(flags: Int32)
|
case inputStorePaymentPremiumSubscription(flags: Int32)
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
case .inputStorePaymentGiftPremium(let userId):
|
case .inputStorePaymentGiftPremium(let userId, let currency, let amount):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(1147243133)
|
buffer.appendInt32(1634697192)
|
||||||
}
|
}
|
||||||
userId.serialize(buffer, true)
|
userId.serialize(buffer, true)
|
||||||
|
serializeString(currency, buffer: buffer, boxed: false)
|
||||||
|
serializeInt64(amount, buffer: buffer, boxed: false)
|
||||||
break
|
break
|
||||||
case .inputStorePaymentPremiumSubscription(let flags):
|
case .inputStorePaymentPremiumSubscription(let flags):
|
||||||
if boxed {
|
if boxed {
|
||||||
@ -478,8 +660,8 @@ public extension Api {
|
|||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||||
switch self {
|
switch self {
|
||||||
case .inputStorePaymentGiftPremium(let userId):
|
case .inputStorePaymentGiftPremium(let userId, let currency, let amount):
|
||||||
return ("inputStorePaymentGiftPremium", [("userId", String(describing: userId))])
|
return ("inputStorePaymentGiftPremium", [("userId", String(describing: userId)), ("currency", String(describing: currency)), ("amount", String(describing: amount))])
|
||||||
case .inputStorePaymentPremiumSubscription(let flags):
|
case .inputStorePaymentPremiumSubscription(let flags):
|
||||||
return ("inputStorePaymentPremiumSubscription", [("flags", String(describing: flags))])
|
return ("inputStorePaymentPremiumSubscription", [("flags", String(describing: flags))])
|
||||||
}
|
}
|
||||||
@ -490,9 +672,15 @@ public extension Api {
|
|||||||
if let signature = reader.readInt32() {
|
if let signature = reader.readInt32() {
|
||||||
_1 = Api.parse(reader, signature: signature) as? Api.InputUser
|
_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 _c1 = _1 != nil
|
||||||
if _c1 {
|
let _c2 = _2 != nil
|
||||||
return Api.InputStorePaymentPurpose.inputStorePaymentGiftPremium(userId: _1!)
|
let _c3 = _3 != nil
|
||||||
|
if _c1 && _c2 && _c3 {
|
||||||
|
return Api.InputStorePaymentPurpose.inputStorePaymentGiftPremium(userId: _1!, currency: _2!, amount: _3!)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return nil
|
return nil
|
||||||
@ -818,391 +1006,3 @@ public extension Api {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public extension Api {
|
|
||||||
enum InputWebDocument: TypeConstructorDescription {
|
|
||||||
case inputWebDocument(url: String, size: Int32, mimeType: String, attributes: [Api.DocumentAttribute])
|
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
||||||
switch self {
|
|
||||||
case .inputWebDocument(let url, let size, let mimeType, let attributes):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1678949555)
|
|
||||||
}
|
|
||||||
serializeString(url, buffer: buffer, boxed: false)
|
|
||||||
serializeInt32(size, buffer: buffer, boxed: false)
|
|
||||||
serializeString(mimeType, buffer: buffer, boxed: false)
|
|
||||||
buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(attributes.count))
|
|
||||||
for item in attributes {
|
|
||||||
item.serialize(buffer, true)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
||||||
switch self {
|
|
||||||
case .inputWebDocument(let url, let size, let mimeType, let attributes):
|
|
||||||
return ("inputWebDocument", [("url", String(describing: url)), ("size", String(describing: size)), ("mimeType", String(describing: mimeType)), ("attributes", String(describing: attributes))])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func parse_inputWebDocument(_ reader: BufferReader) -> InputWebDocument? {
|
|
||||||
var _1: String?
|
|
||||||
_1 = parseString(reader)
|
|
||||||
var _2: Int32?
|
|
||||||
_2 = reader.readInt32()
|
|
||||||
var _3: String?
|
|
||||||
_3 = parseString(reader)
|
|
||||||
var _4: [Api.DocumentAttribute]?
|
|
||||||
if let _ = reader.readInt32() {
|
|
||||||
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.DocumentAttribute.self)
|
|
||||||
}
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
let _c2 = _2 != nil
|
|
||||||
let _c3 = _3 != nil
|
|
||||||
let _c4 = _4 != nil
|
|
||||||
if _c1 && _c2 && _c3 && _c4 {
|
|
||||||
return Api.InputWebDocument.inputWebDocument(url: _1!, size: _2!, mimeType: _3!, attributes: _4!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public extension Api {
|
|
||||||
enum InputWebFileLocation: TypeConstructorDescription {
|
|
||||||
case inputWebFileGeoPointLocation(geoPoint: Api.InputGeoPoint, accessHash: Int64, w: Int32, h: Int32, zoom: Int32, scale: Int32)
|
|
||||||
case inputWebFileLocation(url: String, accessHash: Int64)
|
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
||||||
switch self {
|
|
||||||
case .inputWebFileGeoPointLocation(let geoPoint, let accessHash, let w, let h, let zoom, let scale):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1625153079)
|
|
||||||
}
|
|
||||||
geoPoint.serialize(buffer, true)
|
|
||||||
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
||||||
serializeInt32(w, buffer: buffer, boxed: false)
|
|
||||||
serializeInt32(h, buffer: buffer, boxed: false)
|
|
||||||
serializeInt32(zoom, buffer: buffer, boxed: false)
|
|
||||||
serializeInt32(scale, buffer: buffer, boxed: false)
|
|
||||||
break
|
|
||||||
case .inputWebFileLocation(let url, let accessHash):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1036396922)
|
|
||||||
}
|
|
||||||
serializeString(url, buffer: buffer, boxed: false)
|
|
||||||
serializeInt64(accessHash, buffer: buffer, boxed: false)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
||||||
switch self {
|
|
||||||
case .inputWebFileGeoPointLocation(let geoPoint, let accessHash, let w, let h, let zoom, let scale):
|
|
||||||
return ("inputWebFileGeoPointLocation", [("geoPoint", String(describing: geoPoint)), ("accessHash", String(describing: accessHash)), ("w", String(describing: w)), ("h", String(describing: h)), ("zoom", String(describing: zoom)), ("scale", String(describing: scale))])
|
|
||||||
case .inputWebFileLocation(let url, let accessHash):
|
|
||||||
return ("inputWebFileLocation", [("url", String(describing: url)), ("accessHash", String(describing: accessHash))])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func parse_inputWebFileGeoPointLocation(_ reader: BufferReader) -> InputWebFileLocation? {
|
|
||||||
var _1: Api.InputGeoPoint?
|
|
||||||
if let signature = reader.readInt32() {
|
|
||||||
_1 = Api.parse(reader, signature: signature) as? Api.InputGeoPoint
|
|
||||||
}
|
|
||||||
var _2: Int64?
|
|
||||||
_2 = reader.readInt64()
|
|
||||||
var _3: Int32?
|
|
||||||
_3 = reader.readInt32()
|
|
||||||
var _4: Int32?
|
|
||||||
_4 = reader.readInt32()
|
|
||||||
var _5: Int32?
|
|
||||||
_5 = reader.readInt32()
|
|
||||||
var _6: Int32?
|
|
||||||
_6 = reader.readInt32()
|
|
||||||
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.InputWebFileLocation.inputWebFileGeoPointLocation(geoPoint: _1!, accessHash: _2!, w: _3!, h: _4!, zoom: _5!, scale: _6!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static func parse_inputWebFileLocation(_ reader: BufferReader) -> InputWebFileLocation? {
|
|
||||||
var _1: String?
|
|
||||||
_1 = parseString(reader)
|
|
||||||
var _2: Int64?
|
|
||||||
_2 = reader.readInt64()
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
let _c2 = _2 != nil
|
|
||||||
if _c1 && _c2 {
|
|
||||||
return Api.InputWebFileLocation.inputWebFileLocation(url: _1!, accessHash: _2!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public extension Api {
|
|
||||||
enum Invoice: TypeConstructorDescription {
|
|
||||||
case invoice(flags: Int32, currency: String, prices: [Api.LabeledPrice], maxTipAmount: Int64?, suggestedTipAmounts: [Int64]?, recurringTermsUrl: String?)
|
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
||||||
switch self {
|
|
||||||
case .invoice(let flags, let currency, let prices, let maxTipAmount, let suggestedTipAmounts, let recurringTermsUrl):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(1048946971)
|
|
||||||
}
|
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
|
||||||
serializeString(currency, buffer: buffer, boxed: false)
|
|
||||||
buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(prices.count))
|
|
||||||
for item in prices {
|
|
||||||
item.serialize(buffer, true)
|
|
||||||
}
|
|
||||||
if Int(flags) & Int(1 << 8) != 0 {serializeInt64(maxTipAmount!, buffer: buffer, boxed: false)}
|
|
||||||
if Int(flags) & Int(1 << 8) != 0 {buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(suggestedTipAmounts!.count))
|
|
||||||
for item in suggestedTipAmounts! {
|
|
||||||
serializeInt64(item, buffer: buffer, boxed: false)
|
|
||||||
}}
|
|
||||||
if Int(flags) & Int(1 << 9) != 0 {serializeString(recurringTermsUrl!, buffer: buffer, boxed: false)}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
||||||
switch self {
|
|
||||||
case .invoice(let flags, let currency, let prices, let maxTipAmount, let suggestedTipAmounts, let recurringTermsUrl):
|
|
||||||
return ("invoice", [("flags", String(describing: flags)), ("currency", String(describing: currency)), ("prices", String(describing: prices)), ("maxTipAmount", String(describing: maxTipAmount)), ("suggestedTipAmounts", String(describing: suggestedTipAmounts)), ("recurringTermsUrl", String(describing: recurringTermsUrl))])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func parse_invoice(_ reader: BufferReader) -> Invoice? {
|
|
||||||
var _1: Int32?
|
|
||||||
_1 = reader.readInt32()
|
|
||||||
var _2: String?
|
|
||||||
_2 = parseString(reader)
|
|
||||||
var _3: [Api.LabeledPrice]?
|
|
||||||
if let _ = reader.readInt32() {
|
|
||||||
_3 = Api.parseVector(reader, elementSignature: 0, elementType: Api.LabeledPrice.self)
|
|
||||||
}
|
|
||||||
var _4: Int64?
|
|
||||||
if Int(_1!) & Int(1 << 8) != 0 {_4 = reader.readInt64() }
|
|
||||||
var _5: [Int64]?
|
|
||||||
if Int(_1!) & Int(1 << 8) != 0 {if let _ = reader.readInt32() {
|
|
||||||
_5 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
|
||||||
} }
|
|
||||||
var _6: String?
|
|
||||||
if Int(_1!) & Int(1 << 9) != 0 {_6 = parseString(reader) }
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
let _c2 = _2 != nil
|
|
||||||
let _c3 = _3 != nil
|
|
||||||
let _c4 = (Int(_1!) & Int(1 << 8) == 0) || _4 != nil
|
|
||||||
let _c5 = (Int(_1!) & Int(1 << 8) == 0) || _5 != nil
|
|
||||||
let _c6 = (Int(_1!) & Int(1 << 9) == 0) || _6 != nil
|
|
||||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
|
||||||
return Api.Invoice.invoice(flags: _1!, currency: _2!, prices: _3!, maxTipAmount: _4, suggestedTipAmounts: _5, recurringTermsUrl: _6)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public extension Api {
|
|
||||||
enum JSONObjectValue: TypeConstructorDescription {
|
|
||||||
case jsonObjectValue(key: String, value: Api.JSONValue)
|
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
||||||
switch self {
|
|
||||||
case .jsonObjectValue(let key, let value):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1059185703)
|
|
||||||
}
|
|
||||||
serializeString(key, buffer: buffer, boxed: false)
|
|
||||||
value.serialize(buffer, true)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
||||||
switch self {
|
|
||||||
case .jsonObjectValue(let key, let value):
|
|
||||||
return ("jsonObjectValue", [("key", String(describing: key)), ("value", String(describing: value))])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func parse_jsonObjectValue(_ reader: BufferReader) -> JSONObjectValue? {
|
|
||||||
var _1: String?
|
|
||||||
_1 = parseString(reader)
|
|
||||||
var _2: Api.JSONValue?
|
|
||||||
if let signature = reader.readInt32() {
|
|
||||||
_2 = Api.parse(reader, signature: signature) as? Api.JSONValue
|
|
||||||
}
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
let _c2 = _2 != nil
|
|
||||||
if _c1 && _c2 {
|
|
||||||
return Api.JSONObjectValue.jsonObjectValue(key: _1!, value: _2!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public extension Api {
|
|
||||||
enum JSONValue: TypeConstructorDescription {
|
|
||||||
case jsonArray(value: [Api.JSONValue])
|
|
||||||
case jsonBool(value: Api.Bool)
|
|
||||||
case jsonNull
|
|
||||||
case jsonNumber(value: Double)
|
|
||||||
case jsonObject(value: [Api.JSONObjectValue])
|
|
||||||
case jsonString(value: String)
|
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
||||||
switch self {
|
|
||||||
case .jsonArray(let value):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-146520221)
|
|
||||||
}
|
|
||||||
buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(value.count))
|
|
||||||
for item in value {
|
|
||||||
item.serialize(buffer, true)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case .jsonBool(let value):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-952869270)
|
|
||||||
}
|
|
||||||
value.serialize(buffer, true)
|
|
||||||
break
|
|
||||||
case .jsonNull:
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(1064139624)
|
|
||||||
}
|
|
||||||
|
|
||||||
break
|
|
||||||
case .jsonNumber(let value):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(736157604)
|
|
||||||
}
|
|
||||||
serializeDouble(value, buffer: buffer, boxed: false)
|
|
||||||
break
|
|
||||||
case .jsonObject(let value):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1715350371)
|
|
||||||
}
|
|
||||||
buffer.appendInt32(481674261)
|
|
||||||
buffer.appendInt32(Int32(value.count))
|
|
||||||
for item in value {
|
|
||||||
item.serialize(buffer, true)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case .jsonString(let value):
|
|
||||||
if boxed {
|
|
||||||
buffer.appendInt32(-1222740358)
|
|
||||||
}
|
|
||||||
serializeString(value, buffer: buffer, boxed: false)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
|
||||||
switch self {
|
|
||||||
case .jsonArray(let value):
|
|
||||||
return ("jsonArray", [("value", String(describing: value))])
|
|
||||||
case .jsonBool(let value):
|
|
||||||
return ("jsonBool", [("value", String(describing: value))])
|
|
||||||
case .jsonNull:
|
|
||||||
return ("jsonNull", [])
|
|
||||||
case .jsonNumber(let value):
|
|
||||||
return ("jsonNumber", [("value", String(describing: value))])
|
|
||||||
case .jsonObject(let value):
|
|
||||||
return ("jsonObject", [("value", String(describing: value))])
|
|
||||||
case .jsonString(let value):
|
|
||||||
return ("jsonString", [("value", String(describing: value))])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static func parse_jsonArray(_ reader: BufferReader) -> JSONValue? {
|
|
||||||
var _1: [Api.JSONValue]?
|
|
||||||
if let _ = reader.readInt32() {
|
|
||||||
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.JSONValue.self)
|
|
||||||
}
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
if _c1 {
|
|
||||||
return Api.JSONValue.jsonArray(value: _1!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static func parse_jsonBool(_ reader: BufferReader) -> JSONValue? {
|
|
||||||
var _1: Api.Bool?
|
|
||||||
if let signature = reader.readInt32() {
|
|
||||||
_1 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
||||||
}
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
if _c1 {
|
|
||||||
return Api.JSONValue.jsonBool(value: _1!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static func parse_jsonNull(_ reader: BufferReader) -> JSONValue? {
|
|
||||||
return Api.JSONValue.jsonNull
|
|
||||||
}
|
|
||||||
public static func parse_jsonNumber(_ reader: BufferReader) -> JSONValue? {
|
|
||||||
var _1: Double?
|
|
||||||
_1 = reader.readDouble()
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
if _c1 {
|
|
||||||
return Api.JSONValue.jsonNumber(value: _1!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static func parse_jsonObject(_ reader: BufferReader) -> JSONValue? {
|
|
||||||
var _1: [Api.JSONObjectValue]?
|
|
||||||
if let _ = reader.readInt32() {
|
|
||||||
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.JSONObjectValue.self)
|
|
||||||
}
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
if _c1 {
|
|
||||||
return Api.JSONValue.jsonObject(value: _1!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static func parse_jsonString(_ reader: BufferReader) -> JSONValue? {
|
|
||||||
var _1: String?
|
|
||||||
_1 = parseString(reader)
|
|
||||||
let _c1 = _1 != nil
|
|
||||||
if _c1 {
|
|
||||||
return Api.JSONValue.jsonString(value: _1!)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -62,6 +62,8 @@ extension StickerPackReference {
|
|||||||
self = .dice(emoticon)
|
self = .dice(emoticon)
|
||||||
case .inputStickerSetAnimatedEmojiAnimations:
|
case .inputStickerSetAnimatedEmojiAnimations:
|
||||||
self = .animatedEmojiAnimations
|
self = .animatedEmojiAnimations
|
||||||
|
case .inputStickerSetPremiumGifts:
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3502,7 +3502,7 @@ func replayFinalState(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch set {
|
switch set {
|
||||||
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _):
|
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
if (flags & (1 << 3)) != 0 {
|
if (flags & (1 << 3)) != 0 {
|
||||||
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
||||||
} else if (flags & (1 << 7)) != 0 {
|
} else if (flags & (1 << 7)) != 0 {
|
||||||
|
@ -29,7 +29,7 @@ func _internal_sendAppStoreReceipt(account: Account, receipt: Data, purpose: App
|
|||||||
purposeSignal = account.postbox.loadedPeerWithId(peerId)
|
purposeSignal = account.postbox.loadedPeerWithId(peerId)
|
||||||
|> mapToSignal { peer -> Signal<Api.InputStorePaymentPurpose, NoError> in
|
|> mapToSignal { peer -> Signal<Api.InputStorePaymentPurpose, NoError> in
|
||||||
if let inputUser = apiInputUser(peer) {
|
if let inputUser = apiInputUser(peer) {
|
||||||
return .single(.inputStorePaymentGiftPremium(userId: inputUser))
|
return .single(.inputStorePaymentGiftPremium(userId: inputUser, currency: "", amount: 0))
|
||||||
} else {
|
} else {
|
||||||
return .complete()
|
return .complete()
|
||||||
}
|
}
|
||||||
|
@ -541,7 +541,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee
|
|||||||
let stickerPack: StickerPackCollectionInfo? = stickerSet.flatMap { apiSet -> StickerPackCollectionInfo in
|
let stickerPack: StickerPackCollectionInfo? = stickerSet.flatMap { apiSet -> StickerPackCollectionInfo in
|
||||||
let namespace: ItemCollectionId.Namespace
|
let namespace: ItemCollectionId.Namespace
|
||||||
switch apiSet {
|
switch apiSet {
|
||||||
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _):
|
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
if (flags & (1 << 3)) != 0 {
|
if (flags & (1 << 3)) != 0 {
|
||||||
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
||||||
} else if (flags & (1 << 7)) != 0 {
|
} else if (flags & (1 << 7)) != 0 {
|
||||||
|
@ -170,7 +170,7 @@ func _internal_createStickerSet(account: Account, title: String, shortName: Stri
|
|||||||
case let .stickerSet(set, packs, documents):
|
case let .stickerSet(set, packs, documents):
|
||||||
let namespace: ItemCollectionId.Namespace
|
let namespace: ItemCollectionId.Namespace
|
||||||
switch set {
|
switch set {
|
||||||
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _):
|
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
if (flags & (1 << 3)) != 0 {
|
if (flags & (1 << 3)) != 0 {
|
||||||
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
||||||
} else if (flags & (1 << 7)) != 0 {
|
} else if (flags & (1 << 7)) != 0 {
|
||||||
|
@ -49,7 +49,7 @@ func updatedRemoteStickerPack(postbox: Postbox, network: Network, reference: Sti
|
|||||||
case let .stickerSet(set, packs, documents):
|
case let .stickerSet(set, packs, documents):
|
||||||
let namespace: ItemCollectionId.Namespace
|
let namespace: ItemCollectionId.Namespace
|
||||||
switch set {
|
switch set {
|
||||||
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _):
|
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
if (flags & (1 << 3)) != 0 {
|
if (flags & (1 << 3)) != 0 {
|
||||||
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
namespace = Namespaces.ItemCollection.CloudMaskPacks
|
||||||
} else if (flags & (1 << 7)) != 0 {
|
} else if (flags & (1 << 7)) != 0 {
|
||||||
|
@ -32,7 +32,7 @@ func telegramStickerPackThumbnailRepresentationFromApiSizes(datacenterId: Int32,
|
|||||||
extension StickerPackCollectionInfo {
|
extension StickerPackCollectionInfo {
|
||||||
convenience init(apiSet: Api.StickerSet, namespace: ItemCollectionId.Namespace) {
|
convenience init(apiSet: Api.StickerSet, namespace: ItemCollectionId.Namespace) {
|
||||||
switch apiSet {
|
switch apiSet {
|
||||||
case let .stickerSet(flags, _, id, accessHash, title, shortName, thumbs, thumbDcId, thumbVersion, count, nHash):
|
case let .stickerSet(flags, _, id, accessHash, title, shortName, thumbs, thumbDcId, thumbVersion, thumbDocumentId, count, nHash):
|
||||||
var setFlags: StickerPackCollectionInfoFlags = StickerPackCollectionInfoFlags()
|
var setFlags: StickerPackCollectionInfoFlags = StickerPackCollectionInfoFlags()
|
||||||
if (flags & (1 << 2)) != 0 {
|
if (flags & (1 << 2)) != 0 {
|
||||||
setFlags.insert(.isOfficial)
|
setFlags.insert(.isOfficial)
|
||||||
@ -58,6 +58,8 @@ extension StickerPackCollectionInfo {
|
|||||||
immediateThumbnailData = data
|
immediateThumbnailData = data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let _ = thumbDocumentId
|
||||||
|
|
||||||
self.init(id: ItemCollectionId(namespace: namespace, id: id), flags: setFlags, accessHash: accessHash, title: title, shortName: shortName, thumbnail: thumbnailRepresentation, immediateThumbnailData: immediateThumbnailData, hash: nHash, count: count)
|
self.init(id: ItemCollectionId(namespace: namespace, id: id), flags: setFlags, accessHash: accessHash, title: title, shortName: shortName, thumbnail: thumbnailRepresentation, immediateThumbnailData: immediateThumbnailData, hash: nHash, count: count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ func _internal_requestStickerSet(postbox: Postbox, network: Network, reference:
|
|||||||
info = StickerPackCollectionInfo(apiSet: set, namespace: Namespaces.ItemCollection.CloudStickerPacks)
|
info = StickerPackCollectionInfo(apiSet: set, namespace: Namespaces.ItemCollection.CloudStickerPacks)
|
||||||
|
|
||||||
switch set {
|
switch set {
|
||||||
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _):
|
case let .stickerSet(flags, _, _, _, _, _, _, _, _, _, _, _):
|
||||||
installed = (flags & (1 << 0) != 0)
|
installed = (flags & (1 << 0) != 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user