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
00af1d8816
commit
adaf13a008
@ -908,7 +908,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
|||||||
dict[1577421297] = { return Api.StarsGiftOption.parse_starsGiftOption($0) }
|
dict[1577421297] = { return Api.StarsGiftOption.parse_starsGiftOption($0) }
|
||||||
dict[-1798404822] = { return Api.StarsGiveawayOption.parse_starsGiveawayOption($0) }
|
dict[-1798404822] = { return Api.StarsGiveawayOption.parse_starsGiveawayOption($0) }
|
||||||
dict[1411605001] = { return Api.StarsGiveawayWinnersOption.parse_starsGiveawayWinnersOption($0) }
|
dict[1411605001] = { return Api.StarsGiveawayWinnersOption.parse_starsGiveawayWinnersOption($0) }
|
||||||
dict[2033461574] = { return Api.StarsRevenueStatus.parse_starsRevenueStatus($0) }
|
dict[-21080943] = { return Api.StarsRevenueStatus.parse_starsRevenueStatus($0) }
|
||||||
dict[779004698] = { return Api.StarsSubscription.parse_starsSubscription($0) }
|
dict[779004698] = { return Api.StarsSubscription.parse_starsSubscription($0) }
|
||||||
dict[88173912] = { return Api.StarsSubscriptionPricing.parse_starsSubscriptionPricing($0) }
|
dict[88173912] = { return Api.StarsSubscriptionPricing.parse_starsSubscriptionPricing($0) }
|
||||||
dict[198776256] = { return Api.StarsTopupOption.parse_starsTopupOption($0) }
|
dict[198776256] = { return Api.StarsTopupOption.parse_starsTopupOption($0) }
|
||||||
|
@ -904,18 +904,18 @@ public extension Api {
|
|||||||
}
|
}
|
||||||
public extension Api {
|
public extension Api {
|
||||||
enum StarsRevenueStatus: TypeConstructorDescription {
|
enum StarsRevenueStatus: TypeConstructorDescription {
|
||||||
case starsRevenueStatus(flags: Int32, currentBalance: Int64, availableBalance: Int64, overallRevenue: Int64, nextWithdrawalAt: Int32?)
|
case starsRevenueStatus(flags: Int32, currentBalance: Api.StarsAmount, availableBalance: Api.StarsAmount, overallRevenue: Api.StarsAmount, nextWithdrawalAt: Int32?)
|
||||||
|
|
||||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||||
switch self {
|
switch self {
|
||||||
case .starsRevenueStatus(let flags, let currentBalance, let availableBalance, let overallRevenue, let nextWithdrawalAt):
|
case .starsRevenueStatus(let flags, let currentBalance, let availableBalance, let overallRevenue, let nextWithdrawalAt):
|
||||||
if boxed {
|
if boxed {
|
||||||
buffer.appendInt32(2033461574)
|
buffer.appendInt32(-21080943)
|
||||||
}
|
}
|
||||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||||
serializeInt64(currentBalance, buffer: buffer, boxed: false)
|
currentBalance.serialize(buffer, true)
|
||||||
serializeInt64(availableBalance, buffer: buffer, boxed: false)
|
availableBalance.serialize(buffer, true)
|
||||||
serializeInt64(overallRevenue, buffer: buffer, boxed: false)
|
overallRevenue.serialize(buffer, true)
|
||||||
if Int(flags) & Int(1 << 1) != 0 {serializeInt32(nextWithdrawalAt!, buffer: buffer, boxed: false)}
|
if Int(flags) & Int(1 << 1) != 0 {serializeInt32(nextWithdrawalAt!, buffer: buffer, boxed: false)}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -931,12 +931,18 @@ public extension Api {
|
|||||||
public static func parse_starsRevenueStatus(_ reader: BufferReader) -> StarsRevenueStatus? {
|
public static func parse_starsRevenueStatus(_ reader: BufferReader) -> StarsRevenueStatus? {
|
||||||
var _1: Int32?
|
var _1: Int32?
|
||||||
_1 = reader.readInt32()
|
_1 = reader.readInt32()
|
||||||
var _2: Int64?
|
var _2: Api.StarsAmount?
|
||||||
_2 = reader.readInt64()
|
if let signature = reader.readInt32() {
|
||||||
var _3: Int64?
|
_2 = Api.parse(reader, signature: signature) as? Api.StarsAmount
|
||||||
_3 = reader.readInt64()
|
}
|
||||||
var _4: Int64?
|
var _3: Api.StarsAmount?
|
||||||
_4 = reader.readInt64()
|
if let signature = reader.readInt32() {
|
||||||
|
_3 = Api.parse(reader, signature: signature) as? Api.StarsAmount
|
||||||
|
}
|
||||||
|
var _4: Api.StarsAmount?
|
||||||
|
if let signature = reader.readInt32() {
|
||||||
|
_4 = Api.parse(reader, signature: signature) as? Api.StarsAmount
|
||||||
|
}
|
||||||
var _5: Int32?
|
var _5: Int32?
|
||||||
if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() }
|
if Int(_1!) & Int(1 << 1) != 0 {_5 = reader.readInt32() }
|
||||||
let _c1 = _1 != nil
|
let _c1 = _1 != nil
|
||||||
|
@ -146,7 +146,7 @@ extension StarsRevenueStats.Balances {
|
|||||||
init(apiStarsRevenueStatus: Api.StarsRevenueStatus) {
|
init(apiStarsRevenueStatus: Api.StarsRevenueStatus) {
|
||||||
switch apiStarsRevenueStatus {
|
switch apiStarsRevenueStatus {
|
||||||
case let .starsRevenueStatus(flags, currentBalance, availableBalance, overallRevenue, nextWithdrawalAt):
|
case let .starsRevenueStatus(flags, currentBalance, availableBalance, overallRevenue, nextWithdrawalAt):
|
||||||
self.init(currentBalance: StarsAmount(value: currentBalance, nanos: 0), availableBalance: StarsAmount(value: availableBalance, nanos: 0), overallRevenue: StarsAmount(value: overallRevenue, nanos: 0), withdrawEnabled: ((flags & (1 << 0)) != 0), nextWithdrawalTimestamp: nextWithdrawalAt)
|
self.init(currentBalance: StarsAmount(apiAmount: currentBalance), availableBalance: StarsAmount(apiAmount: availableBalance), overallRevenue: StarsAmount(apiAmount: overallRevenue), withdrawEnabled: ((flags & (1 << 0)) != 0), nextWithdrawalTimestamp: nextWithdrawalAt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user