xmtp-ios/Sources/XMTP/Proto/message_contents/conversation_reference.pb.s...

114 lines
4.7 KiB
Swift

// DO NOT EDIT.
// swift-format-ignore-file
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: message_contents/conversation_reference.proto
//
// For information on using the generated types, please see the documentation:
// https://github.com/apple/swift-protobuf/
/// Holds the ConversationReference
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
}
/// A light pointer for a conversation that contains no decryption keys
public struct Xmtp_MessageContents_ConversationReference {
// 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.
public var topic: String = String()
public var peerAddress: String = String()
public var createdNs: UInt64 = 0
public var context: Xmtp_MessageContents_InvitationV1.Context {
get {return _context ?? Xmtp_MessageContents_InvitationV1.Context()}
set {_context = newValue}
}
/// Returns true if `context` has been explicitly set.
public var hasContext: Bool {return self._context != nil}
/// Clears the value of `context`. Subsequent reads from it will return its default value.
public mutating func clearContext() {self._context = nil}
public var unknownFields = SwiftProtobuf.UnknownStorage()
public init() {}
fileprivate var _context: Xmtp_MessageContents_InvitationV1.Context? = nil
}
#if swift(>=5.5) && canImport(_Concurrency)
extension Xmtp_MessageContents_ConversationReference: @unchecked Sendable {}
#endif // swift(>=5.5) && canImport(_Concurrency)
// MARK: - Code below here is support for the SwiftProtobuf runtime.
fileprivate let _protobuf_package = "xmtp.message_contents"
extension Xmtp_MessageContents_ConversationReference: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".ConversationReference"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "topic"),
2: .standard(proto: "peer_address"),
3: .standard(proto: "created_ns"),
4: .same(proto: "context"),
]
public 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.decodeSingularStringField(value: &self.topic) }()
case 2: try { try decoder.decodeSingularStringField(value: &self.peerAddress) }()
case 3: try { try decoder.decodeSingularUInt64Field(value: &self.createdNs) }()
case 4: try { try decoder.decodeSingularMessageField(value: &self._context) }()
default: break
}
}
}
public 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.topic.isEmpty {
try visitor.visitSingularStringField(value: self.topic, fieldNumber: 1)
}
if !self.peerAddress.isEmpty {
try visitor.visitSingularStringField(value: self.peerAddress, fieldNumber: 2)
}
if self.createdNs != 0 {
try visitor.visitSingularUInt64Field(value: self.createdNs, fieldNumber: 3)
}
try { if let v = self._context {
try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
} }()
try unknownFields.traverse(visitor: &visitor)
}
public static func ==(lhs: Xmtp_MessageContents_ConversationReference, rhs: Xmtp_MessageContents_ConversationReference) -> Bool {
if lhs.topic != rhs.topic {return false}
if lhs.peerAddress != rhs.peerAddress {return false}
if lhs.createdNs != rhs.createdNs {return false}
if lhs._context != rhs._context {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}