1852 lines
85 KiB
Swift
1852 lines
85 KiB
Swift
public extension Api {
|
|
indirect enum PageCaption: TypeConstructorDescription {
|
|
public class Cons_pageCaption: TypeConstructorDescription {
|
|
public var text: Api.RichText
|
|
public var credit: Api.RichText
|
|
public init(text: Api.RichText, credit: Api.RichText) {
|
|
self.text = text
|
|
self.credit = credit
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageCaption", [("text", ConstructorParameterDescription(self.text)), ("credit", ConstructorParameterDescription(self.credit))])
|
|
}
|
|
}
|
|
case pageCaption(Cons_pageCaption)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .pageCaption(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(1869903447)
|
|
}
|
|
_data.text.serialize(buffer, true)
|
|
_data.credit.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .pageCaption(let _data):
|
|
return ("pageCaption", [("text", ConstructorParameterDescription(_data.text)), ("credit", ConstructorParameterDescription(_data.credit))])
|
|
}
|
|
}
|
|
|
|
public static func parse_pageCaption(_ reader: BufferReader) -> PageCaption? {
|
|
var _1: Api.RichText?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
|
}
|
|
var _2: Api.RichText?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.RichText
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PageCaption.pageCaption(Cons_pageCaption(text: _1!, credit: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
indirect enum PageListItem: TypeConstructorDescription {
|
|
public class Cons_pageListItemBlocks: TypeConstructorDescription {
|
|
public var blocks: [Api.PageBlock]
|
|
public init(blocks: [Api.PageBlock]) {
|
|
self.blocks = blocks
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageListItemBlocks", [("blocks", ConstructorParameterDescription(self.blocks))])
|
|
}
|
|
}
|
|
public class Cons_pageListItemText: TypeConstructorDescription {
|
|
public var text: Api.RichText
|
|
public init(text: Api.RichText) {
|
|
self.text = text
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageListItemText", [("text", ConstructorParameterDescription(self.text))])
|
|
}
|
|
}
|
|
case pageListItemBlocks(Cons_pageListItemBlocks)
|
|
case pageListItemText(Cons_pageListItemText)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .pageListItemBlocks(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(635466748)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(_data.blocks.count))
|
|
for item in _data.blocks {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
case .pageListItemText(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1188055347)
|
|
}
|
|
_data.text.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .pageListItemBlocks(let _data):
|
|
return ("pageListItemBlocks", [("blocks", ConstructorParameterDescription(_data.blocks))])
|
|
case .pageListItemText(let _data):
|
|
return ("pageListItemText", [("text", ConstructorParameterDescription(_data.text))])
|
|
}
|
|
}
|
|
|
|
public static func parse_pageListItemBlocks(_ reader: BufferReader) -> PageListItem? {
|
|
var _1: [Api.PageBlock]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.PageListItem.pageListItemBlocks(Cons_pageListItemBlocks(blocks: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_pageListItemText(_ reader: BufferReader) -> PageListItem? {
|
|
var _1: Api.RichText?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.RichText
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.PageListItem.pageListItemText(Cons_pageListItemText(text: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
indirect enum PageListOrderedItem: TypeConstructorDescription {
|
|
public class Cons_pageListOrderedItemBlocks: TypeConstructorDescription {
|
|
public var num: String
|
|
public var blocks: [Api.PageBlock]
|
|
public init(num: String, blocks: [Api.PageBlock]) {
|
|
self.num = num
|
|
self.blocks = blocks
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageListOrderedItemBlocks", [("num", ConstructorParameterDescription(self.num)), ("blocks", ConstructorParameterDescription(self.blocks))])
|
|
}
|
|
}
|
|
public class Cons_pageListOrderedItemText: TypeConstructorDescription {
|
|
public var num: String
|
|
public var text: Api.RichText
|
|
public init(num: String, text: Api.RichText) {
|
|
self.num = num
|
|
self.text = text
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageListOrderedItemText", [("num", ConstructorParameterDescription(self.num)), ("text", ConstructorParameterDescription(self.text))])
|
|
}
|
|
}
|
|
case pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks)
|
|
case pageListOrderedItemText(Cons_pageListOrderedItemText)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .pageListOrderedItemBlocks(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1730311882)
|
|
}
|
|
serializeString(_data.num, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(_data.blocks.count))
|
|
for item in _data.blocks {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
case .pageListOrderedItemText(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(1577484359)
|
|
}
|
|
serializeString(_data.num, buffer: buffer, boxed: false)
|
|
_data.text.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .pageListOrderedItemBlocks(let _data):
|
|
return ("pageListOrderedItemBlocks", [("num", ConstructorParameterDescription(_data.num)), ("blocks", ConstructorParameterDescription(_data.blocks))])
|
|
case .pageListOrderedItemText(let _data):
|
|
return ("pageListOrderedItemText", [("num", ConstructorParameterDescription(_data.num)), ("text", ConstructorParameterDescription(_data.text))])
|
|
}
|
|
}
|
|
|
|
public static func parse_pageListOrderedItemBlocks(_ reader: BufferReader) -> PageListOrderedItem? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: [Api.PageBlock]?
|
|
if let _ = reader.readInt32() {
|
|
_2 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageBlock.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PageListOrderedItem.pageListOrderedItemBlocks(Cons_pageListOrderedItemBlocks(num: _1!, blocks: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_pageListOrderedItemText(_ reader: BufferReader) -> PageListOrderedItem? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: Api.RichText?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.RichText
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PageListOrderedItem.pageListOrderedItemText(Cons_pageListOrderedItemText(num: _1!, text: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PageRelatedArticle: TypeConstructorDescription {
|
|
public class Cons_pageRelatedArticle: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var url: String
|
|
public var webpageId: Int64
|
|
public var title: String?
|
|
public var description: String?
|
|
public var photoId: Int64?
|
|
public var author: String?
|
|
public var publishedDate: Int32?
|
|
public init(flags: Int32, url: String, webpageId: Int64, title: String?, description: String?, photoId: Int64?, author: String?, publishedDate: Int32?) {
|
|
self.flags = flags
|
|
self.url = url
|
|
self.webpageId = webpageId
|
|
self.title = title
|
|
self.description = description
|
|
self.photoId = photoId
|
|
self.author = author
|
|
self.publishedDate = publishedDate
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageRelatedArticle", [("flags", ConstructorParameterDescription(self.flags)), ("url", ConstructorParameterDescription(self.url)), ("webpageId", ConstructorParameterDescription(self.webpageId)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("photoId", ConstructorParameterDescription(self.photoId)), ("author", ConstructorParameterDescription(self.author)), ("publishedDate", ConstructorParameterDescription(self.publishedDate))])
|
|
}
|
|
}
|
|
case pageRelatedArticle(Cons_pageRelatedArticle)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .pageRelatedArticle(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1282352120)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
serializeString(_data.url, buffer: buffer, boxed: false)
|
|
serializeInt64(_data.webpageId, buffer: buffer, boxed: false)
|
|
if Int(_data.flags) & Int(1 << 0) != 0 {
|
|
serializeString(_data.title!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 1) != 0 {
|
|
serializeString(_data.description!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 2) != 0 {
|
|
serializeInt64(_data.photoId!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 3) != 0 {
|
|
serializeString(_data.author!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 4) != 0 {
|
|
serializeInt32(_data.publishedDate!, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .pageRelatedArticle(let _data):
|
|
return ("pageRelatedArticle", [("flags", ConstructorParameterDescription(_data.flags)), ("url", ConstructorParameterDescription(_data.url)), ("webpageId", ConstructorParameterDescription(_data.webpageId)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("photoId", ConstructorParameterDescription(_data.photoId)), ("author", ConstructorParameterDescription(_data.author)), ("publishedDate", ConstructorParameterDescription(_data.publishedDate))])
|
|
}
|
|
}
|
|
|
|
public static func parse_pageRelatedArticle(_ reader: BufferReader) -> PageRelatedArticle? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: Int64?
|
|
_3 = reader.readInt64()
|
|
var _4: String?
|
|
if Int(_1!) & Int(1 << 0) != 0 {
|
|
_4 = parseString(reader)
|
|
}
|
|
var _5: String?
|
|
if Int(_1!) & Int(1 << 1) != 0 {
|
|
_5 = parseString(reader)
|
|
}
|
|
var _6: Int64?
|
|
if Int(_1!) & Int(1 << 2) != 0 {
|
|
_6 = reader.readInt64()
|
|
}
|
|
var _7: String?
|
|
if Int(_1!) & Int(1 << 3) != 0 {
|
|
_7 = parseString(reader)
|
|
}
|
|
var _8: Int32?
|
|
if Int(_1!) & Int(1 << 4) != 0 {
|
|
_8 = reader.readInt32()
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 0) == 0) || _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 1) == 0) || _5 != nil
|
|
let _c6 = (Int(_1!) & Int(1 << 2) == 0) || _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 3) == 0) || _7 != nil
|
|
let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
|
|
return Api.PageRelatedArticle.pageRelatedArticle(Cons_pageRelatedArticle(flags: _1!, url: _2!, webpageId: _3!, title: _4, description: _5, photoId: _6, author: _7, publishedDate: _8))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
indirect enum PageTableCell: TypeConstructorDescription {
|
|
public class Cons_pageTableCell: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var text: Api.RichText?
|
|
public var colspan: Int32?
|
|
public var rowspan: Int32?
|
|
public init(flags: Int32, text: Api.RichText?, colspan: Int32?, rowspan: Int32?) {
|
|
self.flags = flags
|
|
self.text = text
|
|
self.colspan = colspan
|
|
self.rowspan = rowspan
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageTableCell", [("flags", ConstructorParameterDescription(self.flags)), ("text", ConstructorParameterDescription(self.text)), ("colspan", ConstructorParameterDescription(self.colspan)), ("rowspan", ConstructorParameterDescription(self.rowspan))])
|
|
}
|
|
}
|
|
case pageTableCell(Cons_pageTableCell)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .pageTableCell(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(878078826)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
if Int(_data.flags) & Int(1 << 7) != 0 {
|
|
_data.text!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 1) != 0 {
|
|
serializeInt32(_data.colspan!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 2) != 0 {
|
|
serializeInt32(_data.rowspan!, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .pageTableCell(let _data):
|
|
return ("pageTableCell", [("flags", ConstructorParameterDescription(_data.flags)), ("text", ConstructorParameterDescription(_data.text)), ("colspan", ConstructorParameterDescription(_data.colspan)), ("rowspan", ConstructorParameterDescription(_data.rowspan))])
|
|
}
|
|
}
|
|
|
|
public static func parse_pageTableCell(_ reader: BufferReader) -> PageTableCell? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.RichText?
|
|
if Int(_1!) & Int(1 << 7) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.RichText
|
|
}
|
|
}
|
|
var _3: Int32?
|
|
if Int(_1!) & Int(1 << 1) != 0 {
|
|
_3 = reader.readInt32()
|
|
}
|
|
var _4: Int32?
|
|
if Int(_1!) & Int(1 << 2) != 0 {
|
|
_4 = reader.readInt32()
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 7) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.PageTableCell.pageTableCell(Cons_pageTableCell(flags: _1!, text: _2, colspan: _3, rowspan: _4))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PageTableRow: TypeConstructorDescription {
|
|
public class Cons_pageTableRow: TypeConstructorDescription {
|
|
public var cells: [Api.PageTableCell]
|
|
public init(cells: [Api.PageTableCell]) {
|
|
self.cells = cells
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pageTableRow", [("cells", ConstructorParameterDescription(self.cells))])
|
|
}
|
|
}
|
|
case pageTableRow(Cons_pageTableRow)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .pageTableRow(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-524237339)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(_data.cells.count))
|
|
for item in _data.cells {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .pageTableRow(let _data):
|
|
return ("pageTableRow", [("cells", ConstructorParameterDescription(_data.cells))])
|
|
}
|
|
}
|
|
|
|
public static func parse_pageTableRow(_ reader: BufferReader) -> PageTableRow? {
|
|
var _1: [Api.PageTableCell]?
|
|
if let _ = reader.readInt32() {
|
|
_1 = Api.parseVector(reader, elementSignature: 0, elementType: Api.PageTableCell.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.PageTableRow.pageTableRow(Cons_pageTableRow(cells: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
indirect enum PaidReactionPrivacy: TypeConstructorDescription {
|
|
public class Cons_paidReactionPrivacyPeer: TypeConstructorDescription {
|
|
public var peer: Api.InputPeer
|
|
public init(peer: Api.InputPeer) {
|
|
self.peer = peer
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(self.peer))])
|
|
}
|
|
}
|
|
case paidReactionPrivacyAnonymous
|
|
case paidReactionPrivacyDefault
|
|
case paidReactionPrivacyPeer(Cons_paidReactionPrivacyPeer)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .paidReactionPrivacyAnonymous:
|
|
if boxed {
|
|
buffer.appendInt32(520887001)
|
|
}
|
|
break
|
|
case .paidReactionPrivacyDefault:
|
|
if boxed {
|
|
buffer.appendInt32(543872158)
|
|
}
|
|
break
|
|
case .paidReactionPrivacyPeer(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-596837136)
|
|
}
|
|
_data.peer.serialize(buffer, true)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .paidReactionPrivacyAnonymous:
|
|
return ("paidReactionPrivacyAnonymous", [])
|
|
case .paidReactionPrivacyDefault:
|
|
return ("paidReactionPrivacyDefault", [])
|
|
case .paidReactionPrivacyPeer(let _data):
|
|
return ("paidReactionPrivacyPeer", [("peer", ConstructorParameterDescription(_data.peer))])
|
|
}
|
|
}
|
|
|
|
public static func parse_paidReactionPrivacyAnonymous(_ reader: BufferReader) -> PaidReactionPrivacy? {
|
|
return Api.PaidReactionPrivacy.paidReactionPrivacyAnonymous
|
|
}
|
|
public static func parse_paidReactionPrivacyDefault(_ reader: BufferReader) -> PaidReactionPrivacy? {
|
|
return Api.PaidReactionPrivacy.paidReactionPrivacyDefault
|
|
}
|
|
public static func parse_paidReactionPrivacyPeer(_ reader: BufferReader) -> PaidReactionPrivacy? {
|
|
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.PaidReactionPrivacy.paidReactionPrivacyPeer(Cons_paidReactionPrivacyPeer(peer: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum Passkey: TypeConstructorDescription {
|
|
public class Cons_passkey: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var id: String
|
|
public var name: String
|
|
public var date: Int32
|
|
public var softwareEmojiId: Int64?
|
|
public var lastUsageDate: Int32?
|
|
public init(flags: Int32, id: String, name: String, date: Int32, softwareEmojiId: Int64?, lastUsageDate: Int32?) {
|
|
self.flags = flags
|
|
self.id = id
|
|
self.name = name
|
|
self.date = date
|
|
self.softwareEmojiId = softwareEmojiId
|
|
self.lastUsageDate = lastUsageDate
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("passkey", [("flags", ConstructorParameterDescription(self.flags)), ("id", ConstructorParameterDescription(self.id)), ("name", ConstructorParameterDescription(self.name)), ("date", ConstructorParameterDescription(self.date)), ("softwareEmojiId", ConstructorParameterDescription(self.softwareEmojiId)), ("lastUsageDate", ConstructorParameterDescription(self.lastUsageDate))])
|
|
}
|
|
}
|
|
case passkey(Cons_passkey)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .passkey(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1738457409)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
serializeString(_data.id, buffer: buffer, boxed: false)
|
|
serializeString(_data.name, buffer: buffer, boxed: false)
|
|
serializeInt32(_data.date, buffer: buffer, boxed: false)
|
|
if Int(_data.flags) & Int(1 << 0) != 0 {
|
|
serializeInt64(_data.softwareEmojiId!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 1) != 0 {
|
|
serializeInt32(_data.lastUsageDate!, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .passkey(let _data):
|
|
return ("passkey", [("flags", ConstructorParameterDescription(_data.flags)), ("id", ConstructorParameterDescription(_data.id)), ("name", ConstructorParameterDescription(_data.name)), ("date", ConstructorParameterDescription(_data.date)), ("softwareEmojiId", ConstructorParameterDescription(_data.softwareEmojiId)), ("lastUsageDate", ConstructorParameterDescription(_data.lastUsageDate))])
|
|
}
|
|
}
|
|
|
|
public static func parse_passkey(_ reader: BufferReader) -> Passkey? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
var _3: String?
|
|
_3 = parseString(reader)
|
|
var _4: Int32?
|
|
_4 = reader.readInt32()
|
|
var _5: Int64?
|
|
if Int(_1!) & Int(1 << 0) != 0 {
|
|
_5 = reader.readInt64()
|
|
}
|
|
var _6: Int32?
|
|
if Int(_1!) & Int(1 << 1) != 0 {
|
|
_6 = reader.readInt32()
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 0) == 0) || _5 != nil
|
|
let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 {
|
|
return Api.Passkey.passkey(Cons_passkey(flags: _1!, id: _2!, name: _3!, date: _4!, softwareEmojiId: _5, lastUsageDate: _6))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PasswordKdfAlgo: TypeConstructorDescription {
|
|
public class Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow: TypeConstructorDescription {
|
|
public var salt1: Buffer
|
|
public var salt2: Buffer
|
|
public var g: Int32
|
|
public var p: Buffer
|
|
public init(salt1: Buffer, salt2: Buffer, g: Int32, p: Buffer) {
|
|
self.salt1 = salt1
|
|
self.salt2 = salt2
|
|
self.g = g
|
|
self.p = p
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", ConstructorParameterDescription(self.salt1)), ("salt2", ConstructorParameterDescription(self.salt2)), ("g", ConstructorParameterDescription(self.g)), ("p", ConstructorParameterDescription(self.p))])
|
|
}
|
|
}
|
|
case passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)
|
|
case passwordKdfAlgoUnknown
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(982592842)
|
|
}
|
|
serializeBytes(_data.salt1, buffer: buffer, boxed: false)
|
|
serializeBytes(_data.salt2, buffer: buffer, boxed: false)
|
|
serializeInt32(_data.g, buffer: buffer, boxed: false)
|
|
serializeBytes(_data.p, buffer: buffer, boxed: false)
|
|
break
|
|
case .passwordKdfAlgoUnknown:
|
|
if boxed {
|
|
buffer.appendInt32(-732254058)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(let _data):
|
|
return ("passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow", [("salt1", ConstructorParameterDescription(_data.salt1)), ("salt2", ConstructorParameterDescription(_data.salt2)), ("g", ConstructorParameterDescription(_data.g)), ("p", ConstructorParameterDescription(_data.p))])
|
|
case .passwordKdfAlgoUnknown:
|
|
return ("passwordKdfAlgoUnknown", [])
|
|
}
|
|
}
|
|
|
|
public static func parse_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(_ reader: BufferReader) -> PasswordKdfAlgo? {
|
|
var _1: Buffer?
|
|
_1 = parseBytes(reader)
|
|
var _2: Buffer?
|
|
_2 = parseBytes(reader)
|
|
var _3: Int32?
|
|
_3 = reader.readInt32()
|
|
var _4: Buffer?
|
|
_4 = parseBytes(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.PasswordKdfAlgo.passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(Cons_passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow(salt1: _1!, salt2: _2!, g: _3!, p: _4!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_passwordKdfAlgoUnknown(_ reader: BufferReader) -> PasswordKdfAlgo? {
|
|
return Api.PasswordKdfAlgo.passwordKdfAlgoUnknown
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PaymentCharge: TypeConstructorDescription {
|
|
public class Cons_paymentCharge: TypeConstructorDescription {
|
|
public var id: String
|
|
public var providerChargeId: String
|
|
public init(id: String, providerChargeId: String) {
|
|
self.id = id
|
|
self.providerChargeId = providerChargeId
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("paymentCharge", [("id", ConstructorParameterDescription(self.id)), ("providerChargeId", ConstructorParameterDescription(self.providerChargeId))])
|
|
}
|
|
}
|
|
case paymentCharge(Cons_paymentCharge)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .paymentCharge(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-368917890)
|
|
}
|
|
serializeString(_data.id, buffer: buffer, boxed: false)
|
|
serializeString(_data.providerChargeId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .paymentCharge(let _data):
|
|
return ("paymentCharge", [("id", ConstructorParameterDescription(_data.id)), ("providerChargeId", ConstructorParameterDescription(_data.providerChargeId))])
|
|
}
|
|
}
|
|
|
|
public static func parse_paymentCharge(_ reader: BufferReader) -> PaymentCharge? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PaymentCharge.paymentCharge(Cons_paymentCharge(id: _1!, providerChargeId: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PaymentFormMethod: TypeConstructorDescription {
|
|
public class Cons_paymentFormMethod: TypeConstructorDescription {
|
|
public var url: String
|
|
public var title: String
|
|
public init(url: String, title: String) {
|
|
self.url = url
|
|
self.title = title
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("paymentFormMethod", [("url", ConstructorParameterDescription(self.url)), ("title", ConstructorParameterDescription(self.title))])
|
|
}
|
|
}
|
|
case paymentFormMethod(Cons_paymentFormMethod)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .paymentFormMethod(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1996951013)
|
|
}
|
|
serializeString(_data.url, buffer: buffer, boxed: false)
|
|
serializeString(_data.title, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .paymentFormMethod(let _data):
|
|
return ("paymentFormMethod", [("url", ConstructorParameterDescription(_data.url)), ("title", ConstructorParameterDescription(_data.title))])
|
|
}
|
|
}
|
|
|
|
public static func parse_paymentFormMethod(_ reader: BufferReader) -> PaymentFormMethod? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PaymentFormMethod.paymentFormMethod(Cons_paymentFormMethod(url: _1!, title: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PaymentRequestedInfo: TypeConstructorDescription {
|
|
public class Cons_paymentRequestedInfo: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var name: String?
|
|
public var phone: String?
|
|
public var email: String?
|
|
public var shippingAddress: Api.PostAddress?
|
|
public init(flags: Int32, name: String?, phone: String?, email: String?, shippingAddress: Api.PostAddress?) {
|
|
self.flags = flags
|
|
self.name = name
|
|
self.phone = phone
|
|
self.email = email
|
|
self.shippingAddress = shippingAddress
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("paymentRequestedInfo", [("flags", ConstructorParameterDescription(self.flags)), ("name", ConstructorParameterDescription(self.name)), ("phone", ConstructorParameterDescription(self.phone)), ("email", ConstructorParameterDescription(self.email)), ("shippingAddress", ConstructorParameterDescription(self.shippingAddress))])
|
|
}
|
|
}
|
|
case paymentRequestedInfo(Cons_paymentRequestedInfo)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .paymentRequestedInfo(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1868808300)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
if Int(_data.flags) & Int(1 << 0) != 0 {
|
|
serializeString(_data.name!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 1) != 0 {
|
|
serializeString(_data.phone!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 2) != 0 {
|
|
serializeString(_data.email!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 3) != 0 {
|
|
_data.shippingAddress!.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .paymentRequestedInfo(let _data):
|
|
return ("paymentRequestedInfo", [("flags", ConstructorParameterDescription(_data.flags)), ("name", ConstructorParameterDescription(_data.name)), ("phone", ConstructorParameterDescription(_data.phone)), ("email", ConstructorParameterDescription(_data.email)), ("shippingAddress", ConstructorParameterDescription(_data.shippingAddress))])
|
|
}
|
|
}
|
|
|
|
public static func parse_paymentRequestedInfo(_ reader: BufferReader) -> PaymentRequestedInfo? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: String?
|
|
if Int(_1!) & Int(1 << 0) != 0 {
|
|
_2 = parseString(reader)
|
|
}
|
|
var _3: String?
|
|
if Int(_1!) & Int(1 << 1) != 0 {
|
|
_3 = parseString(reader)
|
|
}
|
|
var _4: String?
|
|
if Int(_1!) & Int(1 << 2) != 0 {
|
|
_4 = parseString(reader)
|
|
}
|
|
var _5: Api.PostAddress?
|
|
if Int(_1!) & Int(1 << 3) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_5 = Api.parse(reader, signature: signature) as? Api.PostAddress
|
|
}
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
|
return Api.PaymentRequestedInfo.paymentRequestedInfo(Cons_paymentRequestedInfo(flags: _1!, name: _2, phone: _3, email: _4, shippingAddress: _5))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PaymentSavedCredentials: TypeConstructorDescription {
|
|
public class Cons_paymentSavedCredentialsCard: TypeConstructorDescription {
|
|
public var id: String
|
|
public var title: String
|
|
public init(id: String, title: String) {
|
|
self.id = id
|
|
self.title = title
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(self.id)), ("title", ConstructorParameterDescription(self.title))])
|
|
}
|
|
}
|
|
case paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .paymentSavedCredentialsCard(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-842892769)
|
|
}
|
|
serializeString(_data.id, buffer: buffer, boxed: false)
|
|
serializeString(_data.title, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .paymentSavedCredentialsCard(let _data):
|
|
return ("paymentSavedCredentialsCard", [("id", ConstructorParameterDescription(_data.id)), ("title", ConstructorParameterDescription(_data.title))])
|
|
}
|
|
}
|
|
|
|
public static func parse_paymentSavedCredentialsCard(_ reader: BufferReader) -> PaymentSavedCredentials? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: String?
|
|
_2 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PaymentSavedCredentials.paymentSavedCredentialsCard(Cons_paymentSavedCredentialsCard(id: _1!, title: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum Peer: TypeConstructorDescription {
|
|
public class Cons_peerChannel: TypeConstructorDescription {
|
|
public var channelId: Int64
|
|
public init(channelId: Int64) {
|
|
self.channelId = channelId
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerChannel", [("channelId", ConstructorParameterDescription(self.channelId))])
|
|
}
|
|
}
|
|
public class Cons_peerChat: TypeConstructorDescription {
|
|
public var chatId: Int64
|
|
public init(chatId: Int64) {
|
|
self.chatId = chatId
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerChat", [("chatId", ConstructorParameterDescription(self.chatId))])
|
|
}
|
|
}
|
|
public class Cons_peerUser: TypeConstructorDescription {
|
|
public var userId: Int64
|
|
public init(userId: Int64) {
|
|
self.userId = userId
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerUser", [("userId", ConstructorParameterDescription(self.userId))])
|
|
}
|
|
}
|
|
case peerChannel(Cons_peerChannel)
|
|
case peerChat(Cons_peerChat)
|
|
case peerUser(Cons_peerUser)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .peerChannel(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1566230754)
|
|
}
|
|
serializeInt64(_data.channelId, buffer: buffer, boxed: false)
|
|
break
|
|
case .peerChat(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(918946202)
|
|
}
|
|
serializeInt64(_data.chatId, buffer: buffer, boxed: false)
|
|
break
|
|
case .peerUser(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(1498486562)
|
|
}
|
|
serializeInt64(_data.userId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .peerChannel(let _data):
|
|
return ("peerChannel", [("channelId", ConstructorParameterDescription(_data.channelId))])
|
|
case .peerChat(let _data):
|
|
return ("peerChat", [("chatId", ConstructorParameterDescription(_data.chatId))])
|
|
case .peerUser(let _data):
|
|
return ("peerUser", [("userId", ConstructorParameterDescription(_data.userId))])
|
|
}
|
|
}
|
|
|
|
public static func parse_peerChannel(_ reader: BufferReader) -> Peer? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.Peer.peerChannel(Cons_peerChannel(channelId: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_peerChat(_ reader: BufferReader) -> Peer? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.Peer.peerChat(Cons_peerChat(chatId: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_peerUser(_ reader: BufferReader) -> Peer? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.Peer.peerUser(Cons_peerUser(userId: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PeerBlocked: TypeConstructorDescription {
|
|
public class Cons_peerBlocked: TypeConstructorDescription {
|
|
public var peerId: Api.Peer
|
|
public var date: Int32
|
|
public init(peerId: Api.Peer, date: Int32) {
|
|
self.peerId = peerId
|
|
self.date = date
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerBlocked", [("peerId", ConstructorParameterDescription(self.peerId)), ("date", ConstructorParameterDescription(self.date))])
|
|
}
|
|
}
|
|
case peerBlocked(Cons_peerBlocked)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .peerBlocked(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-386039788)
|
|
}
|
|
_data.peerId.serialize(buffer, true)
|
|
serializeInt32(_data.date, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .peerBlocked(let _data):
|
|
return ("peerBlocked", [("peerId", ConstructorParameterDescription(_data.peerId)), ("date", ConstructorParameterDescription(_data.date))])
|
|
}
|
|
}
|
|
|
|
public static func parse_peerBlocked(_ reader: BufferReader) -> PeerBlocked? {
|
|
var _1: Api.Peer?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.Peer
|
|
}
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PeerBlocked.peerBlocked(Cons_peerBlocked(peerId: _1!, date: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PeerColor: TypeConstructorDescription {
|
|
public class Cons_inputPeerColorCollectible: TypeConstructorDescription {
|
|
public var collectibleId: Int64
|
|
public init(collectibleId: Int64) {
|
|
self.collectibleId = collectibleId
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(self.collectibleId))])
|
|
}
|
|
}
|
|
public class Cons_peerColor: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var color: Int32?
|
|
public var backgroundEmojiId: Int64?
|
|
public init(flags: Int32, color: Int32?, backgroundEmojiId: Int64?) {
|
|
self.flags = flags
|
|
self.color = color
|
|
self.backgroundEmojiId = backgroundEmojiId
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerColor", [("flags", ConstructorParameterDescription(self.flags)), ("color", ConstructorParameterDescription(self.color)), ("backgroundEmojiId", ConstructorParameterDescription(self.backgroundEmojiId))])
|
|
}
|
|
}
|
|
public class Cons_peerColorCollectible: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var collectibleId: Int64
|
|
public var giftEmojiId: Int64
|
|
public var backgroundEmojiId: Int64
|
|
public var accentColor: Int32
|
|
public var colors: [Int32]
|
|
public var darkAccentColor: Int32?
|
|
public var darkColors: [Int32]?
|
|
public init(flags: Int32, collectibleId: Int64, giftEmojiId: Int64, backgroundEmojiId: Int64, accentColor: Int32, colors: [Int32], darkAccentColor: Int32?, darkColors: [Int32]?) {
|
|
self.flags = flags
|
|
self.collectibleId = collectibleId
|
|
self.giftEmojiId = giftEmojiId
|
|
self.backgroundEmojiId = backgroundEmojiId
|
|
self.accentColor = accentColor
|
|
self.colors = colors
|
|
self.darkAccentColor = darkAccentColor
|
|
self.darkColors = darkColors
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerColorCollectible", [("flags", ConstructorParameterDescription(self.flags)), ("collectibleId", ConstructorParameterDescription(self.collectibleId)), ("giftEmojiId", ConstructorParameterDescription(self.giftEmojiId)), ("backgroundEmojiId", ConstructorParameterDescription(self.backgroundEmojiId)), ("accentColor", ConstructorParameterDescription(self.accentColor)), ("colors", ConstructorParameterDescription(self.colors)), ("darkAccentColor", ConstructorParameterDescription(self.darkAccentColor)), ("darkColors", ConstructorParameterDescription(self.darkColors))])
|
|
}
|
|
}
|
|
case inputPeerColorCollectible(Cons_inputPeerColorCollectible)
|
|
case peerColor(Cons_peerColor)
|
|
case peerColorCollectible(Cons_peerColorCollectible)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .inputPeerColorCollectible(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1192589655)
|
|
}
|
|
serializeInt64(_data.collectibleId, buffer: buffer, boxed: false)
|
|
break
|
|
case .peerColor(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1253352753)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
if Int(_data.flags) & Int(1 << 0) != 0 {
|
|
serializeInt32(_data.color!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 1) != 0 {
|
|
serializeInt64(_data.backgroundEmojiId!, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
case .peerColorCollectible(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1178573926)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
serializeInt64(_data.collectibleId, buffer: buffer, boxed: false)
|
|
serializeInt64(_data.giftEmojiId, buffer: buffer, boxed: false)
|
|
serializeInt64(_data.backgroundEmojiId, buffer: buffer, boxed: false)
|
|
serializeInt32(_data.accentColor, buffer: buffer, boxed: false)
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(_data.colors.count))
|
|
for item in _data.colors {
|
|
serializeInt32(item, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 0) != 0 {
|
|
serializeInt32(_data.darkAccentColor!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 1) != 0 {
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(_data.darkColors!.count))
|
|
for item in _data.darkColors! {
|
|
serializeInt32(item, buffer: buffer, boxed: false)
|
|
}
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .inputPeerColorCollectible(let _data):
|
|
return ("inputPeerColorCollectible", [("collectibleId", ConstructorParameterDescription(_data.collectibleId))])
|
|
case .peerColor(let _data):
|
|
return ("peerColor", [("flags", ConstructorParameterDescription(_data.flags)), ("color", ConstructorParameterDescription(_data.color)), ("backgroundEmojiId", ConstructorParameterDescription(_data.backgroundEmojiId))])
|
|
case .peerColorCollectible(let _data):
|
|
return ("peerColorCollectible", [("flags", ConstructorParameterDescription(_data.flags)), ("collectibleId", ConstructorParameterDescription(_data.collectibleId)), ("giftEmojiId", ConstructorParameterDescription(_data.giftEmojiId)), ("backgroundEmojiId", ConstructorParameterDescription(_data.backgroundEmojiId)), ("accentColor", ConstructorParameterDescription(_data.accentColor)), ("colors", ConstructorParameterDescription(_data.colors)), ("darkAccentColor", ConstructorParameterDescription(_data.darkAccentColor)), ("darkColors", ConstructorParameterDescription(_data.darkColors))])
|
|
}
|
|
}
|
|
|
|
public static func parse_inputPeerColorCollectible(_ reader: BufferReader) -> PeerColor? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.PeerColor.inputPeerColorCollectible(Cons_inputPeerColorCollectible(collectibleId: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_peerColor(_ reader: BufferReader) -> PeerColor? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int32?
|
|
if Int(_1!) & Int(1 << 0) != 0 {
|
|
_2 = reader.readInt32()
|
|
}
|
|
var _3: Int64?
|
|
if Int(_1!) & Int(1 << 1) != 0 {
|
|
_3 = reader.readInt64()
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.PeerColor.peerColor(Cons_peerColor(flags: _1!, color: _2, backgroundEmojiId: _3))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_peerColorCollectible(_ reader: BufferReader) -> PeerColor? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int64?
|
|
_2 = reader.readInt64()
|
|
var _3: Int64?
|
|
_3 = reader.readInt64()
|
|
var _4: Int64?
|
|
_4 = reader.readInt64()
|
|
var _5: Int32?
|
|
_5 = reader.readInt32()
|
|
var _6: [Int32]?
|
|
if let _ = reader.readInt32() {
|
|
_6 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self)
|
|
}
|
|
var _7: Int32?
|
|
if Int(_1!) & Int(1 << 0) != 0 {
|
|
_7 = reader.readInt32()
|
|
}
|
|
var _8: [Int32]?
|
|
if Int(_1!) & Int(1 << 1) != 0 {
|
|
if let _ = reader.readInt32() {
|
|
_8 = Api.parseVector(reader, elementSignature: -1471112230, elementType: Int32.self)
|
|
}
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
let _c5 = _5 != nil
|
|
let _c6 = _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 0) == 0) || _7 != nil
|
|
let _c8 = (Int(_1!) & Int(1 << 1) == 0) || _8 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
|
|
return Api.PeerColor.peerColorCollectible(Cons_peerColorCollectible(flags: _1!, collectibleId: _2!, giftEmojiId: _3!, backgroundEmojiId: _4!, accentColor: _5!, colors: _6!, darkAccentColor: _7, darkColors: _8))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PeerLocated: TypeConstructorDescription {
|
|
public class Cons_peerLocated: TypeConstructorDescription {
|
|
public var peer: Api.Peer
|
|
public var expires: Int32
|
|
public var distance: Int32
|
|
public init(peer: Api.Peer, expires: Int32, distance: Int32) {
|
|
self.peer = peer
|
|
self.expires = expires
|
|
self.distance = distance
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerLocated", [("peer", ConstructorParameterDescription(self.peer)), ("expires", ConstructorParameterDescription(self.expires)), ("distance", ConstructorParameterDescription(self.distance))])
|
|
}
|
|
}
|
|
public class Cons_peerSelfLocated: TypeConstructorDescription {
|
|
public var expires: Int32
|
|
public init(expires: Int32) {
|
|
self.expires = expires
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerSelfLocated", [("expires", ConstructorParameterDescription(self.expires))])
|
|
}
|
|
}
|
|
case peerLocated(Cons_peerLocated)
|
|
case peerSelfLocated(Cons_peerSelfLocated)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .peerLocated(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-901375139)
|
|
}
|
|
_data.peer.serialize(buffer, true)
|
|
serializeInt32(_data.expires, buffer: buffer, boxed: false)
|
|
serializeInt32(_data.distance, buffer: buffer, boxed: false)
|
|
break
|
|
case .peerSelfLocated(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-118740917)
|
|
}
|
|
serializeInt32(_data.expires, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .peerLocated(let _data):
|
|
return ("peerLocated", [("peer", ConstructorParameterDescription(_data.peer)), ("expires", ConstructorParameterDescription(_data.expires)), ("distance", ConstructorParameterDescription(_data.distance))])
|
|
case .peerSelfLocated(let _data):
|
|
return ("peerSelfLocated", [("expires", ConstructorParameterDescription(_data.expires))])
|
|
}
|
|
}
|
|
|
|
public static func parse_peerLocated(_ reader: BufferReader) -> PeerLocated? {
|
|
var _1: Api.Peer?
|
|
if let signature = reader.readInt32() {
|
|
_1 = Api.parse(reader, signature: signature) as? Api.Peer
|
|
}
|
|
var _2: Int32?
|
|
_2 = reader.readInt32()
|
|
var _3: Int32?
|
|
_3 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
if _c1 && _c2 && _c3 {
|
|
return Api.PeerLocated.peerLocated(Cons_peerLocated(peer: _1!, expires: _2!, distance: _3!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
public static func parse_peerSelfLocated(_ reader: BufferReader) -> PeerLocated? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
let _c1 = _1 != nil
|
|
if _c1 {
|
|
return Api.PeerLocated.peerSelfLocated(Cons_peerSelfLocated(expires: _1!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PeerNotifySettings: TypeConstructorDescription {
|
|
public class Cons_peerNotifySettings: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var showPreviews: Api.Bool?
|
|
public var silent: Api.Bool?
|
|
public var muteUntil: Int32?
|
|
public var iosSound: Api.NotificationSound?
|
|
public var androidSound: Api.NotificationSound?
|
|
public var otherSound: Api.NotificationSound?
|
|
public var storiesMuted: Api.Bool?
|
|
public var storiesHideSender: Api.Bool?
|
|
public var storiesIosSound: Api.NotificationSound?
|
|
public var storiesAndroidSound: Api.NotificationSound?
|
|
public var storiesOtherSound: Api.NotificationSound?
|
|
public init(flags: Int32, showPreviews: Api.Bool?, silent: Api.Bool?, muteUntil: Int32?, iosSound: Api.NotificationSound?, androidSound: Api.NotificationSound?, otherSound: Api.NotificationSound?, storiesMuted: Api.Bool?, storiesHideSender: Api.Bool?, storiesIosSound: Api.NotificationSound?, storiesAndroidSound: Api.NotificationSound?, storiesOtherSound: Api.NotificationSound?) {
|
|
self.flags = flags
|
|
self.showPreviews = showPreviews
|
|
self.silent = silent
|
|
self.muteUntil = muteUntil
|
|
self.iosSound = iosSound
|
|
self.androidSound = androidSound
|
|
self.otherSound = otherSound
|
|
self.storiesMuted = storiesMuted
|
|
self.storiesHideSender = storiesHideSender
|
|
self.storiesIosSound = storiesIosSound
|
|
self.storiesAndroidSound = storiesAndroidSound
|
|
self.storiesOtherSound = storiesOtherSound
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerNotifySettings", [("flags", ConstructorParameterDescription(self.flags)), ("showPreviews", ConstructorParameterDescription(self.showPreviews)), ("silent", ConstructorParameterDescription(self.silent)), ("muteUntil", ConstructorParameterDescription(self.muteUntil)), ("iosSound", ConstructorParameterDescription(self.iosSound)), ("androidSound", ConstructorParameterDescription(self.androidSound)), ("otherSound", ConstructorParameterDescription(self.otherSound)), ("storiesMuted", ConstructorParameterDescription(self.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(self.storiesHideSender)), ("storiesIosSound", ConstructorParameterDescription(self.storiesIosSound)), ("storiesAndroidSound", ConstructorParameterDescription(self.storiesAndroidSound)), ("storiesOtherSound", ConstructorParameterDescription(self.storiesOtherSound))])
|
|
}
|
|
}
|
|
case peerNotifySettings(Cons_peerNotifySettings)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .peerNotifySettings(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1721619444)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
if Int(_data.flags) & Int(1 << 0) != 0 {
|
|
_data.showPreviews!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 1) != 0 {
|
|
_data.silent!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 2) != 0 {
|
|
serializeInt32(_data.muteUntil!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 3) != 0 {
|
|
_data.iosSound!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 4) != 0 {
|
|
_data.androidSound!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 5) != 0 {
|
|
_data.otherSound!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 6) != 0 {
|
|
_data.storiesMuted!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 7) != 0 {
|
|
_data.storiesHideSender!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 8) != 0 {
|
|
_data.storiesIosSound!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 9) != 0 {
|
|
_data.storiesAndroidSound!.serialize(buffer, true)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 10) != 0 {
|
|
_data.storiesOtherSound!.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .peerNotifySettings(let _data):
|
|
return ("peerNotifySettings", [("flags", ConstructorParameterDescription(_data.flags)), ("showPreviews", ConstructorParameterDescription(_data.showPreviews)), ("silent", ConstructorParameterDescription(_data.silent)), ("muteUntil", ConstructorParameterDescription(_data.muteUntil)), ("iosSound", ConstructorParameterDescription(_data.iosSound)), ("androidSound", ConstructorParameterDescription(_data.androidSound)), ("otherSound", ConstructorParameterDescription(_data.otherSound)), ("storiesMuted", ConstructorParameterDescription(_data.storiesMuted)), ("storiesHideSender", ConstructorParameterDescription(_data.storiesHideSender)), ("storiesIosSound", ConstructorParameterDescription(_data.storiesIosSound)), ("storiesAndroidSound", ConstructorParameterDescription(_data.storiesAndroidSound)), ("storiesOtherSound", ConstructorParameterDescription(_data.storiesOtherSound))])
|
|
}
|
|
}
|
|
|
|
public static func parse_peerNotifySettings(_ reader: BufferReader) -> PeerNotifySettings? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.Bool?
|
|
if Int(_1!) & Int(1 << 0) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
}
|
|
}
|
|
var _3: Api.Bool?
|
|
if Int(_1!) & Int(1 << 1) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_3 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
}
|
|
}
|
|
var _4: Int32?
|
|
if Int(_1!) & Int(1 << 2) != 0 {
|
|
_4 = reader.readInt32()
|
|
}
|
|
var _5: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 3) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_5 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
}
|
|
}
|
|
var _6: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 4) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_6 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
}
|
|
}
|
|
var _7: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 5) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_7 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
}
|
|
}
|
|
var _8: Api.Bool?
|
|
if Int(_1!) & Int(1 << 6) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_8 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
}
|
|
}
|
|
var _9: Api.Bool?
|
|
if Int(_1!) & Int(1 << 7) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_9 = Api.parse(reader, signature: signature) as? Api.Bool
|
|
}
|
|
}
|
|
var _10: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 8) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_10 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
}
|
|
}
|
|
var _11: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 9) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_11 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
}
|
|
}
|
|
var _12: Api.NotificationSound?
|
|
if Int(_1!) & Int(1 << 10) != 0 {
|
|
if let signature = reader.readInt32() {
|
|
_12 = Api.parse(reader, signature: signature) as? Api.NotificationSound
|
|
}
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 0) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 1) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 2) == 0) || _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 3) == 0) || _5 != nil
|
|
let _c6 = (Int(_1!) & Int(1 << 4) == 0) || _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 5) == 0) || _7 != nil
|
|
let _c8 = (Int(_1!) & Int(1 << 6) == 0) || _8 != nil
|
|
let _c9 = (Int(_1!) & Int(1 << 7) == 0) || _9 != nil
|
|
let _c10 = (Int(_1!) & Int(1 << 8) == 0) || _10 != nil
|
|
let _c11 = (Int(_1!) & Int(1 << 9) == 0) || _11 != nil
|
|
let _c12 = (Int(_1!) & Int(1 << 10) == 0) || _12 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 {
|
|
return Api.PeerNotifySettings.peerNotifySettings(Cons_peerNotifySettings(flags: _1!, showPreviews: _2, silent: _3, muteUntil: _4, iosSound: _5, androidSound: _6, otherSound: _7, storiesMuted: _8, storiesHideSender: _9, storiesIosSound: _10, storiesAndroidSound: _11, storiesOtherSound: _12))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PeerSettings: TypeConstructorDescription {
|
|
public class Cons_peerSettings: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var geoDistance: Int32?
|
|
public var requestChatTitle: String?
|
|
public var requestChatDate: Int32?
|
|
public var businessBotId: Int64?
|
|
public var businessBotManageUrl: String?
|
|
public var chargePaidMessageStars: Int64?
|
|
public var registrationMonth: String?
|
|
public var phoneCountry: String?
|
|
public var nameChangeDate: Int32?
|
|
public var photoChangeDate: Int32?
|
|
public init(flags: Int32, geoDistance: Int32?, requestChatTitle: String?, requestChatDate: Int32?, businessBotId: Int64?, businessBotManageUrl: String?, chargePaidMessageStars: Int64?, registrationMonth: String?, phoneCountry: String?, nameChangeDate: Int32?, photoChangeDate: Int32?) {
|
|
self.flags = flags
|
|
self.geoDistance = geoDistance
|
|
self.requestChatTitle = requestChatTitle
|
|
self.requestChatDate = requestChatDate
|
|
self.businessBotId = businessBotId
|
|
self.businessBotManageUrl = businessBotManageUrl
|
|
self.chargePaidMessageStars = chargePaidMessageStars
|
|
self.registrationMonth = registrationMonth
|
|
self.phoneCountry = phoneCountry
|
|
self.nameChangeDate = nameChangeDate
|
|
self.photoChangeDate = photoChangeDate
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerSettings", [("flags", ConstructorParameterDescription(self.flags)), ("geoDistance", ConstructorParameterDescription(self.geoDistance)), ("requestChatTitle", ConstructorParameterDescription(self.requestChatTitle)), ("requestChatDate", ConstructorParameterDescription(self.requestChatDate)), ("businessBotId", ConstructorParameterDescription(self.businessBotId)), ("businessBotManageUrl", ConstructorParameterDescription(self.businessBotManageUrl)), ("chargePaidMessageStars", ConstructorParameterDescription(self.chargePaidMessageStars)), ("registrationMonth", ConstructorParameterDescription(self.registrationMonth)), ("phoneCountry", ConstructorParameterDescription(self.phoneCountry)), ("nameChangeDate", ConstructorParameterDescription(self.nameChangeDate)), ("photoChangeDate", ConstructorParameterDescription(self.photoChangeDate))])
|
|
}
|
|
}
|
|
case peerSettings(Cons_peerSettings)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .peerSettings(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-193510921)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
if Int(_data.flags) & Int(1 << 6) != 0 {
|
|
serializeInt32(_data.geoDistance!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 9) != 0 {
|
|
serializeString(_data.requestChatTitle!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 9) != 0 {
|
|
serializeInt32(_data.requestChatDate!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 13) != 0 {
|
|
serializeInt64(_data.businessBotId!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 13) != 0 {
|
|
serializeString(_data.businessBotManageUrl!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 14) != 0 {
|
|
serializeInt64(_data.chargePaidMessageStars!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 15) != 0 {
|
|
serializeString(_data.registrationMonth!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 16) != 0 {
|
|
serializeString(_data.phoneCountry!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 17) != 0 {
|
|
serializeInt32(_data.nameChangeDate!, buffer: buffer, boxed: false)
|
|
}
|
|
if Int(_data.flags) & Int(1 << 18) != 0 {
|
|
serializeInt32(_data.photoChangeDate!, buffer: buffer, boxed: false)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .peerSettings(let _data):
|
|
return ("peerSettings", [("flags", ConstructorParameterDescription(_data.flags)), ("geoDistance", ConstructorParameterDescription(_data.geoDistance)), ("requestChatTitle", ConstructorParameterDescription(_data.requestChatTitle)), ("requestChatDate", ConstructorParameterDescription(_data.requestChatDate)), ("businessBotId", ConstructorParameterDescription(_data.businessBotId)), ("businessBotManageUrl", ConstructorParameterDescription(_data.businessBotManageUrl)), ("chargePaidMessageStars", ConstructorParameterDescription(_data.chargePaidMessageStars)), ("registrationMonth", ConstructorParameterDescription(_data.registrationMonth)), ("phoneCountry", ConstructorParameterDescription(_data.phoneCountry)), ("nameChangeDate", ConstructorParameterDescription(_data.nameChangeDate)), ("photoChangeDate", ConstructorParameterDescription(_data.photoChangeDate))])
|
|
}
|
|
}
|
|
|
|
public static func parse_peerSettings(_ reader: BufferReader) -> PeerSettings? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Int32?
|
|
if Int(_1!) & Int(1 << 6) != 0 {
|
|
_2 = reader.readInt32()
|
|
}
|
|
var _3: String?
|
|
if Int(_1!) & Int(1 << 9) != 0 {
|
|
_3 = parseString(reader)
|
|
}
|
|
var _4: Int32?
|
|
if Int(_1!) & Int(1 << 9) != 0 {
|
|
_4 = reader.readInt32()
|
|
}
|
|
var _5: Int64?
|
|
if Int(_1!) & Int(1 << 13) != 0 {
|
|
_5 = reader.readInt64()
|
|
}
|
|
var _6: String?
|
|
if Int(_1!) & Int(1 << 13) != 0 {
|
|
_6 = parseString(reader)
|
|
}
|
|
var _7: Int64?
|
|
if Int(_1!) & Int(1 << 14) != 0 {
|
|
_7 = reader.readInt64()
|
|
}
|
|
var _8: String?
|
|
if Int(_1!) & Int(1 << 15) != 0 {
|
|
_8 = parseString(reader)
|
|
}
|
|
var _9: String?
|
|
if Int(_1!) & Int(1 << 16) != 0 {
|
|
_9 = parseString(reader)
|
|
}
|
|
var _10: Int32?
|
|
if Int(_1!) & Int(1 << 17) != 0 {
|
|
_10 = reader.readInt32()
|
|
}
|
|
var _11: Int32?
|
|
if Int(_1!) & Int(1 << 18) != 0 {
|
|
_11 = reader.readInt32()
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = (Int(_1!) & Int(1 << 6) == 0) || _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 9) == 0) || _3 != nil
|
|
let _c4 = (Int(_1!) & Int(1 << 9) == 0) || _4 != nil
|
|
let _c5 = (Int(_1!) & Int(1 << 13) == 0) || _5 != nil
|
|
let _c6 = (Int(_1!) & Int(1 << 13) == 0) || _6 != nil
|
|
let _c7 = (Int(_1!) & Int(1 << 14) == 0) || _7 != nil
|
|
let _c8 = (Int(_1!) & Int(1 << 15) == 0) || _8 != nil
|
|
let _c9 = (Int(_1!) & Int(1 << 16) == 0) || _9 != nil
|
|
let _c10 = (Int(_1!) & Int(1 << 17) == 0) || _10 != nil
|
|
let _c11 = (Int(_1!) & Int(1 << 18) == 0) || _11 != nil
|
|
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 {
|
|
return Api.PeerSettings.peerSettings(Cons_peerSettings(flags: _1!, geoDistance: _2, requestChatTitle: _3, requestChatDate: _4, businessBotId: _5, businessBotManageUrl: _6, chargePaidMessageStars: _7, registrationMonth: _8, phoneCountry: _9, nameChangeDate: _10, photoChangeDate: _11))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PeerStories: TypeConstructorDescription {
|
|
public class Cons_peerStories: TypeConstructorDescription {
|
|
public var flags: Int32
|
|
public var peer: Api.Peer
|
|
public var maxReadId: Int32?
|
|
public var stories: [Api.StoryItem]
|
|
public init(flags: Int32, peer: Api.Peer, maxReadId: Int32?, stories: [Api.StoryItem]) {
|
|
self.flags = flags
|
|
self.peer = peer
|
|
self.maxReadId = maxReadId
|
|
self.stories = stories
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("peerStories", [("flags", ConstructorParameterDescription(self.flags)), ("peer", ConstructorParameterDescription(self.peer)), ("maxReadId", ConstructorParameterDescription(self.maxReadId)), ("stories", ConstructorParameterDescription(self.stories))])
|
|
}
|
|
}
|
|
case peerStories(Cons_peerStories)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .peerStories(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-1707742823)
|
|
}
|
|
serializeInt32(_data.flags, buffer: buffer, boxed: false)
|
|
_data.peer.serialize(buffer, true)
|
|
if Int(_data.flags) & Int(1 << 0) != 0 {
|
|
serializeInt32(_data.maxReadId!, buffer: buffer, boxed: false)
|
|
}
|
|
buffer.appendInt32(481674261)
|
|
buffer.appendInt32(Int32(_data.stories.count))
|
|
for item in _data.stories {
|
|
item.serialize(buffer, true)
|
|
}
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .peerStories(let _data):
|
|
return ("peerStories", [("flags", ConstructorParameterDescription(_data.flags)), ("peer", ConstructorParameterDescription(_data.peer)), ("maxReadId", ConstructorParameterDescription(_data.maxReadId)), ("stories", ConstructorParameterDescription(_data.stories))])
|
|
}
|
|
}
|
|
|
|
public static func parse_peerStories(_ reader: BufferReader) -> PeerStories? {
|
|
var _1: Int32?
|
|
_1 = reader.readInt32()
|
|
var _2: Api.Peer?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.Peer
|
|
}
|
|
var _3: Int32?
|
|
if Int(_1!) & Int(1 << 0) != 0 {
|
|
_3 = reader.readInt32()
|
|
}
|
|
var _4: [Api.StoryItem]?
|
|
if let _ = reader.readInt32() {
|
|
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.StoryItem.self)
|
|
}
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = (Int(_1!) & Int(1 << 0) == 0) || _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.PeerStories.peerStories(Cons_peerStories(flags: _1!, peer: _2!, maxReadId: _3, stories: _4!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PendingSuggestion: TypeConstructorDescription {
|
|
public class Cons_pendingSuggestion: TypeConstructorDescription {
|
|
public var suggestion: String
|
|
public var title: Api.TextWithEntities
|
|
public var description: Api.TextWithEntities
|
|
public var url: String
|
|
public init(suggestion: String, title: Api.TextWithEntities, description: Api.TextWithEntities, url: String) {
|
|
self.suggestion = suggestion
|
|
self.title = title
|
|
self.description = description
|
|
self.url = url
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("pendingSuggestion", [("suggestion", ConstructorParameterDescription(self.suggestion)), ("title", ConstructorParameterDescription(self.title)), ("description", ConstructorParameterDescription(self.description)), ("url", ConstructorParameterDescription(self.url))])
|
|
}
|
|
}
|
|
case pendingSuggestion(Cons_pendingSuggestion)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .pendingSuggestion(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(-404214254)
|
|
}
|
|
serializeString(_data.suggestion, buffer: buffer, boxed: false)
|
|
_data.title.serialize(buffer, true)
|
|
_data.description.serialize(buffer, true)
|
|
serializeString(_data.url, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .pendingSuggestion(let _data):
|
|
return ("pendingSuggestion", [("suggestion", ConstructorParameterDescription(_data.suggestion)), ("title", ConstructorParameterDescription(_data.title)), ("description", ConstructorParameterDescription(_data.description)), ("url", ConstructorParameterDescription(_data.url))])
|
|
}
|
|
}
|
|
|
|
public static func parse_pendingSuggestion(_ reader: BufferReader) -> PendingSuggestion? {
|
|
var _1: String?
|
|
_1 = parseString(reader)
|
|
var _2: Api.TextWithEntities?
|
|
if let signature = reader.readInt32() {
|
|
_2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
|
}
|
|
var _3: Api.TextWithEntities?
|
|
if let signature = reader.readInt32() {
|
|
_3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
|
}
|
|
var _4: String?
|
|
_4 = parseString(reader)
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
let _c3 = _3 != nil
|
|
let _c4 = _4 != nil
|
|
if _c1 && _c2 && _c3 && _c4 {
|
|
return Api.PendingSuggestion.pendingSuggestion(Cons_pendingSuggestion(suggestion: _1!, title: _2!, description: _3!, url: _4!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|
|
public extension Api {
|
|
enum PersonalChannel: TypeConstructorDescription {
|
|
public class Cons_personalChannel: TypeConstructorDescription {
|
|
public var userId: Int64
|
|
public var channelId: Int64
|
|
public init(userId: Int64, channelId: Int64) {
|
|
self.userId = userId
|
|
self.channelId = channelId
|
|
}
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
return ("personalChannel", [("userId", ConstructorParameterDescription(self.userId)), ("channelId", ConstructorParameterDescription(self.channelId))])
|
|
}
|
|
}
|
|
case personalChannel(Cons_personalChannel)
|
|
|
|
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
|
switch self {
|
|
case .personalChannel(let _data):
|
|
if boxed {
|
|
buffer.appendInt32(431767677)
|
|
}
|
|
serializeInt64(_data.userId, buffer: buffer, boxed: false)
|
|
serializeInt64(_data.channelId, buffer: buffer, boxed: false)
|
|
break
|
|
}
|
|
}
|
|
|
|
public func descriptionFields() -> (String, [(String, ConstructorParameterDescription)]) {
|
|
switch self {
|
|
case .personalChannel(let _data):
|
|
return ("personalChannel", [("userId", ConstructorParameterDescription(_data.userId)), ("channelId", ConstructorParameterDescription(_data.channelId))])
|
|
}
|
|
}
|
|
|
|
public static func parse_personalChannel(_ reader: BufferReader) -> PersonalChannel? {
|
|
var _1: Int64?
|
|
_1 = reader.readInt64()
|
|
var _2: Int64?
|
|
_2 = reader.readInt64()
|
|
let _c1 = _1 != nil
|
|
let _c2 = _2 != nil
|
|
if _c1 && _c2 {
|
|
return Api.PersonalChannel.personalChannel(Cons_personalChannel(userId: _1!, channelId: _2!))
|
|
}
|
|
else {
|
|
return nil
|
|
}
|
|
}
|
|
}
|
|
}
|