mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 20:18:41 +00:00
431 lines
16 KiB
Swift
431 lines
16 KiB
Swift
// DO NOT EDIT.
|
|
// swift-format-ignore-file
|
|
// swiftlint:disable all
|
|
//
|
|
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
|
// Source: push_notification.proto
|
|
//
|
|
// For information on using the generated types, please see the documentation:
|
|
// https://github.com/apple/swift-protobuf/
|
|
|
|
import Foundation
|
|
import SwiftProtobuf
|
|
|
|
// If the compiler emits an error on this type, it is because this file
|
|
// was generated by a version of the `protoc` Swift plug-in that is
|
|
// incompatible with the version of SwiftProtobuf to which you are linking.
|
|
// Please ensure that you are building against the same version of the API
|
|
// that was used to generate this file.
|
|
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
|
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
|
typealias Version = _2
|
|
}
|
|
|
|
enum PushKind: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
typealias RawValue = Int
|
|
case reaction // = 0
|
|
case response // = 1
|
|
case text // = 2
|
|
case video // = 3
|
|
case twonly // = 4
|
|
case image // = 5
|
|
case contactRequest // = 6
|
|
case acceptRequest // = 7
|
|
case storedMediaFile // = 8
|
|
case testNotification // = 9
|
|
case reopenedMedia // = 10
|
|
case reactionToVideo // = 11
|
|
case reactionToText // = 12
|
|
case reactionToImage // = 13
|
|
case UNRECOGNIZED(Int)
|
|
|
|
init() {
|
|
self = .reaction
|
|
}
|
|
|
|
init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .reaction
|
|
case 1: self = .response
|
|
case 2: self = .text
|
|
case 3: self = .video
|
|
case 4: self = .twonly
|
|
case 5: self = .image
|
|
case 6: self = .contactRequest
|
|
case 7: self = .acceptRequest
|
|
case 8: self = .storedMediaFile
|
|
case 9: self = .testNotification
|
|
case 10: self = .reopenedMedia
|
|
case 11: self = .reactionToVideo
|
|
case 12: self = .reactionToText
|
|
case 13: self = .reactionToImage
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
var rawValue: Int {
|
|
switch self {
|
|
case .reaction: return 0
|
|
case .response: return 1
|
|
case .text: return 2
|
|
case .video: return 3
|
|
case .twonly: return 4
|
|
case .image: return 5
|
|
case .contactRequest: return 6
|
|
case .acceptRequest: return 7
|
|
case .storedMediaFile: return 8
|
|
case .testNotification: return 9
|
|
case .reopenedMedia: return 10
|
|
case .reactionToVideo: return 11
|
|
case .reactionToText: return 12
|
|
case .reactionToImage: return 13
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
static let allCases: [PushKind] = [
|
|
.reaction,
|
|
.response,
|
|
.text,
|
|
.video,
|
|
.twonly,
|
|
.image,
|
|
.contactRequest,
|
|
.acceptRequest,
|
|
.storedMediaFile,
|
|
.testNotification,
|
|
.reopenedMedia,
|
|
.reactionToVideo,
|
|
.reactionToText,
|
|
.reactionToImage,
|
|
]
|
|
|
|
}
|
|
|
|
struct EncryptedPushNotification: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
var keyID: Int64 = 0
|
|
|
|
var nonce: Data = Data()
|
|
|
|
var ciphertext: Data = Data()
|
|
|
|
var mac: Data = Data()
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
}
|
|
|
|
struct PushNotification: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
var kind: PushKind = .reaction
|
|
|
|
var messageID: String {
|
|
get {return _messageID ?? String()}
|
|
set {_messageID = newValue}
|
|
}
|
|
/// Returns true if `messageID` has been explicitly set.
|
|
var hasMessageID: Bool {return self._messageID != nil}
|
|
/// Clears the value of `messageID`. Subsequent reads from it will return its default value.
|
|
mutating func clearMessageID() {self._messageID = nil}
|
|
|
|
var reactionContent: String {
|
|
get {return _reactionContent ?? String()}
|
|
set {_reactionContent = newValue}
|
|
}
|
|
/// Returns true if `reactionContent` has been explicitly set.
|
|
var hasReactionContent: Bool {return self._reactionContent != nil}
|
|
/// Clears the value of `reactionContent`. Subsequent reads from it will return its default value.
|
|
mutating func clearReactionContent() {self._reactionContent = nil}
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
|
|
fileprivate var _messageID: String? = nil
|
|
fileprivate var _reactionContent: String? = nil
|
|
}
|
|
|
|
struct PushUsers: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
var users: [PushUser] = []
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
}
|
|
|
|
struct PushUser: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
var userID: Int64 = 0
|
|
|
|
var displayName: String = String()
|
|
|
|
var blocked: Bool = false
|
|
|
|
var lastMessageID: String {
|
|
get {return _lastMessageID ?? String()}
|
|
set {_lastMessageID = newValue}
|
|
}
|
|
/// Returns true if `lastMessageID` has been explicitly set.
|
|
var hasLastMessageID: Bool {return self._lastMessageID != nil}
|
|
/// Clears the value of `lastMessageID`. Subsequent reads from it will return its default value.
|
|
mutating func clearLastMessageID() {self._lastMessageID = nil}
|
|
|
|
var pushKeys: [PushKey] = []
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
|
|
fileprivate var _lastMessageID: String? = nil
|
|
}
|
|
|
|
struct PushKey: Sendable {
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
// methods supported on all messages.
|
|
|
|
var id: Int64 = 0
|
|
|
|
var key: Data = Data()
|
|
|
|
var createdAtUnixTimestamp: Int64 = 0
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
}
|
|
|
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
|
|
extension PushKind: SwiftProtobuf._ProtoNameProviding {
|
|
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0reaction\0\u{1}response\0\u{1}text\0\u{1}video\0\u{1}twonly\0\u{1}image\0\u{1}contactRequest\0\u{1}acceptRequest\0\u{1}storedMediaFile\0\u{1}testNotification\0\u{1}reopenedMedia\0\u{1}reactionToVideo\0\u{1}reactionToText\0\u{1}reactionToImage\0")
|
|
}
|
|
|
|
extension EncryptedPushNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "EncryptedPushNotification"
|
|
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}keyId\0\u{1}nonce\0\u{1}ciphertext\0\u{1}mac\0")
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularInt64Field(value: &self.keyID) }()
|
|
case 2: try { try decoder.decodeSingularBytesField(value: &self.nonce) }()
|
|
case 3: try { try decoder.decodeSingularBytesField(value: &self.ciphertext) }()
|
|
case 4: try { try decoder.decodeSingularBytesField(value: &self.mac) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.keyID != 0 {
|
|
try visitor.visitSingularInt64Field(value: self.keyID, fieldNumber: 1)
|
|
}
|
|
if !self.nonce.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.nonce, fieldNumber: 2)
|
|
}
|
|
if !self.ciphertext.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.ciphertext, fieldNumber: 3)
|
|
}
|
|
if !self.mac.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.mac, fieldNumber: 4)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: EncryptedPushNotification, rhs: EncryptedPushNotification) -> Bool {
|
|
if lhs.keyID != rhs.keyID {return false}
|
|
if lhs.nonce != rhs.nonce {return false}
|
|
if lhs.ciphertext != rhs.ciphertext {return false}
|
|
if lhs.mac != rhs.mac {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension PushNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "PushNotification"
|
|
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}kind\0\u{1}messageId\0\u{1}reactionContent\0")
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularEnumField(value: &self.kind) }()
|
|
case 2: try { try decoder.decodeSingularStringField(value: &self._messageID) }()
|
|
case 3: try { try decoder.decodeSingularStringField(value: &self._reactionContent) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every if/case branch local when no optimizations
|
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
// https://github.com/apple/swift-protobuf/issues/1182
|
|
if self.kind != .reaction {
|
|
try visitor.visitSingularEnumField(value: self.kind, fieldNumber: 1)
|
|
}
|
|
try { if let v = self._messageID {
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 2)
|
|
} }()
|
|
try { if let v = self._reactionContent {
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 3)
|
|
} }()
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: PushNotification, rhs: PushNotification) -> Bool {
|
|
if lhs.kind != rhs.kind {return false}
|
|
if lhs._messageID != rhs._messageID {return false}
|
|
if lhs._reactionContent != rhs._reactionContent {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension PushUsers: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "PushUsers"
|
|
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}users\0")
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeRepeatedMessageField(value: &self.users) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if !self.users.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: self.users, fieldNumber: 1)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: PushUsers, rhs: PushUsers) -> Bool {
|
|
if lhs.users != rhs.users {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension PushUser: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "PushUser"
|
|
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}userId\0\u{1}displayName\0\u{1}blocked\0\u{1}lastMessageId\0\u{1}pushKeys\0")
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularInt64Field(value: &self.userID) }()
|
|
case 2: try { try decoder.decodeSingularStringField(value: &self.displayName) }()
|
|
case 3: try { try decoder.decodeSingularBoolField(value: &self.blocked) }()
|
|
case 4: try { try decoder.decodeSingularStringField(value: &self._lastMessageID) }()
|
|
case 5: try { try decoder.decodeRepeatedMessageField(value: &self.pushKeys) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every if/case branch local when no optimizations
|
|
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
|
|
// https://github.com/apple/swift-protobuf/issues/1182
|
|
if self.userID != 0 {
|
|
try visitor.visitSingularInt64Field(value: self.userID, fieldNumber: 1)
|
|
}
|
|
if !self.displayName.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 2)
|
|
}
|
|
if self.blocked != false {
|
|
try visitor.visitSingularBoolField(value: self.blocked, fieldNumber: 3)
|
|
}
|
|
try { if let v = self._lastMessageID {
|
|
try visitor.visitSingularStringField(value: v, fieldNumber: 4)
|
|
} }()
|
|
if !self.pushKeys.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: self.pushKeys, fieldNumber: 5)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: PushUser, rhs: PushUser) -> Bool {
|
|
if lhs.userID != rhs.userID {return false}
|
|
if lhs.displayName != rhs.displayName {return false}
|
|
if lhs.blocked != rhs.blocked {return false}
|
|
if lhs._lastMessageID != rhs._lastMessageID {return false}
|
|
if lhs.pushKeys != rhs.pushKeys {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension PushKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "PushKey"
|
|
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}key\0\u{1}createdAtUnixTimestamp\0")
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
// allocates stack space for every case branch when no optimizations are
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
switch fieldNumber {
|
|
case 1: try { try decoder.decodeSingularInt64Field(value: &self.id) }()
|
|
case 2: try { try decoder.decodeSingularBytesField(value: &self.key) }()
|
|
case 3: try { try decoder.decodeSingularInt64Field(value: &self.createdAtUnixTimestamp) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.id != 0 {
|
|
try visitor.visitSingularInt64Field(value: self.id, fieldNumber: 1)
|
|
}
|
|
if !self.key.isEmpty {
|
|
try visitor.visitSingularBytesField(value: self.key, fieldNumber: 2)
|
|
}
|
|
if self.createdAtUnixTimestamp != 0 {
|
|
try visitor.visitSingularInt64Field(value: self.createdAtUnixTimestamp, fieldNumber: 3)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: PushKey, rhs: PushKey) -> Bool {
|
|
if lhs.id != rhs.id {return false}
|
|
if lhs.key != rhs.key {return false}
|
|
if lhs.createdAtUnixTimestamp != rhs.createdAtUnixTimestamp {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|