-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update the swift generated stuff for spm
- Loading branch information
1 parent
7a4c246
commit d8e4d26
Showing
10 changed files
with
1,241 additions
and
6 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// DO NOT EDIT. | ||
// swift-format-ignore-file | ||
// | ||
// Generated by the Swift generator plugin for the protocol buffer compiler. | ||
// Source: message_contents/ecies.proto | ||
// | ||
// For information on using the generated types, please see the documentation: | ||
// https://github.com/apple/swift-protobuf/ | ||
|
||
/// ECIES is a wrapper for ECIES payloads | ||
|
||
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 | ||
} | ||
|
||
/// EciesMessage is a wrapper for ECIES encrypted payloads | ||
public struct Xmtp_MessageContents_EciesMessage { | ||
// 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 version: Xmtp_MessageContents_EciesMessage.OneOf_Version? = nil | ||
|
||
/// Expected to be an ECIES encrypted SignedPayload | ||
public var v1: Data { | ||
get { | ||
if case .v1(let v)? = version {return v} | ||
return Data() | ||
} | ||
set {version = .v1(newValue)} | ||
} | ||
|
||
public var unknownFields = SwiftProtobuf.UnknownStorage() | ||
|
||
public enum OneOf_Version: Equatable { | ||
/// Expected to be an ECIES encrypted SignedPayload | ||
case v1(Data) | ||
|
||
#if !swift(>=4.1) | ||
public static func ==(lhs: Xmtp_MessageContents_EciesMessage.OneOf_Version, rhs: Xmtp_MessageContents_EciesMessage.OneOf_Version) -> Bool { | ||
// 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 (lhs, rhs) { | ||
case (.v1, .v1): return { | ||
guard case .v1(let l) = lhs, case .v1(let r) = rhs else { preconditionFailure() } | ||
return l == r | ||
}() | ||
} | ||
} | ||
#endif | ||
} | ||
|
||
public init() {} | ||
} | ||
|
||
#if swift(>=5.5) && canImport(_Concurrency) | ||
extension Xmtp_MessageContents_EciesMessage: @unchecked Sendable {} | ||
extension Xmtp_MessageContents_EciesMessage.OneOf_Version: @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_EciesMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { | ||
public static let protoMessageName: String = _protobuf_package + ".EciesMessage" | ||
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ | ||
1: .same(proto: "v1"), | ||
] | ||
|
||
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 { | ||
var v: Data? | ||
try decoder.decodeSingularBytesField(value: &v) | ||
if let v = v { | ||
if self.version != nil {try decoder.handleConflictingOneOf()} | ||
self.version = .v1(v) | ||
} | ||
}() | ||
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 | ||
try { if case .v1(let v)? = self.version { | ||
try visitor.visitSingularBytesField(value: v, fieldNumber: 1) | ||
} }() | ||
try unknownFields.traverse(visitor: &visitor) | ||
} | ||
|
||
public static func ==(lhs: Xmtp_MessageContents_EciesMessage, rhs: Xmtp_MessageContents_EciesMessage) -> Bool { | ||
if lhs.version != rhs.version {return false} | ||
if lhs.unknownFields != rhs.unknownFields {return false} | ||
return true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.