|
| 1 | +public extension Api { |
| 2 | + enum StarsRating: TypeConstructorDescription { |
| 3 | + case starsRating(flags: Int32, level: Int32, currentLevelStars: Int64, stars: Int64, nextLevelStars: Int64?) |
| 4 | + |
| 5 | + public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { |
| 6 | + switch self { |
| 7 | + case .starsRating(let flags, let level, let currentLevelStars, let stars, let nextLevelStars): |
| 8 | + if boxed { |
| 9 | + buffer.appendInt32(453922567) |
| 10 | + } |
| 11 | + serializeInt32(flags, buffer: buffer, boxed: false) |
| 12 | + serializeInt32(level, buffer: buffer, boxed: false) |
| 13 | + serializeInt64(currentLevelStars, buffer: buffer, boxed: false) |
| 14 | + serializeInt64(stars, buffer: buffer, boxed: false) |
| 15 | + if Int(flags) & Int(1 << 0) != 0 {serializeInt64(nextLevelStars!, buffer: buffer, boxed: false)} |
| 16 | + break |
| 17 | + } |
| 18 | + } |
| 19 | + |
| 20 | + public func descriptionFields() -> (String, [(String, Any)]) { |
| 21 | + switch self { |
| 22 | + case .starsRating(let flags, let level, let currentLevelStars, let stars, let nextLevelStars): |
| 23 | + return ("starsRating", [("flags", flags as Any), ("level", level as Any), ("currentLevelStars", currentLevelStars as Any), ("stars", stars as Any), ("nextLevelStars", nextLevelStars as Any)]) |
| 24 | + } |
| 25 | + } |
| 26 | + |
| 27 | + public static func parse_starsRating(_ reader: BufferReader) -> StarsRating? { |
| 28 | + var _1: Int32? |
| 29 | + _1 = reader.readInt32() |
| 30 | + var _2: Int32? |
| 31 | + _2 = reader.readInt32() |
| 32 | + var _3: Int64? |
| 33 | + _3 = reader.readInt64() |
| 34 | + var _4: Int64? |
| 35 | + _4 = reader.readInt64() |
| 36 | + var _5: Int64? |
| 37 | + if Int(_1!) & Int(1 << 0) != 0 {_5 = reader.readInt64() } |
| 38 | + let _c1 = _1 != nil |
| 39 | + let _c2 = _2 != nil |
| 40 | + let _c3 = _3 != nil |
| 41 | + let _c4 = _4 != nil |
| 42 | + let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil |
| 43 | + if _c1 && _c2 && _c3 && _c4 && _c5 { |
| 44 | + return Api.StarsRating.starsRating(flags: _1!, level: _2!, currentLevelStars: _3!, stars: _4!, nextLevelStars: _5) |
| 45 | + } |
| 46 | + else { |
| 47 | + return nil |
| 48 | + } |
| 49 | + } |
| 50 | + |
| 51 | + } |
| 52 | +} |
1 | 53 | public extension Api { |
2 | 54 | enum StarsRevenueStatus: TypeConstructorDescription { |
3 | 55 | case starsRevenueStatus(flags: Int32, currentBalance: Api.StarsAmount, availableBalance: Api.StarsAmount, overallRevenue: Api.StarsAmount, nextWithdrawalAt: Int32?) |
@@ -1236,59 +1288,3 @@ public extension Api { |
1236 | 1288 |
|
1237 | 1289 | } |
1238 | 1290 | } |
1239 | | -public extension Api { |
1240 | | - enum StoryAlbum: TypeConstructorDescription { |
1241 | | - case storyAlbum(flags: Int32, albumId: Int32, title: String, iconPhoto: Api.Photo?, iconVideo: Api.Document?) |
1242 | | - |
1243 | | - public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) { |
1244 | | - switch self { |
1245 | | - case .storyAlbum(let flags, let albumId, let title, let iconPhoto, let iconVideo): |
1246 | | - if boxed { |
1247 | | - buffer.appendInt32(-1826262950) |
1248 | | - } |
1249 | | - serializeInt32(flags, buffer: buffer, boxed: false) |
1250 | | - serializeInt32(albumId, buffer: buffer, boxed: false) |
1251 | | - serializeString(title, buffer: buffer, boxed: false) |
1252 | | - if Int(flags) & Int(1 << 0) != 0 {iconPhoto!.serialize(buffer, true)} |
1253 | | - if Int(flags) & Int(1 << 1) != 0 {iconVideo!.serialize(buffer, true)} |
1254 | | - break |
1255 | | - } |
1256 | | - } |
1257 | | - |
1258 | | - public func descriptionFields() -> (String, [(String, Any)]) { |
1259 | | - switch self { |
1260 | | - case .storyAlbum(let flags, let albumId, let title, let iconPhoto, let iconVideo): |
1261 | | - return ("storyAlbum", [("flags", flags as Any), ("albumId", albumId as Any), ("title", title as Any), ("iconPhoto", iconPhoto as Any), ("iconVideo", iconVideo as Any)]) |
1262 | | - } |
1263 | | - } |
1264 | | - |
1265 | | - public static func parse_storyAlbum(_ reader: BufferReader) -> StoryAlbum? { |
1266 | | - var _1: Int32? |
1267 | | - _1 = reader.readInt32() |
1268 | | - var _2: Int32? |
1269 | | - _2 = reader.readInt32() |
1270 | | - var _3: String? |
1271 | | - _3 = parseString(reader) |
1272 | | - var _4: Api.Photo? |
1273 | | - if Int(_1!) & Int(1 << 0) != 0 {if let signature = reader.readInt32() { |
1274 | | - _4 = Api.parse(reader, signature: signature) as? Api.Photo |
1275 | | - } } |
1276 | | - var _5: Api.Document? |
1277 | | - if Int(_1!) & Int(1 << 1) != 0 {if let signature = reader.readInt32() { |
1278 | | - _5 = Api.parse(reader, signature: signature) as? Api.Document |
1279 | | - } } |
1280 | | - let _c1 = _1 != nil |
1281 | | - let _c2 = _2 != nil |
1282 | | - let _c3 = _3 != nil |
1283 | | - let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil |
1284 | | - let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil |
1285 | | - if _c1 && _c2 && _c3 && _c4 && _c5 { |
1286 | | - return Api.StoryAlbum.storyAlbum(flags: _1!, albumId: _2!, title: _3!, iconPhoto: _4, iconVideo: _5) |
1287 | | - } |
1288 | | - else { |
1289 | | - return nil |
1290 | | - } |
1291 | | - } |
1292 | | - |
1293 | | - } |
1294 | | -} |
0 commit comments