diff --git a/Package.resolved b/Package.resolved index 074675b4..13f2700c 100644 --- a/Package.resolved +++ b/Package.resolved @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/xmtp/libxmtp-swift", "state" : { - "branch" : "92274fe", - "revision" : "92274fe0dde1fc7f8f716ebcffa3d252813be56d" + "branch" : "ccbf6ac", + "revision" : "ccbf6ac71b8c5a89c3078d8dc4057123bea8a291" } }, { diff --git a/Sources/XMTPiOS/ConversationV2.swift b/Sources/XMTPiOS/ConversationV2.swift index b099098d..0aa2575b 100644 --- a/Sources/XMTPiOS/ConversationV2.swift +++ b/Sources/XMTPiOS/ConversationV2.swift @@ -88,6 +88,7 @@ public struct ConversationV2 { throw CodecError.invalidContent } } + let message = try await MessageV2.encode( client: client, content: encodedContent, diff --git a/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift b/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift index 39c65e69..e69de29b 100644 --- a/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift +++ b/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift @@ -1,3121 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: keystore_api/v1/keystore.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -/// Message content encoding structures - -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 -} - -/// Application-specific error codes for the Keystore API. -public enum Xmtp_KeystoreApi_V1_ErrorCode: SwiftProtobuf.Enum { - public typealias RawValue = Int - case unspecified // = 0 - case invalidInput // = 1 - case noMatchingPrekey // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unspecified - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unspecified - case 1: self = .invalidInput - case 2: self = .noMatchingPrekey - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unspecified: return 0 - case .invalidInput: return 1 - case .noMatchingPrekey: return 2 - case .UNRECOGNIZED(let i): return i - } - } - -} - -#if swift(>=4.2) - -extension Xmtp_KeystoreApi_V1_ErrorCode: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Xmtp_KeystoreApi_V1_ErrorCode] = [ - .unspecified, - .invalidInput, - .noMatchingPrekey, - ] -} - -#endif // swift(>=4.2) - -/// JobType is used to specify the type of job the caller would like info on -public enum Xmtp_KeystoreApi_V1_JobType: SwiftProtobuf.Enum { - public typealias RawValue = Int - case unspecified // = 0 - case refreshV1 // = 1 - case refreshV2 // = 2 - case refreshPppp // = 3 - case UNRECOGNIZED(Int) - - public init() { - self = .unspecified - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unspecified - case 1: self = .refreshV1 - case 2: self = .refreshV2 - case 3: self = .refreshPppp - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unspecified: return 0 - case .refreshV1: return 1 - case .refreshV2: return 2 - case .refreshPppp: return 3 - case .UNRECOGNIZED(let i): return i - } - } - -} - -#if swift(>=4.2) - -extension Xmtp_KeystoreApi_V1_JobType: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Xmtp_KeystoreApi_V1_JobType] = [ - .unspecified, - .refreshV1, - .refreshV2, - .refreshPppp, - ] -} - -#endif // swift(>=4.2) - -/// Wrapper class for errors from the Keystore API -public struct Xmtp_KeystoreApi_V1_KeystoreError { - // 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 message: String = String() - - public var code: Xmtp_KeystoreApi_V1_ErrorCode = .unspecified - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Decrypt a batch of messages using X3DH key agreement -public struct Xmtp_KeystoreApi_V1_DecryptV1Request { - // 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 requests: [Xmtp_KeystoreApi_V1_DecryptV1Request.Request] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// A single decryption request - public struct Request { - // 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 payload: Xmtp_MessageContents_Ciphertext { - get {return _payload ?? Xmtp_MessageContents_Ciphertext()} - set {_payload = newValue} - } - /// Returns true if `payload` has been explicitly set. - public var hasPayload: Bool {return self._payload != nil} - /// Clears the value of `payload`. Subsequent reads from it will return its default value. - public mutating func clearPayload() {self._payload = nil} - - public var peerKeys: Xmtp_MessageContents_PublicKeyBundle { - get {return _peerKeys ?? Xmtp_MessageContents_PublicKeyBundle()} - set {_peerKeys = newValue} - } - /// Returns true if `peerKeys` has been explicitly set. - public var hasPeerKeys: Bool {return self._peerKeys != nil} - /// Clears the value of `peerKeys`. Subsequent reads from it will return its default value. - public mutating func clearPeerKeys() {self._peerKeys = nil} - - public var headerBytes: Data = Data() - - public var isSender: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _payload: Xmtp_MessageContents_Ciphertext? = nil - fileprivate var _peerKeys: Xmtp_MessageContents_PublicKeyBundle? = nil - } - - public init() {} -} - -/// Response type for both V1 and V2 decryption requests -public struct Xmtp_KeystoreApi_V1_DecryptResponse { - // 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 responses: [Xmtp_KeystoreApi_V1_DecryptResponse.Response] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// A single decryption response - public struct Response { - // 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 response: Xmtp_KeystoreApi_V1_DecryptResponse.Response.OneOf_Response? = nil - - public var result: Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success { - get { - if case .result(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success() - } - set {response = .result(newValue)} - } - - public var error: Xmtp_KeystoreApi_V1_KeystoreError { - get { - if case .error(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_KeystoreError() - } - set {response = .error(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Response: Equatable { - case result(Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success) - case error(Xmtp_KeystoreApi_V1_KeystoreError) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptResponse.Response.OneOf_Response, rhs: Xmtp_KeystoreApi_V1_DecryptResponse.Response.OneOf_Response) -> 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 (.result, .result): return { - guard case .result(let l) = lhs, case .result(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.error, .error): return { - guard case .error(let l) = lhs, case .error(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - /// Wrapper object for success response - public struct Success { - // 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 decrypted: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} - } - - public init() {} -} - -/// Decrypt a batch of messages using the appropriate topic keys -public struct Xmtp_KeystoreApi_V1_DecryptV2Request { - // 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 requests: [Xmtp_KeystoreApi_V1_DecryptV2Request.Request] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// A single decryption request - public struct Request { - // 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 payload: Xmtp_MessageContents_Ciphertext { - get {return _payload ?? Xmtp_MessageContents_Ciphertext()} - set {_payload = newValue} - } - /// Returns true if `payload` has been explicitly set. - public var hasPayload: Bool {return self._payload != nil} - /// Clears the value of `payload`. Subsequent reads from it will return its default value. - public mutating func clearPayload() {self._payload = nil} - - public var headerBytes: Data = Data() - - public var contentTopic: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _payload: Xmtp_MessageContents_Ciphertext? = nil - } - - public init() {} -} - -/// Encrypt a batch of messages using X3DH key agreement -public struct Xmtp_KeystoreApi_V1_EncryptV1Request { - // 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 requests: [Xmtp_KeystoreApi_V1_EncryptV1Request.Request] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// A single encryption request - public struct Request { - // 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 recipient: Xmtp_MessageContents_PublicKeyBundle { - get {return _recipient ?? Xmtp_MessageContents_PublicKeyBundle()} - set {_recipient = newValue} - } - /// Returns true if `recipient` has been explicitly set. - public var hasRecipient: Bool {return self._recipient != nil} - /// Clears the value of `recipient`. Subsequent reads from it will return its default value. - public mutating func clearRecipient() {self._recipient = nil} - - public var payload: Data = Data() - - public var headerBytes: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _recipient: Xmtp_MessageContents_PublicKeyBundle? = nil - } - - public init() {} -} - -/// Response type for both V1 and V2 encryption requests -public struct Xmtp_KeystoreApi_V1_EncryptResponse { - // 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 responses: [Xmtp_KeystoreApi_V1_EncryptResponse.Response] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// A single encryption response - public struct Response { - // 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 response: Xmtp_KeystoreApi_V1_EncryptResponse.Response.OneOf_Response? = nil - - public var result: Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success { - get { - if case .result(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success() - } - set {response = .result(newValue)} - } - - public var error: Xmtp_KeystoreApi_V1_KeystoreError { - get { - if case .error(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_KeystoreError() - } - set {response = .error(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Response: Equatable { - case result(Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success) - case error(Xmtp_KeystoreApi_V1_KeystoreError) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptResponse.Response.OneOf_Response, rhs: Xmtp_KeystoreApi_V1_EncryptResponse.Response.OneOf_Response) -> 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 (.result, .result): return { - guard case .result(let l) = lhs, case .result(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.error, .error): return { - guard case .error(let l) = lhs, case .error(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - /// Wrapper object for success response - public struct Success { - // 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 encrypted: Xmtp_MessageContents_Ciphertext { - get {return _encrypted ?? Xmtp_MessageContents_Ciphertext()} - set {_encrypted = newValue} - } - /// Returns true if `encrypted` has been explicitly set. - public var hasEncrypted: Bool {return self._encrypted != nil} - /// Clears the value of `encrypted`. Subsequent reads from it will return its default value. - public mutating func clearEncrypted() {self._encrypted = nil} - - public var senderHmac: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _encrypted: Xmtp_MessageContents_Ciphertext? = nil - } - - public init() {} - } - - public init() {} -} - -/// Encrypt a batch of messages using the appropriate topic keys -public struct Xmtp_KeystoreApi_V1_EncryptV2Request { - // 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 requests: [Xmtp_KeystoreApi_V1_EncryptV2Request.Request] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// A single encryption request - public struct Request { - // 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 payload: Data = Data() - - public var headerBytes: Data = Data() - - public var contentTopic: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -/// Encrypt a message for yourself -public struct Xmtp_KeystoreApi_V1_SelfEncryptRequest { - // 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 requests: [Xmtp_KeystoreApi_V1_SelfEncryptRequest.Request] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Request type - public struct Request { - // 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 payload: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -/// Response type for SelfEncryptRequest -public struct Xmtp_KeystoreApi_V1_SelfEncryptResponse { - // 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 responses: [Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Response type - public struct Response { - // 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 response: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.OneOf_Response? = nil - - public var result: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success { - get { - if case .result(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success() - } - set {response = .result(newValue)} - } - - public var error: Xmtp_KeystoreApi_V1_KeystoreError { - get { - if case .error(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_KeystoreError() - } - set {response = .error(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Response: Equatable { - case result(Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success) - case error(Xmtp_KeystoreApi_V1_KeystoreError) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.OneOf_Response, rhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.OneOf_Response) -> 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 (.result, .result): return { - guard case .result(let l) = lhs, case .result(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.error, .error): return { - guard case .error(let l) = lhs, case .error(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - /// Success response - public struct Success { - // 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 encrypted: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} - } - - public init() {} -} - -/// SelfDecryptRequest -public struct Xmtp_KeystoreApi_V1_SelfDecryptRequest { - // 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 requests: [Xmtp_KeystoreApi_V1_SelfDecryptRequest.Request] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Request type - public struct Request { - // 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 payload: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -/// Get the private preferences topic identifier -public struct Xmtp_KeystoreApi_V1_GetPrivatePreferencesTopicIdentifierResponse { - // 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 identifier: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Request to create an invite payload, and store the topic keys in the Keystore -public struct Xmtp_KeystoreApi_V1_CreateInviteRequest { - // 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 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 recipient: Xmtp_MessageContents_SignedPublicKeyBundle { - get {return _recipient ?? Xmtp_MessageContents_SignedPublicKeyBundle()} - set {_recipient = newValue} - } - /// Returns true if `recipient` has been explicitly set. - public var hasRecipient: Bool {return self._recipient != nil} - /// Clears the value of `recipient`. Subsequent reads from it will return its default value. - public mutating func clearRecipient() {self._recipient = nil} - - public var createdNs: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _context: Xmtp_MessageContents_InvitationV1.Context? = nil - fileprivate var _recipient: Xmtp_MessageContents_SignedPublicKeyBundle? = nil -} - -/// Response to a CreateInviteRequest -public struct Xmtp_KeystoreApi_V1_CreateInviteResponse { - // 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 conversation: Xmtp_MessageContents_ConversationReference { - get {return _conversation ?? Xmtp_MessageContents_ConversationReference()} - set {_conversation = newValue} - } - /// Returns true if `conversation` has been explicitly set. - public var hasConversation: Bool {return self._conversation != nil} - /// Clears the value of `conversation`. Subsequent reads from it will return its default value. - public mutating func clearConversation() {self._conversation = nil} - - public var payload: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _conversation: Xmtp_MessageContents_ConversationReference? = nil -} - -/// Request to save a batch of invite messages to the Keystore -public struct Xmtp_KeystoreApi_V1_SaveInvitesRequest { - // 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 requests: [Xmtp_KeystoreApi_V1_SaveInvitesRequest.Request] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Mirrors xmtp.envelope schema - public struct Request { - // 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 contentTopic: String = String() - - public var timestampNs: UInt64 = 0 - - public var payload: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -/// Response to a SaveInvitesRequest -public struct Xmtp_KeystoreApi_V1_SaveInvitesResponse { - // 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 responses: [Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// A single response - public struct Response { - // 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 response: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.OneOf_Response? = nil - - public var result: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success { - get { - if case .result(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success() - } - set {response = .result(newValue)} - } - - public var error: Xmtp_KeystoreApi_V1_KeystoreError { - get { - if case .error(let v)? = response {return v} - return Xmtp_KeystoreApi_V1_KeystoreError() - } - set {response = .error(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Response: Equatable { - case result(Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success) - case error(Xmtp_KeystoreApi_V1_KeystoreError) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.OneOf_Response, rhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.OneOf_Response) -> 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 (.result, .result): return { - guard case .result(let l) = lhs, case .result(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.error, .error): return { - guard case .error(let l) = lhs, case .error(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - /// Wrapper object for success response - public struct Success { - // 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 conversation: Xmtp_MessageContents_ConversationReference { - get {return _conversation ?? Xmtp_MessageContents_ConversationReference()} - set {_conversation = newValue} - } - /// Returns true if `conversation` has been explicitly set. - public var hasConversation: Bool {return self._conversation != nil} - /// Clears the value of `conversation`. Subsequent reads from it will return its default value. - public mutating func clearConversation() {self._conversation = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _conversation: Xmtp_MessageContents_ConversationReference? = nil - } - - public init() {} - } - - public init() {} -} - -/// CreateAuthTokenRequest is used to create an auth token for the XMTP API -public struct Xmtp_KeystoreApi_V1_CreateAuthTokenRequest { - // 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 timestampNs: UInt64 { - get {return _timestampNs ?? 0} - set {_timestampNs = newValue} - } - /// Returns true if `timestampNs` has been explicitly set. - public var hasTimestampNs: Bool {return self._timestampNs != nil} - /// Clears the value of `timestampNs`. Subsequent reads from it will return its default value. - public mutating func clearTimestampNs() {self._timestampNs = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _timestampNs: UInt64? = nil -} - -/// SaveV1ConversationsRequest is used to save a batch of conversations to the -/// built in persistence -public struct Xmtp_KeystoreApi_V1_SaveV1ConversationsRequest { - // 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 conversations: [Xmtp_MessageContents_ConversationReference] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Placeholder response type for SaveV1Conversations -public struct Xmtp_KeystoreApi_V1_SaveV1ConversationsResponse { - // 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 unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Response for GetV2Conversations -public struct Xmtp_KeystoreApi_V1_GetConversationsResponse { - // 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 conversations: [Xmtp_MessageContents_ConversationReference] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Used to check if the Keystore implementation has been setup for the given -/// wallet address Only used for MM Snap Keystore currently -public struct Xmtp_KeystoreApi_V1_GetKeystoreStatusRequest { - // 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 walletAddress: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Response to GetKeystoreStatusRequest -public struct Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse { - // 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 status: Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse.KeystoreStatus = .unspecified - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Status of the Keystore for the specified wallet address - public enum KeystoreStatus: SwiftProtobuf.Enum { - public typealias RawValue = Int - case unspecified // = 0 - case uninitialized // = 1 - case initialized // = 2 - case UNRECOGNIZED(Int) - - public init() { - self = .unspecified - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unspecified - case 1: self = .uninitialized - case 2: self = .initialized - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unspecified: return 0 - case .uninitialized: return 1 - case .initialized: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - } - - public init() {} -} - -#if swift(>=4.2) - -extension Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse.KeystoreStatus: CaseIterable { - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse.KeystoreStatus] = [ - .unspecified, - .uninitialized, - .initialized, - ] -} - -#endif // swift(>=4.2) - -/// Used to initialize the Keystore with a private key bundle retrieved from the -/// client -public struct Xmtp_KeystoreApi_V1_InitKeystoreRequest { - // 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 bundle: Xmtp_KeystoreApi_V1_InitKeystoreRequest.OneOf_Bundle? = nil - - public var v1: Xmtp_MessageContents_PrivateKeyBundleV1 { - get { - if case .v1(let v)? = bundle {return v} - return Xmtp_MessageContents_PrivateKeyBundleV1() - } - set {bundle = .v1(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Bundle: Equatable { - case v1(Xmtp_MessageContents_PrivateKeyBundleV1) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_KeystoreApi_V1_InitKeystoreRequest.OneOf_Bundle, rhs: Xmtp_KeystoreApi_V1_InitKeystoreRequest.OneOf_Bundle) -> 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() {} -} - -/// Response to the request to initialize the Keystore -public struct Xmtp_KeystoreApi_V1_InitKeystoreResponse { - // 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 error: Xmtp_KeystoreApi_V1_KeystoreError { - get {return _error ?? Xmtp_KeystoreApi_V1_KeystoreError()} - set {_error = newValue} - } - /// Returns true if `error` has been explicitly set. - public var hasError: Bool {return self._error != nil} - /// Clears the value of `error`. Subsequent reads from it will return its default value. - public mutating func clearError() {self._error = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _error: Xmtp_KeystoreApi_V1_KeystoreError? = nil -} - -/// SignDigestRequest is used to sign a digest with either the identity key -/// or a prekey -public struct Xmtp_KeystoreApi_V1_SignDigestRequest { - // 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 digest: Data = Data() - - public var signer: Xmtp_KeystoreApi_V1_SignDigestRequest.OneOf_Signer? = nil - - public var identityKey: Bool { - get { - if case .identityKey(let v)? = signer {return v} - return false - } - set {signer = .identityKey(newValue)} - } - - public var prekeyIndex: UInt32 { - get { - if case .prekeyIndex(let v)? = signer {return v} - return 0 - } - set {signer = .prekeyIndex(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Signer: Equatable { - case identityKey(Bool) - case prekeyIndex(UInt32) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_KeystoreApi_V1_SignDigestRequest.OneOf_Signer, rhs: Xmtp_KeystoreApi_V1_SignDigestRequest.OneOf_Signer) -> 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 (.identityKey, .identityKey): return { - guard case .identityKey(let l) = lhs, case .identityKey(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.prekeyIndex, .prekeyIndex): return { - guard case .prekeyIndex(let l) = lhs, case .prekeyIndex(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - public init() {} -} - -/// GetRefreshJobRequest is used to get the last run time of a refresh job -public struct Xmtp_KeystoreApi_V1_GetRefreshJobRequest { - // 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 jobType: Xmtp_KeystoreApi_V1_JobType = .unspecified - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// GetRefreshJobResponse is used to return the last run time of a refresh job -public struct Xmtp_KeystoreApi_V1_GetRefreshJobResponse { - // 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 lastRunNs: Int64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// SetRefreshJobRequest is used to set the last run time of a refresh job -public struct Xmtp_KeystoreApi_V1_SetRefeshJobRequest { - // 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 jobType: Xmtp_KeystoreApi_V1_JobType = .unspecified - - public var lastRunNs: Int64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// SetRefreshJobResponse is an empty response type -public struct Xmtp_KeystoreApi_V1_SetRefreshJobResponse { - // 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 unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// A mapping of topics to their decrypted invitations -public struct Xmtp_KeystoreApi_V1_TopicMap { - // 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 topics: Dictionary = [:] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// TopicData wraps the invitation and the timestamp it was created - public struct TopicData { - // 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 createdNs: UInt64 = 0 - - public var peerAddress: String = String() - - public var invitation: Xmtp_MessageContents_InvitationV1 { - get {return _invitation ?? Xmtp_MessageContents_InvitationV1()} - set {_invitation = newValue} - } - /// Returns true if `invitation` has been explicitly set. - public var hasInvitation: Bool {return self._invitation != nil} - /// Clears the value of `invitation`. Subsequent reads from it will return its default value. - public mutating func clearInvitation() {self._invitation = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _invitation: Xmtp_MessageContents_InvitationV1? = nil - } - - public init() {} -} - -/// A mapping of topics to their HMAC keys -public struct Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse { - // 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 hmacKeys: Dictionary = [:] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// HmacKeyData wraps the HMAC key and the number of 30 day periods since epoch - public struct HmacKeyData { - // 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 thirtyDayPeriodsSinceEpoch: Int32 = 0 - - public var hmacKey: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - /// HmacKeys represents multiple HmacKeyData objects - public struct HmacKeys { - // 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 values: [Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeyData] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -#if swift(>=5.5) && canImport(_Concurrency) -extension Xmtp_KeystoreApi_V1_ErrorCode: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_JobType: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_KeystoreError: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptV1Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptV1Request.Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptResponse.Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptResponse.Response.OneOf_Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptV2Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_DecryptV2Request.Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptV1Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptV1Request.Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptResponse.Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptResponse.Response.OneOf_Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptV2Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_EncryptV2Request.Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfEncryptRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfEncryptRequest.Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfEncryptResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.OneOf_Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfDecryptRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SelfDecryptRequest.Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetPrivatePreferencesTopicIdentifierResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_CreateInviteRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_CreateInviteResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveInvitesRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveInvitesRequest.Request: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveInvitesResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.OneOf_Response: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_CreateAuthTokenRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveV1ConversationsRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SaveV1ConversationsResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetConversationsResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetKeystoreStatusRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse.KeystoreStatus: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_InitKeystoreRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_InitKeystoreRequest.OneOf_Bundle: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_InitKeystoreResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SignDigestRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SignDigestRequest.OneOf_Signer: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetRefreshJobRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetRefreshJobResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SetRefeshJobRequest: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_SetRefreshJobResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_TopicMap: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_TopicMap.TopicData: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeyData: @unchecked Sendable {} -extension Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeys: @unchecked Sendable {} -#endif // swift(>=5.5) && canImport(_Concurrency) - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "xmtp.keystore_api.v1" - -extension Xmtp_KeystoreApi_V1_ErrorCode: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ERROR_CODE_UNSPECIFIED"), - 1: .same(proto: "ERROR_CODE_INVALID_INPUT"), - 2: .same(proto: "ERROR_CODE_NO_MATCHING_PREKEY"), - ] -} - -extension Xmtp_KeystoreApi_V1_JobType: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "JOB_TYPE_UNSPECIFIED"), - 1: .same(proto: "JOB_TYPE_REFRESH_V1"), - 2: .same(proto: "JOB_TYPE_REFRESH_V2"), - 3: .same(proto: "JOB_TYPE_REFRESH_PPPP"), - ] -} - -extension Xmtp_KeystoreApi_V1_KeystoreError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".KeystoreError" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "message"), - 2: .same(proto: "code"), - ] - - public mutating func decodeMessage(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.message) }() - case 2: try { try decoder.decodeSingularEnumField(value: &self.code) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 1) - } - if self.code != .unspecified { - try visitor.visitSingularEnumField(value: self.code, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_KeystoreError, rhs: Xmtp_KeystoreApi_V1_KeystoreError) -> Bool { - if lhs.message != rhs.message {return false} - if lhs.code != rhs.code {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_DecryptV1Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DecryptV1Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "requests"), - ] - - public mutating func decodeMessage(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.requests) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.requests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.requests, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptV1Request, rhs: Xmtp_KeystoreApi_V1_DecryptV1Request) -> Bool { - if lhs.requests != rhs.requests {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_DecryptV1Request.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_DecryptV1Request.protoMessageName + ".Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "payload"), - 2: .standard(proto: "peer_keys"), - 3: .standard(proto: "header_bytes"), - 4: .standard(proto: "is_sender"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._payload) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._peerKeys) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self.headerBytes) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.isSender) }() - default: break - } - } - } - - public func traverse(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 let v = self._payload { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._peerKeys { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.headerBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.headerBytes, fieldNumber: 3) - } - if self.isSender != false { - try visitor.visitSingularBoolField(value: self.isSender, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptV1Request.Request, rhs: Xmtp_KeystoreApi_V1_DecryptV1Request.Request) -> Bool { - if lhs._payload != rhs._payload {return false} - if lhs._peerKeys != rhs._peerKeys {return false} - if lhs.headerBytes != rhs.headerBytes {return false} - if lhs.isSender != rhs.isSender {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_DecryptResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DecryptResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "responses"), - ] - - public mutating func decodeMessage(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.responses) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.responses.isEmpty { - try visitor.visitRepeatedMessageField(value: self.responses, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptResponse, rhs: Xmtp_KeystoreApi_V1_DecryptResponse) -> Bool { - if lhs.responses != rhs.responses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_DecryptResponse.Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_DecryptResponse.protoMessageName + ".Response" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .same(proto: "error"), - ] - - public mutating func decodeMessage(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: Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .result(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .result(v) - } - }() - case 2: try { - var v: Xmtp_KeystoreApi_V1_KeystoreError? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .error(v) - } - }() - default: break - } - } - } - - public func traverse(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 - switch self.response { - case .result?: try { - guard case .result(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .error?: try { - guard case .error(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptResponse.Response, rhs: Xmtp_KeystoreApi_V1_DecryptResponse.Response) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_DecryptResponse.Response.protoMessageName + ".Success" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "decrypted"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.decrypted) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.decrypted.isEmpty { - try visitor.visitSingularBytesField(value: self.decrypted, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success, rhs: Xmtp_KeystoreApi_V1_DecryptResponse.Response.Success) -> Bool { - if lhs.decrypted != rhs.decrypted {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_DecryptV2Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DecryptV2Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "requests"), - ] - - public mutating func decodeMessage(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.requests) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.requests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.requests, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptV2Request, rhs: Xmtp_KeystoreApi_V1_DecryptV2Request) -> Bool { - if lhs.requests != rhs.requests {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_DecryptV2Request.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_DecryptV2Request.protoMessageName + ".Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "payload"), - 2: .standard(proto: "header_bytes"), - 3: .standard(proto: "content_topic"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._payload) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.headerBytes) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.contentTopic) }() - default: break - } - } - } - - public func traverse(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 let v = self._payload { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.headerBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.headerBytes, fieldNumber: 2) - } - if !self.contentTopic.isEmpty { - try visitor.visitSingularStringField(value: self.contentTopic, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_DecryptV2Request.Request, rhs: Xmtp_KeystoreApi_V1_DecryptV2Request.Request) -> Bool { - if lhs._payload != rhs._payload {return false} - if lhs.headerBytes != rhs.headerBytes {return false} - if lhs.contentTopic != rhs.contentTopic {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_EncryptV1Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EncryptV1Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "requests"), - ] - - public mutating func decodeMessage(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.requests) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.requests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.requests, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptV1Request, rhs: Xmtp_KeystoreApi_V1_EncryptV1Request) -> Bool { - if lhs.requests != rhs.requests {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_EncryptV1Request.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_EncryptV1Request.protoMessageName + ".Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "recipient"), - 2: .same(proto: "payload"), - 3: .standard(proto: "header_bytes"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._recipient) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.payload) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self.headerBytes) }() - default: break - } - } - } - - public func traverse(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 let v = self._recipient { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.payload.isEmpty { - try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 2) - } - if !self.headerBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.headerBytes, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptV1Request.Request, rhs: Xmtp_KeystoreApi_V1_EncryptV1Request.Request) -> Bool { - if lhs._recipient != rhs._recipient {return false} - if lhs.payload != rhs.payload {return false} - if lhs.headerBytes != rhs.headerBytes {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_EncryptResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EncryptResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "responses"), - ] - - public mutating func decodeMessage(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.responses) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.responses.isEmpty { - try visitor.visitRepeatedMessageField(value: self.responses, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptResponse, rhs: Xmtp_KeystoreApi_V1_EncryptResponse) -> Bool { - if lhs.responses != rhs.responses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_EncryptResponse.Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_EncryptResponse.protoMessageName + ".Response" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .same(proto: "error"), - ] - - public mutating func decodeMessage(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: Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .result(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .result(v) - } - }() - case 2: try { - var v: Xmtp_KeystoreApi_V1_KeystoreError? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .error(v) - } - }() - default: break - } - } - } - - public func traverse(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 - switch self.response { - case .result?: try { - guard case .result(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .error?: try { - guard case .error(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptResponse.Response, rhs: Xmtp_KeystoreApi_V1_EncryptResponse.Response) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_EncryptResponse.Response.protoMessageName + ".Success" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "encrypted"), - 2: .standard(proto: "sender_hmac"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._encrypted) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.senderHmac) }() - default: break - } - } - } - - public func traverse(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 let v = self._encrypted { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.senderHmac.isEmpty { - try visitor.visitSingularBytesField(value: self.senderHmac, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success, rhs: Xmtp_KeystoreApi_V1_EncryptResponse.Response.Success) -> Bool { - if lhs._encrypted != rhs._encrypted {return false} - if lhs.senderHmac != rhs.senderHmac {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_EncryptV2Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".EncryptV2Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "requests"), - ] - - public mutating func decodeMessage(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.requests) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.requests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.requests, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptV2Request, rhs: Xmtp_KeystoreApi_V1_EncryptV2Request) -> Bool { - if lhs.requests != rhs.requests {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_EncryptV2Request.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_EncryptV2Request.protoMessageName + ".Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "payload"), - 2: .standard(proto: "header_bytes"), - 3: .standard(proto: "content_topic"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.payload) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.headerBytes) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.contentTopic) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.payload.isEmpty { - try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 1) - } - if !self.headerBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.headerBytes, fieldNumber: 2) - } - if !self.contentTopic.isEmpty { - try visitor.visitSingularStringField(value: self.contentTopic, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_EncryptV2Request.Request, rhs: Xmtp_KeystoreApi_V1_EncryptV2Request.Request) -> Bool { - if lhs.payload != rhs.payload {return false} - if lhs.headerBytes != rhs.headerBytes {return false} - if lhs.contentTopic != rhs.contentTopic {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SelfEncryptRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SelfEncryptRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "requests"), - ] - - public mutating func decodeMessage(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.requests) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.requests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.requests, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfEncryptRequest, rhs: Xmtp_KeystoreApi_V1_SelfEncryptRequest) -> Bool { - if lhs.requests != rhs.requests {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SelfEncryptRequest.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_SelfEncryptRequest.protoMessageName + ".Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "payload"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.payload) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.payload.isEmpty { - try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfEncryptRequest.Request, rhs: Xmtp_KeystoreApi_V1_SelfEncryptRequest.Request) -> Bool { - if lhs.payload != rhs.payload {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SelfEncryptResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SelfEncryptResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "responses"), - ] - - public mutating func decodeMessage(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.responses) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.responses.isEmpty { - try visitor.visitRepeatedMessageField(value: self.responses, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse, rhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse) -> Bool { - if lhs.responses != rhs.responses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_SelfEncryptResponse.protoMessageName + ".Response" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .same(proto: "error"), - ] - - public mutating func decodeMessage(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: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .result(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .result(v) - } - }() - case 2: try { - var v: Xmtp_KeystoreApi_V1_KeystoreError? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .error(v) - } - }() - default: break - } - } - } - - public func traverse(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 - switch self.response { - case .result?: try { - guard case .result(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .error?: try { - guard case .error(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response, rhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.protoMessageName + ".Success" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "encrypted"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.encrypted) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.encrypted.isEmpty { - try visitor.visitSingularBytesField(value: self.encrypted, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success, rhs: Xmtp_KeystoreApi_V1_SelfEncryptResponse.Response.Success) -> Bool { - if lhs.encrypted != rhs.encrypted {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SelfDecryptRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SelfDecryptRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "requests"), - ] - - public mutating func decodeMessage(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.requests) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.requests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.requests, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfDecryptRequest, rhs: Xmtp_KeystoreApi_V1_SelfDecryptRequest) -> Bool { - if lhs.requests != rhs.requests {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SelfDecryptRequest.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_SelfDecryptRequest.protoMessageName + ".Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "payload"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.payload) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.payload.isEmpty { - try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SelfDecryptRequest.Request, rhs: Xmtp_KeystoreApi_V1_SelfDecryptRequest.Request) -> Bool { - if lhs.payload != rhs.payload {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetPrivatePreferencesTopicIdentifierResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetPrivatePreferencesTopicIdentifierResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "identifier"), - ] - - public mutating func decodeMessage(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.identifier) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.identifier.isEmpty { - try visitor.visitSingularStringField(value: self.identifier, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetPrivatePreferencesTopicIdentifierResponse, rhs: Xmtp_KeystoreApi_V1_GetPrivatePreferencesTopicIdentifierResponse) -> Bool { - if lhs.identifier != rhs.identifier {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_CreateInviteRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CreateInviteRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "context"), - 2: .same(proto: "recipient"), - 3: .standard(proto: "created_ns"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._context) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._recipient) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.createdNs) }() - default: break - } - } - } - - public func traverse(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 let v = self._context { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = self._recipient { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.createdNs != 0 { - try visitor.visitSingularUInt64Field(value: self.createdNs, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_CreateInviteRequest, rhs: Xmtp_KeystoreApi_V1_CreateInviteRequest) -> Bool { - if lhs._context != rhs._context {return false} - if lhs._recipient != rhs._recipient {return false} - if lhs.createdNs != rhs.createdNs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_CreateInviteResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CreateInviteResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "conversation"), - 2: .same(proto: "payload"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._conversation) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.payload) }() - default: break - } - } - } - - public func traverse(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 let v = self._conversation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if !self.payload.isEmpty { - try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_CreateInviteResponse, rhs: Xmtp_KeystoreApi_V1_CreateInviteResponse) -> Bool { - if lhs._conversation != rhs._conversation {return false} - if lhs.payload != rhs.payload {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SaveInvitesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SaveInvitesRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "requests"), - ] - - public mutating func decodeMessage(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.requests) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.requests.isEmpty { - try visitor.visitRepeatedMessageField(value: self.requests, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveInvitesRequest, rhs: Xmtp_KeystoreApi_V1_SaveInvitesRequest) -> Bool { - if lhs.requests != rhs.requests {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SaveInvitesRequest.Request: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_SaveInvitesRequest.protoMessageName + ".Request" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "content_topic"), - 2: .standard(proto: "timestamp_ns"), - 3: .same(proto: "payload"), - ] - - public mutating func decodeMessage(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.contentTopic) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.timestampNs) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self.payload) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.contentTopic.isEmpty { - try visitor.visitSingularStringField(value: self.contentTopic, fieldNumber: 1) - } - if self.timestampNs != 0 { - try visitor.visitSingularUInt64Field(value: self.timestampNs, fieldNumber: 2) - } - if !self.payload.isEmpty { - try visitor.visitSingularBytesField(value: self.payload, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveInvitesRequest.Request, rhs: Xmtp_KeystoreApi_V1_SaveInvitesRequest.Request) -> Bool { - if lhs.contentTopic != rhs.contentTopic {return false} - if lhs.timestampNs != rhs.timestampNs {return false} - if lhs.payload != rhs.payload {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SaveInvitesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SaveInvitesResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "responses"), - ] - - public mutating func decodeMessage(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.responses) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.responses.isEmpty { - try visitor.visitRepeatedMessageField(value: self.responses, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse, rhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse) -> Bool { - if lhs.responses != rhs.responses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_SaveInvitesResponse.protoMessageName + ".Response" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "result"), - 2: .same(proto: "error"), - ] - - public mutating func decodeMessage(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: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .result(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .result(v) - } - }() - case 2: try { - var v: Xmtp_KeystoreApi_V1_KeystoreError? - var hadOneofValue = false - if let current = self.response { - hadOneofValue = true - if case .error(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.response = .error(v) - } - }() - default: break - } - } - } - - public func traverse(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 - switch self.response { - case .result?: try { - guard case .result(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .error?: try { - guard case .error(let v)? = self.response else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response, rhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.protoMessageName + ".Success" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "conversation"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._conversation) }() - default: break - } - } - } - - public func traverse(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 let v = self._conversation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success, rhs: Xmtp_KeystoreApi_V1_SaveInvitesResponse.Response.Success) -> Bool { - if lhs._conversation != rhs._conversation {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_CreateAuthTokenRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".CreateAuthTokenRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "timestamp_ns"), - ] - - public mutating func decodeMessage(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.decodeSingularUInt64Field(value: &self._timestampNs) }() - default: break - } - } - } - - public func traverse(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 let v = self._timestampNs { - try visitor.visitSingularUInt64Field(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_CreateAuthTokenRequest, rhs: Xmtp_KeystoreApi_V1_CreateAuthTokenRequest) -> Bool { - if lhs._timestampNs != rhs._timestampNs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SaveV1ConversationsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SaveV1ConversationsRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "conversations"), - ] - - public mutating func decodeMessage(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.conversations) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.conversations.isEmpty { - try visitor.visitRepeatedMessageField(value: self.conversations, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveV1ConversationsRequest, rhs: Xmtp_KeystoreApi_V1_SaveV1ConversationsRequest) -> Bool { - if lhs.conversations != rhs.conversations {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SaveV1ConversationsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SaveV1ConversationsResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SaveV1ConversationsResponse, rhs: Xmtp_KeystoreApi_V1_SaveV1ConversationsResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetConversationsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetConversationsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "conversations"), - ] - - public mutating func decodeMessage(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.conversations) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.conversations.isEmpty { - try visitor.visitRepeatedMessageField(value: self.conversations, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetConversationsResponse, rhs: Xmtp_KeystoreApi_V1_GetConversationsResponse) -> Bool { - if lhs.conversations != rhs.conversations {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetKeystoreStatusRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetKeystoreStatusRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "wallet_address"), - ] - - public mutating func decodeMessage(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.walletAddress) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.walletAddress.isEmpty { - try visitor.visitSingularStringField(value: self.walletAddress, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetKeystoreStatusRequest, rhs: Xmtp_KeystoreApi_V1_GetKeystoreStatusRequest) -> Bool { - if lhs.walletAddress != rhs.walletAddress {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetKeystoreStatusResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "status"), - ] - - public mutating func decodeMessage(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.status) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.status != .unspecified { - try visitor.visitSingularEnumField(value: self.status, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse, rhs: Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse) -> Bool { - if lhs.status != rhs.status {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse.KeystoreStatus: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "KEYSTORE_STATUS_UNSPECIFIED"), - 1: .same(proto: "KEYSTORE_STATUS_UNINITIALIZED"), - 2: .same(proto: "KEYSTORE_STATUS_INITIALIZED"), - ] -} - -extension Xmtp_KeystoreApi_V1_InitKeystoreRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".InitKeystoreRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "v1"), - ] - - public mutating func decodeMessage(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: Xmtp_MessageContents_PrivateKeyBundleV1? - var hadOneofValue = false - if let current = self.bundle { - hadOneofValue = true - if case .v1(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.bundle = .v1(v) - } - }() - default: break - } - } - } - - public func traverse(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.bundle { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_InitKeystoreRequest, rhs: Xmtp_KeystoreApi_V1_InitKeystoreRequest) -> Bool { - if lhs.bundle != rhs.bundle {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_InitKeystoreResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".InitKeystoreResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "error"), - ] - - public mutating func decodeMessage(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.decodeSingularMessageField(value: &self._error) }() - default: break - } - } - } - - public func traverse(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 let v = self._error { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_InitKeystoreResponse, rhs: Xmtp_KeystoreApi_V1_InitKeystoreResponse) -> Bool { - if lhs._error != rhs._error {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SignDigestRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SignDigestRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "digest"), - 2: .standard(proto: "identity_key"), - 3: .standard(proto: "prekey_index"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.digest) }() - case 2: try { - var v: Bool? - try decoder.decodeSingularBoolField(value: &v) - if let v = v { - if self.signer != nil {try decoder.handleConflictingOneOf()} - self.signer = .identityKey(v) - } - }() - case 3: try { - var v: UInt32? - try decoder.decodeSingularUInt32Field(value: &v) - if let v = v { - if self.signer != nil {try decoder.handleConflictingOneOf()} - self.signer = .prekeyIndex(v) - } - }() - default: break - } - } - } - - public func traverse(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.digest.isEmpty { - try visitor.visitSingularBytesField(value: self.digest, fieldNumber: 1) - } - switch self.signer { - case .identityKey?: try { - guard case .identityKey(let v)? = self.signer else { preconditionFailure() } - try visitor.visitSingularBoolField(value: v, fieldNumber: 2) - }() - case .prekeyIndex?: try { - guard case .prekeyIndex(let v)? = self.signer else { preconditionFailure() } - try visitor.visitSingularUInt32Field(value: v, fieldNumber: 3) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SignDigestRequest, rhs: Xmtp_KeystoreApi_V1_SignDigestRequest) -> Bool { - if lhs.digest != rhs.digest {return false} - if lhs.signer != rhs.signer {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetRefreshJobRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetRefreshJobRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "job_type"), - ] - - public mutating func decodeMessage(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.jobType) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.jobType != .unspecified { - try visitor.visitSingularEnumField(value: self.jobType, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetRefreshJobRequest, rhs: Xmtp_KeystoreApi_V1_GetRefreshJobRequest) -> Bool { - if lhs.jobType != rhs.jobType {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetRefreshJobResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetRefreshJobResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "last_run_ns"), - ] - - public mutating func decodeMessage(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.lastRunNs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.lastRunNs != 0 { - try visitor.visitSingularInt64Field(value: self.lastRunNs, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetRefreshJobResponse, rhs: Xmtp_KeystoreApi_V1_GetRefreshJobResponse) -> Bool { - if lhs.lastRunNs != rhs.lastRunNs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SetRefeshJobRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetRefeshJobRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "job_type"), - 2: .standard(proto: "last_run_ns"), - ] - - public mutating func decodeMessage(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.jobType) }() - case 2: try { try decoder.decodeSingularInt64Field(value: &self.lastRunNs) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.jobType != .unspecified { - try visitor.visitSingularEnumField(value: self.jobType, fieldNumber: 1) - } - if self.lastRunNs != 0 { - try visitor.visitSingularInt64Field(value: self.lastRunNs, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SetRefeshJobRequest, rhs: Xmtp_KeystoreApi_V1_SetRefeshJobRequest) -> Bool { - if lhs.jobType != rhs.jobType {return false} - if lhs.lastRunNs != rhs.lastRunNs {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_SetRefreshJobResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".SetRefreshJobResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_SetRefreshJobResponse, rhs: Xmtp_KeystoreApi_V1_SetRefreshJobResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_TopicMap: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TopicMap" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "topics"), - ] - - public mutating func decodeMessage(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.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.topics) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.topics.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.topics, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_TopicMap, rhs: Xmtp_KeystoreApi_V1_TopicMap) -> Bool { - if lhs.topics != rhs.topics {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_TopicMap.TopicData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_TopicMap.protoMessageName + ".TopicData" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "created_ns"), - 2: .standard(proto: "peer_address"), - 3: .same(proto: "invitation"), - ] - - public mutating func decodeMessage(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.decodeSingularUInt64Field(value: &self.createdNs) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.peerAddress) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._invitation) }() - default: break - } - } - } - - public func traverse(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.createdNs != 0 { - try visitor.visitSingularUInt64Field(value: self.createdNs, fieldNumber: 1) - } - if !self.peerAddress.isEmpty { - try visitor.visitSingularStringField(value: self.peerAddress, fieldNumber: 2) - } - try { if let v = self._invitation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_TopicMap.TopicData, rhs: Xmtp_KeystoreApi_V1_TopicMap.TopicData) -> Bool { - if lhs.createdNs != rhs.createdNs {return false} - if lhs.peerAddress != rhs.peerAddress {return false} - if lhs._invitation != rhs._invitation {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetConversationHmacKeysResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "hmac_keys"), - ] - - public mutating func decodeMessage(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.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.hmacKeys) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.hmacKeys.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.hmacKeys, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse, rhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse) -> Bool { - if lhs.hmacKeys != rhs.hmacKeys {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeyData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.protoMessageName + ".HmacKeyData" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "thirty_day_periods_since_epoch"), - 2: .standard(proto: "hmac_key"), - ] - - public mutating func decodeMessage(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.decodeSingularInt32Field(value: &self.thirtyDayPeriodsSinceEpoch) }() - case 2: try { try decoder.decodeSingularBytesField(value: &self.hmacKey) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.thirtyDayPeriodsSinceEpoch != 0 { - try visitor.visitSingularInt32Field(value: self.thirtyDayPeriodsSinceEpoch, fieldNumber: 1) - } - if !self.hmacKey.isEmpty { - try visitor.visitSingularBytesField(value: self.hmacKey, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeyData, rhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeyData) -> Bool { - if lhs.thirtyDayPeriodsSinceEpoch != rhs.thirtyDayPeriodsSinceEpoch {return false} - if lhs.hmacKey != rhs.hmacKey {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeys: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.protoMessageName + ".HmacKeys" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "values"), - ] - - public mutating func decodeMessage(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.values) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.values.isEmpty { - try visitor.visitRepeatedMessageField(value: self.values, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeys, rhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeys) -> Bool { - if lhs.values != rhs.values {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Sources/XMTPiOS/Proto/message_contents/message.pb.swift b/Sources/XMTPiOS/Proto/message_contents/message.pb.swift index 8cbf8114..e69de29b 100644 --- a/Sources/XMTPiOS/Proto/message_contents/message.pb.swift +++ b/Sources/XMTPiOS/Proto/message_contents/message.pb.swift @@ -1,618 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: message_contents/message.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -/// Messages used for transport and storage of user conversations. - -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 -} - -/// Message header is encoded separately as the bytes are also used -/// as associated data for authenticated encryption -public struct Xmtp_MessageContents_MessageHeaderV1 { - // 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 sender: Xmtp_MessageContents_PublicKeyBundle { - get {return _storage._sender ?? Xmtp_MessageContents_PublicKeyBundle()} - set {_uniqueStorage()._sender = newValue} - } - /// Returns true if `sender` has been explicitly set. - public var hasSender: Bool {return _storage._sender != nil} - /// Clears the value of `sender`. Subsequent reads from it will return its default value. - public mutating func clearSender() {_uniqueStorage()._sender = nil} - - public var recipient: Xmtp_MessageContents_PublicKeyBundle { - get {return _storage._recipient ?? Xmtp_MessageContents_PublicKeyBundle()} - set {_uniqueStorage()._recipient = newValue} - } - /// Returns true if `recipient` has been explicitly set. - public var hasRecipient: Bool {return _storage._recipient != nil} - /// Clears the value of `recipient`. Subsequent reads from it will return its default value. - public mutating func clearRecipient() {_uniqueStorage()._recipient = nil} - - public var timestamp: UInt64 { - get {return _storage._timestamp} - set {_uniqueStorage()._timestamp = newValue} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -/// Message is the top level protocol element -public struct Xmtp_MessageContents_MessageV1 { - // 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. - - /// encapsulates encoded MessageHeaderV1 - public var headerBytes: Data = Data() - - /// Ciphertext.payload MUST contain encrypted EncodedContent - public var ciphertext: Xmtp_MessageContents_Ciphertext { - get {return _ciphertext ?? Xmtp_MessageContents_Ciphertext()} - set {_ciphertext = newValue} - } - /// Returns true if `ciphertext` has been explicitly set. - public var hasCiphertext: Bool {return self._ciphertext != nil} - /// Clears the value of `ciphertext`. Subsequent reads from it will return its default value. - public mutating func clearCiphertext() {self._ciphertext = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _ciphertext: Xmtp_MessageContents_Ciphertext? = nil -} - -/// Message header carries information that is not encrypted, and is therefore -/// observable by the network. It is however authenticated as associated data -/// of the AEAD encryption used to protect the message, -/// thus providing tamper evidence. -public struct Xmtp_MessageContents_MessageHeaderV2 { - // 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. - - /// sender specified message creation time - public var createdNs: UInt64 = 0 - - /// the topic the message belongs to - public var topic: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Message combines the encoded header with the encrypted payload. -public struct Xmtp_MessageContents_MessageV2 { - // 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. - - /// encapsulates encoded MessageHeaderV2 - public var headerBytes: Data = Data() - - /// Ciphertext.payload MUST contain encrypted SignedContent - public var ciphertext: Xmtp_MessageContents_Ciphertext { - get {return _ciphertext ?? Xmtp_MessageContents_Ciphertext()} - set {_ciphertext = newValue} - } - /// Returns true if `ciphertext` has been explicitly set. - public var hasCiphertext: Bool {return self._ciphertext != nil} - /// Clears the value of `ciphertext`. Subsequent reads from it will return its default value. - public mutating func clearCiphertext() {self._ciphertext = nil} - - /// HMAC of the message ciphertext, with the HMAC key derived from the topic key - public var senderHmac: Data = Data() - - /// Flag indicating whether the message should be pushed from a notification server - public var shouldPush: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _ciphertext: Xmtp_MessageContents_Ciphertext? = nil -} - -/// Versioned Message -public struct Xmtp_MessageContents_Message { - // 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_Message.OneOf_Version? = nil - - public var v1: Xmtp_MessageContents_MessageV1 { - get { - if case .v1(let v)? = version {return v} - return Xmtp_MessageContents_MessageV1() - } - set {version = .v1(newValue)} - } - - public var v2: Xmtp_MessageContents_MessageV2 { - get { - if case .v2(let v)? = version {return v} - return Xmtp_MessageContents_MessageV2() - } - set {version = .v2(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Version: Equatable { - case v1(Xmtp_MessageContents_MessageV1) - case v2(Xmtp_MessageContents_MessageV2) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_MessageContents_Message.OneOf_Version, rhs: Xmtp_MessageContents_Message.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 - }() - case (.v2, .v2): return { - guard case .v2(let l) = lhs, case .v2(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - public init() {} -} - -/// DecodedMessage represents the decrypted message contents. -/// DecodedMessage instances are not stored on the network, but -/// may be serialized and stored by clients -public struct Xmtp_MessageContents_DecodedMessage { - // 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 id: String = String() - - public var messageVersion: String = String() - - public var senderAddress: String = String() - - public var recipientAddress: String { - get {return _recipientAddress ?? String()} - set {_recipientAddress = newValue} - } - /// Returns true if `recipientAddress` has been explicitly set. - public var hasRecipientAddress: Bool {return self._recipientAddress != nil} - /// Clears the value of `recipientAddress`. Subsequent reads from it will return its default value. - public mutating func clearRecipientAddress() {self._recipientAddress = nil} - - public var sentNs: UInt64 = 0 - - public var contentTopic: String = String() - - public var conversation: Xmtp_MessageContents_ConversationReference { - get {return _conversation ?? Xmtp_MessageContents_ConversationReference()} - set {_conversation = newValue} - } - /// Returns true if `conversation` has been explicitly set. - public var hasConversation: Bool {return self._conversation != nil} - /// Clears the value of `conversation`. Subsequent reads from it will return its default value. - public mutating func clearConversation() {self._conversation = nil} - - /// encapsulates EncodedContent - public var contentBytes: Data = Data() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _recipientAddress: String? = nil - fileprivate var _conversation: Xmtp_MessageContents_ConversationReference? = nil -} - -#if swift(>=5.5) && canImport(_Concurrency) -extension Xmtp_MessageContents_MessageHeaderV1: @unchecked Sendable {} -extension Xmtp_MessageContents_MessageV1: @unchecked Sendable {} -extension Xmtp_MessageContents_MessageHeaderV2: @unchecked Sendable {} -extension Xmtp_MessageContents_MessageV2: @unchecked Sendable {} -extension Xmtp_MessageContents_Message: @unchecked Sendable {} -extension Xmtp_MessageContents_Message.OneOf_Version: @unchecked Sendable {} -extension Xmtp_MessageContents_DecodedMessage: @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_MessageHeaderV1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageHeaderV1" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "sender"), - 2: .same(proto: "recipient"), - 3: .same(proto: "timestamp"), - ] - - fileprivate class _StorageClass { - var _sender: Xmtp_MessageContents_PublicKeyBundle? = nil - var _recipient: Xmtp_MessageContents_PublicKeyBundle? = nil - var _timestamp: UInt64 = 0 - - static let defaultInstance = _StorageClass() - - private init() {} - - init(copying source: _StorageClass) { - _sender = source._sender - _recipient = source._recipient - _timestamp = source._timestamp - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - 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.decodeSingularMessageField(value: &_storage._sender) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._recipient) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &_storage._timestamp) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // 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 let v = _storage._sender { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._recipient { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if _storage._timestamp != 0 { - try visitor.visitSingularUInt64Field(value: _storage._timestamp, fieldNumber: 3) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_MessageHeaderV1, rhs: Xmtp_MessageContents_MessageHeaderV1) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._sender != rhs_storage._sender {return false} - if _storage._recipient != rhs_storage._recipient {return false} - if _storage._timestamp != rhs_storage._timestamp {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_MessageV1: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageV1" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "header_bytes"), - 2: .same(proto: "ciphertext"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.headerBytes) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._ciphertext) }() - default: break - } - } - } - - public func traverse(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.headerBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.headerBytes, fieldNumber: 1) - } - try { if let v = self._ciphertext { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_MessageV1, rhs: Xmtp_MessageContents_MessageV1) -> Bool { - if lhs.headerBytes != rhs.headerBytes {return false} - if lhs._ciphertext != rhs._ciphertext {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_MessageHeaderV2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageHeaderV2" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "created_ns"), - 2: .same(proto: "topic"), - ] - - public mutating func decodeMessage(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.decodeSingularUInt64Field(value: &self.createdNs) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.topic) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.createdNs != 0 { - try visitor.visitSingularUInt64Field(value: self.createdNs, fieldNumber: 1) - } - if !self.topic.isEmpty { - try visitor.visitSingularStringField(value: self.topic, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_MessageHeaderV2, rhs: Xmtp_MessageContents_MessageHeaderV2) -> Bool { - if lhs.createdNs != rhs.createdNs {return false} - if lhs.topic != rhs.topic {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_MessageV2: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".MessageV2" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "header_bytes"), - 2: .same(proto: "ciphertext"), - 3: .standard(proto: "sender_hmac"), - 4: .standard(proto: "should_push"), - ] - - public mutating func decodeMessage(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.decodeSingularBytesField(value: &self.headerBytes) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._ciphertext) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self.senderHmac) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self.shouldPush) }() - default: break - } - } - } - - public func traverse(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.headerBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.headerBytes, fieldNumber: 1) - } - try { if let v = self._ciphertext { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if !self.senderHmac.isEmpty { - try visitor.visitSingularBytesField(value: self.senderHmac, fieldNumber: 3) - } - if self.shouldPush != false { - try visitor.visitSingularBoolField(value: self.shouldPush, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_MessageV2, rhs: Xmtp_MessageContents_MessageV2) -> Bool { - if lhs.headerBytes != rhs.headerBytes {return false} - if lhs._ciphertext != rhs._ciphertext {return false} - if lhs.senderHmac != rhs.senderHmac {return false} - if lhs.shouldPush != rhs.shouldPush {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_Message: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Message" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "v1"), - 2: .same(proto: "v2"), - ] - - public mutating func decodeMessage(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: Xmtp_MessageContents_MessageV1? - var hadOneofValue = false - if let current = self.version { - hadOneofValue = true - if case .v1(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.version = .v1(v) - } - }() - case 2: try { - var v: Xmtp_MessageContents_MessageV2? - var hadOneofValue = false - if let current = self.version { - hadOneofValue = true - if case .v2(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.version = .v2(v) - } - }() - default: break - } - } - } - - public func traverse(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 - switch self.version { - case .v1?: try { - guard case .v1(let v)? = self.version else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .v2?: try { - guard case .v2(let v)? = self.version else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_Message, rhs: Xmtp_MessageContents_Message) -> Bool { - if lhs.version != rhs.version {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_DecodedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".DecodedMessage" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .standard(proto: "message_version"), - 3: .standard(proto: "sender_address"), - 4: .standard(proto: "recipient_address"), - 5: .standard(proto: "sent_ns"), - 6: .standard(proto: "content_topic"), - 7: .same(proto: "conversation"), - 8: .standard(proto: "content_bytes"), - ] - - public mutating func decodeMessage(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.id) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.messageVersion) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.senderAddress) }() - case 4: try { try decoder.decodeSingularStringField(value: &self._recipientAddress) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &self.sentNs) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.contentTopic) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._conversation) }() - case 8: try { try decoder.decodeSingularBytesField(value: &self.contentBytes) }() - default: break - } - } - } - - public func traverse(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.id.isEmpty { - try visitor.visitSingularStringField(value: self.id, fieldNumber: 1) - } - if !self.messageVersion.isEmpty { - try visitor.visitSingularStringField(value: self.messageVersion, fieldNumber: 2) - } - if !self.senderAddress.isEmpty { - try visitor.visitSingularStringField(value: self.senderAddress, fieldNumber: 3) - } - try { if let v = self._recipientAddress { - try visitor.visitSingularStringField(value: v, fieldNumber: 4) - } }() - if self.sentNs != 0 { - try visitor.visitSingularUInt64Field(value: self.sentNs, fieldNumber: 5) - } - if !self.contentTopic.isEmpty { - try visitor.visitSingularStringField(value: self.contentTopic, fieldNumber: 6) - } - try { if let v = self._conversation { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - if !self.contentBytes.isEmpty { - try visitor.visitSingularBytesField(value: self.contentBytes, fieldNumber: 8) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_DecodedMessage, rhs: Xmtp_MessageContents_DecodedMessage) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.messageVersion != rhs.messageVersion {return false} - if lhs.senderAddress != rhs.senderAddress {return false} - if lhs._recipientAddress != rhs._recipientAddress {return false} - if lhs.sentNs != rhs.sentNs {return false} - if lhs.contentTopic != rhs.contentTopic {return false} - if lhs._conversation != rhs._conversation {return false} - if lhs.contentBytes != rhs.contentBytes {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Sources/XMTPiOS/Proto/message_contents/private_preferences.pb.swift b/Sources/XMTPiOS/Proto/message_contents/private_preferences.pb.swift index 185242d9..e69de29b 100644 --- a/Sources/XMTPiOS/Proto/message_contents/private_preferences.pb.swift +++ b/Sources/XMTPiOS/Proto/message_contents/private_preferences.pb.swift @@ -1,341 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: message_contents/private_preferences.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -/// Private Key Storage -/// -/// Following definitions are not used in the protocol, instead -/// they provide a way for encoding private keys for storage. - -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 -} - -/// PrivatePreferencesAction is a message used to update the client's -/// preference store. The only current actions are allow and block. -/// Other actions may be added later -public struct Xmtp_MessageContents_PrivatePreferencesAction { - // 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 messageType: Xmtp_MessageContents_PrivatePreferencesAction.OneOf_MessageType? = nil - - public var allow: Xmtp_MessageContents_PrivatePreferencesAction.Allow { - get { - if case .allow(let v)? = messageType {return v} - return Xmtp_MessageContents_PrivatePreferencesAction.Allow() - } - set {messageType = .allow(newValue)} - } - - public var block: Xmtp_MessageContents_PrivatePreferencesAction.Block { - get { - if case .block(let v)? = messageType {return v} - return Xmtp_MessageContents_PrivatePreferencesAction.Block() - } - set {messageType = .block(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_MessageType: Equatable { - case allow(Xmtp_MessageContents_PrivatePreferencesAction.Allow) - case block(Xmtp_MessageContents_PrivatePreferencesAction.Block) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction.OneOf_MessageType, rhs: Xmtp_MessageContents_PrivatePreferencesAction.OneOf_MessageType) -> 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 (.allow, .allow): return { - guard case .allow(let l) = lhs, case .allow(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.block, .block): return { - guard case .block(let l) = lhs, case .block(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } - #endif - } - - /// Add the given wallet addresses to the allow list - public struct Allow { - // 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 walletAddresses: [String] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - /// Add the given wallet addresses to the block list - public struct Block { - // 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 walletAddresses: [String] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -/// The payload that goes over the wire -public struct Xmtp_MessageContents_PrivatePreferencesPayload { - // 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_PrivatePreferencesPayload.OneOf_Version? = nil - - public var v1: Xmtp_MessageContents_Ciphertext { - get { - if case .v1(let v)? = version {return v} - return Xmtp_MessageContents_Ciphertext() - } - set {version = .v1(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Version: Equatable { - case v1(Xmtp_MessageContents_Ciphertext) - - #if !swift(>=4.1) - public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesPayload.OneOf_Version, rhs: Xmtp_MessageContents_PrivatePreferencesPayload.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_PrivatePreferencesAction: @unchecked Sendable {} -extension Xmtp_MessageContents_PrivatePreferencesAction.OneOf_MessageType: @unchecked Sendable {} -extension Xmtp_MessageContents_PrivatePreferencesAction.Allow: @unchecked Sendable {} -extension Xmtp_MessageContents_PrivatePreferencesAction.Block: @unchecked Sendable {} -extension Xmtp_MessageContents_PrivatePreferencesPayload: @unchecked Sendable {} -extension Xmtp_MessageContents_PrivatePreferencesPayload.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_PrivatePreferencesAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PrivatePreferencesAction" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "allow"), - 2: .same(proto: "block"), - ] - - public mutating func decodeMessage(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: Xmtp_MessageContents_PrivatePreferencesAction.Allow? - var hadOneofValue = false - if let current = self.messageType { - hadOneofValue = true - if case .allow(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.messageType = .allow(v) - } - }() - case 2: try { - var v: Xmtp_MessageContents_PrivatePreferencesAction.Block? - var hadOneofValue = false - if let current = self.messageType { - hadOneofValue = true - if case .block(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.messageType = .block(v) - } - }() - default: break - } - } - } - - public func traverse(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 - switch self.messageType { - case .allow?: try { - guard case .allow(let v)? = self.messageType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .block?: try { - guard case .block(let v)? = self.messageType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction, rhs: Xmtp_MessageContents_PrivatePreferencesAction) -> Bool { - if lhs.messageType != rhs.messageType {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_PrivatePreferencesAction.Allow: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_MessageContents_PrivatePreferencesAction.protoMessageName + ".Allow" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "wallet_addresses"), - ] - - public mutating func decodeMessage(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.decodeRepeatedStringField(value: &self.walletAddresses) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.walletAddresses.isEmpty { - try visitor.visitRepeatedStringField(value: self.walletAddresses, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction.Allow, rhs: Xmtp_MessageContents_PrivatePreferencesAction.Allow) -> Bool { - if lhs.walletAddresses != rhs.walletAddresses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_PrivatePreferencesAction.Block: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Xmtp_MessageContents_PrivatePreferencesAction.protoMessageName + ".Block" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "wallet_addresses"), - ] - - public mutating func decodeMessage(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.decodeRepeatedStringField(value: &self.walletAddresses) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.walletAddresses.isEmpty { - try visitor.visitRepeatedStringField(value: self.walletAddresses, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction.Block, rhs: Xmtp_MessageContents_PrivatePreferencesAction.Block) -> Bool { - if lhs.walletAddresses != rhs.walletAddresses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Xmtp_MessageContents_PrivatePreferencesPayload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PrivatePreferencesPayload" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "v1"), - ] - - public mutating func decodeMessage(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: Xmtp_MessageContents_Ciphertext? - var hadOneofValue = false - if let current = self.version { - hadOneofValue = true - if case .v1(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.version = .v1(v) - } - }() - default: break - } - } - } - - public func traverse(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.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesPayload, rhs: Xmtp_MessageContents_PrivatePreferencesPayload) -> Bool { - if lhs.version != rhs.version {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -}