mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
API
This commit is contained in:
@@ -1,3 +1,103 @@
|
||||
public extension Api {
|
||||
indirect enum InputNotifyPeer: TypeConstructorDescription {
|
||||
case inputNotifyBroadcasts
|
||||
case inputNotifyChats
|
||||
case inputNotifyForumTopic(peer: Api.InputPeer, topMsgId: Int32)
|
||||
case inputNotifyPeer(peer: Api.InputPeer)
|
||||
case inputNotifyUsers
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .inputNotifyBroadcasts:
|
||||
if boxed {
|
||||
buffer.appendInt32(-1311015810)
|
||||
}
|
||||
|
||||
break
|
||||
case .inputNotifyChats:
|
||||
if boxed {
|
||||
buffer.appendInt32(1251338318)
|
||||
}
|
||||
|
||||
break
|
||||
case .inputNotifyForumTopic(let peer, let topMsgId):
|
||||
if boxed {
|
||||
buffer.appendInt32(1548122514)
|
||||
}
|
||||
peer.serialize(buffer, true)
|
||||
serializeInt32(topMsgId, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .inputNotifyPeer(let peer):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1195615476)
|
||||
}
|
||||
peer.serialize(buffer, true)
|
||||
break
|
||||
case .inputNotifyUsers:
|
||||
if boxed {
|
||||
buffer.appendInt32(423314455)
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .inputNotifyBroadcasts:
|
||||
return ("inputNotifyBroadcasts", [])
|
||||
case .inputNotifyChats:
|
||||
return ("inputNotifyChats", [])
|
||||
case .inputNotifyForumTopic(let peer, let topMsgId):
|
||||
return ("inputNotifyForumTopic", [("peer", peer as Any), ("topMsgId", topMsgId as Any)])
|
||||
case .inputNotifyPeer(let peer):
|
||||
return ("inputNotifyPeer", [("peer", peer as Any)])
|
||||
case .inputNotifyUsers:
|
||||
return ("inputNotifyUsers", [])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_inputNotifyBroadcasts(_ reader: BufferReader) -> InputNotifyPeer? {
|
||||
return Api.InputNotifyPeer.inputNotifyBroadcasts
|
||||
}
|
||||
public static func parse_inputNotifyChats(_ reader: BufferReader) -> InputNotifyPeer? {
|
||||
return Api.InputNotifyPeer.inputNotifyChats
|
||||
}
|
||||
public static func parse_inputNotifyForumTopic(_ reader: BufferReader) -> InputNotifyPeer? {
|
||||
var _1: Api.InputPeer?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
||||
}
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
if _c1 && _c2 {
|
||||
return Api.InputNotifyPeer.inputNotifyForumTopic(peer: _1!, topMsgId: _2!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_inputNotifyPeer(_ reader: BufferReader) -> InputNotifyPeer? {
|
||||
var _1: Api.InputPeer?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.InputPeer
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.InputNotifyPeer.inputNotifyPeer(peer: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_inputNotifyUsers(_ reader: BufferReader) -> InputNotifyPeer? {
|
||||
return Api.InputNotifyPeer.inputNotifyUsers
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum InputPaymentCredentials: TypeConstructorDescription {
|
||||
case inputPaymentCredentials(flags: Int32, data: Api.DataJSON)
|
||||
@@ -608,219 +708,3 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum InputPrivacyRule: TypeConstructorDescription {
|
||||
case inputPrivacyValueAllowAll
|
||||
case inputPrivacyValueAllowBots
|
||||
case inputPrivacyValueAllowChatParticipants(chats: [Int64])
|
||||
case inputPrivacyValueAllowCloseFriends
|
||||
case inputPrivacyValueAllowContacts
|
||||
case inputPrivacyValueAllowPremium
|
||||
case inputPrivacyValueAllowUsers(users: [Api.InputUser])
|
||||
case inputPrivacyValueDisallowAll
|
||||
case inputPrivacyValueDisallowBots
|
||||
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 .inputPrivacyValueAllowBots:
|
||||
if boxed {
|
||||
buffer.appendInt32(1515179237)
|
||||
}
|
||||
|
||||
break
|
||||
case .inputPrivacyValueAllowChatParticipants(let chats):
|
||||
if boxed {
|
||||
buffer.appendInt32(-2079962673)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(chats.count))
|
||||
for item in chats {
|
||||
serializeInt64(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
break
|
||||
case .inputPrivacyValueAllowCloseFriends:
|
||||
if boxed {
|
||||
buffer.appendInt32(793067081)
|
||||
}
|
||||
|
||||
break
|
||||
case .inputPrivacyValueAllowContacts:
|
||||
if boxed {
|
||||
buffer.appendInt32(218751099)
|
||||
}
|
||||
|
||||
break
|
||||
case .inputPrivacyValueAllowPremium:
|
||||
if boxed {
|
||||
buffer.appendInt32(2009975281)
|
||||
}
|
||||
|
||||
break
|
||||
case .inputPrivacyValueAllowUsers(let users):
|
||||
if boxed {
|
||||
buffer.appendInt32(320652927)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(users.count))
|
||||
for item in users {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
break
|
||||
case .inputPrivacyValueDisallowAll:
|
||||
if boxed {
|
||||
buffer.appendInt32(-697604407)
|
||||
}
|
||||
|
||||
break
|
||||
case .inputPrivacyValueDisallowBots:
|
||||
if boxed {
|
||||
buffer.appendInt32(-991594219)
|
||||
}
|
||||
|
||||
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 .inputPrivacyValueAllowBots:
|
||||
return ("inputPrivacyValueAllowBots", [])
|
||||
case .inputPrivacyValueAllowChatParticipants(let chats):
|
||||
return ("inputPrivacyValueAllowChatParticipants", [("chats", chats as Any)])
|
||||
case .inputPrivacyValueAllowCloseFriends:
|
||||
return ("inputPrivacyValueAllowCloseFriends", [])
|
||||
case .inputPrivacyValueAllowContacts:
|
||||
return ("inputPrivacyValueAllowContacts", [])
|
||||
case .inputPrivacyValueAllowPremium:
|
||||
return ("inputPrivacyValueAllowPremium", [])
|
||||
case .inputPrivacyValueAllowUsers(let users):
|
||||
return ("inputPrivacyValueAllowUsers", [("users", users as Any)])
|
||||
case .inputPrivacyValueDisallowAll:
|
||||
return ("inputPrivacyValueDisallowAll", [])
|
||||
case .inputPrivacyValueDisallowBots:
|
||||
return ("inputPrivacyValueDisallowBots", [])
|
||||
case .inputPrivacyValueDisallowChatParticipants(let chats):
|
||||
return ("inputPrivacyValueDisallowChatParticipants", [("chats", chats as Any)])
|
||||
case .inputPrivacyValueDisallowContacts:
|
||||
return ("inputPrivacyValueDisallowContacts", [])
|
||||
case .inputPrivacyValueDisallowUsers(let users):
|
||||
return ("inputPrivacyValueDisallowUsers", [("users", users as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_inputPrivacyValueAllowAll(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueAllowAll
|
||||
}
|
||||
public static func parse_inputPrivacyValueAllowBots(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueAllowBots
|
||||
}
|
||||
public static func parse_inputPrivacyValueAllowChatParticipants(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
var _1: [Int64]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 570911930, elementType: Int64.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueAllowChatParticipants(chats: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_inputPrivacyValueAllowCloseFriends(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueAllowCloseFriends
|
||||
}
|
||||
public static func parse_inputPrivacyValueAllowContacts(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueAllowContacts
|
||||
}
|
||||
public static func parse_inputPrivacyValueAllowPremium(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueAllowPremium
|
||||
}
|
||||
public static func parse_inputPrivacyValueAllowUsers(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
var _1: [Api.InputUser]?
|
||||
if let _ = reader.readInt32() {
|
||||
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.InputUser.self)
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueAllowUsers(users: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_inputPrivacyValueDisallowAll(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueDisallowAll
|
||||
}
|
||||
public static func parse_inputPrivacyValueDisallowBots(_ reader: BufferReader) -> InputPrivacyRule? {
|
||||
return Api.InputPrivacyRule.inputPrivacyValueDisallowBots
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user