@@ -593,7 +593,7 @@ public func FfiConverterTypeAuthenticationService_lower(_ value: AuthenticationS
593593
594594public protocol ClientProtocol {
595595 func accountData(eventType: String) throws -> String?
596- func accountUrl() -> String?
596+ func accountUrl(action: AccountManagementAction? ) throws -> String?
597597 func avatarUrl() throws -> String?
598598 func cachedAvatarUrl() throws -> String?
599599 func createRoom(request: CreateRoomParameters) throws -> String
@@ -657,12 +657,12 @@ public class Client: ClientProtocol {
657657 )
658658 }
659659
660- public func accountUrl() -> String? {
661- return try! FfiConverterOptionString.lift(
662- try!
663- rustCall( ) {
664-
665- uniffi_matrix_sdk_ffi_fn_method_client_account_url(self.pointer, $0
660+ public func accountUrl(action: AccountManagementAction?) throws -> String? {
661+ return try FfiConverterOptionString.lift(
662+ try
663+ rustCallWithError(FfiConverterTypeClientError.lift ) {
664+ uniffi_matrix_sdk_ffi_fn_method_client_account_url(self.pointer,
665+ FfiConverterOptionTypeAccountManagementAction.lower(action), $0
666666 )
667667}
668668 )
@@ -8827,6 +8827,78 @@ public func FfiConverterTypeWidgetSettings_lower(_ value: WidgetSettings) -> Rus
88278827 return FfiConverterTypeWidgetSettings.lower(value)
88288828}
88298829
8830+ // Note that we don't yet support `indirect` for enums.
8831+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
8832+ public enum AccountManagementAction {
8833+
8834+ case profile
8835+ case sessionsList
8836+ case sessionView(deviceId: String)
8837+ case sessionEnd(deviceId: String)
8838+ }
8839+
8840+ public struct FfiConverterTypeAccountManagementAction: FfiConverterRustBuffer {
8841+ typealias SwiftType = AccountManagementAction
8842+
8843+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccountManagementAction {
8844+ let variant: Int32 = try readInt(&buf)
8845+ switch variant {
8846+
8847+ case 1: return .profile
8848+
8849+ case 2: return .sessionsList
8850+
8851+ case 3: return .sessionView(
8852+ deviceId: try FfiConverterString.read(from: &buf)
8853+ )
8854+
8855+ case 4: return .sessionEnd(
8856+ deviceId: try FfiConverterString.read(from: &buf)
8857+ )
8858+
8859+ default: throw UniffiInternalError.unexpectedEnumCase
8860+ }
8861+ }
8862+
8863+ public static func write(_ value: AccountManagementAction, into buf: inout [UInt8]) {
8864+ switch value {
8865+
8866+
8867+ case .profile:
8868+ writeInt(&buf, Int32(1))
8869+
8870+
8871+ case .sessionsList:
8872+ writeInt(&buf, Int32(2))
8873+
8874+
8875+ case let .sessionView(deviceId):
8876+ writeInt(&buf, Int32(3))
8877+ FfiConverterString.write(deviceId, into: &buf)
8878+
8879+
8880+ case let .sessionEnd(deviceId):
8881+ writeInt(&buf, Int32(4))
8882+ FfiConverterString.write(deviceId, into: &buf)
8883+
8884+ }
8885+ }
8886+ }
8887+
8888+
8889+ public func FfiConverterTypeAccountManagementAction_lift(_ buf: RustBuffer) throws -> AccountManagementAction {
8890+ return try FfiConverterTypeAccountManagementAction.lift(buf)
8891+ }
8892+
8893+ public func FfiConverterTypeAccountManagementAction_lower(_ value: AccountManagementAction) -> RustBuffer {
8894+ return FfiConverterTypeAccountManagementAction.lower(value)
8895+ }
8896+
8897+
8898+ extension AccountManagementAction: Equatable, Hashable {}
8899+
8900+
8901+
88308902// Note that we don't yet support `indirect` for enums.
88318903// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
88328904public enum AssetType {
@@ -14928,6 +15000,27 @@ fileprivate struct FfiConverterOptionTypeVideoInfo: FfiConverterRustBuffer {
1492815000 }
1492915001}
1493015002
15003+ fileprivate struct FfiConverterOptionTypeAccountManagementAction: FfiConverterRustBuffer {
15004+ typealias SwiftType = AccountManagementAction?
15005+
15006+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
15007+ guard let value = value else {
15008+ writeInt(&buf, Int8(0))
15009+ return
15010+ }
15011+ writeInt(&buf, Int8(1))
15012+ FfiConverterTypeAccountManagementAction.write(value, into: &buf)
15013+ }
15014+
15015+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
15016+ switch try readInt(&buf) as Int8 {
15017+ case 0: return nil
15018+ case 1: return try FfiConverterTypeAccountManagementAction.read(from: &buf)
15019+ default: throw UniffiInternalError.unexpectedOptionalTag
15020+ }
15021+ }
15022+ }
15023+
1493115024fileprivate struct FfiConverterOptionTypeAssetType: FfiConverterRustBuffer {
1493215025 typealias SwiftType = AssetType?
1493315026
@@ -17274,7 +17367,7 @@ private var initializationResult: InitializationResult {
1727417367 if (uniffi_matrix_sdk_ffi_checksum_method_client_account_data() != 37263) {
1727517368 return InitializationResult.apiChecksumMismatch
1727617369 }
17277- if (uniffi_matrix_sdk_ffi_checksum_method_client_account_url() != 29423 ) {
17370+ if (uniffi_matrix_sdk_ffi_checksum_method_client_account_url() != 57664 ) {
1727817371 return InitializationResult.apiChecksumMismatch
1727917372 }
1728017373 if (uniffi_matrix_sdk_ffi_checksum_method_client_avatar_url() != 13474) {
0 commit comments