diff --git a/README.md b/README.md index 96a4391f..e7f756fc 100644 --- a/README.md +++ b/README.md @@ -473,3 +473,8 @@ The `env` parameter accepts one of three valid values: `dev`, `production`, or ` - `local`: Use to have a client communicate with an XMTP node you are running locally. For example, an XMTP node developer can set `env` to `local` to generate client traffic to test a node running locally. The `production` network is configured to store messages indefinitely. XMTP may occasionally delete messages and keys from the `dev` network, and will provide advance notice in the [XMTP Discord community](https://discord.gg/xmtp). + +## Generate Protobufs +``` +buf generate buf.build/xmtp/proto +``` diff --git a/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift b/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift index 901520aa..5c2a8e6e 100644 --- a/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift +++ b/Sources/XMTPiOS/Proto/keystore_api/v1/keystore.pb.swift @@ -31,25 +31,25 @@ public enum Xmtp_KeystoreApi_V1_ErrorCode: SwiftProtobuf.Enum { case UNRECOGNIZED(Int) public init() { - self = .unspecified + self = .unspecified } public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unspecified - case 1: self = .invalidInput - case 2: self = .noMatchingPrekey - default: self = .UNRECOGNIZED(rawValue) - } + 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 - } + switch self { + case .unspecified: return 0 + case .invalidInput: return 1 + case .noMatchingPrekey: return 2 + case .UNRECOGNIZED(let i): return i + } } } @@ -59,9 +59,9 @@ public enum Xmtp_KeystoreApi_V1_ErrorCode: SwiftProtobuf.Enum { 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, + .unspecified, + .invalidInput, + .noMatchingPrekey, ] } @@ -77,27 +77,27 @@ public enum Xmtp_KeystoreApi_V1_JobType: SwiftProtobuf.Enum { case UNRECOGNIZED(Int) public init() { - self = .unspecified + 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) - } + 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 - } + switch self { + case .unspecified: return 0 + case .refreshV1: return 1 + case .refreshV2: return 2 + case .refreshPppp: return 3 + case .UNRECOGNIZED(let i): return i + } } } @@ -107,10 +107,10 @@ public enum Xmtp_KeystoreApi_V1_JobType: SwiftProtobuf.Enum { 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, + .unspecified, + .refreshV1, + .refreshV2, + .refreshPppp, ] } @@ -143,38 +143,38 @@ public struct Xmtp_KeystoreApi_V1_DecryptV1Request { /// 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. + // 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 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 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 headerBytes: Data = Data() - public var isSender: Bool = false + public var isSender: Bool = false - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} - fileprivate var _payload: Xmtp_MessageContents_Ciphertext? = nil - fileprivate var _peerKeys: Xmtp_MessageContents_PublicKeyBundle? = nil + fileprivate var _payload: Xmtp_MessageContents_Ciphertext? = nil + fileprivate var _peerKeys: Xmtp_MessageContents_PublicKeyBundle? = nil } public init() {} @@ -192,68 +192,68 @@ public struct Xmtp_KeystoreApi_V1_DecryptResponse { /// 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() {} + // 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() {} @@ -271,28 +271,28 @@ public struct Xmtp_KeystoreApi_V1_DecryptV2Request { /// 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. + // 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 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 headerBytes: Data = Data() - public var contentTopic: String = String() + public var contentTopic: String = String() - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} - fileprivate var _payload: Xmtp_MessageContents_Ciphertext? = nil + fileprivate var _payload: Xmtp_MessageContents_Ciphertext? = nil } public init() {} @@ -310,28 +310,28 @@ public struct Xmtp_KeystoreApi_V1_EncryptV1Request { /// 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. + // 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 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 payload: Data = Data() - public var headerBytes: Data = Data() + public var headerBytes: Data = Data() - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} - fileprivate var _recipient: Xmtp_MessageContents_PublicKeyBundle? = nil + fileprivate var _recipient: Xmtp_MessageContents_PublicKeyBundle? = nil } public init() {} @@ -349,79 +349,79 @@ public struct Xmtp_KeystoreApi_V1_EncryptResponse { /// 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() {} + // 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() {} @@ -439,19 +439,19 @@ public struct Xmtp_KeystoreApi_V1_EncryptV2Request { /// 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. + // 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 payload: Data = Data() - public var headerBytes: Data = Data() + public var headerBytes: Data = Data() - public var contentTopic: String = String() + public var contentTopic: String = String() - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } public init() {} @@ -469,15 +469,15 @@ public struct Xmtp_KeystoreApi_V1_SelfEncryptRequest { /// 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. + // 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 payload: Data = Data() - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } public init() {} @@ -495,68 +495,68 @@ public struct Xmtp_KeystoreApi_V1_SelfEncryptResponse { /// 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() {} + // 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() {} @@ -574,15 +574,15 @@ public struct Xmtp_KeystoreApi_V1_SelfDecryptRequest { /// 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. + // 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 payload: Data = Data() - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } public init() {} @@ -608,8 +608,8 @@ public struct Xmtp_KeystoreApi_V1_CreateInviteRequest { // methods supported on all messages. public var context: Xmtp_MessageContents_InvitationV1.Context { - get {return _context ?? Xmtp_MessageContents_InvitationV1.Context()} - set {_context = newValue} + 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} @@ -617,8 +617,8 @@ public struct Xmtp_KeystoreApi_V1_CreateInviteRequest { public mutating func clearContext() {self._context = nil} public var recipient: Xmtp_MessageContents_SignedPublicKeyBundle { - get {return _recipient ?? Xmtp_MessageContents_SignedPublicKeyBundle()} - set {_recipient = newValue} + 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} @@ -642,8 +642,8 @@ public struct Xmtp_KeystoreApi_V1_CreateInviteResponse { // methods supported on all messages. public var conversation: Xmtp_MessageContents_ConversationReference { - get {return _conversation ?? Xmtp_MessageContents_ConversationReference()} - set {_conversation = newValue} + 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} @@ -671,19 +671,19 @@ public struct Xmtp_KeystoreApi_V1_SaveInvitesRequest { /// 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. + // 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 contentTopic: String = String() - public var timestampNs: UInt64 = 0 + public var timestampNs: UInt64 = 0 - public var payload: Data = Data() + public var payload: Data = Data() - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } public init() {} @@ -701,77 +701,77 @@ public struct Xmtp_KeystoreApi_V1_SaveInvitesResponse { /// 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() {} + // 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() {} @@ -784,8 +784,8 @@ public struct Xmtp_KeystoreApi_V1_CreateAuthTokenRequest { // methods supported on all messages. public var timestampNs: UInt64 { - get {return _timestampNs ?? 0} - set {_timestampNs = newValue} + get {return _timestampNs ?? 0} + set {_timestampNs = newValue} } /// Returns true if `timestampNs` has been explicitly set. public var hasTimestampNs: Bool {return self._timestampNs != nil} @@ -863,33 +863,33 @@ public struct Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse { /// 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 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 + } + } } @@ -901,9 +901,9 @@ public struct Xmtp_KeystoreApi_V1_GetKeystoreStatusResponse { 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, + .unspecified, + .uninitialized, + .initialized, ] } @@ -919,30 +919,30 @@ public struct Xmtp_KeystoreApi_V1_InitKeystoreRequest { 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)} + 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) + 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 - }() - } - } + 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 } @@ -956,8 +956,8 @@ public struct Xmtp_KeystoreApi_V1_InitKeystoreResponse { // methods supported on all messages. public var error: Xmtp_KeystoreApi_V1_KeystoreError { - get {return _error ?? Xmtp_KeystoreApi_V1_KeystoreError()} - set {_error = newValue} + 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} @@ -983,44 +983,44 @@ public struct Xmtp_KeystoreApi_V1_SignDigestRequest { 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)} + 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)} + 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) + 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 - } - } + 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 } @@ -1091,28 +1091,28 @@ public struct Xmtp_KeystoreApi_V1_TopicMap { /// 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. + // 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 createdNs: UInt64 = 0 - public var peerAddress: String = String() + 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 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 var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} - fileprivate var _invitation: Xmtp_MessageContents_InvitationV1? = nil + fileprivate var _invitation: Xmtp_MessageContents_InvitationV1? = nil } public init() {} @@ -1143,30 +1143,30 @@ public struct Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse { /// 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. + // 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 thirtyDayPeriodsSinceEpoch: Int32 = 0 - public var hmacKey: Data = Data() + public var hmacKey: Data = Data() - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + 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. + // 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 values: [Xmtp_KeystoreApi_V1_GetConversationHmacKeysResponse.HmacKeyData] = [] - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } public init() {} @@ -1239,1322 +1239,1322 @@ 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"), + 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"), + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + if lhs.conversations != rhs.conversations {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } @@ -2563,373 +2563,373 @@ extension Xmtp_KeystoreApi_V1_SaveV1ConversationsResponse: SwiftProtobuf.Message public static let _protobuf_nameMap = SwiftProtobuf._NameMap() public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let _ = try decoder.nextFieldNumber() { + } } public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + if lhs.jobType != rhs.jobType {return false} + if lhs.lastRunNs != rhs.lastRunNs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } @@ -2938,230 +2938,230 @@ extension Xmtp_KeystoreApi_V1_SetRefreshJobResponse: SwiftProtobuf.Message, Swif public static let _protobuf_nameMap = SwiftProtobuf._NameMap() public mutating func decodeMessage(decoder: inout D) throws { - while let _ = try decoder.nextFieldNumber() { - } + while let _ = try decoder.nextFieldNumber() { + } } public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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_GetConversationHmacKeysRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".GetConversationHmacKeysRequest" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "topics"), + 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.decodeRepeatedStringField(value: &self.topics) }() - default: break - } - } + 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.topics) }() + default: break + } + } } public func traverse(visitor: inout V) throws { - if !self.topics.isEmpty { - try visitor.visitRepeatedStringField(value: self.topics, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) + if !self.topics.isEmpty { + try visitor.visitRepeatedStringField(value: self.topics, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysRequest, rhs: Xmtp_KeystoreApi_V1_GetConversationHmacKeysRequest) -> Bool { - if lhs.topics != rhs.topics {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.topics != rhs.topics {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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) + 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 + if lhs.values != rhs.values {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } diff --git a/Sources/XMTPiOS/Proto/message_contents/frames.pb.swift b/Sources/XMTPiOS/Proto/message_contents/frames.pb.swift new file mode 100644 index 00000000..a99bc60a --- /dev/null +++ b/Sources/XMTPiOS/Proto/message_contents/frames.pb.swift @@ -0,0 +1,222 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: message_contents/frames.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +/// Signature is a generic structure for public key signatures. + +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 +} + +/// The message that will be signed by the Client and returned inside the +/// `action_body` field of the FrameAction message +public struct Xmtp_MessageContents_FrameActionBody { + // 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. + + /// The URL of the frame that was clicked + /// May be different from `post_url` + public var frameURL: String = String() + + /// The 1-indexed button that was clicked + public var buttonIndex: Int32 = 0 + + /// Timestamp of the click in milliseconds since the epoch + public var timestamp: UInt64 = 0 + + /// A unique identifier for the conversation, not tied to anything on the + /// network. Will not match the topic or conversation_id + public var opaqueConversationIdentifier: String = String() + + /// Unix timestamp + public var unixTimestamp: UInt32 = 0 + + /// Input text from a text input field + public var inputText: String = String() + + /// A state serialized to a string (for example via JSON.stringify()). Maximum 4096 bytes. + public var state: String = String() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} +} + +/// The outer payload that will be sent as the `messageBytes` in the +/// `trusted_data` part of the Frames message +public struct Xmtp_MessageContents_FrameAction { + // 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 signature: Xmtp_MessageContents_Signature { + get {return _signature ?? Xmtp_MessageContents_Signature()} + set {_signature = newValue} + } + /// Returns true if `signature` has been explicitly set. + public var hasSignature: Bool {return self._signature != nil} + /// Clears the value of `signature`. Subsequent reads from it will return its default value. + public mutating func clearSignature() {self._signature = nil} + + /// The SignedPublicKeyBundle of the signer, used to link the XMTP signature + /// with a blockchain account through a chain of signatures. + public var signedPublicKeyBundle: Xmtp_MessageContents_SignedPublicKeyBundle { + get {return _signedPublicKeyBundle ?? Xmtp_MessageContents_SignedPublicKeyBundle()} + set {_signedPublicKeyBundle = newValue} + } + /// Returns true if `signedPublicKeyBundle` has been explicitly set. + public var hasSignedPublicKeyBundle: Bool {return self._signedPublicKeyBundle != nil} + /// Clears the value of `signedPublicKeyBundle`. Subsequent reads from it will return its default value. + public mutating func clearSignedPublicKeyBundle() {self._signedPublicKeyBundle = nil} + + /// Serialized FrameActionBody message, so that the signature verification can + /// happen on a byte-perfect representation of the message + public var actionBody: Data = Data() + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _signature: Xmtp_MessageContents_Signature? = nil + fileprivate var _signedPublicKeyBundle: Xmtp_MessageContents_SignedPublicKeyBundle? = nil +} + +#if swift(>=5.5) && canImport(_Concurrency) +extension Xmtp_MessageContents_FrameActionBody: @unchecked Sendable {} +extension Xmtp_MessageContents_FrameAction: @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_FrameActionBody: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FrameActionBody" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "frame_url"), + 2: .standard(proto: "button_index"), + 3: .same(proto: "timestamp"), + 4: .standard(proto: "opaque_conversation_identifier"), + 5: .standard(proto: "unix_timestamp"), + 6: .standard(proto: "input_text"), + 7: .same(proto: "state"), + ] + + 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.frameURL) }() + case 2: try { try decoder.decodeSingularInt32Field(value: &self.buttonIndex) }() + case 3: try { try decoder.decodeSingularUInt64Field(value: &self.timestamp) }() + case 4: try { try decoder.decodeSingularStringField(value: &self.opaqueConversationIdentifier) }() + case 5: try { try decoder.decodeSingularUInt32Field(value: &self.unixTimestamp) }() + case 6: try { try decoder.decodeSingularStringField(value: &self.inputText) }() + case 7: try { try decoder.decodeSingularStringField(value: &self.state) }() + default: break + } + } + } + + public func traverse(visitor: inout V) throws { + if !self.frameURL.isEmpty { + try visitor.visitSingularStringField(value: self.frameURL, fieldNumber: 1) + } + if self.buttonIndex != 0 { + try visitor.visitSingularInt32Field(value: self.buttonIndex, fieldNumber: 2) + } + if self.timestamp != 0 { + try visitor.visitSingularUInt64Field(value: self.timestamp, fieldNumber: 3) + } + if !self.opaqueConversationIdentifier.isEmpty { + try visitor.visitSingularStringField(value: self.opaqueConversationIdentifier, fieldNumber: 4) + } + if self.unixTimestamp != 0 { + try visitor.visitSingularUInt32Field(value: self.unixTimestamp, fieldNumber: 5) + } + if !self.inputText.isEmpty { + try visitor.visitSingularStringField(value: self.inputText, fieldNumber: 6) + } + if !self.state.isEmpty { + try visitor.visitSingularStringField(value: self.state, fieldNumber: 7) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Xmtp_MessageContents_FrameActionBody, rhs: Xmtp_MessageContents_FrameActionBody) -> Bool { + if lhs.frameURL != rhs.frameURL {return false} + if lhs.buttonIndex != rhs.buttonIndex {return false} + if lhs.timestamp != rhs.timestamp {return false} + if lhs.opaqueConversationIdentifier != rhs.opaqueConversationIdentifier {return false} + if lhs.unixTimestamp != rhs.unixTimestamp {return false} + if lhs.inputText != rhs.inputText {return false} + if lhs.state != rhs.state {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Xmtp_MessageContents_FrameAction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FrameAction" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "signature"), + 2: .standard(proto: "signed_public_key_bundle"), + 3: .standard(proto: "action_body"), + ] + + 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._signature) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._signedPublicKeyBundle) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self.actionBody) }() + 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._signature { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._signedPublicKeyBundle { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.actionBody.isEmpty { + try visitor.visitSingularBytesField(value: self.actionBody, fieldNumber: 3) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Xmtp_MessageContents_FrameAction, rhs: Xmtp_MessageContents_FrameAction) -> Bool { + if lhs._signature != rhs._signature {return false} + if lhs._signedPublicKeyBundle != rhs._signedPublicKeyBundle {return false} + if lhs.actionBody != rhs.actionBody {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 22e935fe..823548ab 100644 --- a/Sources/XMTPiOS/Proto/message_contents/message.pb.swift +++ b/Sources/XMTPiOS/Proto/message_contents/message.pb.swift @@ -30,8 +30,8 @@ public struct Xmtp_MessageContents_MessageHeaderV1 { // methods supported on all messages. public var sender: Xmtp_MessageContents_PublicKeyBundle { - get {return _storage._sender ?? Xmtp_MessageContents_PublicKeyBundle()} - set {_uniqueStorage()._sender = newValue} + 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} @@ -39,8 +39,8 @@ public struct Xmtp_MessageContents_MessageHeaderV1 { public mutating func clearSender() {_uniqueStorage()._sender = nil} public var recipient: Xmtp_MessageContents_PublicKeyBundle { - get {return _storage._recipient ?? Xmtp_MessageContents_PublicKeyBundle()} - set {_uniqueStorage()._recipient = newValue} + 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} @@ -48,8 +48,8 @@ public struct Xmtp_MessageContents_MessageHeaderV1 { public mutating func clearRecipient() {_uniqueStorage()._recipient = nil} public var timestamp: UInt64 { - get {return _storage._timestamp} - set {_uniqueStorage()._timestamp = newValue} + get {return _storage._timestamp} + set {_uniqueStorage()._timestamp = newValue} } public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -70,8 +70,8 @@ public struct Xmtp_MessageContents_MessageV1 { /// Ciphertext.payload MUST contain encrypted EncodedContent public var ciphertext: Xmtp_MessageContents_Ciphertext { - get {return _ciphertext ?? Xmtp_MessageContents_Ciphertext()} - set {_ciphertext = newValue} + 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} @@ -116,28 +116,30 @@ public struct Xmtp_MessageContents_MessageV2 { /// Ciphertext.payload MUST contain encrypted SignedContent public var ciphertext: Xmtp_MessageContents_Ciphertext { - get {return _ciphertext ?? Xmtp_MessageContents_Ciphertext()} - set {_ciphertext = newValue} + 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 + /// HMAC of the message ciphertext, with the HMAC key derived from the topic + /// key public var senderHmac: Data { - get {return _senderHmac ?? Data()} - set {_senderHmac = newValue} + get {return _senderHmac ?? Data()} + set {_senderHmac = newValue} } /// Returns true if `senderHmac` has been explicitly set. public var hasSenderHmac: Bool {return self._senderHmac != nil} /// Clears the value of `senderHmac`. Subsequent reads from it will return its default value. public mutating func clearSenderHmac() {self._senderHmac = nil} - /// Flag indicating whether the message should be pushed from a notification server + /// Flag indicating whether the message should be pushed from a notification + /// server public var shouldPush: Bool { - get {return _shouldPush ?? false} - set {_shouldPush = newValue} + get {return _shouldPush ?? false} + set {_shouldPush = newValue} } /// Returns true if `shouldPush` has been explicitly set. public var hasShouldPush: Bool {return self._shouldPush != nil} @@ -162,44 +164,44 @@ public struct Xmtp_MessageContents_Message { 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)} + 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)} + 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) + 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 - } - } + 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 } @@ -221,8 +223,8 @@ public struct Xmtp_MessageContents_DecodedMessage { public var senderAddress: String = String() public var recipientAddress: String { - get {return _recipientAddress ?? String()} - set {_recipientAddress = newValue} + get {return _recipientAddress ?? String()} + set {_recipientAddress = newValue} } /// Returns true if `recipientAddress` has been explicitly set. public var hasRecipientAddress: Bool {return self._recipientAddress != nil} @@ -234,8 +236,8 @@ public struct Xmtp_MessageContents_DecodedMessage { public var contentTopic: String = String() public var conversation: Xmtp_MessageContents_ConversationReference { - get {return _conversation ?? Xmtp_MessageContents_ConversationReference()} - set {_conversation = newValue} + 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} @@ -270,365 +272,373 @@ 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"), + 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 + var _sender: Xmtp_MessageContents_PublicKeyBundle? = nil + var _recipient: Xmtp_MessageContents_PublicKeyBundle? = nil + var _timestamp: UInt64 = 0 - static let defaultInstance = _StorageClass() + #if swift(>=5.10) + // This property is used as the initial default value for new instances of the type. + // The type itself is protecting the reference to its storage via CoW semantics. + // This will force a copy to be made of this reference when the first mutation occurs; + // hence, it is safe to mark this as `nonisolated(unsafe)`. + static nonisolated(unsafe) let defaultInstance = _StorageClass() + #else + static let defaultInstance = _StorageClass() + #endif - private init() {} + private init() {} - init(copying source: _StorageClass) { - _sender = source._sender - _recipient = source._recipient - _timestamp = source._timestamp - } + 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 + 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 - } - } - } + _ = _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) + 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + 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 + 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"), + 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 - } - } + 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) - } }() - try { if let v = self._senderHmac { - try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - } }() - try { if let v = self._shouldPush { - try visitor.visitSingularBoolField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) + // 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 { if let v = self._senderHmac { + try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + } }() + try { if let v = self._shouldPush { + try visitor.visitSingularBoolField(value: v, 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 + 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"), + 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 - } - } + 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) + // 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 + 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"), + 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 - } - } + 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) + // 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 + 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 575bb037..0cdccb1d 100644 --- a/Sources/XMTPiOS/Proto/message_contents/private_preferences.pb.swift +++ b/Sources/XMTPiOS/Proto/message_contents/private_preferences.pb.swift @@ -35,127 +35,127 @@ public struct Xmtp_MessageContents_PrivatePreferencesAction { public var messageType: Xmtp_MessageContents_PrivatePreferencesAction.OneOf_MessageType? = nil public var allowAddress: Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress { - get { - if case .allowAddress(let v)? = messageType {return v} - return Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress() - } - set {messageType = .allowAddress(newValue)} + get { + if case .allowAddress(let v)? = messageType {return v} + return Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress() + } + set {messageType = .allowAddress(newValue)} } public var denyAddress: Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress { - get { - if case .denyAddress(let v)? = messageType {return v} - return Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress() - } - set {messageType = .denyAddress(newValue)} + get { + if case .denyAddress(let v)? = messageType {return v} + return Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress() + } + set {messageType = .denyAddress(newValue)} } public var allowGroup: Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup { - get { - if case .allowGroup(let v)? = messageType {return v} - return Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup() - } - set {messageType = .allowGroup(newValue)} + get { + if case .allowGroup(let v)? = messageType {return v} + return Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup() + } + set {messageType = .allowGroup(newValue)} } public var denyGroup: Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup { - get { - if case .denyGroup(let v)? = messageType {return v} - return Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup() - } - set {messageType = .denyGroup(newValue)} + get { + if case .denyGroup(let v)? = messageType {return v} + return Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup() + } + set {messageType = .denyGroup(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_MessageType: Equatable { - case allowAddress(Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress) - case denyAddress(Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress) - case allowGroup(Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup) - case denyGroup(Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup) + case allowAddress(Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress) + case denyAddress(Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress) + case allowGroup(Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup) + case denyGroup(Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup) #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 (.allowAddress, .allowAddress): return { - guard case .allowAddress(let l) = lhs, case .allowAddress(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.denyAddress, .denyAddress): return { - guard case .denyAddress(let l) = lhs, case .denyAddress(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.allowGroup, .allowGroup): return { - guard case .allowGroup(let l) = lhs, case .allowGroup(let r) = rhs else { preconditionFailure() } - return l == r - }() - case (.denyGroup, .denyGroup): return { - guard case .denyGroup(let l) = lhs, case .denyGroup(let r) = rhs else { preconditionFailure() } - return l == r - }() - default: return false - } - } + 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 (.allowAddress, .allowAddress): return { + guard case .allowAddress(let l) = lhs, case .allowAddress(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.denyAddress, .denyAddress): return { + guard case .denyAddress(let l) = lhs, case .denyAddress(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.allowGroup, .allowGroup): return { + guard case .allowGroup(let l) = lhs, case .allowGroup(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.denyGroup, .denyGroup): return { + guard case .denyGroup(let l) = lhs, case .denyGroup(let r) = rhs else { preconditionFailure() } + return l == r + }() + default: return false + } + } #endif } /// Allow 1:1 direct message (DM) access public struct AllowAddress { - // 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. + // 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. - /// Add the given wallet addresses to the allow list - public var walletAddresses: [String] = [] + /// Add the given wallet addresses to the allow list + public var walletAddresses: [String] = [] - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } /// Deny (block) 1:1 direct message (DM) access public struct DenyAddress { - // 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. + // 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. - /// Add the given wallet addresses to the deny list - public var walletAddresses: [String] = [] + /// Add the given wallet addresses to the deny list + public var walletAddresses: [String] = [] - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } /// Allow Group access public struct AllowGroup { - // 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. + // 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. - /// Add the given group_ids to the allow list - public var groupIds: [Data] = [] + /// Add the given group_ids to the allow list + public var groupIds: [Data] = [] - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } /// Deny (deny) Group access public struct DenyGroup { - // 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. + // 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. - /// Add the given group_ids to the deny list - public var groupIds: [Data] = [] + /// Add the given group_ids to the deny list + public var groupIds: [Data] = [] - public var unknownFields = SwiftProtobuf.UnknownStorage() + public var unknownFields = SwiftProtobuf.UnknownStorage() - public init() {} + public init() {} } public init() {} @@ -170,30 +170,30 @@ public struct Xmtp_MessageContents_PrivatePreferencesPayload { 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)} + 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) + 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 - }() - } - } + 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 } @@ -218,281 +218,281 @@ 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: .standard(proto: "allow_address"), - 2: .standard(proto: "deny_address"), - 3: .standard(proto: "allow_group"), - 4: .standard(proto: "deny_group"), + 1: .standard(proto: "allow_address"), + 2: .standard(proto: "deny_address"), + 3: .standard(proto: "allow_group"), + 4: .standard(proto: "deny_group"), ] 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.AllowAddress? - var hadOneofValue = false - if let current = self.messageType { - hadOneofValue = true - if case .allowAddress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.messageType = .allowAddress(v) - } - }() - case 2: try { - var v: Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress? - var hadOneofValue = false - if let current = self.messageType { - hadOneofValue = true - if case .denyAddress(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.messageType = .denyAddress(v) - } - }() - case 3: try { - var v: Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup? - var hadOneofValue = false - if let current = self.messageType { - hadOneofValue = true - if case .allowGroup(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.messageType = .allowGroup(v) - } - }() - case 4: try { - var v: Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup? - var hadOneofValue = false - if let current = self.messageType { - hadOneofValue = true - if case .denyGroup(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.messageType = .denyGroup(v) - } - }() - default: break - } - } + 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.AllowAddress? + var hadOneofValue = false + if let current = self.messageType { + hadOneofValue = true + if case .allowAddress(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.messageType = .allowAddress(v) + } + }() + case 2: try { + var v: Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress? + var hadOneofValue = false + if let current = self.messageType { + hadOneofValue = true + if case .denyAddress(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.messageType = .denyAddress(v) + } + }() + case 3: try { + var v: Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup? + var hadOneofValue = false + if let current = self.messageType { + hadOneofValue = true + if case .allowGroup(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.messageType = .allowGroup(v) + } + }() + case 4: try { + var v: Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup? + var hadOneofValue = false + if let current = self.messageType { + hadOneofValue = true + if case .denyGroup(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.messageType = .denyGroup(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 .allowAddress?: try { - guard case .allowAddress(let v)? = self.messageType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - }() - case .denyAddress?: try { - guard case .denyAddress(let v)? = self.messageType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .allowGroup?: try { - guard case .allowGroup(let v)? = self.messageType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .denyGroup?: try { - guard case .denyGroup(let v)? = self.messageType else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) + // 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 .allowAddress?: try { + guard case .allowAddress(let v)? = self.messageType else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + }() + case .denyAddress?: try { + guard case .denyAddress(let v)? = self.messageType else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + }() + case .allowGroup?: try { + guard case .allowGroup(let v)? = self.messageType else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case .denyGroup?: try { + guard case .denyGroup(let v)? = self.messageType else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + }() + 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 + if lhs.messageType != rhs.messageType {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Xmtp_MessageContents_PrivatePreferencesAction.protoMessageName + ".AllowAddress" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "wallet_addresses"), + 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 - } - } + 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) + if !self.walletAddresses.isEmpty { + try visitor.visitRepeatedStringField(value: self.walletAddresses, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress, rhs: Xmtp_MessageContents_PrivatePreferencesAction.AllowAddress) -> Bool { - if lhs.walletAddresses != rhs.walletAddresses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.walletAddresses != rhs.walletAddresses {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Xmtp_MessageContents_PrivatePreferencesAction.protoMessageName + ".DenyAddress" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "wallet_addresses"), + 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 - } - } + 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) + if !self.walletAddresses.isEmpty { + try visitor.visitRepeatedStringField(value: self.walletAddresses, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress, rhs: Xmtp_MessageContents_PrivatePreferencesAction.DenyAddress) -> Bool { - if lhs.walletAddresses != rhs.walletAddresses {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.walletAddresses != rhs.walletAddresses {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Xmtp_MessageContents_PrivatePreferencesAction.protoMessageName + ".AllowGroup" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "group_ids"), + 1: .standard(proto: "group_ids"), ] 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.decodeRepeatedBytesField(value: &self.groupIds) }() - default: break - } - } + 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.decodeRepeatedBytesField(value: &self.groupIds) }() + default: break + } + } } public func traverse(visitor: inout V) throws { - if !self.groupIds.isEmpty { - try visitor.visitRepeatedBytesField(value: self.groupIds, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) + if !self.groupIds.isEmpty { + try visitor.visitRepeatedBytesField(value: self.groupIds, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup, rhs: Xmtp_MessageContents_PrivatePreferencesAction.AllowGroup) -> Bool { - if lhs.groupIds != rhs.groupIds {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.groupIds != rhs.groupIds {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } extension Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = Xmtp_MessageContents_PrivatePreferencesAction.protoMessageName + ".DenyGroup" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "group_ids"), + 1: .standard(proto: "group_ids"), ] 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.decodeRepeatedBytesField(value: &self.groupIds) }() - default: break - } - } + 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.decodeRepeatedBytesField(value: &self.groupIds) }() + default: break + } + } } public func traverse(visitor: inout V) throws { - if !self.groupIds.isEmpty { - try visitor.visitRepeatedBytesField(value: self.groupIds, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) + if !self.groupIds.isEmpty { + try visitor.visitRepeatedBytesField(value: self.groupIds, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup, rhs: Xmtp_MessageContents_PrivatePreferencesAction.DenyGroup) -> Bool { - if lhs.groupIds != rhs.groupIds {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true + if lhs.groupIds != rhs.groupIds {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"), + 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 - } - } + 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) + // 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 + if lhs.version != rhs.version {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true } } diff --git a/Sources/XMTPiOS/Proto/mls/message_contents/association.pb.swift b/Sources/XMTPiOS/Proto/mls/message_contents/association.pb.swift index ac604ace..abcba216 100644 --- a/Sources/XMTPiOS/Proto/mls/message_contents/association.pb.swift +++ b/Sources/XMTPiOS/Proto/mls/message_contents/association.pb.swift @@ -64,14 +64,15 @@ extension Xmtp_Mls_MessageContents_AssociationTextVersion: CaseIterable { #endif // swift(>=4.2) -/// EIP191Association is used for all EIP 191 compliant wallet signatures -public struct Xmtp_Mls_MessageContents_Eip191Association { +/// Used for "Grant Messaging Access" associations +public struct Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation { // 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 associationTextVersion: Xmtp_Mls_MessageContents_AssociationTextVersion = .unspecified + /// EIP-191 signature public var signature: Xmtp_Mls_MessageContents_RecoverableEcdsaSignature { get {return _signature ?? Xmtp_Mls_MessageContents_RecoverableEcdsaSignature()} set {_signature = newValue} @@ -83,7 +84,7 @@ public struct Xmtp_Mls_MessageContents_Eip191Association { public var accountAddress: String = String() - public var iso8601Time: String = String() + public var createdNs: UInt64 = 0 public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -92,13 +93,79 @@ public struct Xmtp_Mls_MessageContents_Eip191Association { fileprivate var _signature: Xmtp_Mls_MessageContents_RecoverableEcdsaSignature? = nil } +/// Used for "Revoke Messaging Access" associations +public struct Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation { + // 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 associationTextVersion: Xmtp_Mls_MessageContents_AssociationTextVersion = .unspecified + + /// EIP-191 signature + public var signature: Xmtp_Mls_MessageContents_RecoverableEcdsaSignature { + get {return _signature ?? Xmtp_Mls_MessageContents_RecoverableEcdsaSignature()} + set {_signature = newValue} + } + /// Returns true if `signature` has been explicitly set. + public var hasSignature: Bool {return self._signature != nil} + /// Clears the value of `signature`. Subsequent reads from it will return its default value. + public mutating func clearSignature() {self._signature = nil} + + public var accountAddress: String = String() + + public var createdNs: UInt64 = 0 + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _signature: Xmtp_Mls_MessageContents_RecoverableEcdsaSignature? = nil +} + +/// LegacyCreateIdentityAssociation is used when a v3 installation key +/// is signed by a v2 identity key, which in turn is signed via a +/// 'CreateIdentity' wallet signature +public struct Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation { + // 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. + + /// Signs SHA-256 hash of installation key + public var signature: Xmtp_Mls_MessageContents_RecoverableEcdsaSignature { + get {return _signature ?? Xmtp_Mls_MessageContents_RecoverableEcdsaSignature()} + set {_signature = newValue} + } + /// Returns true if `signature` has been explicitly set. + public var hasSignature: Bool {return self._signature != nil} + /// Clears the value of `signature`. Subsequent reads from it will return its default value. + public mutating func clearSignature() {self._signature = nil} + + /// created_ns is encoded inside serialized key, account_address is recoverable + /// from the SignedPublicKey signature + public var signedLegacyCreateIdentityKey: Xmtp_MessageContents_SignedPublicKey { + get {return _signedLegacyCreateIdentityKey ?? Xmtp_MessageContents_SignedPublicKey()} + set {_signedLegacyCreateIdentityKey = newValue} + } + /// Returns true if `signedLegacyCreateIdentityKey` has been explicitly set. + public var hasSignedLegacyCreateIdentityKey: Bool {return self._signedLegacyCreateIdentityKey != nil} + /// Clears the value of `signedLegacyCreateIdentityKey`. Subsequent reads from it will return its default value. + public mutating func clearSignedLegacyCreateIdentityKey() {self._signedLegacyCreateIdentityKey = nil} + + public var unknownFields = SwiftProtobuf.UnknownStorage() + + public init() {} + + fileprivate var _signature: Xmtp_Mls_MessageContents_RecoverableEcdsaSignature? = nil + fileprivate var _signedLegacyCreateIdentityKey: Xmtp_MessageContents_SignedPublicKey? = nil +} + /// RecoverableEcdsaSignature public struct Xmtp_Mls_MessageContents_RecoverableEcdsaSignature { // 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. - /// Includes recovery id as the last byte + /// 65-bytes [ R || S || V ], with recovery id as the last byte public var bytes: Data = Data() public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -121,7 +188,9 @@ public struct Xmtp_Mls_MessageContents_EdDsaSignature { #if swift(>=5.5) && canImport(_Concurrency) extension Xmtp_Mls_MessageContents_AssociationTextVersion: @unchecked Sendable {} -extension Xmtp_Mls_MessageContents_Eip191Association: @unchecked Sendable {} +extension Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation: @unchecked Sendable {} +extension Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation: @unchecked Sendable {} +extension Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation: @unchecked Sendable {} extension Xmtp_Mls_MessageContents_RecoverableEcdsaSignature: @unchecked Sendable {} extension Xmtp_Mls_MessageContents_EdDsaSignature: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) @@ -137,13 +206,13 @@ extension Xmtp_Mls_MessageContents_AssociationTextVersion: SwiftProtobuf._ProtoN ] } -extension Xmtp_Mls_MessageContents_Eip191Association: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Eip191Association" +extension Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".GrantMessagingAccessAssociation" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "association_text_version"), 2: .same(proto: "signature"), 3: .standard(proto: "account_address"), - 4: .standard(proto: "iso8601_time"), + 4: .standard(proto: "created_ns"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -155,7 +224,7 @@ extension Xmtp_Mls_MessageContents_Eip191Association: SwiftProtobuf.Message, Swi case 1: try { try decoder.decodeSingularEnumField(value: &self.associationTextVersion) }() case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() case 3: try { try decoder.decodeSingularStringField(value: &self.accountAddress) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.iso8601Time) }() + case 4: try { try decoder.decodeSingularUInt64Field(value: &self.createdNs) }() default: break } } @@ -175,17 +244,113 @@ extension Xmtp_Mls_MessageContents_Eip191Association: SwiftProtobuf.Message, Swi if !self.accountAddress.isEmpty { try visitor.visitSingularStringField(value: self.accountAddress, fieldNumber: 3) } - if !self.iso8601Time.isEmpty { - try visitor.visitSingularStringField(value: self.iso8601Time, fieldNumber: 4) + if self.createdNs != 0 { + try visitor.visitSingularUInt64Field(value: self.createdNs, fieldNumber: 4) } try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Xmtp_Mls_MessageContents_Eip191Association, rhs: Xmtp_Mls_MessageContents_Eip191Association) -> Bool { + public static func ==(lhs: Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation, rhs: Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation) -> Bool { if lhs.associationTextVersion != rhs.associationTextVersion {return false} if lhs._signature != rhs._signature {return false} if lhs.accountAddress != rhs.accountAddress {return false} - if lhs.iso8601Time != rhs.iso8601Time {return false} + if lhs.createdNs != rhs.createdNs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".RevokeMessagingAccessAssociation" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "association_text_version"), + 2: .same(proto: "signature"), + 3: .standard(proto: "account_address"), + 4: .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.decodeSingularEnumField(value: &self.associationTextVersion) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._signature) }() + case 3: try { try decoder.decodeSingularStringField(value: &self.accountAddress) }() + case 4: 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 + if self.associationTextVersion != .unspecified { + try visitor.visitSingularEnumField(value: self.associationTextVersion, fieldNumber: 1) + } + try { if let v = self._signature { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + if !self.accountAddress.isEmpty { + try visitor.visitSingularStringField(value: self.accountAddress, fieldNumber: 3) + } + if self.createdNs != 0 { + try visitor.visitSingularUInt64Field(value: self.createdNs, fieldNumber: 4) + } + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation, rhs: Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation) -> Bool { + if lhs.associationTextVersion != rhs.associationTextVersion {return false} + if lhs._signature != rhs._signature {return false} + if lhs.accountAddress != rhs.accountAddress {return false} + if lhs.createdNs != rhs.createdNs {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".LegacyCreateIdentityAssociation" + public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "signature"), + 2: .standard(proto: "signed_legacy_create_identity_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.decodeSingularMessageField(value: &self._signature) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._signedLegacyCreateIdentityKey) }() + 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._signature { + try visitor.visitSingularMessageField(value: v, fieldNumber: 1) + } }() + try { if let v = self._signedLegacyCreateIdentityKey { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + public static func ==(lhs: Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation, rhs: Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation) -> Bool { + if lhs._signature != rhs._signature {return false} + if lhs._signedLegacyCreateIdentityKey != rhs._signedLegacyCreateIdentityKey {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } diff --git a/Sources/XMTPiOS/Proto/mls/message_contents/credential.pb.swift b/Sources/XMTPiOS/Proto/mls/message_contents/credential.pb.swift index f9e52fcc..4831605f 100644 --- a/Sources/XMTPiOS/Proto/mls/message_contents/credential.pb.swift +++ b/Sources/XMTPiOS/Proto/mls/message_contents/credential.pb.swift @@ -32,18 +32,27 @@ public struct Xmtp_Mls_MessageContents_MlsCredential { public var association: Xmtp_Mls_MessageContents_MlsCredential.OneOf_Association? = nil - public var eip191: Xmtp_Mls_MessageContents_Eip191Association { + public var messagingAccess: Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation { get { - if case .eip191(let v)? = association {return v} - return Xmtp_Mls_MessageContents_Eip191Association() + if case .messagingAccess(let v)? = association {return v} + return Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation() } - set {association = .eip191(newValue)} + set {association = .messagingAccess(newValue)} + } + + public var legacyCreateIdentity: Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation { + get { + if case .legacyCreateIdentity(let v)? = association {return v} + return Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation() + } + set {association = .legacyCreateIdentity(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() public enum OneOf_Association: Equatable { - case eip191(Xmtp_Mls_MessageContents_Eip191Association) + case messagingAccess(Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation) + case legacyCreateIdentity(Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation) #if !swift(>=4.1) public static func ==(lhs: Xmtp_Mls_MessageContents_MlsCredential.OneOf_Association, rhs: Xmtp_Mls_MessageContents_MlsCredential.OneOf_Association) -> Bool { @@ -51,10 +60,15 @@ public struct Xmtp_Mls_MessageContents_MlsCredential { // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.eip191, .eip191): return { - guard case .eip191(let l) = lhs, case .eip191(let r) = rhs else { preconditionFailure() } + case (.messagingAccess, .messagingAccess): return { + guard case .messagingAccess(let l) = lhs, case .messagingAccess(let r) = rhs else { preconditionFailure() } return l == r }() + case (.legacyCreateIdentity, .legacyCreateIdentity): return { + guard case .legacyCreateIdentity(let l) = lhs, case .legacyCreateIdentity(let r) = rhs else { preconditionFailure() } + return l == r + }() + default: return false } } #endif @@ -69,22 +83,66 @@ public struct Xmtp_Mls_MessageContents_CredentialRevocation { // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var installationPublicKey: Data = Data() + public var publicKey: Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_PublicKey? = nil + + /// The 'installation_public_key' field of the MlsCredential proto + public var installationKey: Data { + get { + if case .installationKey(let v)? = publicKey {return v} + return Data() + } + set {publicKey = .installationKey(newValue)} + } + + /// The 'key_bytes' field of the legacy SignedPublicKey proto + public var unsignedLegacyCreateIdentityKey: Data { + get { + if case .unsignedLegacyCreateIdentityKey(let v)? = publicKey {return v} + return Data() + } + set {publicKey = .unsignedLegacyCreateIdentityKey(newValue)} + } public var association: Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_Association? = nil - public var eip191: Xmtp_Mls_MessageContents_Eip191Association { + public var messagingAccess: Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation { get { - if case .eip191(let v)? = association {return v} - return Xmtp_Mls_MessageContents_Eip191Association() + if case .messagingAccess(let v)? = association {return v} + return Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation() } - set {association = .eip191(newValue)} + set {association = .messagingAccess(newValue)} } public var unknownFields = SwiftProtobuf.UnknownStorage() + public enum OneOf_PublicKey: Equatable { + /// The 'installation_public_key' field of the MlsCredential proto + case installationKey(Data) + /// The 'key_bytes' field of the legacy SignedPublicKey proto + case unsignedLegacyCreateIdentityKey(Data) + + #if !swift(>=4.1) + public static func ==(lhs: Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_PublicKey, rhs: Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_PublicKey) -> 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 (.installationKey, .installationKey): return { + guard case .installationKey(let l) = lhs, case .installationKey(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.unsignedLegacyCreateIdentityKey, .unsignedLegacyCreateIdentityKey): return { + guard case .unsignedLegacyCreateIdentityKey(let l) = lhs, case .unsignedLegacyCreateIdentityKey(let r) = rhs else { preconditionFailure() } + return l == r + }() + default: return false + } + } + #endif + } + public enum OneOf_Association: Equatable { - case eip191(Xmtp_Mls_MessageContents_Eip191Association) + case messagingAccess(Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation) #if !swift(>=4.1) public static func ==(lhs: Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_Association, rhs: Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_Association) -> Bool { @@ -92,8 +150,8 @@ public struct Xmtp_Mls_MessageContents_CredentialRevocation { // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch (lhs, rhs) { - case (.eip191, .eip191): return { - guard case .eip191(let l) = lhs, case .eip191(let r) = rhs else { preconditionFailure() } + case (.messagingAccess, .messagingAccess): return { + guard case .messagingAccess(let l) = lhs, case .messagingAccess(let r) = rhs else { preconditionFailure() } return l == r }() } @@ -108,6 +166,7 @@ public struct Xmtp_Mls_MessageContents_CredentialRevocation { extension Xmtp_Mls_MessageContents_MlsCredential: @unchecked Sendable {} extension Xmtp_Mls_MessageContents_MlsCredential.OneOf_Association: @unchecked Sendable {} extension Xmtp_Mls_MessageContents_CredentialRevocation: @unchecked Sendable {} +extension Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_PublicKey: @unchecked Sendable {} extension Xmtp_Mls_MessageContents_CredentialRevocation.OneOf_Association: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) @@ -119,7 +178,8 @@ extension Xmtp_Mls_MessageContents_MlsCredential: SwiftProtobuf.Message, SwiftPr public static let protoMessageName: String = _protobuf_package + ".MlsCredential" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "installation_public_key"), - 2: .standard(proto: "eip_191"), + 2: .standard(proto: "messaging_access"), + 3: .standard(proto: "legacy_create_identity"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -130,16 +190,29 @@ extension Xmtp_Mls_MessageContents_MlsCredential: SwiftProtobuf.Message, SwiftPr switch fieldNumber { case 1: try { try decoder.decodeSingularBytesField(value: &self.installationPublicKey) }() case 2: try { - var v: Xmtp_Mls_MessageContents_Eip191Association? + var v: Xmtp_Mls_MessageContents_GrantMessagingAccessAssociation? var hadOneofValue = false if let current = self.association { hadOneofValue = true - if case .eip191(let m) = current {v = m} + if case .messagingAccess(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) if let v = v { if hadOneofValue {try decoder.handleConflictingOneOf()} - self.association = .eip191(v) + self.association = .messagingAccess(v) + } + }() + case 3: try { + var v: Xmtp_Mls_MessageContents_LegacyCreateIdentityAssociation? + var hadOneofValue = false + if let current = self.association { + hadOneofValue = true + if case .legacyCreateIdentity(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + self.association = .legacyCreateIdentity(v) } }() default: break @@ -155,9 +228,17 @@ extension Xmtp_Mls_MessageContents_MlsCredential: SwiftProtobuf.Message, SwiftPr if !self.installationPublicKey.isEmpty { try visitor.visitSingularBytesField(value: self.installationPublicKey, fieldNumber: 1) } - try { if case .eip191(let v)? = self.association { + switch self.association { + case .messagingAccess?: try { + guard case .messagingAccess(let v)? = self.association else { preconditionFailure() } try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() + }() + case .legacyCreateIdentity?: try { + guard case .legacyCreateIdentity(let v)? = self.association else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + }() + case nil: break + } try unknownFields.traverse(visitor: &visitor) } @@ -172,8 +253,9 @@ extension Xmtp_Mls_MessageContents_MlsCredential: SwiftProtobuf.Message, SwiftPr extension Xmtp_Mls_MessageContents_CredentialRevocation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".CredentialRevocation" public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "installation_public_key"), - 2: .standard(proto: "eip_191"), + 1: .standard(proto: "installation_key"), + 2: .standard(proto: "unsigned_legacy_create_identity_key"), + 3: .standard(proto: "messaging_access"), ] public mutating func decodeMessage(decoder: inout D) throws { @@ -182,18 +264,33 @@ extension Xmtp_Mls_MessageContents_CredentialRevocation: SwiftProtobuf.Message, // 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.installationPublicKey) }() + case 1: try { + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.publicKey != nil {try decoder.handleConflictingOneOf()} + self.publicKey = .installationKey(v) + } + }() case 2: try { - var v: Xmtp_Mls_MessageContents_Eip191Association? + var v: Data? + try decoder.decodeSingularBytesField(value: &v) + if let v = v { + if self.publicKey != nil {try decoder.handleConflictingOneOf()} + self.publicKey = .unsignedLegacyCreateIdentityKey(v) + } + }() + case 3: try { + var v: Xmtp_Mls_MessageContents_RevokeMessagingAccessAssociation? var hadOneofValue = false if let current = self.association { hadOneofValue = true - if case .eip191(let m) = current {v = m} + if case .messagingAccess(let m) = current {v = m} } try decoder.decodeSingularMessageField(value: &v) if let v = v { if hadOneofValue {try decoder.handleConflictingOneOf()} - self.association = .eip191(v) + self.association = .messagingAccess(v) } }() default: break @@ -206,17 +303,25 @@ extension Xmtp_Mls_MessageContents_CredentialRevocation: SwiftProtobuf.Message, // 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.installationPublicKey.isEmpty { - try visitor.visitSingularBytesField(value: self.installationPublicKey, fieldNumber: 1) + switch self.publicKey { + case .installationKey?: try { + guard case .installationKey(let v)? = self.publicKey else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 1) + }() + case .unsignedLegacyCreateIdentityKey?: try { + guard case .unsignedLegacyCreateIdentityKey(let v)? = self.publicKey else { preconditionFailure() } + try visitor.visitSingularBytesField(value: v, fieldNumber: 2) + }() + case nil: break } - try { if case .eip191(let v)? = self.association { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + try { if case .messagingAccess(let v)? = self.association { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) } }() try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Xmtp_Mls_MessageContents_CredentialRevocation, rhs: Xmtp_Mls_MessageContents_CredentialRevocation) -> Bool { - if lhs.installationPublicKey != rhs.installationPublicKey {return false} + if lhs.publicKey != rhs.publicKey {return false} if lhs.association != rhs.association {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true diff --git a/buf.gen.yaml b/buf.gen.yaml index 9da67da7..c933da82 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -3,6 +3,6 @@ managed: enabled: true plugins: - plugin: buf.build/apple/swift - out: Sources/XMTP/Proto + out: Sources/XMTPiOS/Proto opt: - Visibility=Public