Update scheme

This commit is contained in:
Ilya Laktyushin
2023-10-17 13:52:47 +04:00
parent 1b50b16bee
commit fc8b77d946
20 changed files with 917 additions and 533 deletions

View File

@@ -893,37 +893,57 @@ public extension Api {
}
}
public extension Api {
enum Booster: TypeConstructorDescription {
case booster(userId: Int64, expires: Int32)
enum Boost: TypeConstructorDescription {
case boost(flags: Int32, id: String, userId: Int64?, giveawayMsgId: Int32?, date: Int32, expires: Int32, usedGiftSlug: String?)
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
switch self {
case .booster(let userId, let expires):
case .boost(let flags, let id, let userId, let giveawayMsgId, let date, let expires, let usedGiftSlug):
if boxed {
buffer.appendInt32(245261184)
buffer.appendInt32(1405288648)
}
serializeInt64(userId, buffer: buffer, boxed: false)
serializeInt32(flags, buffer: buffer, boxed: false)
serializeString(id, buffer: buffer, boxed: false)
if Int(flags) & Int(1 << 0) != 0 {serializeInt64(userId!, buffer: buffer, boxed: false)}
if Int(flags) & Int(1 << 2) != 0 {serializeInt32(giveawayMsgId!, buffer: buffer, boxed: false)}
serializeInt32(date, buffer: buffer, boxed: false)
serializeInt32(expires, buffer: buffer, boxed: false)
if Int(flags) & Int(1 << 4) != 0 {serializeString(usedGiftSlug!, buffer: buffer, boxed: false)}
break
}
}
public func descriptionFields() -> (String, [(String, Any)]) {
switch self {
case .booster(let userId, let expires):
return ("booster", [("userId", userId as Any), ("expires", expires as Any)])
case .boost(let flags, let id, let userId, let giveawayMsgId, let date, let expires, let usedGiftSlug):
return ("boost", [("flags", flags as Any), ("id", id as Any), ("userId", userId as Any), ("giveawayMsgId", giveawayMsgId as Any), ("date", date as Any), ("expires", expires as Any), ("usedGiftSlug", usedGiftSlug as Any)])
}
}
public static func parse_booster(_ reader: BufferReader) -> Booster? {
var _1: Int64?
_1 = reader.readInt64()
var _2: Int32?
_2 = reader.readInt32()
public static func parse_boost(_ reader: BufferReader) -> Boost? {
var _1: Int32?
_1 = reader.readInt32()
var _2: String?
_2 = parseString(reader)
var _3: Int64?
if Int(_1!) & Int(1 << 0) != 0 {_3 = reader.readInt64() }
var _4: Int32?
if Int(_1!) & Int(1 << 2) != 0 {_4 = reader.readInt32() }
var _5: Int32?
_5 = reader.readInt32()
var _6: Int32?
_6 = reader.readInt32()
var _7: String?
if Int(_1!) & Int(1 << 4) != 0 {_7 = parseString(reader) }
let _c1 = _1 != nil
let _c2 = _2 != nil
if _c1 && _c2 {
return Api.Booster.booster(userId: _1!, expires: _2!)
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
let _c5 = _5 != nil
let _c6 = _6 != nil
let _c7 = (Int(_1!) & Int(1 << 4) == 0) || _7 != nil
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
return Api.Boost.boost(flags: _1!, id: _2!, userId: _3, giveawayMsgId: _4, date: _5!, expires: _6!, usedGiftSlug: _7)
}
else {
return nil