247 lines
7.3 KiB
Swift
Executable File
247 lines
7.3 KiB
Swift
Executable File
// DO NOT EDIT.
|
|
// swift-format-ignore-file
|
|
//
|
|
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
|
// Source: Message.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 Action: SwiftProtobuf.Enum {
|
|
typealias RawValue = Int
|
|
case send // = 0
|
|
case get // = 1
|
|
case inbox // = 2
|
|
case UNRECOGNIZED(Int)
|
|
|
|
init() {
|
|
self = .send
|
|
}
|
|
|
|
init?(rawValue: Int) {
|
|
switch rawValue {
|
|
case 0: self = .send
|
|
case 1: self = .get
|
|
case 2: self = .inbox
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
}
|
|
}
|
|
|
|
var rawValue: Int {
|
|
switch self {
|
|
case .send: return 0
|
|
case .get: return 1
|
|
case .inbox: return 2
|
|
case .UNRECOGNIZED(let i): return i
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
#if swift(>=4.2)
|
|
|
|
extension Action: CaseIterable {
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
static var allCases: [Action] = [
|
|
.send,
|
|
.get,
|
|
.inbox,
|
|
]
|
|
}
|
|
|
|
#endif // swift(>=4.2)
|
|
|
|
struct Mex {
|
|
// 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 from: String = String()
|
|
|
|
var content: String = String()
|
|
|
|
var at: Int64 = 0
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
}
|
|
|
|
struct RespData {
|
|
// 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 error: String = String()
|
|
|
|
var messages: [Mex] = []
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
}
|
|
|
|
struct ReqData {
|
|
// 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 action: Action = .send
|
|
|
|
var content: String = String()
|
|
|
|
var from: String = String()
|
|
|
|
var to: String = String()
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
}
|
|
|
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
|
|
extension Action: SwiftProtobuf._ProtoNameProviding {
|
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
0: .same(proto: "ACTION_SEND"),
|
|
1: .same(proto: "ACTION_GET"),
|
|
2: .same(proto: "ACTION_INBOX"),
|
|
]
|
|
}
|
|
|
|
extension Mex: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "Mex"
|
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .same(proto: "from"),
|
|
2: .same(proto: "content"),
|
|
3: .same(proto: "at"),
|
|
]
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
switch fieldNumber {
|
|
case 1: try decoder.decodeSingularStringField(value: &self.from)
|
|
case 2: try decoder.decodeSingularStringField(value: &self.content)
|
|
case 3: try decoder.decodeSingularInt64Field(value: &self.at)
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if !self.from.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.from, fieldNumber: 1)
|
|
}
|
|
if !self.content.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.content, fieldNumber: 2)
|
|
}
|
|
if self.at != 0 {
|
|
try visitor.visitSingularInt64Field(value: self.at, fieldNumber: 3)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: Mex, rhs: Mex) -> Bool {
|
|
if lhs.from != rhs.from {return false}
|
|
if lhs.content != rhs.content {return false}
|
|
if lhs.at != rhs.at {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension RespData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "RespData"
|
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .same(proto: "error"),
|
|
2: .same(proto: "messages"),
|
|
]
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
switch fieldNumber {
|
|
case 1: try decoder.decodeSingularStringField(value: &self.error)
|
|
case 2: try decoder.decodeRepeatedMessageField(value: &self.messages)
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if !self.error.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.error, fieldNumber: 1)
|
|
}
|
|
if !self.messages.isEmpty {
|
|
try visitor.visitRepeatedMessageField(value: self.messages, fieldNumber: 2)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: RespData, rhs: RespData) -> Bool {
|
|
if lhs.error != rhs.error {return false}
|
|
if lhs.messages != rhs.messages {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|
|
|
|
extension ReqData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "ReqData"
|
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .same(proto: "action"),
|
|
2: .same(proto: "content"),
|
|
3: .same(proto: "from"),
|
|
4: .same(proto: "to"),
|
|
]
|
|
|
|
mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
switch fieldNumber {
|
|
case 1: try decoder.decodeSingularEnumField(value: &self.action)
|
|
case 2: try decoder.decodeSingularStringField(value: &self.content)
|
|
case 3: try decoder.decodeSingularStringField(value: &self.from)
|
|
case 4: try decoder.decodeSingularStringField(value: &self.to)
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.action != .send {
|
|
try visitor.visitSingularEnumField(value: self.action, fieldNumber: 1)
|
|
}
|
|
if !self.content.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.content, fieldNumber: 2)
|
|
}
|
|
if !self.from.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.from, fieldNumber: 3)
|
|
}
|
|
if !self.to.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.to, fieldNumber: 4)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: ReqData, rhs: ReqData) -> Bool {
|
|
if lhs.action != rhs.action {return false}
|
|
if lhs.content != rhs.content {return false}
|
|
if lhs.from != rhs.from {return false}
|
|
if lhs.to != rhs.to {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|