Files
element-x-ios/Components/SDKMocks/Sources/Generated/SDKGeneratedMocks.swift
T
2026-09-10 08:27:08 +03:00

19892 lines
1.1 MiB
Plaintext

// Generated using Sourcery 2.3.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
// swiftlint:disable all
@preconcurrency import MatrixRustSDK
import Foundation
open class BackupSecretsSDKMock: MatrixRustSDK.BackupSecrets, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
}
open class CheckCodeSenderSDKMock: MatrixRustSDK.CheckCodeSender, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - send
open var sendCodeThrowableError: Error?
private let sendCodeCallsCountLock = NSLock()
private var sendCodeUnderlyingCallsCount = 0
open var sendCodeCallsCount: Int {
get { sendCodeCallsCountLock.withLock { sendCodeUnderlyingCallsCount } }
set { sendCodeCallsCountLock.withLock { sendCodeUnderlyingCallsCount = newValue } }
}
open var sendCodeCalled: Bool {
return sendCodeCallsCount > 0
}
private let sendCodeReceivedCodeLock = NSLock()
private var sendCodeUnderlyingReceivedCode: UInt8?
open var sendCodeReceivedCode: UInt8? {
get { sendCodeReceivedCodeLock.withLock { sendCodeUnderlyingReceivedCode } }
set { sendCodeReceivedCodeLock.withLock { sendCodeUnderlyingReceivedCode = newValue } }
}
private let sendCodeReceivedInvocationsLock = NSLock()
private var sendCodeUnderlyingReceivedInvocations: [UInt8] = []
open var sendCodeReceivedInvocations: [UInt8] {
get { sendCodeReceivedInvocationsLock.withLock { sendCodeUnderlyingReceivedInvocations } }
set { sendCodeReceivedInvocationsLock.withLock { sendCodeUnderlyingReceivedInvocations = newValue } }
}
open var sendCodeClosure: ((UInt8) async throws -> Void)?
open override func send(code: UInt8) async throws {
if let error = sendCodeThrowableError {
throw error
}
sendCodeCallsCountLock.withLock { sendCodeUnderlyingCallsCount += 1 }
sendCodeReceivedCode = code
sendCodeReceivedInvocationsLock.withLock { sendCodeUnderlyingReceivedInvocations.append(code) }
try await sendCodeClosure?(code)
}
}
open class ClientSDKMock: MatrixRustSDK.Client, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - abortOauthAuth
private let abortOauthAuthAuthorizationDataCallsCountLock = NSLock()
private var abortOauthAuthAuthorizationDataUnderlyingCallsCount = 0
open var abortOauthAuthAuthorizationDataCallsCount: Int {
get { abortOauthAuthAuthorizationDataCallsCountLock.withLock { abortOauthAuthAuthorizationDataUnderlyingCallsCount } }
set { abortOauthAuthAuthorizationDataCallsCountLock.withLock { abortOauthAuthAuthorizationDataUnderlyingCallsCount = newValue } }
}
open var abortOauthAuthAuthorizationDataCalled: Bool {
return abortOauthAuthAuthorizationDataCallsCount > 0
}
private let abortOauthAuthAuthorizationDataReceivedAuthorizationDataLock = NSLock()
private var abortOauthAuthAuthorizationDataUnderlyingReceivedAuthorizationData: OAuthAuthorizationData?
open var abortOauthAuthAuthorizationDataReceivedAuthorizationData: OAuthAuthorizationData? {
get { abortOauthAuthAuthorizationDataReceivedAuthorizationDataLock.withLock { abortOauthAuthAuthorizationDataUnderlyingReceivedAuthorizationData } }
set { abortOauthAuthAuthorizationDataReceivedAuthorizationDataLock.withLock { abortOauthAuthAuthorizationDataUnderlyingReceivedAuthorizationData = newValue } }
}
private let abortOauthAuthAuthorizationDataReceivedInvocationsLock = NSLock()
private var abortOauthAuthAuthorizationDataUnderlyingReceivedInvocations: [OAuthAuthorizationData] = []
open var abortOauthAuthAuthorizationDataReceivedInvocations: [OAuthAuthorizationData] {
get { abortOauthAuthAuthorizationDataReceivedInvocationsLock.withLock { abortOauthAuthAuthorizationDataUnderlyingReceivedInvocations } }
set { abortOauthAuthAuthorizationDataReceivedInvocationsLock.withLock { abortOauthAuthAuthorizationDataUnderlyingReceivedInvocations = newValue } }
}
open var abortOauthAuthAuthorizationDataClosure: ((OAuthAuthorizationData) async -> Void)?
open override func abortOauthAuth(authorizationData: OAuthAuthorizationData) async {
abortOauthAuthAuthorizationDataCallsCountLock.withLock { abortOauthAuthAuthorizationDataUnderlyingCallsCount += 1 }
abortOauthAuthAuthorizationDataReceivedAuthorizationData = authorizationData
abortOauthAuthAuthorizationDataReceivedInvocationsLock.withLock { abortOauthAuthAuthorizationDataUnderlyingReceivedInvocations.append(authorizationData) }
await abortOauthAuthAuthorizationDataClosure?(authorizationData)
}
//MARK: - accountData
open var accountDataEventTypeThrowableError: Error?
private let accountDataEventTypeCallsCountLock = NSLock()
private var accountDataEventTypeUnderlyingCallsCount = 0
open var accountDataEventTypeCallsCount: Int {
get { accountDataEventTypeCallsCountLock.withLock { accountDataEventTypeUnderlyingCallsCount } }
set { accountDataEventTypeCallsCountLock.withLock { accountDataEventTypeUnderlyingCallsCount = newValue } }
}
open var accountDataEventTypeCalled: Bool {
return accountDataEventTypeCallsCount > 0
}
private let accountDataEventTypeReceivedEventTypeLock = NSLock()
private var accountDataEventTypeUnderlyingReceivedEventType: String?
open var accountDataEventTypeReceivedEventType: String? {
get { accountDataEventTypeReceivedEventTypeLock.withLock { accountDataEventTypeUnderlyingReceivedEventType } }
set { accountDataEventTypeReceivedEventTypeLock.withLock { accountDataEventTypeUnderlyingReceivedEventType = newValue } }
}
private let accountDataEventTypeReceivedInvocationsLock = NSLock()
private var accountDataEventTypeUnderlyingReceivedInvocations: [String] = []
open var accountDataEventTypeReceivedInvocations: [String] {
get { accountDataEventTypeReceivedInvocationsLock.withLock { accountDataEventTypeUnderlyingReceivedInvocations } }
set { accountDataEventTypeReceivedInvocationsLock.withLock { accountDataEventTypeUnderlyingReceivedInvocations = newValue } }
}
private let accountDataEventTypeReturnValueLock = NSLock()
open var accountDataEventTypeUnderlyingReturnValue: String?
open var accountDataEventTypeReturnValue: String? {
get { accountDataEventTypeReturnValueLock.withLock { accountDataEventTypeUnderlyingReturnValue } }
set { accountDataEventTypeReturnValueLock.withLock { accountDataEventTypeUnderlyingReturnValue = newValue } }
}
open var accountDataEventTypeClosure: ((String) async throws -> String?)?
open override func accountData(eventType: String) async throws -> String? {
if let error = accountDataEventTypeThrowableError {
throw error
}
accountDataEventTypeCallsCountLock.withLock { accountDataEventTypeUnderlyingCallsCount += 1 }
accountDataEventTypeReceivedEventType = eventType
accountDataEventTypeReceivedInvocationsLock.withLock { accountDataEventTypeUnderlyingReceivedInvocations.append(eventType) }
if let accountDataEventTypeClosure = accountDataEventTypeClosure {
return try await accountDataEventTypeClosure(eventType)
} else {
return accountDataEventTypeReturnValue
}
}
//MARK: - accountUrl
open var accountUrlActionThrowableError: Error?
private let accountUrlActionCallsCountLock = NSLock()
private var accountUrlActionUnderlyingCallsCount = 0
open var accountUrlActionCallsCount: Int {
get { accountUrlActionCallsCountLock.withLock { accountUrlActionUnderlyingCallsCount } }
set { accountUrlActionCallsCountLock.withLock { accountUrlActionUnderlyingCallsCount = newValue } }
}
open var accountUrlActionCalled: Bool {
return accountUrlActionCallsCount > 0
}
private let accountUrlActionReceivedActionLock = NSLock()
private var accountUrlActionUnderlyingReceivedAction: AccountManagementAction?
open var accountUrlActionReceivedAction: AccountManagementAction? {
get { accountUrlActionReceivedActionLock.withLock { accountUrlActionUnderlyingReceivedAction } }
set { accountUrlActionReceivedActionLock.withLock { accountUrlActionUnderlyingReceivedAction = newValue } }
}
private let accountUrlActionReceivedInvocationsLock = NSLock()
private var accountUrlActionUnderlyingReceivedInvocations: [AccountManagementAction?] = []
open var accountUrlActionReceivedInvocations: [AccountManagementAction?] {
get { accountUrlActionReceivedInvocationsLock.withLock { accountUrlActionUnderlyingReceivedInvocations } }
set { accountUrlActionReceivedInvocationsLock.withLock { accountUrlActionUnderlyingReceivedInvocations = newValue } }
}
private let accountUrlActionReturnValueLock = NSLock()
open var accountUrlActionUnderlyingReturnValue: String?
open var accountUrlActionReturnValue: String? {
get { accountUrlActionReturnValueLock.withLock { accountUrlActionUnderlyingReturnValue } }
set { accountUrlActionReturnValueLock.withLock { accountUrlActionUnderlyingReturnValue = newValue } }
}
open var accountUrlActionClosure: ((AccountManagementAction?) async throws -> String?)?
open override func accountUrl(action: AccountManagementAction?) async throws -> String? {
if let error = accountUrlActionThrowableError {
throw error
}
accountUrlActionCallsCountLock.withLock { accountUrlActionUnderlyingCallsCount += 1 }
accountUrlActionReceivedAction = action
accountUrlActionReceivedInvocationsLock.withLock { accountUrlActionUnderlyingReceivedInvocations.append(action) }
if let accountUrlActionClosure = accountUrlActionClosure {
return try await accountUrlActionClosure(action)
} else {
return accountUrlActionReturnValue
}
}
//MARK: - availableSlidingSyncVersions
private let availableSlidingSyncVersionsCallsCountLock = NSLock()
private var availableSlidingSyncVersionsUnderlyingCallsCount = 0
open var availableSlidingSyncVersionsCallsCount: Int {
get { availableSlidingSyncVersionsCallsCountLock.withLock { availableSlidingSyncVersionsUnderlyingCallsCount } }
set { availableSlidingSyncVersionsCallsCountLock.withLock { availableSlidingSyncVersionsUnderlyingCallsCount = newValue } }
}
open var availableSlidingSyncVersionsCalled: Bool {
return availableSlidingSyncVersionsCallsCount > 0
}
private let availableSlidingSyncVersionsReturnValueLock = NSLock()
open var availableSlidingSyncVersionsUnderlyingReturnValue: [SlidingSyncVersion]!
open var availableSlidingSyncVersionsReturnValue: [SlidingSyncVersion]! {
get { availableSlidingSyncVersionsReturnValueLock.withLock { availableSlidingSyncVersionsUnderlyingReturnValue } }
set { availableSlidingSyncVersionsReturnValueLock.withLock { availableSlidingSyncVersionsUnderlyingReturnValue = newValue } }
}
open var availableSlidingSyncVersionsClosure: (() async -> [SlidingSyncVersion])?
open override func availableSlidingSyncVersions() async -> [SlidingSyncVersion] {
availableSlidingSyncVersionsCallsCountLock.withLock { availableSlidingSyncVersionsUnderlyingCallsCount += 1 }
if let availableSlidingSyncVersionsClosure = availableSlidingSyncVersionsClosure {
return await availableSlidingSyncVersionsClosure()
} else {
return availableSlidingSyncVersionsReturnValue
}
}
//MARK: - avatarUrl
open var avatarUrlThrowableError: Error?
private let avatarUrlCallsCountLock = NSLock()
private var avatarUrlUnderlyingCallsCount = 0
open var avatarUrlCallsCount: Int {
get { avatarUrlCallsCountLock.withLock { avatarUrlUnderlyingCallsCount } }
set { avatarUrlCallsCountLock.withLock { avatarUrlUnderlyingCallsCount = newValue } }
}
open var avatarUrlCalled: Bool {
return avatarUrlCallsCount > 0
}
private let avatarUrlReturnValueLock = NSLock()
open var avatarUrlUnderlyingReturnValue: String?
open var avatarUrlReturnValue: String? {
get { avatarUrlReturnValueLock.withLock { avatarUrlUnderlyingReturnValue } }
set { avatarUrlReturnValueLock.withLock { avatarUrlUnderlyingReturnValue = newValue } }
}
open var avatarUrlClosure: (() async throws -> String?)?
open override func avatarUrl() async throws -> String? {
if let error = avatarUrlThrowableError {
throw error
}
avatarUrlCallsCountLock.withLock { avatarUrlUnderlyingCallsCount += 1 }
if let avatarUrlClosure = avatarUrlClosure {
return try await avatarUrlClosure()
} else {
return avatarUrlReturnValue
}
}
//MARK: - awaitRoomRemoteEcho
open var awaitRoomRemoteEchoRoomIdThrowableError: Error?
private let awaitRoomRemoteEchoRoomIdCallsCountLock = NSLock()
private var awaitRoomRemoteEchoRoomIdUnderlyingCallsCount = 0
open var awaitRoomRemoteEchoRoomIdCallsCount: Int {
get { awaitRoomRemoteEchoRoomIdCallsCountLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingCallsCount } }
set { awaitRoomRemoteEchoRoomIdCallsCountLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingCallsCount = newValue } }
}
open var awaitRoomRemoteEchoRoomIdCalled: Bool {
return awaitRoomRemoteEchoRoomIdCallsCount > 0
}
private let awaitRoomRemoteEchoRoomIdReceivedRoomIdLock = NSLock()
private var awaitRoomRemoteEchoRoomIdUnderlyingReceivedRoomId: String?
open var awaitRoomRemoteEchoRoomIdReceivedRoomId: String? {
get { awaitRoomRemoteEchoRoomIdReceivedRoomIdLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingReceivedRoomId } }
set { awaitRoomRemoteEchoRoomIdReceivedRoomIdLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let awaitRoomRemoteEchoRoomIdReceivedInvocationsLock = NSLock()
private var awaitRoomRemoteEchoRoomIdUnderlyingReceivedInvocations: [String] = []
open var awaitRoomRemoteEchoRoomIdReceivedInvocations: [String] {
get { awaitRoomRemoteEchoRoomIdReceivedInvocationsLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingReceivedInvocations } }
set { awaitRoomRemoteEchoRoomIdReceivedInvocationsLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let awaitRoomRemoteEchoRoomIdReturnValueLock = NSLock()
open var awaitRoomRemoteEchoRoomIdUnderlyingReturnValue: Room!
open var awaitRoomRemoteEchoRoomIdReturnValue: Room! {
get { awaitRoomRemoteEchoRoomIdReturnValueLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingReturnValue } }
set { awaitRoomRemoteEchoRoomIdReturnValueLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingReturnValue = newValue } }
}
open var awaitRoomRemoteEchoRoomIdClosure: ((String) async throws -> Room)?
open override func awaitRoomRemoteEcho(roomId: String) async throws -> Room {
if let error = awaitRoomRemoteEchoRoomIdThrowableError {
throw error
}
awaitRoomRemoteEchoRoomIdCallsCountLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingCallsCount += 1 }
awaitRoomRemoteEchoRoomIdReceivedRoomId = roomId
awaitRoomRemoteEchoRoomIdReceivedInvocationsLock.withLock { awaitRoomRemoteEchoRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let awaitRoomRemoteEchoRoomIdClosure = awaitRoomRemoteEchoRoomIdClosure {
return try await awaitRoomRemoteEchoRoomIdClosure(roomId)
} else {
return awaitRoomRemoteEchoRoomIdReturnValue
}
}
//MARK: - cachedAvatarUrl
open var cachedAvatarUrlThrowableError: Error?
private let cachedAvatarUrlCallsCountLock = NSLock()
private var cachedAvatarUrlUnderlyingCallsCount = 0
open var cachedAvatarUrlCallsCount: Int {
get { cachedAvatarUrlCallsCountLock.withLock { cachedAvatarUrlUnderlyingCallsCount } }
set { cachedAvatarUrlCallsCountLock.withLock { cachedAvatarUrlUnderlyingCallsCount = newValue } }
}
open var cachedAvatarUrlCalled: Bool {
return cachedAvatarUrlCallsCount > 0
}
private let cachedAvatarUrlReturnValueLock = NSLock()
open var cachedAvatarUrlUnderlyingReturnValue: String?
open var cachedAvatarUrlReturnValue: String? {
get { cachedAvatarUrlReturnValueLock.withLock { cachedAvatarUrlUnderlyingReturnValue } }
set { cachedAvatarUrlReturnValueLock.withLock { cachedAvatarUrlUnderlyingReturnValue = newValue } }
}
open var cachedAvatarUrlClosure: (() async throws -> String?)?
open override func cachedAvatarUrl() async throws -> String? {
if let error = cachedAvatarUrlThrowableError {
throw error
}
cachedAvatarUrlCallsCountLock.withLock { cachedAvatarUrlUnderlyingCallsCount += 1 }
if let cachedAvatarUrlClosure = cachedAvatarUrlClosure {
return try await cachedAvatarUrlClosure()
} else {
return cachedAvatarUrlReturnValue
}
}
//MARK: - canDeactivateAccount
private let canDeactivateAccountCallsCountLock = NSLock()
private var canDeactivateAccountUnderlyingCallsCount = 0
open var canDeactivateAccountCallsCount: Int {
get { canDeactivateAccountCallsCountLock.withLock { canDeactivateAccountUnderlyingCallsCount } }
set { canDeactivateAccountCallsCountLock.withLock { canDeactivateAccountUnderlyingCallsCount = newValue } }
}
open var canDeactivateAccountCalled: Bool {
return canDeactivateAccountCallsCount > 0
}
private let canDeactivateAccountReturnValueLock = NSLock()
open var canDeactivateAccountUnderlyingReturnValue: Bool!
open var canDeactivateAccountReturnValue: Bool! {
get { canDeactivateAccountReturnValueLock.withLock { canDeactivateAccountUnderlyingReturnValue } }
set { canDeactivateAccountReturnValueLock.withLock { canDeactivateAccountUnderlyingReturnValue = newValue } }
}
open var canDeactivateAccountClosure: (() -> Bool)?
open override func canDeactivateAccount() -> Bool {
canDeactivateAccountCallsCountLock.withLock { canDeactivateAccountUnderlyingCallsCount += 1 }
if let canDeactivateAccountClosure = canDeactivateAccountClosure {
return canDeactivateAccountClosure()
} else {
return canDeactivateAccountReturnValue
}
}
//MARK: - clearCaches
open var clearCachesSyncServiceThrowableError: Error?
private let clearCachesSyncServiceCallsCountLock = NSLock()
private var clearCachesSyncServiceUnderlyingCallsCount = 0
open var clearCachesSyncServiceCallsCount: Int {
get { clearCachesSyncServiceCallsCountLock.withLock { clearCachesSyncServiceUnderlyingCallsCount } }
set { clearCachesSyncServiceCallsCountLock.withLock { clearCachesSyncServiceUnderlyingCallsCount = newValue } }
}
open var clearCachesSyncServiceCalled: Bool {
return clearCachesSyncServiceCallsCount > 0
}
private let clearCachesSyncServiceReceivedSyncServiceLock = NSLock()
private var clearCachesSyncServiceUnderlyingReceivedSyncService: SyncService?
open var clearCachesSyncServiceReceivedSyncService: SyncService? {
get { clearCachesSyncServiceReceivedSyncServiceLock.withLock { clearCachesSyncServiceUnderlyingReceivedSyncService } }
set { clearCachesSyncServiceReceivedSyncServiceLock.withLock { clearCachesSyncServiceUnderlyingReceivedSyncService = newValue } }
}
private let clearCachesSyncServiceReceivedInvocationsLock = NSLock()
private var clearCachesSyncServiceUnderlyingReceivedInvocations: [SyncService?] = []
open var clearCachesSyncServiceReceivedInvocations: [SyncService?] {
get { clearCachesSyncServiceReceivedInvocationsLock.withLock { clearCachesSyncServiceUnderlyingReceivedInvocations } }
set { clearCachesSyncServiceReceivedInvocationsLock.withLock { clearCachesSyncServiceUnderlyingReceivedInvocations = newValue } }
}
open var clearCachesSyncServiceClosure: ((SyncService?) async throws -> Void)?
open override func clearCaches(syncService: SyncService?) async throws {
if let error = clearCachesSyncServiceThrowableError {
throw error
}
clearCachesSyncServiceCallsCountLock.withLock { clearCachesSyncServiceUnderlyingCallsCount += 1 }
clearCachesSyncServiceReceivedSyncService = syncService
clearCachesSyncServiceReceivedInvocationsLock.withLock { clearCachesSyncServiceUnderlyingReceivedInvocations.append(syncService) }
try await clearCachesSyncServiceClosure?(syncService)
}
//MARK: - clearUserStatus
open var clearUserStatusThrowableError: Error?
private let clearUserStatusCallsCountLock = NSLock()
private var clearUserStatusUnderlyingCallsCount = 0
open var clearUserStatusCallsCount: Int {
get { clearUserStatusCallsCountLock.withLock { clearUserStatusUnderlyingCallsCount } }
set { clearUserStatusCallsCountLock.withLock { clearUserStatusUnderlyingCallsCount = newValue } }
}
open var clearUserStatusCalled: Bool {
return clearUserStatusCallsCount > 0
}
open var clearUserStatusClosure: (() async throws -> Void)?
open override func clearUserStatus() async throws {
if let error = clearUserStatusThrowableError {
throw error
}
clearUserStatusCallsCountLock.withLock { clearUserStatusUnderlyingCallsCount += 1 }
try await clearUserStatusClosure?()
}
//MARK: - contentScanner
private let contentScannerCallsCountLock = NSLock()
private var contentScannerUnderlyingCallsCount = 0
open var contentScannerCallsCount: Int {
get { contentScannerCallsCountLock.withLock { contentScannerUnderlyingCallsCount } }
set { contentScannerCallsCountLock.withLock { contentScannerUnderlyingCallsCount = newValue } }
}
open var contentScannerCalled: Bool {
return contentScannerCallsCount > 0
}
private let contentScannerReturnValueLock = NSLock()
open var contentScannerUnderlyingReturnValue: ContentScanner?
open var contentScannerReturnValue: ContentScanner? {
get { contentScannerReturnValueLock.withLock { contentScannerUnderlyingReturnValue } }
set { contentScannerReturnValueLock.withLock { contentScannerUnderlyingReturnValue = newValue } }
}
open var contentScannerClosure: (() async -> ContentScanner?)?
open override func contentScanner() async -> ContentScanner? {
contentScannerCallsCountLock.withLock { contentScannerUnderlyingCallsCount += 1 }
if let contentScannerClosure = contentScannerClosure {
return await contentScannerClosure()
} else {
return contentScannerReturnValue
}
}
//MARK: - createRoom
open var createRoomRequestThrowableError: Error?
private let createRoomRequestCallsCountLock = NSLock()
private var createRoomRequestUnderlyingCallsCount = 0
open var createRoomRequestCallsCount: Int {
get { createRoomRequestCallsCountLock.withLock { createRoomRequestUnderlyingCallsCount } }
set { createRoomRequestCallsCountLock.withLock { createRoomRequestUnderlyingCallsCount = newValue } }
}
open var createRoomRequestCalled: Bool {
return createRoomRequestCallsCount > 0
}
private let createRoomRequestReceivedRequestLock = NSLock()
private var createRoomRequestUnderlyingReceivedRequest: CreateRoomParameters?
open var createRoomRequestReceivedRequest: CreateRoomParameters? {
get { createRoomRequestReceivedRequestLock.withLock { createRoomRequestUnderlyingReceivedRequest } }
set { createRoomRequestReceivedRequestLock.withLock { createRoomRequestUnderlyingReceivedRequest = newValue } }
}
private let createRoomRequestReceivedInvocationsLock = NSLock()
private var createRoomRequestUnderlyingReceivedInvocations: [CreateRoomParameters] = []
open var createRoomRequestReceivedInvocations: [CreateRoomParameters] {
get { createRoomRequestReceivedInvocationsLock.withLock { createRoomRequestUnderlyingReceivedInvocations } }
set { createRoomRequestReceivedInvocationsLock.withLock { createRoomRequestUnderlyingReceivedInvocations = newValue } }
}
private let createRoomRequestReturnValueLock = NSLock()
open var createRoomRequestUnderlyingReturnValue: String!
open var createRoomRequestReturnValue: String! {
get { createRoomRequestReturnValueLock.withLock { createRoomRequestUnderlyingReturnValue } }
set { createRoomRequestReturnValueLock.withLock { createRoomRequestUnderlyingReturnValue = newValue } }
}
open var createRoomRequestClosure: ((CreateRoomParameters) async throws -> String)?
open override func createRoom(request: CreateRoomParameters) async throws -> String {
if let error = createRoomRequestThrowableError {
throw error
}
createRoomRequestCallsCountLock.withLock { createRoomRequestUnderlyingCallsCount += 1 }
createRoomRequestReceivedRequest = request
createRoomRequestReceivedInvocationsLock.withLock { createRoomRequestUnderlyingReceivedInvocations.append(request) }
if let createRoomRequestClosure = createRoomRequestClosure {
return try await createRoomRequestClosure(request)
} else {
return createRoomRequestReturnValue
}
}
//MARK: - customLoginWithJwt
open var customLoginWithJwtJwtInitialDeviceNameDeviceIdThrowableError: Error?
private let customLoginWithJwtJwtInitialDeviceNameDeviceIdCallsCountLock = NSLock()
private var customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingCallsCount = 0
open var customLoginWithJwtJwtInitialDeviceNameDeviceIdCallsCount: Int {
get { customLoginWithJwtJwtInitialDeviceNameDeviceIdCallsCountLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingCallsCount } }
set { customLoginWithJwtJwtInitialDeviceNameDeviceIdCallsCountLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingCallsCount = newValue } }
}
open var customLoginWithJwtJwtInitialDeviceNameDeviceIdCalled: Bool {
return customLoginWithJwtJwtInitialDeviceNameDeviceIdCallsCount > 0
}
private let customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedArgumentsLock = NSLock()
private var customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingReceivedArguments: (jwt: String, initialDeviceName: String?, deviceId: String?)?
open var customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedArguments: (jwt: String, initialDeviceName: String?, deviceId: String?)? {
get { customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedArgumentsLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingReceivedArguments } }
set { customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedArgumentsLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingReceivedArguments = newValue } }
}
private let customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedInvocationsLock = NSLock()
private var customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingReceivedInvocations: [(jwt: String, initialDeviceName: String?, deviceId: String?)] = []
open var customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedInvocations: [(jwt: String, initialDeviceName: String?, deviceId: String?)] {
get { customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingReceivedInvocations } }
set { customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingReceivedInvocations = newValue } }
}
open var customLoginWithJwtJwtInitialDeviceNameDeviceIdClosure: ((String, String?, String?) async throws -> Void)?
open override func customLoginWithJwt(jwt: String, initialDeviceName: String?, deviceId: String?) async throws {
if let error = customLoginWithJwtJwtInitialDeviceNameDeviceIdThrowableError {
throw error
}
customLoginWithJwtJwtInitialDeviceNameDeviceIdCallsCountLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingCallsCount += 1 }
customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedArguments = (jwt: jwt, initialDeviceName: initialDeviceName, deviceId: deviceId)
customLoginWithJwtJwtInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { customLoginWithJwtJwtInitialDeviceNameDeviceIdUnderlyingReceivedInvocations.append((jwt: jwt, initialDeviceName: initialDeviceName, deviceId: deviceId)) }
try await customLoginWithJwtJwtInitialDeviceNameDeviceIdClosure?(jwt, initialDeviceName, deviceId)
}
//MARK: - deactivateAccount
open var deactivateAccountAuthDataEraseDataThrowableError: Error?
private let deactivateAccountAuthDataEraseDataCallsCountLock = NSLock()
private var deactivateAccountAuthDataEraseDataUnderlyingCallsCount = 0
open var deactivateAccountAuthDataEraseDataCallsCount: Int {
get { deactivateAccountAuthDataEraseDataCallsCountLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingCallsCount } }
set { deactivateAccountAuthDataEraseDataCallsCountLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingCallsCount = newValue } }
}
open var deactivateAccountAuthDataEraseDataCalled: Bool {
return deactivateAccountAuthDataEraseDataCallsCount > 0
}
private let deactivateAccountAuthDataEraseDataReceivedArgumentsLock = NSLock()
private var deactivateAccountAuthDataEraseDataUnderlyingReceivedArguments: (authData: AuthData?, eraseData: Bool)?
open var deactivateAccountAuthDataEraseDataReceivedArguments: (authData: AuthData?, eraseData: Bool)? {
get { deactivateAccountAuthDataEraseDataReceivedArgumentsLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingReceivedArguments } }
set { deactivateAccountAuthDataEraseDataReceivedArgumentsLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingReceivedArguments = newValue } }
}
private let deactivateAccountAuthDataEraseDataReceivedInvocationsLock = NSLock()
private var deactivateAccountAuthDataEraseDataUnderlyingReceivedInvocations: [(authData: AuthData?, eraseData: Bool)] = []
open var deactivateAccountAuthDataEraseDataReceivedInvocations: [(authData: AuthData?, eraseData: Bool)] {
get { deactivateAccountAuthDataEraseDataReceivedInvocationsLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingReceivedInvocations } }
set { deactivateAccountAuthDataEraseDataReceivedInvocationsLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingReceivedInvocations = newValue } }
}
open var deactivateAccountAuthDataEraseDataClosure: ((AuthData?, Bool) async throws -> Void)?
open override func deactivateAccount(authData: AuthData?, eraseData: Bool) async throws {
if let error = deactivateAccountAuthDataEraseDataThrowableError {
throw error
}
deactivateAccountAuthDataEraseDataCallsCountLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingCallsCount += 1 }
deactivateAccountAuthDataEraseDataReceivedArguments = (authData: authData, eraseData: eraseData)
deactivateAccountAuthDataEraseDataReceivedInvocationsLock.withLock { deactivateAccountAuthDataEraseDataUnderlyingReceivedInvocations.append((authData: authData, eraseData: eraseData)) }
try await deactivateAccountAuthDataEraseDataClosure?(authData, eraseData)
}
//MARK: - deletePusher
open var deletePusherIdentifiersThrowableError: Error?
private let deletePusherIdentifiersCallsCountLock = NSLock()
private var deletePusherIdentifiersUnderlyingCallsCount = 0
open var deletePusherIdentifiersCallsCount: Int {
get { deletePusherIdentifiersCallsCountLock.withLock { deletePusherIdentifiersUnderlyingCallsCount } }
set { deletePusherIdentifiersCallsCountLock.withLock { deletePusherIdentifiersUnderlyingCallsCount = newValue } }
}
open var deletePusherIdentifiersCalled: Bool {
return deletePusherIdentifiersCallsCount > 0
}
private let deletePusherIdentifiersReceivedIdentifiersLock = NSLock()
private var deletePusherIdentifiersUnderlyingReceivedIdentifiers: PusherIdentifiers?
open var deletePusherIdentifiersReceivedIdentifiers: PusherIdentifiers? {
get { deletePusherIdentifiersReceivedIdentifiersLock.withLock { deletePusherIdentifiersUnderlyingReceivedIdentifiers } }
set { deletePusherIdentifiersReceivedIdentifiersLock.withLock { deletePusherIdentifiersUnderlyingReceivedIdentifiers = newValue } }
}
private let deletePusherIdentifiersReceivedInvocationsLock = NSLock()
private var deletePusherIdentifiersUnderlyingReceivedInvocations: [PusherIdentifiers] = []
open var deletePusherIdentifiersReceivedInvocations: [PusherIdentifiers] {
get { deletePusherIdentifiersReceivedInvocationsLock.withLock { deletePusherIdentifiersUnderlyingReceivedInvocations } }
set { deletePusherIdentifiersReceivedInvocationsLock.withLock { deletePusherIdentifiersUnderlyingReceivedInvocations = newValue } }
}
open var deletePusherIdentifiersClosure: ((PusherIdentifiers) async throws -> Void)?
open override func deletePusher(identifiers: PusherIdentifiers) async throws {
if let error = deletePusherIdentifiersThrowableError {
throw error
}
deletePusherIdentifiersCallsCountLock.withLock { deletePusherIdentifiersUnderlyingCallsCount += 1 }
deletePusherIdentifiersReceivedIdentifiers = identifiers
deletePusherIdentifiersReceivedInvocationsLock.withLock { deletePusherIdentifiersUnderlyingReceivedInvocations.append(identifiers) }
try await deletePusherIdentifiersClosure?(identifiers)
}
//MARK: - deviceId
open var deviceIdThrowableError: Error?
private let deviceIdCallsCountLock = NSLock()
private var deviceIdUnderlyingCallsCount = 0
open var deviceIdCallsCount: Int {
get { deviceIdCallsCountLock.withLock { deviceIdUnderlyingCallsCount } }
set { deviceIdCallsCountLock.withLock { deviceIdUnderlyingCallsCount = newValue } }
}
open var deviceIdCalled: Bool {
return deviceIdCallsCount > 0
}
private let deviceIdReturnValueLock = NSLock()
open var deviceIdUnderlyingReturnValue: String!
open var deviceIdReturnValue: String! {
get { deviceIdReturnValueLock.withLock { deviceIdUnderlyingReturnValue } }
set { deviceIdReturnValueLock.withLock { deviceIdUnderlyingReturnValue = newValue } }
}
open var deviceIdClosure: (() throws -> String)?
open override func deviceId() throws -> String {
if let error = deviceIdThrowableError {
throw error
}
deviceIdCallsCountLock.withLock { deviceIdUnderlyingCallsCount += 1 }
if let deviceIdClosure = deviceIdClosure {
return try deviceIdClosure()
} else {
return deviceIdReturnValue
}
}
//MARK: - disableWellKnownLookup
private let disableWellKnownLookupDisableCallsCountLock = NSLock()
private var disableWellKnownLookupDisableUnderlyingCallsCount = 0
open var disableWellKnownLookupDisableCallsCount: Int {
get { disableWellKnownLookupDisableCallsCountLock.withLock { disableWellKnownLookupDisableUnderlyingCallsCount } }
set { disableWellKnownLookupDisableCallsCountLock.withLock { disableWellKnownLookupDisableUnderlyingCallsCount = newValue } }
}
open var disableWellKnownLookupDisableCalled: Bool {
return disableWellKnownLookupDisableCallsCount > 0
}
private let disableWellKnownLookupDisableReceivedDisableLock = NSLock()
private var disableWellKnownLookupDisableUnderlyingReceivedDisable: Bool?
open var disableWellKnownLookupDisableReceivedDisable: Bool? {
get { disableWellKnownLookupDisableReceivedDisableLock.withLock { disableWellKnownLookupDisableUnderlyingReceivedDisable } }
set { disableWellKnownLookupDisableReceivedDisableLock.withLock { disableWellKnownLookupDisableUnderlyingReceivedDisable = newValue } }
}
private let disableWellKnownLookupDisableReceivedInvocationsLock = NSLock()
private var disableWellKnownLookupDisableUnderlyingReceivedInvocations: [Bool] = []
open var disableWellKnownLookupDisableReceivedInvocations: [Bool] {
get { disableWellKnownLookupDisableReceivedInvocationsLock.withLock { disableWellKnownLookupDisableUnderlyingReceivedInvocations } }
set { disableWellKnownLookupDisableReceivedInvocationsLock.withLock { disableWellKnownLookupDisableUnderlyingReceivedInvocations = newValue } }
}
open var disableWellKnownLookupDisableClosure: ((Bool) -> Void)?
open override func disableWellKnownLookup(disable: Bool) {
disableWellKnownLookupDisableCallsCountLock.withLock { disableWellKnownLookupDisableUnderlyingCallsCount += 1 }
disableWellKnownLookupDisableReceivedDisable = disable
disableWellKnownLookupDisableReceivedInvocationsLock.withLock { disableWellKnownLookupDisableUnderlyingReceivedInvocations.append(disable) }
disableWellKnownLookupDisableClosure?(disable)
}
//MARK: - displayName
open var displayNameThrowableError: Error?
private let displayNameCallsCountLock = NSLock()
private var displayNameUnderlyingCallsCount = 0
open var displayNameCallsCount: Int {
get { displayNameCallsCountLock.withLock { displayNameUnderlyingCallsCount } }
set { displayNameCallsCountLock.withLock { displayNameUnderlyingCallsCount = newValue } }
}
open var displayNameCalled: Bool {
return displayNameCallsCount > 0
}
private let displayNameReturnValueLock = NSLock()
open var displayNameUnderlyingReturnValue: String!
open var displayNameReturnValue: String! {
get { displayNameReturnValueLock.withLock { displayNameUnderlyingReturnValue } }
set { displayNameReturnValueLock.withLock { displayNameUnderlyingReturnValue = newValue } }
}
open var displayNameClosure: (() async throws -> String)?
open override func displayName() async throws -> String {
if let error = displayNameThrowableError {
throw error
}
displayNameCallsCountLock.withLock { displayNameUnderlyingCallsCount += 1 }
if let displayNameClosure = displayNameClosure {
return try await displayNameClosure()
} else {
return displayNameReturnValue
}
}
//MARK: - enableAllSendQueues
private let enableAllSendQueuesEnableCallsCountLock = NSLock()
private var enableAllSendQueuesEnableUnderlyingCallsCount = 0
open var enableAllSendQueuesEnableCallsCount: Int {
get { enableAllSendQueuesEnableCallsCountLock.withLock { enableAllSendQueuesEnableUnderlyingCallsCount } }
set { enableAllSendQueuesEnableCallsCountLock.withLock { enableAllSendQueuesEnableUnderlyingCallsCount = newValue } }
}
open var enableAllSendQueuesEnableCalled: Bool {
return enableAllSendQueuesEnableCallsCount > 0
}
private let enableAllSendQueuesEnableReceivedEnableLock = NSLock()
private var enableAllSendQueuesEnableUnderlyingReceivedEnable: Bool?
open var enableAllSendQueuesEnableReceivedEnable: Bool? {
get { enableAllSendQueuesEnableReceivedEnableLock.withLock { enableAllSendQueuesEnableUnderlyingReceivedEnable } }
set { enableAllSendQueuesEnableReceivedEnableLock.withLock { enableAllSendQueuesEnableUnderlyingReceivedEnable = newValue } }
}
private let enableAllSendQueuesEnableReceivedInvocationsLock = NSLock()
private var enableAllSendQueuesEnableUnderlyingReceivedInvocations: [Bool] = []
open var enableAllSendQueuesEnableReceivedInvocations: [Bool] {
get { enableAllSendQueuesEnableReceivedInvocationsLock.withLock { enableAllSendQueuesEnableUnderlyingReceivedInvocations } }
set { enableAllSendQueuesEnableReceivedInvocationsLock.withLock { enableAllSendQueuesEnableUnderlyingReceivedInvocations = newValue } }
}
open var enableAllSendQueuesEnableClosure: ((Bool) async -> Void)?
open override func enableAllSendQueues(enable: Bool) async {
enableAllSendQueuesEnableCallsCountLock.withLock { enableAllSendQueuesEnableUnderlyingCallsCount += 1 }
enableAllSendQueuesEnableReceivedEnable = enable
enableAllSendQueuesEnableReceivedInvocationsLock.withLock { enableAllSendQueuesEnableUnderlyingReceivedInvocations.append(enable) }
await enableAllSendQueuesEnableClosure?(enable)
}
//MARK: - enableAutomaticCallStatus
private let enableAutomaticCallStatusEnabledCallsCountLock = NSLock()
private var enableAutomaticCallStatusEnabledUnderlyingCallsCount = 0
open var enableAutomaticCallStatusEnabledCallsCount: Int {
get { enableAutomaticCallStatusEnabledCallsCountLock.withLock { enableAutomaticCallStatusEnabledUnderlyingCallsCount } }
set { enableAutomaticCallStatusEnabledCallsCountLock.withLock { enableAutomaticCallStatusEnabledUnderlyingCallsCount = newValue } }
}
open var enableAutomaticCallStatusEnabledCalled: Bool {
return enableAutomaticCallStatusEnabledCallsCount > 0
}
private let enableAutomaticCallStatusEnabledReceivedEnabledLock = NSLock()
private var enableAutomaticCallStatusEnabledUnderlyingReceivedEnabled: Bool?
open var enableAutomaticCallStatusEnabledReceivedEnabled: Bool? {
get { enableAutomaticCallStatusEnabledReceivedEnabledLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedEnabled } }
set { enableAutomaticCallStatusEnabledReceivedEnabledLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedEnabled = newValue } }
}
private let enableAutomaticCallStatusEnabledReceivedInvocationsLock = NSLock()
private var enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations: [Bool] = []
open var enableAutomaticCallStatusEnabledReceivedInvocations: [Bool] {
get { enableAutomaticCallStatusEnabledReceivedInvocationsLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations } }
set { enableAutomaticCallStatusEnabledReceivedInvocationsLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations = newValue } }
}
open var enableAutomaticCallStatusEnabledClosure: ((Bool) -> Void)?
open override func enableAutomaticCallStatus(enabled: Bool) {
enableAutomaticCallStatusEnabledCallsCountLock.withLock { enableAutomaticCallStatusEnabledUnderlyingCallsCount += 1 }
enableAutomaticCallStatusEnabledReceivedEnabled = enabled
enableAutomaticCallStatusEnabledReceivedInvocationsLock.withLock { enableAutomaticCallStatusEnabledUnderlyingReceivedInvocations.append(enabled) }
enableAutomaticCallStatusEnabledClosure?(enabled)
}
//MARK: - enableSendQueueUploadProgress
private let enableSendQueueUploadProgressEnableCallsCountLock = NSLock()
private var enableSendQueueUploadProgressEnableUnderlyingCallsCount = 0
open var enableSendQueueUploadProgressEnableCallsCount: Int {
get { enableSendQueueUploadProgressEnableCallsCountLock.withLock { enableSendQueueUploadProgressEnableUnderlyingCallsCount } }
set { enableSendQueueUploadProgressEnableCallsCountLock.withLock { enableSendQueueUploadProgressEnableUnderlyingCallsCount = newValue } }
}
open var enableSendQueueUploadProgressEnableCalled: Bool {
return enableSendQueueUploadProgressEnableCallsCount > 0
}
private let enableSendQueueUploadProgressEnableReceivedEnableLock = NSLock()
private var enableSendQueueUploadProgressEnableUnderlyingReceivedEnable: Bool?
open var enableSendQueueUploadProgressEnableReceivedEnable: Bool? {
get { enableSendQueueUploadProgressEnableReceivedEnableLock.withLock { enableSendQueueUploadProgressEnableUnderlyingReceivedEnable } }
set { enableSendQueueUploadProgressEnableReceivedEnableLock.withLock { enableSendQueueUploadProgressEnableUnderlyingReceivedEnable = newValue } }
}
private let enableSendQueueUploadProgressEnableReceivedInvocationsLock = NSLock()
private var enableSendQueueUploadProgressEnableUnderlyingReceivedInvocations: [Bool] = []
open var enableSendQueueUploadProgressEnableReceivedInvocations: [Bool] {
get { enableSendQueueUploadProgressEnableReceivedInvocationsLock.withLock { enableSendQueueUploadProgressEnableUnderlyingReceivedInvocations } }
set { enableSendQueueUploadProgressEnableReceivedInvocationsLock.withLock { enableSendQueueUploadProgressEnableUnderlyingReceivedInvocations = newValue } }
}
open var enableSendQueueUploadProgressEnableClosure: ((Bool) -> Void)?
open override func enableSendQueueUploadProgress(enable: Bool) {
enableSendQueueUploadProgressEnableCallsCountLock.withLock { enableSendQueueUploadProgressEnableUnderlyingCallsCount += 1 }
enableSendQueueUploadProgressEnableReceivedEnable = enable
enableSendQueueUploadProgressEnableReceivedInvocationsLock.withLock { enableSendQueueUploadProgressEnableUnderlyingReceivedInvocations.append(enable) }
enableSendQueueUploadProgressEnableClosure?(enable)
}
//MARK: - encryption
private let encryptionCallsCountLock = NSLock()
private var encryptionUnderlyingCallsCount = 0
open var encryptionCallsCount: Int {
get { encryptionCallsCountLock.withLock { encryptionUnderlyingCallsCount } }
set { encryptionCallsCountLock.withLock { encryptionUnderlyingCallsCount = newValue } }
}
open var encryptionCalled: Bool {
return encryptionCallsCount > 0
}
private let encryptionReturnValueLock = NSLock()
open var encryptionUnderlyingReturnValue: Encryption!
open var encryptionReturnValue: Encryption! {
get { encryptionReturnValueLock.withLock { encryptionUnderlyingReturnValue } }
set { encryptionReturnValueLock.withLock { encryptionUnderlyingReturnValue = newValue } }
}
open var encryptionClosure: (() -> Encryption)?
open override func encryption() -> Encryption {
encryptionCallsCountLock.withLock { encryptionUnderlyingCallsCount += 1 }
if let encryptionClosure = encryptionClosure {
return encryptionClosure()
} else {
return encryptionReturnValue
}
}
//MARK: - fetchMediaPreviewConfig
open var fetchMediaPreviewConfigThrowableError: Error?
private let fetchMediaPreviewConfigCallsCountLock = NSLock()
private var fetchMediaPreviewConfigUnderlyingCallsCount = 0
open var fetchMediaPreviewConfigCallsCount: Int {
get { fetchMediaPreviewConfigCallsCountLock.withLock { fetchMediaPreviewConfigUnderlyingCallsCount } }
set { fetchMediaPreviewConfigCallsCountLock.withLock { fetchMediaPreviewConfigUnderlyingCallsCount = newValue } }
}
open var fetchMediaPreviewConfigCalled: Bool {
return fetchMediaPreviewConfigCallsCount > 0
}
private let fetchMediaPreviewConfigReturnValueLock = NSLock()
open var fetchMediaPreviewConfigUnderlyingReturnValue: MediaPreviewConfig?
open var fetchMediaPreviewConfigReturnValue: MediaPreviewConfig? {
get { fetchMediaPreviewConfigReturnValueLock.withLock { fetchMediaPreviewConfigUnderlyingReturnValue } }
set { fetchMediaPreviewConfigReturnValueLock.withLock { fetchMediaPreviewConfigUnderlyingReturnValue = newValue } }
}
open var fetchMediaPreviewConfigClosure: (() async throws -> MediaPreviewConfig?)?
open override func fetchMediaPreviewConfig() async throws -> MediaPreviewConfig? {
if let error = fetchMediaPreviewConfigThrowableError {
throw error
}
fetchMediaPreviewConfigCallsCountLock.withLock { fetchMediaPreviewConfigUnderlyingCallsCount += 1 }
if let fetchMediaPreviewConfigClosure = fetchMediaPreviewConfigClosure {
return try await fetchMediaPreviewConfigClosure()
} else {
return fetchMediaPreviewConfigReturnValue
}
}
//MARK: - getDmRoom
open var getDmRoomUserIdThrowableError: Error?
private let getDmRoomUserIdCallsCountLock = NSLock()
private var getDmRoomUserIdUnderlyingCallsCount = 0
open var getDmRoomUserIdCallsCount: Int {
get { getDmRoomUserIdCallsCountLock.withLock { getDmRoomUserIdUnderlyingCallsCount } }
set { getDmRoomUserIdCallsCountLock.withLock { getDmRoomUserIdUnderlyingCallsCount = newValue } }
}
open var getDmRoomUserIdCalled: Bool {
return getDmRoomUserIdCallsCount > 0
}
private let getDmRoomUserIdReceivedUserIdLock = NSLock()
private var getDmRoomUserIdUnderlyingReceivedUserId: String?
open var getDmRoomUserIdReceivedUserId: String? {
get { getDmRoomUserIdReceivedUserIdLock.withLock { getDmRoomUserIdUnderlyingReceivedUserId } }
set { getDmRoomUserIdReceivedUserIdLock.withLock { getDmRoomUserIdUnderlyingReceivedUserId = newValue } }
}
private let getDmRoomUserIdReceivedInvocationsLock = NSLock()
private var getDmRoomUserIdUnderlyingReceivedInvocations: [String] = []
open var getDmRoomUserIdReceivedInvocations: [String] {
get { getDmRoomUserIdReceivedInvocationsLock.withLock { getDmRoomUserIdUnderlyingReceivedInvocations } }
set { getDmRoomUserIdReceivedInvocationsLock.withLock { getDmRoomUserIdUnderlyingReceivedInvocations = newValue } }
}
private let getDmRoomUserIdReturnValueLock = NSLock()
open var getDmRoomUserIdUnderlyingReturnValue: Room?
open var getDmRoomUserIdReturnValue: Room? {
get { getDmRoomUserIdReturnValueLock.withLock { getDmRoomUserIdUnderlyingReturnValue } }
set { getDmRoomUserIdReturnValueLock.withLock { getDmRoomUserIdUnderlyingReturnValue = newValue } }
}
open var getDmRoomUserIdClosure: ((String) throws -> Room?)?
open override func getDmRoom(userId: String) throws -> Room? {
if let error = getDmRoomUserIdThrowableError {
throw error
}
getDmRoomUserIdCallsCountLock.withLock { getDmRoomUserIdUnderlyingCallsCount += 1 }
getDmRoomUserIdReceivedUserId = userId
getDmRoomUserIdReceivedInvocationsLock.withLock { getDmRoomUserIdUnderlyingReceivedInvocations.append(userId) }
if let getDmRoomUserIdClosure = getDmRoomUserIdClosure {
return try getDmRoomUserIdClosure(userId)
} else {
return getDmRoomUserIdReturnValue
}
}
//MARK: - getDmRooms
open var getDmRoomsUserIdThrowableError: Error?
private let getDmRoomsUserIdCallsCountLock = NSLock()
private var getDmRoomsUserIdUnderlyingCallsCount = 0
open var getDmRoomsUserIdCallsCount: Int {
get { getDmRoomsUserIdCallsCountLock.withLock { getDmRoomsUserIdUnderlyingCallsCount } }
set { getDmRoomsUserIdCallsCountLock.withLock { getDmRoomsUserIdUnderlyingCallsCount = newValue } }
}
open var getDmRoomsUserIdCalled: Bool {
return getDmRoomsUserIdCallsCount > 0
}
private let getDmRoomsUserIdReceivedUserIdLock = NSLock()
private var getDmRoomsUserIdUnderlyingReceivedUserId: String?
open var getDmRoomsUserIdReceivedUserId: String? {
get { getDmRoomsUserIdReceivedUserIdLock.withLock { getDmRoomsUserIdUnderlyingReceivedUserId } }
set { getDmRoomsUserIdReceivedUserIdLock.withLock { getDmRoomsUserIdUnderlyingReceivedUserId = newValue } }
}
private let getDmRoomsUserIdReceivedInvocationsLock = NSLock()
private var getDmRoomsUserIdUnderlyingReceivedInvocations: [String] = []
open var getDmRoomsUserIdReceivedInvocations: [String] {
get { getDmRoomsUserIdReceivedInvocationsLock.withLock { getDmRoomsUserIdUnderlyingReceivedInvocations } }
set { getDmRoomsUserIdReceivedInvocationsLock.withLock { getDmRoomsUserIdUnderlyingReceivedInvocations = newValue } }
}
private let getDmRoomsUserIdReturnValueLock = NSLock()
open var getDmRoomsUserIdUnderlyingReturnValue: [Room]!
open var getDmRoomsUserIdReturnValue: [Room]! {
get { getDmRoomsUserIdReturnValueLock.withLock { getDmRoomsUserIdUnderlyingReturnValue } }
set { getDmRoomsUserIdReturnValueLock.withLock { getDmRoomsUserIdUnderlyingReturnValue = newValue } }
}
open var getDmRoomsUserIdClosure: ((String) throws -> [Room])?
open override func getDmRooms(userId: String) throws -> [Room] {
if let error = getDmRoomsUserIdThrowableError {
throw error
}
getDmRoomsUserIdCallsCountLock.withLock { getDmRoomsUserIdUnderlyingCallsCount += 1 }
getDmRoomsUserIdReceivedUserId = userId
getDmRoomsUserIdReceivedInvocationsLock.withLock { getDmRoomsUserIdUnderlyingReceivedInvocations.append(userId) }
if let getDmRoomsUserIdClosure = getDmRoomsUserIdClosure {
return try getDmRoomsUserIdClosure(userId)
} else {
return getDmRoomsUserIdReturnValue
}
}
//MARK: - getInviteAvatarsDisplayPolicy
open var getInviteAvatarsDisplayPolicyThrowableError: Error?
private let getInviteAvatarsDisplayPolicyCallsCountLock = NSLock()
private var getInviteAvatarsDisplayPolicyUnderlyingCallsCount = 0
open var getInviteAvatarsDisplayPolicyCallsCount: Int {
get { getInviteAvatarsDisplayPolicyCallsCountLock.withLock { getInviteAvatarsDisplayPolicyUnderlyingCallsCount } }
set { getInviteAvatarsDisplayPolicyCallsCountLock.withLock { getInviteAvatarsDisplayPolicyUnderlyingCallsCount = newValue } }
}
open var getInviteAvatarsDisplayPolicyCalled: Bool {
return getInviteAvatarsDisplayPolicyCallsCount > 0
}
private let getInviteAvatarsDisplayPolicyReturnValueLock = NSLock()
open var getInviteAvatarsDisplayPolicyUnderlyingReturnValue: InviteAvatars?
open var getInviteAvatarsDisplayPolicyReturnValue: InviteAvatars? {
get { getInviteAvatarsDisplayPolicyReturnValueLock.withLock { getInviteAvatarsDisplayPolicyUnderlyingReturnValue } }
set { getInviteAvatarsDisplayPolicyReturnValueLock.withLock { getInviteAvatarsDisplayPolicyUnderlyingReturnValue = newValue } }
}
open var getInviteAvatarsDisplayPolicyClosure: (() async throws -> InviteAvatars?)?
open override func getInviteAvatarsDisplayPolicy() async throws -> InviteAvatars? {
if let error = getInviteAvatarsDisplayPolicyThrowableError {
throw error
}
getInviteAvatarsDisplayPolicyCallsCountLock.withLock { getInviteAvatarsDisplayPolicyUnderlyingCallsCount += 1 }
if let getInviteAvatarsDisplayPolicyClosure = getInviteAvatarsDisplayPolicyClosure {
return try await getInviteAvatarsDisplayPolicyClosure()
} else {
return getInviteAvatarsDisplayPolicyReturnValue
}
}
//MARK: - getMaxMediaUploadSize
open var getMaxMediaUploadSizeThrowableError: Error?
private let getMaxMediaUploadSizeCallsCountLock = NSLock()
private var getMaxMediaUploadSizeUnderlyingCallsCount = 0
open var getMaxMediaUploadSizeCallsCount: Int {
get { getMaxMediaUploadSizeCallsCountLock.withLock { getMaxMediaUploadSizeUnderlyingCallsCount } }
set { getMaxMediaUploadSizeCallsCountLock.withLock { getMaxMediaUploadSizeUnderlyingCallsCount = newValue } }
}
open var getMaxMediaUploadSizeCalled: Bool {
return getMaxMediaUploadSizeCallsCount > 0
}
private let getMaxMediaUploadSizeReturnValueLock = NSLock()
open var getMaxMediaUploadSizeUnderlyingReturnValue: UInt64!
open var getMaxMediaUploadSizeReturnValue: UInt64! {
get { getMaxMediaUploadSizeReturnValueLock.withLock { getMaxMediaUploadSizeUnderlyingReturnValue } }
set { getMaxMediaUploadSizeReturnValueLock.withLock { getMaxMediaUploadSizeUnderlyingReturnValue = newValue } }
}
open var getMaxMediaUploadSizeClosure: (() async throws -> UInt64)?
open override func getMaxMediaUploadSize() async throws -> UInt64 {
if let error = getMaxMediaUploadSizeThrowableError {
throw error
}
getMaxMediaUploadSizeCallsCountLock.withLock { getMaxMediaUploadSizeUnderlyingCallsCount += 1 }
if let getMaxMediaUploadSizeClosure = getMaxMediaUploadSizeClosure {
return try await getMaxMediaUploadSizeClosure()
} else {
return getMaxMediaUploadSizeReturnValue
}
}
//MARK: - getMediaContent
open var getMediaContentMediaSourceThrowableError: Error?
private let getMediaContentMediaSourceCallsCountLock = NSLock()
private var getMediaContentMediaSourceUnderlyingCallsCount = 0
open var getMediaContentMediaSourceCallsCount: Int {
get { getMediaContentMediaSourceCallsCountLock.withLock { getMediaContentMediaSourceUnderlyingCallsCount } }
set { getMediaContentMediaSourceCallsCountLock.withLock { getMediaContentMediaSourceUnderlyingCallsCount = newValue } }
}
open var getMediaContentMediaSourceCalled: Bool {
return getMediaContentMediaSourceCallsCount > 0
}
private let getMediaContentMediaSourceReceivedMediaSourceLock = NSLock()
private var getMediaContentMediaSourceUnderlyingReceivedMediaSource: MediaSource?
open var getMediaContentMediaSourceReceivedMediaSource: MediaSource? {
get { getMediaContentMediaSourceReceivedMediaSourceLock.withLock { getMediaContentMediaSourceUnderlyingReceivedMediaSource } }
set { getMediaContentMediaSourceReceivedMediaSourceLock.withLock { getMediaContentMediaSourceUnderlyingReceivedMediaSource = newValue } }
}
private let getMediaContentMediaSourceReceivedInvocationsLock = NSLock()
private var getMediaContentMediaSourceUnderlyingReceivedInvocations: [MediaSource] = []
open var getMediaContentMediaSourceReceivedInvocations: [MediaSource] {
get { getMediaContentMediaSourceReceivedInvocationsLock.withLock { getMediaContentMediaSourceUnderlyingReceivedInvocations } }
set { getMediaContentMediaSourceReceivedInvocationsLock.withLock { getMediaContentMediaSourceUnderlyingReceivedInvocations = newValue } }
}
private let getMediaContentMediaSourceReturnValueLock = NSLock()
open var getMediaContentMediaSourceUnderlyingReturnValue: Data!
open var getMediaContentMediaSourceReturnValue: Data! {
get { getMediaContentMediaSourceReturnValueLock.withLock { getMediaContentMediaSourceUnderlyingReturnValue } }
set { getMediaContentMediaSourceReturnValueLock.withLock { getMediaContentMediaSourceUnderlyingReturnValue = newValue } }
}
open var getMediaContentMediaSourceClosure: ((MediaSource) async throws -> Data)?
open override func getMediaContent(mediaSource: MediaSource) async throws -> Data {
if let error = getMediaContentMediaSourceThrowableError {
throw error
}
getMediaContentMediaSourceCallsCountLock.withLock { getMediaContentMediaSourceUnderlyingCallsCount += 1 }
getMediaContentMediaSourceReceivedMediaSource = mediaSource
getMediaContentMediaSourceReceivedInvocationsLock.withLock { getMediaContentMediaSourceUnderlyingReceivedInvocations.append(mediaSource) }
if let getMediaContentMediaSourceClosure = getMediaContentMediaSourceClosure {
return try await getMediaContentMediaSourceClosure(mediaSource)
} else {
return getMediaContentMediaSourceReturnValue
}
}
//MARK: - getMediaFile
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirThrowableError: Error?
private let getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCountLock = NSLock()
private var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount = 0
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCount: Int {
get { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCountLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount } }
set { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCountLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount = newValue } }
}
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCalled: Bool {
return getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCount > 0
}
private let getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedArgumentsLock = NSLock()
private var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReceivedArguments: (mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?)?
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedArguments: (mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?)? {
get { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedArgumentsLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReceivedArguments } }
set { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedArgumentsLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReceivedArguments = newValue } }
}
private let getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedInvocationsLock = NSLock()
private var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReceivedInvocations: [(mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?)] = []
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedInvocations: [(mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?)] {
get { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedInvocationsLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReceivedInvocations } }
set { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedInvocationsLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReceivedInvocations = newValue } }
}
private let getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReturnValueLock = NSLock()
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue: MediaFileHandle!
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReturnValue: MediaFileHandle! {
get { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReturnValueLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue } }
set { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReturnValueLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReturnValue = newValue } }
}
open var getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure: ((MediaSource, String?, String, Bool, String?) async throws -> MediaFileHandle)?
open override func getMediaFile(mediaSource: MediaSource, filename: String?, mimeType: String, useCache: Bool, tempDir: String?) async throws -> MediaFileHandle {
if let error = getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirThrowableError {
throw error
}
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirCallsCountLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingCallsCount += 1 }
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedArguments = (mediaSource: mediaSource, filename: filename, mimeType: mimeType, useCache: useCache, tempDir: tempDir)
getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReceivedInvocationsLock.withLock { getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirUnderlyingReceivedInvocations.append((mediaSource: mediaSource, filename: filename, mimeType: mimeType, useCache: useCache, tempDir: tempDir)) }
if let getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure = getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure {
return try await getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirClosure(mediaSource, filename, mimeType, useCache, tempDir)
} else {
return getMediaFileMediaSourceFilenameMimeTypeUseCacheTempDirReturnValue
}
}
//MARK: - getMediaPreviewDisplayPolicy
open var getMediaPreviewDisplayPolicyThrowableError: Error?
private let getMediaPreviewDisplayPolicyCallsCountLock = NSLock()
private var getMediaPreviewDisplayPolicyUnderlyingCallsCount = 0
open var getMediaPreviewDisplayPolicyCallsCount: Int {
get { getMediaPreviewDisplayPolicyCallsCountLock.withLock { getMediaPreviewDisplayPolicyUnderlyingCallsCount } }
set { getMediaPreviewDisplayPolicyCallsCountLock.withLock { getMediaPreviewDisplayPolicyUnderlyingCallsCount = newValue } }
}
open var getMediaPreviewDisplayPolicyCalled: Bool {
return getMediaPreviewDisplayPolicyCallsCount > 0
}
private let getMediaPreviewDisplayPolicyReturnValueLock = NSLock()
open var getMediaPreviewDisplayPolicyUnderlyingReturnValue: MediaPreviews?
open var getMediaPreviewDisplayPolicyReturnValue: MediaPreviews? {
get { getMediaPreviewDisplayPolicyReturnValueLock.withLock { getMediaPreviewDisplayPolicyUnderlyingReturnValue } }
set { getMediaPreviewDisplayPolicyReturnValueLock.withLock { getMediaPreviewDisplayPolicyUnderlyingReturnValue = newValue } }
}
open var getMediaPreviewDisplayPolicyClosure: (() async throws -> MediaPreviews?)?
open override func getMediaPreviewDisplayPolicy() async throws -> MediaPreviews? {
if let error = getMediaPreviewDisplayPolicyThrowableError {
throw error
}
getMediaPreviewDisplayPolicyCallsCountLock.withLock { getMediaPreviewDisplayPolicyUnderlyingCallsCount += 1 }
if let getMediaPreviewDisplayPolicyClosure = getMediaPreviewDisplayPolicyClosure {
return try await getMediaPreviewDisplayPolicyClosure()
} else {
return getMediaPreviewDisplayPolicyReturnValue
}
}
//MARK: - getMediaThumbnail
open var getMediaThumbnailMediaSourceWidthHeightThrowableError: Error?
private let getMediaThumbnailMediaSourceWidthHeightCallsCountLock = NSLock()
private var getMediaThumbnailMediaSourceWidthHeightUnderlyingCallsCount = 0
open var getMediaThumbnailMediaSourceWidthHeightCallsCount: Int {
get { getMediaThumbnailMediaSourceWidthHeightCallsCountLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingCallsCount } }
set { getMediaThumbnailMediaSourceWidthHeightCallsCountLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingCallsCount = newValue } }
}
open var getMediaThumbnailMediaSourceWidthHeightCalled: Bool {
return getMediaThumbnailMediaSourceWidthHeightCallsCount > 0
}
private let getMediaThumbnailMediaSourceWidthHeightReceivedArgumentsLock = NSLock()
private var getMediaThumbnailMediaSourceWidthHeightUnderlyingReceivedArguments: (mediaSource: MediaSource, width: UInt64, height: UInt64)?
open var getMediaThumbnailMediaSourceWidthHeightReceivedArguments: (mediaSource: MediaSource, width: UInt64, height: UInt64)? {
get { getMediaThumbnailMediaSourceWidthHeightReceivedArgumentsLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingReceivedArguments } }
set { getMediaThumbnailMediaSourceWidthHeightReceivedArgumentsLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingReceivedArguments = newValue } }
}
private let getMediaThumbnailMediaSourceWidthHeightReceivedInvocationsLock = NSLock()
private var getMediaThumbnailMediaSourceWidthHeightUnderlyingReceivedInvocations: [(mediaSource: MediaSource, width: UInt64, height: UInt64)] = []
open var getMediaThumbnailMediaSourceWidthHeightReceivedInvocations: [(mediaSource: MediaSource, width: UInt64, height: UInt64)] {
get { getMediaThumbnailMediaSourceWidthHeightReceivedInvocationsLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingReceivedInvocations } }
set { getMediaThumbnailMediaSourceWidthHeightReceivedInvocationsLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingReceivedInvocations = newValue } }
}
private let getMediaThumbnailMediaSourceWidthHeightReturnValueLock = NSLock()
open var getMediaThumbnailMediaSourceWidthHeightUnderlyingReturnValue: Data!
open var getMediaThumbnailMediaSourceWidthHeightReturnValue: Data! {
get { getMediaThumbnailMediaSourceWidthHeightReturnValueLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingReturnValue } }
set { getMediaThumbnailMediaSourceWidthHeightReturnValueLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingReturnValue = newValue } }
}
open var getMediaThumbnailMediaSourceWidthHeightClosure: ((MediaSource, UInt64, UInt64) async throws -> Data)?
open override func getMediaThumbnail(mediaSource: MediaSource, width: UInt64, height: UInt64) async throws -> Data {
if let error = getMediaThumbnailMediaSourceWidthHeightThrowableError {
throw error
}
getMediaThumbnailMediaSourceWidthHeightCallsCountLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingCallsCount += 1 }
getMediaThumbnailMediaSourceWidthHeightReceivedArguments = (mediaSource: mediaSource, width: width, height: height)
getMediaThumbnailMediaSourceWidthHeightReceivedInvocationsLock.withLock { getMediaThumbnailMediaSourceWidthHeightUnderlyingReceivedInvocations.append((mediaSource: mediaSource, width: width, height: height)) }
if let getMediaThumbnailMediaSourceWidthHeightClosure = getMediaThumbnailMediaSourceWidthHeightClosure {
return try await getMediaThumbnailMediaSourceWidthHeightClosure(mediaSource, width, height)
} else {
return getMediaThumbnailMediaSourceWidthHeightReturnValue
}
}
//MARK: - getNotificationSettings
private let getNotificationSettingsCallsCountLock = NSLock()
private var getNotificationSettingsUnderlyingCallsCount = 0
open var getNotificationSettingsCallsCount: Int {
get { getNotificationSettingsCallsCountLock.withLock { getNotificationSettingsUnderlyingCallsCount } }
set { getNotificationSettingsCallsCountLock.withLock { getNotificationSettingsUnderlyingCallsCount = newValue } }
}
open var getNotificationSettingsCalled: Bool {
return getNotificationSettingsCallsCount > 0
}
private let getNotificationSettingsReturnValueLock = NSLock()
open var getNotificationSettingsUnderlyingReturnValue: NotificationSettings!
open var getNotificationSettingsReturnValue: NotificationSettings! {
get { getNotificationSettingsReturnValueLock.withLock { getNotificationSettingsUnderlyingReturnValue } }
set { getNotificationSettingsReturnValueLock.withLock { getNotificationSettingsUnderlyingReturnValue = newValue } }
}
open var getNotificationSettingsClosure: (() async -> NotificationSettings)?
open override func getNotificationSettings() async -> NotificationSettings {
getNotificationSettingsCallsCountLock.withLock { getNotificationSettingsUnderlyingCallsCount += 1 }
if let getNotificationSettingsClosure = getNotificationSettingsClosure {
return await getNotificationSettingsClosure()
} else {
return getNotificationSettingsReturnValue
}
}
//MARK: - getProfile
open var getProfileUserIdThrowableError: Error?
private let getProfileUserIdCallsCountLock = NSLock()
private var getProfileUserIdUnderlyingCallsCount = 0
open var getProfileUserIdCallsCount: Int {
get { getProfileUserIdCallsCountLock.withLock { getProfileUserIdUnderlyingCallsCount } }
set { getProfileUserIdCallsCountLock.withLock { getProfileUserIdUnderlyingCallsCount = newValue } }
}
open var getProfileUserIdCalled: Bool {
return getProfileUserIdCallsCount > 0
}
private let getProfileUserIdReceivedUserIdLock = NSLock()
private var getProfileUserIdUnderlyingReceivedUserId: String?
open var getProfileUserIdReceivedUserId: String? {
get { getProfileUserIdReceivedUserIdLock.withLock { getProfileUserIdUnderlyingReceivedUserId } }
set { getProfileUserIdReceivedUserIdLock.withLock { getProfileUserIdUnderlyingReceivedUserId = newValue } }
}
private let getProfileUserIdReceivedInvocationsLock = NSLock()
private var getProfileUserIdUnderlyingReceivedInvocations: [String] = []
open var getProfileUserIdReceivedInvocations: [String] {
get { getProfileUserIdReceivedInvocationsLock.withLock { getProfileUserIdUnderlyingReceivedInvocations } }
set { getProfileUserIdReceivedInvocationsLock.withLock { getProfileUserIdUnderlyingReceivedInvocations = newValue } }
}
private let getProfileUserIdReturnValueLock = NSLock()
open var getProfileUserIdUnderlyingReturnValue: UserProfile!
open var getProfileUserIdReturnValue: UserProfile! {
get { getProfileUserIdReturnValueLock.withLock { getProfileUserIdUnderlyingReturnValue } }
set { getProfileUserIdReturnValueLock.withLock { getProfileUserIdUnderlyingReturnValue = newValue } }
}
open var getProfileUserIdClosure: ((String) async throws -> UserProfile)?
open override func getProfile(userId: String) async throws -> UserProfile {
if let error = getProfileUserIdThrowableError {
throw error
}
getProfileUserIdCallsCountLock.withLock { getProfileUserIdUnderlyingCallsCount += 1 }
getProfileUserIdReceivedUserId = userId
getProfileUserIdReceivedInvocationsLock.withLock { getProfileUserIdUnderlyingReceivedInvocations.append(userId) }
if let getProfileUserIdClosure = getProfileUserIdClosure {
return try await getProfileUserIdClosure(userId)
} else {
return getProfileUserIdReturnValue
}
}
//MARK: - getRecentlyVisitedRooms
open var getRecentlyVisitedRoomsThrowableError: Error?
private let getRecentlyVisitedRoomsCallsCountLock = NSLock()
private var getRecentlyVisitedRoomsUnderlyingCallsCount = 0
open var getRecentlyVisitedRoomsCallsCount: Int {
get { getRecentlyVisitedRoomsCallsCountLock.withLock { getRecentlyVisitedRoomsUnderlyingCallsCount } }
set { getRecentlyVisitedRoomsCallsCountLock.withLock { getRecentlyVisitedRoomsUnderlyingCallsCount = newValue } }
}
open var getRecentlyVisitedRoomsCalled: Bool {
return getRecentlyVisitedRoomsCallsCount > 0
}
private let getRecentlyVisitedRoomsReturnValueLock = NSLock()
open var getRecentlyVisitedRoomsUnderlyingReturnValue: [String]!
open var getRecentlyVisitedRoomsReturnValue: [String]! {
get { getRecentlyVisitedRoomsReturnValueLock.withLock { getRecentlyVisitedRoomsUnderlyingReturnValue } }
set { getRecentlyVisitedRoomsReturnValueLock.withLock { getRecentlyVisitedRoomsUnderlyingReturnValue = newValue } }
}
open var getRecentlyVisitedRoomsClosure: (() async throws -> [String])?
open override func getRecentlyVisitedRooms() async throws -> [String] {
if let error = getRecentlyVisitedRoomsThrowableError {
throw error
}
getRecentlyVisitedRoomsCallsCountLock.withLock { getRecentlyVisitedRoomsUnderlyingCallsCount += 1 }
if let getRecentlyVisitedRoomsClosure = getRecentlyVisitedRoomsClosure {
return try await getRecentlyVisitedRoomsClosure()
} else {
return getRecentlyVisitedRoomsReturnValue
}
}
//MARK: - getRoom
open var getRoomRoomIdThrowableError: Error?
private let getRoomRoomIdCallsCountLock = NSLock()
private var getRoomRoomIdUnderlyingCallsCount = 0
open var getRoomRoomIdCallsCount: Int {
get { getRoomRoomIdCallsCountLock.withLock { getRoomRoomIdUnderlyingCallsCount } }
set { getRoomRoomIdCallsCountLock.withLock { getRoomRoomIdUnderlyingCallsCount = newValue } }
}
open var getRoomRoomIdCalled: Bool {
return getRoomRoomIdCallsCount > 0
}
private let getRoomRoomIdReceivedRoomIdLock = NSLock()
private var getRoomRoomIdUnderlyingReceivedRoomId: String?
open var getRoomRoomIdReceivedRoomId: String? {
get { getRoomRoomIdReceivedRoomIdLock.withLock { getRoomRoomIdUnderlyingReceivedRoomId } }
set { getRoomRoomIdReceivedRoomIdLock.withLock { getRoomRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let getRoomRoomIdReceivedInvocationsLock = NSLock()
private var getRoomRoomIdUnderlyingReceivedInvocations: [String] = []
open var getRoomRoomIdReceivedInvocations: [String] {
get { getRoomRoomIdReceivedInvocationsLock.withLock { getRoomRoomIdUnderlyingReceivedInvocations } }
set { getRoomRoomIdReceivedInvocationsLock.withLock { getRoomRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let getRoomRoomIdReturnValueLock = NSLock()
open var getRoomRoomIdUnderlyingReturnValue: Room?
open var getRoomRoomIdReturnValue: Room? {
get { getRoomRoomIdReturnValueLock.withLock { getRoomRoomIdUnderlyingReturnValue } }
set { getRoomRoomIdReturnValueLock.withLock { getRoomRoomIdUnderlyingReturnValue = newValue } }
}
open var getRoomRoomIdClosure: ((String) throws -> Room?)?
open override func getRoom(roomId: String) throws -> Room? {
if let error = getRoomRoomIdThrowableError {
throw error
}
getRoomRoomIdCallsCountLock.withLock { getRoomRoomIdUnderlyingCallsCount += 1 }
getRoomRoomIdReceivedRoomId = roomId
getRoomRoomIdReceivedInvocationsLock.withLock { getRoomRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let getRoomRoomIdClosure = getRoomRoomIdClosure {
return try getRoomRoomIdClosure(roomId)
} else {
return getRoomRoomIdReturnValue
}
}
//MARK: - getRoomPreviewFromRoomAlias
open var getRoomPreviewFromRoomAliasRoomAliasThrowableError: Error?
private let getRoomPreviewFromRoomAliasRoomAliasCallsCountLock = NSLock()
private var getRoomPreviewFromRoomAliasRoomAliasUnderlyingCallsCount = 0
open var getRoomPreviewFromRoomAliasRoomAliasCallsCount: Int {
get { getRoomPreviewFromRoomAliasRoomAliasCallsCountLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingCallsCount } }
set { getRoomPreviewFromRoomAliasRoomAliasCallsCountLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingCallsCount = newValue } }
}
open var getRoomPreviewFromRoomAliasRoomAliasCalled: Bool {
return getRoomPreviewFromRoomAliasRoomAliasCallsCount > 0
}
private let getRoomPreviewFromRoomAliasRoomAliasReceivedRoomAliasLock = NSLock()
private var getRoomPreviewFromRoomAliasRoomAliasUnderlyingReceivedRoomAlias: String?
open var getRoomPreviewFromRoomAliasRoomAliasReceivedRoomAlias: String? {
get { getRoomPreviewFromRoomAliasRoomAliasReceivedRoomAliasLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingReceivedRoomAlias } }
set { getRoomPreviewFromRoomAliasRoomAliasReceivedRoomAliasLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingReceivedRoomAlias = newValue } }
}
private let getRoomPreviewFromRoomAliasRoomAliasReceivedInvocationsLock = NSLock()
private var getRoomPreviewFromRoomAliasRoomAliasUnderlyingReceivedInvocations: [String] = []
open var getRoomPreviewFromRoomAliasRoomAliasReceivedInvocations: [String] {
get { getRoomPreviewFromRoomAliasRoomAliasReceivedInvocationsLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingReceivedInvocations } }
set { getRoomPreviewFromRoomAliasRoomAliasReceivedInvocationsLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingReceivedInvocations = newValue } }
}
private let getRoomPreviewFromRoomAliasRoomAliasReturnValueLock = NSLock()
open var getRoomPreviewFromRoomAliasRoomAliasUnderlyingReturnValue: RoomPreview!
open var getRoomPreviewFromRoomAliasRoomAliasReturnValue: RoomPreview! {
get { getRoomPreviewFromRoomAliasRoomAliasReturnValueLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingReturnValue } }
set { getRoomPreviewFromRoomAliasRoomAliasReturnValueLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingReturnValue = newValue } }
}
open var getRoomPreviewFromRoomAliasRoomAliasClosure: ((String) async throws -> RoomPreview)?
open override func getRoomPreviewFromRoomAlias(roomAlias: String) async throws -> RoomPreview {
if let error = getRoomPreviewFromRoomAliasRoomAliasThrowableError {
throw error
}
getRoomPreviewFromRoomAliasRoomAliasCallsCountLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingCallsCount += 1 }
getRoomPreviewFromRoomAliasRoomAliasReceivedRoomAlias = roomAlias
getRoomPreviewFromRoomAliasRoomAliasReceivedInvocationsLock.withLock { getRoomPreviewFromRoomAliasRoomAliasUnderlyingReceivedInvocations.append(roomAlias) }
if let getRoomPreviewFromRoomAliasRoomAliasClosure = getRoomPreviewFromRoomAliasRoomAliasClosure {
return try await getRoomPreviewFromRoomAliasRoomAliasClosure(roomAlias)
} else {
return getRoomPreviewFromRoomAliasRoomAliasReturnValue
}
}
//MARK: - getRoomPreviewFromRoomId
open var getRoomPreviewFromRoomIdRoomIdViaServersThrowableError: Error?
private let getRoomPreviewFromRoomIdRoomIdViaServersCallsCountLock = NSLock()
private var getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingCallsCount = 0
open var getRoomPreviewFromRoomIdRoomIdViaServersCallsCount: Int {
get { getRoomPreviewFromRoomIdRoomIdViaServersCallsCountLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingCallsCount } }
set { getRoomPreviewFromRoomIdRoomIdViaServersCallsCountLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingCallsCount = newValue } }
}
open var getRoomPreviewFromRoomIdRoomIdViaServersCalled: Bool {
return getRoomPreviewFromRoomIdRoomIdViaServersCallsCount > 0
}
private let getRoomPreviewFromRoomIdRoomIdViaServersReceivedArgumentsLock = NSLock()
private var getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReceivedArguments: (roomId: String, viaServers: [String])?
open var getRoomPreviewFromRoomIdRoomIdViaServersReceivedArguments: (roomId: String, viaServers: [String])? {
get { getRoomPreviewFromRoomIdRoomIdViaServersReceivedArgumentsLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReceivedArguments } }
set { getRoomPreviewFromRoomIdRoomIdViaServersReceivedArgumentsLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReceivedArguments = newValue } }
}
private let getRoomPreviewFromRoomIdRoomIdViaServersReceivedInvocationsLock = NSLock()
private var getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReceivedInvocations: [(roomId: String, viaServers: [String])] = []
open var getRoomPreviewFromRoomIdRoomIdViaServersReceivedInvocations: [(roomId: String, viaServers: [String])] {
get { getRoomPreviewFromRoomIdRoomIdViaServersReceivedInvocationsLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReceivedInvocations } }
set { getRoomPreviewFromRoomIdRoomIdViaServersReceivedInvocationsLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReceivedInvocations = newValue } }
}
private let getRoomPreviewFromRoomIdRoomIdViaServersReturnValueLock = NSLock()
open var getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReturnValue: RoomPreview!
open var getRoomPreviewFromRoomIdRoomIdViaServersReturnValue: RoomPreview! {
get { getRoomPreviewFromRoomIdRoomIdViaServersReturnValueLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReturnValue } }
set { getRoomPreviewFromRoomIdRoomIdViaServersReturnValueLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReturnValue = newValue } }
}
open var getRoomPreviewFromRoomIdRoomIdViaServersClosure: ((String, [String]) async throws -> RoomPreview)?
open override func getRoomPreviewFromRoomId(roomId: String, viaServers: [String]) async throws -> RoomPreview {
if let error = getRoomPreviewFromRoomIdRoomIdViaServersThrowableError {
throw error
}
getRoomPreviewFromRoomIdRoomIdViaServersCallsCountLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingCallsCount += 1 }
getRoomPreviewFromRoomIdRoomIdViaServersReceivedArguments = (roomId: roomId, viaServers: viaServers)
getRoomPreviewFromRoomIdRoomIdViaServersReceivedInvocationsLock.withLock { getRoomPreviewFromRoomIdRoomIdViaServersUnderlyingReceivedInvocations.append((roomId: roomId, viaServers: viaServers)) }
if let getRoomPreviewFromRoomIdRoomIdViaServersClosure = getRoomPreviewFromRoomIdRoomIdViaServersClosure {
return try await getRoomPreviewFromRoomIdRoomIdViaServersClosure(roomId, viaServers)
} else {
return getRoomPreviewFromRoomIdRoomIdViaServersReturnValue
}
}
//MARK: - getSessionVerificationController
open var getSessionVerificationControllerThrowableError: Error?
private let getSessionVerificationControllerCallsCountLock = NSLock()
private var getSessionVerificationControllerUnderlyingCallsCount = 0
open var getSessionVerificationControllerCallsCount: Int {
get { getSessionVerificationControllerCallsCountLock.withLock { getSessionVerificationControllerUnderlyingCallsCount } }
set { getSessionVerificationControllerCallsCountLock.withLock { getSessionVerificationControllerUnderlyingCallsCount = newValue } }
}
open var getSessionVerificationControllerCalled: Bool {
return getSessionVerificationControllerCallsCount > 0
}
private let getSessionVerificationControllerReturnValueLock = NSLock()
open var getSessionVerificationControllerUnderlyingReturnValue: SessionVerificationController!
open var getSessionVerificationControllerReturnValue: SessionVerificationController! {
get { getSessionVerificationControllerReturnValueLock.withLock { getSessionVerificationControllerUnderlyingReturnValue } }
set { getSessionVerificationControllerReturnValueLock.withLock { getSessionVerificationControllerUnderlyingReturnValue = newValue } }
}
open var getSessionVerificationControllerClosure: (() async throws -> SessionVerificationController)?
open override func getSessionVerificationController() async throws -> SessionVerificationController {
if let error = getSessionVerificationControllerThrowableError {
throw error
}
getSessionVerificationControllerCallsCountLock.withLock { getSessionVerificationControllerUnderlyingCallsCount += 1 }
if let getSessionVerificationControllerClosure = getSessionVerificationControllerClosure {
return try await getSessionVerificationControllerClosure()
} else {
return getSessionVerificationControllerReturnValue
}
}
//MARK: - getStoreSizes
open var getStoreSizesThrowableError: Error?
private let getStoreSizesCallsCountLock = NSLock()
private var getStoreSizesUnderlyingCallsCount = 0
open var getStoreSizesCallsCount: Int {
get { getStoreSizesCallsCountLock.withLock { getStoreSizesUnderlyingCallsCount } }
set { getStoreSizesCallsCountLock.withLock { getStoreSizesUnderlyingCallsCount = newValue } }
}
open var getStoreSizesCalled: Bool {
return getStoreSizesCallsCount > 0
}
private let getStoreSizesReturnValueLock = NSLock()
open var getStoreSizesUnderlyingReturnValue: StoreSizes!
open var getStoreSizesReturnValue: StoreSizes! {
get { getStoreSizesReturnValueLock.withLock { getStoreSizesUnderlyingReturnValue } }
set { getStoreSizesReturnValueLock.withLock { getStoreSizesUnderlyingReturnValue = newValue } }
}
open var getStoreSizesClosure: (() async throws -> StoreSizes)?
open override func getStoreSizes() async throws -> StoreSizes {
if let error = getStoreSizesThrowableError {
throw error
}
getStoreSizesCallsCountLock.withLock { getStoreSizesUnderlyingCallsCount += 1 }
if let getStoreSizesClosure = getStoreSizesClosure {
return try await getStoreSizesClosure()
} else {
return getStoreSizesReturnValue
}
}
//MARK: - getUrl
open var getUrlUrlThrowableError: Error?
private let getUrlUrlCallsCountLock = NSLock()
private var getUrlUrlUnderlyingCallsCount = 0
open var getUrlUrlCallsCount: Int {
get { getUrlUrlCallsCountLock.withLock { getUrlUrlUnderlyingCallsCount } }
set { getUrlUrlCallsCountLock.withLock { getUrlUrlUnderlyingCallsCount = newValue } }
}
open var getUrlUrlCalled: Bool {
return getUrlUrlCallsCount > 0
}
private let getUrlUrlReceivedUrlLock = NSLock()
private var getUrlUrlUnderlyingReceivedUrl: String?
open var getUrlUrlReceivedUrl: String? {
get { getUrlUrlReceivedUrlLock.withLock { getUrlUrlUnderlyingReceivedUrl } }
set { getUrlUrlReceivedUrlLock.withLock { getUrlUrlUnderlyingReceivedUrl = newValue } }
}
private let getUrlUrlReceivedInvocationsLock = NSLock()
private var getUrlUrlUnderlyingReceivedInvocations: [String] = []
open var getUrlUrlReceivedInvocations: [String] {
get { getUrlUrlReceivedInvocationsLock.withLock { getUrlUrlUnderlyingReceivedInvocations } }
set { getUrlUrlReceivedInvocationsLock.withLock { getUrlUrlUnderlyingReceivedInvocations = newValue } }
}
private let getUrlUrlReturnValueLock = NSLock()
open var getUrlUrlUnderlyingReturnValue: Data!
open var getUrlUrlReturnValue: Data! {
get { getUrlUrlReturnValueLock.withLock { getUrlUrlUnderlyingReturnValue } }
set { getUrlUrlReturnValueLock.withLock { getUrlUrlUnderlyingReturnValue = newValue } }
}
open var getUrlUrlClosure: ((String) async throws -> Data)?
open override func getUrl(url: String) async throws -> Data {
if let error = getUrlUrlThrowableError {
throw error
}
getUrlUrlCallsCountLock.withLock { getUrlUrlUnderlyingCallsCount += 1 }
getUrlUrlReceivedUrl = url
getUrlUrlReceivedInvocationsLock.withLock { getUrlUrlUnderlyingReceivedInvocations.append(url) }
if let getUrlUrlClosure = getUrlUrlClosure {
return try await getUrlUrlClosure(url)
} else {
return getUrlUrlReturnValue
}
}
//MARK: - getUrlPreview
open var getUrlPreviewUrlTsThrowableError: Error?
private let getUrlPreviewUrlTsCallsCountLock = NSLock()
private var getUrlPreviewUrlTsUnderlyingCallsCount = 0
open var getUrlPreviewUrlTsCallsCount: Int {
get { getUrlPreviewUrlTsCallsCountLock.withLock { getUrlPreviewUrlTsUnderlyingCallsCount } }
set { getUrlPreviewUrlTsCallsCountLock.withLock { getUrlPreviewUrlTsUnderlyingCallsCount = newValue } }
}
open var getUrlPreviewUrlTsCalled: Bool {
return getUrlPreviewUrlTsCallsCount > 0
}
private let getUrlPreviewUrlTsReceivedArgumentsLock = NSLock()
private var getUrlPreviewUrlTsUnderlyingReceivedArguments: (url: String, ts: UInt64?)?
open var getUrlPreviewUrlTsReceivedArguments: (url: String, ts: UInt64?)? {
get { getUrlPreviewUrlTsReceivedArgumentsLock.withLock { getUrlPreviewUrlTsUnderlyingReceivedArguments } }
set { getUrlPreviewUrlTsReceivedArgumentsLock.withLock { getUrlPreviewUrlTsUnderlyingReceivedArguments = newValue } }
}
private let getUrlPreviewUrlTsReceivedInvocationsLock = NSLock()
private var getUrlPreviewUrlTsUnderlyingReceivedInvocations: [(url: String, ts: UInt64?)] = []
open var getUrlPreviewUrlTsReceivedInvocations: [(url: String, ts: UInt64?)] {
get { getUrlPreviewUrlTsReceivedInvocationsLock.withLock { getUrlPreviewUrlTsUnderlyingReceivedInvocations } }
set { getUrlPreviewUrlTsReceivedInvocationsLock.withLock { getUrlPreviewUrlTsUnderlyingReceivedInvocations = newValue } }
}
private let getUrlPreviewUrlTsReturnValueLock = NSLock()
open var getUrlPreviewUrlTsUnderlyingReturnValue: String?
open var getUrlPreviewUrlTsReturnValue: String? {
get { getUrlPreviewUrlTsReturnValueLock.withLock { getUrlPreviewUrlTsUnderlyingReturnValue } }
set { getUrlPreviewUrlTsReturnValueLock.withLock { getUrlPreviewUrlTsUnderlyingReturnValue = newValue } }
}
open var getUrlPreviewUrlTsClosure: ((String, UInt64?) async throws -> String?)?
open override func getUrlPreview(url: String, ts: UInt64?) async throws -> String? {
if let error = getUrlPreviewUrlTsThrowableError {
throw error
}
getUrlPreviewUrlTsCallsCountLock.withLock { getUrlPreviewUrlTsUnderlyingCallsCount += 1 }
getUrlPreviewUrlTsReceivedArguments = (url: url, ts: ts)
getUrlPreviewUrlTsReceivedInvocationsLock.withLock { getUrlPreviewUrlTsUnderlyingReceivedInvocations.append((url: url, ts: ts)) }
if let getUrlPreviewUrlTsClosure = getUrlPreviewUrlTsClosure {
return try await getUrlPreviewUrlTsClosure(url, ts)
} else {
return getUrlPreviewUrlTsReturnValue
}
}
//MARK: - homeserver
private let homeserverCallsCountLock = NSLock()
private var homeserverUnderlyingCallsCount = 0
open var homeserverCallsCount: Int {
get { homeserverCallsCountLock.withLock { homeserverUnderlyingCallsCount } }
set { homeserverCallsCountLock.withLock { homeserverUnderlyingCallsCount = newValue } }
}
open var homeserverCalled: Bool {
return homeserverCallsCount > 0
}
private let homeserverReturnValueLock = NSLock()
open var homeserverUnderlyingReturnValue: String!
open var homeserverReturnValue: String! {
get { homeserverReturnValueLock.withLock { homeserverUnderlyingReturnValue } }
set { homeserverReturnValueLock.withLock { homeserverUnderlyingReturnValue = newValue } }
}
open var homeserverClosure: (() -> String)?
open override func homeserver() -> String {
homeserverCallsCountLock.withLock { homeserverUnderlyingCallsCount += 1 }
if let homeserverClosure = homeserverClosure {
return homeserverClosure()
} else {
return homeserverReturnValue
}
}
//MARK: - homeserverCapabilities
private let homeserverCapabilitiesCallsCountLock = NSLock()
private var homeserverCapabilitiesUnderlyingCallsCount = 0
open var homeserverCapabilitiesCallsCount: Int {
get { homeserverCapabilitiesCallsCountLock.withLock { homeserverCapabilitiesUnderlyingCallsCount } }
set { homeserverCapabilitiesCallsCountLock.withLock { homeserverCapabilitiesUnderlyingCallsCount = newValue } }
}
open var homeserverCapabilitiesCalled: Bool {
return homeserverCapabilitiesCallsCount > 0
}
private let homeserverCapabilitiesReturnValueLock = NSLock()
open var homeserverCapabilitiesUnderlyingReturnValue: HomeserverCapabilities!
open var homeserverCapabilitiesReturnValue: HomeserverCapabilities! {
get { homeserverCapabilitiesReturnValueLock.withLock { homeserverCapabilitiesUnderlyingReturnValue } }
set { homeserverCapabilitiesReturnValueLock.withLock { homeserverCapabilitiesUnderlyingReturnValue = newValue } }
}
open var homeserverCapabilitiesClosure: (() -> HomeserverCapabilities)?
open override func homeserverCapabilities() -> HomeserverCapabilities {
homeserverCapabilitiesCallsCountLock.withLock { homeserverCapabilitiesUnderlyingCallsCount += 1 }
if let homeserverCapabilitiesClosure = homeserverCapabilitiesClosure {
return homeserverCapabilitiesClosure()
} else {
return homeserverCapabilitiesReturnValue
}
}
//MARK: - homeserverLoginDetails
private let homeserverLoginDetailsCallsCountLock = NSLock()
private var homeserverLoginDetailsUnderlyingCallsCount = 0
open var homeserverLoginDetailsCallsCount: Int {
get { homeserverLoginDetailsCallsCountLock.withLock { homeserverLoginDetailsUnderlyingCallsCount } }
set { homeserverLoginDetailsCallsCountLock.withLock { homeserverLoginDetailsUnderlyingCallsCount = newValue } }
}
open var homeserverLoginDetailsCalled: Bool {
return homeserverLoginDetailsCallsCount > 0
}
private let homeserverLoginDetailsReturnValueLock = NSLock()
open var homeserverLoginDetailsUnderlyingReturnValue: HomeserverLoginDetails!
open var homeserverLoginDetailsReturnValue: HomeserverLoginDetails! {
get { homeserverLoginDetailsReturnValueLock.withLock { homeserverLoginDetailsUnderlyingReturnValue } }
set { homeserverLoginDetailsReturnValueLock.withLock { homeserverLoginDetailsUnderlyingReturnValue = newValue } }
}
open var homeserverLoginDetailsClosure: (() async -> HomeserverLoginDetails)?
open override func homeserverLoginDetails() async -> HomeserverLoginDetails {
homeserverLoginDetailsCallsCountLock.withLock { homeserverLoginDetailsUnderlyingCallsCount += 1 }
if let homeserverLoginDetailsClosure = homeserverLoginDetailsClosure {
return await homeserverLoginDetailsClosure()
} else {
return homeserverLoginDetailsReturnValue
}
}
//MARK: - ignoreUser
open var ignoreUserUserIdThrowableError: Error?
private let ignoreUserUserIdCallsCountLock = NSLock()
private var ignoreUserUserIdUnderlyingCallsCount = 0
open var ignoreUserUserIdCallsCount: Int {
get { ignoreUserUserIdCallsCountLock.withLock { ignoreUserUserIdUnderlyingCallsCount } }
set { ignoreUserUserIdCallsCountLock.withLock { ignoreUserUserIdUnderlyingCallsCount = newValue } }
}
open var ignoreUserUserIdCalled: Bool {
return ignoreUserUserIdCallsCount > 0
}
private let ignoreUserUserIdReceivedUserIdLock = NSLock()
private var ignoreUserUserIdUnderlyingReceivedUserId: String?
open var ignoreUserUserIdReceivedUserId: String? {
get { ignoreUserUserIdReceivedUserIdLock.withLock { ignoreUserUserIdUnderlyingReceivedUserId } }
set { ignoreUserUserIdReceivedUserIdLock.withLock { ignoreUserUserIdUnderlyingReceivedUserId = newValue } }
}
private let ignoreUserUserIdReceivedInvocationsLock = NSLock()
private var ignoreUserUserIdUnderlyingReceivedInvocations: [String] = []
open var ignoreUserUserIdReceivedInvocations: [String] {
get { ignoreUserUserIdReceivedInvocationsLock.withLock { ignoreUserUserIdUnderlyingReceivedInvocations } }
set { ignoreUserUserIdReceivedInvocationsLock.withLock { ignoreUserUserIdUnderlyingReceivedInvocations = newValue } }
}
open var ignoreUserUserIdClosure: ((String) async throws -> Void)?
open override func ignoreUser(userId: String) async throws {
if let error = ignoreUserUserIdThrowableError {
throw error
}
ignoreUserUserIdCallsCountLock.withLock { ignoreUserUserIdUnderlyingCallsCount += 1 }
ignoreUserUserIdReceivedUserId = userId
ignoreUserUserIdReceivedInvocationsLock.withLock { ignoreUserUserIdUnderlyingReceivedInvocations.append(userId) }
try await ignoreUserUserIdClosure?(userId)
}
//MARK: - ignoredUsers
open var ignoredUsersThrowableError: Error?
private let ignoredUsersCallsCountLock = NSLock()
private var ignoredUsersUnderlyingCallsCount = 0
open var ignoredUsersCallsCount: Int {
get { ignoredUsersCallsCountLock.withLock { ignoredUsersUnderlyingCallsCount } }
set { ignoredUsersCallsCountLock.withLock { ignoredUsersUnderlyingCallsCount = newValue } }
}
open var ignoredUsersCalled: Bool {
return ignoredUsersCallsCount > 0
}
private let ignoredUsersReturnValueLock = NSLock()
open var ignoredUsersUnderlyingReturnValue: [String]!
open var ignoredUsersReturnValue: [String]! {
get { ignoredUsersReturnValueLock.withLock { ignoredUsersUnderlyingReturnValue } }
set { ignoredUsersReturnValueLock.withLock { ignoredUsersUnderlyingReturnValue = newValue } }
}
open var ignoredUsersClosure: (() async throws -> [String])?
open override func ignoredUsers() async throws -> [String] {
if let error = ignoredUsersThrowableError {
throw error
}
ignoredUsersCallsCountLock.withLock { ignoredUsersUnderlyingCallsCount += 1 }
if let ignoredUsersClosure = ignoredUsersClosure {
return try await ignoredUsersClosure()
} else {
return ignoredUsersReturnValue
}
}
//MARK: - isLivekitRtcSupported
open var isLivekitRtcSupportedThrowableError: Error?
private let isLivekitRtcSupportedCallsCountLock = NSLock()
private var isLivekitRtcSupportedUnderlyingCallsCount = 0
open var isLivekitRtcSupportedCallsCount: Int {
get { isLivekitRtcSupportedCallsCountLock.withLock { isLivekitRtcSupportedUnderlyingCallsCount } }
set { isLivekitRtcSupportedCallsCountLock.withLock { isLivekitRtcSupportedUnderlyingCallsCount = newValue } }
}
open var isLivekitRtcSupportedCalled: Bool {
return isLivekitRtcSupportedCallsCount > 0
}
private let isLivekitRtcSupportedReturnValueLock = NSLock()
open var isLivekitRtcSupportedUnderlyingReturnValue: Bool!
open var isLivekitRtcSupportedReturnValue: Bool! {
get { isLivekitRtcSupportedReturnValueLock.withLock { isLivekitRtcSupportedUnderlyingReturnValue } }
set { isLivekitRtcSupportedReturnValueLock.withLock { isLivekitRtcSupportedUnderlyingReturnValue = newValue } }
}
open var isLivekitRtcSupportedClosure: (() async throws -> Bool)?
open override func isLivekitRtcSupported() async throws -> Bool {
if let error = isLivekitRtcSupportedThrowableError {
throw error
}
isLivekitRtcSupportedCallsCountLock.withLock { isLivekitRtcSupportedUnderlyingCallsCount += 1 }
if let isLivekitRtcSupportedClosure = isLivekitRtcSupportedClosure {
return try await isLivekitRtcSupportedClosure()
} else {
return isLivekitRtcSupportedReturnValue
}
}
//MARK: - isLoginWithQrCodeSupported
open var isLoginWithQrCodeSupportedThrowableError: Error?
private let isLoginWithQrCodeSupportedCallsCountLock = NSLock()
private var isLoginWithQrCodeSupportedUnderlyingCallsCount = 0
open var isLoginWithQrCodeSupportedCallsCount: Int {
get { isLoginWithQrCodeSupportedCallsCountLock.withLock { isLoginWithQrCodeSupportedUnderlyingCallsCount } }
set { isLoginWithQrCodeSupportedCallsCountLock.withLock { isLoginWithQrCodeSupportedUnderlyingCallsCount = newValue } }
}
open var isLoginWithQrCodeSupportedCalled: Bool {
return isLoginWithQrCodeSupportedCallsCount > 0
}
private let isLoginWithQrCodeSupportedReturnValueLock = NSLock()
open var isLoginWithQrCodeSupportedUnderlyingReturnValue: Bool!
open var isLoginWithQrCodeSupportedReturnValue: Bool! {
get { isLoginWithQrCodeSupportedReturnValueLock.withLock { isLoginWithQrCodeSupportedUnderlyingReturnValue } }
set { isLoginWithQrCodeSupportedReturnValueLock.withLock { isLoginWithQrCodeSupportedUnderlyingReturnValue = newValue } }
}
open var isLoginWithQrCodeSupportedClosure: (() async throws -> Bool)?
open override func isLoginWithQrCodeSupported() async throws -> Bool {
if let error = isLoginWithQrCodeSupportedThrowableError {
throw error
}
isLoginWithQrCodeSupportedCallsCountLock.withLock { isLoginWithQrCodeSupportedUnderlyingCallsCount += 1 }
if let isLoginWithQrCodeSupportedClosure = isLoginWithQrCodeSupportedClosure {
return try await isLoginWithQrCodeSupportedClosure()
} else {
return isLoginWithQrCodeSupportedReturnValue
}
}
//MARK: - isProfilesSlidingSyncExtensionSupported
open var isProfilesSlidingSyncExtensionSupportedThrowableError: Error?
private let isProfilesSlidingSyncExtensionSupportedCallsCountLock = NSLock()
private var isProfilesSlidingSyncExtensionSupportedUnderlyingCallsCount = 0
open var isProfilesSlidingSyncExtensionSupportedCallsCount: Int {
get { isProfilesSlidingSyncExtensionSupportedCallsCountLock.withLock { isProfilesSlidingSyncExtensionSupportedUnderlyingCallsCount } }
set { isProfilesSlidingSyncExtensionSupportedCallsCountLock.withLock { isProfilesSlidingSyncExtensionSupportedUnderlyingCallsCount = newValue } }
}
open var isProfilesSlidingSyncExtensionSupportedCalled: Bool {
return isProfilesSlidingSyncExtensionSupportedCallsCount > 0
}
private let isProfilesSlidingSyncExtensionSupportedReturnValueLock = NSLock()
open var isProfilesSlidingSyncExtensionSupportedUnderlyingReturnValue: Bool!
open var isProfilesSlidingSyncExtensionSupportedReturnValue: Bool! {
get { isProfilesSlidingSyncExtensionSupportedReturnValueLock.withLock { isProfilesSlidingSyncExtensionSupportedUnderlyingReturnValue } }
set { isProfilesSlidingSyncExtensionSupportedReturnValueLock.withLock { isProfilesSlidingSyncExtensionSupportedUnderlyingReturnValue = newValue } }
}
open var isProfilesSlidingSyncExtensionSupportedClosure: (() async throws -> Bool)?
open override func isProfilesSlidingSyncExtensionSupported() async throws -> Bool {
if let error = isProfilesSlidingSyncExtensionSupportedThrowableError {
throw error
}
isProfilesSlidingSyncExtensionSupportedCallsCountLock.withLock { isProfilesSlidingSyncExtensionSupportedUnderlyingCallsCount += 1 }
if let isProfilesSlidingSyncExtensionSupportedClosure = isProfilesSlidingSyncExtensionSupportedClosure {
return try await isProfilesSlidingSyncExtensionSupportedClosure()
} else {
return isProfilesSlidingSyncExtensionSupportedReturnValue
}
}
//MARK: - isReportRoomApiSupported
open var isReportRoomApiSupportedThrowableError: Error?
private let isReportRoomApiSupportedCallsCountLock = NSLock()
private var isReportRoomApiSupportedUnderlyingCallsCount = 0
open var isReportRoomApiSupportedCallsCount: Int {
get { isReportRoomApiSupportedCallsCountLock.withLock { isReportRoomApiSupportedUnderlyingCallsCount } }
set { isReportRoomApiSupportedCallsCountLock.withLock { isReportRoomApiSupportedUnderlyingCallsCount = newValue } }
}
open var isReportRoomApiSupportedCalled: Bool {
return isReportRoomApiSupportedCallsCount > 0
}
private let isReportRoomApiSupportedReturnValueLock = NSLock()
open var isReportRoomApiSupportedUnderlyingReturnValue: Bool!
open var isReportRoomApiSupportedReturnValue: Bool! {
get { isReportRoomApiSupportedReturnValueLock.withLock { isReportRoomApiSupportedUnderlyingReturnValue } }
set { isReportRoomApiSupportedReturnValueLock.withLock { isReportRoomApiSupportedUnderlyingReturnValue = newValue } }
}
open var isReportRoomApiSupportedClosure: (() async throws -> Bool)?
open override func isReportRoomApiSupported() async throws -> Bool {
if let error = isReportRoomApiSupportedThrowableError {
throw error
}
isReportRoomApiSupportedCallsCountLock.withLock { isReportRoomApiSupportedUnderlyingCallsCount += 1 }
if let isReportRoomApiSupportedClosure = isReportRoomApiSupportedClosure {
return try await isReportRoomApiSupportedClosure()
} else {
return isReportRoomApiSupportedReturnValue
}
}
//MARK: - isRoomAliasAvailable
open var isRoomAliasAvailableAliasThrowableError: Error?
private let isRoomAliasAvailableAliasCallsCountLock = NSLock()
private var isRoomAliasAvailableAliasUnderlyingCallsCount = 0
open var isRoomAliasAvailableAliasCallsCount: Int {
get { isRoomAliasAvailableAliasCallsCountLock.withLock { isRoomAliasAvailableAliasUnderlyingCallsCount } }
set { isRoomAliasAvailableAliasCallsCountLock.withLock { isRoomAliasAvailableAliasUnderlyingCallsCount = newValue } }
}
open var isRoomAliasAvailableAliasCalled: Bool {
return isRoomAliasAvailableAliasCallsCount > 0
}
private let isRoomAliasAvailableAliasReceivedAliasLock = NSLock()
private var isRoomAliasAvailableAliasUnderlyingReceivedAlias: String?
open var isRoomAliasAvailableAliasReceivedAlias: String? {
get { isRoomAliasAvailableAliasReceivedAliasLock.withLock { isRoomAliasAvailableAliasUnderlyingReceivedAlias } }
set { isRoomAliasAvailableAliasReceivedAliasLock.withLock { isRoomAliasAvailableAliasUnderlyingReceivedAlias = newValue } }
}
private let isRoomAliasAvailableAliasReceivedInvocationsLock = NSLock()
private var isRoomAliasAvailableAliasUnderlyingReceivedInvocations: [String] = []
open var isRoomAliasAvailableAliasReceivedInvocations: [String] {
get { isRoomAliasAvailableAliasReceivedInvocationsLock.withLock { isRoomAliasAvailableAliasUnderlyingReceivedInvocations } }
set { isRoomAliasAvailableAliasReceivedInvocationsLock.withLock { isRoomAliasAvailableAliasUnderlyingReceivedInvocations = newValue } }
}
private let isRoomAliasAvailableAliasReturnValueLock = NSLock()
open var isRoomAliasAvailableAliasUnderlyingReturnValue: Bool!
open var isRoomAliasAvailableAliasReturnValue: Bool! {
get { isRoomAliasAvailableAliasReturnValueLock.withLock { isRoomAliasAvailableAliasUnderlyingReturnValue } }
set { isRoomAliasAvailableAliasReturnValueLock.withLock { isRoomAliasAvailableAliasUnderlyingReturnValue = newValue } }
}
open var isRoomAliasAvailableAliasClosure: ((String) async throws -> Bool)?
open override func isRoomAliasAvailable(alias: String) async throws -> Bool {
if let error = isRoomAliasAvailableAliasThrowableError {
throw error
}
isRoomAliasAvailableAliasCallsCountLock.withLock { isRoomAliasAvailableAliasUnderlyingCallsCount += 1 }
isRoomAliasAvailableAliasReceivedAlias = alias
isRoomAliasAvailableAliasReceivedInvocationsLock.withLock { isRoomAliasAvailableAliasUnderlyingReceivedInvocations.append(alias) }
if let isRoomAliasAvailableAliasClosure = isRoomAliasAvailableAliasClosure {
return try await isRoomAliasAvailableAliasClosure(alias)
} else {
return isRoomAliasAvailableAliasReturnValue
}
}
//MARK: - isUserStatusSupported
open var isUserStatusSupportedThrowableError: Error?
private let isUserStatusSupportedCallsCountLock = NSLock()
private var isUserStatusSupportedUnderlyingCallsCount = 0
open var isUserStatusSupportedCallsCount: Int {
get { isUserStatusSupportedCallsCountLock.withLock { isUserStatusSupportedUnderlyingCallsCount } }
set { isUserStatusSupportedCallsCountLock.withLock { isUserStatusSupportedUnderlyingCallsCount = newValue } }
}
open var isUserStatusSupportedCalled: Bool {
return isUserStatusSupportedCallsCount > 0
}
private let isUserStatusSupportedReturnValueLock = NSLock()
open var isUserStatusSupportedUnderlyingReturnValue: Bool!
open var isUserStatusSupportedReturnValue: Bool! {
get { isUserStatusSupportedReturnValueLock.withLock { isUserStatusSupportedUnderlyingReturnValue } }
set { isUserStatusSupportedReturnValueLock.withLock { isUserStatusSupportedUnderlyingReturnValue = newValue } }
}
open var isUserStatusSupportedClosure: (() async throws -> Bool)?
open override func isUserStatusSupported() async throws -> Bool {
if let error = isUserStatusSupportedThrowableError {
throw error
}
isUserStatusSupportedCallsCountLock.withLock { isUserStatusSupportedUnderlyingCallsCount += 1 }
if let isUserStatusSupportedClosure = isUserStatusSupportedClosure {
return try await isUserStatusSupportedClosure()
} else {
return isUserStatusSupportedReturnValue
}
}
//MARK: - joinRoomById
open var joinRoomByIdRoomIdThrowableError: Error?
private let joinRoomByIdRoomIdCallsCountLock = NSLock()
private var joinRoomByIdRoomIdUnderlyingCallsCount = 0
open var joinRoomByIdRoomIdCallsCount: Int {
get { joinRoomByIdRoomIdCallsCountLock.withLock { joinRoomByIdRoomIdUnderlyingCallsCount } }
set { joinRoomByIdRoomIdCallsCountLock.withLock { joinRoomByIdRoomIdUnderlyingCallsCount = newValue } }
}
open var joinRoomByIdRoomIdCalled: Bool {
return joinRoomByIdRoomIdCallsCount > 0
}
private let joinRoomByIdRoomIdReceivedRoomIdLock = NSLock()
private var joinRoomByIdRoomIdUnderlyingReceivedRoomId: String?
open var joinRoomByIdRoomIdReceivedRoomId: String? {
get { joinRoomByIdRoomIdReceivedRoomIdLock.withLock { joinRoomByIdRoomIdUnderlyingReceivedRoomId } }
set { joinRoomByIdRoomIdReceivedRoomIdLock.withLock { joinRoomByIdRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let joinRoomByIdRoomIdReceivedInvocationsLock = NSLock()
private var joinRoomByIdRoomIdUnderlyingReceivedInvocations: [String] = []
open var joinRoomByIdRoomIdReceivedInvocations: [String] {
get { joinRoomByIdRoomIdReceivedInvocationsLock.withLock { joinRoomByIdRoomIdUnderlyingReceivedInvocations } }
set { joinRoomByIdRoomIdReceivedInvocationsLock.withLock { joinRoomByIdRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let joinRoomByIdRoomIdReturnValueLock = NSLock()
open var joinRoomByIdRoomIdUnderlyingReturnValue: Room!
open var joinRoomByIdRoomIdReturnValue: Room! {
get { joinRoomByIdRoomIdReturnValueLock.withLock { joinRoomByIdRoomIdUnderlyingReturnValue } }
set { joinRoomByIdRoomIdReturnValueLock.withLock { joinRoomByIdRoomIdUnderlyingReturnValue = newValue } }
}
open var joinRoomByIdRoomIdClosure: ((String) async throws -> Room)?
open override func joinRoomById(roomId: String) async throws -> Room {
if let error = joinRoomByIdRoomIdThrowableError {
throw error
}
joinRoomByIdRoomIdCallsCountLock.withLock { joinRoomByIdRoomIdUnderlyingCallsCount += 1 }
joinRoomByIdRoomIdReceivedRoomId = roomId
joinRoomByIdRoomIdReceivedInvocationsLock.withLock { joinRoomByIdRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let joinRoomByIdRoomIdClosure = joinRoomByIdRoomIdClosure {
return try await joinRoomByIdRoomIdClosure(roomId)
} else {
return joinRoomByIdRoomIdReturnValue
}
}
//MARK: - joinRoomByIdOrAlias
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesThrowableError: Error?
private let joinRoomByIdOrAliasRoomIdOrAliasServerNamesCallsCountLock = NSLock()
private var joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingCallsCount = 0
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesCallsCount: Int {
get { joinRoomByIdOrAliasRoomIdOrAliasServerNamesCallsCountLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingCallsCount } }
set { joinRoomByIdOrAliasRoomIdOrAliasServerNamesCallsCountLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingCallsCount = newValue } }
}
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesCalled: Bool {
return joinRoomByIdOrAliasRoomIdOrAliasServerNamesCallsCount > 0
}
private let joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedArgumentsLock = NSLock()
private var joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReceivedArguments: (roomIdOrAlias: String, serverNames: [String])?
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedArguments: (roomIdOrAlias: String, serverNames: [String])? {
get { joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedArgumentsLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReceivedArguments } }
set { joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedArgumentsLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReceivedArguments = newValue } }
}
private let joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedInvocationsLock = NSLock()
private var joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReceivedInvocations: [(roomIdOrAlias: String, serverNames: [String])] = []
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedInvocations: [(roomIdOrAlias: String, serverNames: [String])] {
get { joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedInvocationsLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReceivedInvocations } }
set { joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedInvocationsLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReceivedInvocations = newValue } }
}
private let joinRoomByIdOrAliasRoomIdOrAliasServerNamesReturnValueLock = NSLock()
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReturnValue: Room!
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesReturnValue: Room! {
get { joinRoomByIdOrAliasRoomIdOrAliasServerNamesReturnValueLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReturnValue } }
set { joinRoomByIdOrAliasRoomIdOrAliasServerNamesReturnValueLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReturnValue = newValue } }
}
open var joinRoomByIdOrAliasRoomIdOrAliasServerNamesClosure: ((String, [String]) async throws -> Room)?
open override func joinRoomByIdOrAlias(roomIdOrAlias: String, serverNames: [String]) async throws -> Room {
if let error = joinRoomByIdOrAliasRoomIdOrAliasServerNamesThrowableError {
throw error
}
joinRoomByIdOrAliasRoomIdOrAliasServerNamesCallsCountLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingCallsCount += 1 }
joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedArguments = (roomIdOrAlias: roomIdOrAlias, serverNames: serverNames)
joinRoomByIdOrAliasRoomIdOrAliasServerNamesReceivedInvocationsLock.withLock { joinRoomByIdOrAliasRoomIdOrAliasServerNamesUnderlyingReceivedInvocations.append((roomIdOrAlias: roomIdOrAlias, serverNames: serverNames)) }
if let joinRoomByIdOrAliasRoomIdOrAliasServerNamesClosure = joinRoomByIdOrAliasRoomIdOrAliasServerNamesClosure {
return try await joinRoomByIdOrAliasRoomIdOrAliasServerNamesClosure(roomIdOrAlias, serverNames)
} else {
return joinRoomByIdOrAliasRoomIdOrAliasServerNamesReturnValue
}
}
//MARK: - knock
open var knockRoomIdOrAliasReasonServerNamesThrowableError: Error?
private let knockRoomIdOrAliasReasonServerNamesCallsCountLock = NSLock()
private var knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = 0
open var knockRoomIdOrAliasReasonServerNamesCallsCount: Int {
get { knockRoomIdOrAliasReasonServerNamesCallsCountLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount } }
set { knockRoomIdOrAliasReasonServerNamesCallsCountLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = newValue } }
}
open var knockRoomIdOrAliasReasonServerNamesCalled: Bool {
return knockRoomIdOrAliasReasonServerNamesCallsCount > 0
}
private let knockRoomIdOrAliasReasonServerNamesReceivedArgumentsLock = NSLock()
private var knockRoomIdOrAliasReasonServerNamesUnderlyingReceivedArguments: (roomIdOrAlias: String, reason: String?, serverNames: [String])?
open var knockRoomIdOrAliasReasonServerNamesReceivedArguments: (roomIdOrAlias: String, reason: String?, serverNames: [String])? {
get { knockRoomIdOrAliasReasonServerNamesReceivedArgumentsLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingReceivedArguments } }
set { knockRoomIdOrAliasReasonServerNamesReceivedArgumentsLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingReceivedArguments = newValue } }
}
private let knockRoomIdOrAliasReasonServerNamesReceivedInvocationsLock = NSLock()
private var knockRoomIdOrAliasReasonServerNamesUnderlyingReceivedInvocations: [(roomIdOrAlias: String, reason: String?, serverNames: [String])] = []
open var knockRoomIdOrAliasReasonServerNamesReceivedInvocations: [(roomIdOrAlias: String, reason: String?, serverNames: [String])] {
get { knockRoomIdOrAliasReasonServerNamesReceivedInvocationsLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingReceivedInvocations } }
set { knockRoomIdOrAliasReasonServerNamesReceivedInvocationsLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingReceivedInvocations = newValue } }
}
private let knockRoomIdOrAliasReasonServerNamesReturnValueLock = NSLock()
open var knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue: Room!
open var knockRoomIdOrAliasReasonServerNamesReturnValue: Room! {
get { knockRoomIdOrAliasReasonServerNamesReturnValueLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue } }
set { knockRoomIdOrAliasReasonServerNamesReturnValueLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue = newValue } }
}
open var knockRoomIdOrAliasReasonServerNamesClosure: ((String, String?, [String]) async throws -> Room)?
open override func knock(roomIdOrAlias: String, reason: String?, serverNames: [String]) async throws -> Room {
if let error = knockRoomIdOrAliasReasonServerNamesThrowableError {
throw error
}
knockRoomIdOrAliasReasonServerNamesCallsCountLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount += 1 }
knockRoomIdOrAliasReasonServerNamesReceivedArguments = (roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames)
knockRoomIdOrAliasReasonServerNamesReceivedInvocationsLock.withLock { knockRoomIdOrAliasReasonServerNamesUnderlyingReceivedInvocations.append((roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames)) }
if let knockRoomIdOrAliasReasonServerNamesClosure = knockRoomIdOrAliasReasonServerNamesClosure {
return try await knockRoomIdOrAliasReasonServerNamesClosure(roomIdOrAlias, reason, serverNames)
} else {
return knockRoomIdOrAliasReasonServerNamesReturnValue
}
}
//MARK: - login
open var loginUsernamePasswordInitialDeviceNameDeviceIdThrowableError: Error?
private let loginUsernamePasswordInitialDeviceNameDeviceIdCallsCountLock = NSLock()
private var loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingCallsCount = 0
open var loginUsernamePasswordInitialDeviceNameDeviceIdCallsCount: Int {
get { loginUsernamePasswordInitialDeviceNameDeviceIdCallsCountLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingCallsCount } }
set { loginUsernamePasswordInitialDeviceNameDeviceIdCallsCountLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingCallsCount = newValue } }
}
open var loginUsernamePasswordInitialDeviceNameDeviceIdCalled: Bool {
return loginUsernamePasswordInitialDeviceNameDeviceIdCallsCount > 0
}
private let loginUsernamePasswordInitialDeviceNameDeviceIdReceivedArgumentsLock = NSLock()
private var loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingReceivedArguments: (username: String, password: String, initialDeviceName: String?, deviceId: String?)?
open var loginUsernamePasswordInitialDeviceNameDeviceIdReceivedArguments: (username: String, password: String, initialDeviceName: String?, deviceId: String?)? {
get { loginUsernamePasswordInitialDeviceNameDeviceIdReceivedArgumentsLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingReceivedArguments } }
set { loginUsernamePasswordInitialDeviceNameDeviceIdReceivedArgumentsLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingReceivedArguments = newValue } }
}
private let loginUsernamePasswordInitialDeviceNameDeviceIdReceivedInvocationsLock = NSLock()
private var loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations: [(username: String, password: String, initialDeviceName: String?, deviceId: String?)] = []
open var loginUsernamePasswordInitialDeviceNameDeviceIdReceivedInvocations: [(username: String, password: String, initialDeviceName: String?, deviceId: String?)] {
get { loginUsernamePasswordInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations } }
set { loginUsernamePasswordInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations = newValue } }
}
open var loginUsernamePasswordInitialDeviceNameDeviceIdClosure: ((String, String, String?, String?) async throws -> Void)?
open override func login(username: String, password: String, initialDeviceName: String?, deviceId: String?) async throws {
if let error = loginUsernamePasswordInitialDeviceNameDeviceIdThrowableError {
throw error
}
loginUsernamePasswordInitialDeviceNameDeviceIdCallsCountLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingCallsCount += 1 }
loginUsernamePasswordInitialDeviceNameDeviceIdReceivedArguments = (username: username, password: password, initialDeviceName: initialDeviceName, deviceId: deviceId)
loginUsernamePasswordInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { loginUsernamePasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations.append((username: username, password: password, initialDeviceName: initialDeviceName, deviceId: deviceId)) }
try await loginUsernamePasswordInitialDeviceNameDeviceIdClosure?(username, password, initialDeviceName, deviceId)
}
//MARK: - loginWithEmail
open var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdThrowableError: Error?
private let loginWithEmailEmailPasswordInitialDeviceNameDeviceIdCallsCountLock = NSLock()
private var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingCallsCount = 0
open var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdCallsCount: Int {
get { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdCallsCountLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingCallsCount } }
set { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdCallsCountLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingCallsCount = newValue } }
}
open var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdCalled: Bool {
return loginWithEmailEmailPasswordInitialDeviceNameDeviceIdCallsCount > 0
}
private let loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedArgumentsLock = NSLock()
private var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingReceivedArguments: (email: String, password: String, initialDeviceName: String?, deviceId: String?)?
open var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedArguments: (email: String, password: String, initialDeviceName: String?, deviceId: String?)? {
get { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedArgumentsLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingReceivedArguments } }
set { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedArgumentsLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingReceivedArguments = newValue } }
}
private let loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedInvocationsLock = NSLock()
private var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations: [(email: String, password: String, initialDeviceName: String?, deviceId: String?)] = []
open var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedInvocations: [(email: String, password: String, initialDeviceName: String?, deviceId: String?)] {
get { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations } }
set { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations = newValue } }
}
open var loginWithEmailEmailPasswordInitialDeviceNameDeviceIdClosure: ((String, String, String?, String?) async throws -> Void)?
open override func loginWithEmail(email: String, password: String, initialDeviceName: String?, deviceId: String?) async throws {
if let error = loginWithEmailEmailPasswordInitialDeviceNameDeviceIdThrowableError {
throw error
}
loginWithEmailEmailPasswordInitialDeviceNameDeviceIdCallsCountLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingCallsCount += 1 }
loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedArguments = (email: email, password: password, initialDeviceName: initialDeviceName, deviceId: deviceId)
loginWithEmailEmailPasswordInitialDeviceNameDeviceIdReceivedInvocationsLock.withLock { loginWithEmailEmailPasswordInitialDeviceNameDeviceIdUnderlyingReceivedInvocations.append((email: email, password: password, initialDeviceName: initialDeviceName, deviceId: deviceId)) }
try await loginWithEmailEmailPasswordInitialDeviceNameDeviceIdClosure?(email, password, initialDeviceName, deviceId)
}
//MARK: - loginWithOauthCallback
open var loginWithOauthCallbackCallbackUrlThrowableError: Error?
private let loginWithOauthCallbackCallbackUrlCallsCountLock = NSLock()
private var loginWithOauthCallbackCallbackUrlUnderlyingCallsCount = 0
open var loginWithOauthCallbackCallbackUrlCallsCount: Int {
get { loginWithOauthCallbackCallbackUrlCallsCountLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingCallsCount } }
set { loginWithOauthCallbackCallbackUrlCallsCountLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingCallsCount = newValue } }
}
open var loginWithOauthCallbackCallbackUrlCalled: Bool {
return loginWithOauthCallbackCallbackUrlCallsCount > 0
}
private let loginWithOauthCallbackCallbackUrlReceivedCallbackUrlLock = NSLock()
private var loginWithOauthCallbackCallbackUrlUnderlyingReceivedCallbackUrl: String?
open var loginWithOauthCallbackCallbackUrlReceivedCallbackUrl: String? {
get { loginWithOauthCallbackCallbackUrlReceivedCallbackUrlLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingReceivedCallbackUrl } }
set { loginWithOauthCallbackCallbackUrlReceivedCallbackUrlLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingReceivedCallbackUrl = newValue } }
}
private let loginWithOauthCallbackCallbackUrlReceivedInvocationsLock = NSLock()
private var loginWithOauthCallbackCallbackUrlUnderlyingReceivedInvocations: [String] = []
open var loginWithOauthCallbackCallbackUrlReceivedInvocations: [String] {
get { loginWithOauthCallbackCallbackUrlReceivedInvocationsLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingReceivedInvocations } }
set { loginWithOauthCallbackCallbackUrlReceivedInvocationsLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingReceivedInvocations = newValue } }
}
open var loginWithOauthCallbackCallbackUrlClosure: ((String) async throws -> Void)?
open override func loginWithOauthCallback(callbackUrl: String) async throws {
if let error = loginWithOauthCallbackCallbackUrlThrowableError {
throw error
}
loginWithOauthCallbackCallbackUrlCallsCountLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingCallsCount += 1 }
loginWithOauthCallbackCallbackUrlReceivedCallbackUrl = callbackUrl
loginWithOauthCallbackCallbackUrlReceivedInvocationsLock.withLock { loginWithOauthCallbackCallbackUrlUnderlyingReceivedInvocations.append(callbackUrl) }
try await loginWithOauthCallbackCallbackUrlClosure?(callbackUrl)
}
//MARK: - logout
open var logoutThrowableError: Error?
private let logoutCallsCountLock = NSLock()
private var logoutUnderlyingCallsCount = 0
open var logoutCallsCount: Int {
get { logoutCallsCountLock.withLock { logoutUnderlyingCallsCount } }
set { logoutCallsCountLock.withLock { logoutUnderlyingCallsCount = newValue } }
}
open var logoutCalled: Bool {
return logoutCallsCount > 0
}
open var logoutClosure: (() async throws -> Void)?
open override func logout() async throws {
if let error = logoutThrowableError {
throw error
}
logoutCallsCountLock.withLock { logoutUnderlyingCallsCount += 1 }
try await logoutClosure?()
}
//MARK: - markAllRoomsAsRead
open var markAllRoomsAsReadThrowableError: Error?
private let markAllRoomsAsReadCallsCountLock = NSLock()
private var markAllRoomsAsReadUnderlyingCallsCount = 0
open var markAllRoomsAsReadCallsCount: Int {
get { markAllRoomsAsReadCallsCountLock.withLock { markAllRoomsAsReadUnderlyingCallsCount } }
set { markAllRoomsAsReadCallsCountLock.withLock { markAllRoomsAsReadUnderlyingCallsCount = newValue } }
}
open var markAllRoomsAsReadCalled: Bool {
return markAllRoomsAsReadCallsCount > 0
}
open var markAllRoomsAsReadClosure: (() async throws -> Void)?
open override func markAllRoomsAsRead() async throws {
if let error = markAllRoomsAsReadThrowableError {
throw error
}
markAllRoomsAsReadCallsCountLock.withLock { markAllRoomsAsReadUnderlyingCallsCount += 1 }
try await markAllRoomsAsReadClosure?()
}
//MARK: - newGrantLoginWithQrCodeHandler
private let newGrantLoginWithQrCodeHandlerCallsCountLock = NSLock()
private var newGrantLoginWithQrCodeHandlerUnderlyingCallsCount = 0
open var newGrantLoginWithQrCodeHandlerCallsCount: Int {
get { newGrantLoginWithQrCodeHandlerCallsCountLock.withLock { newGrantLoginWithQrCodeHandlerUnderlyingCallsCount } }
set { newGrantLoginWithQrCodeHandlerCallsCountLock.withLock { newGrantLoginWithQrCodeHandlerUnderlyingCallsCount = newValue } }
}
open var newGrantLoginWithQrCodeHandlerCalled: Bool {
return newGrantLoginWithQrCodeHandlerCallsCount > 0
}
private let newGrantLoginWithQrCodeHandlerReturnValueLock = NSLock()
open var newGrantLoginWithQrCodeHandlerUnderlyingReturnValue: GrantLoginWithQrCodeHandler!
open var newGrantLoginWithQrCodeHandlerReturnValue: GrantLoginWithQrCodeHandler! {
get { newGrantLoginWithQrCodeHandlerReturnValueLock.withLock { newGrantLoginWithQrCodeHandlerUnderlyingReturnValue } }
set { newGrantLoginWithQrCodeHandlerReturnValueLock.withLock { newGrantLoginWithQrCodeHandlerUnderlyingReturnValue = newValue } }
}
open var newGrantLoginWithQrCodeHandlerClosure: (() -> GrantLoginWithQrCodeHandler)?
open override func newGrantLoginWithQrCodeHandler() -> GrantLoginWithQrCodeHandler {
newGrantLoginWithQrCodeHandlerCallsCountLock.withLock { newGrantLoginWithQrCodeHandlerUnderlyingCallsCount += 1 }
if let newGrantLoginWithQrCodeHandlerClosure = newGrantLoginWithQrCodeHandlerClosure {
return newGrantLoginWithQrCodeHandlerClosure()
} else {
return newGrantLoginWithQrCodeHandlerReturnValue
}
}
//MARK: - newLoginWithQrCodeHandler
private let newLoginWithQrCodeHandlerOauthConfigurationCallsCountLock = NSLock()
private var newLoginWithQrCodeHandlerOauthConfigurationUnderlyingCallsCount = 0
open var newLoginWithQrCodeHandlerOauthConfigurationCallsCount: Int {
get { newLoginWithQrCodeHandlerOauthConfigurationCallsCountLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingCallsCount } }
set { newLoginWithQrCodeHandlerOauthConfigurationCallsCountLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingCallsCount = newValue } }
}
open var newLoginWithQrCodeHandlerOauthConfigurationCalled: Bool {
return newLoginWithQrCodeHandlerOauthConfigurationCallsCount > 0
}
private let newLoginWithQrCodeHandlerOauthConfigurationReceivedOauthConfigurationLock = NSLock()
private var newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReceivedOauthConfiguration: OAuthConfiguration?
open var newLoginWithQrCodeHandlerOauthConfigurationReceivedOauthConfiguration: OAuthConfiguration? {
get { newLoginWithQrCodeHandlerOauthConfigurationReceivedOauthConfigurationLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReceivedOauthConfiguration } }
set { newLoginWithQrCodeHandlerOauthConfigurationReceivedOauthConfigurationLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReceivedOauthConfiguration = newValue } }
}
private let newLoginWithQrCodeHandlerOauthConfigurationReceivedInvocationsLock = NSLock()
private var newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReceivedInvocations: [OAuthConfiguration] = []
open var newLoginWithQrCodeHandlerOauthConfigurationReceivedInvocations: [OAuthConfiguration] {
get { newLoginWithQrCodeHandlerOauthConfigurationReceivedInvocationsLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReceivedInvocations } }
set { newLoginWithQrCodeHandlerOauthConfigurationReceivedInvocationsLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReceivedInvocations = newValue } }
}
private let newLoginWithQrCodeHandlerOauthConfigurationReturnValueLock = NSLock()
open var newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReturnValue: LoginWithQrCodeHandler!
open var newLoginWithQrCodeHandlerOauthConfigurationReturnValue: LoginWithQrCodeHandler! {
get { newLoginWithQrCodeHandlerOauthConfigurationReturnValueLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReturnValue } }
set { newLoginWithQrCodeHandlerOauthConfigurationReturnValueLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReturnValue = newValue } }
}
open var newLoginWithQrCodeHandlerOauthConfigurationClosure: ((OAuthConfiguration) -> LoginWithQrCodeHandler)?
open override func newLoginWithQrCodeHandler(oauthConfiguration: OAuthConfiguration) -> LoginWithQrCodeHandler {
newLoginWithQrCodeHandlerOauthConfigurationCallsCountLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingCallsCount += 1 }
newLoginWithQrCodeHandlerOauthConfigurationReceivedOauthConfiguration = oauthConfiguration
newLoginWithQrCodeHandlerOauthConfigurationReceivedInvocationsLock.withLock { newLoginWithQrCodeHandlerOauthConfigurationUnderlyingReceivedInvocations.append(oauthConfiguration) }
if let newLoginWithQrCodeHandlerOauthConfigurationClosure = newLoginWithQrCodeHandlerOauthConfigurationClosure {
return newLoginWithQrCodeHandlerOauthConfigurationClosure(oauthConfiguration)
} else {
return newLoginWithQrCodeHandlerOauthConfigurationReturnValue
}
}
//MARK: - notificationClient
open var notificationClientProcessSetupThrowableError: Error?
private let notificationClientProcessSetupCallsCountLock = NSLock()
private var notificationClientProcessSetupUnderlyingCallsCount = 0
open var notificationClientProcessSetupCallsCount: Int {
get { notificationClientProcessSetupCallsCountLock.withLock { notificationClientProcessSetupUnderlyingCallsCount } }
set { notificationClientProcessSetupCallsCountLock.withLock { notificationClientProcessSetupUnderlyingCallsCount = newValue } }
}
open var notificationClientProcessSetupCalled: Bool {
return notificationClientProcessSetupCallsCount > 0
}
private let notificationClientProcessSetupReceivedProcessSetupLock = NSLock()
private var notificationClientProcessSetupUnderlyingReceivedProcessSetup: NotificationProcessSetup?
open var notificationClientProcessSetupReceivedProcessSetup: NotificationProcessSetup? {
get { notificationClientProcessSetupReceivedProcessSetupLock.withLock { notificationClientProcessSetupUnderlyingReceivedProcessSetup } }
set { notificationClientProcessSetupReceivedProcessSetupLock.withLock { notificationClientProcessSetupUnderlyingReceivedProcessSetup = newValue } }
}
private let notificationClientProcessSetupReceivedInvocationsLock = NSLock()
private var notificationClientProcessSetupUnderlyingReceivedInvocations: [NotificationProcessSetup] = []
open var notificationClientProcessSetupReceivedInvocations: [NotificationProcessSetup] {
get { notificationClientProcessSetupReceivedInvocationsLock.withLock { notificationClientProcessSetupUnderlyingReceivedInvocations } }
set { notificationClientProcessSetupReceivedInvocationsLock.withLock { notificationClientProcessSetupUnderlyingReceivedInvocations = newValue } }
}
private let notificationClientProcessSetupReturnValueLock = NSLock()
open var notificationClientProcessSetupUnderlyingReturnValue: NotificationClient!
open var notificationClientProcessSetupReturnValue: NotificationClient! {
get { notificationClientProcessSetupReturnValueLock.withLock { notificationClientProcessSetupUnderlyingReturnValue } }
set { notificationClientProcessSetupReturnValueLock.withLock { notificationClientProcessSetupUnderlyingReturnValue = newValue } }
}
open var notificationClientProcessSetupClosure: ((NotificationProcessSetup) async throws -> NotificationClient)?
open override func notificationClient(processSetup: NotificationProcessSetup) async throws -> NotificationClient {
if let error = notificationClientProcessSetupThrowableError {
throw error
}
notificationClientProcessSetupCallsCountLock.withLock { notificationClientProcessSetupUnderlyingCallsCount += 1 }
notificationClientProcessSetupReceivedProcessSetup = processSetup
notificationClientProcessSetupReceivedInvocationsLock.withLock { notificationClientProcessSetupUnderlyingReceivedInvocations.append(processSetup) }
if let notificationClientProcessSetupClosure = notificationClientProcessSetupClosure {
return try await notificationClientProcessSetupClosure(processSetup)
} else {
return notificationClientProcessSetupReturnValue
}
}
//MARK: - observeAccountDataEvent
private let observeAccountDataEventEventTypeListenerCallsCountLock = NSLock()
private var observeAccountDataEventEventTypeListenerUnderlyingCallsCount = 0
open var observeAccountDataEventEventTypeListenerCallsCount: Int {
get { observeAccountDataEventEventTypeListenerCallsCountLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingCallsCount } }
set { observeAccountDataEventEventTypeListenerCallsCountLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingCallsCount = newValue } }
}
open var observeAccountDataEventEventTypeListenerCalled: Bool {
return observeAccountDataEventEventTypeListenerCallsCount > 0
}
private let observeAccountDataEventEventTypeListenerReceivedArgumentsLock = NSLock()
private var observeAccountDataEventEventTypeListenerUnderlyingReceivedArguments: (eventType: AccountDataEventType, listener: AccountDataListener)?
open var observeAccountDataEventEventTypeListenerReceivedArguments: (eventType: AccountDataEventType, listener: AccountDataListener)? {
get { observeAccountDataEventEventTypeListenerReceivedArgumentsLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingReceivedArguments } }
set { observeAccountDataEventEventTypeListenerReceivedArgumentsLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingReceivedArguments = newValue } }
}
private let observeAccountDataEventEventTypeListenerReceivedInvocationsLock = NSLock()
private var observeAccountDataEventEventTypeListenerUnderlyingReceivedInvocations: [(eventType: AccountDataEventType, listener: AccountDataListener)] = []
open var observeAccountDataEventEventTypeListenerReceivedInvocations: [(eventType: AccountDataEventType, listener: AccountDataListener)] {
get { observeAccountDataEventEventTypeListenerReceivedInvocationsLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingReceivedInvocations } }
set { observeAccountDataEventEventTypeListenerReceivedInvocationsLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingReceivedInvocations = newValue } }
}
private let observeAccountDataEventEventTypeListenerReturnValueLock = NSLock()
open var observeAccountDataEventEventTypeListenerUnderlyingReturnValue: TaskHandle!
open var observeAccountDataEventEventTypeListenerReturnValue: TaskHandle! {
get { observeAccountDataEventEventTypeListenerReturnValueLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingReturnValue } }
set { observeAccountDataEventEventTypeListenerReturnValueLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingReturnValue = newValue } }
}
open var observeAccountDataEventEventTypeListenerClosure: ((AccountDataEventType, AccountDataListener) -> TaskHandle)?
open override func observeAccountDataEvent(eventType: AccountDataEventType, listener: AccountDataListener) -> TaskHandle {
observeAccountDataEventEventTypeListenerCallsCountLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingCallsCount += 1 }
observeAccountDataEventEventTypeListenerReceivedArguments = (eventType: eventType, listener: listener)
observeAccountDataEventEventTypeListenerReceivedInvocationsLock.withLock { observeAccountDataEventEventTypeListenerUnderlyingReceivedInvocations.append((eventType: eventType, listener: listener)) }
if let observeAccountDataEventEventTypeListenerClosure = observeAccountDataEventEventTypeListenerClosure {
return observeAccountDataEventEventTypeListenerClosure(eventType, listener)
} else {
return observeAccountDataEventEventTypeListenerReturnValue
}
}
//MARK: - observeRoomAccountDataEvent
open var observeRoomAccountDataEventRoomIdEventTypeListenerThrowableError: Error?
private let observeRoomAccountDataEventRoomIdEventTypeListenerCallsCountLock = NSLock()
private var observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount = 0
open var observeRoomAccountDataEventRoomIdEventTypeListenerCallsCount: Int {
get { observeRoomAccountDataEventRoomIdEventTypeListenerCallsCountLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount } }
set { observeRoomAccountDataEventRoomIdEventTypeListenerCallsCountLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount = newValue } }
}
open var observeRoomAccountDataEventRoomIdEventTypeListenerCalled: Bool {
return observeRoomAccountDataEventRoomIdEventTypeListenerCallsCount > 0
}
private let observeRoomAccountDataEventRoomIdEventTypeListenerReceivedArgumentsLock = NSLock()
private var observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReceivedArguments: (roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener)?
open var observeRoomAccountDataEventRoomIdEventTypeListenerReceivedArguments: (roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener)? {
get { observeRoomAccountDataEventRoomIdEventTypeListenerReceivedArgumentsLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReceivedArguments } }
set { observeRoomAccountDataEventRoomIdEventTypeListenerReceivedArgumentsLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReceivedArguments = newValue } }
}
private let observeRoomAccountDataEventRoomIdEventTypeListenerReceivedInvocationsLock = NSLock()
private var observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReceivedInvocations: [(roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener)] = []
open var observeRoomAccountDataEventRoomIdEventTypeListenerReceivedInvocations: [(roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener)] {
get { observeRoomAccountDataEventRoomIdEventTypeListenerReceivedInvocationsLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReceivedInvocations } }
set { observeRoomAccountDataEventRoomIdEventTypeListenerReceivedInvocationsLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReceivedInvocations = newValue } }
}
private let observeRoomAccountDataEventRoomIdEventTypeListenerReturnValueLock = NSLock()
open var observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue: TaskHandle!
open var observeRoomAccountDataEventRoomIdEventTypeListenerReturnValue: TaskHandle! {
get { observeRoomAccountDataEventRoomIdEventTypeListenerReturnValueLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue } }
set { observeRoomAccountDataEventRoomIdEventTypeListenerReturnValueLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReturnValue = newValue } }
}
open var observeRoomAccountDataEventRoomIdEventTypeListenerClosure: ((String, RoomAccountDataEventType, RoomAccountDataListener) throws -> TaskHandle)?
open override func observeRoomAccountDataEvent(roomId: String, eventType: RoomAccountDataEventType, listener: RoomAccountDataListener) throws -> TaskHandle {
if let error = observeRoomAccountDataEventRoomIdEventTypeListenerThrowableError {
throw error
}
observeRoomAccountDataEventRoomIdEventTypeListenerCallsCountLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingCallsCount += 1 }
observeRoomAccountDataEventRoomIdEventTypeListenerReceivedArguments = (roomId: roomId, eventType: eventType, listener: listener)
observeRoomAccountDataEventRoomIdEventTypeListenerReceivedInvocationsLock.withLock { observeRoomAccountDataEventRoomIdEventTypeListenerUnderlyingReceivedInvocations.append((roomId: roomId, eventType: eventType, listener: listener)) }
if let observeRoomAccountDataEventRoomIdEventTypeListenerClosure = observeRoomAccountDataEventRoomIdEventTypeListenerClosure {
return try observeRoomAccountDataEventRoomIdEventTypeListenerClosure(roomId, eventType, listener)
} else {
return observeRoomAccountDataEventRoomIdEventTypeListenerReturnValue
}
}
//MARK: - optimizeStores
open var optimizeStoresThrowableError: Error?
private let optimizeStoresCallsCountLock = NSLock()
private var optimizeStoresUnderlyingCallsCount = 0
open var optimizeStoresCallsCount: Int {
get { optimizeStoresCallsCountLock.withLock { optimizeStoresUnderlyingCallsCount } }
set { optimizeStoresCallsCountLock.withLock { optimizeStoresUnderlyingCallsCount = newValue } }
}
open var optimizeStoresCalled: Bool {
return optimizeStoresCallsCount > 0
}
open var optimizeStoresClosure: (() async throws -> Void)?
open override func optimizeStores() async throws {
if let error = optimizeStoresThrowableError {
throw error
}
optimizeStoresCallsCountLock.withLock { optimizeStoresUnderlyingCallsCount += 1 }
try await optimizeStoresClosure?()
}
//MARK: - pause
open var pauseThrowableError: Error?
private let pauseCallsCountLock = NSLock()
private var pauseUnderlyingCallsCount = 0
open var pauseCallsCount: Int {
get { pauseCallsCountLock.withLock { pauseUnderlyingCallsCount } }
set { pauseCallsCountLock.withLock { pauseUnderlyingCallsCount = newValue } }
}
open var pauseCalled: Bool {
return pauseCallsCount > 0
}
open var pauseClosure: (() async throws -> Void)?
open override func pause() async throws {
if let error = pauseThrowableError {
throw error
}
pauseCallsCountLock.withLock { pauseUnderlyingCallsCount += 1 }
try await pauseClosure?()
}
//MARK: - registerNotificationHandler
private let registerNotificationHandlerListenerCallsCountLock = NSLock()
private var registerNotificationHandlerListenerUnderlyingCallsCount = 0
open var registerNotificationHandlerListenerCallsCount: Int {
get { registerNotificationHandlerListenerCallsCountLock.withLock { registerNotificationHandlerListenerUnderlyingCallsCount } }
set { registerNotificationHandlerListenerCallsCountLock.withLock { registerNotificationHandlerListenerUnderlyingCallsCount = newValue } }
}
open var registerNotificationHandlerListenerCalled: Bool {
return registerNotificationHandlerListenerCallsCount > 0
}
private let registerNotificationHandlerListenerReceivedListenerLock = NSLock()
private var registerNotificationHandlerListenerUnderlyingReceivedListener: SyncNotificationListener?
open var registerNotificationHandlerListenerReceivedListener: SyncNotificationListener? {
get { registerNotificationHandlerListenerReceivedListenerLock.withLock { registerNotificationHandlerListenerUnderlyingReceivedListener } }
set { registerNotificationHandlerListenerReceivedListenerLock.withLock { registerNotificationHandlerListenerUnderlyingReceivedListener = newValue } }
}
private let registerNotificationHandlerListenerReceivedInvocationsLock = NSLock()
private var registerNotificationHandlerListenerUnderlyingReceivedInvocations: [SyncNotificationListener] = []
open var registerNotificationHandlerListenerReceivedInvocations: [SyncNotificationListener] {
get { registerNotificationHandlerListenerReceivedInvocationsLock.withLock { registerNotificationHandlerListenerUnderlyingReceivedInvocations } }
set { registerNotificationHandlerListenerReceivedInvocationsLock.withLock { registerNotificationHandlerListenerUnderlyingReceivedInvocations = newValue } }
}
open var registerNotificationHandlerListenerClosure: ((SyncNotificationListener) async -> Void)?
open override func registerNotificationHandler(listener: SyncNotificationListener) async {
registerNotificationHandlerListenerCallsCountLock.withLock { registerNotificationHandlerListenerUnderlyingCallsCount += 1 }
registerNotificationHandlerListenerReceivedListener = listener
registerNotificationHandlerListenerReceivedInvocationsLock.withLock { registerNotificationHandlerListenerUnderlyingReceivedInvocations.append(listener) }
await registerNotificationHandlerListenerClosure?(listener)
}
//MARK: - removeAvatar
open var removeAvatarThrowableError: Error?
private let removeAvatarCallsCountLock = NSLock()
private var removeAvatarUnderlyingCallsCount = 0
open var removeAvatarCallsCount: Int {
get { removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount } }
set { removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount = newValue } }
}
open var removeAvatarCalled: Bool {
return removeAvatarCallsCount > 0
}
open var removeAvatarClosure: (() async throws -> Void)?
open override func removeAvatar() async throws {
if let error = removeAvatarThrowableError {
throw error
}
removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount += 1 }
try await removeAvatarClosure?()
}
//MARK: - requestOpenidToken
open var requestOpenidTokenThrowableError: Error?
private let requestOpenidTokenCallsCountLock = NSLock()
private var requestOpenidTokenUnderlyingCallsCount = 0
open var requestOpenidTokenCallsCount: Int {
get { requestOpenidTokenCallsCountLock.withLock { requestOpenidTokenUnderlyingCallsCount } }
set { requestOpenidTokenCallsCountLock.withLock { requestOpenidTokenUnderlyingCallsCount = newValue } }
}
open var requestOpenidTokenCalled: Bool {
return requestOpenidTokenCallsCount > 0
}
private let requestOpenidTokenReturnValueLock = NSLock()
open var requestOpenidTokenUnderlyingReturnValue: OpenIdToken!
open var requestOpenidTokenReturnValue: OpenIdToken! {
get { requestOpenidTokenReturnValueLock.withLock { requestOpenidTokenUnderlyingReturnValue } }
set { requestOpenidTokenReturnValueLock.withLock { requestOpenidTokenUnderlyingReturnValue = newValue } }
}
open var requestOpenidTokenClosure: (() async throws -> OpenIdToken)?
open override func requestOpenidToken() async throws -> OpenIdToken {
if let error = requestOpenidTokenThrowableError {
throw error
}
requestOpenidTokenCallsCountLock.withLock { requestOpenidTokenUnderlyingCallsCount += 1 }
if let requestOpenidTokenClosure = requestOpenidTokenClosure {
return try await requestOpenidTokenClosure()
} else {
return requestOpenidTokenReturnValue
}
}
//MARK: - resetSupportedVersions
open var resetSupportedVersionsThrowableError: Error?
private let resetSupportedVersionsCallsCountLock = NSLock()
private var resetSupportedVersionsUnderlyingCallsCount = 0
open var resetSupportedVersionsCallsCount: Int {
get { resetSupportedVersionsCallsCountLock.withLock { resetSupportedVersionsUnderlyingCallsCount } }
set { resetSupportedVersionsCallsCountLock.withLock { resetSupportedVersionsUnderlyingCallsCount = newValue } }
}
open var resetSupportedVersionsCalled: Bool {
return resetSupportedVersionsCallsCount > 0
}
open var resetSupportedVersionsClosure: (() async throws -> Void)?
open override func resetSupportedVersions() async throws {
if let error = resetSupportedVersionsThrowableError {
throw error
}
resetSupportedVersionsCallsCountLock.withLock { resetSupportedVersionsUnderlyingCallsCount += 1 }
try await resetSupportedVersionsClosure?()
}
//MARK: - resetWellKnown
open var resetWellKnownThrowableError: Error?
private let resetWellKnownCallsCountLock = NSLock()
private var resetWellKnownUnderlyingCallsCount = 0
open var resetWellKnownCallsCount: Int {
get { resetWellKnownCallsCountLock.withLock { resetWellKnownUnderlyingCallsCount } }
set { resetWellKnownCallsCountLock.withLock { resetWellKnownUnderlyingCallsCount = newValue } }
}
open var resetWellKnownCalled: Bool {
return resetWellKnownCallsCount > 0
}
open var resetWellKnownClosure: (() async throws -> Void)?
open override func resetWellKnown() async throws {
if let error = resetWellKnownThrowableError {
throw error
}
resetWellKnownCallsCountLock.withLock { resetWellKnownUnderlyingCallsCount += 1 }
try await resetWellKnownClosure?()
}
//MARK: - resolveRoomAlias
open var resolveRoomAliasRoomAliasThrowableError: Error?
private let resolveRoomAliasRoomAliasCallsCountLock = NSLock()
private var resolveRoomAliasRoomAliasUnderlyingCallsCount = 0
open var resolveRoomAliasRoomAliasCallsCount: Int {
get { resolveRoomAliasRoomAliasCallsCountLock.withLock { resolveRoomAliasRoomAliasUnderlyingCallsCount } }
set { resolveRoomAliasRoomAliasCallsCountLock.withLock { resolveRoomAliasRoomAliasUnderlyingCallsCount = newValue } }
}
open var resolveRoomAliasRoomAliasCalled: Bool {
return resolveRoomAliasRoomAliasCallsCount > 0
}
private let resolveRoomAliasRoomAliasReceivedRoomAliasLock = NSLock()
private var resolveRoomAliasRoomAliasUnderlyingReceivedRoomAlias: String?
open var resolveRoomAliasRoomAliasReceivedRoomAlias: String? {
get { resolveRoomAliasRoomAliasReceivedRoomAliasLock.withLock { resolveRoomAliasRoomAliasUnderlyingReceivedRoomAlias } }
set { resolveRoomAliasRoomAliasReceivedRoomAliasLock.withLock { resolveRoomAliasRoomAliasUnderlyingReceivedRoomAlias = newValue } }
}
private let resolveRoomAliasRoomAliasReceivedInvocationsLock = NSLock()
private var resolveRoomAliasRoomAliasUnderlyingReceivedInvocations: [String] = []
open var resolveRoomAliasRoomAliasReceivedInvocations: [String] {
get { resolveRoomAliasRoomAliasReceivedInvocationsLock.withLock { resolveRoomAliasRoomAliasUnderlyingReceivedInvocations } }
set { resolveRoomAliasRoomAliasReceivedInvocationsLock.withLock { resolveRoomAliasRoomAliasUnderlyingReceivedInvocations = newValue } }
}
private let resolveRoomAliasRoomAliasReturnValueLock = NSLock()
open var resolveRoomAliasRoomAliasUnderlyingReturnValue: ResolvedRoomAlias?
open var resolveRoomAliasRoomAliasReturnValue: ResolvedRoomAlias? {
get { resolveRoomAliasRoomAliasReturnValueLock.withLock { resolveRoomAliasRoomAliasUnderlyingReturnValue } }
set { resolveRoomAliasRoomAliasReturnValueLock.withLock { resolveRoomAliasRoomAliasUnderlyingReturnValue = newValue } }
}
open var resolveRoomAliasRoomAliasClosure: ((String) async throws -> ResolvedRoomAlias?)?
open override func resolveRoomAlias(roomAlias: String) async throws -> ResolvedRoomAlias? {
if let error = resolveRoomAliasRoomAliasThrowableError {
throw error
}
resolveRoomAliasRoomAliasCallsCountLock.withLock { resolveRoomAliasRoomAliasUnderlyingCallsCount += 1 }
resolveRoomAliasRoomAliasReceivedRoomAlias = roomAlias
resolveRoomAliasRoomAliasReceivedInvocationsLock.withLock { resolveRoomAliasRoomAliasUnderlyingReceivedInvocations.append(roomAlias) }
if let resolveRoomAliasRoomAliasClosure = resolveRoomAliasRoomAliasClosure {
return try await resolveRoomAliasRoomAliasClosure(roomAlias)
} else {
return resolveRoomAliasRoomAliasReturnValue
}
}
//MARK: - restoreSession
open var restoreSessionSessionThrowableError: Error?
private let restoreSessionSessionCallsCountLock = NSLock()
private var restoreSessionSessionUnderlyingCallsCount = 0
open var restoreSessionSessionCallsCount: Int {
get { restoreSessionSessionCallsCountLock.withLock { restoreSessionSessionUnderlyingCallsCount } }
set { restoreSessionSessionCallsCountLock.withLock { restoreSessionSessionUnderlyingCallsCount = newValue } }
}
open var restoreSessionSessionCalled: Bool {
return restoreSessionSessionCallsCount > 0
}
private let restoreSessionSessionReceivedSessionLock = NSLock()
private var restoreSessionSessionUnderlyingReceivedSession: Session?
open var restoreSessionSessionReceivedSession: Session? {
get { restoreSessionSessionReceivedSessionLock.withLock { restoreSessionSessionUnderlyingReceivedSession } }
set { restoreSessionSessionReceivedSessionLock.withLock { restoreSessionSessionUnderlyingReceivedSession = newValue } }
}
private let restoreSessionSessionReceivedInvocationsLock = NSLock()
private var restoreSessionSessionUnderlyingReceivedInvocations: [Session] = []
open var restoreSessionSessionReceivedInvocations: [Session] {
get { restoreSessionSessionReceivedInvocationsLock.withLock { restoreSessionSessionUnderlyingReceivedInvocations } }
set { restoreSessionSessionReceivedInvocationsLock.withLock { restoreSessionSessionUnderlyingReceivedInvocations = newValue } }
}
open var restoreSessionSessionClosure: ((Session) async throws -> Void)?
open override func restoreSession(session: Session) async throws {
if let error = restoreSessionSessionThrowableError {
throw error
}
restoreSessionSessionCallsCountLock.withLock { restoreSessionSessionUnderlyingCallsCount += 1 }
restoreSessionSessionReceivedSession = session
restoreSessionSessionReceivedInvocationsLock.withLock { restoreSessionSessionUnderlyingReceivedInvocations.append(session) }
try await restoreSessionSessionClosure?(session)
}
//MARK: - restoreSessionWith
open var restoreSessionWithSessionRoomLoadSettingsThrowableError: Error?
private let restoreSessionWithSessionRoomLoadSettingsCallsCountLock = NSLock()
private var restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount = 0
open var restoreSessionWithSessionRoomLoadSettingsCallsCount: Int {
get { restoreSessionWithSessionRoomLoadSettingsCallsCountLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount } }
set { restoreSessionWithSessionRoomLoadSettingsCallsCountLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount = newValue } }
}
open var restoreSessionWithSessionRoomLoadSettingsCalled: Bool {
return restoreSessionWithSessionRoomLoadSettingsCallsCount > 0
}
private let restoreSessionWithSessionRoomLoadSettingsReceivedArgumentsLock = NSLock()
private var restoreSessionWithSessionRoomLoadSettingsUnderlyingReceivedArguments: (session: Session, roomLoadSettings: RoomLoadSettings)?
open var restoreSessionWithSessionRoomLoadSettingsReceivedArguments: (session: Session, roomLoadSettings: RoomLoadSettings)? {
get { restoreSessionWithSessionRoomLoadSettingsReceivedArgumentsLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingReceivedArguments } }
set { restoreSessionWithSessionRoomLoadSettingsReceivedArgumentsLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingReceivedArguments = newValue } }
}
private let restoreSessionWithSessionRoomLoadSettingsReceivedInvocationsLock = NSLock()
private var restoreSessionWithSessionRoomLoadSettingsUnderlyingReceivedInvocations: [(session: Session, roomLoadSettings: RoomLoadSettings)] = []
open var restoreSessionWithSessionRoomLoadSettingsReceivedInvocations: [(session: Session, roomLoadSettings: RoomLoadSettings)] {
get { restoreSessionWithSessionRoomLoadSettingsReceivedInvocationsLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingReceivedInvocations } }
set { restoreSessionWithSessionRoomLoadSettingsReceivedInvocationsLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingReceivedInvocations = newValue } }
}
open var restoreSessionWithSessionRoomLoadSettingsClosure: ((Session, RoomLoadSettings) async throws -> Void)?
open override func restoreSessionWith(session: Session, roomLoadSettings: RoomLoadSettings) async throws {
if let error = restoreSessionWithSessionRoomLoadSettingsThrowableError {
throw error
}
restoreSessionWithSessionRoomLoadSettingsCallsCountLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingCallsCount += 1 }
restoreSessionWithSessionRoomLoadSettingsReceivedArguments = (session: session, roomLoadSettings: roomLoadSettings)
restoreSessionWithSessionRoomLoadSettingsReceivedInvocationsLock.withLock { restoreSessionWithSessionRoomLoadSettingsUnderlyingReceivedInvocations.append((session: session, roomLoadSettings: roomLoadSettings)) }
try await restoreSessionWithSessionRoomLoadSettingsClosure?(session, roomLoadSettings)
}
//MARK: - resume
open var resumeThrowableError: Error?
private let resumeCallsCountLock = NSLock()
private var resumeUnderlyingCallsCount = 0
open var resumeCallsCount: Int {
get { resumeCallsCountLock.withLock { resumeUnderlyingCallsCount } }
set { resumeCallsCountLock.withLock { resumeUnderlyingCallsCount = newValue } }
}
open var resumeCalled: Bool {
return resumeCallsCount > 0
}
open var resumeClosure: (() async throws -> Void)?
open override func resume() async throws {
if let error = resumeThrowableError {
throw error
}
resumeCallsCountLock.withLock { resumeUnderlyingCallsCount += 1 }
try await resumeClosure?()
}
//MARK: - roomAliasExists
open var roomAliasExistsRoomAliasThrowableError: Error?
private let roomAliasExistsRoomAliasCallsCountLock = NSLock()
private var roomAliasExistsRoomAliasUnderlyingCallsCount = 0
open var roomAliasExistsRoomAliasCallsCount: Int {
get { roomAliasExistsRoomAliasCallsCountLock.withLock { roomAliasExistsRoomAliasUnderlyingCallsCount } }
set { roomAliasExistsRoomAliasCallsCountLock.withLock { roomAliasExistsRoomAliasUnderlyingCallsCount = newValue } }
}
open var roomAliasExistsRoomAliasCalled: Bool {
return roomAliasExistsRoomAliasCallsCount > 0
}
private let roomAliasExistsRoomAliasReceivedRoomAliasLock = NSLock()
private var roomAliasExistsRoomAliasUnderlyingReceivedRoomAlias: String?
open var roomAliasExistsRoomAliasReceivedRoomAlias: String? {
get { roomAliasExistsRoomAliasReceivedRoomAliasLock.withLock { roomAliasExistsRoomAliasUnderlyingReceivedRoomAlias } }
set { roomAliasExistsRoomAliasReceivedRoomAliasLock.withLock { roomAliasExistsRoomAliasUnderlyingReceivedRoomAlias = newValue } }
}
private let roomAliasExistsRoomAliasReceivedInvocationsLock = NSLock()
private var roomAliasExistsRoomAliasUnderlyingReceivedInvocations: [String] = []
open var roomAliasExistsRoomAliasReceivedInvocations: [String] {
get { roomAliasExistsRoomAliasReceivedInvocationsLock.withLock { roomAliasExistsRoomAliasUnderlyingReceivedInvocations } }
set { roomAliasExistsRoomAliasReceivedInvocationsLock.withLock { roomAliasExistsRoomAliasUnderlyingReceivedInvocations = newValue } }
}
private let roomAliasExistsRoomAliasReturnValueLock = NSLock()
open var roomAliasExistsRoomAliasUnderlyingReturnValue: Bool!
open var roomAliasExistsRoomAliasReturnValue: Bool! {
get { roomAliasExistsRoomAliasReturnValueLock.withLock { roomAliasExistsRoomAliasUnderlyingReturnValue } }
set { roomAliasExistsRoomAliasReturnValueLock.withLock { roomAliasExistsRoomAliasUnderlyingReturnValue = newValue } }
}
open var roomAliasExistsRoomAliasClosure: ((String) async throws -> Bool)?
open override func roomAliasExists(roomAlias: String) async throws -> Bool {
if let error = roomAliasExistsRoomAliasThrowableError {
throw error
}
roomAliasExistsRoomAliasCallsCountLock.withLock { roomAliasExistsRoomAliasUnderlyingCallsCount += 1 }
roomAliasExistsRoomAliasReceivedRoomAlias = roomAlias
roomAliasExistsRoomAliasReceivedInvocationsLock.withLock { roomAliasExistsRoomAliasUnderlyingReceivedInvocations.append(roomAlias) }
if let roomAliasExistsRoomAliasClosure = roomAliasExistsRoomAliasClosure {
return try await roomAliasExistsRoomAliasClosure(roomAlias)
} else {
return roomAliasExistsRoomAliasReturnValue
}
}
//MARK: - roomDirectorySearch
private let roomDirectorySearchCallsCountLock = NSLock()
private var roomDirectorySearchUnderlyingCallsCount = 0
open var roomDirectorySearchCallsCount: Int {
get { roomDirectorySearchCallsCountLock.withLock { roomDirectorySearchUnderlyingCallsCount } }
set { roomDirectorySearchCallsCountLock.withLock { roomDirectorySearchUnderlyingCallsCount = newValue } }
}
open var roomDirectorySearchCalled: Bool {
return roomDirectorySearchCallsCount > 0
}
private let roomDirectorySearchReturnValueLock = NSLock()
open var roomDirectorySearchUnderlyingReturnValue: RoomDirectorySearch!
open var roomDirectorySearchReturnValue: RoomDirectorySearch! {
get { roomDirectorySearchReturnValueLock.withLock { roomDirectorySearchUnderlyingReturnValue } }
set { roomDirectorySearchReturnValueLock.withLock { roomDirectorySearchUnderlyingReturnValue = newValue } }
}
open var roomDirectorySearchClosure: (() -> RoomDirectorySearch)?
open override func roomDirectorySearch() -> RoomDirectorySearch {
roomDirectorySearchCallsCountLock.withLock { roomDirectorySearchUnderlyingCallsCount += 1 }
if let roomDirectorySearchClosure = roomDirectorySearchClosure {
return roomDirectorySearchClosure()
} else {
return roomDirectorySearchReturnValue
}
}
//MARK: - rooms
private let roomsCallsCountLock = NSLock()
private var roomsUnderlyingCallsCount = 0
open var roomsCallsCount: Int {
get { roomsCallsCountLock.withLock { roomsUnderlyingCallsCount } }
set { roomsCallsCountLock.withLock { roomsUnderlyingCallsCount = newValue } }
}
open var roomsCalled: Bool {
return roomsCallsCount > 0
}
private let roomsReturnValueLock = NSLock()
open var roomsUnderlyingReturnValue: [Room]!
open var roomsReturnValue: [Room]! {
get { roomsReturnValueLock.withLock { roomsUnderlyingReturnValue } }
set { roomsReturnValueLock.withLock { roomsUnderlyingReturnValue = newValue } }
}
open var roomsClosure: (() -> [Room])?
open override func rooms() -> [Room] {
roomsCallsCountLock.withLock { roomsUnderlyingCallsCount += 1 }
if let roomsClosure = roomsClosure {
return roomsClosure()
} else {
return roomsReturnValue
}
}
//MARK: - searchUsers
open var searchUsersSearchTermLimitThrowableError: Error?
private let searchUsersSearchTermLimitCallsCountLock = NSLock()
private var searchUsersSearchTermLimitUnderlyingCallsCount = 0
open var searchUsersSearchTermLimitCallsCount: Int {
get { searchUsersSearchTermLimitCallsCountLock.withLock { searchUsersSearchTermLimitUnderlyingCallsCount } }
set { searchUsersSearchTermLimitCallsCountLock.withLock { searchUsersSearchTermLimitUnderlyingCallsCount = newValue } }
}
open var searchUsersSearchTermLimitCalled: Bool {
return searchUsersSearchTermLimitCallsCount > 0
}
private let searchUsersSearchTermLimitReceivedArgumentsLock = NSLock()
private var searchUsersSearchTermLimitUnderlyingReceivedArguments: (searchTerm: String, limit: UInt64)?
open var searchUsersSearchTermLimitReceivedArguments: (searchTerm: String, limit: UInt64)? {
get { searchUsersSearchTermLimitReceivedArgumentsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedArguments } }
set { searchUsersSearchTermLimitReceivedArgumentsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedArguments = newValue } }
}
private let searchUsersSearchTermLimitReceivedInvocationsLock = NSLock()
private var searchUsersSearchTermLimitUnderlyingReceivedInvocations: [(searchTerm: String, limit: UInt64)] = []
open var searchUsersSearchTermLimitReceivedInvocations: [(searchTerm: String, limit: UInt64)] {
get { searchUsersSearchTermLimitReceivedInvocationsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedInvocations } }
set { searchUsersSearchTermLimitReceivedInvocationsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedInvocations = newValue } }
}
private let searchUsersSearchTermLimitReturnValueLock = NSLock()
open var searchUsersSearchTermLimitUnderlyingReturnValue: SearchUsersResults!
open var searchUsersSearchTermLimitReturnValue: SearchUsersResults! {
get { searchUsersSearchTermLimitReturnValueLock.withLock { searchUsersSearchTermLimitUnderlyingReturnValue } }
set { searchUsersSearchTermLimitReturnValueLock.withLock { searchUsersSearchTermLimitUnderlyingReturnValue = newValue } }
}
open var searchUsersSearchTermLimitClosure: ((String, UInt64) async throws -> SearchUsersResults)?
open override func searchUsers(searchTerm: String, limit: UInt64) async throws -> SearchUsersResults {
if let error = searchUsersSearchTermLimitThrowableError {
throw error
}
searchUsersSearchTermLimitCallsCountLock.withLock { searchUsersSearchTermLimitUnderlyingCallsCount += 1 }
searchUsersSearchTermLimitReceivedArguments = (searchTerm: searchTerm, limit: limit)
searchUsersSearchTermLimitReceivedInvocationsLock.withLock { searchUsersSearchTermLimitUnderlyingReceivedInvocations.append((searchTerm: searchTerm, limit: limit)) }
if let searchUsersSearchTermLimitClosure = searchUsersSearchTermLimitClosure {
return try await searchUsersSearchTermLimitClosure(searchTerm, limit)
} else {
return searchUsersSearchTermLimitReturnValue
}
}
//MARK: - server
private let serverCallsCountLock = NSLock()
private var serverUnderlyingCallsCount = 0
open var serverCallsCount: Int {
get { serverCallsCountLock.withLock { serverUnderlyingCallsCount } }
set { serverCallsCountLock.withLock { serverUnderlyingCallsCount = newValue } }
}
open var serverCalled: Bool {
return serverCallsCount > 0
}
private let serverReturnValueLock = NSLock()
open var serverUnderlyingReturnValue: String?
open var serverReturnValue: String? {
get { serverReturnValueLock.withLock { serverUnderlyingReturnValue } }
set { serverReturnValueLock.withLock { serverUnderlyingReturnValue = newValue } }
}
open var serverClosure: (() -> String?)?
open override func server() -> String? {
serverCallsCountLock.withLock { serverUnderlyingCallsCount += 1 }
if let serverClosure = serverClosure {
return serverClosure()
} else {
return serverReturnValue
}
}
//MARK: - serverVendorInfo
open var serverVendorInfoThrowableError: Error?
private let serverVendorInfoCallsCountLock = NSLock()
private var serverVendorInfoUnderlyingCallsCount = 0
open var serverVendorInfoCallsCount: Int {
get { serverVendorInfoCallsCountLock.withLock { serverVendorInfoUnderlyingCallsCount } }
set { serverVendorInfoCallsCountLock.withLock { serverVendorInfoUnderlyingCallsCount = newValue } }
}
open var serverVendorInfoCalled: Bool {
return serverVendorInfoCallsCount > 0
}
private let serverVendorInfoReturnValueLock = NSLock()
open var serverVendorInfoUnderlyingReturnValue: ServerVendorInfo!
open var serverVendorInfoReturnValue: ServerVendorInfo! {
get { serverVendorInfoReturnValueLock.withLock { serverVendorInfoUnderlyingReturnValue } }
set { serverVendorInfoReturnValueLock.withLock { serverVendorInfoUnderlyingReturnValue = newValue } }
}
open var serverVendorInfoClosure: (() async throws -> ServerVendorInfo)?
open override func serverVendorInfo() async throws -> ServerVendorInfo {
if let error = serverVendorInfoThrowableError {
throw error
}
serverVendorInfoCallsCountLock.withLock { serverVendorInfoUnderlyingCallsCount += 1 }
if let serverVendorInfoClosure = serverVendorInfoClosure {
return try await serverVendorInfoClosure()
} else {
return serverVendorInfoReturnValue
}
}
//MARK: - session
open var sessionThrowableError: Error?
private let sessionCallsCountLock = NSLock()
private var sessionUnderlyingCallsCount = 0
open var sessionCallsCount: Int {
get { sessionCallsCountLock.withLock { sessionUnderlyingCallsCount } }
set { sessionCallsCountLock.withLock { sessionUnderlyingCallsCount = newValue } }
}
open var sessionCalled: Bool {
return sessionCallsCount > 0
}
private let sessionReturnValueLock = NSLock()
open var sessionUnderlyingReturnValue: Session!
open var sessionReturnValue: Session! {
get { sessionReturnValueLock.withLock { sessionUnderlyingReturnValue } }
set { sessionReturnValueLock.withLock { sessionUnderlyingReturnValue = newValue } }
}
open var sessionClosure: (() throws -> Session)?
open override func session() throws -> Session {
if let error = sessionThrowableError {
throw error
}
sessionCallsCountLock.withLock { sessionUnderlyingCallsCount += 1 }
if let sessionClosure = sessionClosure {
return try sessionClosure()
} else {
return sessionReturnValue
}
}
//MARK: - setAccountData
open var setAccountDataEventTypeContentThrowableError: Error?
private let setAccountDataEventTypeContentCallsCountLock = NSLock()
private var setAccountDataEventTypeContentUnderlyingCallsCount = 0
open var setAccountDataEventTypeContentCallsCount: Int {
get { setAccountDataEventTypeContentCallsCountLock.withLock { setAccountDataEventTypeContentUnderlyingCallsCount } }
set { setAccountDataEventTypeContentCallsCountLock.withLock { setAccountDataEventTypeContentUnderlyingCallsCount = newValue } }
}
open var setAccountDataEventTypeContentCalled: Bool {
return setAccountDataEventTypeContentCallsCount > 0
}
private let setAccountDataEventTypeContentReceivedArgumentsLock = NSLock()
private var setAccountDataEventTypeContentUnderlyingReceivedArguments: (eventType: String, content: String)?
open var setAccountDataEventTypeContentReceivedArguments: (eventType: String, content: String)? {
get { setAccountDataEventTypeContentReceivedArgumentsLock.withLock { setAccountDataEventTypeContentUnderlyingReceivedArguments } }
set { setAccountDataEventTypeContentReceivedArgumentsLock.withLock { setAccountDataEventTypeContentUnderlyingReceivedArguments = newValue } }
}
private let setAccountDataEventTypeContentReceivedInvocationsLock = NSLock()
private var setAccountDataEventTypeContentUnderlyingReceivedInvocations: [(eventType: String, content: String)] = []
open var setAccountDataEventTypeContentReceivedInvocations: [(eventType: String, content: String)] {
get { setAccountDataEventTypeContentReceivedInvocationsLock.withLock { setAccountDataEventTypeContentUnderlyingReceivedInvocations } }
set { setAccountDataEventTypeContentReceivedInvocationsLock.withLock { setAccountDataEventTypeContentUnderlyingReceivedInvocations = newValue } }
}
open var setAccountDataEventTypeContentClosure: ((String, String) async throws -> Void)?
open override func setAccountData(eventType: String, content: String) async throws {
if let error = setAccountDataEventTypeContentThrowableError {
throw error
}
setAccountDataEventTypeContentCallsCountLock.withLock { setAccountDataEventTypeContentUnderlyingCallsCount += 1 }
setAccountDataEventTypeContentReceivedArguments = (eventType: eventType, content: content)
setAccountDataEventTypeContentReceivedInvocationsLock.withLock { setAccountDataEventTypeContentUnderlyingReceivedInvocations.append((eventType: eventType, content: content)) }
try await setAccountDataEventTypeContentClosure?(eventType, content)
}
//MARK: - setAvatarUrl
open var setAvatarUrlUrlThrowableError: Error?
private let setAvatarUrlUrlCallsCountLock = NSLock()
private var setAvatarUrlUrlUnderlyingCallsCount = 0
open var setAvatarUrlUrlCallsCount: Int {
get { setAvatarUrlUrlCallsCountLock.withLock { setAvatarUrlUrlUnderlyingCallsCount } }
set { setAvatarUrlUrlCallsCountLock.withLock { setAvatarUrlUrlUnderlyingCallsCount = newValue } }
}
open var setAvatarUrlUrlCalled: Bool {
return setAvatarUrlUrlCallsCount > 0
}
private let setAvatarUrlUrlReceivedUrlLock = NSLock()
private var setAvatarUrlUrlUnderlyingReceivedUrl: String?
open var setAvatarUrlUrlReceivedUrl: String? {
get { setAvatarUrlUrlReceivedUrlLock.withLock { setAvatarUrlUrlUnderlyingReceivedUrl } }
set { setAvatarUrlUrlReceivedUrlLock.withLock { setAvatarUrlUrlUnderlyingReceivedUrl = newValue } }
}
private let setAvatarUrlUrlReceivedInvocationsLock = NSLock()
private var setAvatarUrlUrlUnderlyingReceivedInvocations: [String] = []
open var setAvatarUrlUrlReceivedInvocations: [String] {
get { setAvatarUrlUrlReceivedInvocationsLock.withLock { setAvatarUrlUrlUnderlyingReceivedInvocations } }
set { setAvatarUrlUrlReceivedInvocationsLock.withLock { setAvatarUrlUrlUnderlyingReceivedInvocations = newValue } }
}
open var setAvatarUrlUrlClosure: ((String) async throws -> Void)?
open override func setAvatarUrl(url: String) async throws {
if let error = setAvatarUrlUrlThrowableError {
throw error
}
setAvatarUrlUrlCallsCountLock.withLock { setAvatarUrlUrlUnderlyingCallsCount += 1 }
setAvatarUrlUrlReceivedUrl = url
setAvatarUrlUrlReceivedInvocationsLock.withLock { setAvatarUrlUrlUnderlyingReceivedInvocations.append(url) }
try await setAvatarUrlUrlClosure?(url)
}
//MARK: - setContentScanner
private let setContentScannerContentScannerCallsCountLock = NSLock()
private var setContentScannerContentScannerUnderlyingCallsCount = 0
open var setContentScannerContentScannerCallsCount: Int {
get { setContentScannerContentScannerCallsCountLock.withLock { setContentScannerContentScannerUnderlyingCallsCount } }
set { setContentScannerContentScannerCallsCountLock.withLock { setContentScannerContentScannerUnderlyingCallsCount = newValue } }
}
open var setContentScannerContentScannerCalled: Bool {
return setContentScannerContentScannerCallsCount > 0
}
private let setContentScannerContentScannerReceivedContentScannerLock = NSLock()
private var setContentScannerContentScannerUnderlyingReceivedContentScanner: ContentScanner?
open var setContentScannerContentScannerReceivedContentScanner: ContentScanner? {
get { setContentScannerContentScannerReceivedContentScannerLock.withLock { setContentScannerContentScannerUnderlyingReceivedContentScanner } }
set { setContentScannerContentScannerReceivedContentScannerLock.withLock { setContentScannerContentScannerUnderlyingReceivedContentScanner = newValue } }
}
private let setContentScannerContentScannerReceivedInvocationsLock = NSLock()
private var setContentScannerContentScannerUnderlyingReceivedInvocations: [ContentScanner?] = []
open var setContentScannerContentScannerReceivedInvocations: [ContentScanner?] {
get { setContentScannerContentScannerReceivedInvocationsLock.withLock { setContentScannerContentScannerUnderlyingReceivedInvocations } }
set { setContentScannerContentScannerReceivedInvocationsLock.withLock { setContentScannerContentScannerUnderlyingReceivedInvocations = newValue } }
}
open var setContentScannerContentScannerClosure: ((ContentScanner?) async -> Void)?
open override func setContentScanner(contentScanner: ContentScanner?) async {
setContentScannerContentScannerCallsCountLock.withLock { setContentScannerContentScannerUnderlyingCallsCount += 1 }
setContentScannerContentScannerReceivedContentScanner = contentScanner
setContentScannerContentScannerReceivedInvocationsLock.withLock { setContentScannerContentScannerUnderlyingReceivedInvocations.append(contentScanner) }
await setContentScannerContentScannerClosure?(contentScanner)
}
//MARK: - setDelegate
open var setDelegateDelegateThrowableError: Error?
private let setDelegateDelegateCallsCountLock = NSLock()
private var setDelegateDelegateUnderlyingCallsCount = 0
open var setDelegateDelegateCallsCount: Int {
get { setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount } }
set { setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount = newValue } }
}
open var setDelegateDelegateCalled: Bool {
return setDelegateDelegateCallsCount > 0
}
private let setDelegateDelegateReceivedDelegateLock = NSLock()
private var setDelegateDelegateUnderlyingReceivedDelegate: ClientDelegate?
open var setDelegateDelegateReceivedDelegate: ClientDelegate? {
get { setDelegateDelegateReceivedDelegateLock.withLock { setDelegateDelegateUnderlyingReceivedDelegate } }
set { setDelegateDelegateReceivedDelegateLock.withLock { setDelegateDelegateUnderlyingReceivedDelegate = newValue } }
}
private let setDelegateDelegateReceivedInvocationsLock = NSLock()
private var setDelegateDelegateUnderlyingReceivedInvocations: [ClientDelegate?] = []
open var setDelegateDelegateReceivedInvocations: [ClientDelegate?] {
get { setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations } }
set { setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations = newValue } }
}
private let setDelegateDelegateReturnValueLock = NSLock()
open var setDelegateDelegateUnderlyingReturnValue: TaskHandle?
open var setDelegateDelegateReturnValue: TaskHandle? {
get { setDelegateDelegateReturnValueLock.withLock { setDelegateDelegateUnderlyingReturnValue } }
set { setDelegateDelegateReturnValueLock.withLock { setDelegateDelegateUnderlyingReturnValue = newValue } }
}
open var setDelegateDelegateClosure: ((ClientDelegate?) throws -> TaskHandle?)?
open override func setDelegate(delegate: ClientDelegate?) throws -> TaskHandle? {
if let error = setDelegateDelegateThrowableError {
throw error
}
setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount += 1 }
setDelegateDelegateReceivedDelegate = delegate
setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations.append(delegate) }
if let setDelegateDelegateClosure = setDelegateDelegateClosure {
return try setDelegateDelegateClosure(delegate)
} else {
return setDelegateDelegateReturnValue
}
}
//MARK: - setDisplayName
open var setDisplayNameNameThrowableError: Error?
private let setDisplayNameNameCallsCountLock = NSLock()
private var setDisplayNameNameUnderlyingCallsCount = 0
open var setDisplayNameNameCallsCount: Int {
get { setDisplayNameNameCallsCountLock.withLock { setDisplayNameNameUnderlyingCallsCount } }
set { setDisplayNameNameCallsCountLock.withLock { setDisplayNameNameUnderlyingCallsCount = newValue } }
}
open var setDisplayNameNameCalled: Bool {
return setDisplayNameNameCallsCount > 0
}
private let setDisplayNameNameReceivedNameLock = NSLock()
private var setDisplayNameNameUnderlyingReceivedName: String?
open var setDisplayNameNameReceivedName: String? {
get { setDisplayNameNameReceivedNameLock.withLock { setDisplayNameNameUnderlyingReceivedName } }
set { setDisplayNameNameReceivedNameLock.withLock { setDisplayNameNameUnderlyingReceivedName = newValue } }
}
private let setDisplayNameNameReceivedInvocationsLock = NSLock()
private var setDisplayNameNameUnderlyingReceivedInvocations: [String] = []
open var setDisplayNameNameReceivedInvocations: [String] {
get { setDisplayNameNameReceivedInvocationsLock.withLock { setDisplayNameNameUnderlyingReceivedInvocations } }
set { setDisplayNameNameReceivedInvocationsLock.withLock { setDisplayNameNameUnderlyingReceivedInvocations = newValue } }
}
open var setDisplayNameNameClosure: ((String) async throws -> Void)?
open override func setDisplayName(name: String) async throws {
if let error = setDisplayNameNameThrowableError {
throw error
}
setDisplayNameNameCallsCountLock.withLock { setDisplayNameNameUnderlyingCallsCount += 1 }
setDisplayNameNameReceivedName = name
setDisplayNameNameReceivedInvocationsLock.withLock { setDisplayNameNameUnderlyingReceivedInvocations.append(name) }
try await setDisplayNameNameClosure?(name)
}
//MARK: - setInviteAvatarsDisplayPolicy
open var setInviteAvatarsDisplayPolicyPolicyThrowableError: Error?
private let setInviteAvatarsDisplayPolicyPolicyCallsCountLock = NSLock()
private var setInviteAvatarsDisplayPolicyPolicyUnderlyingCallsCount = 0
open var setInviteAvatarsDisplayPolicyPolicyCallsCount: Int {
get { setInviteAvatarsDisplayPolicyPolicyCallsCountLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingCallsCount } }
set { setInviteAvatarsDisplayPolicyPolicyCallsCountLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingCallsCount = newValue } }
}
open var setInviteAvatarsDisplayPolicyPolicyCalled: Bool {
return setInviteAvatarsDisplayPolicyPolicyCallsCount > 0
}
private let setInviteAvatarsDisplayPolicyPolicyReceivedPolicyLock = NSLock()
private var setInviteAvatarsDisplayPolicyPolicyUnderlyingReceivedPolicy: InviteAvatars?
open var setInviteAvatarsDisplayPolicyPolicyReceivedPolicy: InviteAvatars? {
get { setInviteAvatarsDisplayPolicyPolicyReceivedPolicyLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingReceivedPolicy } }
set { setInviteAvatarsDisplayPolicyPolicyReceivedPolicyLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingReceivedPolicy = newValue } }
}
private let setInviteAvatarsDisplayPolicyPolicyReceivedInvocationsLock = NSLock()
private var setInviteAvatarsDisplayPolicyPolicyUnderlyingReceivedInvocations: [InviteAvatars] = []
open var setInviteAvatarsDisplayPolicyPolicyReceivedInvocations: [InviteAvatars] {
get { setInviteAvatarsDisplayPolicyPolicyReceivedInvocationsLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingReceivedInvocations } }
set { setInviteAvatarsDisplayPolicyPolicyReceivedInvocationsLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingReceivedInvocations = newValue } }
}
open var setInviteAvatarsDisplayPolicyPolicyClosure: ((InviteAvatars) async throws -> Void)?
open override func setInviteAvatarsDisplayPolicy(policy: InviteAvatars) async throws {
if let error = setInviteAvatarsDisplayPolicyPolicyThrowableError {
throw error
}
setInviteAvatarsDisplayPolicyPolicyCallsCountLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingCallsCount += 1 }
setInviteAvatarsDisplayPolicyPolicyReceivedPolicy = policy
setInviteAvatarsDisplayPolicyPolicyReceivedInvocationsLock.withLock { setInviteAvatarsDisplayPolicyPolicyUnderlyingReceivedInvocations.append(policy) }
try await setInviteAvatarsDisplayPolicyPolicyClosure?(policy)
}
//MARK: - setMediaPreviewDisplayPolicy
open var setMediaPreviewDisplayPolicyPolicyThrowableError: Error?
private let setMediaPreviewDisplayPolicyPolicyCallsCountLock = NSLock()
private var setMediaPreviewDisplayPolicyPolicyUnderlyingCallsCount = 0
open var setMediaPreviewDisplayPolicyPolicyCallsCount: Int {
get { setMediaPreviewDisplayPolicyPolicyCallsCountLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingCallsCount } }
set { setMediaPreviewDisplayPolicyPolicyCallsCountLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingCallsCount = newValue } }
}
open var setMediaPreviewDisplayPolicyPolicyCalled: Bool {
return setMediaPreviewDisplayPolicyPolicyCallsCount > 0
}
private let setMediaPreviewDisplayPolicyPolicyReceivedPolicyLock = NSLock()
private var setMediaPreviewDisplayPolicyPolicyUnderlyingReceivedPolicy: MediaPreviews?
open var setMediaPreviewDisplayPolicyPolicyReceivedPolicy: MediaPreviews? {
get { setMediaPreviewDisplayPolicyPolicyReceivedPolicyLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingReceivedPolicy } }
set { setMediaPreviewDisplayPolicyPolicyReceivedPolicyLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingReceivedPolicy = newValue } }
}
private let setMediaPreviewDisplayPolicyPolicyReceivedInvocationsLock = NSLock()
private var setMediaPreviewDisplayPolicyPolicyUnderlyingReceivedInvocations: [MediaPreviews] = []
open var setMediaPreviewDisplayPolicyPolicyReceivedInvocations: [MediaPreviews] {
get { setMediaPreviewDisplayPolicyPolicyReceivedInvocationsLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingReceivedInvocations } }
set { setMediaPreviewDisplayPolicyPolicyReceivedInvocationsLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingReceivedInvocations = newValue } }
}
open var setMediaPreviewDisplayPolicyPolicyClosure: ((MediaPreviews) async throws -> Void)?
open override func setMediaPreviewDisplayPolicy(policy: MediaPreviews) async throws {
if let error = setMediaPreviewDisplayPolicyPolicyThrowableError {
throw error
}
setMediaPreviewDisplayPolicyPolicyCallsCountLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingCallsCount += 1 }
setMediaPreviewDisplayPolicyPolicyReceivedPolicy = policy
setMediaPreviewDisplayPolicyPolicyReceivedInvocationsLock.withLock { setMediaPreviewDisplayPolicyPolicyUnderlyingReceivedInvocations.append(policy) }
try await setMediaPreviewDisplayPolicyPolicyClosure?(policy)
}
//MARK: - setMediaRetentionPolicy
open var setMediaRetentionPolicyPolicyThrowableError: Error?
private let setMediaRetentionPolicyPolicyCallsCountLock = NSLock()
private var setMediaRetentionPolicyPolicyUnderlyingCallsCount = 0
open var setMediaRetentionPolicyPolicyCallsCount: Int {
get { setMediaRetentionPolicyPolicyCallsCountLock.withLock { setMediaRetentionPolicyPolicyUnderlyingCallsCount } }
set { setMediaRetentionPolicyPolicyCallsCountLock.withLock { setMediaRetentionPolicyPolicyUnderlyingCallsCount = newValue } }
}
open var setMediaRetentionPolicyPolicyCalled: Bool {
return setMediaRetentionPolicyPolicyCallsCount > 0
}
private let setMediaRetentionPolicyPolicyReceivedPolicyLock = NSLock()
private var setMediaRetentionPolicyPolicyUnderlyingReceivedPolicy: MediaRetentionPolicy?
open var setMediaRetentionPolicyPolicyReceivedPolicy: MediaRetentionPolicy? {
get { setMediaRetentionPolicyPolicyReceivedPolicyLock.withLock { setMediaRetentionPolicyPolicyUnderlyingReceivedPolicy } }
set { setMediaRetentionPolicyPolicyReceivedPolicyLock.withLock { setMediaRetentionPolicyPolicyUnderlyingReceivedPolicy = newValue } }
}
private let setMediaRetentionPolicyPolicyReceivedInvocationsLock = NSLock()
private var setMediaRetentionPolicyPolicyUnderlyingReceivedInvocations: [MediaRetentionPolicy] = []
open var setMediaRetentionPolicyPolicyReceivedInvocations: [MediaRetentionPolicy] {
get { setMediaRetentionPolicyPolicyReceivedInvocationsLock.withLock { setMediaRetentionPolicyPolicyUnderlyingReceivedInvocations } }
set { setMediaRetentionPolicyPolicyReceivedInvocationsLock.withLock { setMediaRetentionPolicyPolicyUnderlyingReceivedInvocations = newValue } }
}
open var setMediaRetentionPolicyPolicyClosure: ((MediaRetentionPolicy) async throws -> Void)?
open override func setMediaRetentionPolicy(policy: MediaRetentionPolicy) async throws {
if let error = setMediaRetentionPolicyPolicyThrowableError {
throw error
}
setMediaRetentionPolicyPolicyCallsCountLock.withLock { setMediaRetentionPolicyPolicyUnderlyingCallsCount += 1 }
setMediaRetentionPolicyPolicyReceivedPolicy = policy
setMediaRetentionPolicyPolicyReceivedInvocationsLock.withLock { setMediaRetentionPolicyPolicyUnderlyingReceivedInvocations.append(policy) }
try await setMediaRetentionPolicyPolicyClosure?(policy)
}
//MARK: - setPresence
open var setPresencePresenceImmediateThrowableError: Error?
private let setPresencePresenceImmediateCallsCountLock = NSLock()
private var setPresencePresenceImmediateUnderlyingCallsCount = 0
open var setPresencePresenceImmediateCallsCount: Int {
get { setPresencePresenceImmediateCallsCountLock.withLock { setPresencePresenceImmediateUnderlyingCallsCount } }
set { setPresencePresenceImmediateCallsCountLock.withLock { setPresencePresenceImmediateUnderlyingCallsCount = newValue } }
}
open var setPresencePresenceImmediateCalled: Bool {
return setPresencePresenceImmediateCallsCount > 0
}
private let setPresencePresenceImmediateReceivedArgumentsLock = NSLock()
private var setPresencePresenceImmediateUnderlyingReceivedArguments: (presence: PresenceState, immediate: Bool)?
open var setPresencePresenceImmediateReceivedArguments: (presence: PresenceState, immediate: Bool)? {
get { setPresencePresenceImmediateReceivedArgumentsLock.withLock { setPresencePresenceImmediateUnderlyingReceivedArguments } }
set { setPresencePresenceImmediateReceivedArgumentsLock.withLock { setPresencePresenceImmediateUnderlyingReceivedArguments = newValue } }
}
private let setPresencePresenceImmediateReceivedInvocationsLock = NSLock()
private var setPresencePresenceImmediateUnderlyingReceivedInvocations: [(presence: PresenceState, immediate: Bool)] = []
open var setPresencePresenceImmediateReceivedInvocations: [(presence: PresenceState, immediate: Bool)] {
get { setPresencePresenceImmediateReceivedInvocationsLock.withLock { setPresencePresenceImmediateUnderlyingReceivedInvocations } }
set { setPresencePresenceImmediateReceivedInvocationsLock.withLock { setPresencePresenceImmediateUnderlyingReceivedInvocations = newValue } }
}
open var setPresencePresenceImmediateClosure: ((PresenceState, Bool) async throws -> Void)?
open override func setPresence(presence: PresenceState, immediate: Bool) async throws {
if let error = setPresencePresenceImmediateThrowableError {
throw error
}
setPresencePresenceImmediateCallsCountLock.withLock { setPresencePresenceImmediateUnderlyingCallsCount += 1 }
setPresencePresenceImmediateReceivedArguments = (presence: presence, immediate: immediate)
setPresencePresenceImmediateReceivedInvocationsLock.withLock { setPresencePresenceImmediateUnderlyingReceivedInvocations.append((presence: presence, immediate: immediate)) }
try await setPresencePresenceImmediateClosure?(presence, immediate)
}
//MARK: - setPusher
open var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendThrowableError: Error?
private let setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendCallsCountLock = NSLock()
private var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingCallsCount = 0
open var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendCallsCount: Int {
get { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendCallsCountLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingCallsCount } }
set { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendCallsCountLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingCallsCount = newValue } }
}
open var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendCalled: Bool {
return setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendCallsCount > 0
}
private let setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedArgumentsLock = NSLock()
private var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingReceivedArguments: (identifiers: PusherIdentifiers, kind: PusherKind, appDisplayName: String, deviceDisplayName: String, profileTag: String?, lang: String, append: Bool)?
open var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedArguments: (identifiers: PusherIdentifiers, kind: PusherKind, appDisplayName: String, deviceDisplayName: String, profileTag: String?, lang: String, append: Bool)? {
get { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedArgumentsLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingReceivedArguments } }
set { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedArgumentsLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingReceivedArguments = newValue } }
}
private let setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedInvocationsLock = NSLock()
private var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingReceivedInvocations: [(identifiers: PusherIdentifiers, kind: PusherKind, appDisplayName: String, deviceDisplayName: String, profileTag: String?, lang: String, append: Bool)] = []
open var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedInvocations: [(identifiers: PusherIdentifiers, kind: PusherKind, appDisplayName: String, deviceDisplayName: String, profileTag: String?, lang: String, append: Bool)] {
get { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedInvocationsLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingReceivedInvocations } }
set { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedInvocationsLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingReceivedInvocations = newValue } }
}
open var setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendClosure: ((PusherIdentifiers, PusherKind, String, String, String?, String, Bool) async throws -> Void)?
open override func setPusher(identifiers: PusherIdentifiers, kind: PusherKind, appDisplayName: String, deviceDisplayName: String, profileTag: String?, lang: String, append: Bool) async throws {
if let error = setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendThrowableError {
throw error
}
setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendCallsCountLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingCallsCount += 1 }
setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedArguments = (identifiers: identifiers, kind: kind, appDisplayName: appDisplayName, deviceDisplayName: deviceDisplayName, profileTag: profileTag, lang: lang, append: append)
setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendReceivedInvocationsLock.withLock { setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendUnderlyingReceivedInvocations.append((identifiers: identifiers, kind: kind, appDisplayName: appDisplayName, deviceDisplayName: deviceDisplayName, profileTag: profileTag, lang: lang, append: append)) }
try await setPusherIdentifiersKindAppDisplayNameDeviceDisplayNameProfileTagLangAppendClosure?(identifiers, kind, appDisplayName, deviceDisplayName, profileTag, lang, append)
}
//MARK: - setUserStatus
open var setUserStatusStatusThrowableError: Error?
private let setUserStatusStatusCallsCountLock = NSLock()
private var setUserStatusStatusUnderlyingCallsCount = 0
open var setUserStatusStatusCallsCount: Int {
get { setUserStatusStatusCallsCountLock.withLock { setUserStatusStatusUnderlyingCallsCount } }
set { setUserStatusStatusCallsCountLock.withLock { setUserStatusStatusUnderlyingCallsCount = newValue } }
}
open var setUserStatusStatusCalled: Bool {
return setUserStatusStatusCallsCount > 0
}
private let setUserStatusStatusReceivedStatusLock = NSLock()
private var setUserStatusStatusUnderlyingReceivedStatus: UserStatus?
open var setUserStatusStatusReceivedStatus: UserStatus? {
get { setUserStatusStatusReceivedStatusLock.withLock { setUserStatusStatusUnderlyingReceivedStatus } }
set { setUserStatusStatusReceivedStatusLock.withLock { setUserStatusStatusUnderlyingReceivedStatus = newValue } }
}
private let setUserStatusStatusReceivedInvocationsLock = NSLock()
private var setUserStatusStatusUnderlyingReceivedInvocations: [UserStatus] = []
open var setUserStatusStatusReceivedInvocations: [UserStatus] {
get { setUserStatusStatusReceivedInvocationsLock.withLock { setUserStatusStatusUnderlyingReceivedInvocations } }
set { setUserStatusStatusReceivedInvocationsLock.withLock { setUserStatusStatusUnderlyingReceivedInvocations = newValue } }
}
open var setUserStatusStatusClosure: ((UserStatus) async throws -> Void)?
open override func setUserStatus(status: UserStatus) async throws {
if let error = setUserStatusStatusThrowableError {
throw error
}
setUserStatusStatusCallsCountLock.withLock { setUserStatusStatusUnderlyingCallsCount += 1 }
setUserStatusStatusReceivedStatus = status
setUserStatusStatusReceivedInvocationsLock.withLock { setUserStatusStatusUnderlyingReceivedInvocations.append(status) }
try await setUserStatusStatusClosure?(status)
}
//MARK: - setUtdDelegate
open var setUtdDelegateUtdDelegateThrowableError: Error?
private let setUtdDelegateUtdDelegateCallsCountLock = NSLock()
private var setUtdDelegateUtdDelegateUnderlyingCallsCount = 0
open var setUtdDelegateUtdDelegateCallsCount: Int {
get { setUtdDelegateUtdDelegateCallsCountLock.withLock { setUtdDelegateUtdDelegateUnderlyingCallsCount } }
set { setUtdDelegateUtdDelegateCallsCountLock.withLock { setUtdDelegateUtdDelegateUnderlyingCallsCount = newValue } }
}
open var setUtdDelegateUtdDelegateCalled: Bool {
return setUtdDelegateUtdDelegateCallsCount > 0
}
private let setUtdDelegateUtdDelegateReceivedUtdDelegateLock = NSLock()
private var setUtdDelegateUtdDelegateUnderlyingReceivedUtdDelegate: UnableToDecryptDelegate?
open var setUtdDelegateUtdDelegateReceivedUtdDelegate: UnableToDecryptDelegate? {
get { setUtdDelegateUtdDelegateReceivedUtdDelegateLock.withLock { setUtdDelegateUtdDelegateUnderlyingReceivedUtdDelegate } }
set { setUtdDelegateUtdDelegateReceivedUtdDelegateLock.withLock { setUtdDelegateUtdDelegateUnderlyingReceivedUtdDelegate = newValue } }
}
private let setUtdDelegateUtdDelegateReceivedInvocationsLock = NSLock()
private var setUtdDelegateUtdDelegateUnderlyingReceivedInvocations: [UnableToDecryptDelegate] = []
open var setUtdDelegateUtdDelegateReceivedInvocations: [UnableToDecryptDelegate] {
get { setUtdDelegateUtdDelegateReceivedInvocationsLock.withLock { setUtdDelegateUtdDelegateUnderlyingReceivedInvocations } }
set { setUtdDelegateUtdDelegateReceivedInvocationsLock.withLock { setUtdDelegateUtdDelegateUnderlyingReceivedInvocations = newValue } }
}
open var setUtdDelegateUtdDelegateClosure: ((UnableToDecryptDelegate) async throws -> Void)?
open override func setUtdDelegate(utdDelegate: UnableToDecryptDelegate) async throws {
if let error = setUtdDelegateUtdDelegateThrowableError {
throw error
}
setUtdDelegateUtdDelegateCallsCountLock.withLock { setUtdDelegateUtdDelegateUnderlyingCallsCount += 1 }
setUtdDelegateUtdDelegateReceivedUtdDelegate = utdDelegate
setUtdDelegateUtdDelegateReceivedInvocationsLock.withLock { setUtdDelegateUtdDelegateUnderlyingReceivedInvocations.append(utdDelegate) }
try await setUtdDelegateUtdDelegateClosure?(utdDelegate)
}
//MARK: - slidingSyncVersion
private let slidingSyncVersionCallsCountLock = NSLock()
private var slidingSyncVersionUnderlyingCallsCount = 0
open var slidingSyncVersionCallsCount: Int {
get { slidingSyncVersionCallsCountLock.withLock { slidingSyncVersionUnderlyingCallsCount } }
set { slidingSyncVersionCallsCountLock.withLock { slidingSyncVersionUnderlyingCallsCount = newValue } }
}
open var slidingSyncVersionCalled: Bool {
return slidingSyncVersionCallsCount > 0
}
private let slidingSyncVersionReturnValueLock = NSLock()
open var slidingSyncVersionUnderlyingReturnValue: SlidingSyncVersion!
open var slidingSyncVersionReturnValue: SlidingSyncVersion! {
get { slidingSyncVersionReturnValueLock.withLock { slidingSyncVersionUnderlyingReturnValue } }
set { slidingSyncVersionReturnValueLock.withLock { slidingSyncVersionUnderlyingReturnValue = newValue } }
}
open var slidingSyncVersionClosure: (() -> SlidingSyncVersion)?
open override func slidingSyncVersion() -> SlidingSyncVersion {
slidingSyncVersionCallsCountLock.withLock { slidingSyncVersionUnderlyingCallsCount += 1 }
if let slidingSyncVersionClosure = slidingSyncVersionClosure {
return slidingSyncVersionClosure()
} else {
return slidingSyncVersionReturnValue
}
}
//MARK: - spaceService
private let spaceServiceCallsCountLock = NSLock()
private var spaceServiceUnderlyingCallsCount = 0
open var spaceServiceCallsCount: Int {
get { spaceServiceCallsCountLock.withLock { spaceServiceUnderlyingCallsCount } }
set { spaceServiceCallsCountLock.withLock { spaceServiceUnderlyingCallsCount = newValue } }
}
open var spaceServiceCalled: Bool {
return spaceServiceCallsCount > 0
}
private let spaceServiceReturnValueLock = NSLock()
open var spaceServiceUnderlyingReturnValue: SpaceService!
open var spaceServiceReturnValue: SpaceService! {
get { spaceServiceReturnValueLock.withLock { spaceServiceUnderlyingReturnValue } }
set { spaceServiceReturnValueLock.withLock { spaceServiceUnderlyingReturnValue = newValue } }
}
open var spaceServiceClosure: (() async -> SpaceService)?
open override func spaceService() async -> SpaceService {
spaceServiceCallsCountLock.withLock { spaceServiceUnderlyingCallsCount += 1 }
if let spaceServiceClosure = spaceServiceClosure {
return await spaceServiceClosure()
} else {
return spaceServiceReturnValue
}
}
//MARK: - startSsoLogin
open var startSsoLoginRedirectUrlIdpIdThrowableError: Error?
private let startSsoLoginRedirectUrlIdpIdCallsCountLock = NSLock()
private var startSsoLoginRedirectUrlIdpIdUnderlyingCallsCount = 0
open var startSsoLoginRedirectUrlIdpIdCallsCount: Int {
get { startSsoLoginRedirectUrlIdpIdCallsCountLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingCallsCount } }
set { startSsoLoginRedirectUrlIdpIdCallsCountLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingCallsCount = newValue } }
}
open var startSsoLoginRedirectUrlIdpIdCalled: Bool {
return startSsoLoginRedirectUrlIdpIdCallsCount > 0
}
private let startSsoLoginRedirectUrlIdpIdReceivedArgumentsLock = NSLock()
private var startSsoLoginRedirectUrlIdpIdUnderlyingReceivedArguments: (redirectUrl: String, idpId: String?)?
open var startSsoLoginRedirectUrlIdpIdReceivedArguments: (redirectUrl: String, idpId: String?)? {
get { startSsoLoginRedirectUrlIdpIdReceivedArgumentsLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingReceivedArguments } }
set { startSsoLoginRedirectUrlIdpIdReceivedArgumentsLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingReceivedArguments = newValue } }
}
private let startSsoLoginRedirectUrlIdpIdReceivedInvocationsLock = NSLock()
private var startSsoLoginRedirectUrlIdpIdUnderlyingReceivedInvocations: [(redirectUrl: String, idpId: String?)] = []
open var startSsoLoginRedirectUrlIdpIdReceivedInvocations: [(redirectUrl: String, idpId: String?)] {
get { startSsoLoginRedirectUrlIdpIdReceivedInvocationsLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingReceivedInvocations } }
set { startSsoLoginRedirectUrlIdpIdReceivedInvocationsLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingReceivedInvocations = newValue } }
}
private let startSsoLoginRedirectUrlIdpIdReturnValueLock = NSLock()
open var startSsoLoginRedirectUrlIdpIdUnderlyingReturnValue: SsoHandler!
open var startSsoLoginRedirectUrlIdpIdReturnValue: SsoHandler! {
get { startSsoLoginRedirectUrlIdpIdReturnValueLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingReturnValue } }
set { startSsoLoginRedirectUrlIdpIdReturnValueLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingReturnValue = newValue } }
}
open var startSsoLoginRedirectUrlIdpIdClosure: ((String, String?) async throws -> SsoHandler)?
open override func startSsoLogin(redirectUrl: String, idpId: String?) async throws -> SsoHandler {
if let error = startSsoLoginRedirectUrlIdpIdThrowableError {
throw error
}
startSsoLoginRedirectUrlIdpIdCallsCountLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingCallsCount += 1 }
startSsoLoginRedirectUrlIdpIdReceivedArguments = (redirectUrl: redirectUrl, idpId: idpId)
startSsoLoginRedirectUrlIdpIdReceivedInvocationsLock.withLock { startSsoLoginRedirectUrlIdpIdUnderlyingReceivedInvocations.append((redirectUrl: redirectUrl, idpId: idpId)) }
if let startSsoLoginRedirectUrlIdpIdClosure = startSsoLoginRedirectUrlIdpIdClosure {
return try await startSsoLoginRedirectUrlIdpIdClosure(redirectUrl, idpId)
} else {
return startSsoLoginRedirectUrlIdpIdReturnValue
}
}
//MARK: - subscribeToDuplicateKeyUploadErrors
private let subscribeToDuplicateKeyUploadErrorsListenerCallsCountLock = NSLock()
private var subscribeToDuplicateKeyUploadErrorsListenerUnderlyingCallsCount = 0
open var subscribeToDuplicateKeyUploadErrorsListenerCallsCount: Int {
get { subscribeToDuplicateKeyUploadErrorsListenerCallsCountLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingCallsCount } }
set { subscribeToDuplicateKeyUploadErrorsListenerCallsCountLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToDuplicateKeyUploadErrorsListenerCalled: Bool {
return subscribeToDuplicateKeyUploadErrorsListenerCallsCount > 0
}
private let subscribeToDuplicateKeyUploadErrorsListenerReceivedListenerLock = NSLock()
private var subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReceivedListener: DuplicateKeyUploadErrorListener?
open var subscribeToDuplicateKeyUploadErrorsListenerReceivedListener: DuplicateKeyUploadErrorListener? {
get { subscribeToDuplicateKeyUploadErrorsListenerReceivedListenerLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReceivedListener } }
set { subscribeToDuplicateKeyUploadErrorsListenerReceivedListenerLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToDuplicateKeyUploadErrorsListenerReceivedInvocationsLock = NSLock()
private var subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReceivedInvocations: [DuplicateKeyUploadErrorListener] = []
open var subscribeToDuplicateKeyUploadErrorsListenerReceivedInvocations: [DuplicateKeyUploadErrorListener] {
get { subscribeToDuplicateKeyUploadErrorsListenerReceivedInvocationsLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReceivedInvocations } }
set { subscribeToDuplicateKeyUploadErrorsListenerReceivedInvocationsLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToDuplicateKeyUploadErrorsListenerReturnValueLock = NSLock()
open var subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToDuplicateKeyUploadErrorsListenerReturnValue: TaskHandle! {
get { subscribeToDuplicateKeyUploadErrorsListenerReturnValueLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReturnValue } }
set { subscribeToDuplicateKeyUploadErrorsListenerReturnValueLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToDuplicateKeyUploadErrorsListenerClosure: ((DuplicateKeyUploadErrorListener) -> TaskHandle)?
open override func subscribeToDuplicateKeyUploadErrors(listener: DuplicateKeyUploadErrorListener) -> TaskHandle {
subscribeToDuplicateKeyUploadErrorsListenerCallsCountLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingCallsCount += 1 }
subscribeToDuplicateKeyUploadErrorsListenerReceivedListener = listener
subscribeToDuplicateKeyUploadErrorsListenerReceivedInvocationsLock.withLock { subscribeToDuplicateKeyUploadErrorsListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToDuplicateKeyUploadErrorsListenerClosure = subscribeToDuplicateKeyUploadErrorsListenerClosure {
return subscribeToDuplicateKeyUploadErrorsListenerClosure(listener)
} else {
return subscribeToDuplicateKeyUploadErrorsListenerReturnValue
}
}
//MARK: - subscribeToIgnoredUsers
private let subscribeToIgnoredUsersListenerCallsCountLock = NSLock()
private var subscribeToIgnoredUsersListenerUnderlyingCallsCount = 0
open var subscribeToIgnoredUsersListenerCallsCount: Int {
get { subscribeToIgnoredUsersListenerCallsCountLock.withLock { subscribeToIgnoredUsersListenerUnderlyingCallsCount } }
set { subscribeToIgnoredUsersListenerCallsCountLock.withLock { subscribeToIgnoredUsersListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToIgnoredUsersListenerCalled: Bool {
return subscribeToIgnoredUsersListenerCallsCount > 0
}
private let subscribeToIgnoredUsersListenerReceivedListenerLock = NSLock()
private var subscribeToIgnoredUsersListenerUnderlyingReceivedListener: IgnoredUsersListener?
open var subscribeToIgnoredUsersListenerReceivedListener: IgnoredUsersListener? {
get { subscribeToIgnoredUsersListenerReceivedListenerLock.withLock { subscribeToIgnoredUsersListenerUnderlyingReceivedListener } }
set { subscribeToIgnoredUsersListenerReceivedListenerLock.withLock { subscribeToIgnoredUsersListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToIgnoredUsersListenerReceivedInvocationsLock = NSLock()
private var subscribeToIgnoredUsersListenerUnderlyingReceivedInvocations: [IgnoredUsersListener] = []
open var subscribeToIgnoredUsersListenerReceivedInvocations: [IgnoredUsersListener] {
get { subscribeToIgnoredUsersListenerReceivedInvocationsLock.withLock { subscribeToIgnoredUsersListenerUnderlyingReceivedInvocations } }
set { subscribeToIgnoredUsersListenerReceivedInvocationsLock.withLock { subscribeToIgnoredUsersListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToIgnoredUsersListenerReturnValueLock = NSLock()
open var subscribeToIgnoredUsersListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToIgnoredUsersListenerReturnValue: TaskHandle! {
get { subscribeToIgnoredUsersListenerReturnValueLock.withLock { subscribeToIgnoredUsersListenerUnderlyingReturnValue } }
set { subscribeToIgnoredUsersListenerReturnValueLock.withLock { subscribeToIgnoredUsersListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToIgnoredUsersListenerClosure: ((IgnoredUsersListener) -> TaskHandle)?
open override func subscribeToIgnoredUsers(listener: IgnoredUsersListener) -> TaskHandle {
subscribeToIgnoredUsersListenerCallsCountLock.withLock { subscribeToIgnoredUsersListenerUnderlyingCallsCount += 1 }
subscribeToIgnoredUsersListenerReceivedListener = listener
subscribeToIgnoredUsersListenerReceivedInvocationsLock.withLock { subscribeToIgnoredUsersListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToIgnoredUsersListenerClosure = subscribeToIgnoredUsersListenerClosure {
return subscribeToIgnoredUsersListenerClosure(listener)
} else {
return subscribeToIgnoredUsersListenerReturnValue
}
}
//MARK: - subscribeToMediaPreviewConfig
open var subscribeToMediaPreviewConfigListenerThrowableError: Error?
private let subscribeToMediaPreviewConfigListenerCallsCountLock = NSLock()
private var subscribeToMediaPreviewConfigListenerUnderlyingCallsCount = 0
open var subscribeToMediaPreviewConfigListenerCallsCount: Int {
get { subscribeToMediaPreviewConfigListenerCallsCountLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingCallsCount } }
set { subscribeToMediaPreviewConfigListenerCallsCountLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToMediaPreviewConfigListenerCalled: Bool {
return subscribeToMediaPreviewConfigListenerCallsCount > 0
}
private let subscribeToMediaPreviewConfigListenerReceivedListenerLock = NSLock()
private var subscribeToMediaPreviewConfigListenerUnderlyingReceivedListener: MediaPreviewConfigListener?
open var subscribeToMediaPreviewConfigListenerReceivedListener: MediaPreviewConfigListener? {
get { subscribeToMediaPreviewConfigListenerReceivedListenerLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingReceivedListener } }
set { subscribeToMediaPreviewConfigListenerReceivedListenerLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToMediaPreviewConfigListenerReceivedInvocationsLock = NSLock()
private var subscribeToMediaPreviewConfigListenerUnderlyingReceivedInvocations: [MediaPreviewConfigListener] = []
open var subscribeToMediaPreviewConfigListenerReceivedInvocations: [MediaPreviewConfigListener] {
get { subscribeToMediaPreviewConfigListenerReceivedInvocationsLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingReceivedInvocations } }
set { subscribeToMediaPreviewConfigListenerReceivedInvocationsLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToMediaPreviewConfigListenerReturnValueLock = NSLock()
open var subscribeToMediaPreviewConfigListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToMediaPreviewConfigListenerReturnValue: TaskHandle! {
get { subscribeToMediaPreviewConfigListenerReturnValueLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingReturnValue } }
set { subscribeToMediaPreviewConfigListenerReturnValueLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToMediaPreviewConfigListenerClosure: ((MediaPreviewConfigListener) async throws -> TaskHandle)?
open override func subscribeToMediaPreviewConfig(listener: MediaPreviewConfigListener) async throws -> TaskHandle {
if let error = subscribeToMediaPreviewConfigListenerThrowableError {
throw error
}
subscribeToMediaPreviewConfigListenerCallsCountLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingCallsCount += 1 }
subscribeToMediaPreviewConfigListenerReceivedListener = listener
subscribeToMediaPreviewConfigListenerReceivedInvocationsLock.withLock { subscribeToMediaPreviewConfigListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToMediaPreviewConfigListenerClosure = subscribeToMediaPreviewConfigListenerClosure {
return try await subscribeToMediaPreviewConfigListenerClosure(listener)
} else {
return subscribeToMediaPreviewConfigListenerReturnValue
}
}
//MARK: - subscribeToOwnBeaconInfoUpdates
open var subscribeToOwnBeaconInfoUpdatesListenerThrowableError: Error?
private let subscribeToOwnBeaconInfoUpdatesListenerCallsCountLock = NSLock()
private var subscribeToOwnBeaconInfoUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToOwnBeaconInfoUpdatesListenerCallsCount: Int {
get { subscribeToOwnBeaconInfoUpdatesListenerCallsCountLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingCallsCount } }
set { subscribeToOwnBeaconInfoUpdatesListenerCallsCountLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToOwnBeaconInfoUpdatesListenerCalled: Bool {
return subscribeToOwnBeaconInfoUpdatesListenerCallsCount > 0
}
private let subscribeToOwnBeaconInfoUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReceivedListener: BeaconInfoListener?
open var subscribeToOwnBeaconInfoUpdatesListenerReceivedListener: BeaconInfoListener? {
get { subscribeToOwnBeaconInfoUpdatesListenerReceivedListenerLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToOwnBeaconInfoUpdatesListenerReceivedListenerLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToOwnBeaconInfoUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReceivedInvocations: [BeaconInfoListener] = []
open var subscribeToOwnBeaconInfoUpdatesListenerReceivedInvocations: [BeaconInfoListener] {
get { subscribeToOwnBeaconInfoUpdatesListenerReceivedInvocationsLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToOwnBeaconInfoUpdatesListenerReceivedInvocationsLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToOwnBeaconInfoUpdatesListenerReturnValueLock = NSLock()
open var subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToOwnBeaconInfoUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToOwnBeaconInfoUpdatesListenerReturnValueLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReturnValue } }
set { subscribeToOwnBeaconInfoUpdatesListenerReturnValueLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToOwnBeaconInfoUpdatesListenerClosure: ((BeaconInfoListener) throws -> TaskHandle)?
open override func subscribeToOwnBeaconInfoUpdates(listener: BeaconInfoListener) throws -> TaskHandle {
if let error = subscribeToOwnBeaconInfoUpdatesListenerThrowableError {
throw error
}
subscribeToOwnBeaconInfoUpdatesListenerCallsCountLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToOwnBeaconInfoUpdatesListenerReceivedListener = listener
subscribeToOwnBeaconInfoUpdatesListenerReceivedInvocationsLock.withLock { subscribeToOwnBeaconInfoUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToOwnBeaconInfoUpdatesListenerClosure = subscribeToOwnBeaconInfoUpdatesListenerClosure {
return try subscribeToOwnBeaconInfoUpdatesListenerClosure(listener)
} else {
return subscribeToOwnBeaconInfoUpdatesListenerReturnValue
}
}
//MARK: - subscribeToOwnProfile
open var subscribeToOwnProfileListenerThrowableError: Error?
private let subscribeToOwnProfileListenerCallsCountLock = NSLock()
private var subscribeToOwnProfileListenerUnderlyingCallsCount = 0
open var subscribeToOwnProfileListenerCallsCount: Int {
get { subscribeToOwnProfileListenerCallsCountLock.withLock { subscribeToOwnProfileListenerUnderlyingCallsCount } }
set { subscribeToOwnProfileListenerCallsCountLock.withLock { subscribeToOwnProfileListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToOwnProfileListenerCalled: Bool {
return subscribeToOwnProfileListenerCallsCount > 0
}
private let subscribeToOwnProfileListenerReceivedListenerLock = NSLock()
private var subscribeToOwnProfileListenerUnderlyingReceivedListener: ProfileListener?
open var subscribeToOwnProfileListenerReceivedListener: ProfileListener? {
get { subscribeToOwnProfileListenerReceivedListenerLock.withLock { subscribeToOwnProfileListenerUnderlyingReceivedListener } }
set { subscribeToOwnProfileListenerReceivedListenerLock.withLock { subscribeToOwnProfileListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToOwnProfileListenerReceivedInvocationsLock = NSLock()
private var subscribeToOwnProfileListenerUnderlyingReceivedInvocations: [ProfileListener] = []
open var subscribeToOwnProfileListenerReceivedInvocations: [ProfileListener] {
get { subscribeToOwnProfileListenerReceivedInvocationsLock.withLock { subscribeToOwnProfileListenerUnderlyingReceivedInvocations } }
set { subscribeToOwnProfileListenerReceivedInvocationsLock.withLock { subscribeToOwnProfileListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToOwnProfileListenerReturnValueLock = NSLock()
open var subscribeToOwnProfileListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToOwnProfileListenerReturnValue: TaskHandle! {
get { subscribeToOwnProfileListenerReturnValueLock.withLock { subscribeToOwnProfileListenerUnderlyingReturnValue } }
set { subscribeToOwnProfileListenerReturnValueLock.withLock { subscribeToOwnProfileListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToOwnProfileListenerClosure: ((ProfileListener) throws -> TaskHandle)?
open override func subscribeToOwnProfile(listener: ProfileListener) throws -> TaskHandle {
if let error = subscribeToOwnProfileListenerThrowableError {
throw error
}
subscribeToOwnProfileListenerCallsCountLock.withLock { subscribeToOwnProfileListenerUnderlyingCallsCount += 1 }
subscribeToOwnProfileListenerReceivedListener = listener
subscribeToOwnProfileListenerReceivedInvocationsLock.withLock { subscribeToOwnProfileListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToOwnProfileListenerClosure = subscribeToOwnProfileListenerClosure {
return try subscribeToOwnProfileListenerClosure(listener)
} else {
return subscribeToOwnProfileListenerReturnValue
}
}
//MARK: - subscribeToRoomInfo
open var subscribeToRoomInfoRoomIdListenerThrowableError: Error?
private let subscribeToRoomInfoRoomIdListenerCallsCountLock = NSLock()
private var subscribeToRoomInfoRoomIdListenerUnderlyingCallsCount = 0
open var subscribeToRoomInfoRoomIdListenerCallsCount: Int {
get { subscribeToRoomInfoRoomIdListenerCallsCountLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingCallsCount } }
set { subscribeToRoomInfoRoomIdListenerCallsCountLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToRoomInfoRoomIdListenerCalled: Bool {
return subscribeToRoomInfoRoomIdListenerCallsCount > 0
}
private let subscribeToRoomInfoRoomIdListenerReceivedArgumentsLock = NSLock()
private var subscribeToRoomInfoRoomIdListenerUnderlyingReceivedArguments: (roomId: String, listener: RoomInfoListener)?
open var subscribeToRoomInfoRoomIdListenerReceivedArguments: (roomId: String, listener: RoomInfoListener)? {
get { subscribeToRoomInfoRoomIdListenerReceivedArgumentsLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingReceivedArguments } }
set { subscribeToRoomInfoRoomIdListenerReceivedArgumentsLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingReceivedArguments = newValue } }
}
private let subscribeToRoomInfoRoomIdListenerReceivedInvocationsLock = NSLock()
private var subscribeToRoomInfoRoomIdListenerUnderlyingReceivedInvocations: [(roomId: String, listener: RoomInfoListener)] = []
open var subscribeToRoomInfoRoomIdListenerReceivedInvocations: [(roomId: String, listener: RoomInfoListener)] {
get { subscribeToRoomInfoRoomIdListenerReceivedInvocationsLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingReceivedInvocations } }
set { subscribeToRoomInfoRoomIdListenerReceivedInvocationsLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToRoomInfoRoomIdListenerReturnValueLock = NSLock()
open var subscribeToRoomInfoRoomIdListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToRoomInfoRoomIdListenerReturnValue: TaskHandle! {
get { subscribeToRoomInfoRoomIdListenerReturnValueLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingReturnValue } }
set { subscribeToRoomInfoRoomIdListenerReturnValueLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToRoomInfoRoomIdListenerClosure: ((String, RoomInfoListener) async throws -> TaskHandle)?
open override func subscribeToRoomInfo(roomId: String, listener: RoomInfoListener) async throws -> TaskHandle {
if let error = subscribeToRoomInfoRoomIdListenerThrowableError {
throw error
}
subscribeToRoomInfoRoomIdListenerCallsCountLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingCallsCount += 1 }
subscribeToRoomInfoRoomIdListenerReceivedArguments = (roomId: roomId, listener: listener)
subscribeToRoomInfoRoomIdListenerReceivedInvocationsLock.withLock { subscribeToRoomInfoRoomIdListenerUnderlyingReceivedInvocations.append((roomId: roomId, listener: listener)) }
if let subscribeToRoomInfoRoomIdListenerClosure = subscribeToRoomInfoRoomIdListenerClosure {
return try await subscribeToRoomInfoRoomIdListenerClosure(roomId, listener)
} else {
return subscribeToRoomInfoRoomIdListenerReturnValue
}
}
//MARK: - subscribeToSendQueueStatus
private let subscribeToSendQueueStatusListenerCallsCountLock = NSLock()
private var subscribeToSendQueueStatusListenerUnderlyingCallsCount = 0
open var subscribeToSendQueueStatusListenerCallsCount: Int {
get { subscribeToSendQueueStatusListenerCallsCountLock.withLock { subscribeToSendQueueStatusListenerUnderlyingCallsCount } }
set { subscribeToSendQueueStatusListenerCallsCountLock.withLock { subscribeToSendQueueStatusListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToSendQueueStatusListenerCalled: Bool {
return subscribeToSendQueueStatusListenerCallsCount > 0
}
private let subscribeToSendQueueStatusListenerReceivedListenerLock = NSLock()
private var subscribeToSendQueueStatusListenerUnderlyingReceivedListener: SendQueueRoomErrorListener?
open var subscribeToSendQueueStatusListenerReceivedListener: SendQueueRoomErrorListener? {
get { subscribeToSendQueueStatusListenerReceivedListenerLock.withLock { subscribeToSendQueueStatusListenerUnderlyingReceivedListener } }
set { subscribeToSendQueueStatusListenerReceivedListenerLock.withLock { subscribeToSendQueueStatusListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToSendQueueStatusListenerReceivedInvocationsLock = NSLock()
private var subscribeToSendQueueStatusListenerUnderlyingReceivedInvocations: [SendQueueRoomErrorListener] = []
open var subscribeToSendQueueStatusListenerReceivedInvocations: [SendQueueRoomErrorListener] {
get { subscribeToSendQueueStatusListenerReceivedInvocationsLock.withLock { subscribeToSendQueueStatusListenerUnderlyingReceivedInvocations } }
set { subscribeToSendQueueStatusListenerReceivedInvocationsLock.withLock { subscribeToSendQueueStatusListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToSendQueueStatusListenerReturnValueLock = NSLock()
open var subscribeToSendQueueStatusListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToSendQueueStatusListenerReturnValue: TaskHandle! {
get { subscribeToSendQueueStatusListenerReturnValueLock.withLock { subscribeToSendQueueStatusListenerUnderlyingReturnValue } }
set { subscribeToSendQueueStatusListenerReturnValueLock.withLock { subscribeToSendQueueStatusListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToSendQueueStatusListenerClosure: ((SendQueueRoomErrorListener) -> TaskHandle)?
open override func subscribeToSendQueueStatus(listener: SendQueueRoomErrorListener) -> TaskHandle {
subscribeToSendQueueStatusListenerCallsCountLock.withLock { subscribeToSendQueueStatusListenerUnderlyingCallsCount += 1 }
subscribeToSendQueueStatusListenerReceivedListener = listener
subscribeToSendQueueStatusListenerReceivedInvocationsLock.withLock { subscribeToSendQueueStatusListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToSendQueueStatusListenerClosure = subscribeToSendQueueStatusListenerClosure {
return subscribeToSendQueueStatusListenerClosure(listener)
} else {
return subscribeToSendQueueStatusListenerReturnValue
}
}
//MARK: - subscribeToSendQueueUpdates
open var subscribeToSendQueueUpdatesListenerThrowableError: Error?
private let subscribeToSendQueueUpdatesListenerCallsCountLock = NSLock()
private var subscribeToSendQueueUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToSendQueueUpdatesListenerCallsCount: Int {
get { subscribeToSendQueueUpdatesListenerCallsCountLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingCallsCount } }
set { subscribeToSendQueueUpdatesListenerCallsCountLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToSendQueueUpdatesListenerCalled: Bool {
return subscribeToSendQueueUpdatesListenerCallsCount > 0
}
private let subscribeToSendQueueUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToSendQueueUpdatesListenerUnderlyingReceivedListener: SendQueueRoomUpdateListener?
open var subscribeToSendQueueUpdatesListenerReceivedListener: SendQueueRoomUpdateListener? {
get { subscribeToSendQueueUpdatesListenerReceivedListenerLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToSendQueueUpdatesListenerReceivedListenerLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToSendQueueUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations: [SendQueueRoomUpdateListener] = []
open var subscribeToSendQueueUpdatesListenerReceivedInvocations: [SendQueueRoomUpdateListener] {
get { subscribeToSendQueueUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToSendQueueUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToSendQueueUpdatesListenerReturnValueLock = NSLock()
open var subscribeToSendQueueUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToSendQueueUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToSendQueueUpdatesListenerReturnValueLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReturnValue } }
set { subscribeToSendQueueUpdatesListenerReturnValueLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToSendQueueUpdatesListenerClosure: ((SendQueueRoomUpdateListener) async throws -> TaskHandle)?
open override func subscribeToSendQueueUpdates(listener: SendQueueRoomUpdateListener) async throws -> TaskHandle {
if let error = subscribeToSendQueueUpdatesListenerThrowableError {
throw error
}
subscribeToSendQueueUpdatesListenerCallsCountLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToSendQueueUpdatesListenerReceivedListener = listener
subscribeToSendQueueUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToSendQueueUpdatesListenerClosure = subscribeToSendQueueUpdatesListenerClosure {
return try await subscribeToSendQueueUpdatesListenerClosure(listener)
} else {
return subscribeToSendQueueUpdatesListenerReturnValue
}
}
//MARK: - syncOnceV2
open var syncOnceV2SettingsThrowableError: Error?
private let syncOnceV2SettingsCallsCountLock = NSLock()
private var syncOnceV2SettingsUnderlyingCallsCount = 0
open var syncOnceV2SettingsCallsCount: Int {
get { syncOnceV2SettingsCallsCountLock.withLock { syncOnceV2SettingsUnderlyingCallsCount } }
set { syncOnceV2SettingsCallsCountLock.withLock { syncOnceV2SettingsUnderlyingCallsCount = newValue } }
}
open var syncOnceV2SettingsCalled: Bool {
return syncOnceV2SettingsCallsCount > 0
}
private let syncOnceV2SettingsReceivedSettingsLock = NSLock()
private var syncOnceV2SettingsUnderlyingReceivedSettings: SyncSettingsV2?
open var syncOnceV2SettingsReceivedSettings: SyncSettingsV2? {
get { syncOnceV2SettingsReceivedSettingsLock.withLock { syncOnceV2SettingsUnderlyingReceivedSettings } }
set { syncOnceV2SettingsReceivedSettingsLock.withLock { syncOnceV2SettingsUnderlyingReceivedSettings = newValue } }
}
private let syncOnceV2SettingsReceivedInvocationsLock = NSLock()
private var syncOnceV2SettingsUnderlyingReceivedInvocations: [SyncSettingsV2] = []
open var syncOnceV2SettingsReceivedInvocations: [SyncSettingsV2] {
get { syncOnceV2SettingsReceivedInvocationsLock.withLock { syncOnceV2SettingsUnderlyingReceivedInvocations } }
set { syncOnceV2SettingsReceivedInvocationsLock.withLock { syncOnceV2SettingsUnderlyingReceivedInvocations = newValue } }
}
private let syncOnceV2SettingsReturnValueLock = NSLock()
open var syncOnceV2SettingsUnderlyingReturnValue: SyncResponseV2!
open var syncOnceV2SettingsReturnValue: SyncResponseV2! {
get { syncOnceV2SettingsReturnValueLock.withLock { syncOnceV2SettingsUnderlyingReturnValue } }
set { syncOnceV2SettingsReturnValueLock.withLock { syncOnceV2SettingsUnderlyingReturnValue = newValue } }
}
open var syncOnceV2SettingsClosure: ((SyncSettingsV2) async throws -> SyncResponseV2)?
open override func syncOnceV2(settings: SyncSettingsV2) async throws -> SyncResponseV2 {
if let error = syncOnceV2SettingsThrowableError {
throw error
}
syncOnceV2SettingsCallsCountLock.withLock { syncOnceV2SettingsUnderlyingCallsCount += 1 }
syncOnceV2SettingsReceivedSettings = settings
syncOnceV2SettingsReceivedInvocationsLock.withLock { syncOnceV2SettingsUnderlyingReceivedInvocations.append(settings) }
if let syncOnceV2SettingsClosure = syncOnceV2SettingsClosure {
return try await syncOnceV2SettingsClosure(settings)
} else {
return syncOnceV2SettingsReturnValue
}
}
//MARK: - syncService
private let syncServiceCallsCountLock = NSLock()
private var syncServiceUnderlyingCallsCount = 0
open var syncServiceCallsCount: Int {
get { syncServiceCallsCountLock.withLock { syncServiceUnderlyingCallsCount } }
set { syncServiceCallsCountLock.withLock { syncServiceUnderlyingCallsCount = newValue } }
}
open var syncServiceCalled: Bool {
return syncServiceCallsCount > 0
}
private let syncServiceReturnValueLock = NSLock()
open var syncServiceUnderlyingReturnValue: SyncServiceBuilder!
open var syncServiceReturnValue: SyncServiceBuilder! {
get { syncServiceReturnValueLock.withLock { syncServiceUnderlyingReturnValue } }
set { syncServiceReturnValueLock.withLock { syncServiceUnderlyingReturnValue = newValue } }
}
open var syncServiceClosure: (() -> SyncServiceBuilder)?
open override func syncService() -> SyncServiceBuilder {
syncServiceCallsCountLock.withLock { syncServiceUnderlyingCallsCount += 1 }
if let syncServiceClosure = syncServiceClosure {
return syncServiceClosure()
} else {
return syncServiceReturnValue
}
}
//MARK: - syncV2
private let syncV2SettingsListenerCallsCountLock = NSLock()
private var syncV2SettingsListenerUnderlyingCallsCount = 0
open var syncV2SettingsListenerCallsCount: Int {
get { syncV2SettingsListenerCallsCountLock.withLock { syncV2SettingsListenerUnderlyingCallsCount } }
set { syncV2SettingsListenerCallsCountLock.withLock { syncV2SettingsListenerUnderlyingCallsCount = newValue } }
}
open var syncV2SettingsListenerCalled: Bool {
return syncV2SettingsListenerCallsCount > 0
}
private let syncV2SettingsListenerReceivedArgumentsLock = NSLock()
private var syncV2SettingsListenerUnderlyingReceivedArguments: (settings: SyncSettingsV2, listener: SyncListenerV2)?
open var syncV2SettingsListenerReceivedArguments: (settings: SyncSettingsV2, listener: SyncListenerV2)? {
get { syncV2SettingsListenerReceivedArgumentsLock.withLock { syncV2SettingsListenerUnderlyingReceivedArguments } }
set { syncV2SettingsListenerReceivedArgumentsLock.withLock { syncV2SettingsListenerUnderlyingReceivedArguments = newValue } }
}
private let syncV2SettingsListenerReceivedInvocationsLock = NSLock()
private var syncV2SettingsListenerUnderlyingReceivedInvocations: [(settings: SyncSettingsV2, listener: SyncListenerV2)] = []
open var syncV2SettingsListenerReceivedInvocations: [(settings: SyncSettingsV2, listener: SyncListenerV2)] {
get { syncV2SettingsListenerReceivedInvocationsLock.withLock { syncV2SettingsListenerUnderlyingReceivedInvocations } }
set { syncV2SettingsListenerReceivedInvocationsLock.withLock { syncV2SettingsListenerUnderlyingReceivedInvocations = newValue } }
}
private let syncV2SettingsListenerReturnValueLock = NSLock()
open var syncV2SettingsListenerUnderlyingReturnValue: TaskHandle!
open var syncV2SettingsListenerReturnValue: TaskHandle! {
get { syncV2SettingsListenerReturnValueLock.withLock { syncV2SettingsListenerUnderlyingReturnValue } }
set { syncV2SettingsListenerReturnValueLock.withLock { syncV2SettingsListenerUnderlyingReturnValue = newValue } }
}
open var syncV2SettingsListenerClosure: ((SyncSettingsV2, SyncListenerV2) -> TaskHandle)?
open override func syncV2(settings: SyncSettingsV2, listener: SyncListenerV2) -> TaskHandle {
syncV2SettingsListenerCallsCountLock.withLock { syncV2SettingsListenerUnderlyingCallsCount += 1 }
syncV2SettingsListenerReceivedArguments = (settings: settings, listener: listener)
syncV2SettingsListenerReceivedInvocationsLock.withLock { syncV2SettingsListenerUnderlyingReceivedInvocations.append((settings: settings, listener: listener)) }
if let syncV2SettingsListenerClosure = syncV2SettingsListenerClosure {
return syncV2SettingsListenerClosure(settings, listener)
} else {
return syncV2SettingsListenerReturnValue
}
}
//MARK: - tileServer
private let tileServerCallsCountLock = NSLock()
private var tileServerUnderlyingCallsCount = 0
open var tileServerCallsCount: Int {
get { tileServerCallsCountLock.withLock { tileServerUnderlyingCallsCount } }
set { tileServerCallsCountLock.withLock { tileServerUnderlyingCallsCount = newValue } }
}
open var tileServerCalled: Bool {
return tileServerCallsCount > 0
}
private let tileServerReturnValueLock = NSLock()
open var tileServerUnderlyingReturnValue: TileServerInfo?
open var tileServerReturnValue: TileServerInfo? {
get { tileServerReturnValueLock.withLock { tileServerUnderlyingReturnValue } }
set { tileServerReturnValueLock.withLock { tileServerUnderlyingReturnValue = newValue } }
}
open var tileServerClosure: (() async -> TileServerInfo?)?
open override func tileServer() async -> TileServerInfo? {
tileServerCallsCountLock.withLock { tileServerUnderlyingCallsCount += 1 }
if let tileServerClosure = tileServerClosure {
return await tileServerClosure()
} else {
return tileServerReturnValue
}
}
//MARK: - totalUnreadNotifications
private let totalUnreadNotificationsCallsCountLock = NSLock()
private var totalUnreadNotificationsUnderlyingCallsCount = 0
open var totalUnreadNotificationsCallsCount: Int {
get { totalUnreadNotificationsCallsCountLock.withLock { totalUnreadNotificationsUnderlyingCallsCount } }
set { totalUnreadNotificationsCallsCountLock.withLock { totalUnreadNotificationsUnderlyingCallsCount = newValue } }
}
open var totalUnreadNotificationsCalled: Bool {
return totalUnreadNotificationsCallsCount > 0
}
private let totalUnreadNotificationsReturnValueLock = NSLock()
open var totalUnreadNotificationsUnderlyingReturnValue: UInt64!
open var totalUnreadNotificationsReturnValue: UInt64! {
get { totalUnreadNotificationsReturnValueLock.withLock { totalUnreadNotificationsUnderlyingReturnValue } }
set { totalUnreadNotificationsReturnValueLock.withLock { totalUnreadNotificationsUnderlyingReturnValue = newValue } }
}
open var totalUnreadNotificationsClosure: (() -> UInt64)?
open override func totalUnreadNotifications() -> UInt64 {
totalUnreadNotificationsCallsCountLock.withLock { totalUnreadNotificationsUnderlyingCallsCount += 1 }
if let totalUnreadNotificationsClosure = totalUnreadNotificationsClosure {
return totalUnreadNotificationsClosure()
} else {
return totalUnreadNotificationsReturnValue
}
}
//MARK: - trackRecentlyVisitedRoom
open var trackRecentlyVisitedRoomRoomThrowableError: Error?
private let trackRecentlyVisitedRoomRoomCallsCountLock = NSLock()
private var trackRecentlyVisitedRoomRoomUnderlyingCallsCount = 0
open var trackRecentlyVisitedRoomRoomCallsCount: Int {
get { trackRecentlyVisitedRoomRoomCallsCountLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingCallsCount } }
set { trackRecentlyVisitedRoomRoomCallsCountLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingCallsCount = newValue } }
}
open var trackRecentlyVisitedRoomRoomCalled: Bool {
return trackRecentlyVisitedRoomRoomCallsCount > 0
}
private let trackRecentlyVisitedRoomRoomReceivedRoomLock = NSLock()
private var trackRecentlyVisitedRoomRoomUnderlyingReceivedRoom: String?
open var trackRecentlyVisitedRoomRoomReceivedRoom: String? {
get { trackRecentlyVisitedRoomRoomReceivedRoomLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingReceivedRoom } }
set { trackRecentlyVisitedRoomRoomReceivedRoomLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingReceivedRoom = newValue } }
}
private let trackRecentlyVisitedRoomRoomReceivedInvocationsLock = NSLock()
private var trackRecentlyVisitedRoomRoomUnderlyingReceivedInvocations: [String] = []
open var trackRecentlyVisitedRoomRoomReceivedInvocations: [String] {
get { trackRecentlyVisitedRoomRoomReceivedInvocationsLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingReceivedInvocations } }
set { trackRecentlyVisitedRoomRoomReceivedInvocationsLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingReceivedInvocations = newValue } }
}
open var trackRecentlyVisitedRoomRoomClosure: ((String) async throws -> Void)?
open override func trackRecentlyVisitedRoom(room: String) async throws {
if let error = trackRecentlyVisitedRoomRoomThrowableError {
throw error
}
trackRecentlyVisitedRoomRoomCallsCountLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingCallsCount += 1 }
trackRecentlyVisitedRoomRoomReceivedRoom = room
trackRecentlyVisitedRoomRoomReceivedInvocationsLock.withLock { trackRecentlyVisitedRoomRoomUnderlyingReceivedInvocations.append(room) }
try await trackRecentlyVisitedRoomRoomClosure?(room)
}
//MARK: - unignoreUser
open var unignoreUserUserIdThrowableError: Error?
private let unignoreUserUserIdCallsCountLock = NSLock()
private var unignoreUserUserIdUnderlyingCallsCount = 0
open var unignoreUserUserIdCallsCount: Int {
get { unignoreUserUserIdCallsCountLock.withLock { unignoreUserUserIdUnderlyingCallsCount } }
set { unignoreUserUserIdCallsCountLock.withLock { unignoreUserUserIdUnderlyingCallsCount = newValue } }
}
open var unignoreUserUserIdCalled: Bool {
return unignoreUserUserIdCallsCount > 0
}
private let unignoreUserUserIdReceivedUserIdLock = NSLock()
private var unignoreUserUserIdUnderlyingReceivedUserId: String?
open var unignoreUserUserIdReceivedUserId: String? {
get { unignoreUserUserIdReceivedUserIdLock.withLock { unignoreUserUserIdUnderlyingReceivedUserId } }
set { unignoreUserUserIdReceivedUserIdLock.withLock { unignoreUserUserIdUnderlyingReceivedUserId = newValue } }
}
private let unignoreUserUserIdReceivedInvocationsLock = NSLock()
private var unignoreUserUserIdUnderlyingReceivedInvocations: [String] = []
open var unignoreUserUserIdReceivedInvocations: [String] {
get { unignoreUserUserIdReceivedInvocationsLock.withLock { unignoreUserUserIdUnderlyingReceivedInvocations } }
set { unignoreUserUserIdReceivedInvocationsLock.withLock { unignoreUserUserIdUnderlyingReceivedInvocations = newValue } }
}
open var unignoreUserUserIdClosure: ((String) async throws -> Void)?
open override func unignoreUser(userId: String) async throws {
if let error = unignoreUserUserIdThrowableError {
throw error
}
unignoreUserUserIdCallsCountLock.withLock { unignoreUserUserIdUnderlyingCallsCount += 1 }
unignoreUserUserIdReceivedUserId = userId
unignoreUserUserIdReceivedInvocationsLock.withLock { unignoreUserUserIdUnderlyingReceivedInvocations.append(userId) }
try await unignoreUserUserIdClosure?(userId)
}
//MARK: - uploadAvatar
open var uploadAvatarMimeTypeDataThrowableError: Error?
private let uploadAvatarMimeTypeDataCallsCountLock = NSLock()
private var uploadAvatarMimeTypeDataUnderlyingCallsCount = 0
open var uploadAvatarMimeTypeDataCallsCount: Int {
get { uploadAvatarMimeTypeDataCallsCountLock.withLock { uploadAvatarMimeTypeDataUnderlyingCallsCount } }
set { uploadAvatarMimeTypeDataCallsCountLock.withLock { uploadAvatarMimeTypeDataUnderlyingCallsCount = newValue } }
}
open var uploadAvatarMimeTypeDataCalled: Bool {
return uploadAvatarMimeTypeDataCallsCount > 0
}
private let uploadAvatarMimeTypeDataReceivedArgumentsLock = NSLock()
private var uploadAvatarMimeTypeDataUnderlyingReceivedArguments: (mimeType: String, data: Data)?
open var uploadAvatarMimeTypeDataReceivedArguments: (mimeType: String, data: Data)? {
get { uploadAvatarMimeTypeDataReceivedArgumentsLock.withLock { uploadAvatarMimeTypeDataUnderlyingReceivedArguments } }
set { uploadAvatarMimeTypeDataReceivedArgumentsLock.withLock { uploadAvatarMimeTypeDataUnderlyingReceivedArguments = newValue } }
}
private let uploadAvatarMimeTypeDataReceivedInvocationsLock = NSLock()
private var uploadAvatarMimeTypeDataUnderlyingReceivedInvocations: [(mimeType: String, data: Data)] = []
open var uploadAvatarMimeTypeDataReceivedInvocations: [(mimeType: String, data: Data)] {
get { uploadAvatarMimeTypeDataReceivedInvocationsLock.withLock { uploadAvatarMimeTypeDataUnderlyingReceivedInvocations } }
set { uploadAvatarMimeTypeDataReceivedInvocationsLock.withLock { uploadAvatarMimeTypeDataUnderlyingReceivedInvocations = newValue } }
}
open var uploadAvatarMimeTypeDataClosure: ((String, Data) async throws -> Void)?
open override func uploadAvatar(mimeType: String, data: Data) async throws {
if let error = uploadAvatarMimeTypeDataThrowableError {
throw error
}
uploadAvatarMimeTypeDataCallsCountLock.withLock { uploadAvatarMimeTypeDataUnderlyingCallsCount += 1 }
uploadAvatarMimeTypeDataReceivedArguments = (mimeType: mimeType, data: data)
uploadAvatarMimeTypeDataReceivedInvocationsLock.withLock { uploadAvatarMimeTypeDataUnderlyingReceivedInvocations.append((mimeType: mimeType, data: data)) }
try await uploadAvatarMimeTypeDataClosure?(mimeType, data)
}
//MARK: - uploadMedia
open var uploadMediaMimeTypeDataProgressWatcherThrowableError: Error?
private let uploadMediaMimeTypeDataProgressWatcherCallsCountLock = NSLock()
private var uploadMediaMimeTypeDataProgressWatcherUnderlyingCallsCount = 0
open var uploadMediaMimeTypeDataProgressWatcherCallsCount: Int {
get { uploadMediaMimeTypeDataProgressWatcherCallsCountLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingCallsCount } }
set { uploadMediaMimeTypeDataProgressWatcherCallsCountLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingCallsCount = newValue } }
}
open var uploadMediaMimeTypeDataProgressWatcherCalled: Bool {
return uploadMediaMimeTypeDataProgressWatcherCallsCount > 0
}
private let uploadMediaMimeTypeDataProgressWatcherReceivedArgumentsLock = NSLock()
private var uploadMediaMimeTypeDataProgressWatcherUnderlyingReceivedArguments: (mimeType: String, data: Data, progressWatcher: ProgressWatcher?)?
open var uploadMediaMimeTypeDataProgressWatcherReceivedArguments: (mimeType: String, data: Data, progressWatcher: ProgressWatcher?)? {
get { uploadMediaMimeTypeDataProgressWatcherReceivedArgumentsLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingReceivedArguments } }
set { uploadMediaMimeTypeDataProgressWatcherReceivedArgumentsLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingReceivedArguments = newValue } }
}
private let uploadMediaMimeTypeDataProgressWatcherReceivedInvocationsLock = NSLock()
private var uploadMediaMimeTypeDataProgressWatcherUnderlyingReceivedInvocations: [(mimeType: String, data: Data, progressWatcher: ProgressWatcher?)] = []
open var uploadMediaMimeTypeDataProgressWatcherReceivedInvocations: [(mimeType: String, data: Data, progressWatcher: ProgressWatcher?)] {
get { uploadMediaMimeTypeDataProgressWatcherReceivedInvocationsLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingReceivedInvocations } }
set { uploadMediaMimeTypeDataProgressWatcherReceivedInvocationsLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingReceivedInvocations = newValue } }
}
private let uploadMediaMimeTypeDataProgressWatcherReturnValueLock = NSLock()
open var uploadMediaMimeTypeDataProgressWatcherUnderlyingReturnValue: String!
open var uploadMediaMimeTypeDataProgressWatcherReturnValue: String! {
get { uploadMediaMimeTypeDataProgressWatcherReturnValueLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingReturnValue } }
set { uploadMediaMimeTypeDataProgressWatcherReturnValueLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingReturnValue = newValue } }
}
open var uploadMediaMimeTypeDataProgressWatcherClosure: ((String, Data, ProgressWatcher?) async throws -> String)?
open override func uploadMedia(mimeType: String, data: Data, progressWatcher: ProgressWatcher?) async throws -> String {
if let error = uploadMediaMimeTypeDataProgressWatcherThrowableError {
throw error
}
uploadMediaMimeTypeDataProgressWatcherCallsCountLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingCallsCount += 1 }
uploadMediaMimeTypeDataProgressWatcherReceivedArguments = (mimeType: mimeType, data: data, progressWatcher: progressWatcher)
uploadMediaMimeTypeDataProgressWatcherReceivedInvocationsLock.withLock { uploadMediaMimeTypeDataProgressWatcherUnderlyingReceivedInvocations.append((mimeType: mimeType, data: data, progressWatcher: progressWatcher)) }
if let uploadMediaMimeTypeDataProgressWatcherClosure = uploadMediaMimeTypeDataProgressWatcherClosure {
return try await uploadMediaMimeTypeDataProgressWatcherClosure(mimeType, data, progressWatcher)
} else {
return uploadMediaMimeTypeDataProgressWatcherReturnValue
}
}
//MARK: - urlForOauth
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesThrowableError: Error?
private let urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesCallsCountLock = NSLock()
private var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingCallsCount = 0
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesCallsCount: Int {
get { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesCallsCountLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingCallsCount } }
set { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesCallsCountLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingCallsCount = newValue } }
}
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesCalled: Bool {
return urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesCallsCount > 0
}
private let urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedArgumentsLock = NSLock()
private var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReceivedArguments: (oauthConfiguration: OAuthConfiguration, prompt: OAuthPrompt?, loginHint: String?, deviceId: String?, additionalScopes: [String]?)?
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedArguments: (oauthConfiguration: OAuthConfiguration, prompt: OAuthPrompt?, loginHint: String?, deviceId: String?, additionalScopes: [String]?)? {
get { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedArgumentsLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReceivedArguments } }
set { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedArgumentsLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReceivedArguments = newValue } }
}
private let urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedInvocationsLock = NSLock()
private var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReceivedInvocations: [(oauthConfiguration: OAuthConfiguration, prompt: OAuthPrompt?, loginHint: String?, deviceId: String?, additionalScopes: [String]?)] = []
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedInvocations: [(oauthConfiguration: OAuthConfiguration, prompt: OAuthPrompt?, loginHint: String?, deviceId: String?, additionalScopes: [String]?)] {
get { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedInvocationsLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReceivedInvocations } }
set { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedInvocationsLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReceivedInvocations = newValue } }
}
private let urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReturnValueLock = NSLock()
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReturnValue: OAuthAuthorizationData!
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReturnValue: OAuthAuthorizationData! {
get { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReturnValueLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReturnValue } }
set { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReturnValueLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReturnValue = newValue } }
}
open var urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesClosure: ((OAuthConfiguration, OAuthPrompt?, String?, String?, [String]?) async throws -> OAuthAuthorizationData)?
open override func urlForOauth(oauthConfiguration: OAuthConfiguration, prompt: OAuthPrompt?, loginHint: String?, deviceId: String?, additionalScopes: [String]?) async throws -> OAuthAuthorizationData {
if let error = urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesThrowableError {
throw error
}
urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesCallsCountLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingCallsCount += 1 }
urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedArguments = (oauthConfiguration: oauthConfiguration, prompt: prompt, loginHint: loginHint, deviceId: deviceId, additionalScopes: additionalScopes)
urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReceivedInvocationsLock.withLock { urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesUnderlyingReceivedInvocations.append((oauthConfiguration: oauthConfiguration, prompt: prompt, loginHint: loginHint, deviceId: deviceId, additionalScopes: additionalScopes)) }
if let urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesClosure = urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesClosure {
return try await urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesClosure(oauthConfiguration, prompt, loginHint, deviceId, additionalScopes)
} else {
return urlForOauthOauthConfigurationPromptLoginHintDeviceIdAdditionalScopesReturnValue
}
}
//MARK: - userId
open var userIdThrowableError: Error?
private let userIdCallsCountLock = NSLock()
private var userIdUnderlyingCallsCount = 0
open var userIdCallsCount: Int {
get { userIdCallsCountLock.withLock { userIdUnderlyingCallsCount } }
set { userIdCallsCountLock.withLock { userIdUnderlyingCallsCount = newValue } }
}
open var userIdCalled: Bool {
return userIdCallsCount > 0
}
private let userIdReturnValueLock = NSLock()
open var userIdUnderlyingReturnValue: String!
open var userIdReturnValue: String! {
get { userIdReturnValueLock.withLock { userIdUnderlyingReturnValue } }
set { userIdReturnValueLock.withLock { userIdUnderlyingReturnValue = newValue } }
}
open var userIdClosure: (() throws -> String)?
open override func userId() throws -> String {
if let error = userIdThrowableError {
throw error
}
userIdCallsCountLock.withLock { userIdUnderlyingCallsCount += 1 }
if let userIdClosure = userIdClosure {
return try userIdClosure()
} else {
return userIdReturnValue
}
}
//MARK: - userIdServerName
open var userIdServerNameThrowableError: Error?
private let userIdServerNameCallsCountLock = NSLock()
private var userIdServerNameUnderlyingCallsCount = 0
open var userIdServerNameCallsCount: Int {
get { userIdServerNameCallsCountLock.withLock { userIdServerNameUnderlyingCallsCount } }
set { userIdServerNameCallsCountLock.withLock { userIdServerNameUnderlyingCallsCount = newValue } }
}
open var userIdServerNameCalled: Bool {
return userIdServerNameCallsCount > 0
}
private let userIdServerNameReturnValueLock = NSLock()
open var userIdServerNameUnderlyingReturnValue: String!
open var userIdServerNameReturnValue: String! {
get { userIdServerNameReturnValueLock.withLock { userIdServerNameUnderlyingReturnValue } }
set { userIdServerNameReturnValueLock.withLock { userIdServerNameUnderlyingReturnValue = newValue } }
}
open var userIdServerNameClosure: (() throws -> String)?
open override func userIdServerName() throws -> String {
if let error = userIdServerNameThrowableError {
throw error
}
userIdServerNameCallsCountLock.withLock { userIdServerNameUnderlyingCallsCount += 1 }
if let userIdServerNameClosure = userIdServerNameClosure {
return try userIdServerNameClosure()
} else {
return userIdServerNameReturnValue
}
}
//MARK: - addRecentEmoji
open var addRecentEmojiEmojiThrowableError: Error?
private let addRecentEmojiEmojiCallsCountLock = NSLock()
private var addRecentEmojiEmojiUnderlyingCallsCount = 0
open var addRecentEmojiEmojiCallsCount: Int {
get { addRecentEmojiEmojiCallsCountLock.withLock { addRecentEmojiEmojiUnderlyingCallsCount } }
set { addRecentEmojiEmojiCallsCountLock.withLock { addRecentEmojiEmojiUnderlyingCallsCount = newValue } }
}
open var addRecentEmojiEmojiCalled: Bool {
return addRecentEmojiEmojiCallsCount > 0
}
private let addRecentEmojiEmojiReceivedEmojiLock = NSLock()
private var addRecentEmojiEmojiUnderlyingReceivedEmoji: String?
open var addRecentEmojiEmojiReceivedEmoji: String? {
get { addRecentEmojiEmojiReceivedEmojiLock.withLock { addRecentEmojiEmojiUnderlyingReceivedEmoji } }
set { addRecentEmojiEmojiReceivedEmojiLock.withLock { addRecentEmojiEmojiUnderlyingReceivedEmoji = newValue } }
}
private let addRecentEmojiEmojiReceivedInvocationsLock = NSLock()
private var addRecentEmojiEmojiUnderlyingReceivedInvocations: [String] = []
open var addRecentEmojiEmojiReceivedInvocations: [String] {
get { addRecentEmojiEmojiReceivedInvocationsLock.withLock { addRecentEmojiEmojiUnderlyingReceivedInvocations } }
set { addRecentEmojiEmojiReceivedInvocationsLock.withLock { addRecentEmojiEmojiUnderlyingReceivedInvocations = newValue } }
}
open var addRecentEmojiEmojiClosure: ((String) async throws -> Void)?
open override func addRecentEmoji(emoji: String) async throws {
if let error = addRecentEmojiEmojiThrowableError {
throw error
}
addRecentEmojiEmojiCallsCountLock.withLock { addRecentEmojiEmojiUnderlyingCallsCount += 1 }
addRecentEmojiEmojiReceivedEmoji = emoji
addRecentEmojiEmojiReceivedInvocationsLock.withLock { addRecentEmojiEmojiUnderlyingReceivedInvocations.append(emoji) }
try await addRecentEmojiEmojiClosure?(emoji)
}
//MARK: - getRecentEmojis
open var getRecentEmojisThrowableError: Error?
private let getRecentEmojisCallsCountLock = NSLock()
private var getRecentEmojisUnderlyingCallsCount = 0
open var getRecentEmojisCallsCount: Int {
get { getRecentEmojisCallsCountLock.withLock { getRecentEmojisUnderlyingCallsCount } }
set { getRecentEmojisCallsCountLock.withLock { getRecentEmojisUnderlyingCallsCount = newValue } }
}
open var getRecentEmojisCalled: Bool {
return getRecentEmojisCallsCount > 0
}
private let getRecentEmojisReturnValueLock = NSLock()
open var getRecentEmojisUnderlyingReturnValue: [RecentEmoji]!
open var getRecentEmojisReturnValue: [RecentEmoji]! {
get { getRecentEmojisReturnValueLock.withLock { getRecentEmojisUnderlyingReturnValue } }
set { getRecentEmojisReturnValueLock.withLock { getRecentEmojisUnderlyingReturnValue = newValue } }
}
open var getRecentEmojisClosure: (() async throws -> [RecentEmoji])?
open override func getRecentEmojis() async throws -> [RecentEmoji] {
if let error = getRecentEmojisThrowableError {
throw error
}
getRecentEmojisCallsCountLock.withLock { getRecentEmojisUnderlyingCallsCount += 1 }
if let getRecentEmojisClosure = getRecentEmojisClosure {
return try await getRecentEmojisClosure()
} else {
return getRecentEmojisReturnValue
}
}
//MARK: - searchService
private let searchServiceCallsCountLock = NSLock()
private var searchServiceUnderlyingCallsCount = 0
open var searchServiceCallsCount: Int {
get { searchServiceCallsCountLock.withLock { searchServiceUnderlyingCallsCount } }
set { searchServiceCallsCountLock.withLock { searchServiceUnderlyingCallsCount = newValue } }
}
open var searchServiceCalled: Bool {
return searchServiceCallsCount > 0
}
private let searchServiceReturnValueLock = NSLock()
open var searchServiceUnderlyingReturnValue: SearchService!
open var searchServiceReturnValue: SearchService! {
get { searchServiceReturnValueLock.withLock { searchServiceUnderlyingReturnValue } }
set { searchServiceReturnValueLock.withLock { searchServiceUnderlyingReturnValue = newValue } }
}
open var searchServiceClosure: (() -> SearchService)?
open override func searchService() -> SearchService {
searchServiceCallsCountLock.withLock { searchServiceUnderlyingCallsCount += 1 }
if let searchServiceClosure = searchServiceClosure {
return searchServiceClosure()
} else {
return searchServiceReturnValue
}
}
}
open class ClientBuilderSDKMock: MatrixRustSDK.ClientBuilder, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - addRootCertificates
private let addRootCertificatesCertificatesCallsCountLock = NSLock()
private var addRootCertificatesCertificatesUnderlyingCallsCount = 0
open var addRootCertificatesCertificatesCallsCount: Int {
get { addRootCertificatesCertificatesCallsCountLock.withLock { addRootCertificatesCertificatesUnderlyingCallsCount } }
set { addRootCertificatesCertificatesCallsCountLock.withLock { addRootCertificatesCertificatesUnderlyingCallsCount = newValue } }
}
open var addRootCertificatesCertificatesCalled: Bool {
return addRootCertificatesCertificatesCallsCount > 0
}
private let addRootCertificatesCertificatesReceivedCertificatesLock = NSLock()
private var addRootCertificatesCertificatesUnderlyingReceivedCertificates: [Data]?
open var addRootCertificatesCertificatesReceivedCertificates: [Data]? {
get { addRootCertificatesCertificatesReceivedCertificatesLock.withLock { addRootCertificatesCertificatesUnderlyingReceivedCertificates } }
set { addRootCertificatesCertificatesReceivedCertificatesLock.withLock { addRootCertificatesCertificatesUnderlyingReceivedCertificates = newValue } }
}
private let addRootCertificatesCertificatesReceivedInvocationsLock = NSLock()
private var addRootCertificatesCertificatesUnderlyingReceivedInvocations: [[Data]] = []
open var addRootCertificatesCertificatesReceivedInvocations: [[Data]] {
get { addRootCertificatesCertificatesReceivedInvocationsLock.withLock { addRootCertificatesCertificatesUnderlyingReceivedInvocations } }
set { addRootCertificatesCertificatesReceivedInvocationsLock.withLock { addRootCertificatesCertificatesUnderlyingReceivedInvocations = newValue } }
}
private let addRootCertificatesCertificatesReturnValueLock = NSLock()
open var addRootCertificatesCertificatesUnderlyingReturnValue: ClientBuilder!
open var addRootCertificatesCertificatesReturnValue: ClientBuilder! {
get { addRootCertificatesCertificatesReturnValueLock.withLock { addRootCertificatesCertificatesUnderlyingReturnValue } }
set { addRootCertificatesCertificatesReturnValueLock.withLock { addRootCertificatesCertificatesUnderlyingReturnValue = newValue } }
}
open var addRootCertificatesCertificatesClosure: (([Data]) -> ClientBuilder)?
open override func addRootCertificates(certificates: [Data]) -> ClientBuilder {
addRootCertificatesCertificatesCallsCountLock.withLock { addRootCertificatesCertificatesUnderlyingCallsCount += 1 }
addRootCertificatesCertificatesReceivedCertificates = certificates
addRootCertificatesCertificatesReceivedInvocationsLock.withLock { addRootCertificatesCertificatesUnderlyingReceivedInvocations.append(certificates) }
if let addRootCertificatesCertificatesClosure = addRootCertificatesCertificatesClosure {
return addRootCertificatesCertificatesClosure(certificates)
} else {
return addRootCertificatesCertificatesReturnValue
}
}
//MARK: - autoEnableBackups
private let autoEnableBackupsAutoEnableBackupsCallsCountLock = NSLock()
private var autoEnableBackupsAutoEnableBackupsUnderlyingCallsCount = 0
open var autoEnableBackupsAutoEnableBackupsCallsCount: Int {
get { autoEnableBackupsAutoEnableBackupsCallsCountLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingCallsCount } }
set { autoEnableBackupsAutoEnableBackupsCallsCountLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingCallsCount = newValue } }
}
open var autoEnableBackupsAutoEnableBackupsCalled: Bool {
return autoEnableBackupsAutoEnableBackupsCallsCount > 0
}
private let autoEnableBackupsAutoEnableBackupsReceivedAutoEnableBackupsLock = NSLock()
private var autoEnableBackupsAutoEnableBackupsUnderlyingReceivedAutoEnableBackups: Bool?
open var autoEnableBackupsAutoEnableBackupsReceivedAutoEnableBackups: Bool? {
get { autoEnableBackupsAutoEnableBackupsReceivedAutoEnableBackupsLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingReceivedAutoEnableBackups } }
set { autoEnableBackupsAutoEnableBackupsReceivedAutoEnableBackupsLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingReceivedAutoEnableBackups = newValue } }
}
private let autoEnableBackupsAutoEnableBackupsReceivedInvocationsLock = NSLock()
private var autoEnableBackupsAutoEnableBackupsUnderlyingReceivedInvocations: [Bool] = []
open var autoEnableBackupsAutoEnableBackupsReceivedInvocations: [Bool] {
get { autoEnableBackupsAutoEnableBackupsReceivedInvocationsLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingReceivedInvocations } }
set { autoEnableBackupsAutoEnableBackupsReceivedInvocationsLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingReceivedInvocations = newValue } }
}
private let autoEnableBackupsAutoEnableBackupsReturnValueLock = NSLock()
open var autoEnableBackupsAutoEnableBackupsUnderlyingReturnValue: ClientBuilder!
open var autoEnableBackupsAutoEnableBackupsReturnValue: ClientBuilder! {
get { autoEnableBackupsAutoEnableBackupsReturnValueLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingReturnValue } }
set { autoEnableBackupsAutoEnableBackupsReturnValueLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingReturnValue = newValue } }
}
open var autoEnableBackupsAutoEnableBackupsClosure: ((Bool) -> ClientBuilder)?
open override func autoEnableBackups(autoEnableBackups: Bool) -> ClientBuilder {
autoEnableBackupsAutoEnableBackupsCallsCountLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingCallsCount += 1 }
autoEnableBackupsAutoEnableBackupsReceivedAutoEnableBackups = autoEnableBackups
autoEnableBackupsAutoEnableBackupsReceivedInvocationsLock.withLock { autoEnableBackupsAutoEnableBackupsUnderlyingReceivedInvocations.append(autoEnableBackups) }
if let autoEnableBackupsAutoEnableBackupsClosure = autoEnableBackupsAutoEnableBackupsClosure {
return autoEnableBackupsAutoEnableBackupsClosure(autoEnableBackups)
} else {
return autoEnableBackupsAutoEnableBackupsReturnValue
}
}
//MARK: - autoEnableCrossSigning
private let autoEnableCrossSigningAutoEnableCrossSigningCallsCountLock = NSLock()
private var autoEnableCrossSigningAutoEnableCrossSigningUnderlyingCallsCount = 0
open var autoEnableCrossSigningAutoEnableCrossSigningCallsCount: Int {
get { autoEnableCrossSigningAutoEnableCrossSigningCallsCountLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingCallsCount } }
set { autoEnableCrossSigningAutoEnableCrossSigningCallsCountLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingCallsCount = newValue } }
}
open var autoEnableCrossSigningAutoEnableCrossSigningCalled: Bool {
return autoEnableCrossSigningAutoEnableCrossSigningCallsCount > 0
}
private let autoEnableCrossSigningAutoEnableCrossSigningReceivedAutoEnableCrossSigningLock = NSLock()
private var autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReceivedAutoEnableCrossSigning: Bool?
open var autoEnableCrossSigningAutoEnableCrossSigningReceivedAutoEnableCrossSigning: Bool? {
get { autoEnableCrossSigningAutoEnableCrossSigningReceivedAutoEnableCrossSigningLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReceivedAutoEnableCrossSigning } }
set { autoEnableCrossSigningAutoEnableCrossSigningReceivedAutoEnableCrossSigningLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReceivedAutoEnableCrossSigning = newValue } }
}
private let autoEnableCrossSigningAutoEnableCrossSigningReceivedInvocationsLock = NSLock()
private var autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReceivedInvocations: [Bool] = []
open var autoEnableCrossSigningAutoEnableCrossSigningReceivedInvocations: [Bool] {
get { autoEnableCrossSigningAutoEnableCrossSigningReceivedInvocationsLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReceivedInvocations } }
set { autoEnableCrossSigningAutoEnableCrossSigningReceivedInvocationsLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReceivedInvocations = newValue } }
}
private let autoEnableCrossSigningAutoEnableCrossSigningReturnValueLock = NSLock()
open var autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReturnValue: ClientBuilder!
open var autoEnableCrossSigningAutoEnableCrossSigningReturnValue: ClientBuilder! {
get { autoEnableCrossSigningAutoEnableCrossSigningReturnValueLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReturnValue } }
set { autoEnableCrossSigningAutoEnableCrossSigningReturnValueLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReturnValue = newValue } }
}
open var autoEnableCrossSigningAutoEnableCrossSigningClosure: ((Bool) -> ClientBuilder)?
open override func autoEnableCrossSigning(autoEnableCrossSigning: Bool) -> ClientBuilder {
autoEnableCrossSigningAutoEnableCrossSigningCallsCountLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingCallsCount += 1 }
autoEnableCrossSigningAutoEnableCrossSigningReceivedAutoEnableCrossSigning = autoEnableCrossSigning
autoEnableCrossSigningAutoEnableCrossSigningReceivedInvocationsLock.withLock { autoEnableCrossSigningAutoEnableCrossSigningUnderlyingReceivedInvocations.append(autoEnableCrossSigning) }
if let autoEnableCrossSigningAutoEnableCrossSigningClosure = autoEnableCrossSigningAutoEnableCrossSigningClosure {
return autoEnableCrossSigningAutoEnableCrossSigningClosure(autoEnableCrossSigning)
} else {
return autoEnableCrossSigningAutoEnableCrossSigningReturnValue
}
}
//MARK: - backupDownloadStrategy
private let backupDownloadStrategyBackupDownloadStrategyCallsCountLock = NSLock()
private var backupDownloadStrategyBackupDownloadStrategyUnderlyingCallsCount = 0
open var backupDownloadStrategyBackupDownloadStrategyCallsCount: Int {
get { backupDownloadStrategyBackupDownloadStrategyCallsCountLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingCallsCount } }
set { backupDownloadStrategyBackupDownloadStrategyCallsCountLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingCallsCount = newValue } }
}
open var backupDownloadStrategyBackupDownloadStrategyCalled: Bool {
return backupDownloadStrategyBackupDownloadStrategyCallsCount > 0
}
private let backupDownloadStrategyBackupDownloadStrategyReceivedBackupDownloadStrategyLock = NSLock()
private var backupDownloadStrategyBackupDownloadStrategyUnderlyingReceivedBackupDownloadStrategy: BackupDownloadStrategy?
open var backupDownloadStrategyBackupDownloadStrategyReceivedBackupDownloadStrategy: BackupDownloadStrategy? {
get { backupDownloadStrategyBackupDownloadStrategyReceivedBackupDownloadStrategyLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingReceivedBackupDownloadStrategy } }
set { backupDownloadStrategyBackupDownloadStrategyReceivedBackupDownloadStrategyLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingReceivedBackupDownloadStrategy = newValue } }
}
private let backupDownloadStrategyBackupDownloadStrategyReceivedInvocationsLock = NSLock()
private var backupDownloadStrategyBackupDownloadStrategyUnderlyingReceivedInvocations: [BackupDownloadStrategy] = []
open var backupDownloadStrategyBackupDownloadStrategyReceivedInvocations: [BackupDownloadStrategy] {
get { backupDownloadStrategyBackupDownloadStrategyReceivedInvocationsLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingReceivedInvocations } }
set { backupDownloadStrategyBackupDownloadStrategyReceivedInvocationsLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingReceivedInvocations = newValue } }
}
private let backupDownloadStrategyBackupDownloadStrategyReturnValueLock = NSLock()
open var backupDownloadStrategyBackupDownloadStrategyUnderlyingReturnValue: ClientBuilder!
open var backupDownloadStrategyBackupDownloadStrategyReturnValue: ClientBuilder! {
get { backupDownloadStrategyBackupDownloadStrategyReturnValueLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingReturnValue } }
set { backupDownloadStrategyBackupDownloadStrategyReturnValueLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingReturnValue = newValue } }
}
open var backupDownloadStrategyBackupDownloadStrategyClosure: ((BackupDownloadStrategy) -> ClientBuilder)?
open override func backupDownloadStrategy(backupDownloadStrategy: BackupDownloadStrategy) -> ClientBuilder {
backupDownloadStrategyBackupDownloadStrategyCallsCountLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingCallsCount += 1 }
backupDownloadStrategyBackupDownloadStrategyReceivedBackupDownloadStrategy = backupDownloadStrategy
backupDownloadStrategyBackupDownloadStrategyReceivedInvocationsLock.withLock { backupDownloadStrategyBackupDownloadStrategyUnderlyingReceivedInvocations.append(backupDownloadStrategy) }
if let backupDownloadStrategyBackupDownloadStrategyClosure = backupDownloadStrategyBackupDownloadStrategyClosure {
return backupDownloadStrategyBackupDownloadStrategyClosure(backupDownloadStrategy)
} else {
return backupDownloadStrategyBackupDownloadStrategyReturnValue
}
}
//MARK: - build
open var buildThrowableError: Error?
private let buildCallsCountLock = NSLock()
private var buildUnderlyingCallsCount = 0
open var buildCallsCount: Int {
get { buildCallsCountLock.withLock { buildUnderlyingCallsCount } }
set { buildCallsCountLock.withLock { buildUnderlyingCallsCount = newValue } }
}
open var buildCalled: Bool {
return buildCallsCount > 0
}
private let buildReturnValueLock = NSLock()
open var buildUnderlyingReturnValue: Client!
open var buildReturnValue: Client! {
get { buildReturnValueLock.withLock { buildUnderlyingReturnValue } }
set { buildReturnValueLock.withLock { buildUnderlyingReturnValue = newValue } }
}
open var buildClosure: (() async throws -> Client)?
open override func build() async throws -> Client {
if let error = buildThrowableError {
throw error
}
buildCallsCountLock.withLock { buildUnderlyingCallsCount += 1 }
if let buildClosure = buildClosure {
return try await buildClosure()
} else {
return buildReturnValue
}
}
//MARK: - crossProcessLockConfig
private let crossProcessLockConfigCrossProcessLockConfigCallsCountLock = NSLock()
private var crossProcessLockConfigCrossProcessLockConfigUnderlyingCallsCount = 0
open var crossProcessLockConfigCrossProcessLockConfigCallsCount: Int {
get { crossProcessLockConfigCrossProcessLockConfigCallsCountLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingCallsCount } }
set { crossProcessLockConfigCrossProcessLockConfigCallsCountLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingCallsCount = newValue } }
}
open var crossProcessLockConfigCrossProcessLockConfigCalled: Bool {
return crossProcessLockConfigCrossProcessLockConfigCallsCount > 0
}
private let crossProcessLockConfigCrossProcessLockConfigReceivedCrossProcessLockConfigLock = NSLock()
private var crossProcessLockConfigCrossProcessLockConfigUnderlyingReceivedCrossProcessLockConfig: CrossProcessLockConfig?
open var crossProcessLockConfigCrossProcessLockConfigReceivedCrossProcessLockConfig: CrossProcessLockConfig? {
get { crossProcessLockConfigCrossProcessLockConfigReceivedCrossProcessLockConfigLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingReceivedCrossProcessLockConfig } }
set { crossProcessLockConfigCrossProcessLockConfigReceivedCrossProcessLockConfigLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingReceivedCrossProcessLockConfig = newValue } }
}
private let crossProcessLockConfigCrossProcessLockConfigReceivedInvocationsLock = NSLock()
private var crossProcessLockConfigCrossProcessLockConfigUnderlyingReceivedInvocations: [CrossProcessLockConfig] = []
open var crossProcessLockConfigCrossProcessLockConfigReceivedInvocations: [CrossProcessLockConfig] {
get { crossProcessLockConfigCrossProcessLockConfigReceivedInvocationsLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingReceivedInvocations } }
set { crossProcessLockConfigCrossProcessLockConfigReceivedInvocationsLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingReceivedInvocations = newValue } }
}
private let crossProcessLockConfigCrossProcessLockConfigReturnValueLock = NSLock()
open var crossProcessLockConfigCrossProcessLockConfigUnderlyingReturnValue: ClientBuilder!
open var crossProcessLockConfigCrossProcessLockConfigReturnValue: ClientBuilder! {
get { crossProcessLockConfigCrossProcessLockConfigReturnValueLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingReturnValue } }
set { crossProcessLockConfigCrossProcessLockConfigReturnValueLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingReturnValue = newValue } }
}
open var crossProcessLockConfigCrossProcessLockConfigClosure: ((CrossProcessLockConfig) -> ClientBuilder)?
open override func crossProcessLockConfig(crossProcessLockConfig: CrossProcessLockConfig) -> ClientBuilder {
crossProcessLockConfigCrossProcessLockConfigCallsCountLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingCallsCount += 1 }
crossProcessLockConfigCrossProcessLockConfigReceivedCrossProcessLockConfig = crossProcessLockConfig
crossProcessLockConfigCrossProcessLockConfigReceivedInvocationsLock.withLock { crossProcessLockConfigCrossProcessLockConfigUnderlyingReceivedInvocations.append(crossProcessLockConfig) }
if let crossProcessLockConfigCrossProcessLockConfigClosure = crossProcessLockConfigCrossProcessLockConfigClosure {
return crossProcessLockConfigCrossProcessLockConfigClosure(crossProcessLockConfig)
} else {
return crossProcessLockConfigCrossProcessLockConfigReturnValue
}
}
//MARK: - decryptionSettings
private let decryptionSettingsDecryptionSettingsCallsCountLock = NSLock()
private var decryptionSettingsDecryptionSettingsUnderlyingCallsCount = 0
open var decryptionSettingsDecryptionSettingsCallsCount: Int {
get { decryptionSettingsDecryptionSettingsCallsCountLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingCallsCount } }
set { decryptionSettingsDecryptionSettingsCallsCountLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingCallsCount = newValue } }
}
open var decryptionSettingsDecryptionSettingsCalled: Bool {
return decryptionSettingsDecryptionSettingsCallsCount > 0
}
private let decryptionSettingsDecryptionSettingsReceivedDecryptionSettingsLock = NSLock()
private var decryptionSettingsDecryptionSettingsUnderlyingReceivedDecryptionSettings: DecryptionSettings?
open var decryptionSettingsDecryptionSettingsReceivedDecryptionSettings: DecryptionSettings? {
get { decryptionSettingsDecryptionSettingsReceivedDecryptionSettingsLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingReceivedDecryptionSettings } }
set { decryptionSettingsDecryptionSettingsReceivedDecryptionSettingsLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingReceivedDecryptionSettings = newValue } }
}
private let decryptionSettingsDecryptionSettingsReceivedInvocationsLock = NSLock()
private var decryptionSettingsDecryptionSettingsUnderlyingReceivedInvocations: [DecryptionSettings] = []
open var decryptionSettingsDecryptionSettingsReceivedInvocations: [DecryptionSettings] {
get { decryptionSettingsDecryptionSettingsReceivedInvocationsLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingReceivedInvocations } }
set { decryptionSettingsDecryptionSettingsReceivedInvocationsLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingReceivedInvocations = newValue } }
}
private let decryptionSettingsDecryptionSettingsReturnValueLock = NSLock()
open var decryptionSettingsDecryptionSettingsUnderlyingReturnValue: ClientBuilder!
open var decryptionSettingsDecryptionSettingsReturnValue: ClientBuilder! {
get { decryptionSettingsDecryptionSettingsReturnValueLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingReturnValue } }
set { decryptionSettingsDecryptionSettingsReturnValueLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingReturnValue = newValue } }
}
open var decryptionSettingsDecryptionSettingsClosure: ((DecryptionSettings) -> ClientBuilder)?
open override func decryptionSettings(decryptionSettings: DecryptionSettings) -> ClientBuilder {
decryptionSettingsDecryptionSettingsCallsCountLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingCallsCount += 1 }
decryptionSettingsDecryptionSettingsReceivedDecryptionSettings = decryptionSettings
decryptionSettingsDecryptionSettingsReceivedInvocationsLock.withLock { decryptionSettingsDecryptionSettingsUnderlyingReceivedInvocations.append(decryptionSettings) }
if let decryptionSettingsDecryptionSettingsClosure = decryptionSettingsDecryptionSettingsClosure {
return decryptionSettingsDecryptionSettingsClosure(decryptionSettings)
} else {
return decryptionSettingsDecryptionSettingsReturnValue
}
}
//MARK: - disableAutomaticTokenRefresh
private let disableAutomaticTokenRefreshCallsCountLock = NSLock()
private var disableAutomaticTokenRefreshUnderlyingCallsCount = 0
open var disableAutomaticTokenRefreshCallsCount: Int {
get { disableAutomaticTokenRefreshCallsCountLock.withLock { disableAutomaticTokenRefreshUnderlyingCallsCount } }
set { disableAutomaticTokenRefreshCallsCountLock.withLock { disableAutomaticTokenRefreshUnderlyingCallsCount = newValue } }
}
open var disableAutomaticTokenRefreshCalled: Bool {
return disableAutomaticTokenRefreshCallsCount > 0
}
private let disableAutomaticTokenRefreshReturnValueLock = NSLock()
open var disableAutomaticTokenRefreshUnderlyingReturnValue: ClientBuilder!
open var disableAutomaticTokenRefreshReturnValue: ClientBuilder! {
get { disableAutomaticTokenRefreshReturnValueLock.withLock { disableAutomaticTokenRefreshUnderlyingReturnValue } }
set { disableAutomaticTokenRefreshReturnValueLock.withLock { disableAutomaticTokenRefreshUnderlyingReturnValue = newValue } }
}
open var disableAutomaticTokenRefreshClosure: (() -> ClientBuilder)?
open override func disableAutomaticTokenRefresh() -> ClientBuilder {
disableAutomaticTokenRefreshCallsCountLock.withLock { disableAutomaticTokenRefreshUnderlyingCallsCount += 1 }
if let disableAutomaticTokenRefreshClosure = disableAutomaticTokenRefreshClosure {
return disableAutomaticTokenRefreshClosure()
} else {
return disableAutomaticTokenRefreshReturnValue
}
}
//MARK: - disableBuiltInRootCertificates
private let disableBuiltInRootCertificatesCallsCountLock = NSLock()
private var disableBuiltInRootCertificatesUnderlyingCallsCount = 0
open var disableBuiltInRootCertificatesCallsCount: Int {
get { disableBuiltInRootCertificatesCallsCountLock.withLock { disableBuiltInRootCertificatesUnderlyingCallsCount } }
set { disableBuiltInRootCertificatesCallsCountLock.withLock { disableBuiltInRootCertificatesUnderlyingCallsCount = newValue } }
}
open var disableBuiltInRootCertificatesCalled: Bool {
return disableBuiltInRootCertificatesCallsCount > 0
}
private let disableBuiltInRootCertificatesReturnValueLock = NSLock()
open var disableBuiltInRootCertificatesUnderlyingReturnValue: ClientBuilder!
open var disableBuiltInRootCertificatesReturnValue: ClientBuilder! {
get { disableBuiltInRootCertificatesReturnValueLock.withLock { disableBuiltInRootCertificatesUnderlyingReturnValue } }
set { disableBuiltInRootCertificatesReturnValueLock.withLock { disableBuiltInRootCertificatesUnderlyingReturnValue = newValue } }
}
open var disableBuiltInRootCertificatesClosure: (() -> ClientBuilder)?
open override func disableBuiltInRootCertificates() -> ClientBuilder {
disableBuiltInRootCertificatesCallsCountLock.withLock { disableBuiltInRootCertificatesUnderlyingCallsCount += 1 }
if let disableBuiltInRootCertificatesClosure = disableBuiltInRootCertificatesClosure {
return disableBuiltInRootCertificatesClosure()
} else {
return disableBuiltInRootCertificatesReturnValue
}
}
//MARK: - disableSslVerification
private let disableSslVerificationCallsCountLock = NSLock()
private var disableSslVerificationUnderlyingCallsCount = 0
open var disableSslVerificationCallsCount: Int {
get { disableSslVerificationCallsCountLock.withLock { disableSslVerificationUnderlyingCallsCount } }
set { disableSslVerificationCallsCountLock.withLock { disableSslVerificationUnderlyingCallsCount = newValue } }
}
open var disableSslVerificationCalled: Bool {
return disableSslVerificationCallsCount > 0
}
private let disableSslVerificationReturnValueLock = NSLock()
open var disableSslVerificationUnderlyingReturnValue: ClientBuilder!
open var disableSslVerificationReturnValue: ClientBuilder! {
get { disableSslVerificationReturnValueLock.withLock { disableSslVerificationUnderlyingReturnValue } }
set { disableSslVerificationReturnValueLock.withLock { disableSslVerificationUnderlyingReturnValue = newValue } }
}
open var disableSslVerificationClosure: (() -> ClientBuilder)?
open override func disableSslVerification() -> ClientBuilder {
disableSslVerificationCallsCountLock.withLock { disableSslVerificationUnderlyingCallsCount += 1 }
if let disableSslVerificationClosure = disableSslVerificationClosure {
return disableSslVerificationClosure()
} else {
return disableSslVerificationReturnValue
}
}
//MARK: - disableWellKnownLookup
private let disableWellKnownLookupDisableWellKnownLookupCallsCountLock = NSLock()
private var disableWellKnownLookupDisableWellKnownLookupUnderlyingCallsCount = 0
open var disableWellKnownLookupDisableWellKnownLookupCallsCount: Int {
get { disableWellKnownLookupDisableWellKnownLookupCallsCountLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingCallsCount } }
set { disableWellKnownLookupDisableWellKnownLookupCallsCountLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingCallsCount = newValue } }
}
open var disableWellKnownLookupDisableWellKnownLookupCalled: Bool {
return disableWellKnownLookupDisableWellKnownLookupCallsCount > 0
}
private let disableWellKnownLookupDisableWellKnownLookupReceivedDisableWellKnownLookupLock = NSLock()
private var disableWellKnownLookupDisableWellKnownLookupUnderlyingReceivedDisableWellKnownLookup: Bool?
open var disableWellKnownLookupDisableWellKnownLookupReceivedDisableWellKnownLookup: Bool? {
get { disableWellKnownLookupDisableWellKnownLookupReceivedDisableWellKnownLookupLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingReceivedDisableWellKnownLookup } }
set { disableWellKnownLookupDisableWellKnownLookupReceivedDisableWellKnownLookupLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingReceivedDisableWellKnownLookup = newValue } }
}
private let disableWellKnownLookupDisableWellKnownLookupReceivedInvocationsLock = NSLock()
private var disableWellKnownLookupDisableWellKnownLookupUnderlyingReceivedInvocations: [Bool] = []
open var disableWellKnownLookupDisableWellKnownLookupReceivedInvocations: [Bool] {
get { disableWellKnownLookupDisableWellKnownLookupReceivedInvocationsLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingReceivedInvocations } }
set { disableWellKnownLookupDisableWellKnownLookupReceivedInvocationsLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingReceivedInvocations = newValue } }
}
private let disableWellKnownLookupDisableWellKnownLookupReturnValueLock = NSLock()
open var disableWellKnownLookupDisableWellKnownLookupUnderlyingReturnValue: ClientBuilder!
open var disableWellKnownLookupDisableWellKnownLookupReturnValue: ClientBuilder! {
get { disableWellKnownLookupDisableWellKnownLookupReturnValueLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingReturnValue } }
set { disableWellKnownLookupDisableWellKnownLookupReturnValueLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingReturnValue = newValue } }
}
open var disableWellKnownLookupDisableWellKnownLookupClosure: ((Bool) -> ClientBuilder)?
open override func disableWellKnownLookup(disableWellKnownLookup: Bool) -> ClientBuilder {
disableWellKnownLookupDisableWellKnownLookupCallsCountLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingCallsCount += 1 }
disableWellKnownLookupDisableWellKnownLookupReceivedDisableWellKnownLookup = disableWellKnownLookup
disableWellKnownLookupDisableWellKnownLookupReceivedInvocationsLock.withLock { disableWellKnownLookupDisableWellKnownLookupUnderlyingReceivedInvocations.append(disableWellKnownLookup) }
if let disableWellKnownLookupDisableWellKnownLookupClosure = disableWellKnownLookupDisableWellKnownLookupClosure {
return disableWellKnownLookupDisableWellKnownLookupClosure(disableWellKnownLookup)
} else {
return disableWellKnownLookupDisableWellKnownLookupReturnValue
}
}
//MARK: - dmRoomDefinition
private let dmRoomDefinitionDmRoomDefinitionCallsCountLock = NSLock()
private var dmRoomDefinitionDmRoomDefinitionUnderlyingCallsCount = 0
open var dmRoomDefinitionDmRoomDefinitionCallsCount: Int {
get { dmRoomDefinitionDmRoomDefinitionCallsCountLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingCallsCount } }
set { dmRoomDefinitionDmRoomDefinitionCallsCountLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingCallsCount = newValue } }
}
open var dmRoomDefinitionDmRoomDefinitionCalled: Bool {
return dmRoomDefinitionDmRoomDefinitionCallsCount > 0
}
private let dmRoomDefinitionDmRoomDefinitionReceivedDmRoomDefinitionLock = NSLock()
private var dmRoomDefinitionDmRoomDefinitionUnderlyingReceivedDmRoomDefinition: DmRoomDefinition?
open var dmRoomDefinitionDmRoomDefinitionReceivedDmRoomDefinition: DmRoomDefinition? {
get { dmRoomDefinitionDmRoomDefinitionReceivedDmRoomDefinitionLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingReceivedDmRoomDefinition } }
set { dmRoomDefinitionDmRoomDefinitionReceivedDmRoomDefinitionLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingReceivedDmRoomDefinition = newValue } }
}
private let dmRoomDefinitionDmRoomDefinitionReceivedInvocationsLock = NSLock()
private var dmRoomDefinitionDmRoomDefinitionUnderlyingReceivedInvocations: [DmRoomDefinition] = []
open var dmRoomDefinitionDmRoomDefinitionReceivedInvocations: [DmRoomDefinition] {
get { dmRoomDefinitionDmRoomDefinitionReceivedInvocationsLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingReceivedInvocations } }
set { dmRoomDefinitionDmRoomDefinitionReceivedInvocationsLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingReceivedInvocations = newValue } }
}
private let dmRoomDefinitionDmRoomDefinitionReturnValueLock = NSLock()
open var dmRoomDefinitionDmRoomDefinitionUnderlyingReturnValue: ClientBuilder!
open var dmRoomDefinitionDmRoomDefinitionReturnValue: ClientBuilder! {
get { dmRoomDefinitionDmRoomDefinitionReturnValueLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingReturnValue } }
set { dmRoomDefinitionDmRoomDefinitionReturnValueLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingReturnValue = newValue } }
}
open var dmRoomDefinitionDmRoomDefinitionClosure: ((DmRoomDefinition) -> ClientBuilder)?
open override func dmRoomDefinition(dmRoomDefinition: DmRoomDefinition) -> ClientBuilder {
dmRoomDefinitionDmRoomDefinitionCallsCountLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingCallsCount += 1 }
dmRoomDefinitionDmRoomDefinitionReceivedDmRoomDefinition = dmRoomDefinition
dmRoomDefinitionDmRoomDefinitionReceivedInvocationsLock.withLock { dmRoomDefinitionDmRoomDefinitionUnderlyingReceivedInvocations.append(dmRoomDefinition) }
if let dmRoomDefinitionDmRoomDefinitionClosure = dmRoomDefinitionDmRoomDefinitionClosure {
return dmRoomDefinitionDmRoomDefinitionClosure(dmRoomDefinition)
} else {
return dmRoomDefinitionDmRoomDefinitionReturnValue
}
}
//MARK: - enableAutomaticBackPagination
private let enableAutomaticBackPaginationEnableAutomaticBackPaginationCallsCountLock = NSLock()
private var enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingCallsCount = 0
open var enableAutomaticBackPaginationEnableAutomaticBackPaginationCallsCount: Int {
get { enableAutomaticBackPaginationEnableAutomaticBackPaginationCallsCountLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingCallsCount } }
set { enableAutomaticBackPaginationEnableAutomaticBackPaginationCallsCountLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingCallsCount = newValue } }
}
open var enableAutomaticBackPaginationEnableAutomaticBackPaginationCalled: Bool {
return enableAutomaticBackPaginationEnableAutomaticBackPaginationCallsCount > 0
}
private let enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedEnableAutomaticBackPaginationLock = NSLock()
private var enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReceivedEnableAutomaticBackPagination: Bool?
open var enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedEnableAutomaticBackPagination: Bool? {
get { enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedEnableAutomaticBackPaginationLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReceivedEnableAutomaticBackPagination } }
set { enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedEnableAutomaticBackPaginationLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReceivedEnableAutomaticBackPagination = newValue } }
}
private let enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedInvocationsLock = NSLock()
private var enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReceivedInvocations: [Bool] = []
open var enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedInvocations: [Bool] {
get { enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedInvocationsLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReceivedInvocations } }
set { enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedInvocationsLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReceivedInvocations = newValue } }
}
private let enableAutomaticBackPaginationEnableAutomaticBackPaginationReturnValueLock = NSLock()
open var enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReturnValue: ClientBuilder!
open var enableAutomaticBackPaginationEnableAutomaticBackPaginationReturnValue: ClientBuilder! {
get { enableAutomaticBackPaginationEnableAutomaticBackPaginationReturnValueLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReturnValue } }
set { enableAutomaticBackPaginationEnableAutomaticBackPaginationReturnValueLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReturnValue = newValue } }
}
open var enableAutomaticBackPaginationEnableAutomaticBackPaginationClosure: ((Bool) -> ClientBuilder)?
open override func enableAutomaticBackPagination(enableAutomaticBackPagination: Bool) -> ClientBuilder {
enableAutomaticBackPaginationEnableAutomaticBackPaginationCallsCountLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingCallsCount += 1 }
enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedEnableAutomaticBackPagination = enableAutomaticBackPagination
enableAutomaticBackPaginationEnableAutomaticBackPaginationReceivedInvocationsLock.withLock { enableAutomaticBackPaginationEnableAutomaticBackPaginationUnderlyingReceivedInvocations.append(enableAutomaticBackPagination) }
if let enableAutomaticBackPaginationEnableAutomaticBackPaginationClosure = enableAutomaticBackPaginationEnableAutomaticBackPaginationClosure {
return enableAutomaticBackPaginationEnableAutomaticBackPaginationClosure(enableAutomaticBackPagination)
} else {
return enableAutomaticBackPaginationEnableAutomaticBackPaginationReturnValue
}
}
//MARK: - enableShareHistoryOnInvite
private let enableShareHistoryOnInviteEnableShareHistoryOnInviteCallsCountLock = NSLock()
private var enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingCallsCount = 0
open var enableShareHistoryOnInviteEnableShareHistoryOnInviteCallsCount: Int {
get { enableShareHistoryOnInviteEnableShareHistoryOnInviteCallsCountLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingCallsCount } }
set { enableShareHistoryOnInviteEnableShareHistoryOnInviteCallsCountLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingCallsCount = newValue } }
}
open var enableShareHistoryOnInviteEnableShareHistoryOnInviteCalled: Bool {
return enableShareHistoryOnInviteEnableShareHistoryOnInviteCallsCount > 0
}
private let enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedEnableShareHistoryOnInviteLock = NSLock()
private var enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReceivedEnableShareHistoryOnInvite: Bool?
open var enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedEnableShareHistoryOnInvite: Bool? {
get { enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedEnableShareHistoryOnInviteLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReceivedEnableShareHistoryOnInvite } }
set { enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedEnableShareHistoryOnInviteLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReceivedEnableShareHistoryOnInvite = newValue } }
}
private let enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedInvocationsLock = NSLock()
private var enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReceivedInvocations: [Bool] = []
open var enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedInvocations: [Bool] {
get { enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedInvocationsLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReceivedInvocations } }
set { enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedInvocationsLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReceivedInvocations = newValue } }
}
private let enableShareHistoryOnInviteEnableShareHistoryOnInviteReturnValueLock = NSLock()
open var enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReturnValue: ClientBuilder!
open var enableShareHistoryOnInviteEnableShareHistoryOnInviteReturnValue: ClientBuilder! {
get { enableShareHistoryOnInviteEnableShareHistoryOnInviteReturnValueLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReturnValue } }
set { enableShareHistoryOnInviteEnableShareHistoryOnInviteReturnValueLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReturnValue = newValue } }
}
open var enableShareHistoryOnInviteEnableShareHistoryOnInviteClosure: ((Bool) -> ClientBuilder)?
open override func enableShareHistoryOnInvite(enableShareHistoryOnInvite: Bool) -> ClientBuilder {
enableShareHistoryOnInviteEnableShareHistoryOnInviteCallsCountLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingCallsCount += 1 }
enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedEnableShareHistoryOnInvite = enableShareHistoryOnInvite
enableShareHistoryOnInviteEnableShareHistoryOnInviteReceivedInvocationsLock.withLock { enableShareHistoryOnInviteEnableShareHistoryOnInviteUnderlyingReceivedInvocations.append(enableShareHistoryOnInvite) }
if let enableShareHistoryOnInviteEnableShareHistoryOnInviteClosure = enableShareHistoryOnInviteEnableShareHistoryOnInviteClosure {
return enableShareHistoryOnInviteEnableShareHistoryOnInviteClosure(enableShareHistoryOnInvite)
} else {
return enableShareHistoryOnInviteEnableShareHistoryOnInviteReturnValue
}
}
//MARK: - homeserverUrl
private let homeserverUrlUrlCallsCountLock = NSLock()
private var homeserverUrlUrlUnderlyingCallsCount = 0
open var homeserverUrlUrlCallsCount: Int {
get { homeserverUrlUrlCallsCountLock.withLock { homeserverUrlUrlUnderlyingCallsCount } }
set { homeserverUrlUrlCallsCountLock.withLock { homeserverUrlUrlUnderlyingCallsCount = newValue } }
}
open var homeserverUrlUrlCalled: Bool {
return homeserverUrlUrlCallsCount > 0
}
private let homeserverUrlUrlReceivedUrlLock = NSLock()
private var homeserverUrlUrlUnderlyingReceivedUrl: String?
open var homeserverUrlUrlReceivedUrl: String? {
get { homeserverUrlUrlReceivedUrlLock.withLock { homeserverUrlUrlUnderlyingReceivedUrl } }
set { homeserverUrlUrlReceivedUrlLock.withLock { homeserverUrlUrlUnderlyingReceivedUrl = newValue } }
}
private let homeserverUrlUrlReceivedInvocationsLock = NSLock()
private var homeserverUrlUrlUnderlyingReceivedInvocations: [String] = []
open var homeserverUrlUrlReceivedInvocations: [String] {
get { homeserverUrlUrlReceivedInvocationsLock.withLock { homeserverUrlUrlUnderlyingReceivedInvocations } }
set { homeserverUrlUrlReceivedInvocationsLock.withLock { homeserverUrlUrlUnderlyingReceivedInvocations = newValue } }
}
private let homeserverUrlUrlReturnValueLock = NSLock()
open var homeserverUrlUrlUnderlyingReturnValue: ClientBuilder!
open var homeserverUrlUrlReturnValue: ClientBuilder! {
get { homeserverUrlUrlReturnValueLock.withLock { homeserverUrlUrlUnderlyingReturnValue } }
set { homeserverUrlUrlReturnValueLock.withLock { homeserverUrlUrlUnderlyingReturnValue = newValue } }
}
open var homeserverUrlUrlClosure: ((String) -> ClientBuilder)?
open override func homeserverUrl(url: String) -> ClientBuilder {
homeserverUrlUrlCallsCountLock.withLock { homeserverUrlUrlUnderlyingCallsCount += 1 }
homeserverUrlUrlReceivedUrl = url
homeserverUrlUrlReceivedInvocationsLock.withLock { homeserverUrlUrlUnderlyingReceivedInvocations.append(url) }
if let homeserverUrlUrlClosure = homeserverUrlUrlClosure {
return homeserverUrlUrlClosure(url)
} else {
return homeserverUrlUrlReturnValue
}
}
//MARK: - inMemoryStore
private let inMemoryStoreCallsCountLock = NSLock()
private var inMemoryStoreUnderlyingCallsCount = 0
open var inMemoryStoreCallsCount: Int {
get { inMemoryStoreCallsCountLock.withLock { inMemoryStoreUnderlyingCallsCount } }
set { inMemoryStoreCallsCountLock.withLock { inMemoryStoreUnderlyingCallsCount = newValue } }
}
open var inMemoryStoreCalled: Bool {
return inMemoryStoreCallsCount > 0
}
private let inMemoryStoreReturnValueLock = NSLock()
open var inMemoryStoreUnderlyingReturnValue: ClientBuilder!
open var inMemoryStoreReturnValue: ClientBuilder! {
get { inMemoryStoreReturnValueLock.withLock { inMemoryStoreUnderlyingReturnValue } }
set { inMemoryStoreReturnValueLock.withLock { inMemoryStoreUnderlyingReturnValue = newValue } }
}
open var inMemoryStoreClosure: (() -> ClientBuilder)?
open override func inMemoryStore() -> ClientBuilder {
inMemoryStoreCallsCountLock.withLock { inMemoryStoreUnderlyingCallsCount += 1 }
if let inMemoryStoreClosure = inMemoryStoreClosure {
return inMemoryStoreClosure()
} else {
return inMemoryStoreReturnValue
}
}
//MARK: - proxy
private let proxyUrlCallsCountLock = NSLock()
private var proxyUrlUnderlyingCallsCount = 0
open var proxyUrlCallsCount: Int {
get { proxyUrlCallsCountLock.withLock { proxyUrlUnderlyingCallsCount } }
set { proxyUrlCallsCountLock.withLock { proxyUrlUnderlyingCallsCount = newValue } }
}
open var proxyUrlCalled: Bool {
return proxyUrlCallsCount > 0
}
private let proxyUrlReceivedUrlLock = NSLock()
private var proxyUrlUnderlyingReceivedUrl: String?
open var proxyUrlReceivedUrl: String? {
get { proxyUrlReceivedUrlLock.withLock { proxyUrlUnderlyingReceivedUrl } }
set { proxyUrlReceivedUrlLock.withLock { proxyUrlUnderlyingReceivedUrl = newValue } }
}
private let proxyUrlReceivedInvocationsLock = NSLock()
private var proxyUrlUnderlyingReceivedInvocations: [String] = []
open var proxyUrlReceivedInvocations: [String] {
get { proxyUrlReceivedInvocationsLock.withLock { proxyUrlUnderlyingReceivedInvocations } }
set { proxyUrlReceivedInvocationsLock.withLock { proxyUrlUnderlyingReceivedInvocations = newValue } }
}
private let proxyUrlReturnValueLock = NSLock()
open var proxyUrlUnderlyingReturnValue: ClientBuilder!
open var proxyUrlReturnValue: ClientBuilder! {
get { proxyUrlReturnValueLock.withLock { proxyUrlUnderlyingReturnValue } }
set { proxyUrlReturnValueLock.withLock { proxyUrlUnderlyingReturnValue = newValue } }
}
open var proxyUrlClosure: ((String) -> ClientBuilder)?
open override func proxy(url: String) -> ClientBuilder {
proxyUrlCallsCountLock.withLock { proxyUrlUnderlyingCallsCount += 1 }
proxyUrlReceivedUrl = url
proxyUrlReceivedInvocationsLock.withLock { proxyUrlUnderlyingReceivedInvocations.append(url) }
if let proxyUrlClosure = proxyUrlClosure {
return proxyUrlClosure(url)
} else {
return proxyUrlReturnValue
}
}
//MARK: - requestConfig
private let requestConfigConfigCallsCountLock = NSLock()
private var requestConfigConfigUnderlyingCallsCount = 0
open var requestConfigConfigCallsCount: Int {
get { requestConfigConfigCallsCountLock.withLock { requestConfigConfigUnderlyingCallsCount } }
set { requestConfigConfigCallsCountLock.withLock { requestConfigConfigUnderlyingCallsCount = newValue } }
}
open var requestConfigConfigCalled: Bool {
return requestConfigConfigCallsCount > 0
}
private let requestConfigConfigReceivedConfigLock = NSLock()
private var requestConfigConfigUnderlyingReceivedConfig: RequestConfig?
open var requestConfigConfigReceivedConfig: RequestConfig? {
get { requestConfigConfigReceivedConfigLock.withLock { requestConfigConfigUnderlyingReceivedConfig } }
set { requestConfigConfigReceivedConfigLock.withLock { requestConfigConfigUnderlyingReceivedConfig = newValue } }
}
private let requestConfigConfigReceivedInvocationsLock = NSLock()
private var requestConfigConfigUnderlyingReceivedInvocations: [RequestConfig] = []
open var requestConfigConfigReceivedInvocations: [RequestConfig] {
get { requestConfigConfigReceivedInvocationsLock.withLock { requestConfigConfigUnderlyingReceivedInvocations } }
set { requestConfigConfigReceivedInvocationsLock.withLock { requestConfigConfigUnderlyingReceivedInvocations = newValue } }
}
private let requestConfigConfigReturnValueLock = NSLock()
open var requestConfigConfigUnderlyingReturnValue: ClientBuilder!
open var requestConfigConfigReturnValue: ClientBuilder! {
get { requestConfigConfigReturnValueLock.withLock { requestConfigConfigUnderlyingReturnValue } }
set { requestConfigConfigReturnValueLock.withLock { requestConfigConfigUnderlyingReturnValue = newValue } }
}
open var requestConfigConfigClosure: ((RequestConfig) -> ClientBuilder)?
open override func requestConfig(config: RequestConfig) -> ClientBuilder {
requestConfigConfigCallsCountLock.withLock { requestConfigConfigUnderlyingCallsCount += 1 }
requestConfigConfigReceivedConfig = config
requestConfigConfigReceivedInvocationsLock.withLock { requestConfigConfigUnderlyingReceivedInvocations.append(config) }
if let requestConfigConfigClosure = requestConfigConfigClosure {
return requestConfigConfigClosure(config)
} else {
return requestConfigConfigReturnValue
}
}
//MARK: - roomKeyRecipientStrategy
private let roomKeyRecipientStrategyStrategyCallsCountLock = NSLock()
private var roomKeyRecipientStrategyStrategyUnderlyingCallsCount = 0
open var roomKeyRecipientStrategyStrategyCallsCount: Int {
get { roomKeyRecipientStrategyStrategyCallsCountLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingCallsCount } }
set { roomKeyRecipientStrategyStrategyCallsCountLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingCallsCount = newValue } }
}
open var roomKeyRecipientStrategyStrategyCalled: Bool {
return roomKeyRecipientStrategyStrategyCallsCount > 0
}
private let roomKeyRecipientStrategyStrategyReceivedStrategyLock = NSLock()
private var roomKeyRecipientStrategyStrategyUnderlyingReceivedStrategy: CollectStrategy?
open var roomKeyRecipientStrategyStrategyReceivedStrategy: CollectStrategy? {
get { roomKeyRecipientStrategyStrategyReceivedStrategyLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingReceivedStrategy } }
set { roomKeyRecipientStrategyStrategyReceivedStrategyLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingReceivedStrategy = newValue } }
}
private let roomKeyRecipientStrategyStrategyReceivedInvocationsLock = NSLock()
private var roomKeyRecipientStrategyStrategyUnderlyingReceivedInvocations: [CollectStrategy] = []
open var roomKeyRecipientStrategyStrategyReceivedInvocations: [CollectStrategy] {
get { roomKeyRecipientStrategyStrategyReceivedInvocationsLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingReceivedInvocations } }
set { roomKeyRecipientStrategyStrategyReceivedInvocationsLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingReceivedInvocations = newValue } }
}
private let roomKeyRecipientStrategyStrategyReturnValueLock = NSLock()
open var roomKeyRecipientStrategyStrategyUnderlyingReturnValue: ClientBuilder!
open var roomKeyRecipientStrategyStrategyReturnValue: ClientBuilder! {
get { roomKeyRecipientStrategyStrategyReturnValueLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingReturnValue } }
set { roomKeyRecipientStrategyStrategyReturnValueLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingReturnValue = newValue } }
}
open var roomKeyRecipientStrategyStrategyClosure: ((CollectStrategy) -> ClientBuilder)?
open override func roomKeyRecipientStrategy(strategy: CollectStrategy) -> ClientBuilder {
roomKeyRecipientStrategyStrategyCallsCountLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingCallsCount += 1 }
roomKeyRecipientStrategyStrategyReceivedStrategy = strategy
roomKeyRecipientStrategyStrategyReceivedInvocationsLock.withLock { roomKeyRecipientStrategyStrategyUnderlyingReceivedInvocations.append(strategy) }
if let roomKeyRecipientStrategyStrategyClosure = roomKeyRecipientStrategyStrategyClosure {
return roomKeyRecipientStrategyStrategyClosure(strategy)
} else {
return roomKeyRecipientStrategyStrategyReturnValue
}
}
//MARK: - serverName
private let serverNameServerNameCallsCountLock = NSLock()
private var serverNameServerNameUnderlyingCallsCount = 0
open var serverNameServerNameCallsCount: Int {
get { serverNameServerNameCallsCountLock.withLock { serverNameServerNameUnderlyingCallsCount } }
set { serverNameServerNameCallsCountLock.withLock { serverNameServerNameUnderlyingCallsCount = newValue } }
}
open var serverNameServerNameCalled: Bool {
return serverNameServerNameCallsCount > 0
}
private let serverNameServerNameReceivedServerNameLock = NSLock()
private var serverNameServerNameUnderlyingReceivedServerName: String?
open var serverNameServerNameReceivedServerName: String? {
get { serverNameServerNameReceivedServerNameLock.withLock { serverNameServerNameUnderlyingReceivedServerName } }
set { serverNameServerNameReceivedServerNameLock.withLock { serverNameServerNameUnderlyingReceivedServerName = newValue } }
}
private let serverNameServerNameReceivedInvocationsLock = NSLock()
private var serverNameServerNameUnderlyingReceivedInvocations: [String] = []
open var serverNameServerNameReceivedInvocations: [String] {
get { serverNameServerNameReceivedInvocationsLock.withLock { serverNameServerNameUnderlyingReceivedInvocations } }
set { serverNameServerNameReceivedInvocationsLock.withLock { serverNameServerNameUnderlyingReceivedInvocations = newValue } }
}
private let serverNameServerNameReturnValueLock = NSLock()
open var serverNameServerNameUnderlyingReturnValue: ClientBuilder!
open var serverNameServerNameReturnValue: ClientBuilder! {
get { serverNameServerNameReturnValueLock.withLock { serverNameServerNameUnderlyingReturnValue } }
set { serverNameServerNameReturnValueLock.withLock { serverNameServerNameUnderlyingReturnValue = newValue } }
}
open var serverNameServerNameClosure: ((String) -> ClientBuilder)?
open override func serverName(serverName: String) -> ClientBuilder {
serverNameServerNameCallsCountLock.withLock { serverNameServerNameUnderlyingCallsCount += 1 }
serverNameServerNameReceivedServerName = serverName
serverNameServerNameReceivedInvocationsLock.withLock { serverNameServerNameUnderlyingReceivedInvocations.append(serverName) }
if let serverNameServerNameClosure = serverNameServerNameClosure {
return serverNameServerNameClosure(serverName)
} else {
return serverNameServerNameReturnValue
}
}
//MARK: - serverNameFromUserId
private let serverNameFromUserIdUserIdCallsCountLock = NSLock()
private var serverNameFromUserIdUserIdUnderlyingCallsCount = 0
open var serverNameFromUserIdUserIdCallsCount: Int {
get { serverNameFromUserIdUserIdCallsCountLock.withLock { serverNameFromUserIdUserIdUnderlyingCallsCount } }
set { serverNameFromUserIdUserIdCallsCountLock.withLock { serverNameFromUserIdUserIdUnderlyingCallsCount = newValue } }
}
open var serverNameFromUserIdUserIdCalled: Bool {
return serverNameFromUserIdUserIdCallsCount > 0
}
private let serverNameFromUserIdUserIdReceivedUserIdLock = NSLock()
private var serverNameFromUserIdUserIdUnderlyingReceivedUserId: String?
open var serverNameFromUserIdUserIdReceivedUserId: String? {
get { serverNameFromUserIdUserIdReceivedUserIdLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedUserId } }
set { serverNameFromUserIdUserIdReceivedUserIdLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedUserId = newValue } }
}
private let serverNameFromUserIdUserIdReceivedInvocationsLock = NSLock()
private var serverNameFromUserIdUserIdUnderlyingReceivedInvocations: [String] = []
open var serverNameFromUserIdUserIdReceivedInvocations: [String] {
get { serverNameFromUserIdUserIdReceivedInvocationsLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedInvocations } }
set { serverNameFromUserIdUserIdReceivedInvocationsLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedInvocations = newValue } }
}
private let serverNameFromUserIdUserIdReturnValueLock = NSLock()
open var serverNameFromUserIdUserIdUnderlyingReturnValue: ClientBuilder!
open var serverNameFromUserIdUserIdReturnValue: ClientBuilder! {
get { serverNameFromUserIdUserIdReturnValueLock.withLock { serverNameFromUserIdUserIdUnderlyingReturnValue } }
set { serverNameFromUserIdUserIdReturnValueLock.withLock { serverNameFromUserIdUserIdUnderlyingReturnValue = newValue } }
}
open var serverNameFromUserIdUserIdClosure: ((String) -> ClientBuilder)?
open override func serverNameFromUserId(userId: String) -> ClientBuilder {
serverNameFromUserIdUserIdCallsCountLock.withLock { serverNameFromUserIdUserIdUnderlyingCallsCount += 1 }
serverNameFromUserIdUserIdReceivedUserId = userId
serverNameFromUserIdUserIdReceivedInvocationsLock.withLock { serverNameFromUserIdUserIdUnderlyingReceivedInvocations.append(userId) }
if let serverNameFromUserIdUserIdClosure = serverNameFromUserIdUserIdClosure {
return serverNameFromUserIdUserIdClosure(userId)
} else {
return serverNameFromUserIdUserIdReturnValue
}
}
//MARK: - serverNameOrHomeserverUrl
private let serverNameOrHomeserverUrlServerNameOrUrlCallsCountLock = NSLock()
private var serverNameOrHomeserverUrlServerNameOrUrlUnderlyingCallsCount = 0
open var serverNameOrHomeserverUrlServerNameOrUrlCallsCount: Int {
get { serverNameOrHomeserverUrlServerNameOrUrlCallsCountLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingCallsCount } }
set { serverNameOrHomeserverUrlServerNameOrUrlCallsCountLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingCallsCount = newValue } }
}
open var serverNameOrHomeserverUrlServerNameOrUrlCalled: Bool {
return serverNameOrHomeserverUrlServerNameOrUrlCallsCount > 0
}
private let serverNameOrHomeserverUrlServerNameOrUrlReceivedServerNameOrUrlLock = NSLock()
private var serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReceivedServerNameOrUrl: String?
open var serverNameOrHomeserverUrlServerNameOrUrlReceivedServerNameOrUrl: String? {
get { serverNameOrHomeserverUrlServerNameOrUrlReceivedServerNameOrUrlLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReceivedServerNameOrUrl } }
set { serverNameOrHomeserverUrlServerNameOrUrlReceivedServerNameOrUrlLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReceivedServerNameOrUrl = newValue } }
}
private let serverNameOrHomeserverUrlServerNameOrUrlReceivedInvocationsLock = NSLock()
private var serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReceivedInvocations: [String] = []
open var serverNameOrHomeserverUrlServerNameOrUrlReceivedInvocations: [String] {
get { serverNameOrHomeserverUrlServerNameOrUrlReceivedInvocationsLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReceivedInvocations } }
set { serverNameOrHomeserverUrlServerNameOrUrlReceivedInvocationsLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReceivedInvocations = newValue } }
}
private let serverNameOrHomeserverUrlServerNameOrUrlReturnValueLock = NSLock()
open var serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReturnValue: ClientBuilder!
open var serverNameOrHomeserverUrlServerNameOrUrlReturnValue: ClientBuilder! {
get { serverNameOrHomeserverUrlServerNameOrUrlReturnValueLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReturnValue } }
set { serverNameOrHomeserverUrlServerNameOrUrlReturnValueLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReturnValue = newValue } }
}
open var serverNameOrHomeserverUrlServerNameOrUrlClosure: ((String) -> ClientBuilder)?
open override func serverNameOrHomeserverUrl(serverNameOrUrl: String) -> ClientBuilder {
serverNameOrHomeserverUrlServerNameOrUrlCallsCountLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingCallsCount += 1 }
serverNameOrHomeserverUrlServerNameOrUrlReceivedServerNameOrUrl = serverNameOrUrl
serverNameOrHomeserverUrlServerNameOrUrlReceivedInvocationsLock.withLock { serverNameOrHomeserverUrlServerNameOrUrlUnderlyingReceivedInvocations.append(serverNameOrUrl) }
if let serverNameOrHomeserverUrlServerNameOrUrlClosure = serverNameOrHomeserverUrlServerNameOrUrlClosure {
return serverNameOrHomeserverUrlServerNameOrUrlClosure(serverNameOrUrl)
} else {
return serverNameOrHomeserverUrlServerNameOrUrlReturnValue
}
}
//MARK: - sessionPaths
private let sessionPathsDataPathCachePathCallsCountLock = NSLock()
private var sessionPathsDataPathCachePathUnderlyingCallsCount = 0
open var sessionPathsDataPathCachePathCallsCount: Int {
get { sessionPathsDataPathCachePathCallsCountLock.withLock { sessionPathsDataPathCachePathUnderlyingCallsCount } }
set { sessionPathsDataPathCachePathCallsCountLock.withLock { sessionPathsDataPathCachePathUnderlyingCallsCount = newValue } }
}
open var sessionPathsDataPathCachePathCalled: Bool {
return sessionPathsDataPathCachePathCallsCount > 0
}
private let sessionPathsDataPathCachePathReceivedArgumentsLock = NSLock()
private var sessionPathsDataPathCachePathUnderlyingReceivedArguments: (dataPath: String, cachePath: String)?
open var sessionPathsDataPathCachePathReceivedArguments: (dataPath: String, cachePath: String)? {
get { sessionPathsDataPathCachePathReceivedArgumentsLock.withLock { sessionPathsDataPathCachePathUnderlyingReceivedArguments } }
set { sessionPathsDataPathCachePathReceivedArgumentsLock.withLock { sessionPathsDataPathCachePathUnderlyingReceivedArguments = newValue } }
}
private let sessionPathsDataPathCachePathReceivedInvocationsLock = NSLock()
private var sessionPathsDataPathCachePathUnderlyingReceivedInvocations: [(dataPath: String, cachePath: String)] = []
open var sessionPathsDataPathCachePathReceivedInvocations: [(dataPath: String, cachePath: String)] {
get { sessionPathsDataPathCachePathReceivedInvocationsLock.withLock { sessionPathsDataPathCachePathUnderlyingReceivedInvocations } }
set { sessionPathsDataPathCachePathReceivedInvocationsLock.withLock { sessionPathsDataPathCachePathUnderlyingReceivedInvocations = newValue } }
}
private let sessionPathsDataPathCachePathReturnValueLock = NSLock()
open var sessionPathsDataPathCachePathUnderlyingReturnValue: ClientBuilder!
open var sessionPathsDataPathCachePathReturnValue: ClientBuilder! {
get { sessionPathsDataPathCachePathReturnValueLock.withLock { sessionPathsDataPathCachePathUnderlyingReturnValue } }
set { sessionPathsDataPathCachePathReturnValueLock.withLock { sessionPathsDataPathCachePathUnderlyingReturnValue = newValue } }
}
open var sessionPathsDataPathCachePathClosure: ((String, String) -> ClientBuilder)?
open override func sessionPaths(dataPath: String, cachePath: String) -> ClientBuilder {
sessionPathsDataPathCachePathCallsCountLock.withLock { sessionPathsDataPathCachePathUnderlyingCallsCount += 1 }
sessionPathsDataPathCachePathReceivedArguments = (dataPath: dataPath, cachePath: cachePath)
sessionPathsDataPathCachePathReceivedInvocationsLock.withLock { sessionPathsDataPathCachePathUnderlyingReceivedInvocations.append((dataPath: dataPath, cachePath: cachePath)) }
if let sessionPathsDataPathCachePathClosure = sessionPathsDataPathCachePathClosure {
return sessionPathsDataPathCachePathClosure(dataPath, cachePath)
} else {
return sessionPathsDataPathCachePathReturnValue
}
}
//MARK: - setSessionDelegate
private let setSessionDelegateSessionDelegateCallsCountLock = NSLock()
private var setSessionDelegateSessionDelegateUnderlyingCallsCount = 0
open var setSessionDelegateSessionDelegateCallsCount: Int {
get { setSessionDelegateSessionDelegateCallsCountLock.withLock { setSessionDelegateSessionDelegateUnderlyingCallsCount } }
set { setSessionDelegateSessionDelegateCallsCountLock.withLock { setSessionDelegateSessionDelegateUnderlyingCallsCount = newValue } }
}
open var setSessionDelegateSessionDelegateCalled: Bool {
return setSessionDelegateSessionDelegateCallsCount > 0
}
private let setSessionDelegateSessionDelegateReceivedSessionDelegateLock = NSLock()
private var setSessionDelegateSessionDelegateUnderlyingReceivedSessionDelegate: ClientSessionDelegate?
open var setSessionDelegateSessionDelegateReceivedSessionDelegate: ClientSessionDelegate? {
get { setSessionDelegateSessionDelegateReceivedSessionDelegateLock.withLock { setSessionDelegateSessionDelegateUnderlyingReceivedSessionDelegate } }
set { setSessionDelegateSessionDelegateReceivedSessionDelegateLock.withLock { setSessionDelegateSessionDelegateUnderlyingReceivedSessionDelegate = newValue } }
}
private let setSessionDelegateSessionDelegateReceivedInvocationsLock = NSLock()
private var setSessionDelegateSessionDelegateUnderlyingReceivedInvocations: [ClientSessionDelegate] = []
open var setSessionDelegateSessionDelegateReceivedInvocations: [ClientSessionDelegate] {
get { setSessionDelegateSessionDelegateReceivedInvocationsLock.withLock { setSessionDelegateSessionDelegateUnderlyingReceivedInvocations } }
set { setSessionDelegateSessionDelegateReceivedInvocationsLock.withLock { setSessionDelegateSessionDelegateUnderlyingReceivedInvocations = newValue } }
}
private let setSessionDelegateSessionDelegateReturnValueLock = NSLock()
open var setSessionDelegateSessionDelegateUnderlyingReturnValue: ClientBuilder!
open var setSessionDelegateSessionDelegateReturnValue: ClientBuilder! {
get { setSessionDelegateSessionDelegateReturnValueLock.withLock { setSessionDelegateSessionDelegateUnderlyingReturnValue } }
set { setSessionDelegateSessionDelegateReturnValueLock.withLock { setSessionDelegateSessionDelegateUnderlyingReturnValue = newValue } }
}
open var setSessionDelegateSessionDelegateClosure: ((ClientSessionDelegate) -> ClientBuilder)?
open override func setSessionDelegate(sessionDelegate: ClientSessionDelegate) -> ClientBuilder {
setSessionDelegateSessionDelegateCallsCountLock.withLock { setSessionDelegateSessionDelegateUnderlyingCallsCount += 1 }
setSessionDelegateSessionDelegateReceivedSessionDelegate = sessionDelegate
setSessionDelegateSessionDelegateReceivedInvocationsLock.withLock { setSessionDelegateSessionDelegateUnderlyingReceivedInvocations.append(sessionDelegate) }
if let setSessionDelegateSessionDelegateClosure = setSessionDelegateSessionDelegateClosure {
return setSessionDelegateSessionDelegateClosure(sessionDelegate)
} else {
return setSessionDelegateSessionDelegateReturnValue
}
}
//MARK: - slidingSyncVersionBuilder
private let slidingSyncVersionBuilderVersionBuilderCallsCountLock = NSLock()
private var slidingSyncVersionBuilderVersionBuilderUnderlyingCallsCount = 0
open var slidingSyncVersionBuilderVersionBuilderCallsCount: Int {
get { slidingSyncVersionBuilderVersionBuilderCallsCountLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingCallsCount } }
set { slidingSyncVersionBuilderVersionBuilderCallsCountLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingCallsCount = newValue } }
}
open var slidingSyncVersionBuilderVersionBuilderCalled: Bool {
return slidingSyncVersionBuilderVersionBuilderCallsCount > 0
}
private let slidingSyncVersionBuilderVersionBuilderReceivedVersionBuilderLock = NSLock()
private var slidingSyncVersionBuilderVersionBuilderUnderlyingReceivedVersionBuilder: SlidingSyncVersionBuilder?
open var slidingSyncVersionBuilderVersionBuilderReceivedVersionBuilder: SlidingSyncVersionBuilder? {
get { slidingSyncVersionBuilderVersionBuilderReceivedVersionBuilderLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingReceivedVersionBuilder } }
set { slidingSyncVersionBuilderVersionBuilderReceivedVersionBuilderLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingReceivedVersionBuilder = newValue } }
}
private let slidingSyncVersionBuilderVersionBuilderReceivedInvocationsLock = NSLock()
private var slidingSyncVersionBuilderVersionBuilderUnderlyingReceivedInvocations: [SlidingSyncVersionBuilder] = []
open var slidingSyncVersionBuilderVersionBuilderReceivedInvocations: [SlidingSyncVersionBuilder] {
get { slidingSyncVersionBuilderVersionBuilderReceivedInvocationsLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingReceivedInvocations } }
set { slidingSyncVersionBuilderVersionBuilderReceivedInvocationsLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingReceivedInvocations = newValue } }
}
private let slidingSyncVersionBuilderVersionBuilderReturnValueLock = NSLock()
open var slidingSyncVersionBuilderVersionBuilderUnderlyingReturnValue: ClientBuilder!
open var slidingSyncVersionBuilderVersionBuilderReturnValue: ClientBuilder! {
get { slidingSyncVersionBuilderVersionBuilderReturnValueLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingReturnValue } }
set { slidingSyncVersionBuilderVersionBuilderReturnValueLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingReturnValue = newValue } }
}
open var slidingSyncVersionBuilderVersionBuilderClosure: ((SlidingSyncVersionBuilder) -> ClientBuilder)?
open override func slidingSyncVersionBuilder(versionBuilder: SlidingSyncVersionBuilder) -> ClientBuilder {
slidingSyncVersionBuilderVersionBuilderCallsCountLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingCallsCount += 1 }
slidingSyncVersionBuilderVersionBuilderReceivedVersionBuilder = versionBuilder
slidingSyncVersionBuilderVersionBuilderReceivedInvocationsLock.withLock { slidingSyncVersionBuilderVersionBuilderUnderlyingReceivedInvocations.append(versionBuilder) }
if let slidingSyncVersionBuilderVersionBuilderClosure = slidingSyncVersionBuilderVersionBuilderClosure {
return slidingSyncVersionBuilderVersionBuilderClosure(versionBuilder)
} else {
return slidingSyncVersionBuilderVersionBuilderReturnValue
}
}
//MARK: - sqliteStore
private let sqliteStoreConfigCallsCountLock = NSLock()
private var sqliteStoreConfigUnderlyingCallsCount = 0
open var sqliteStoreConfigCallsCount: Int {
get { sqliteStoreConfigCallsCountLock.withLock { sqliteStoreConfigUnderlyingCallsCount } }
set { sqliteStoreConfigCallsCountLock.withLock { sqliteStoreConfigUnderlyingCallsCount = newValue } }
}
open var sqliteStoreConfigCalled: Bool {
return sqliteStoreConfigCallsCount > 0
}
private let sqliteStoreConfigReceivedConfigLock = NSLock()
private var sqliteStoreConfigUnderlyingReceivedConfig: SqliteStoreBuilder?
open var sqliteStoreConfigReceivedConfig: SqliteStoreBuilder? {
get { sqliteStoreConfigReceivedConfigLock.withLock { sqliteStoreConfigUnderlyingReceivedConfig } }
set { sqliteStoreConfigReceivedConfigLock.withLock { sqliteStoreConfigUnderlyingReceivedConfig = newValue } }
}
private let sqliteStoreConfigReceivedInvocationsLock = NSLock()
private var sqliteStoreConfigUnderlyingReceivedInvocations: [SqliteStoreBuilder] = []
open var sqliteStoreConfigReceivedInvocations: [SqliteStoreBuilder] {
get { sqliteStoreConfigReceivedInvocationsLock.withLock { sqliteStoreConfigUnderlyingReceivedInvocations } }
set { sqliteStoreConfigReceivedInvocationsLock.withLock { sqliteStoreConfigUnderlyingReceivedInvocations = newValue } }
}
private let sqliteStoreConfigReturnValueLock = NSLock()
open var sqliteStoreConfigUnderlyingReturnValue: ClientBuilder!
open var sqliteStoreConfigReturnValue: ClientBuilder! {
get { sqliteStoreConfigReturnValueLock.withLock { sqliteStoreConfigUnderlyingReturnValue } }
set { sqliteStoreConfigReturnValueLock.withLock { sqliteStoreConfigUnderlyingReturnValue = newValue } }
}
open var sqliteStoreConfigClosure: ((SqliteStoreBuilder) -> ClientBuilder)?
open override func sqliteStore(config: SqliteStoreBuilder) -> ClientBuilder {
sqliteStoreConfigCallsCountLock.withLock { sqliteStoreConfigUnderlyingCallsCount += 1 }
sqliteStoreConfigReceivedConfig = config
sqliteStoreConfigReceivedInvocationsLock.withLock { sqliteStoreConfigUnderlyingReceivedInvocations.append(config) }
if let sqliteStoreConfigClosure = sqliteStoreConfigClosure {
return sqliteStoreConfigClosure(config)
} else {
return sqliteStoreConfigReturnValue
}
}
//MARK: - systemIsMemoryConstrained
private let systemIsMemoryConstrainedCallsCountLock = NSLock()
private var systemIsMemoryConstrainedUnderlyingCallsCount = 0
open var systemIsMemoryConstrainedCallsCount: Int {
get { systemIsMemoryConstrainedCallsCountLock.withLock { systemIsMemoryConstrainedUnderlyingCallsCount } }
set { systemIsMemoryConstrainedCallsCountLock.withLock { systemIsMemoryConstrainedUnderlyingCallsCount = newValue } }
}
open var systemIsMemoryConstrainedCalled: Bool {
return systemIsMemoryConstrainedCallsCount > 0
}
private let systemIsMemoryConstrainedReturnValueLock = NSLock()
open var systemIsMemoryConstrainedUnderlyingReturnValue: ClientBuilder!
open var systemIsMemoryConstrainedReturnValue: ClientBuilder! {
get { systemIsMemoryConstrainedReturnValueLock.withLock { systemIsMemoryConstrainedUnderlyingReturnValue } }
set { systemIsMemoryConstrainedReturnValueLock.withLock { systemIsMemoryConstrainedUnderlyingReturnValue = newValue } }
}
open var systemIsMemoryConstrainedClosure: (() -> ClientBuilder)?
open override func systemIsMemoryConstrained() -> ClientBuilder {
systemIsMemoryConstrainedCallsCountLock.withLock { systemIsMemoryConstrainedUnderlyingCallsCount += 1 }
if let systemIsMemoryConstrainedClosure = systemIsMemoryConstrainedClosure {
return systemIsMemoryConstrainedClosure()
} else {
return systemIsMemoryConstrainedReturnValue
}
}
//MARK: - threadsEnabled
private let threadsEnabledEnabledThreadSubscriptionsCallsCountLock = NSLock()
private var threadsEnabledEnabledThreadSubscriptionsUnderlyingCallsCount = 0
open var threadsEnabledEnabledThreadSubscriptionsCallsCount: Int {
get { threadsEnabledEnabledThreadSubscriptionsCallsCountLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingCallsCount } }
set { threadsEnabledEnabledThreadSubscriptionsCallsCountLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingCallsCount = newValue } }
}
open var threadsEnabledEnabledThreadSubscriptionsCalled: Bool {
return threadsEnabledEnabledThreadSubscriptionsCallsCount > 0
}
private let threadsEnabledEnabledThreadSubscriptionsReceivedArgumentsLock = NSLock()
private var threadsEnabledEnabledThreadSubscriptionsUnderlyingReceivedArguments: (enabled: Bool, threadSubscriptions: Bool)?
open var threadsEnabledEnabledThreadSubscriptionsReceivedArguments: (enabled: Bool, threadSubscriptions: Bool)? {
get { threadsEnabledEnabledThreadSubscriptionsReceivedArgumentsLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingReceivedArguments } }
set { threadsEnabledEnabledThreadSubscriptionsReceivedArgumentsLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingReceivedArguments = newValue } }
}
private let threadsEnabledEnabledThreadSubscriptionsReceivedInvocationsLock = NSLock()
private var threadsEnabledEnabledThreadSubscriptionsUnderlyingReceivedInvocations: [(enabled: Bool, threadSubscriptions: Bool)] = []
open var threadsEnabledEnabledThreadSubscriptionsReceivedInvocations: [(enabled: Bool, threadSubscriptions: Bool)] {
get { threadsEnabledEnabledThreadSubscriptionsReceivedInvocationsLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingReceivedInvocations } }
set { threadsEnabledEnabledThreadSubscriptionsReceivedInvocationsLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingReceivedInvocations = newValue } }
}
private let threadsEnabledEnabledThreadSubscriptionsReturnValueLock = NSLock()
open var threadsEnabledEnabledThreadSubscriptionsUnderlyingReturnValue: ClientBuilder!
open var threadsEnabledEnabledThreadSubscriptionsReturnValue: ClientBuilder! {
get { threadsEnabledEnabledThreadSubscriptionsReturnValueLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingReturnValue } }
set { threadsEnabledEnabledThreadSubscriptionsReturnValueLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingReturnValue = newValue } }
}
open var threadsEnabledEnabledThreadSubscriptionsClosure: ((Bool, Bool) -> ClientBuilder)?
open override func threadsEnabled(enabled: Bool, threadSubscriptions: Bool) -> ClientBuilder {
threadsEnabledEnabledThreadSubscriptionsCallsCountLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingCallsCount += 1 }
threadsEnabledEnabledThreadSubscriptionsReceivedArguments = (enabled: enabled, threadSubscriptions: threadSubscriptions)
threadsEnabledEnabledThreadSubscriptionsReceivedInvocationsLock.withLock { threadsEnabledEnabledThreadSubscriptionsUnderlyingReceivedInvocations.append((enabled: enabled, threadSubscriptions: threadSubscriptions)) }
if let threadsEnabledEnabledThreadSubscriptionsClosure = threadsEnabledEnabledThreadSubscriptionsClosure {
return threadsEnabledEnabledThreadSubscriptionsClosure(enabled, threadSubscriptions)
} else {
return threadsEnabledEnabledThreadSubscriptionsReturnValue
}
}
//MARK: - userAgent
private let userAgentUserAgentCallsCountLock = NSLock()
private var userAgentUserAgentUnderlyingCallsCount = 0
open var userAgentUserAgentCallsCount: Int {
get { userAgentUserAgentCallsCountLock.withLock { userAgentUserAgentUnderlyingCallsCount } }
set { userAgentUserAgentCallsCountLock.withLock { userAgentUserAgentUnderlyingCallsCount = newValue } }
}
open var userAgentUserAgentCalled: Bool {
return userAgentUserAgentCallsCount > 0
}
private let userAgentUserAgentReceivedUserAgentLock = NSLock()
private var userAgentUserAgentUnderlyingReceivedUserAgent: String?
open var userAgentUserAgentReceivedUserAgent: String? {
get { userAgentUserAgentReceivedUserAgentLock.withLock { userAgentUserAgentUnderlyingReceivedUserAgent } }
set { userAgentUserAgentReceivedUserAgentLock.withLock { userAgentUserAgentUnderlyingReceivedUserAgent = newValue } }
}
private let userAgentUserAgentReceivedInvocationsLock = NSLock()
private var userAgentUserAgentUnderlyingReceivedInvocations: [String] = []
open var userAgentUserAgentReceivedInvocations: [String] {
get { userAgentUserAgentReceivedInvocationsLock.withLock { userAgentUserAgentUnderlyingReceivedInvocations } }
set { userAgentUserAgentReceivedInvocationsLock.withLock { userAgentUserAgentUnderlyingReceivedInvocations = newValue } }
}
private let userAgentUserAgentReturnValueLock = NSLock()
open var userAgentUserAgentUnderlyingReturnValue: ClientBuilder!
open var userAgentUserAgentReturnValue: ClientBuilder! {
get { userAgentUserAgentReturnValueLock.withLock { userAgentUserAgentUnderlyingReturnValue } }
set { userAgentUserAgentReturnValueLock.withLock { userAgentUserAgentUnderlyingReturnValue = newValue } }
}
open var userAgentUserAgentClosure: ((String) -> ClientBuilder)?
open override func userAgent(userAgent: String) -> ClientBuilder {
userAgentUserAgentCallsCountLock.withLock { userAgentUserAgentUnderlyingCallsCount += 1 }
userAgentUserAgentReceivedUserAgent = userAgent
userAgentUserAgentReceivedInvocationsLock.withLock { userAgentUserAgentUnderlyingReceivedInvocations.append(userAgent) }
if let userAgentUserAgentClosure = userAgentUserAgentClosure {
return userAgentUserAgentClosure(userAgent)
} else {
return userAgentUserAgentReturnValue
}
}
//MARK: - withSearchIndexStore
private let withSearchIndexStorePathPasswordCallsCountLock = NSLock()
private var withSearchIndexStorePathPasswordUnderlyingCallsCount = 0
open var withSearchIndexStorePathPasswordCallsCount: Int {
get { withSearchIndexStorePathPasswordCallsCountLock.withLock { withSearchIndexStorePathPasswordUnderlyingCallsCount } }
set { withSearchIndexStorePathPasswordCallsCountLock.withLock { withSearchIndexStorePathPasswordUnderlyingCallsCount = newValue } }
}
open var withSearchIndexStorePathPasswordCalled: Bool {
return withSearchIndexStorePathPasswordCallsCount > 0
}
private let withSearchIndexStorePathPasswordReceivedArgumentsLock = NSLock()
private var withSearchIndexStorePathPasswordUnderlyingReceivedArguments: (path: String, password: String?)?
open var withSearchIndexStorePathPasswordReceivedArguments: (path: String, password: String?)? {
get { withSearchIndexStorePathPasswordReceivedArgumentsLock.withLock { withSearchIndexStorePathPasswordUnderlyingReceivedArguments } }
set { withSearchIndexStorePathPasswordReceivedArgumentsLock.withLock { withSearchIndexStorePathPasswordUnderlyingReceivedArguments = newValue } }
}
private let withSearchIndexStorePathPasswordReceivedInvocationsLock = NSLock()
private var withSearchIndexStorePathPasswordUnderlyingReceivedInvocations: [(path: String, password: String?)] = []
open var withSearchIndexStorePathPasswordReceivedInvocations: [(path: String, password: String?)] {
get { withSearchIndexStorePathPasswordReceivedInvocationsLock.withLock { withSearchIndexStorePathPasswordUnderlyingReceivedInvocations } }
set { withSearchIndexStorePathPasswordReceivedInvocationsLock.withLock { withSearchIndexStorePathPasswordUnderlyingReceivedInvocations = newValue } }
}
private let withSearchIndexStorePathPasswordReturnValueLock = NSLock()
open var withSearchIndexStorePathPasswordUnderlyingReturnValue: ClientBuilder!
open var withSearchIndexStorePathPasswordReturnValue: ClientBuilder! {
get { withSearchIndexStorePathPasswordReturnValueLock.withLock { withSearchIndexStorePathPasswordUnderlyingReturnValue } }
set { withSearchIndexStorePathPasswordReturnValueLock.withLock { withSearchIndexStorePathPasswordUnderlyingReturnValue = newValue } }
}
open var withSearchIndexStorePathPasswordClosure: ((String, String?) -> ClientBuilder)?
open override func withSearchIndexStore(path: String, password: String?) -> ClientBuilder {
withSearchIndexStorePathPasswordCallsCountLock.withLock { withSearchIndexStorePathPasswordUnderlyingCallsCount += 1 }
withSearchIndexStorePathPasswordReceivedArguments = (path: path, password: password)
withSearchIndexStorePathPasswordReceivedInvocationsLock.withLock { withSearchIndexStorePathPasswordUnderlyingReceivedInvocations.append((path: path, password: password)) }
if let withSearchIndexStorePathPasswordClosure = withSearchIndexStorePathPasswordClosure {
return withSearchIndexStorePathPasswordClosure(path, password)
} else {
return withSearchIndexStorePathPasswordReturnValue
}
}
}
open class ContentScannerSDKMock: MatrixRustSDK.ContentScanner, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - scan
open var scanClientMediaSourceThrowableError: Error?
private let scanClientMediaSourceCallsCountLock = NSLock()
private var scanClientMediaSourceUnderlyingCallsCount = 0
open var scanClientMediaSourceCallsCount: Int {
get { scanClientMediaSourceCallsCountLock.withLock { scanClientMediaSourceUnderlyingCallsCount } }
set { scanClientMediaSourceCallsCountLock.withLock { scanClientMediaSourceUnderlyingCallsCount = newValue } }
}
open var scanClientMediaSourceCalled: Bool {
return scanClientMediaSourceCallsCount > 0
}
private let scanClientMediaSourceReceivedArgumentsLock = NSLock()
private var scanClientMediaSourceUnderlyingReceivedArguments: (client: Client, mediaSource: MediaSource)?
open var scanClientMediaSourceReceivedArguments: (client: Client, mediaSource: MediaSource)? {
get { scanClientMediaSourceReceivedArgumentsLock.withLock { scanClientMediaSourceUnderlyingReceivedArguments } }
set { scanClientMediaSourceReceivedArgumentsLock.withLock { scanClientMediaSourceUnderlyingReceivedArguments = newValue } }
}
private let scanClientMediaSourceReceivedInvocationsLock = NSLock()
private var scanClientMediaSourceUnderlyingReceivedInvocations: [(client: Client, mediaSource: MediaSource)] = []
open var scanClientMediaSourceReceivedInvocations: [(client: Client, mediaSource: MediaSource)] {
get { scanClientMediaSourceReceivedInvocationsLock.withLock { scanClientMediaSourceUnderlyingReceivedInvocations } }
set { scanClientMediaSourceReceivedInvocationsLock.withLock { scanClientMediaSourceUnderlyingReceivedInvocations = newValue } }
}
private let scanClientMediaSourceReturnValueLock = NSLock()
open var scanClientMediaSourceUnderlyingReturnValue: MediaScanResponse!
open var scanClientMediaSourceReturnValue: MediaScanResponse! {
get { scanClientMediaSourceReturnValueLock.withLock { scanClientMediaSourceUnderlyingReturnValue } }
set { scanClientMediaSourceReturnValueLock.withLock { scanClientMediaSourceUnderlyingReturnValue = newValue } }
}
open var scanClientMediaSourceClosure: ((Client, MediaSource) async throws -> MediaScanResponse)?
open override func scan(client: Client, mediaSource: MediaSource) async throws -> MediaScanResponse {
if let error = scanClientMediaSourceThrowableError {
throw error
}
scanClientMediaSourceCallsCountLock.withLock { scanClientMediaSourceUnderlyingCallsCount += 1 }
scanClientMediaSourceReceivedArguments = (client: client, mediaSource: mediaSource)
scanClientMediaSourceReceivedInvocationsLock.withLock { scanClientMediaSourceUnderlyingReceivedInvocations.append((client: client, mediaSource: mediaSource)) }
if let scanClientMediaSourceClosure = scanClientMediaSourceClosure {
return try await scanClientMediaSourceClosure(client, mediaSource)
} else {
return scanClientMediaSourceReturnValue
}
}
}
open class ContinuationMessageSenderSDKMock: MatrixRustSDK.ContinuationMessageSender, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - cancel
open var cancelThrowableError: Error?
private let cancelCallsCountLock = NSLock()
private var cancelUnderlyingCallsCount = 0
open var cancelCallsCount: Int {
get { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount } }
set { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount = newValue } }
}
open var cancelCalled: Bool {
return cancelCallsCount > 0
}
open var cancelClosure: (() async throws -> Void)?
open override func cancel() async throws {
if let error = cancelThrowableError {
throw error
}
cancelCallsCountLock.withLock { cancelUnderlyingCallsCount += 1 }
try await cancelClosure?()
}
//MARK: - confirm
open var confirmThrowableError: Error?
private let confirmCallsCountLock = NSLock()
private var confirmUnderlyingCallsCount = 0
open var confirmCallsCount: Int {
get { confirmCallsCountLock.withLock { confirmUnderlyingCallsCount } }
set { confirmCallsCountLock.withLock { confirmUnderlyingCallsCount = newValue } }
}
open var confirmCalled: Bool {
return confirmCallsCount > 0
}
open var confirmClosure: (() async throws -> Void)?
open override func confirm() async throws {
if let error = confirmThrowableError {
throw error
}
confirmCallsCountLock.withLock { confirmUnderlyingCallsCount += 1 }
try await confirmClosure?()
}
}
open class CrossSigningSecretsSDKMock: MatrixRustSDK.CrossSigningSecrets, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
}
open class EncryptionSDKMock: MatrixRustSDK.Encryption, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - backupExistsOnServer
open var backupExistsOnServerThrowableError: Error?
private let backupExistsOnServerCallsCountLock = NSLock()
private var backupExistsOnServerUnderlyingCallsCount = 0
open var backupExistsOnServerCallsCount: Int {
get { backupExistsOnServerCallsCountLock.withLock { backupExistsOnServerUnderlyingCallsCount } }
set { backupExistsOnServerCallsCountLock.withLock { backupExistsOnServerUnderlyingCallsCount = newValue } }
}
open var backupExistsOnServerCalled: Bool {
return backupExistsOnServerCallsCount > 0
}
private let backupExistsOnServerReturnValueLock = NSLock()
open var backupExistsOnServerUnderlyingReturnValue: Bool!
open var backupExistsOnServerReturnValue: Bool! {
get { backupExistsOnServerReturnValueLock.withLock { backupExistsOnServerUnderlyingReturnValue } }
set { backupExistsOnServerReturnValueLock.withLock { backupExistsOnServerUnderlyingReturnValue = newValue } }
}
open var backupExistsOnServerClosure: (() async throws -> Bool)?
open override func backupExistsOnServer() async throws -> Bool {
if let error = backupExistsOnServerThrowableError {
throw error
}
backupExistsOnServerCallsCountLock.withLock { backupExistsOnServerUnderlyingCallsCount += 1 }
if let backupExistsOnServerClosure = backupExistsOnServerClosure {
return try await backupExistsOnServerClosure()
} else {
return backupExistsOnServerReturnValue
}
}
//MARK: - backupState
private let backupStateCallsCountLock = NSLock()
private var backupStateUnderlyingCallsCount = 0
open var backupStateCallsCount: Int {
get { backupStateCallsCountLock.withLock { backupStateUnderlyingCallsCount } }
set { backupStateCallsCountLock.withLock { backupStateUnderlyingCallsCount = newValue } }
}
open var backupStateCalled: Bool {
return backupStateCallsCount > 0
}
private let backupStateReturnValueLock = NSLock()
open var backupStateUnderlyingReturnValue: BackupState!
open var backupStateReturnValue: BackupState! {
get { backupStateReturnValueLock.withLock { backupStateUnderlyingReturnValue } }
set { backupStateReturnValueLock.withLock { backupStateUnderlyingReturnValue = newValue } }
}
open var backupStateClosure: (() -> BackupState)?
open override func backupState() -> BackupState {
backupStateCallsCountLock.withLock { backupStateUnderlyingCallsCount += 1 }
if let backupStateClosure = backupStateClosure {
return backupStateClosure()
} else {
return backupStateReturnValue
}
}
//MARK: - backupStateListener
private let backupStateListenerListenerCallsCountLock = NSLock()
private var backupStateListenerListenerUnderlyingCallsCount = 0
open var backupStateListenerListenerCallsCount: Int {
get { backupStateListenerListenerCallsCountLock.withLock { backupStateListenerListenerUnderlyingCallsCount } }
set { backupStateListenerListenerCallsCountLock.withLock { backupStateListenerListenerUnderlyingCallsCount = newValue } }
}
open var backupStateListenerListenerCalled: Bool {
return backupStateListenerListenerCallsCount > 0
}
private let backupStateListenerListenerReceivedListenerLock = NSLock()
private var backupStateListenerListenerUnderlyingReceivedListener: BackupStateListener?
open var backupStateListenerListenerReceivedListener: BackupStateListener? {
get { backupStateListenerListenerReceivedListenerLock.withLock { backupStateListenerListenerUnderlyingReceivedListener } }
set { backupStateListenerListenerReceivedListenerLock.withLock { backupStateListenerListenerUnderlyingReceivedListener = newValue } }
}
private let backupStateListenerListenerReceivedInvocationsLock = NSLock()
private var backupStateListenerListenerUnderlyingReceivedInvocations: [BackupStateListener] = []
open var backupStateListenerListenerReceivedInvocations: [BackupStateListener] {
get { backupStateListenerListenerReceivedInvocationsLock.withLock { backupStateListenerListenerUnderlyingReceivedInvocations } }
set { backupStateListenerListenerReceivedInvocationsLock.withLock { backupStateListenerListenerUnderlyingReceivedInvocations = newValue } }
}
private let backupStateListenerListenerReturnValueLock = NSLock()
open var backupStateListenerListenerUnderlyingReturnValue: TaskHandle!
open var backupStateListenerListenerReturnValue: TaskHandle! {
get { backupStateListenerListenerReturnValueLock.withLock { backupStateListenerListenerUnderlyingReturnValue } }
set { backupStateListenerListenerReturnValueLock.withLock { backupStateListenerListenerUnderlyingReturnValue = newValue } }
}
open var backupStateListenerListenerClosure: ((BackupStateListener) -> TaskHandle)?
open override func backupStateListener(listener: BackupStateListener) -> TaskHandle {
backupStateListenerListenerCallsCountLock.withLock { backupStateListenerListenerUnderlyingCallsCount += 1 }
backupStateListenerListenerReceivedListener = listener
backupStateListenerListenerReceivedInvocationsLock.withLock { backupStateListenerListenerUnderlyingReceivedInvocations.append(listener) }
if let backupStateListenerListenerClosure = backupStateListenerListenerClosure {
return backupStateListenerListenerClosure(listener)
} else {
return backupStateListenerListenerReturnValue
}
}
//MARK: - createDehydratedDevice
open var createDehydratedDeviceDisplayNamePickleKeyThrowableError: Error?
private let createDehydratedDeviceDisplayNamePickleKeyCallsCountLock = NSLock()
private var createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount = 0
open var createDehydratedDeviceDisplayNamePickleKeyCallsCount: Int {
get { createDehydratedDeviceDisplayNamePickleKeyCallsCountLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount } }
set { createDehydratedDeviceDisplayNamePickleKeyCallsCountLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount = newValue } }
}
open var createDehydratedDeviceDisplayNamePickleKeyCalled: Bool {
return createDehydratedDeviceDisplayNamePickleKeyCallsCount > 0
}
private let createDehydratedDeviceDisplayNamePickleKeyReceivedArgumentsLock = NSLock()
private var createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedArguments: (displayName: String?, pickleKey: String)?
open var createDehydratedDeviceDisplayNamePickleKeyReceivedArguments: (displayName: String?, pickleKey: String)? {
get { createDehydratedDeviceDisplayNamePickleKeyReceivedArgumentsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedArguments } }
set { createDehydratedDeviceDisplayNamePickleKeyReceivedArgumentsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedArguments = newValue } }
}
private let createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock = NSLock()
private var createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations: [(displayName: String?, pickleKey: String)] = []
open var createDehydratedDeviceDisplayNamePickleKeyReceivedInvocations: [(displayName: String?, pickleKey: String)] {
get { createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations } }
set { createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations = newValue } }
}
private let createDehydratedDeviceDisplayNamePickleKeyReturnValueLock = NSLock()
open var createDehydratedDeviceDisplayNamePickleKeyUnderlyingReturnValue: String!
open var createDehydratedDeviceDisplayNamePickleKeyReturnValue: String! {
get { createDehydratedDeviceDisplayNamePickleKeyReturnValueLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReturnValue } }
set { createDehydratedDeviceDisplayNamePickleKeyReturnValueLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReturnValue = newValue } }
}
open var createDehydratedDeviceDisplayNamePickleKeyClosure: ((String?, String) async throws -> String)?
open override func createDehydratedDevice(displayName: String?, pickleKey: String) async throws -> String {
if let error = createDehydratedDeviceDisplayNamePickleKeyThrowableError {
throw error
}
createDehydratedDeviceDisplayNamePickleKeyCallsCountLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingCallsCount += 1 }
createDehydratedDeviceDisplayNamePickleKeyReceivedArguments = (displayName: displayName, pickleKey: pickleKey)
createDehydratedDeviceDisplayNamePickleKeyReceivedInvocationsLock.withLock { createDehydratedDeviceDisplayNamePickleKeyUnderlyingReceivedInvocations.append((displayName: displayName, pickleKey: pickleKey)) }
if let createDehydratedDeviceDisplayNamePickleKeyClosure = createDehydratedDeviceDisplayNamePickleKeyClosure {
return try await createDehydratedDeviceDisplayNamePickleKeyClosure(displayName, pickleKey)
} else {
return createDehydratedDeviceDisplayNamePickleKeyReturnValue
}
}
//MARK: - curve25519Key
private let curve25519KeyCallsCountLock = NSLock()
private var curve25519KeyUnderlyingCallsCount = 0
open var curve25519KeyCallsCount: Int {
get { curve25519KeyCallsCountLock.withLock { curve25519KeyUnderlyingCallsCount } }
set { curve25519KeyCallsCountLock.withLock { curve25519KeyUnderlyingCallsCount = newValue } }
}
open var curve25519KeyCalled: Bool {
return curve25519KeyCallsCount > 0
}
private let curve25519KeyReturnValueLock = NSLock()
open var curve25519KeyUnderlyingReturnValue: String?
open var curve25519KeyReturnValue: String? {
get { curve25519KeyReturnValueLock.withLock { curve25519KeyUnderlyingReturnValue } }
set { curve25519KeyReturnValueLock.withLock { curve25519KeyUnderlyingReturnValue = newValue } }
}
open var curve25519KeyClosure: (() async -> String?)?
open override func curve25519Key() async -> String? {
curve25519KeyCallsCountLock.withLock { curve25519KeyUnderlyingCallsCount += 1 }
if let curve25519KeyClosure = curve25519KeyClosure {
return await curve25519KeyClosure()
} else {
return curve25519KeyReturnValue
}
}
//MARK: - dehydratedDeviceEventListener
private let dehydratedDeviceEventListenerListenerCallsCountLock = NSLock()
private var dehydratedDeviceEventListenerListenerUnderlyingCallsCount = 0
open var dehydratedDeviceEventListenerListenerCallsCount: Int {
get { dehydratedDeviceEventListenerListenerCallsCountLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingCallsCount } }
set { dehydratedDeviceEventListenerListenerCallsCountLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingCallsCount = newValue } }
}
open var dehydratedDeviceEventListenerListenerCalled: Bool {
return dehydratedDeviceEventListenerListenerCallsCount > 0
}
private let dehydratedDeviceEventListenerListenerReceivedListenerLock = NSLock()
private var dehydratedDeviceEventListenerListenerUnderlyingReceivedListener: DehydratedDeviceEventListener?
open var dehydratedDeviceEventListenerListenerReceivedListener: DehydratedDeviceEventListener? {
get { dehydratedDeviceEventListenerListenerReceivedListenerLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedListener } }
set { dehydratedDeviceEventListenerListenerReceivedListenerLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedListener = newValue } }
}
private let dehydratedDeviceEventListenerListenerReceivedInvocationsLock = NSLock()
private var dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations: [DehydratedDeviceEventListener] = []
open var dehydratedDeviceEventListenerListenerReceivedInvocations: [DehydratedDeviceEventListener] {
get { dehydratedDeviceEventListenerListenerReceivedInvocationsLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations } }
set { dehydratedDeviceEventListenerListenerReceivedInvocationsLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations = newValue } }
}
private let dehydratedDeviceEventListenerListenerReturnValueLock = NSLock()
open var dehydratedDeviceEventListenerListenerUnderlyingReturnValue: TaskHandle!
open var dehydratedDeviceEventListenerListenerReturnValue: TaskHandle! {
get { dehydratedDeviceEventListenerListenerReturnValueLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReturnValue } }
set { dehydratedDeviceEventListenerListenerReturnValueLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReturnValue = newValue } }
}
open var dehydratedDeviceEventListenerListenerClosure: ((DehydratedDeviceEventListener) -> TaskHandle)?
open override func dehydratedDeviceEventListener(listener: DehydratedDeviceEventListener) -> TaskHandle {
dehydratedDeviceEventListenerListenerCallsCountLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingCallsCount += 1 }
dehydratedDeviceEventListenerListenerReceivedListener = listener
dehydratedDeviceEventListenerListenerReceivedInvocationsLock.withLock { dehydratedDeviceEventListenerListenerUnderlyingReceivedInvocations.append(listener) }
if let dehydratedDeviceEventListenerListenerClosure = dehydratedDeviceEventListenerListenerClosure {
return dehydratedDeviceEventListenerListenerClosure(listener)
} else {
return dehydratedDeviceEventListenerListenerReturnValue
}
}
//MARK: - deleteDehydratedDevice
open var deleteDehydratedDeviceThrowableError: Error?
private let deleteDehydratedDeviceCallsCountLock = NSLock()
private var deleteDehydratedDeviceUnderlyingCallsCount = 0
open var deleteDehydratedDeviceCallsCount: Int {
get { deleteDehydratedDeviceCallsCountLock.withLock { deleteDehydratedDeviceUnderlyingCallsCount } }
set { deleteDehydratedDeviceCallsCountLock.withLock { deleteDehydratedDeviceUnderlyingCallsCount = newValue } }
}
open var deleteDehydratedDeviceCalled: Bool {
return deleteDehydratedDeviceCallsCount > 0
}
open var deleteDehydratedDeviceClosure: (() async throws -> Void)?
open override func deleteDehydratedDevice() async throws {
if let error = deleteDehydratedDeviceThrowableError {
throw error
}
deleteDehydratedDeviceCallsCountLock.withLock { deleteDehydratedDeviceUnderlyingCallsCount += 1 }
try await deleteDehydratedDeviceClosure?()
}
//MARK: - disableRecovery
open var disableRecoveryThrowableError: Error?
private let disableRecoveryCallsCountLock = NSLock()
private var disableRecoveryUnderlyingCallsCount = 0
open var disableRecoveryCallsCount: Int {
get { disableRecoveryCallsCountLock.withLock { disableRecoveryUnderlyingCallsCount } }
set { disableRecoveryCallsCountLock.withLock { disableRecoveryUnderlyingCallsCount = newValue } }
}
open var disableRecoveryCalled: Bool {
return disableRecoveryCallsCount > 0
}
open var disableRecoveryClosure: (() async throws -> Void)?
open override func disableRecovery() async throws {
if let error = disableRecoveryThrowableError {
throw error
}
disableRecoveryCallsCountLock.withLock { disableRecoveryUnderlyingCallsCount += 1 }
try await disableRecoveryClosure?()
}
//MARK: - ed25519Key
private let ed25519KeyCallsCountLock = NSLock()
private var ed25519KeyUnderlyingCallsCount = 0
open var ed25519KeyCallsCount: Int {
get { ed25519KeyCallsCountLock.withLock { ed25519KeyUnderlyingCallsCount } }
set { ed25519KeyCallsCountLock.withLock { ed25519KeyUnderlyingCallsCount = newValue } }
}
open var ed25519KeyCalled: Bool {
return ed25519KeyCallsCount > 0
}
private let ed25519KeyReturnValueLock = NSLock()
open var ed25519KeyUnderlyingReturnValue: String?
open var ed25519KeyReturnValue: String? {
get { ed25519KeyReturnValueLock.withLock { ed25519KeyUnderlyingReturnValue } }
set { ed25519KeyReturnValueLock.withLock { ed25519KeyUnderlyingReturnValue = newValue } }
}
open var ed25519KeyClosure: (() async -> String?)?
open override func ed25519Key() async -> String? {
ed25519KeyCallsCountLock.withLock { ed25519KeyUnderlyingCallsCount += 1 }
if let ed25519KeyClosure = ed25519KeyClosure {
return await ed25519KeyClosure()
} else {
return ed25519KeyReturnValue
}
}
//MARK: - enableBackups
open var enableBackupsThrowableError: Error?
private let enableBackupsCallsCountLock = NSLock()
private var enableBackupsUnderlyingCallsCount = 0
open var enableBackupsCallsCount: Int {
get { enableBackupsCallsCountLock.withLock { enableBackupsUnderlyingCallsCount } }
set { enableBackupsCallsCountLock.withLock { enableBackupsUnderlyingCallsCount = newValue } }
}
open var enableBackupsCalled: Bool {
return enableBackupsCallsCount > 0
}
open var enableBackupsClosure: (() async throws -> Void)?
open override func enableBackups() async throws {
if let error = enableBackupsThrowableError {
throw error
}
enableBackupsCallsCountLock.withLock { enableBackupsUnderlyingCallsCount += 1 }
try await enableBackupsClosure?()
}
//MARK: - enableRecovery
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerThrowableError: Error?
private let enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerCallsCountLock = NSLock()
private var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingCallsCount = 0
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerCallsCount: Int {
get { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerCallsCountLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingCallsCount } }
set { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerCallsCountLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingCallsCount = newValue } }
}
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerCalled: Bool {
return enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerCallsCount > 0
}
private let enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedArgumentsLock = NSLock()
private var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReceivedArguments: (waitForBackupsToUpload: Bool, passphrase: String?, progressListener: EnableRecoveryProgressListener)?
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedArguments: (waitForBackupsToUpload: Bool, passphrase: String?, progressListener: EnableRecoveryProgressListener)? {
get { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedArgumentsLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReceivedArguments } }
set { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedArgumentsLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReceivedArguments = newValue } }
}
private let enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedInvocationsLock = NSLock()
private var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReceivedInvocations: [(waitForBackupsToUpload: Bool, passphrase: String?, progressListener: EnableRecoveryProgressListener)] = []
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedInvocations: [(waitForBackupsToUpload: Bool, passphrase: String?, progressListener: EnableRecoveryProgressListener)] {
get { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedInvocationsLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReceivedInvocations } }
set { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedInvocationsLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReceivedInvocations = newValue } }
}
private let enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReturnValueLock = NSLock()
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReturnValue: String!
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReturnValue: String! {
get { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReturnValueLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReturnValue } }
set { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReturnValueLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReturnValue = newValue } }
}
open var enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerClosure: ((Bool, String?, EnableRecoveryProgressListener) async throws -> String)?
open override func enableRecovery(waitForBackupsToUpload: Bool, passphrase: String?, progressListener: EnableRecoveryProgressListener) async throws -> String {
if let error = enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerThrowableError {
throw error
}
enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerCallsCountLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingCallsCount += 1 }
enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedArguments = (waitForBackupsToUpload: waitForBackupsToUpload, passphrase: passphrase, progressListener: progressListener)
enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReceivedInvocationsLock.withLock { enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerUnderlyingReceivedInvocations.append((waitForBackupsToUpload: waitForBackupsToUpload, passphrase: passphrase, progressListener: progressListener)) }
if let enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerClosure = enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerClosure {
return try await enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerClosure(waitForBackupsToUpload, passphrase, progressListener)
} else {
return enableRecoveryWaitForBackupsToUploadPassphraseProgressListenerReturnValue
}
}
//MARK: - hasDevicesToVerifyAgainst
open var hasDevicesToVerifyAgainstThrowableError: Error?
private let hasDevicesToVerifyAgainstCallsCountLock = NSLock()
private var hasDevicesToVerifyAgainstUnderlyingCallsCount = 0
open var hasDevicesToVerifyAgainstCallsCount: Int {
get { hasDevicesToVerifyAgainstCallsCountLock.withLock { hasDevicesToVerifyAgainstUnderlyingCallsCount } }
set { hasDevicesToVerifyAgainstCallsCountLock.withLock { hasDevicesToVerifyAgainstUnderlyingCallsCount = newValue } }
}
open var hasDevicesToVerifyAgainstCalled: Bool {
return hasDevicesToVerifyAgainstCallsCount > 0
}
private let hasDevicesToVerifyAgainstReturnValueLock = NSLock()
open var hasDevicesToVerifyAgainstUnderlyingReturnValue: Bool!
open var hasDevicesToVerifyAgainstReturnValue: Bool! {
get { hasDevicesToVerifyAgainstReturnValueLock.withLock { hasDevicesToVerifyAgainstUnderlyingReturnValue } }
set { hasDevicesToVerifyAgainstReturnValueLock.withLock { hasDevicesToVerifyAgainstUnderlyingReturnValue = newValue } }
}
open var hasDevicesToVerifyAgainstClosure: (() async throws -> Bool)?
open override func hasDevicesToVerifyAgainst() async throws -> Bool {
if let error = hasDevicesToVerifyAgainstThrowableError {
throw error
}
hasDevicesToVerifyAgainstCallsCountLock.withLock { hasDevicesToVerifyAgainstUnderlyingCallsCount += 1 }
if let hasDevicesToVerifyAgainstClosure = hasDevicesToVerifyAgainstClosure {
return try await hasDevicesToVerifyAgainstClosure()
} else {
return hasDevicesToVerifyAgainstReturnValue
}
}
//MARK: - importSecretsBundle
open var importSecretsBundleSecretsBundleThrowableError: Error?
private let importSecretsBundleSecretsBundleCallsCountLock = NSLock()
private var importSecretsBundleSecretsBundleUnderlyingCallsCount = 0
open var importSecretsBundleSecretsBundleCallsCount: Int {
get { importSecretsBundleSecretsBundleCallsCountLock.withLock { importSecretsBundleSecretsBundleUnderlyingCallsCount } }
set { importSecretsBundleSecretsBundleCallsCountLock.withLock { importSecretsBundleSecretsBundleUnderlyingCallsCount = newValue } }
}
open var importSecretsBundleSecretsBundleCalled: Bool {
return importSecretsBundleSecretsBundleCallsCount > 0
}
private let importSecretsBundleSecretsBundleReceivedSecretsBundleLock = NSLock()
private var importSecretsBundleSecretsBundleUnderlyingReceivedSecretsBundle: SecretsBundleWithUserId?
open var importSecretsBundleSecretsBundleReceivedSecretsBundle: SecretsBundleWithUserId? {
get { importSecretsBundleSecretsBundleReceivedSecretsBundleLock.withLock { importSecretsBundleSecretsBundleUnderlyingReceivedSecretsBundle } }
set { importSecretsBundleSecretsBundleReceivedSecretsBundleLock.withLock { importSecretsBundleSecretsBundleUnderlyingReceivedSecretsBundle = newValue } }
}
private let importSecretsBundleSecretsBundleReceivedInvocationsLock = NSLock()
private var importSecretsBundleSecretsBundleUnderlyingReceivedInvocations: [SecretsBundleWithUserId] = []
open var importSecretsBundleSecretsBundleReceivedInvocations: [SecretsBundleWithUserId] {
get { importSecretsBundleSecretsBundleReceivedInvocationsLock.withLock { importSecretsBundleSecretsBundleUnderlyingReceivedInvocations } }
set { importSecretsBundleSecretsBundleReceivedInvocationsLock.withLock { importSecretsBundleSecretsBundleUnderlyingReceivedInvocations = newValue } }
}
open var importSecretsBundleSecretsBundleClosure: ((SecretsBundleWithUserId) async throws -> Void)?
open override func importSecretsBundle(secretsBundle: SecretsBundleWithUserId) async throws {
if let error = importSecretsBundleSecretsBundleThrowableError {
throw error
}
importSecretsBundleSecretsBundleCallsCountLock.withLock { importSecretsBundleSecretsBundleUnderlyingCallsCount += 1 }
importSecretsBundleSecretsBundleReceivedSecretsBundle = secretsBundle
importSecretsBundleSecretsBundleReceivedInvocationsLock.withLock { importSecretsBundleSecretsBundleUnderlyingReceivedInvocations.append(secretsBundle) }
try await importSecretsBundleSecretsBundleClosure?(secretsBundle)
}
//MARK: - isDehydratedDeviceSupported
open var isDehydratedDeviceSupportedThrowableError: Error?
private let isDehydratedDeviceSupportedCallsCountLock = NSLock()
private var isDehydratedDeviceSupportedUnderlyingCallsCount = 0
open var isDehydratedDeviceSupportedCallsCount: Int {
get { isDehydratedDeviceSupportedCallsCountLock.withLock { isDehydratedDeviceSupportedUnderlyingCallsCount } }
set { isDehydratedDeviceSupportedCallsCountLock.withLock { isDehydratedDeviceSupportedUnderlyingCallsCount = newValue } }
}
open var isDehydratedDeviceSupportedCalled: Bool {
return isDehydratedDeviceSupportedCallsCount > 0
}
private let isDehydratedDeviceSupportedReturnValueLock = NSLock()
open var isDehydratedDeviceSupportedUnderlyingReturnValue: Bool!
open var isDehydratedDeviceSupportedReturnValue: Bool! {
get { isDehydratedDeviceSupportedReturnValueLock.withLock { isDehydratedDeviceSupportedUnderlyingReturnValue } }
set { isDehydratedDeviceSupportedReturnValueLock.withLock { isDehydratedDeviceSupportedUnderlyingReturnValue = newValue } }
}
open var isDehydratedDeviceSupportedClosure: (() async throws -> Bool)?
open override func isDehydratedDeviceSupported() async throws -> Bool {
if let error = isDehydratedDeviceSupportedThrowableError {
throw error
}
isDehydratedDeviceSupportedCallsCountLock.withLock { isDehydratedDeviceSupportedUnderlyingCallsCount += 1 }
if let isDehydratedDeviceSupportedClosure = isDehydratedDeviceSupportedClosure {
return try await isDehydratedDeviceSupportedClosure()
} else {
return isDehydratedDeviceSupportedReturnValue
}
}
//MARK: - isLastDevice
open var isLastDeviceThrowableError: Error?
private let isLastDeviceCallsCountLock = NSLock()
private var isLastDeviceUnderlyingCallsCount = 0
open var isLastDeviceCallsCount: Int {
get { isLastDeviceCallsCountLock.withLock { isLastDeviceUnderlyingCallsCount } }
set { isLastDeviceCallsCountLock.withLock { isLastDeviceUnderlyingCallsCount = newValue } }
}
open var isLastDeviceCalled: Bool {
return isLastDeviceCallsCount > 0
}
private let isLastDeviceReturnValueLock = NSLock()
open var isLastDeviceUnderlyingReturnValue: Bool!
open var isLastDeviceReturnValue: Bool! {
get { isLastDeviceReturnValueLock.withLock { isLastDeviceUnderlyingReturnValue } }
set { isLastDeviceReturnValueLock.withLock { isLastDeviceUnderlyingReturnValue = newValue } }
}
open var isLastDeviceClosure: (() async throws -> Bool)?
open override func isLastDevice() async throws -> Bool {
if let error = isLastDeviceThrowableError {
throw error
}
isLastDeviceCallsCountLock.withLock { isLastDeviceUnderlyingCallsCount += 1 }
if let isLastDeviceClosure = isLastDeviceClosure {
return try await isLastDeviceClosure()
} else {
return isLastDeviceReturnValue
}
}
//MARK: - recover
open var recoverRecoveryKeyThrowableError: Error?
private let recoverRecoveryKeyCallsCountLock = NSLock()
private var recoverRecoveryKeyUnderlyingCallsCount = 0
open var recoverRecoveryKeyCallsCount: Int {
get { recoverRecoveryKeyCallsCountLock.withLock { recoverRecoveryKeyUnderlyingCallsCount } }
set { recoverRecoveryKeyCallsCountLock.withLock { recoverRecoveryKeyUnderlyingCallsCount = newValue } }
}
open var recoverRecoveryKeyCalled: Bool {
return recoverRecoveryKeyCallsCount > 0
}
private let recoverRecoveryKeyReceivedRecoveryKeyLock = NSLock()
private var recoverRecoveryKeyUnderlyingReceivedRecoveryKey: String?
open var recoverRecoveryKeyReceivedRecoveryKey: String? {
get { recoverRecoveryKeyReceivedRecoveryKeyLock.withLock { recoverRecoveryKeyUnderlyingReceivedRecoveryKey } }
set { recoverRecoveryKeyReceivedRecoveryKeyLock.withLock { recoverRecoveryKeyUnderlyingReceivedRecoveryKey = newValue } }
}
private let recoverRecoveryKeyReceivedInvocationsLock = NSLock()
private var recoverRecoveryKeyUnderlyingReceivedInvocations: [String] = []
open var recoverRecoveryKeyReceivedInvocations: [String] {
get { recoverRecoveryKeyReceivedInvocationsLock.withLock { recoverRecoveryKeyUnderlyingReceivedInvocations } }
set { recoverRecoveryKeyReceivedInvocationsLock.withLock { recoverRecoveryKeyUnderlyingReceivedInvocations = newValue } }
}
open var recoverRecoveryKeyClosure: ((String) async throws -> Void)?
open override func recover(recoveryKey: String) async throws {
if let error = recoverRecoveryKeyThrowableError {
throw error
}
recoverRecoveryKeyCallsCountLock.withLock { recoverRecoveryKeyUnderlyingCallsCount += 1 }
recoverRecoveryKeyReceivedRecoveryKey = recoveryKey
recoverRecoveryKeyReceivedInvocationsLock.withLock { recoverRecoveryKeyUnderlyingReceivedInvocations.append(recoveryKey) }
try await recoverRecoveryKeyClosure?(recoveryKey)
}
//MARK: - recoverAndFixBackup
open var recoverAndFixBackupRecoveryKeyThrowableError: Error?
private let recoverAndFixBackupRecoveryKeyCallsCountLock = NSLock()
private var recoverAndFixBackupRecoveryKeyUnderlyingCallsCount = 0
open var recoverAndFixBackupRecoveryKeyCallsCount: Int {
get { recoverAndFixBackupRecoveryKeyCallsCountLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingCallsCount } }
set { recoverAndFixBackupRecoveryKeyCallsCountLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingCallsCount = newValue } }
}
open var recoverAndFixBackupRecoveryKeyCalled: Bool {
return recoverAndFixBackupRecoveryKeyCallsCount > 0
}
private let recoverAndFixBackupRecoveryKeyReceivedRecoveryKeyLock = NSLock()
private var recoverAndFixBackupRecoveryKeyUnderlyingReceivedRecoveryKey: String?
open var recoverAndFixBackupRecoveryKeyReceivedRecoveryKey: String? {
get { recoverAndFixBackupRecoveryKeyReceivedRecoveryKeyLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingReceivedRecoveryKey } }
set { recoverAndFixBackupRecoveryKeyReceivedRecoveryKeyLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingReceivedRecoveryKey = newValue } }
}
private let recoverAndFixBackupRecoveryKeyReceivedInvocationsLock = NSLock()
private var recoverAndFixBackupRecoveryKeyUnderlyingReceivedInvocations: [String] = []
open var recoverAndFixBackupRecoveryKeyReceivedInvocations: [String] {
get { recoverAndFixBackupRecoveryKeyReceivedInvocationsLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingReceivedInvocations } }
set { recoverAndFixBackupRecoveryKeyReceivedInvocationsLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingReceivedInvocations = newValue } }
}
open var recoverAndFixBackupRecoveryKeyClosure: ((String) async throws -> Void)?
open override func recoverAndFixBackup(recoveryKey: String) async throws {
if let error = recoverAndFixBackupRecoveryKeyThrowableError {
throw error
}
recoverAndFixBackupRecoveryKeyCallsCountLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingCallsCount += 1 }
recoverAndFixBackupRecoveryKeyReceivedRecoveryKey = recoveryKey
recoverAndFixBackupRecoveryKeyReceivedInvocationsLock.withLock { recoverAndFixBackupRecoveryKeyUnderlyingReceivedInvocations.append(recoveryKey) }
try await recoverAndFixBackupRecoveryKeyClosure?(recoveryKey)
}
//MARK: - recoverAndReset
open var recoverAndResetOldRecoveryKeyThrowableError: Error?
private let recoverAndResetOldRecoveryKeyCallsCountLock = NSLock()
private var recoverAndResetOldRecoveryKeyUnderlyingCallsCount = 0
open var recoverAndResetOldRecoveryKeyCallsCount: Int {
get { recoverAndResetOldRecoveryKeyCallsCountLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingCallsCount } }
set { recoverAndResetOldRecoveryKeyCallsCountLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingCallsCount = newValue } }
}
open var recoverAndResetOldRecoveryKeyCalled: Bool {
return recoverAndResetOldRecoveryKeyCallsCount > 0
}
private let recoverAndResetOldRecoveryKeyReceivedOldRecoveryKeyLock = NSLock()
private var recoverAndResetOldRecoveryKeyUnderlyingReceivedOldRecoveryKey: String?
open var recoverAndResetOldRecoveryKeyReceivedOldRecoveryKey: String? {
get { recoverAndResetOldRecoveryKeyReceivedOldRecoveryKeyLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingReceivedOldRecoveryKey } }
set { recoverAndResetOldRecoveryKeyReceivedOldRecoveryKeyLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingReceivedOldRecoveryKey = newValue } }
}
private let recoverAndResetOldRecoveryKeyReceivedInvocationsLock = NSLock()
private var recoverAndResetOldRecoveryKeyUnderlyingReceivedInvocations: [String] = []
open var recoverAndResetOldRecoveryKeyReceivedInvocations: [String] {
get { recoverAndResetOldRecoveryKeyReceivedInvocationsLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingReceivedInvocations } }
set { recoverAndResetOldRecoveryKeyReceivedInvocationsLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingReceivedInvocations = newValue } }
}
private let recoverAndResetOldRecoveryKeyReturnValueLock = NSLock()
open var recoverAndResetOldRecoveryKeyUnderlyingReturnValue: String!
open var recoverAndResetOldRecoveryKeyReturnValue: String! {
get { recoverAndResetOldRecoveryKeyReturnValueLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingReturnValue } }
set { recoverAndResetOldRecoveryKeyReturnValueLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingReturnValue = newValue } }
}
open var recoverAndResetOldRecoveryKeyClosure: ((String) async throws -> String)?
open override func recoverAndReset(oldRecoveryKey: String) async throws -> String {
if let error = recoverAndResetOldRecoveryKeyThrowableError {
throw error
}
recoverAndResetOldRecoveryKeyCallsCountLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingCallsCount += 1 }
recoverAndResetOldRecoveryKeyReceivedOldRecoveryKey = oldRecoveryKey
recoverAndResetOldRecoveryKeyReceivedInvocationsLock.withLock { recoverAndResetOldRecoveryKeyUnderlyingReceivedInvocations.append(oldRecoveryKey) }
if let recoverAndResetOldRecoveryKeyClosure = recoverAndResetOldRecoveryKeyClosure {
return try await recoverAndResetOldRecoveryKeyClosure(oldRecoveryKey)
} else {
return recoverAndResetOldRecoveryKeyReturnValue
}
}
//MARK: - recoveryState
private let recoveryStateCallsCountLock = NSLock()
private var recoveryStateUnderlyingCallsCount = 0
open var recoveryStateCallsCount: Int {
get { recoveryStateCallsCountLock.withLock { recoveryStateUnderlyingCallsCount } }
set { recoveryStateCallsCountLock.withLock { recoveryStateUnderlyingCallsCount = newValue } }
}
open var recoveryStateCalled: Bool {
return recoveryStateCallsCount > 0
}
private let recoveryStateReturnValueLock = NSLock()
open var recoveryStateUnderlyingReturnValue: RecoveryState!
open var recoveryStateReturnValue: RecoveryState! {
get { recoveryStateReturnValueLock.withLock { recoveryStateUnderlyingReturnValue } }
set { recoveryStateReturnValueLock.withLock { recoveryStateUnderlyingReturnValue = newValue } }
}
open var recoveryStateClosure: (() -> RecoveryState)?
open override func recoveryState() -> RecoveryState {
recoveryStateCallsCountLock.withLock { recoveryStateUnderlyingCallsCount += 1 }
if let recoveryStateClosure = recoveryStateClosure {
return recoveryStateClosure()
} else {
return recoveryStateReturnValue
}
}
//MARK: - recoveryStateListener
private let recoveryStateListenerListenerCallsCountLock = NSLock()
private var recoveryStateListenerListenerUnderlyingCallsCount = 0
open var recoveryStateListenerListenerCallsCount: Int {
get { recoveryStateListenerListenerCallsCountLock.withLock { recoveryStateListenerListenerUnderlyingCallsCount } }
set { recoveryStateListenerListenerCallsCountLock.withLock { recoveryStateListenerListenerUnderlyingCallsCount = newValue } }
}
open var recoveryStateListenerListenerCalled: Bool {
return recoveryStateListenerListenerCallsCount > 0
}
private let recoveryStateListenerListenerReceivedListenerLock = NSLock()
private var recoveryStateListenerListenerUnderlyingReceivedListener: RecoveryStateListener?
open var recoveryStateListenerListenerReceivedListener: RecoveryStateListener? {
get { recoveryStateListenerListenerReceivedListenerLock.withLock { recoveryStateListenerListenerUnderlyingReceivedListener } }
set { recoveryStateListenerListenerReceivedListenerLock.withLock { recoveryStateListenerListenerUnderlyingReceivedListener = newValue } }
}
private let recoveryStateListenerListenerReceivedInvocationsLock = NSLock()
private var recoveryStateListenerListenerUnderlyingReceivedInvocations: [RecoveryStateListener] = []
open var recoveryStateListenerListenerReceivedInvocations: [RecoveryStateListener] {
get { recoveryStateListenerListenerReceivedInvocationsLock.withLock { recoveryStateListenerListenerUnderlyingReceivedInvocations } }
set { recoveryStateListenerListenerReceivedInvocationsLock.withLock { recoveryStateListenerListenerUnderlyingReceivedInvocations = newValue } }
}
private let recoveryStateListenerListenerReturnValueLock = NSLock()
open var recoveryStateListenerListenerUnderlyingReturnValue: TaskHandle!
open var recoveryStateListenerListenerReturnValue: TaskHandle! {
get { recoveryStateListenerListenerReturnValueLock.withLock { recoveryStateListenerListenerUnderlyingReturnValue } }
set { recoveryStateListenerListenerReturnValueLock.withLock { recoveryStateListenerListenerUnderlyingReturnValue = newValue } }
}
open var recoveryStateListenerListenerClosure: ((RecoveryStateListener) -> TaskHandle)?
open override func recoveryStateListener(listener: RecoveryStateListener) -> TaskHandle {
recoveryStateListenerListenerCallsCountLock.withLock { recoveryStateListenerListenerUnderlyingCallsCount += 1 }
recoveryStateListenerListenerReceivedListener = listener
recoveryStateListenerListenerReceivedInvocationsLock.withLock { recoveryStateListenerListenerUnderlyingReceivedInvocations.append(listener) }
if let recoveryStateListenerListenerClosure = recoveryStateListenerListenerClosure {
return recoveryStateListenerListenerClosure(listener)
} else {
return recoveryStateListenerListenerReturnValue
}
}
//MARK: - rehydrateDehydratedDevice
open var rehydrateDehydratedDevicePickleKeyThrowableError: Error?
private let rehydrateDehydratedDevicePickleKeyCallsCountLock = NSLock()
private var rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount = 0
open var rehydrateDehydratedDevicePickleKeyCallsCount: Int {
get { rehydrateDehydratedDevicePickleKeyCallsCountLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount } }
set { rehydrateDehydratedDevicePickleKeyCallsCountLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount = newValue } }
}
open var rehydrateDehydratedDevicePickleKeyCalled: Bool {
return rehydrateDehydratedDevicePickleKeyCallsCount > 0
}
private let rehydrateDehydratedDevicePickleKeyReceivedPickleKeyLock = NSLock()
private var rehydrateDehydratedDevicePickleKeyUnderlyingReceivedPickleKey: String?
open var rehydrateDehydratedDevicePickleKeyReceivedPickleKey: String? {
get { rehydrateDehydratedDevicePickleKeyReceivedPickleKeyLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedPickleKey } }
set { rehydrateDehydratedDevicePickleKeyReceivedPickleKeyLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedPickleKey = newValue } }
}
private let rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock = NSLock()
private var rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations: [String] = []
open var rehydrateDehydratedDevicePickleKeyReceivedInvocations: [String] {
get { rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations } }
set { rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations = newValue } }
}
private let rehydrateDehydratedDevicePickleKeyReturnValueLock = NSLock()
open var rehydrateDehydratedDevicePickleKeyUnderlyingReturnValue: Bool!
open var rehydrateDehydratedDevicePickleKeyReturnValue: Bool! {
get { rehydrateDehydratedDevicePickleKeyReturnValueLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReturnValue } }
set { rehydrateDehydratedDevicePickleKeyReturnValueLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReturnValue = newValue } }
}
open var rehydrateDehydratedDevicePickleKeyClosure: ((String) async throws -> Bool)?
open override func rehydrateDehydratedDevice(pickleKey: String) async throws -> Bool {
if let error = rehydrateDehydratedDevicePickleKeyThrowableError {
throw error
}
rehydrateDehydratedDevicePickleKeyCallsCountLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingCallsCount += 1 }
rehydrateDehydratedDevicePickleKeyReceivedPickleKey = pickleKey
rehydrateDehydratedDevicePickleKeyReceivedInvocationsLock.withLock { rehydrateDehydratedDevicePickleKeyUnderlyingReceivedInvocations.append(pickleKey) }
if let rehydrateDehydratedDevicePickleKeyClosure = rehydrateDehydratedDevicePickleKeyClosure {
return try await rehydrateDehydratedDevicePickleKeyClosure(pickleKey)
} else {
return rehydrateDehydratedDevicePickleKeyReturnValue
}
}
//MARK: - resetIdentity
open var resetIdentityThrowableError: Error?
private let resetIdentityCallsCountLock = NSLock()
private var resetIdentityUnderlyingCallsCount = 0
open var resetIdentityCallsCount: Int {
get { resetIdentityCallsCountLock.withLock { resetIdentityUnderlyingCallsCount } }
set { resetIdentityCallsCountLock.withLock { resetIdentityUnderlyingCallsCount = newValue } }
}
open var resetIdentityCalled: Bool {
return resetIdentityCallsCount > 0
}
private let resetIdentityReturnValueLock = NSLock()
open var resetIdentityUnderlyingReturnValue: IdentityResetHandle?
open var resetIdentityReturnValue: IdentityResetHandle? {
get { resetIdentityReturnValueLock.withLock { resetIdentityUnderlyingReturnValue } }
set { resetIdentityReturnValueLock.withLock { resetIdentityUnderlyingReturnValue = newValue } }
}
open var resetIdentityClosure: (() async throws -> IdentityResetHandle?)?
open override func resetIdentity() async throws -> IdentityResetHandle? {
if let error = resetIdentityThrowableError {
throw error
}
resetIdentityCallsCountLock.withLock { resetIdentityUnderlyingCallsCount += 1 }
if let resetIdentityClosure = resetIdentityClosure {
return try await resetIdentityClosure()
} else {
return resetIdentityReturnValue
}
}
//MARK: - resetRecoveryKey
open var resetRecoveryKeyThrowableError: Error?
private let resetRecoveryKeyCallsCountLock = NSLock()
private var resetRecoveryKeyUnderlyingCallsCount = 0
open var resetRecoveryKeyCallsCount: Int {
get { resetRecoveryKeyCallsCountLock.withLock { resetRecoveryKeyUnderlyingCallsCount } }
set { resetRecoveryKeyCallsCountLock.withLock { resetRecoveryKeyUnderlyingCallsCount = newValue } }
}
open var resetRecoveryKeyCalled: Bool {
return resetRecoveryKeyCallsCount > 0
}
private let resetRecoveryKeyReturnValueLock = NSLock()
open var resetRecoveryKeyUnderlyingReturnValue: String!
open var resetRecoveryKeyReturnValue: String! {
get { resetRecoveryKeyReturnValueLock.withLock { resetRecoveryKeyUnderlyingReturnValue } }
set { resetRecoveryKeyReturnValueLock.withLock { resetRecoveryKeyUnderlyingReturnValue = newValue } }
}
open var resetRecoveryKeyClosure: (() async throws -> String)?
open override func resetRecoveryKey() async throws -> String {
if let error = resetRecoveryKeyThrowableError {
throw error
}
resetRecoveryKeyCallsCountLock.withLock { resetRecoveryKeyUnderlyingCallsCount += 1 }
if let resetRecoveryKeyClosure = resetRecoveryKeyClosure {
return try await resetRecoveryKeyClosure()
} else {
return resetRecoveryKeyReturnValue
}
}
//MARK: - startDehydratedDevices
open var startDehydratedDevicesRecoveryKeySettingsThrowableError: Error?
private let startDehydratedDevicesRecoveryKeySettingsCallsCountLock = NSLock()
private var startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount = 0
open var startDehydratedDevicesRecoveryKeySettingsCallsCount: Int {
get { startDehydratedDevicesRecoveryKeySettingsCallsCountLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount } }
set { startDehydratedDevicesRecoveryKeySettingsCallsCountLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount = newValue } }
}
open var startDehydratedDevicesRecoveryKeySettingsCalled: Bool {
return startDehydratedDevicesRecoveryKeySettingsCallsCount > 0
}
private let startDehydratedDevicesRecoveryKeySettingsReceivedArgumentsLock = NSLock()
private var startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedArguments: (recoveryKey: String, settings: StartDehydratedDevicesSettings)?
open var startDehydratedDevicesRecoveryKeySettingsReceivedArguments: (recoveryKey: String, settings: StartDehydratedDevicesSettings)? {
get { startDehydratedDevicesRecoveryKeySettingsReceivedArgumentsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedArguments } }
set { startDehydratedDevicesRecoveryKeySettingsReceivedArgumentsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedArguments = newValue } }
}
private let startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock = NSLock()
private var startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations: [(recoveryKey: String, settings: StartDehydratedDevicesSettings)] = []
open var startDehydratedDevicesRecoveryKeySettingsReceivedInvocations: [(recoveryKey: String, settings: StartDehydratedDevicesSettings)] {
get { startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations } }
set { startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations = newValue } }
}
open var startDehydratedDevicesRecoveryKeySettingsClosure: ((String, StartDehydratedDevicesSettings) async throws -> Void)?
open override func startDehydratedDevices(recoveryKey: String, settings: StartDehydratedDevicesSettings) async throws {
if let error = startDehydratedDevicesRecoveryKeySettingsThrowableError {
throw error
}
startDehydratedDevicesRecoveryKeySettingsCallsCountLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingCallsCount += 1 }
startDehydratedDevicesRecoveryKeySettingsReceivedArguments = (recoveryKey: recoveryKey, settings: settings)
startDehydratedDevicesRecoveryKeySettingsReceivedInvocationsLock.withLock { startDehydratedDevicesRecoveryKeySettingsUnderlyingReceivedInvocations.append((recoveryKey: recoveryKey, settings: settings)) }
try await startDehydratedDevicesRecoveryKeySettingsClosure?(recoveryKey, settings)
}
//MARK: - stopDehydratedDevices
private let stopDehydratedDevicesCallsCountLock = NSLock()
private var stopDehydratedDevicesUnderlyingCallsCount = 0
open var stopDehydratedDevicesCallsCount: Int {
get { stopDehydratedDevicesCallsCountLock.withLock { stopDehydratedDevicesUnderlyingCallsCount } }
set { stopDehydratedDevicesCallsCountLock.withLock { stopDehydratedDevicesUnderlyingCallsCount = newValue } }
}
open var stopDehydratedDevicesCalled: Bool {
return stopDehydratedDevicesCallsCount > 0
}
open var stopDehydratedDevicesClosure: (() -> Void)?
open override func stopDehydratedDevices() {
stopDehydratedDevicesCallsCountLock.withLock { stopDehydratedDevicesUnderlyingCallsCount += 1 }
stopDehydratedDevicesClosure?()
}
//MARK: - userIdentity
open var userIdentityUserIdFallbackToServerThrowableError: Error?
private let userIdentityUserIdFallbackToServerCallsCountLock = NSLock()
private var userIdentityUserIdFallbackToServerUnderlyingCallsCount = 0
open var userIdentityUserIdFallbackToServerCallsCount: Int {
get { userIdentityUserIdFallbackToServerCallsCountLock.withLock { userIdentityUserIdFallbackToServerUnderlyingCallsCount } }
set { userIdentityUserIdFallbackToServerCallsCountLock.withLock { userIdentityUserIdFallbackToServerUnderlyingCallsCount = newValue } }
}
open var userIdentityUserIdFallbackToServerCalled: Bool {
return userIdentityUserIdFallbackToServerCallsCount > 0
}
private let userIdentityUserIdFallbackToServerReceivedArgumentsLock = NSLock()
private var userIdentityUserIdFallbackToServerUnderlyingReceivedArguments: (userId: String, fallbackToServer: Bool)?
open var userIdentityUserIdFallbackToServerReceivedArguments: (userId: String, fallbackToServer: Bool)? {
get { userIdentityUserIdFallbackToServerReceivedArgumentsLock.withLock { userIdentityUserIdFallbackToServerUnderlyingReceivedArguments } }
set { userIdentityUserIdFallbackToServerReceivedArgumentsLock.withLock { userIdentityUserIdFallbackToServerUnderlyingReceivedArguments = newValue } }
}
private let userIdentityUserIdFallbackToServerReceivedInvocationsLock = NSLock()
private var userIdentityUserIdFallbackToServerUnderlyingReceivedInvocations: [(userId: String, fallbackToServer: Bool)] = []
open var userIdentityUserIdFallbackToServerReceivedInvocations: [(userId: String, fallbackToServer: Bool)] {
get { userIdentityUserIdFallbackToServerReceivedInvocationsLock.withLock { userIdentityUserIdFallbackToServerUnderlyingReceivedInvocations } }
set { userIdentityUserIdFallbackToServerReceivedInvocationsLock.withLock { userIdentityUserIdFallbackToServerUnderlyingReceivedInvocations = newValue } }
}
private let userIdentityUserIdFallbackToServerReturnValueLock = NSLock()
open var userIdentityUserIdFallbackToServerUnderlyingReturnValue: UserIdentity?
open var userIdentityUserIdFallbackToServerReturnValue: UserIdentity? {
get { userIdentityUserIdFallbackToServerReturnValueLock.withLock { userIdentityUserIdFallbackToServerUnderlyingReturnValue } }
set { userIdentityUserIdFallbackToServerReturnValueLock.withLock { userIdentityUserIdFallbackToServerUnderlyingReturnValue = newValue } }
}
open var userIdentityUserIdFallbackToServerClosure: ((String, Bool) async throws -> UserIdentity?)?
open override func userIdentity(userId: String, fallbackToServer: Bool) async throws -> UserIdentity? {
if let error = userIdentityUserIdFallbackToServerThrowableError {
throw error
}
userIdentityUserIdFallbackToServerCallsCountLock.withLock { userIdentityUserIdFallbackToServerUnderlyingCallsCount += 1 }
userIdentityUserIdFallbackToServerReceivedArguments = (userId: userId, fallbackToServer: fallbackToServer)
userIdentityUserIdFallbackToServerReceivedInvocationsLock.withLock { userIdentityUserIdFallbackToServerUnderlyingReceivedInvocations.append((userId: userId, fallbackToServer: fallbackToServer)) }
if let userIdentityUserIdFallbackToServerClosure = userIdentityUserIdFallbackToServerClosure {
return try await userIdentityUserIdFallbackToServerClosure(userId, fallbackToServer)
} else {
return userIdentityUserIdFallbackToServerReturnValue
}
}
//MARK: - verificationState
private let verificationStateCallsCountLock = NSLock()
private var verificationStateUnderlyingCallsCount = 0
open var verificationStateCallsCount: Int {
get { verificationStateCallsCountLock.withLock { verificationStateUnderlyingCallsCount } }
set { verificationStateCallsCountLock.withLock { verificationStateUnderlyingCallsCount = newValue } }
}
open var verificationStateCalled: Bool {
return verificationStateCallsCount > 0
}
private let verificationStateReturnValueLock = NSLock()
open var verificationStateUnderlyingReturnValue: VerificationState!
open var verificationStateReturnValue: VerificationState! {
get { verificationStateReturnValueLock.withLock { verificationStateUnderlyingReturnValue } }
set { verificationStateReturnValueLock.withLock { verificationStateUnderlyingReturnValue = newValue } }
}
open var verificationStateClosure: (() -> VerificationState)?
open override func verificationState() -> VerificationState {
verificationStateCallsCountLock.withLock { verificationStateUnderlyingCallsCount += 1 }
if let verificationStateClosure = verificationStateClosure {
return verificationStateClosure()
} else {
return verificationStateReturnValue
}
}
//MARK: - verificationStateListener
private let verificationStateListenerListenerCallsCountLock = NSLock()
private var verificationStateListenerListenerUnderlyingCallsCount = 0
open var verificationStateListenerListenerCallsCount: Int {
get { verificationStateListenerListenerCallsCountLock.withLock { verificationStateListenerListenerUnderlyingCallsCount } }
set { verificationStateListenerListenerCallsCountLock.withLock { verificationStateListenerListenerUnderlyingCallsCount = newValue } }
}
open var verificationStateListenerListenerCalled: Bool {
return verificationStateListenerListenerCallsCount > 0
}
private let verificationStateListenerListenerReceivedListenerLock = NSLock()
private var verificationStateListenerListenerUnderlyingReceivedListener: VerificationStateListener?
open var verificationStateListenerListenerReceivedListener: VerificationStateListener? {
get { verificationStateListenerListenerReceivedListenerLock.withLock { verificationStateListenerListenerUnderlyingReceivedListener } }
set { verificationStateListenerListenerReceivedListenerLock.withLock { verificationStateListenerListenerUnderlyingReceivedListener = newValue } }
}
private let verificationStateListenerListenerReceivedInvocationsLock = NSLock()
private var verificationStateListenerListenerUnderlyingReceivedInvocations: [VerificationStateListener] = []
open var verificationStateListenerListenerReceivedInvocations: [VerificationStateListener] {
get { verificationStateListenerListenerReceivedInvocationsLock.withLock { verificationStateListenerListenerUnderlyingReceivedInvocations } }
set { verificationStateListenerListenerReceivedInvocationsLock.withLock { verificationStateListenerListenerUnderlyingReceivedInvocations = newValue } }
}
private let verificationStateListenerListenerReturnValueLock = NSLock()
open var verificationStateListenerListenerUnderlyingReturnValue: TaskHandle!
open var verificationStateListenerListenerReturnValue: TaskHandle! {
get { verificationStateListenerListenerReturnValueLock.withLock { verificationStateListenerListenerUnderlyingReturnValue } }
set { verificationStateListenerListenerReturnValueLock.withLock { verificationStateListenerListenerUnderlyingReturnValue = newValue } }
}
open var verificationStateListenerListenerClosure: ((VerificationStateListener) -> TaskHandle)?
open override func verificationStateListener(listener: VerificationStateListener) -> TaskHandle {
verificationStateListenerListenerCallsCountLock.withLock { verificationStateListenerListenerUnderlyingCallsCount += 1 }
verificationStateListenerListenerReceivedListener = listener
verificationStateListenerListenerReceivedInvocationsLock.withLock { verificationStateListenerListenerUnderlyingReceivedInvocations.append(listener) }
if let verificationStateListenerListenerClosure = verificationStateListenerListenerClosure {
return verificationStateListenerListenerClosure(listener)
} else {
return verificationStateListenerListenerReturnValue
}
}
//MARK: - waitForBackupUploadSteadyState
open var waitForBackupUploadSteadyStateProgressListenerThrowableError: Error?
private let waitForBackupUploadSteadyStateProgressListenerCallsCountLock = NSLock()
private var waitForBackupUploadSteadyStateProgressListenerUnderlyingCallsCount = 0
open var waitForBackupUploadSteadyStateProgressListenerCallsCount: Int {
get { waitForBackupUploadSteadyStateProgressListenerCallsCountLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingCallsCount } }
set { waitForBackupUploadSteadyStateProgressListenerCallsCountLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingCallsCount = newValue } }
}
open var waitForBackupUploadSteadyStateProgressListenerCalled: Bool {
return waitForBackupUploadSteadyStateProgressListenerCallsCount > 0
}
private let waitForBackupUploadSteadyStateProgressListenerReceivedProgressListenerLock = NSLock()
private var waitForBackupUploadSteadyStateProgressListenerUnderlyingReceivedProgressListener: BackupSteadyStateListener?
open var waitForBackupUploadSteadyStateProgressListenerReceivedProgressListener: BackupSteadyStateListener? {
get { waitForBackupUploadSteadyStateProgressListenerReceivedProgressListenerLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingReceivedProgressListener } }
set { waitForBackupUploadSteadyStateProgressListenerReceivedProgressListenerLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingReceivedProgressListener = newValue } }
}
private let waitForBackupUploadSteadyStateProgressListenerReceivedInvocationsLock = NSLock()
private var waitForBackupUploadSteadyStateProgressListenerUnderlyingReceivedInvocations: [BackupSteadyStateListener?] = []
open var waitForBackupUploadSteadyStateProgressListenerReceivedInvocations: [BackupSteadyStateListener?] {
get { waitForBackupUploadSteadyStateProgressListenerReceivedInvocationsLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingReceivedInvocations } }
set { waitForBackupUploadSteadyStateProgressListenerReceivedInvocationsLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingReceivedInvocations = newValue } }
}
open var waitForBackupUploadSteadyStateProgressListenerClosure: ((BackupSteadyStateListener?) async throws -> Void)?
open override func waitForBackupUploadSteadyState(progressListener: BackupSteadyStateListener?) async throws {
if let error = waitForBackupUploadSteadyStateProgressListenerThrowableError {
throw error
}
waitForBackupUploadSteadyStateProgressListenerCallsCountLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingCallsCount += 1 }
waitForBackupUploadSteadyStateProgressListenerReceivedProgressListener = progressListener
waitForBackupUploadSteadyStateProgressListenerReceivedInvocationsLock.withLock { waitForBackupUploadSteadyStateProgressListenerUnderlyingReceivedInvocations.append(progressListener) }
try await waitForBackupUploadSteadyStateProgressListenerClosure?(progressListener)
}
//MARK: - waitForE2eeInitializationTasks
private let waitForE2eeInitializationTasksCallsCountLock = NSLock()
private var waitForE2eeInitializationTasksUnderlyingCallsCount = 0
open var waitForE2eeInitializationTasksCallsCount: Int {
get { waitForE2eeInitializationTasksCallsCountLock.withLock { waitForE2eeInitializationTasksUnderlyingCallsCount } }
set { waitForE2eeInitializationTasksCallsCountLock.withLock { waitForE2eeInitializationTasksUnderlyingCallsCount = newValue } }
}
open var waitForE2eeInitializationTasksCalled: Bool {
return waitForE2eeInitializationTasksCallsCount > 0
}
open var waitForE2eeInitializationTasksClosure: (() async -> Void)?
open override func waitForE2eeInitializationTasks() async {
waitForE2eeInitializationTasksCallsCountLock.withLock { waitForE2eeInitializationTasksUnderlyingCallsCount += 1 }
await waitForE2eeInitializationTasksClosure?()
}
}
open class GrantLoginWithQrCodeHandlerSDKMock: MatrixRustSDK.GrantLoginWithQrCodeHandler, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - generate
open var generateProgressListenerThrowableError: Error?
private let generateProgressListenerCallsCountLock = NSLock()
private var generateProgressListenerUnderlyingCallsCount = 0
open var generateProgressListenerCallsCount: Int {
get { generateProgressListenerCallsCountLock.withLock { generateProgressListenerUnderlyingCallsCount } }
set { generateProgressListenerCallsCountLock.withLock { generateProgressListenerUnderlyingCallsCount = newValue } }
}
open var generateProgressListenerCalled: Bool {
return generateProgressListenerCallsCount > 0
}
private let generateProgressListenerReceivedProgressListenerLock = NSLock()
private var generateProgressListenerUnderlyingReceivedProgressListener: GrantGeneratedQrLoginProgressListener?
open var generateProgressListenerReceivedProgressListener: GrantGeneratedQrLoginProgressListener? {
get { generateProgressListenerReceivedProgressListenerLock.withLock { generateProgressListenerUnderlyingReceivedProgressListener } }
set { generateProgressListenerReceivedProgressListenerLock.withLock { generateProgressListenerUnderlyingReceivedProgressListener = newValue } }
}
private let generateProgressListenerReceivedInvocationsLock = NSLock()
private var generateProgressListenerUnderlyingReceivedInvocations: [GrantGeneratedQrLoginProgressListener] = []
open var generateProgressListenerReceivedInvocations: [GrantGeneratedQrLoginProgressListener] {
get { generateProgressListenerReceivedInvocationsLock.withLock { generateProgressListenerUnderlyingReceivedInvocations } }
set { generateProgressListenerReceivedInvocationsLock.withLock { generateProgressListenerUnderlyingReceivedInvocations = newValue } }
}
open var generateProgressListenerClosure: ((GrantGeneratedQrLoginProgressListener) async throws -> Void)?
open override func generate(progressListener: GrantGeneratedQrLoginProgressListener) async throws {
if let error = generateProgressListenerThrowableError {
throw error
}
generateProgressListenerCallsCountLock.withLock { generateProgressListenerUnderlyingCallsCount += 1 }
generateProgressListenerReceivedProgressListener = progressListener
generateProgressListenerReceivedInvocationsLock.withLock { generateProgressListenerUnderlyingReceivedInvocations.append(progressListener) }
try await generateProgressListenerClosure?(progressListener)
}
//MARK: - scan
open var scanQrCodeDataProgressListenerThrowableError: Error?
private let scanQrCodeDataProgressListenerCallsCountLock = NSLock()
private var scanQrCodeDataProgressListenerUnderlyingCallsCount = 0
open var scanQrCodeDataProgressListenerCallsCount: Int {
get { scanQrCodeDataProgressListenerCallsCountLock.withLock { scanQrCodeDataProgressListenerUnderlyingCallsCount } }
set { scanQrCodeDataProgressListenerCallsCountLock.withLock { scanQrCodeDataProgressListenerUnderlyingCallsCount = newValue } }
}
open var scanQrCodeDataProgressListenerCalled: Bool {
return scanQrCodeDataProgressListenerCallsCount > 0
}
private let scanQrCodeDataProgressListenerReceivedArgumentsLock = NSLock()
private var scanQrCodeDataProgressListenerUnderlyingReceivedArguments: (qrCodeData: QrCodeData, progressListener: GrantQrLoginProgressListener)?
open var scanQrCodeDataProgressListenerReceivedArguments: (qrCodeData: QrCodeData, progressListener: GrantQrLoginProgressListener)? {
get { scanQrCodeDataProgressListenerReceivedArgumentsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedArguments } }
set { scanQrCodeDataProgressListenerReceivedArgumentsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedArguments = newValue } }
}
private let scanQrCodeDataProgressListenerReceivedInvocationsLock = NSLock()
private var scanQrCodeDataProgressListenerUnderlyingReceivedInvocations: [(qrCodeData: QrCodeData, progressListener: GrantQrLoginProgressListener)] = []
open var scanQrCodeDataProgressListenerReceivedInvocations: [(qrCodeData: QrCodeData, progressListener: GrantQrLoginProgressListener)] {
get { scanQrCodeDataProgressListenerReceivedInvocationsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedInvocations } }
set { scanQrCodeDataProgressListenerReceivedInvocationsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedInvocations = newValue } }
}
open var scanQrCodeDataProgressListenerClosure: ((QrCodeData, GrantQrLoginProgressListener) async throws -> Void)?
open override func scan(qrCodeData: QrCodeData, progressListener: GrantQrLoginProgressListener) async throws {
if let error = scanQrCodeDataProgressListenerThrowableError {
throw error
}
scanQrCodeDataProgressListenerCallsCountLock.withLock { scanQrCodeDataProgressListenerUnderlyingCallsCount += 1 }
scanQrCodeDataProgressListenerReceivedArguments = (qrCodeData: qrCodeData, progressListener: progressListener)
scanQrCodeDataProgressListenerReceivedInvocationsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedInvocations.append((qrCodeData: qrCodeData, progressListener: progressListener)) }
try await scanQrCodeDataProgressListenerClosure?(qrCodeData, progressListener)
}
}
open class HomeserverCapabilitiesSDKMock: MatrixRustSDK.HomeserverCapabilities, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - canChangeAvatar
open var canChangeAvatarThrowableError: Error?
private let canChangeAvatarCallsCountLock = NSLock()
private var canChangeAvatarUnderlyingCallsCount = 0
open var canChangeAvatarCallsCount: Int {
get { canChangeAvatarCallsCountLock.withLock { canChangeAvatarUnderlyingCallsCount } }
set { canChangeAvatarCallsCountLock.withLock { canChangeAvatarUnderlyingCallsCount = newValue } }
}
open var canChangeAvatarCalled: Bool {
return canChangeAvatarCallsCount > 0
}
private let canChangeAvatarReturnValueLock = NSLock()
open var canChangeAvatarUnderlyingReturnValue: Bool!
open var canChangeAvatarReturnValue: Bool! {
get { canChangeAvatarReturnValueLock.withLock { canChangeAvatarUnderlyingReturnValue } }
set { canChangeAvatarReturnValueLock.withLock { canChangeAvatarUnderlyingReturnValue = newValue } }
}
open var canChangeAvatarClosure: (() async throws -> Bool)?
open override func canChangeAvatar() async throws -> Bool {
if let error = canChangeAvatarThrowableError {
throw error
}
canChangeAvatarCallsCountLock.withLock { canChangeAvatarUnderlyingCallsCount += 1 }
if let canChangeAvatarClosure = canChangeAvatarClosure {
return try await canChangeAvatarClosure()
} else {
return canChangeAvatarReturnValue
}
}
//MARK: - canChangeDisplayname
open var canChangeDisplaynameThrowableError: Error?
private let canChangeDisplaynameCallsCountLock = NSLock()
private var canChangeDisplaynameUnderlyingCallsCount = 0
open var canChangeDisplaynameCallsCount: Int {
get { canChangeDisplaynameCallsCountLock.withLock { canChangeDisplaynameUnderlyingCallsCount } }
set { canChangeDisplaynameCallsCountLock.withLock { canChangeDisplaynameUnderlyingCallsCount = newValue } }
}
open var canChangeDisplaynameCalled: Bool {
return canChangeDisplaynameCallsCount > 0
}
private let canChangeDisplaynameReturnValueLock = NSLock()
open var canChangeDisplaynameUnderlyingReturnValue: Bool!
open var canChangeDisplaynameReturnValue: Bool! {
get { canChangeDisplaynameReturnValueLock.withLock { canChangeDisplaynameUnderlyingReturnValue } }
set { canChangeDisplaynameReturnValueLock.withLock { canChangeDisplaynameUnderlyingReturnValue = newValue } }
}
open var canChangeDisplaynameClosure: (() async throws -> Bool)?
open override func canChangeDisplayname() async throws -> Bool {
if let error = canChangeDisplaynameThrowableError {
throw error
}
canChangeDisplaynameCallsCountLock.withLock { canChangeDisplaynameUnderlyingCallsCount += 1 }
if let canChangeDisplaynameClosure = canChangeDisplaynameClosure {
return try await canChangeDisplaynameClosure()
} else {
return canChangeDisplaynameReturnValue
}
}
//MARK: - canChangePassword
open var canChangePasswordThrowableError: Error?
private let canChangePasswordCallsCountLock = NSLock()
private var canChangePasswordUnderlyingCallsCount = 0
open var canChangePasswordCallsCount: Int {
get { canChangePasswordCallsCountLock.withLock { canChangePasswordUnderlyingCallsCount } }
set { canChangePasswordCallsCountLock.withLock { canChangePasswordUnderlyingCallsCount = newValue } }
}
open var canChangePasswordCalled: Bool {
return canChangePasswordCallsCount > 0
}
private let canChangePasswordReturnValueLock = NSLock()
open var canChangePasswordUnderlyingReturnValue: Bool!
open var canChangePasswordReturnValue: Bool! {
get { canChangePasswordReturnValueLock.withLock { canChangePasswordUnderlyingReturnValue } }
set { canChangePasswordReturnValueLock.withLock { canChangePasswordUnderlyingReturnValue = newValue } }
}
open var canChangePasswordClosure: (() async throws -> Bool)?
open override func canChangePassword() async throws -> Bool {
if let error = canChangePasswordThrowableError {
throw error
}
canChangePasswordCallsCountLock.withLock { canChangePasswordUnderlyingCallsCount += 1 }
if let canChangePasswordClosure = canChangePasswordClosure {
return try await canChangePasswordClosure()
} else {
return canChangePasswordReturnValue
}
}
//MARK: - canChangeThirdpartyIds
open var canChangeThirdpartyIdsThrowableError: Error?
private let canChangeThirdpartyIdsCallsCountLock = NSLock()
private var canChangeThirdpartyIdsUnderlyingCallsCount = 0
open var canChangeThirdpartyIdsCallsCount: Int {
get { canChangeThirdpartyIdsCallsCountLock.withLock { canChangeThirdpartyIdsUnderlyingCallsCount } }
set { canChangeThirdpartyIdsCallsCountLock.withLock { canChangeThirdpartyIdsUnderlyingCallsCount = newValue } }
}
open var canChangeThirdpartyIdsCalled: Bool {
return canChangeThirdpartyIdsCallsCount > 0
}
private let canChangeThirdpartyIdsReturnValueLock = NSLock()
open var canChangeThirdpartyIdsUnderlyingReturnValue: Bool!
open var canChangeThirdpartyIdsReturnValue: Bool! {
get { canChangeThirdpartyIdsReturnValueLock.withLock { canChangeThirdpartyIdsUnderlyingReturnValue } }
set { canChangeThirdpartyIdsReturnValueLock.withLock { canChangeThirdpartyIdsUnderlyingReturnValue = newValue } }
}
open var canChangeThirdpartyIdsClosure: (() async throws -> Bool)?
open override func canChangeThirdpartyIds() async throws -> Bool {
if let error = canChangeThirdpartyIdsThrowableError {
throw error
}
canChangeThirdpartyIdsCallsCountLock.withLock { canChangeThirdpartyIdsUnderlyingCallsCount += 1 }
if let canChangeThirdpartyIdsClosure = canChangeThirdpartyIdsClosure {
return try await canChangeThirdpartyIdsClosure()
} else {
return canChangeThirdpartyIdsReturnValue
}
}
//MARK: - canGetLoginToken
open var canGetLoginTokenThrowableError: Error?
private let canGetLoginTokenCallsCountLock = NSLock()
private var canGetLoginTokenUnderlyingCallsCount = 0
open var canGetLoginTokenCallsCount: Int {
get { canGetLoginTokenCallsCountLock.withLock { canGetLoginTokenUnderlyingCallsCount } }
set { canGetLoginTokenCallsCountLock.withLock { canGetLoginTokenUnderlyingCallsCount = newValue } }
}
open var canGetLoginTokenCalled: Bool {
return canGetLoginTokenCallsCount > 0
}
private let canGetLoginTokenReturnValueLock = NSLock()
open var canGetLoginTokenUnderlyingReturnValue: Bool!
open var canGetLoginTokenReturnValue: Bool! {
get { canGetLoginTokenReturnValueLock.withLock { canGetLoginTokenUnderlyingReturnValue } }
set { canGetLoginTokenReturnValueLock.withLock { canGetLoginTokenUnderlyingReturnValue = newValue } }
}
open var canGetLoginTokenClosure: (() async throws -> Bool)?
open override func canGetLoginToken() async throws -> Bool {
if let error = canGetLoginTokenThrowableError {
throw error
}
canGetLoginTokenCallsCountLock.withLock { canGetLoginTokenUnderlyingCallsCount += 1 }
if let canGetLoginTokenClosure = canGetLoginTokenClosure {
return try await canGetLoginTokenClosure()
} else {
return canGetLoginTokenReturnValue
}
}
//MARK: - extendedProfileFields
open var extendedProfileFieldsThrowableError: Error?
private let extendedProfileFieldsCallsCountLock = NSLock()
private var extendedProfileFieldsUnderlyingCallsCount = 0
open var extendedProfileFieldsCallsCount: Int {
get { extendedProfileFieldsCallsCountLock.withLock { extendedProfileFieldsUnderlyingCallsCount } }
set { extendedProfileFieldsCallsCountLock.withLock { extendedProfileFieldsUnderlyingCallsCount = newValue } }
}
open var extendedProfileFieldsCalled: Bool {
return extendedProfileFieldsCallsCount > 0
}
private let extendedProfileFieldsReturnValueLock = NSLock()
open var extendedProfileFieldsUnderlyingReturnValue: ExtendedProfileFields!
open var extendedProfileFieldsReturnValue: ExtendedProfileFields! {
get { extendedProfileFieldsReturnValueLock.withLock { extendedProfileFieldsUnderlyingReturnValue } }
set { extendedProfileFieldsReturnValueLock.withLock { extendedProfileFieldsUnderlyingReturnValue = newValue } }
}
open var extendedProfileFieldsClosure: (() async throws -> ExtendedProfileFields)?
open override func extendedProfileFields() async throws -> ExtendedProfileFields {
if let error = extendedProfileFieldsThrowableError {
throw error
}
extendedProfileFieldsCallsCountLock.withLock { extendedProfileFieldsUnderlyingCallsCount += 1 }
if let extendedProfileFieldsClosure = extendedProfileFieldsClosure {
return try await extendedProfileFieldsClosure()
} else {
return extendedProfileFieldsReturnValue
}
}
//MARK: - forgetsRoomWhenLeaving
open var forgetsRoomWhenLeavingThrowableError: Error?
private let forgetsRoomWhenLeavingCallsCountLock = NSLock()
private var forgetsRoomWhenLeavingUnderlyingCallsCount = 0
open var forgetsRoomWhenLeavingCallsCount: Int {
get { forgetsRoomWhenLeavingCallsCountLock.withLock { forgetsRoomWhenLeavingUnderlyingCallsCount } }
set { forgetsRoomWhenLeavingCallsCountLock.withLock { forgetsRoomWhenLeavingUnderlyingCallsCount = newValue } }
}
open var forgetsRoomWhenLeavingCalled: Bool {
return forgetsRoomWhenLeavingCallsCount > 0
}
private let forgetsRoomWhenLeavingReturnValueLock = NSLock()
open var forgetsRoomWhenLeavingUnderlyingReturnValue: Bool!
open var forgetsRoomWhenLeavingReturnValue: Bool! {
get { forgetsRoomWhenLeavingReturnValueLock.withLock { forgetsRoomWhenLeavingUnderlyingReturnValue } }
set { forgetsRoomWhenLeavingReturnValueLock.withLock { forgetsRoomWhenLeavingUnderlyingReturnValue = newValue } }
}
open var forgetsRoomWhenLeavingClosure: (() async throws -> Bool)?
open override func forgetsRoomWhenLeaving() async throws -> Bool {
if let error = forgetsRoomWhenLeavingThrowableError {
throw error
}
forgetsRoomWhenLeavingCallsCountLock.withLock { forgetsRoomWhenLeavingUnderlyingCallsCount += 1 }
if let forgetsRoomWhenLeavingClosure = forgetsRoomWhenLeavingClosure {
return try await forgetsRoomWhenLeavingClosure()
} else {
return forgetsRoomWhenLeavingReturnValue
}
}
//MARK: - refresh
open var refreshThrowableError: Error?
private let refreshCallsCountLock = NSLock()
private var refreshUnderlyingCallsCount = 0
open var refreshCallsCount: Int {
get { refreshCallsCountLock.withLock { refreshUnderlyingCallsCount } }
set { refreshCallsCountLock.withLock { refreshUnderlyingCallsCount = newValue } }
}
open var refreshCalled: Bool {
return refreshCallsCount > 0
}
open var refreshClosure: (() async throws -> Void)?
open override func refresh() async throws {
if let error = refreshThrowableError {
throw error
}
refreshCallsCountLock.withLock { refreshUnderlyingCallsCount += 1 }
try await refreshClosure?()
}
}
open class HomeserverLoginDetailsSDKMock: MatrixRustSDK.HomeserverLoginDetails, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - slidingSyncVersion
private let slidingSyncVersionCallsCountLock = NSLock()
private var slidingSyncVersionUnderlyingCallsCount = 0
open var slidingSyncVersionCallsCount: Int {
get { slidingSyncVersionCallsCountLock.withLock { slidingSyncVersionUnderlyingCallsCount } }
set { slidingSyncVersionCallsCountLock.withLock { slidingSyncVersionUnderlyingCallsCount = newValue } }
}
open var slidingSyncVersionCalled: Bool {
return slidingSyncVersionCallsCount > 0
}
private let slidingSyncVersionReturnValueLock = NSLock()
open var slidingSyncVersionUnderlyingReturnValue: SlidingSyncVersion!
open var slidingSyncVersionReturnValue: SlidingSyncVersion! {
get { slidingSyncVersionReturnValueLock.withLock { slidingSyncVersionUnderlyingReturnValue } }
set { slidingSyncVersionReturnValueLock.withLock { slidingSyncVersionUnderlyingReturnValue = newValue } }
}
open var slidingSyncVersionClosure: (() -> SlidingSyncVersion)?
open override func slidingSyncVersion() -> SlidingSyncVersion {
slidingSyncVersionCallsCountLock.withLock { slidingSyncVersionUnderlyingCallsCount += 1 }
if let slidingSyncVersionClosure = slidingSyncVersionClosure {
return slidingSyncVersionClosure()
} else {
return slidingSyncVersionReturnValue
}
}
//MARK: - supportedOauthPrompts
private let supportedOauthPromptsCallsCountLock = NSLock()
private var supportedOauthPromptsUnderlyingCallsCount = 0
open var supportedOauthPromptsCallsCount: Int {
get { supportedOauthPromptsCallsCountLock.withLock { supportedOauthPromptsUnderlyingCallsCount } }
set { supportedOauthPromptsCallsCountLock.withLock { supportedOauthPromptsUnderlyingCallsCount = newValue } }
}
open var supportedOauthPromptsCalled: Bool {
return supportedOauthPromptsCallsCount > 0
}
private let supportedOauthPromptsReturnValueLock = NSLock()
open var supportedOauthPromptsUnderlyingReturnValue: [OAuthPrompt]!
open var supportedOauthPromptsReturnValue: [OAuthPrompt]! {
get { supportedOauthPromptsReturnValueLock.withLock { supportedOauthPromptsUnderlyingReturnValue } }
set { supportedOauthPromptsReturnValueLock.withLock { supportedOauthPromptsUnderlyingReturnValue = newValue } }
}
open var supportedOauthPromptsClosure: (() -> [OAuthPrompt])?
open override func supportedOauthPrompts() -> [OAuthPrompt] {
supportedOauthPromptsCallsCountLock.withLock { supportedOauthPromptsUnderlyingCallsCount += 1 }
if let supportedOauthPromptsClosure = supportedOauthPromptsClosure {
return supportedOauthPromptsClosure()
} else {
return supportedOauthPromptsReturnValue
}
}
//MARK: - supportsOauthLogin
private let supportsOauthLoginCallsCountLock = NSLock()
private var supportsOauthLoginUnderlyingCallsCount = 0
open var supportsOauthLoginCallsCount: Int {
get { supportsOauthLoginCallsCountLock.withLock { supportsOauthLoginUnderlyingCallsCount } }
set { supportsOauthLoginCallsCountLock.withLock { supportsOauthLoginUnderlyingCallsCount = newValue } }
}
open var supportsOauthLoginCalled: Bool {
return supportsOauthLoginCallsCount > 0
}
private let supportsOauthLoginReturnValueLock = NSLock()
open var supportsOauthLoginUnderlyingReturnValue: Bool!
open var supportsOauthLoginReturnValue: Bool! {
get { supportsOauthLoginReturnValueLock.withLock { supportsOauthLoginUnderlyingReturnValue } }
set { supportsOauthLoginReturnValueLock.withLock { supportsOauthLoginUnderlyingReturnValue = newValue } }
}
open var supportsOauthLoginClosure: (() -> Bool)?
open override func supportsOauthLogin() -> Bool {
supportsOauthLoginCallsCountLock.withLock { supportsOauthLoginUnderlyingCallsCount += 1 }
if let supportsOauthLoginClosure = supportsOauthLoginClosure {
return supportsOauthLoginClosure()
} else {
return supportsOauthLoginReturnValue
}
}
//MARK: - supportsPasswordLogin
private let supportsPasswordLoginCallsCountLock = NSLock()
private var supportsPasswordLoginUnderlyingCallsCount = 0
open var supportsPasswordLoginCallsCount: Int {
get { supportsPasswordLoginCallsCountLock.withLock { supportsPasswordLoginUnderlyingCallsCount } }
set { supportsPasswordLoginCallsCountLock.withLock { supportsPasswordLoginUnderlyingCallsCount = newValue } }
}
open var supportsPasswordLoginCalled: Bool {
return supportsPasswordLoginCallsCount > 0
}
private let supportsPasswordLoginReturnValueLock = NSLock()
open var supportsPasswordLoginUnderlyingReturnValue: Bool!
open var supportsPasswordLoginReturnValue: Bool! {
get { supportsPasswordLoginReturnValueLock.withLock { supportsPasswordLoginUnderlyingReturnValue } }
set { supportsPasswordLoginReturnValueLock.withLock { supportsPasswordLoginUnderlyingReturnValue = newValue } }
}
open var supportsPasswordLoginClosure: (() -> Bool)?
open override func supportsPasswordLogin() -> Bool {
supportsPasswordLoginCallsCountLock.withLock { supportsPasswordLoginUnderlyingCallsCount += 1 }
if let supportsPasswordLoginClosure = supportsPasswordLoginClosure {
return supportsPasswordLoginClosure()
} else {
return supportsPasswordLoginReturnValue
}
}
//MARK: - supportsSsoLogin
private let supportsSsoLoginCallsCountLock = NSLock()
private var supportsSsoLoginUnderlyingCallsCount = 0
open var supportsSsoLoginCallsCount: Int {
get { supportsSsoLoginCallsCountLock.withLock { supportsSsoLoginUnderlyingCallsCount } }
set { supportsSsoLoginCallsCountLock.withLock { supportsSsoLoginUnderlyingCallsCount = newValue } }
}
open var supportsSsoLoginCalled: Bool {
return supportsSsoLoginCallsCount > 0
}
private let supportsSsoLoginReturnValueLock = NSLock()
open var supportsSsoLoginUnderlyingReturnValue: Bool!
open var supportsSsoLoginReturnValue: Bool! {
get { supportsSsoLoginReturnValueLock.withLock { supportsSsoLoginUnderlyingReturnValue } }
set { supportsSsoLoginReturnValueLock.withLock { supportsSsoLoginUnderlyingReturnValue = newValue } }
}
open var supportsSsoLoginClosure: (() -> Bool)?
open override func supportsSsoLogin() -> Bool {
supportsSsoLoginCallsCountLock.withLock { supportsSsoLoginUnderlyingCallsCount += 1 }
if let supportsSsoLoginClosure = supportsSsoLoginClosure {
return supportsSsoLoginClosure()
} else {
return supportsSsoLoginReturnValue
}
}
//MARK: - url
private let urlCallsCountLock = NSLock()
private var urlUnderlyingCallsCount = 0
open var urlCallsCount: Int {
get { urlCallsCountLock.withLock { urlUnderlyingCallsCount } }
set { urlCallsCountLock.withLock { urlUnderlyingCallsCount = newValue } }
}
open var urlCalled: Bool {
return urlCallsCount > 0
}
private let urlReturnValueLock = NSLock()
open var urlUnderlyingReturnValue: String!
open var urlReturnValue: String! {
get { urlReturnValueLock.withLock { urlUnderlyingReturnValue } }
set { urlReturnValueLock.withLock { urlUnderlyingReturnValue = newValue } }
}
open var urlClosure: (() -> String)?
open override func url() -> String {
urlCallsCountLock.withLock { urlUnderlyingCallsCount += 1 }
if let urlClosure = urlClosure {
return urlClosure()
} else {
return urlReturnValue
}
}
}
open class IdentityResetHandleSDKMock: MatrixRustSDK.IdentityResetHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - authType
private let authTypeCallsCountLock = NSLock()
private var authTypeUnderlyingCallsCount = 0
open var authTypeCallsCount: Int {
get { authTypeCallsCountLock.withLock { authTypeUnderlyingCallsCount } }
set { authTypeCallsCountLock.withLock { authTypeUnderlyingCallsCount = newValue } }
}
open var authTypeCalled: Bool {
return authTypeCallsCount > 0
}
private let authTypeReturnValueLock = NSLock()
open var authTypeUnderlyingReturnValue: CrossSigningResetAuthType!
open var authTypeReturnValue: CrossSigningResetAuthType! {
get { authTypeReturnValueLock.withLock { authTypeUnderlyingReturnValue } }
set { authTypeReturnValueLock.withLock { authTypeUnderlyingReturnValue = newValue } }
}
open var authTypeClosure: (() -> CrossSigningResetAuthType)?
open override func authType() -> CrossSigningResetAuthType {
authTypeCallsCountLock.withLock { authTypeUnderlyingCallsCount += 1 }
if let authTypeClosure = authTypeClosure {
return authTypeClosure()
} else {
return authTypeReturnValue
}
}
//MARK: - cancel
private let cancelCallsCountLock = NSLock()
private var cancelUnderlyingCallsCount = 0
open var cancelCallsCount: Int {
get { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount } }
set { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount = newValue } }
}
open var cancelCalled: Bool {
return cancelCallsCount > 0
}
open var cancelClosure: (() async -> Void)?
open override func cancel() async {
cancelCallsCountLock.withLock { cancelUnderlyingCallsCount += 1 }
await cancelClosure?()
}
//MARK: - reset
open var resetAuthThrowableError: Error?
private let resetAuthCallsCountLock = NSLock()
private var resetAuthUnderlyingCallsCount = 0
open var resetAuthCallsCount: Int {
get { resetAuthCallsCountLock.withLock { resetAuthUnderlyingCallsCount } }
set { resetAuthCallsCountLock.withLock { resetAuthUnderlyingCallsCount = newValue } }
}
open var resetAuthCalled: Bool {
return resetAuthCallsCount > 0
}
private let resetAuthReceivedAuthLock = NSLock()
private var resetAuthUnderlyingReceivedAuth: AuthData?
open var resetAuthReceivedAuth: AuthData? {
get { resetAuthReceivedAuthLock.withLock { resetAuthUnderlyingReceivedAuth } }
set { resetAuthReceivedAuthLock.withLock { resetAuthUnderlyingReceivedAuth = newValue } }
}
private let resetAuthReceivedInvocationsLock = NSLock()
private var resetAuthUnderlyingReceivedInvocations: [AuthData?] = []
open var resetAuthReceivedInvocations: [AuthData?] {
get { resetAuthReceivedInvocationsLock.withLock { resetAuthUnderlyingReceivedInvocations } }
set { resetAuthReceivedInvocationsLock.withLock { resetAuthUnderlyingReceivedInvocations = newValue } }
}
open var resetAuthClosure: ((AuthData?) async throws -> Void)?
open override func reset(auth: AuthData?) async throws {
if let error = resetAuthThrowableError {
throw error
}
resetAuthCallsCountLock.withLock { resetAuthUnderlyingCallsCount += 1 }
resetAuthReceivedAuth = auth
resetAuthReceivedInvocationsLock.withLock { resetAuthUnderlyingReceivedInvocations.append(auth) }
try await resetAuthClosure?(auth)
}
}
open class InReplyToDetailsSDKMock: MatrixRustSDK.InReplyToDetails, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - event
private let eventCallsCountLock = NSLock()
private var eventUnderlyingCallsCount = 0
open var eventCallsCount: Int {
get { eventCallsCountLock.withLock { eventUnderlyingCallsCount } }
set { eventCallsCountLock.withLock { eventUnderlyingCallsCount = newValue } }
}
open var eventCalled: Bool {
return eventCallsCount > 0
}
private let eventReturnValueLock = NSLock()
open var eventUnderlyingReturnValue: EmbeddedEventDetails!
open var eventReturnValue: EmbeddedEventDetails! {
get { eventReturnValueLock.withLock { eventUnderlyingReturnValue } }
set { eventReturnValueLock.withLock { eventUnderlyingReturnValue = newValue } }
}
open var eventClosure: (() -> EmbeddedEventDetails)?
open override func event() -> EmbeddedEventDetails {
eventCallsCountLock.withLock { eventUnderlyingCallsCount += 1 }
if let eventClosure = eventClosure {
return eventClosure()
} else {
return eventReturnValue
}
}
//MARK: - eventId
private let eventIdCallsCountLock = NSLock()
private var eventIdUnderlyingCallsCount = 0
open var eventIdCallsCount: Int {
get { eventIdCallsCountLock.withLock { eventIdUnderlyingCallsCount } }
set { eventIdCallsCountLock.withLock { eventIdUnderlyingCallsCount = newValue } }
}
open var eventIdCalled: Bool {
return eventIdCallsCount > 0
}
private let eventIdReturnValueLock = NSLock()
open var eventIdUnderlyingReturnValue: String!
open var eventIdReturnValue: String! {
get { eventIdReturnValueLock.withLock { eventIdUnderlyingReturnValue } }
set { eventIdReturnValueLock.withLock { eventIdUnderlyingReturnValue = newValue } }
}
open var eventIdClosure: (() -> String)?
open override func eventId() -> String {
eventIdCallsCountLock.withLock { eventIdUnderlyingCallsCount += 1 }
if let eventIdClosure = eventIdClosure {
return eventIdClosure()
} else {
return eventIdReturnValue
}
}
}
open class KnockRequestActionsSDKMock: MatrixRustSDK.KnockRequestActions, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - accept
open var acceptThrowableError: Error?
private let acceptCallsCountLock = NSLock()
private var acceptUnderlyingCallsCount = 0
open var acceptCallsCount: Int {
get { acceptCallsCountLock.withLock { acceptUnderlyingCallsCount } }
set { acceptCallsCountLock.withLock { acceptUnderlyingCallsCount = newValue } }
}
open var acceptCalled: Bool {
return acceptCallsCount > 0
}
open var acceptClosure: (() async throws -> Void)?
open override func accept() async throws {
if let error = acceptThrowableError {
throw error
}
acceptCallsCountLock.withLock { acceptUnderlyingCallsCount += 1 }
try await acceptClosure?()
}
//MARK: - decline
open var declineReasonThrowableError: Error?
private let declineReasonCallsCountLock = NSLock()
private var declineReasonUnderlyingCallsCount = 0
open var declineReasonCallsCount: Int {
get { declineReasonCallsCountLock.withLock { declineReasonUnderlyingCallsCount } }
set { declineReasonCallsCountLock.withLock { declineReasonUnderlyingCallsCount = newValue } }
}
open var declineReasonCalled: Bool {
return declineReasonCallsCount > 0
}
private let declineReasonReceivedReasonLock = NSLock()
private var declineReasonUnderlyingReceivedReason: String?
open var declineReasonReceivedReason: String? {
get { declineReasonReceivedReasonLock.withLock { declineReasonUnderlyingReceivedReason } }
set { declineReasonReceivedReasonLock.withLock { declineReasonUnderlyingReceivedReason = newValue } }
}
private let declineReasonReceivedInvocationsLock = NSLock()
private var declineReasonUnderlyingReceivedInvocations: [String?] = []
open var declineReasonReceivedInvocations: [String?] {
get { declineReasonReceivedInvocationsLock.withLock { declineReasonUnderlyingReceivedInvocations } }
set { declineReasonReceivedInvocationsLock.withLock { declineReasonUnderlyingReceivedInvocations = newValue } }
}
open var declineReasonClosure: ((String?) async throws -> Void)?
open override func decline(reason: String?) async throws {
if let error = declineReasonThrowableError {
throw error
}
declineReasonCallsCountLock.withLock { declineReasonUnderlyingCallsCount += 1 }
declineReasonReceivedReason = reason
declineReasonReceivedInvocationsLock.withLock { declineReasonUnderlyingReceivedInvocations.append(reason) }
try await declineReasonClosure?(reason)
}
//MARK: - declineAndBan
open var declineAndBanReasonThrowableError: Error?
private let declineAndBanReasonCallsCountLock = NSLock()
private var declineAndBanReasonUnderlyingCallsCount = 0
open var declineAndBanReasonCallsCount: Int {
get { declineAndBanReasonCallsCountLock.withLock { declineAndBanReasonUnderlyingCallsCount } }
set { declineAndBanReasonCallsCountLock.withLock { declineAndBanReasonUnderlyingCallsCount = newValue } }
}
open var declineAndBanReasonCalled: Bool {
return declineAndBanReasonCallsCount > 0
}
private let declineAndBanReasonReceivedReasonLock = NSLock()
private var declineAndBanReasonUnderlyingReceivedReason: String?
open var declineAndBanReasonReceivedReason: String? {
get { declineAndBanReasonReceivedReasonLock.withLock { declineAndBanReasonUnderlyingReceivedReason } }
set { declineAndBanReasonReceivedReasonLock.withLock { declineAndBanReasonUnderlyingReceivedReason = newValue } }
}
private let declineAndBanReasonReceivedInvocationsLock = NSLock()
private var declineAndBanReasonUnderlyingReceivedInvocations: [String?] = []
open var declineAndBanReasonReceivedInvocations: [String?] {
get { declineAndBanReasonReceivedInvocationsLock.withLock { declineAndBanReasonUnderlyingReceivedInvocations } }
set { declineAndBanReasonReceivedInvocationsLock.withLock { declineAndBanReasonUnderlyingReceivedInvocations = newValue } }
}
open var declineAndBanReasonClosure: ((String?) async throws -> Void)?
open override func declineAndBan(reason: String?) async throws {
if let error = declineAndBanReasonThrowableError {
throw error
}
declineAndBanReasonCallsCountLock.withLock { declineAndBanReasonUnderlyingCallsCount += 1 }
declineAndBanReasonReceivedReason = reason
declineAndBanReasonReceivedInvocationsLock.withLock { declineAndBanReasonUnderlyingReceivedInvocations.append(reason) }
try await declineAndBanReasonClosure?(reason)
}
//MARK: - markAsSeen
open var markAsSeenThrowableError: Error?
private let markAsSeenCallsCountLock = NSLock()
private var markAsSeenUnderlyingCallsCount = 0
open var markAsSeenCallsCount: Int {
get { markAsSeenCallsCountLock.withLock { markAsSeenUnderlyingCallsCount } }
set { markAsSeenCallsCountLock.withLock { markAsSeenUnderlyingCallsCount = newValue } }
}
open var markAsSeenCalled: Bool {
return markAsSeenCallsCount > 0
}
open var markAsSeenClosure: (() async throws -> Void)?
open override func markAsSeen() async throws {
if let error = markAsSeenThrowableError {
throw error
}
markAsSeenCallsCountLock.withLock { markAsSeenUnderlyingCallsCount += 1 }
try await markAsSeenClosure?()
}
}
open class LazyTimelineItemProviderSDKMock: MatrixRustSDK.LazyTimelineItemProvider, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - containsOnlyEmojis
private let containsOnlyEmojisCallsCountLock = NSLock()
private var containsOnlyEmojisUnderlyingCallsCount = 0
open var containsOnlyEmojisCallsCount: Int {
get { containsOnlyEmojisCallsCountLock.withLock { containsOnlyEmojisUnderlyingCallsCount } }
set { containsOnlyEmojisCallsCountLock.withLock { containsOnlyEmojisUnderlyingCallsCount = newValue } }
}
open var containsOnlyEmojisCalled: Bool {
return containsOnlyEmojisCallsCount > 0
}
private let containsOnlyEmojisReturnValueLock = NSLock()
open var containsOnlyEmojisUnderlyingReturnValue: Bool!
open var containsOnlyEmojisReturnValue: Bool! {
get { containsOnlyEmojisReturnValueLock.withLock { containsOnlyEmojisUnderlyingReturnValue } }
set { containsOnlyEmojisReturnValueLock.withLock { containsOnlyEmojisUnderlyingReturnValue = newValue } }
}
open var containsOnlyEmojisClosure: (() -> Bool)?
open override func containsOnlyEmojis() -> Bool {
containsOnlyEmojisCallsCountLock.withLock { containsOnlyEmojisUnderlyingCallsCount += 1 }
if let containsOnlyEmojisClosure = containsOnlyEmojisClosure {
return containsOnlyEmojisClosure()
} else {
return containsOnlyEmojisReturnValue
}
}
//MARK: - debugInfo
private let debugInfoCallsCountLock = NSLock()
private var debugInfoUnderlyingCallsCount = 0
open var debugInfoCallsCount: Int {
get { debugInfoCallsCountLock.withLock { debugInfoUnderlyingCallsCount } }
set { debugInfoCallsCountLock.withLock { debugInfoUnderlyingCallsCount = newValue } }
}
open var debugInfoCalled: Bool {
return debugInfoCallsCount > 0
}
private let debugInfoReturnValueLock = NSLock()
open var debugInfoUnderlyingReturnValue: EventTimelineItemDebugInfo!
open var debugInfoReturnValue: EventTimelineItemDebugInfo! {
get { debugInfoReturnValueLock.withLock { debugInfoUnderlyingReturnValue } }
set { debugInfoReturnValueLock.withLock { debugInfoUnderlyingReturnValue = newValue } }
}
open var debugInfoClosure: (() -> EventTimelineItemDebugInfo)?
open override func debugInfo() -> EventTimelineItemDebugInfo {
debugInfoCallsCountLock.withLock { debugInfoUnderlyingCallsCount += 1 }
if let debugInfoClosure = debugInfoClosure {
return debugInfoClosure()
} else {
return debugInfoReturnValue
}
}
//MARK: - getSendHandle
private let getSendHandleCallsCountLock = NSLock()
private var getSendHandleUnderlyingCallsCount = 0
open var getSendHandleCallsCount: Int {
get { getSendHandleCallsCountLock.withLock { getSendHandleUnderlyingCallsCount } }
set { getSendHandleCallsCountLock.withLock { getSendHandleUnderlyingCallsCount = newValue } }
}
open var getSendHandleCalled: Bool {
return getSendHandleCallsCount > 0
}
private let getSendHandleReturnValueLock = NSLock()
open var getSendHandleUnderlyingReturnValue: SendHandle?
open var getSendHandleReturnValue: SendHandle? {
get { getSendHandleReturnValueLock.withLock { getSendHandleUnderlyingReturnValue } }
set { getSendHandleReturnValueLock.withLock { getSendHandleUnderlyingReturnValue = newValue } }
}
open var getSendHandleClosure: (() -> SendHandle?)?
open override func getSendHandle() -> SendHandle? {
getSendHandleCallsCountLock.withLock { getSendHandleUnderlyingCallsCount += 1 }
if let getSendHandleClosure = getSendHandleClosure {
return getSendHandleClosure()
} else {
return getSendHandleReturnValue
}
}
//MARK: - getShields
private let getShieldsStrictCallsCountLock = NSLock()
private var getShieldsStrictUnderlyingCallsCount = 0
open var getShieldsStrictCallsCount: Int {
get { getShieldsStrictCallsCountLock.withLock { getShieldsStrictUnderlyingCallsCount } }
set { getShieldsStrictCallsCountLock.withLock { getShieldsStrictUnderlyingCallsCount = newValue } }
}
open var getShieldsStrictCalled: Bool {
return getShieldsStrictCallsCount > 0
}
private let getShieldsStrictReceivedStrictLock = NSLock()
private var getShieldsStrictUnderlyingReceivedStrict: Bool?
open var getShieldsStrictReceivedStrict: Bool? {
get { getShieldsStrictReceivedStrictLock.withLock { getShieldsStrictUnderlyingReceivedStrict } }
set { getShieldsStrictReceivedStrictLock.withLock { getShieldsStrictUnderlyingReceivedStrict = newValue } }
}
private let getShieldsStrictReceivedInvocationsLock = NSLock()
private var getShieldsStrictUnderlyingReceivedInvocations: [Bool] = []
open var getShieldsStrictReceivedInvocations: [Bool] {
get { getShieldsStrictReceivedInvocationsLock.withLock { getShieldsStrictUnderlyingReceivedInvocations } }
set { getShieldsStrictReceivedInvocationsLock.withLock { getShieldsStrictUnderlyingReceivedInvocations = newValue } }
}
private let getShieldsStrictReturnValueLock = NSLock()
open var getShieldsStrictUnderlyingReturnValue: ShieldState!
open var getShieldsStrictReturnValue: ShieldState! {
get { getShieldsStrictReturnValueLock.withLock { getShieldsStrictUnderlyingReturnValue } }
set { getShieldsStrictReturnValueLock.withLock { getShieldsStrictUnderlyingReturnValue = newValue } }
}
open var getShieldsStrictClosure: ((Bool) -> ShieldState)?
open override func getShields(strict: Bool) -> ShieldState {
getShieldsStrictCallsCountLock.withLock { getShieldsStrictUnderlyingCallsCount += 1 }
getShieldsStrictReceivedStrict = strict
getShieldsStrictReceivedInvocationsLock.withLock { getShieldsStrictUnderlyingReceivedInvocations.append(strict) }
if let getShieldsStrictClosure = getShieldsStrictClosure {
return getShieldsStrictClosure(strict)
} else {
return getShieldsStrictReturnValue
}
}
//MARK: - latestJson
private let latestJsonCallsCountLock = NSLock()
private var latestJsonUnderlyingCallsCount = 0
open var latestJsonCallsCount: Int {
get { latestJsonCallsCountLock.withLock { latestJsonUnderlyingCallsCount } }
set { latestJsonCallsCountLock.withLock { latestJsonUnderlyingCallsCount = newValue } }
}
open var latestJsonCalled: Bool {
return latestJsonCallsCount > 0
}
private let latestJsonReturnValueLock = NSLock()
open var latestJsonUnderlyingReturnValue: String?
open var latestJsonReturnValue: String? {
get { latestJsonReturnValueLock.withLock { latestJsonUnderlyingReturnValue } }
set { latestJsonReturnValueLock.withLock { latestJsonUnderlyingReturnValue = newValue } }
}
open var latestJsonClosure: (() -> String?)?
open override func latestJson() -> String? {
latestJsonCallsCountLock.withLock { latestJsonUnderlyingCallsCount += 1 }
if let latestJsonClosure = latestJsonClosure {
return latestJsonClosure()
} else {
return latestJsonReturnValue
}
}
}
open class LeaveSpaceHandleSDKMock: MatrixRustSDK.LeaveSpaceHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - leave
open var leaveRoomIdsThrowableError: Error?
private let leaveRoomIdsCallsCountLock = NSLock()
private var leaveRoomIdsUnderlyingCallsCount = 0
open var leaveRoomIdsCallsCount: Int {
get { leaveRoomIdsCallsCountLock.withLock { leaveRoomIdsUnderlyingCallsCount } }
set { leaveRoomIdsCallsCountLock.withLock { leaveRoomIdsUnderlyingCallsCount = newValue } }
}
open var leaveRoomIdsCalled: Bool {
return leaveRoomIdsCallsCount > 0
}
private let leaveRoomIdsReceivedRoomIdsLock = NSLock()
private var leaveRoomIdsUnderlyingReceivedRoomIds: [String]?
open var leaveRoomIdsReceivedRoomIds: [String]? {
get { leaveRoomIdsReceivedRoomIdsLock.withLock { leaveRoomIdsUnderlyingReceivedRoomIds } }
set { leaveRoomIdsReceivedRoomIdsLock.withLock { leaveRoomIdsUnderlyingReceivedRoomIds = newValue } }
}
private let leaveRoomIdsReceivedInvocationsLock = NSLock()
private var leaveRoomIdsUnderlyingReceivedInvocations: [[String]] = []
open var leaveRoomIdsReceivedInvocations: [[String]] {
get { leaveRoomIdsReceivedInvocationsLock.withLock { leaveRoomIdsUnderlyingReceivedInvocations } }
set { leaveRoomIdsReceivedInvocationsLock.withLock { leaveRoomIdsUnderlyingReceivedInvocations = newValue } }
}
open var leaveRoomIdsClosure: (([String]) async throws -> Void)?
open override func leave(roomIds: [String]) async throws {
if let error = leaveRoomIdsThrowableError {
throw error
}
leaveRoomIdsCallsCountLock.withLock { leaveRoomIdsUnderlyingCallsCount += 1 }
leaveRoomIdsReceivedRoomIds = roomIds
leaveRoomIdsReceivedInvocationsLock.withLock { leaveRoomIdsUnderlyingReceivedInvocations.append(roomIds) }
try await leaveRoomIdsClosure?(roomIds)
}
//MARK: - rooms
private let roomsCallsCountLock = NSLock()
private var roomsUnderlyingCallsCount = 0
open var roomsCallsCount: Int {
get { roomsCallsCountLock.withLock { roomsUnderlyingCallsCount } }
set { roomsCallsCountLock.withLock { roomsUnderlyingCallsCount = newValue } }
}
open var roomsCalled: Bool {
return roomsCallsCount > 0
}
private let roomsReturnValueLock = NSLock()
open var roomsUnderlyingReturnValue: [LeaveSpaceRoom]!
open var roomsReturnValue: [LeaveSpaceRoom]! {
get { roomsReturnValueLock.withLock { roomsUnderlyingReturnValue } }
set { roomsReturnValueLock.withLock { roomsUnderlyingReturnValue = newValue } }
}
open var roomsClosure: (() -> [LeaveSpaceRoom])?
open override func rooms() -> [LeaveSpaceRoom] {
roomsCallsCountLock.withLock { roomsUnderlyingCallsCount += 1 }
if let roomsClosure = roomsClosure {
return roomsClosure()
} else {
return roomsReturnValue
}
}
}
open class LiveLocationsObserverSDKMock: MatrixRustSDK.LiveLocationsObserver, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - subscribe
private let subscribeListenerCallsCountLock = NSLock()
private var subscribeListenerUnderlyingCallsCount = 0
open var subscribeListenerCallsCount: Int {
get { subscribeListenerCallsCountLock.withLock { subscribeListenerUnderlyingCallsCount } }
set { subscribeListenerCallsCountLock.withLock { subscribeListenerUnderlyingCallsCount = newValue } }
}
open var subscribeListenerCalled: Bool {
return subscribeListenerCallsCount > 0
}
private let subscribeListenerReceivedListenerLock = NSLock()
private var subscribeListenerUnderlyingReceivedListener: LiveLocationsListener?
open var subscribeListenerReceivedListener: LiveLocationsListener? {
get { subscribeListenerReceivedListenerLock.withLock { subscribeListenerUnderlyingReceivedListener } }
set { subscribeListenerReceivedListenerLock.withLock { subscribeListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeListenerReceivedInvocationsLock = NSLock()
private var subscribeListenerUnderlyingReceivedInvocations: [LiveLocationsListener] = []
open var subscribeListenerReceivedInvocations: [LiveLocationsListener] {
get { subscribeListenerReceivedInvocationsLock.withLock { subscribeListenerUnderlyingReceivedInvocations } }
set { subscribeListenerReceivedInvocationsLock.withLock { subscribeListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeListenerReturnValueLock = NSLock()
open var subscribeListenerUnderlyingReturnValue: TaskHandle!
open var subscribeListenerReturnValue: TaskHandle! {
get { subscribeListenerReturnValueLock.withLock { subscribeListenerUnderlyingReturnValue } }
set { subscribeListenerReturnValueLock.withLock { subscribeListenerUnderlyingReturnValue = newValue } }
}
open var subscribeListenerClosure: ((LiveLocationsListener) -> TaskHandle)?
open override func subscribe(listener: LiveLocationsListener) -> TaskHandle {
subscribeListenerCallsCountLock.withLock { subscribeListenerUnderlyingCallsCount += 1 }
subscribeListenerReceivedListener = listener
subscribeListenerReceivedInvocationsLock.withLock { subscribeListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeListenerClosure = subscribeListenerClosure {
return subscribeListenerClosure(listener)
} else {
return subscribeListenerReturnValue
}
}
}
open class LoginWithQrCodeHandlerSDKMock: MatrixRustSDK.LoginWithQrCodeHandler, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - generate
open var generateProgressListenerThrowableError: Error?
private let generateProgressListenerCallsCountLock = NSLock()
private var generateProgressListenerUnderlyingCallsCount = 0
open var generateProgressListenerCallsCount: Int {
get { generateProgressListenerCallsCountLock.withLock { generateProgressListenerUnderlyingCallsCount } }
set { generateProgressListenerCallsCountLock.withLock { generateProgressListenerUnderlyingCallsCount = newValue } }
}
open var generateProgressListenerCalled: Bool {
return generateProgressListenerCallsCount > 0
}
private let generateProgressListenerReceivedProgressListenerLock = NSLock()
private var generateProgressListenerUnderlyingReceivedProgressListener: GeneratedQrLoginProgressListener?
open var generateProgressListenerReceivedProgressListener: GeneratedQrLoginProgressListener? {
get { generateProgressListenerReceivedProgressListenerLock.withLock { generateProgressListenerUnderlyingReceivedProgressListener } }
set { generateProgressListenerReceivedProgressListenerLock.withLock { generateProgressListenerUnderlyingReceivedProgressListener = newValue } }
}
private let generateProgressListenerReceivedInvocationsLock = NSLock()
private var generateProgressListenerUnderlyingReceivedInvocations: [GeneratedQrLoginProgressListener] = []
open var generateProgressListenerReceivedInvocations: [GeneratedQrLoginProgressListener] {
get { generateProgressListenerReceivedInvocationsLock.withLock { generateProgressListenerUnderlyingReceivedInvocations } }
set { generateProgressListenerReceivedInvocationsLock.withLock { generateProgressListenerUnderlyingReceivedInvocations = newValue } }
}
open var generateProgressListenerClosure: ((GeneratedQrLoginProgressListener) async throws -> Void)?
open override func generate(progressListener: GeneratedQrLoginProgressListener) async throws {
if let error = generateProgressListenerThrowableError {
throw error
}
generateProgressListenerCallsCountLock.withLock { generateProgressListenerUnderlyingCallsCount += 1 }
generateProgressListenerReceivedProgressListener = progressListener
generateProgressListenerReceivedInvocationsLock.withLock { generateProgressListenerUnderlyingReceivedInvocations.append(progressListener) }
try await generateProgressListenerClosure?(progressListener)
}
//MARK: - scan
open var scanQrCodeDataProgressListenerThrowableError: Error?
private let scanQrCodeDataProgressListenerCallsCountLock = NSLock()
private var scanQrCodeDataProgressListenerUnderlyingCallsCount = 0
open var scanQrCodeDataProgressListenerCallsCount: Int {
get { scanQrCodeDataProgressListenerCallsCountLock.withLock { scanQrCodeDataProgressListenerUnderlyingCallsCount } }
set { scanQrCodeDataProgressListenerCallsCountLock.withLock { scanQrCodeDataProgressListenerUnderlyingCallsCount = newValue } }
}
open var scanQrCodeDataProgressListenerCalled: Bool {
return scanQrCodeDataProgressListenerCallsCount > 0
}
private let scanQrCodeDataProgressListenerReceivedArgumentsLock = NSLock()
private var scanQrCodeDataProgressListenerUnderlyingReceivedArguments: (qrCodeData: QrCodeData, progressListener: QrLoginProgressListener)?
open var scanQrCodeDataProgressListenerReceivedArguments: (qrCodeData: QrCodeData, progressListener: QrLoginProgressListener)? {
get { scanQrCodeDataProgressListenerReceivedArgumentsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedArguments } }
set { scanQrCodeDataProgressListenerReceivedArgumentsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedArguments = newValue } }
}
private let scanQrCodeDataProgressListenerReceivedInvocationsLock = NSLock()
private var scanQrCodeDataProgressListenerUnderlyingReceivedInvocations: [(qrCodeData: QrCodeData, progressListener: QrLoginProgressListener)] = []
open var scanQrCodeDataProgressListenerReceivedInvocations: [(qrCodeData: QrCodeData, progressListener: QrLoginProgressListener)] {
get { scanQrCodeDataProgressListenerReceivedInvocationsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedInvocations } }
set { scanQrCodeDataProgressListenerReceivedInvocationsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedInvocations = newValue } }
}
open var scanQrCodeDataProgressListenerClosure: ((QrCodeData, QrLoginProgressListener) async throws -> Void)?
open override func scan(qrCodeData: QrCodeData, progressListener: QrLoginProgressListener) async throws {
if let error = scanQrCodeDataProgressListenerThrowableError {
throw error
}
scanQrCodeDataProgressListenerCallsCountLock.withLock { scanQrCodeDataProgressListenerUnderlyingCallsCount += 1 }
scanQrCodeDataProgressListenerReceivedArguments = (qrCodeData: qrCodeData, progressListener: progressListener)
scanQrCodeDataProgressListenerReceivedInvocationsLock.withLock { scanQrCodeDataProgressListenerUnderlyingReceivedInvocations.append((qrCodeData: qrCodeData, progressListener: progressListener)) }
try await scanQrCodeDataProgressListenerClosure?(qrCodeData, progressListener)
}
}
open class MediaFileHandleSDKMock: MatrixRustSDK.MediaFileHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - path
open var pathThrowableError: Error?
private let pathCallsCountLock = NSLock()
private var pathUnderlyingCallsCount = 0
open var pathCallsCount: Int {
get { pathCallsCountLock.withLock { pathUnderlyingCallsCount } }
set { pathCallsCountLock.withLock { pathUnderlyingCallsCount = newValue } }
}
open var pathCalled: Bool {
return pathCallsCount > 0
}
private let pathReturnValueLock = NSLock()
open var pathUnderlyingReturnValue: String!
open var pathReturnValue: String! {
get { pathReturnValueLock.withLock { pathUnderlyingReturnValue } }
set { pathReturnValueLock.withLock { pathUnderlyingReturnValue = newValue } }
}
open var pathClosure: (() throws -> String)?
open override func path() throws -> String {
if let error = pathThrowableError {
throw error
}
pathCallsCountLock.withLock { pathUnderlyingCallsCount += 1 }
if let pathClosure = pathClosure {
return try pathClosure()
} else {
return pathReturnValue
}
}
//MARK: - persist
open var persistPathThrowableError: Error?
private let persistPathCallsCountLock = NSLock()
private var persistPathUnderlyingCallsCount = 0
open var persistPathCallsCount: Int {
get { persistPathCallsCountLock.withLock { persistPathUnderlyingCallsCount } }
set { persistPathCallsCountLock.withLock { persistPathUnderlyingCallsCount = newValue } }
}
open var persistPathCalled: Bool {
return persistPathCallsCount > 0
}
private let persistPathReceivedPathLock = NSLock()
private var persistPathUnderlyingReceivedPath: String?
open var persistPathReceivedPath: String? {
get { persistPathReceivedPathLock.withLock { persistPathUnderlyingReceivedPath } }
set { persistPathReceivedPathLock.withLock { persistPathUnderlyingReceivedPath = newValue } }
}
private let persistPathReceivedInvocationsLock = NSLock()
private var persistPathUnderlyingReceivedInvocations: [String] = []
open var persistPathReceivedInvocations: [String] {
get { persistPathReceivedInvocationsLock.withLock { persistPathUnderlyingReceivedInvocations } }
set { persistPathReceivedInvocationsLock.withLock { persistPathUnderlyingReceivedInvocations = newValue } }
}
private let persistPathReturnValueLock = NSLock()
open var persistPathUnderlyingReturnValue: Bool!
open var persistPathReturnValue: Bool! {
get { persistPathReturnValueLock.withLock { persistPathUnderlyingReturnValue } }
set { persistPathReturnValueLock.withLock { persistPathUnderlyingReturnValue = newValue } }
}
open var persistPathClosure: ((String) throws -> Bool)?
open override func persist(path: String) throws -> Bool {
if let error = persistPathThrowableError {
throw error
}
persistPathCallsCountLock.withLock { persistPathUnderlyingCallsCount += 1 }
persistPathReceivedPath = path
persistPathReceivedInvocationsLock.withLock { persistPathUnderlyingReceivedInvocations.append(path) }
if let persistPathClosure = persistPathClosure {
return try persistPathClosure(path)
} else {
return persistPathReturnValue
}
}
}
open class MediaSourceSDKMock: MatrixRustSDK.MediaSource, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
static func reset()
{
}
//MARK: - toJson
private let toJsonCallsCountLock = NSLock()
private var toJsonUnderlyingCallsCount = 0
open var toJsonCallsCount: Int {
get { toJsonCallsCountLock.withLock { toJsonUnderlyingCallsCount } }
set { toJsonCallsCountLock.withLock { toJsonUnderlyingCallsCount = newValue } }
}
open var toJsonCalled: Bool {
return toJsonCallsCount > 0
}
private let toJsonReturnValueLock = NSLock()
open var toJsonUnderlyingReturnValue: String!
open var toJsonReturnValue: String! {
get { toJsonReturnValueLock.withLock { toJsonUnderlyingReturnValue } }
set { toJsonReturnValueLock.withLock { toJsonUnderlyingReturnValue = newValue } }
}
open var toJsonClosure: (() -> String)?
open override func toJson() -> String {
toJsonCallsCountLock.withLock { toJsonUnderlyingCallsCount += 1 }
if let toJsonClosure = toJsonClosure {
return toJsonClosure()
} else {
return toJsonReturnValue
}
}
//MARK: - url
private let urlCallsCountLock = NSLock()
private var urlUnderlyingCallsCount = 0
open var urlCallsCount: Int {
get { urlCallsCountLock.withLock { urlUnderlyingCallsCount } }
set { urlCallsCountLock.withLock { urlUnderlyingCallsCount = newValue } }
}
open var urlCalled: Bool {
return urlCallsCount > 0
}
private let urlReturnValueLock = NSLock()
open var urlUnderlyingReturnValue: String!
open var urlReturnValue: String! {
get { urlReturnValueLock.withLock { urlUnderlyingReturnValue } }
set { urlReturnValueLock.withLock { urlUnderlyingReturnValue = newValue } }
}
open var urlClosure: (() -> String)?
open override func url() -> String {
urlCallsCountLock.withLock { urlUnderlyingCallsCount += 1 }
if let urlClosure = urlClosure {
return urlClosure()
} else {
return urlReturnValue
}
}
}
open class NotificationClientSDKMock: MatrixRustSDK.NotificationClient, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - getNotification
open var getNotificationRoomIdEventIdThrowableError: Error?
private let getNotificationRoomIdEventIdCallsCountLock = NSLock()
private var getNotificationRoomIdEventIdUnderlyingCallsCount = 0
open var getNotificationRoomIdEventIdCallsCount: Int {
get { getNotificationRoomIdEventIdCallsCountLock.withLock { getNotificationRoomIdEventIdUnderlyingCallsCount } }
set { getNotificationRoomIdEventIdCallsCountLock.withLock { getNotificationRoomIdEventIdUnderlyingCallsCount = newValue } }
}
open var getNotificationRoomIdEventIdCalled: Bool {
return getNotificationRoomIdEventIdCallsCount > 0
}
private let getNotificationRoomIdEventIdReceivedArgumentsLock = NSLock()
private var getNotificationRoomIdEventIdUnderlyingReceivedArguments: (roomId: String, eventId: String)?
open var getNotificationRoomIdEventIdReceivedArguments: (roomId: String, eventId: String)? {
get { getNotificationRoomIdEventIdReceivedArgumentsLock.withLock { getNotificationRoomIdEventIdUnderlyingReceivedArguments } }
set { getNotificationRoomIdEventIdReceivedArgumentsLock.withLock { getNotificationRoomIdEventIdUnderlyingReceivedArguments = newValue } }
}
private let getNotificationRoomIdEventIdReceivedInvocationsLock = NSLock()
private var getNotificationRoomIdEventIdUnderlyingReceivedInvocations: [(roomId: String, eventId: String)] = []
open var getNotificationRoomIdEventIdReceivedInvocations: [(roomId: String, eventId: String)] {
get { getNotificationRoomIdEventIdReceivedInvocationsLock.withLock { getNotificationRoomIdEventIdUnderlyingReceivedInvocations } }
set { getNotificationRoomIdEventIdReceivedInvocationsLock.withLock { getNotificationRoomIdEventIdUnderlyingReceivedInvocations = newValue } }
}
private let getNotificationRoomIdEventIdReturnValueLock = NSLock()
open var getNotificationRoomIdEventIdUnderlyingReturnValue: NotificationStatus!
open var getNotificationRoomIdEventIdReturnValue: NotificationStatus! {
get { getNotificationRoomIdEventIdReturnValueLock.withLock { getNotificationRoomIdEventIdUnderlyingReturnValue } }
set { getNotificationRoomIdEventIdReturnValueLock.withLock { getNotificationRoomIdEventIdUnderlyingReturnValue = newValue } }
}
open var getNotificationRoomIdEventIdClosure: ((String, String) async throws -> NotificationStatus)?
open override func getNotification(roomId: String, eventId: String) async throws -> NotificationStatus {
if let error = getNotificationRoomIdEventIdThrowableError {
throw error
}
getNotificationRoomIdEventIdCallsCountLock.withLock { getNotificationRoomIdEventIdUnderlyingCallsCount += 1 }
getNotificationRoomIdEventIdReceivedArguments = (roomId: roomId, eventId: eventId)
getNotificationRoomIdEventIdReceivedInvocationsLock.withLock { getNotificationRoomIdEventIdUnderlyingReceivedInvocations.append((roomId: roomId, eventId: eventId)) }
if let getNotificationRoomIdEventIdClosure = getNotificationRoomIdEventIdClosure {
return try await getNotificationRoomIdEventIdClosure(roomId, eventId)
} else {
return getNotificationRoomIdEventIdReturnValue
}
}
//MARK: - getNotifications
open var getNotificationsRequestsThrowableError: Error?
private let getNotificationsRequestsCallsCountLock = NSLock()
private var getNotificationsRequestsUnderlyingCallsCount = 0
open var getNotificationsRequestsCallsCount: Int {
get { getNotificationsRequestsCallsCountLock.withLock { getNotificationsRequestsUnderlyingCallsCount } }
set { getNotificationsRequestsCallsCountLock.withLock { getNotificationsRequestsUnderlyingCallsCount = newValue } }
}
open var getNotificationsRequestsCalled: Bool {
return getNotificationsRequestsCallsCount > 0
}
private let getNotificationsRequestsReceivedRequestsLock = NSLock()
private var getNotificationsRequestsUnderlyingReceivedRequests: [NotificationItemsRequest]?
open var getNotificationsRequestsReceivedRequests: [NotificationItemsRequest]? {
get { getNotificationsRequestsReceivedRequestsLock.withLock { getNotificationsRequestsUnderlyingReceivedRequests } }
set { getNotificationsRequestsReceivedRequestsLock.withLock { getNotificationsRequestsUnderlyingReceivedRequests = newValue } }
}
private let getNotificationsRequestsReceivedInvocationsLock = NSLock()
private var getNotificationsRequestsUnderlyingReceivedInvocations: [[NotificationItemsRequest]] = []
open var getNotificationsRequestsReceivedInvocations: [[NotificationItemsRequest]] {
get { getNotificationsRequestsReceivedInvocationsLock.withLock { getNotificationsRequestsUnderlyingReceivedInvocations } }
set { getNotificationsRequestsReceivedInvocationsLock.withLock { getNotificationsRequestsUnderlyingReceivedInvocations = newValue } }
}
private let getNotificationsRequestsReturnValueLock = NSLock()
open var getNotificationsRequestsUnderlyingReturnValue: [String: BatchNotificationResult]!
open var getNotificationsRequestsReturnValue: [String: BatchNotificationResult]! {
get { getNotificationsRequestsReturnValueLock.withLock { getNotificationsRequestsUnderlyingReturnValue } }
set { getNotificationsRequestsReturnValueLock.withLock { getNotificationsRequestsUnderlyingReturnValue = newValue } }
}
open var getNotificationsRequestsClosure: (([NotificationItemsRequest]) async throws -> [String: BatchNotificationResult])?
open override func getNotifications(requests: [NotificationItemsRequest]) async throws -> [String: BatchNotificationResult] {
if let error = getNotificationsRequestsThrowableError {
throw error
}
getNotificationsRequestsCallsCountLock.withLock { getNotificationsRequestsUnderlyingCallsCount += 1 }
getNotificationsRequestsReceivedRequests = requests
getNotificationsRequestsReceivedInvocationsLock.withLock { getNotificationsRequestsUnderlyingReceivedInvocations.append(requests) }
if let getNotificationsRequestsClosure = getNotificationsRequestsClosure {
return try await getNotificationsRequestsClosure(requests)
} else {
return getNotificationsRequestsReturnValue
}
}
//MARK: - getRoom
open var getRoomRoomIdThrowableError: Error?
private let getRoomRoomIdCallsCountLock = NSLock()
private var getRoomRoomIdUnderlyingCallsCount = 0
open var getRoomRoomIdCallsCount: Int {
get { getRoomRoomIdCallsCountLock.withLock { getRoomRoomIdUnderlyingCallsCount } }
set { getRoomRoomIdCallsCountLock.withLock { getRoomRoomIdUnderlyingCallsCount = newValue } }
}
open var getRoomRoomIdCalled: Bool {
return getRoomRoomIdCallsCount > 0
}
private let getRoomRoomIdReceivedRoomIdLock = NSLock()
private var getRoomRoomIdUnderlyingReceivedRoomId: String?
open var getRoomRoomIdReceivedRoomId: String? {
get { getRoomRoomIdReceivedRoomIdLock.withLock { getRoomRoomIdUnderlyingReceivedRoomId } }
set { getRoomRoomIdReceivedRoomIdLock.withLock { getRoomRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let getRoomRoomIdReceivedInvocationsLock = NSLock()
private var getRoomRoomIdUnderlyingReceivedInvocations: [String] = []
open var getRoomRoomIdReceivedInvocations: [String] {
get { getRoomRoomIdReceivedInvocationsLock.withLock { getRoomRoomIdUnderlyingReceivedInvocations } }
set { getRoomRoomIdReceivedInvocationsLock.withLock { getRoomRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let getRoomRoomIdReturnValueLock = NSLock()
open var getRoomRoomIdUnderlyingReturnValue: Room?
open var getRoomRoomIdReturnValue: Room? {
get { getRoomRoomIdReturnValueLock.withLock { getRoomRoomIdUnderlyingReturnValue } }
set { getRoomRoomIdReturnValueLock.withLock { getRoomRoomIdUnderlyingReturnValue = newValue } }
}
open var getRoomRoomIdClosure: ((String) throws -> Room?)?
open override func getRoom(roomId: String) throws -> Room? {
if let error = getRoomRoomIdThrowableError {
throw error
}
getRoomRoomIdCallsCountLock.withLock { getRoomRoomIdUnderlyingCallsCount += 1 }
getRoomRoomIdReceivedRoomId = roomId
getRoomRoomIdReceivedInvocationsLock.withLock { getRoomRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let getRoomRoomIdClosure = getRoomRoomIdClosure {
return try getRoomRoomIdClosure(roomId)
} else {
return getRoomRoomIdReturnValue
}
}
}
open class NotificationSettingsSDKMock: MatrixRustSDK.NotificationSettings, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - canHomeserverPushEncryptedEventToDevice
private let canHomeserverPushEncryptedEventToDeviceCallsCountLock = NSLock()
private var canHomeserverPushEncryptedEventToDeviceUnderlyingCallsCount = 0
open var canHomeserverPushEncryptedEventToDeviceCallsCount: Int {
get { canHomeserverPushEncryptedEventToDeviceCallsCountLock.withLock { canHomeserverPushEncryptedEventToDeviceUnderlyingCallsCount } }
set { canHomeserverPushEncryptedEventToDeviceCallsCountLock.withLock { canHomeserverPushEncryptedEventToDeviceUnderlyingCallsCount = newValue } }
}
open var canHomeserverPushEncryptedEventToDeviceCalled: Bool {
return canHomeserverPushEncryptedEventToDeviceCallsCount > 0
}
private let canHomeserverPushEncryptedEventToDeviceReturnValueLock = NSLock()
open var canHomeserverPushEncryptedEventToDeviceUnderlyingReturnValue: Bool!
open var canHomeserverPushEncryptedEventToDeviceReturnValue: Bool! {
get { canHomeserverPushEncryptedEventToDeviceReturnValueLock.withLock { canHomeserverPushEncryptedEventToDeviceUnderlyingReturnValue } }
set { canHomeserverPushEncryptedEventToDeviceReturnValueLock.withLock { canHomeserverPushEncryptedEventToDeviceUnderlyingReturnValue = newValue } }
}
open var canHomeserverPushEncryptedEventToDeviceClosure: (() async -> Bool)?
open override func canHomeserverPushEncryptedEventToDevice() async -> Bool {
canHomeserverPushEncryptedEventToDeviceCallsCountLock.withLock { canHomeserverPushEncryptedEventToDeviceUnderlyingCallsCount += 1 }
if let canHomeserverPushEncryptedEventToDeviceClosure = canHomeserverPushEncryptedEventToDeviceClosure {
return await canHomeserverPushEncryptedEventToDeviceClosure()
} else {
return canHomeserverPushEncryptedEventToDeviceReturnValue
}
}
//MARK: - canPushEncryptedEventToDevice
private let canPushEncryptedEventToDeviceCallsCountLock = NSLock()
private var canPushEncryptedEventToDeviceUnderlyingCallsCount = 0
open var canPushEncryptedEventToDeviceCallsCount: Int {
get { canPushEncryptedEventToDeviceCallsCountLock.withLock { canPushEncryptedEventToDeviceUnderlyingCallsCount } }
set { canPushEncryptedEventToDeviceCallsCountLock.withLock { canPushEncryptedEventToDeviceUnderlyingCallsCount = newValue } }
}
open var canPushEncryptedEventToDeviceCalled: Bool {
return canPushEncryptedEventToDeviceCallsCount > 0
}
private let canPushEncryptedEventToDeviceReturnValueLock = NSLock()
open var canPushEncryptedEventToDeviceUnderlyingReturnValue: Bool!
open var canPushEncryptedEventToDeviceReturnValue: Bool! {
get { canPushEncryptedEventToDeviceReturnValueLock.withLock { canPushEncryptedEventToDeviceUnderlyingReturnValue } }
set { canPushEncryptedEventToDeviceReturnValueLock.withLock { canPushEncryptedEventToDeviceUnderlyingReturnValue = newValue } }
}
open var canPushEncryptedEventToDeviceClosure: (() async -> Bool)?
open override func canPushEncryptedEventToDevice() async -> Bool {
canPushEncryptedEventToDeviceCallsCountLock.withLock { canPushEncryptedEventToDeviceUnderlyingCallsCount += 1 }
if let canPushEncryptedEventToDeviceClosure = canPushEncryptedEventToDeviceClosure {
return await canPushEncryptedEventToDeviceClosure()
} else {
return canPushEncryptedEventToDeviceReturnValue
}
}
//MARK: - containsKeywordsRules
private let containsKeywordsRulesCallsCountLock = NSLock()
private var containsKeywordsRulesUnderlyingCallsCount = 0
open var containsKeywordsRulesCallsCount: Int {
get { containsKeywordsRulesCallsCountLock.withLock { containsKeywordsRulesUnderlyingCallsCount } }
set { containsKeywordsRulesCallsCountLock.withLock { containsKeywordsRulesUnderlyingCallsCount = newValue } }
}
open var containsKeywordsRulesCalled: Bool {
return containsKeywordsRulesCallsCount > 0
}
private let containsKeywordsRulesReturnValueLock = NSLock()
open var containsKeywordsRulesUnderlyingReturnValue: Bool!
open var containsKeywordsRulesReturnValue: Bool! {
get { containsKeywordsRulesReturnValueLock.withLock { containsKeywordsRulesUnderlyingReturnValue } }
set { containsKeywordsRulesReturnValueLock.withLock { containsKeywordsRulesUnderlyingReturnValue = newValue } }
}
open var containsKeywordsRulesClosure: (() async -> Bool)?
open override func containsKeywordsRules() async -> Bool {
containsKeywordsRulesCallsCountLock.withLock { containsKeywordsRulesUnderlyingCallsCount += 1 }
if let containsKeywordsRulesClosure = containsKeywordsRulesClosure {
return await containsKeywordsRulesClosure()
} else {
return containsKeywordsRulesReturnValue
}
}
//MARK: - getDefaultRoomNotificationMode
private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock = NSLock()
private var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount = 0
open var getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCount: Int {
get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount } }
set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount = newValue } }
}
open var getDefaultRoomNotificationModeIsEncryptedIsOneToOneCalled: Bool {
return getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCount > 0
}
private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArgumentsLock = NSLock()
private var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool)?
open var getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool)? {
get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedArguments } }
set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedArguments = newValue } }
}
private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock = NSLock()
private var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool)] = []
open var getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool)] {
get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations } }
set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations = newValue } }
}
private let getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValueLock = NSLock()
open var getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReturnValue: RoomNotificationMode!
open var getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValue: RoomNotificationMode! {
get { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValueLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReturnValue } }
set { getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValueLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReturnValue = newValue } }
}
open var getDefaultRoomNotificationModeIsEncryptedIsOneToOneClosure: ((Bool, Bool) async -> RoomNotificationMode)?
open override func getDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool) async -> RoomNotificationMode {
getDefaultRoomNotificationModeIsEncryptedIsOneToOneCallsCountLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingCallsCount += 1 }
getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedArguments = (isEncrypted: isEncrypted, isOneToOne: isOneToOne)
getDefaultRoomNotificationModeIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getDefaultRoomNotificationModeIsEncryptedIsOneToOneUnderlyingReceivedInvocations.append((isEncrypted: isEncrypted, isOneToOne: isOneToOne)) }
if let getDefaultRoomNotificationModeIsEncryptedIsOneToOneClosure = getDefaultRoomNotificationModeIsEncryptedIsOneToOneClosure {
return await getDefaultRoomNotificationModeIsEncryptedIsOneToOneClosure(isEncrypted, isOneToOne)
} else {
return getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValue
}
}
//MARK: - getRawPushRules
open var getRawPushRulesThrowableError: Error?
private let getRawPushRulesCallsCountLock = NSLock()
private var getRawPushRulesUnderlyingCallsCount = 0
open var getRawPushRulesCallsCount: Int {
get { getRawPushRulesCallsCountLock.withLock { getRawPushRulesUnderlyingCallsCount } }
set { getRawPushRulesCallsCountLock.withLock { getRawPushRulesUnderlyingCallsCount = newValue } }
}
open var getRawPushRulesCalled: Bool {
return getRawPushRulesCallsCount > 0
}
private let getRawPushRulesReturnValueLock = NSLock()
open var getRawPushRulesUnderlyingReturnValue: String?
open var getRawPushRulesReturnValue: String? {
get { getRawPushRulesReturnValueLock.withLock { getRawPushRulesUnderlyingReturnValue } }
set { getRawPushRulesReturnValueLock.withLock { getRawPushRulesUnderlyingReturnValue = newValue } }
}
open var getRawPushRulesClosure: (() async throws -> String?)?
open override func getRawPushRules() async throws -> String? {
if let error = getRawPushRulesThrowableError {
throw error
}
getRawPushRulesCallsCountLock.withLock { getRawPushRulesUnderlyingCallsCount += 1 }
if let getRawPushRulesClosure = getRawPushRulesClosure {
return try await getRawPushRulesClosure()
} else {
return getRawPushRulesReturnValue
}
}
//MARK: - getRoomNotificationSettings
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError: Error?
private let getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCountLock = NSLock()
private var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = 0
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCount: Int {
get { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount } }
set { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = newValue } }
}
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneCalled: Bool {
return getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCount > 0
}
private let getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock = NSLock()
private var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)?
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? {
get { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments } }
set { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments = newValue } }
}
private let getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock = NSLock()
private var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] = []
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] {
get { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations } }
set { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations = newValue } }
}
private let getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValueLock = NSLock()
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReturnValue: RoomNotificationSettings!
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValue: RoomNotificationSettings! {
get { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValueLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReturnValue } }
set { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValueLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReturnValue = newValue } }
}
open var getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneClosure: ((String, Bool, Bool) async throws -> RoomNotificationSettings)?
open override func getRoomNotificationSettings(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws -> RoomNotificationSettings {
if let error = getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError {
throw error
}
getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount += 1 }
getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedArguments = (roomId: roomId, isEncrypted: isEncrypted, isOneToOne: isOneToOne)
getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations.append((roomId: roomId, isEncrypted: isEncrypted, isOneToOne: isOneToOne)) }
if let getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneClosure = getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneClosure {
return try await getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneClosure(roomId, isEncrypted, isOneToOne)
} else {
return getRoomNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValue
}
}
//MARK: - getRoomsWithUserDefinedRules
private let getRoomsWithUserDefinedRulesEnabledCallsCountLock = NSLock()
private var getRoomsWithUserDefinedRulesEnabledUnderlyingCallsCount = 0
open var getRoomsWithUserDefinedRulesEnabledCallsCount: Int {
get { getRoomsWithUserDefinedRulesEnabledCallsCountLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingCallsCount } }
set { getRoomsWithUserDefinedRulesEnabledCallsCountLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingCallsCount = newValue } }
}
open var getRoomsWithUserDefinedRulesEnabledCalled: Bool {
return getRoomsWithUserDefinedRulesEnabledCallsCount > 0
}
private let getRoomsWithUserDefinedRulesEnabledReceivedEnabledLock = NSLock()
private var getRoomsWithUserDefinedRulesEnabledUnderlyingReceivedEnabled: Bool?
open var getRoomsWithUserDefinedRulesEnabledReceivedEnabled: Bool? {
get { getRoomsWithUserDefinedRulesEnabledReceivedEnabledLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingReceivedEnabled } }
set { getRoomsWithUserDefinedRulesEnabledReceivedEnabledLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingReceivedEnabled = newValue } }
}
private let getRoomsWithUserDefinedRulesEnabledReceivedInvocationsLock = NSLock()
private var getRoomsWithUserDefinedRulesEnabledUnderlyingReceivedInvocations: [Bool?] = []
open var getRoomsWithUserDefinedRulesEnabledReceivedInvocations: [Bool?] {
get { getRoomsWithUserDefinedRulesEnabledReceivedInvocationsLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingReceivedInvocations } }
set { getRoomsWithUserDefinedRulesEnabledReceivedInvocationsLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingReceivedInvocations = newValue } }
}
private let getRoomsWithUserDefinedRulesEnabledReturnValueLock = NSLock()
open var getRoomsWithUserDefinedRulesEnabledUnderlyingReturnValue: [String]!
open var getRoomsWithUserDefinedRulesEnabledReturnValue: [String]! {
get { getRoomsWithUserDefinedRulesEnabledReturnValueLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingReturnValue } }
set { getRoomsWithUserDefinedRulesEnabledReturnValueLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingReturnValue = newValue } }
}
open var getRoomsWithUserDefinedRulesEnabledClosure: ((Bool?) async -> [String])?
open override func getRoomsWithUserDefinedRules(enabled: Bool?) async -> [String] {
getRoomsWithUserDefinedRulesEnabledCallsCountLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingCallsCount += 1 }
getRoomsWithUserDefinedRulesEnabledReceivedEnabled = enabled
getRoomsWithUserDefinedRulesEnabledReceivedInvocationsLock.withLock { getRoomsWithUserDefinedRulesEnabledUnderlyingReceivedInvocations.append(enabled) }
if let getRoomsWithUserDefinedRulesEnabledClosure = getRoomsWithUserDefinedRulesEnabledClosure {
return await getRoomsWithUserDefinedRulesEnabledClosure(enabled)
} else {
return getRoomsWithUserDefinedRulesEnabledReturnValue
}
}
//MARK: - getUserDefinedRoomNotificationMode
open var getUserDefinedRoomNotificationModeRoomIdThrowableError: Error?
private let getUserDefinedRoomNotificationModeRoomIdCallsCountLock = NSLock()
private var getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount = 0
open var getUserDefinedRoomNotificationModeRoomIdCallsCount: Int {
get { getUserDefinedRoomNotificationModeRoomIdCallsCountLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount } }
set { getUserDefinedRoomNotificationModeRoomIdCallsCountLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount = newValue } }
}
open var getUserDefinedRoomNotificationModeRoomIdCalled: Bool {
return getUserDefinedRoomNotificationModeRoomIdCallsCount > 0
}
private let getUserDefinedRoomNotificationModeRoomIdReceivedRoomIdLock = NSLock()
private var getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedRoomId: String?
open var getUserDefinedRoomNotificationModeRoomIdReceivedRoomId: String? {
get { getUserDefinedRoomNotificationModeRoomIdReceivedRoomIdLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedRoomId } }
set { getUserDefinedRoomNotificationModeRoomIdReceivedRoomIdLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let getUserDefinedRoomNotificationModeRoomIdReceivedInvocationsLock = NSLock()
private var getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations: [String] = []
open var getUserDefinedRoomNotificationModeRoomIdReceivedInvocations: [String] {
get { getUserDefinedRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations } }
set { getUserDefinedRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let getUserDefinedRoomNotificationModeRoomIdReturnValueLock = NSLock()
open var getUserDefinedRoomNotificationModeRoomIdUnderlyingReturnValue: RoomNotificationMode?
open var getUserDefinedRoomNotificationModeRoomIdReturnValue: RoomNotificationMode? {
get { getUserDefinedRoomNotificationModeRoomIdReturnValueLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReturnValue } }
set { getUserDefinedRoomNotificationModeRoomIdReturnValueLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReturnValue = newValue } }
}
open var getUserDefinedRoomNotificationModeRoomIdClosure: ((String) async throws -> RoomNotificationMode?)?
open override func getUserDefinedRoomNotificationMode(roomId: String) async throws -> RoomNotificationMode? {
if let error = getUserDefinedRoomNotificationModeRoomIdThrowableError {
throw error
}
getUserDefinedRoomNotificationModeRoomIdCallsCountLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingCallsCount += 1 }
getUserDefinedRoomNotificationModeRoomIdReceivedRoomId = roomId
getUserDefinedRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { getUserDefinedRoomNotificationModeRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let getUserDefinedRoomNotificationModeRoomIdClosure = getUserDefinedRoomNotificationModeRoomIdClosure {
return try await getUserDefinedRoomNotificationModeRoomIdClosure(roomId)
} else {
return getUserDefinedRoomNotificationModeRoomIdReturnValue
}
}
//MARK: - isCallEnabled
open var isCallEnabledThrowableError: Error?
private let isCallEnabledCallsCountLock = NSLock()
private var isCallEnabledUnderlyingCallsCount = 0
open var isCallEnabledCallsCount: Int {
get { isCallEnabledCallsCountLock.withLock { isCallEnabledUnderlyingCallsCount } }
set { isCallEnabledCallsCountLock.withLock { isCallEnabledUnderlyingCallsCount = newValue } }
}
open var isCallEnabledCalled: Bool {
return isCallEnabledCallsCount > 0
}
private let isCallEnabledReturnValueLock = NSLock()
open var isCallEnabledUnderlyingReturnValue: Bool!
open var isCallEnabledReturnValue: Bool! {
get { isCallEnabledReturnValueLock.withLock { isCallEnabledUnderlyingReturnValue } }
set { isCallEnabledReturnValueLock.withLock { isCallEnabledUnderlyingReturnValue = newValue } }
}
open var isCallEnabledClosure: (() async throws -> Bool)?
open override func isCallEnabled() async throws -> Bool {
if let error = isCallEnabledThrowableError {
throw error
}
isCallEnabledCallsCountLock.withLock { isCallEnabledUnderlyingCallsCount += 1 }
if let isCallEnabledClosure = isCallEnabledClosure {
return try await isCallEnabledClosure()
} else {
return isCallEnabledReturnValue
}
}
//MARK: - isInviteForMeEnabled
open var isInviteForMeEnabledThrowableError: Error?
private let isInviteForMeEnabledCallsCountLock = NSLock()
private var isInviteForMeEnabledUnderlyingCallsCount = 0
open var isInviteForMeEnabledCallsCount: Int {
get { isInviteForMeEnabledCallsCountLock.withLock { isInviteForMeEnabledUnderlyingCallsCount } }
set { isInviteForMeEnabledCallsCountLock.withLock { isInviteForMeEnabledUnderlyingCallsCount = newValue } }
}
open var isInviteForMeEnabledCalled: Bool {
return isInviteForMeEnabledCallsCount > 0
}
private let isInviteForMeEnabledReturnValueLock = NSLock()
open var isInviteForMeEnabledUnderlyingReturnValue: Bool!
open var isInviteForMeEnabledReturnValue: Bool! {
get { isInviteForMeEnabledReturnValueLock.withLock { isInviteForMeEnabledUnderlyingReturnValue } }
set { isInviteForMeEnabledReturnValueLock.withLock { isInviteForMeEnabledUnderlyingReturnValue = newValue } }
}
open var isInviteForMeEnabledClosure: (() async throws -> Bool)?
open override func isInviteForMeEnabled() async throws -> Bool {
if let error = isInviteForMeEnabledThrowableError {
throw error
}
isInviteForMeEnabledCallsCountLock.withLock { isInviteForMeEnabledUnderlyingCallsCount += 1 }
if let isInviteForMeEnabledClosure = isInviteForMeEnabledClosure {
return try await isInviteForMeEnabledClosure()
} else {
return isInviteForMeEnabledReturnValue
}
}
//MARK: - isRoomMentionEnabled
open var isRoomMentionEnabledThrowableError: Error?
private let isRoomMentionEnabledCallsCountLock = NSLock()
private var isRoomMentionEnabledUnderlyingCallsCount = 0
open var isRoomMentionEnabledCallsCount: Int {
get { isRoomMentionEnabledCallsCountLock.withLock { isRoomMentionEnabledUnderlyingCallsCount } }
set { isRoomMentionEnabledCallsCountLock.withLock { isRoomMentionEnabledUnderlyingCallsCount = newValue } }
}
open var isRoomMentionEnabledCalled: Bool {
return isRoomMentionEnabledCallsCount > 0
}
private let isRoomMentionEnabledReturnValueLock = NSLock()
open var isRoomMentionEnabledUnderlyingReturnValue: Bool!
open var isRoomMentionEnabledReturnValue: Bool! {
get { isRoomMentionEnabledReturnValueLock.withLock { isRoomMentionEnabledUnderlyingReturnValue } }
set { isRoomMentionEnabledReturnValueLock.withLock { isRoomMentionEnabledUnderlyingReturnValue = newValue } }
}
open var isRoomMentionEnabledClosure: (() async throws -> Bool)?
open override func isRoomMentionEnabled() async throws -> Bool {
if let error = isRoomMentionEnabledThrowableError {
throw error
}
isRoomMentionEnabledCallsCountLock.withLock { isRoomMentionEnabledUnderlyingCallsCount += 1 }
if let isRoomMentionEnabledClosure = isRoomMentionEnabledClosure {
return try await isRoomMentionEnabledClosure()
} else {
return isRoomMentionEnabledReturnValue
}
}
//MARK: - isUserMentionEnabled
open var isUserMentionEnabledThrowableError: Error?
private let isUserMentionEnabledCallsCountLock = NSLock()
private var isUserMentionEnabledUnderlyingCallsCount = 0
open var isUserMentionEnabledCallsCount: Int {
get { isUserMentionEnabledCallsCountLock.withLock { isUserMentionEnabledUnderlyingCallsCount } }
set { isUserMentionEnabledCallsCountLock.withLock { isUserMentionEnabledUnderlyingCallsCount = newValue } }
}
open var isUserMentionEnabledCalled: Bool {
return isUserMentionEnabledCallsCount > 0
}
private let isUserMentionEnabledReturnValueLock = NSLock()
open var isUserMentionEnabledUnderlyingReturnValue: Bool!
open var isUserMentionEnabledReturnValue: Bool! {
get { isUserMentionEnabledReturnValueLock.withLock { isUserMentionEnabledUnderlyingReturnValue } }
set { isUserMentionEnabledReturnValueLock.withLock { isUserMentionEnabledUnderlyingReturnValue = newValue } }
}
open var isUserMentionEnabledClosure: (() async throws -> Bool)?
open override func isUserMentionEnabled() async throws -> Bool {
if let error = isUserMentionEnabledThrowableError {
throw error
}
isUserMentionEnabledCallsCountLock.withLock { isUserMentionEnabledUnderlyingCallsCount += 1 }
if let isUserMentionEnabledClosure = isUserMentionEnabledClosure {
return try await isUserMentionEnabledClosure()
} else {
return isUserMentionEnabledReturnValue
}
}
//MARK: - restoreDefaultRoomNotificationMode
open var restoreDefaultRoomNotificationModeRoomIdThrowableError: Error?
private let restoreDefaultRoomNotificationModeRoomIdCallsCountLock = NSLock()
private var restoreDefaultRoomNotificationModeRoomIdUnderlyingCallsCount = 0
open var restoreDefaultRoomNotificationModeRoomIdCallsCount: Int {
get { restoreDefaultRoomNotificationModeRoomIdCallsCountLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingCallsCount } }
set { restoreDefaultRoomNotificationModeRoomIdCallsCountLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingCallsCount = newValue } }
}
open var restoreDefaultRoomNotificationModeRoomIdCalled: Bool {
return restoreDefaultRoomNotificationModeRoomIdCallsCount > 0
}
private let restoreDefaultRoomNotificationModeRoomIdReceivedRoomIdLock = NSLock()
private var restoreDefaultRoomNotificationModeRoomIdUnderlyingReceivedRoomId: String?
open var restoreDefaultRoomNotificationModeRoomIdReceivedRoomId: String? {
get { restoreDefaultRoomNotificationModeRoomIdReceivedRoomIdLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingReceivedRoomId } }
set { restoreDefaultRoomNotificationModeRoomIdReceivedRoomIdLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let restoreDefaultRoomNotificationModeRoomIdReceivedInvocationsLock = NSLock()
private var restoreDefaultRoomNotificationModeRoomIdUnderlyingReceivedInvocations: [String] = []
open var restoreDefaultRoomNotificationModeRoomIdReceivedInvocations: [String] {
get { restoreDefaultRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingReceivedInvocations } }
set { restoreDefaultRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingReceivedInvocations = newValue } }
}
open var restoreDefaultRoomNotificationModeRoomIdClosure: ((String) async throws -> Void)?
open override func restoreDefaultRoomNotificationMode(roomId: String) async throws {
if let error = restoreDefaultRoomNotificationModeRoomIdThrowableError {
throw error
}
restoreDefaultRoomNotificationModeRoomIdCallsCountLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingCallsCount += 1 }
restoreDefaultRoomNotificationModeRoomIdReceivedRoomId = roomId
restoreDefaultRoomNotificationModeRoomIdReceivedInvocationsLock.withLock { restoreDefaultRoomNotificationModeRoomIdUnderlyingReceivedInvocations.append(roomId) }
try await restoreDefaultRoomNotificationModeRoomIdClosure?(roomId)
}
//MARK: - setCallEnabled
open var setCallEnabledEnabledThrowableError: Error?
private let setCallEnabledEnabledCallsCountLock = NSLock()
private var setCallEnabledEnabledUnderlyingCallsCount = 0
open var setCallEnabledEnabledCallsCount: Int {
get { setCallEnabledEnabledCallsCountLock.withLock { setCallEnabledEnabledUnderlyingCallsCount } }
set { setCallEnabledEnabledCallsCountLock.withLock { setCallEnabledEnabledUnderlyingCallsCount = newValue } }
}
open var setCallEnabledEnabledCalled: Bool {
return setCallEnabledEnabledCallsCount > 0
}
private let setCallEnabledEnabledReceivedEnabledLock = NSLock()
private var setCallEnabledEnabledUnderlyingReceivedEnabled: Bool?
open var setCallEnabledEnabledReceivedEnabled: Bool? {
get { setCallEnabledEnabledReceivedEnabledLock.withLock { setCallEnabledEnabledUnderlyingReceivedEnabled } }
set { setCallEnabledEnabledReceivedEnabledLock.withLock { setCallEnabledEnabledUnderlyingReceivedEnabled = newValue } }
}
private let setCallEnabledEnabledReceivedInvocationsLock = NSLock()
private var setCallEnabledEnabledUnderlyingReceivedInvocations: [Bool] = []
open var setCallEnabledEnabledReceivedInvocations: [Bool] {
get { setCallEnabledEnabledReceivedInvocationsLock.withLock { setCallEnabledEnabledUnderlyingReceivedInvocations } }
set { setCallEnabledEnabledReceivedInvocationsLock.withLock { setCallEnabledEnabledUnderlyingReceivedInvocations = newValue } }
}
open var setCallEnabledEnabledClosure: ((Bool) async throws -> Void)?
open override func setCallEnabled(enabled: Bool) async throws {
if let error = setCallEnabledEnabledThrowableError {
throw error
}
setCallEnabledEnabledCallsCountLock.withLock { setCallEnabledEnabledUnderlyingCallsCount += 1 }
setCallEnabledEnabledReceivedEnabled = enabled
setCallEnabledEnabledReceivedInvocationsLock.withLock { setCallEnabledEnabledUnderlyingReceivedInvocations.append(enabled) }
try await setCallEnabledEnabledClosure?(enabled)
}
//MARK: - setCustomPushRule
open var setCustomPushRuleRuleIdRuleKindActionsConditionsThrowableError: Error?
private let setCustomPushRuleRuleIdRuleKindActionsConditionsCallsCountLock = NSLock()
private var setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingCallsCount = 0
open var setCustomPushRuleRuleIdRuleKindActionsConditionsCallsCount: Int {
get { setCustomPushRuleRuleIdRuleKindActionsConditionsCallsCountLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingCallsCount } }
set { setCustomPushRuleRuleIdRuleKindActionsConditionsCallsCountLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingCallsCount = newValue } }
}
open var setCustomPushRuleRuleIdRuleKindActionsConditionsCalled: Bool {
return setCustomPushRuleRuleIdRuleKindActionsConditionsCallsCount > 0
}
private let setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedArgumentsLock = NSLock()
private var setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingReceivedArguments: (ruleId: String, ruleKind: RuleKind, actions: [Action], conditions: [PushCondition])?
open var setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedArguments: (ruleId: String, ruleKind: RuleKind, actions: [Action], conditions: [PushCondition])? {
get { setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedArgumentsLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingReceivedArguments } }
set { setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedArgumentsLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingReceivedArguments = newValue } }
}
private let setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedInvocationsLock = NSLock()
private var setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingReceivedInvocations: [(ruleId: String, ruleKind: RuleKind, actions: [Action], conditions: [PushCondition])] = []
open var setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedInvocations: [(ruleId: String, ruleKind: RuleKind, actions: [Action], conditions: [PushCondition])] {
get { setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedInvocationsLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingReceivedInvocations } }
set { setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedInvocationsLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingReceivedInvocations = newValue } }
}
open var setCustomPushRuleRuleIdRuleKindActionsConditionsClosure: ((String, RuleKind, [Action], [PushCondition]) async throws -> Void)?
open override func setCustomPushRule(ruleId: String, ruleKind: RuleKind, actions: [Action], conditions: [PushCondition]) async throws {
if let error = setCustomPushRuleRuleIdRuleKindActionsConditionsThrowableError {
throw error
}
setCustomPushRuleRuleIdRuleKindActionsConditionsCallsCountLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingCallsCount += 1 }
setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedArguments = (ruleId: ruleId, ruleKind: ruleKind, actions: actions, conditions: conditions)
setCustomPushRuleRuleIdRuleKindActionsConditionsReceivedInvocationsLock.withLock { setCustomPushRuleRuleIdRuleKindActionsConditionsUnderlyingReceivedInvocations.append((ruleId: ruleId, ruleKind: ruleKind, actions: actions, conditions: conditions)) }
try await setCustomPushRuleRuleIdRuleKindActionsConditionsClosure?(ruleId, ruleKind, actions, conditions)
}
//MARK: - setDefaultRoomNotificationMode
open var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeThrowableError: Error?
private let setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCountLock = NSLock()
private var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount = 0
open var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCount: Int {
get { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCountLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount } }
set { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCountLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount = newValue } }
}
open var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCalled: Bool {
return setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCount > 0
}
private let setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArgumentsLock = NSLock()
private var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationMode)?
open var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArguments: (isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationMode)? {
get { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArgumentsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedArguments } }
set { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArgumentsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedArguments = newValue } }
}
private let setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocationsLock = NSLock()
private var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationMode)] = []
open var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocations: [(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationMode)] {
get { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocationsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations } }
set { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocationsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations = newValue } }
}
open var setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeClosure: ((Bool, Bool, RoomNotificationMode) async throws -> Void)?
open override func setDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationMode) async throws {
if let error = setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeThrowableError {
throw error
}
setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeCallsCountLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingCallsCount += 1 }
setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedArguments = (isEncrypted: isEncrypted, isOneToOne: isOneToOne, mode: mode)
setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeReceivedInvocationsLock.withLock { setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeUnderlyingReceivedInvocations.append((isEncrypted: isEncrypted, isOneToOne: isOneToOne, mode: mode)) }
try await setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeClosure?(isEncrypted, isOneToOne, mode)
}
//MARK: - setDelegate
private let setDelegateDelegateCallsCountLock = NSLock()
private var setDelegateDelegateUnderlyingCallsCount = 0
open var setDelegateDelegateCallsCount: Int {
get { setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount } }
set { setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount = newValue } }
}
open var setDelegateDelegateCalled: Bool {
return setDelegateDelegateCallsCount > 0
}
private let setDelegateDelegateReceivedDelegateLock = NSLock()
private var setDelegateDelegateUnderlyingReceivedDelegate: NotificationSettingsDelegate?
open var setDelegateDelegateReceivedDelegate: NotificationSettingsDelegate? {
get { setDelegateDelegateReceivedDelegateLock.withLock { setDelegateDelegateUnderlyingReceivedDelegate } }
set { setDelegateDelegateReceivedDelegateLock.withLock { setDelegateDelegateUnderlyingReceivedDelegate = newValue } }
}
private let setDelegateDelegateReceivedInvocationsLock = NSLock()
private var setDelegateDelegateUnderlyingReceivedInvocations: [NotificationSettingsDelegate?] = []
open var setDelegateDelegateReceivedInvocations: [NotificationSettingsDelegate?] {
get { setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations } }
set { setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations = newValue } }
}
open var setDelegateDelegateClosure: ((NotificationSettingsDelegate?) -> Void)?
open override func setDelegate(delegate: NotificationSettingsDelegate?) {
setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount += 1 }
setDelegateDelegateReceivedDelegate = delegate
setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations.append(delegate) }
setDelegateDelegateClosure?(delegate)
}
//MARK: - setInviteForMeEnabled
open var setInviteForMeEnabledEnabledThrowableError: Error?
private let setInviteForMeEnabledEnabledCallsCountLock = NSLock()
private var setInviteForMeEnabledEnabledUnderlyingCallsCount = 0
open var setInviteForMeEnabledEnabledCallsCount: Int {
get { setInviteForMeEnabledEnabledCallsCountLock.withLock { setInviteForMeEnabledEnabledUnderlyingCallsCount } }
set { setInviteForMeEnabledEnabledCallsCountLock.withLock { setInviteForMeEnabledEnabledUnderlyingCallsCount = newValue } }
}
open var setInviteForMeEnabledEnabledCalled: Bool {
return setInviteForMeEnabledEnabledCallsCount > 0
}
private let setInviteForMeEnabledEnabledReceivedEnabledLock = NSLock()
private var setInviteForMeEnabledEnabledUnderlyingReceivedEnabled: Bool?
open var setInviteForMeEnabledEnabledReceivedEnabled: Bool? {
get { setInviteForMeEnabledEnabledReceivedEnabledLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedEnabled } }
set { setInviteForMeEnabledEnabledReceivedEnabledLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedEnabled = newValue } }
}
private let setInviteForMeEnabledEnabledReceivedInvocationsLock = NSLock()
private var setInviteForMeEnabledEnabledUnderlyingReceivedInvocations: [Bool] = []
open var setInviteForMeEnabledEnabledReceivedInvocations: [Bool] {
get { setInviteForMeEnabledEnabledReceivedInvocationsLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedInvocations } }
set { setInviteForMeEnabledEnabledReceivedInvocationsLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedInvocations = newValue } }
}
open var setInviteForMeEnabledEnabledClosure: ((Bool) async throws -> Void)?
open override func setInviteForMeEnabled(enabled: Bool) async throws {
if let error = setInviteForMeEnabledEnabledThrowableError {
throw error
}
setInviteForMeEnabledEnabledCallsCountLock.withLock { setInviteForMeEnabledEnabledUnderlyingCallsCount += 1 }
setInviteForMeEnabledEnabledReceivedEnabled = enabled
setInviteForMeEnabledEnabledReceivedInvocationsLock.withLock { setInviteForMeEnabledEnabledUnderlyingReceivedInvocations.append(enabled) }
try await setInviteForMeEnabledEnabledClosure?(enabled)
}
//MARK: - setRoomMentionEnabled
open var setRoomMentionEnabledEnabledThrowableError: Error?
private let setRoomMentionEnabledEnabledCallsCountLock = NSLock()
private var setRoomMentionEnabledEnabledUnderlyingCallsCount = 0
open var setRoomMentionEnabledEnabledCallsCount: Int {
get { setRoomMentionEnabledEnabledCallsCountLock.withLock { setRoomMentionEnabledEnabledUnderlyingCallsCount } }
set { setRoomMentionEnabledEnabledCallsCountLock.withLock { setRoomMentionEnabledEnabledUnderlyingCallsCount = newValue } }
}
open var setRoomMentionEnabledEnabledCalled: Bool {
return setRoomMentionEnabledEnabledCallsCount > 0
}
private let setRoomMentionEnabledEnabledReceivedEnabledLock = NSLock()
private var setRoomMentionEnabledEnabledUnderlyingReceivedEnabled: Bool?
open var setRoomMentionEnabledEnabledReceivedEnabled: Bool? {
get { setRoomMentionEnabledEnabledReceivedEnabledLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedEnabled } }
set { setRoomMentionEnabledEnabledReceivedEnabledLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedEnabled = newValue } }
}
private let setRoomMentionEnabledEnabledReceivedInvocationsLock = NSLock()
private var setRoomMentionEnabledEnabledUnderlyingReceivedInvocations: [Bool] = []
open var setRoomMentionEnabledEnabledReceivedInvocations: [Bool] {
get { setRoomMentionEnabledEnabledReceivedInvocationsLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedInvocations } }
set { setRoomMentionEnabledEnabledReceivedInvocationsLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedInvocations = newValue } }
}
open var setRoomMentionEnabledEnabledClosure: ((Bool) async throws -> Void)?
open override func setRoomMentionEnabled(enabled: Bool) async throws {
if let error = setRoomMentionEnabledEnabledThrowableError {
throw error
}
setRoomMentionEnabledEnabledCallsCountLock.withLock { setRoomMentionEnabledEnabledUnderlyingCallsCount += 1 }
setRoomMentionEnabledEnabledReceivedEnabled = enabled
setRoomMentionEnabledEnabledReceivedInvocationsLock.withLock { setRoomMentionEnabledEnabledUnderlyingReceivedInvocations.append(enabled) }
try await setRoomMentionEnabledEnabledClosure?(enabled)
}
//MARK: - setRoomNotificationMode
open var setRoomNotificationModeRoomIdModeThrowableError: Error?
private let setRoomNotificationModeRoomIdModeCallsCountLock = NSLock()
private var setRoomNotificationModeRoomIdModeUnderlyingCallsCount = 0
open var setRoomNotificationModeRoomIdModeCallsCount: Int {
get { setRoomNotificationModeRoomIdModeCallsCountLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingCallsCount } }
set { setRoomNotificationModeRoomIdModeCallsCountLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingCallsCount = newValue } }
}
open var setRoomNotificationModeRoomIdModeCalled: Bool {
return setRoomNotificationModeRoomIdModeCallsCount > 0
}
private let setRoomNotificationModeRoomIdModeReceivedArgumentsLock = NSLock()
private var setRoomNotificationModeRoomIdModeUnderlyingReceivedArguments: (roomId: String, mode: RoomNotificationMode)?
open var setRoomNotificationModeRoomIdModeReceivedArguments: (roomId: String, mode: RoomNotificationMode)? {
get { setRoomNotificationModeRoomIdModeReceivedArgumentsLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingReceivedArguments } }
set { setRoomNotificationModeRoomIdModeReceivedArgumentsLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingReceivedArguments = newValue } }
}
private let setRoomNotificationModeRoomIdModeReceivedInvocationsLock = NSLock()
private var setRoomNotificationModeRoomIdModeUnderlyingReceivedInvocations: [(roomId: String, mode: RoomNotificationMode)] = []
open var setRoomNotificationModeRoomIdModeReceivedInvocations: [(roomId: String, mode: RoomNotificationMode)] {
get { setRoomNotificationModeRoomIdModeReceivedInvocationsLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingReceivedInvocations } }
set { setRoomNotificationModeRoomIdModeReceivedInvocationsLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingReceivedInvocations = newValue } }
}
open var setRoomNotificationModeRoomIdModeClosure: ((String, RoomNotificationMode) async throws -> Void)?
open override func setRoomNotificationMode(roomId: String, mode: RoomNotificationMode) async throws {
if let error = setRoomNotificationModeRoomIdModeThrowableError {
throw error
}
setRoomNotificationModeRoomIdModeCallsCountLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingCallsCount += 1 }
setRoomNotificationModeRoomIdModeReceivedArguments = (roomId: roomId, mode: mode)
setRoomNotificationModeRoomIdModeReceivedInvocationsLock.withLock { setRoomNotificationModeRoomIdModeUnderlyingReceivedInvocations.append((roomId: roomId, mode: mode)) }
try await setRoomNotificationModeRoomIdModeClosure?(roomId, mode)
}
//MARK: - setUserMentionEnabled
open var setUserMentionEnabledEnabledThrowableError: Error?
private let setUserMentionEnabledEnabledCallsCountLock = NSLock()
private var setUserMentionEnabledEnabledUnderlyingCallsCount = 0
open var setUserMentionEnabledEnabledCallsCount: Int {
get { setUserMentionEnabledEnabledCallsCountLock.withLock { setUserMentionEnabledEnabledUnderlyingCallsCount } }
set { setUserMentionEnabledEnabledCallsCountLock.withLock { setUserMentionEnabledEnabledUnderlyingCallsCount = newValue } }
}
open var setUserMentionEnabledEnabledCalled: Bool {
return setUserMentionEnabledEnabledCallsCount > 0
}
private let setUserMentionEnabledEnabledReceivedEnabledLock = NSLock()
private var setUserMentionEnabledEnabledUnderlyingReceivedEnabled: Bool?
open var setUserMentionEnabledEnabledReceivedEnabled: Bool? {
get { setUserMentionEnabledEnabledReceivedEnabledLock.withLock { setUserMentionEnabledEnabledUnderlyingReceivedEnabled } }
set { setUserMentionEnabledEnabledReceivedEnabledLock.withLock { setUserMentionEnabledEnabledUnderlyingReceivedEnabled = newValue } }
}
private let setUserMentionEnabledEnabledReceivedInvocationsLock = NSLock()
private var setUserMentionEnabledEnabledUnderlyingReceivedInvocations: [Bool] = []
open var setUserMentionEnabledEnabledReceivedInvocations: [Bool] {
get { setUserMentionEnabledEnabledReceivedInvocationsLock.withLock { setUserMentionEnabledEnabledUnderlyingReceivedInvocations } }
set { setUserMentionEnabledEnabledReceivedInvocationsLock.withLock { setUserMentionEnabledEnabledUnderlyingReceivedInvocations = newValue } }
}
open var setUserMentionEnabledEnabledClosure: ((Bool) async throws -> Void)?
open override func setUserMentionEnabled(enabled: Bool) async throws {
if let error = setUserMentionEnabledEnabledThrowableError {
throw error
}
setUserMentionEnabledEnabledCallsCountLock.withLock { setUserMentionEnabledEnabledUnderlyingCallsCount += 1 }
setUserMentionEnabledEnabledReceivedEnabled = enabled
setUserMentionEnabledEnabledReceivedInvocationsLock.withLock { setUserMentionEnabledEnabledUnderlyingReceivedInvocations.append(enabled) }
try await setUserMentionEnabledEnabledClosure?(enabled)
}
//MARK: - unmuteRoom
open var unmuteRoomRoomIdIsEncryptedIsOneToOneThrowableError: Error?
private let unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCountLock = NSLock()
private var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = 0
open var unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCount: Int {
get { unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount } }
set { unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount = newValue } }
}
open var unmuteRoomRoomIdIsEncryptedIsOneToOneCalled: Bool {
return unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCount > 0
}
private let unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock = NSLock()
private var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)?
open var unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArguments: (roomId: String, isEncrypted: Bool, isOneToOne: Bool)? {
get { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments } }
set { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArgumentsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedArguments = newValue } }
}
private let unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock = NSLock()
private var unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] = []
open var unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocations: [(roomId: String, isEncrypted: Bool, isOneToOne: Bool)] {
get { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations } }
set { unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations = newValue } }
}
open var unmuteRoomRoomIdIsEncryptedIsOneToOneClosure: ((String, Bool, Bool) async throws -> Void)?
open override func unmuteRoom(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws {
if let error = unmuteRoomRoomIdIsEncryptedIsOneToOneThrowableError {
throw error
}
unmuteRoomRoomIdIsEncryptedIsOneToOneCallsCountLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingCallsCount += 1 }
unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedArguments = (roomId: roomId, isEncrypted: isEncrypted, isOneToOne: isOneToOne)
unmuteRoomRoomIdIsEncryptedIsOneToOneReceivedInvocationsLock.withLock { unmuteRoomRoomIdIsEncryptedIsOneToOneUnderlyingReceivedInvocations.append((roomId: roomId, isEncrypted: isEncrypted, isOneToOne: isOneToOne)) }
try await unmuteRoomRoomIdIsEncryptedIsOneToOneClosure?(roomId, isEncrypted, isOneToOne)
}
}
open class OAuthAuthorizationDataSDKMock: MatrixRustSDK.OAuthAuthorizationData, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - loginUrl
private let loginUrlCallsCountLock = NSLock()
private var loginUrlUnderlyingCallsCount = 0
open var loginUrlCallsCount: Int {
get { loginUrlCallsCountLock.withLock { loginUrlUnderlyingCallsCount } }
set { loginUrlCallsCountLock.withLock { loginUrlUnderlyingCallsCount = newValue } }
}
open var loginUrlCalled: Bool {
return loginUrlCallsCount > 0
}
private let loginUrlReturnValueLock = NSLock()
open var loginUrlUnderlyingReturnValue: String!
open var loginUrlReturnValue: String! {
get { loginUrlReturnValueLock.withLock { loginUrlUnderlyingReturnValue } }
set { loginUrlReturnValueLock.withLock { loginUrlUnderlyingReturnValue = newValue } }
}
open var loginUrlClosure: (() -> String)?
open override func loginUrl() -> String {
loginUrlCallsCountLock.withLock { loginUrlUnderlyingCallsCount += 1 }
if let loginUrlClosure = loginUrlClosure {
return loginUrlClosure()
} else {
return loginUrlReturnValue
}
}
}
open class PasswordStrengthEstimatorSDKMock: MatrixRustSDK.PasswordStrengthEstimator, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
static func reset()
{
}
//MARK: - estimate
private let estimatePasswordUserInputsCallsCountLock = NSLock()
private var estimatePasswordUserInputsUnderlyingCallsCount = 0
open var estimatePasswordUserInputsCallsCount: Int {
get { estimatePasswordUserInputsCallsCountLock.withLock { estimatePasswordUserInputsUnderlyingCallsCount } }
set { estimatePasswordUserInputsCallsCountLock.withLock { estimatePasswordUserInputsUnderlyingCallsCount = newValue } }
}
open var estimatePasswordUserInputsCalled: Bool {
return estimatePasswordUserInputsCallsCount > 0
}
private let estimatePasswordUserInputsReceivedArgumentsLock = NSLock()
private var estimatePasswordUserInputsUnderlyingReceivedArguments: (password: String, userInputs: [String])?
open var estimatePasswordUserInputsReceivedArguments: (password: String, userInputs: [String])? {
get { estimatePasswordUserInputsReceivedArgumentsLock.withLock { estimatePasswordUserInputsUnderlyingReceivedArguments } }
set { estimatePasswordUserInputsReceivedArgumentsLock.withLock { estimatePasswordUserInputsUnderlyingReceivedArguments = newValue } }
}
private let estimatePasswordUserInputsReceivedInvocationsLock = NSLock()
private var estimatePasswordUserInputsUnderlyingReceivedInvocations: [(password: String, userInputs: [String])] = []
open var estimatePasswordUserInputsReceivedInvocations: [(password: String, userInputs: [String])] {
get { estimatePasswordUserInputsReceivedInvocationsLock.withLock { estimatePasswordUserInputsUnderlyingReceivedInvocations } }
set { estimatePasswordUserInputsReceivedInvocationsLock.withLock { estimatePasswordUserInputsUnderlyingReceivedInvocations = newValue } }
}
private let estimatePasswordUserInputsReturnValueLock = NSLock()
open var estimatePasswordUserInputsUnderlyingReturnValue: PasswordStrengthEstimate!
open var estimatePasswordUserInputsReturnValue: PasswordStrengthEstimate! {
get { estimatePasswordUserInputsReturnValueLock.withLock { estimatePasswordUserInputsUnderlyingReturnValue } }
set { estimatePasswordUserInputsReturnValueLock.withLock { estimatePasswordUserInputsUnderlyingReturnValue = newValue } }
}
open var estimatePasswordUserInputsClosure: ((String, [String]) -> PasswordStrengthEstimate)?
open override func estimate(password: String, userInputs: [String]) -> PasswordStrengthEstimate {
estimatePasswordUserInputsCallsCountLock.withLock { estimatePasswordUserInputsUnderlyingCallsCount += 1 }
estimatePasswordUserInputsReceivedArguments = (password: password, userInputs: userInputs)
estimatePasswordUserInputsReceivedInvocationsLock.withLock { estimatePasswordUserInputsUnderlyingReceivedInvocations.append((password: password, userInputs: userInputs)) }
if let estimatePasswordUserInputsClosure = estimatePasswordUserInputsClosure {
return estimatePasswordUserInputsClosure(password, userInputs)
} else {
return estimatePasswordUserInputsReturnValue
}
}
//MARK: - thresholds
private let thresholdsCallsCountLock = NSLock()
private var thresholdsUnderlyingCallsCount = 0
open var thresholdsCallsCount: Int {
get { thresholdsCallsCountLock.withLock { thresholdsUnderlyingCallsCount } }
set { thresholdsCallsCountLock.withLock { thresholdsUnderlyingCallsCount = newValue } }
}
open var thresholdsCalled: Bool {
return thresholdsCallsCount > 0
}
private let thresholdsReturnValueLock = NSLock()
open var thresholdsUnderlyingReturnValue: PasswordStrengthThresholds!
open var thresholdsReturnValue: PasswordStrengthThresholds! {
get { thresholdsReturnValueLock.withLock { thresholdsUnderlyingReturnValue } }
set { thresholdsReturnValueLock.withLock { thresholdsUnderlyingReturnValue = newValue } }
}
open var thresholdsClosure: (() -> PasswordStrengthThresholds)?
open override func thresholds() -> PasswordStrengthThresholds {
thresholdsCallsCountLock.withLock { thresholdsUnderlyingCallsCount += 1 }
if let thresholdsClosure = thresholdsClosure {
return thresholdsClosure()
} else {
return thresholdsReturnValue
}
}
}
open class PrivateStringSDKMock: MatrixRustSDK.PrivateString, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
}
open class QrCodeDataSDKMock: MatrixRustSDK.QrCodeData, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
static func reset()
{
}
//MARK: - baseUrl
private let baseUrlCallsCountLock = NSLock()
private var baseUrlUnderlyingCallsCount = 0
open var baseUrlCallsCount: Int {
get { baseUrlCallsCountLock.withLock { baseUrlUnderlyingCallsCount } }
set { baseUrlCallsCountLock.withLock { baseUrlUnderlyingCallsCount = newValue } }
}
open var baseUrlCalled: Bool {
return baseUrlCallsCount > 0
}
private let baseUrlReturnValueLock = NSLock()
open var baseUrlUnderlyingReturnValue: String?
open var baseUrlReturnValue: String? {
get { baseUrlReturnValueLock.withLock { baseUrlUnderlyingReturnValue } }
set { baseUrlReturnValueLock.withLock { baseUrlUnderlyingReturnValue = newValue } }
}
open var baseUrlClosure: (() -> String?)?
open override func baseUrl() -> String? {
baseUrlCallsCountLock.withLock { baseUrlUnderlyingCallsCount += 1 }
if let baseUrlClosure = baseUrlClosure {
return baseUrlClosure()
} else {
return baseUrlReturnValue
}
}
//MARK: - intent
private let intentCallsCountLock = NSLock()
private var intentUnderlyingCallsCount = 0
open var intentCallsCount: Int {
get { intentCallsCountLock.withLock { intentUnderlyingCallsCount } }
set { intentCallsCountLock.withLock { intentUnderlyingCallsCount = newValue } }
}
open var intentCalled: Bool {
return intentCallsCount > 0
}
private let intentReturnValueLock = NSLock()
open var intentUnderlyingReturnValue: QrCodeIntent!
open var intentReturnValue: QrCodeIntent! {
get { intentReturnValueLock.withLock { intentUnderlyingReturnValue } }
set { intentReturnValueLock.withLock { intentUnderlyingReturnValue = newValue } }
}
open var intentClosure: (() -> QrCodeIntent)?
open override func intent() -> QrCodeIntent {
intentCallsCountLock.withLock { intentUnderlyingCallsCount += 1 }
if let intentClosure = intentClosure {
return intentClosure()
} else {
return intentReturnValue
}
}
//MARK: - serverName
private let serverNameCallsCountLock = NSLock()
private var serverNameUnderlyingCallsCount = 0
open var serverNameCallsCount: Int {
get { serverNameCallsCountLock.withLock { serverNameUnderlyingCallsCount } }
set { serverNameCallsCountLock.withLock { serverNameUnderlyingCallsCount = newValue } }
}
open var serverNameCalled: Bool {
return serverNameCallsCount > 0
}
private let serverNameReturnValueLock = NSLock()
open var serverNameUnderlyingReturnValue: String?
open var serverNameReturnValue: String? {
get { serverNameReturnValueLock.withLock { serverNameUnderlyingReturnValue } }
set { serverNameReturnValueLock.withLock { serverNameUnderlyingReturnValue = newValue } }
}
open var serverNameClosure: (() -> String?)?
open override func serverName() -> String? {
serverNameCallsCountLock.withLock { serverNameUnderlyingCallsCount += 1 }
if let serverNameClosure = serverNameClosure {
return serverNameClosure()
} else {
return serverNameReturnValue
}
}
//MARK: - toBytes
private let toBytesCallsCountLock = NSLock()
private var toBytesUnderlyingCallsCount = 0
open var toBytesCallsCount: Int {
get { toBytesCallsCountLock.withLock { toBytesUnderlyingCallsCount } }
set { toBytesCallsCountLock.withLock { toBytesUnderlyingCallsCount = newValue } }
}
open var toBytesCalled: Bool {
return toBytesCallsCount > 0
}
private let toBytesReturnValueLock = NSLock()
open var toBytesUnderlyingReturnValue: Data!
open var toBytesReturnValue: Data! {
get { toBytesReturnValueLock.withLock { toBytesUnderlyingReturnValue } }
set { toBytesReturnValueLock.withLock { toBytesUnderlyingReturnValue = newValue } }
}
open var toBytesClosure: (() -> Data)?
open override func toBytes() -> Data {
toBytesCallsCountLock.withLock { toBytesUnderlyingCallsCount += 1 }
if let toBytesClosure = toBytesClosure {
return toBytesClosure()
} else {
return toBytesReturnValue
}
}
}
open class RoomSDKMock: MatrixRustSDK.Room, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - activeHumanMemberIds
open var activeHumanMemberIdsThrowableError: Error?
private let activeHumanMemberIdsCallsCountLock = NSLock()
private var activeHumanMemberIdsUnderlyingCallsCount = 0
open var activeHumanMemberIdsCallsCount: Int {
get { activeHumanMemberIdsCallsCountLock.withLock { activeHumanMemberIdsUnderlyingCallsCount } }
set { activeHumanMemberIdsCallsCountLock.withLock { activeHumanMemberIdsUnderlyingCallsCount = newValue } }
}
open var activeHumanMemberIdsCalled: Bool {
return activeHumanMemberIdsCallsCount > 0
}
private let activeHumanMemberIdsReturnValueLock = NSLock()
open var activeHumanMemberIdsUnderlyingReturnValue: [String]!
open var activeHumanMemberIdsReturnValue: [String]! {
get { activeHumanMemberIdsReturnValueLock.withLock { activeHumanMemberIdsUnderlyingReturnValue } }
set { activeHumanMemberIdsReturnValueLock.withLock { activeHumanMemberIdsUnderlyingReturnValue = newValue } }
}
open var activeHumanMemberIdsClosure: (() async throws -> [String])?
open override func activeHumanMemberIds() async throws -> [String] {
if let error = activeHumanMemberIdsThrowableError {
throw error
}
activeHumanMemberIdsCallsCountLock.withLock { activeHumanMemberIdsUnderlyingCallsCount += 1 }
if let activeHumanMemberIdsClosure = activeHumanMemberIdsClosure {
return try await activeHumanMemberIdsClosure()
} else {
return activeHumanMemberIdsReturnValue
}
}
//MARK: - activeHumanMemberIdsNoSync
open var activeHumanMemberIdsNoSyncThrowableError: Error?
private let activeHumanMemberIdsNoSyncCallsCountLock = NSLock()
private var activeHumanMemberIdsNoSyncUnderlyingCallsCount = 0
open var activeHumanMemberIdsNoSyncCallsCount: Int {
get { activeHumanMemberIdsNoSyncCallsCountLock.withLock { activeHumanMemberIdsNoSyncUnderlyingCallsCount } }
set { activeHumanMemberIdsNoSyncCallsCountLock.withLock { activeHumanMemberIdsNoSyncUnderlyingCallsCount = newValue } }
}
open var activeHumanMemberIdsNoSyncCalled: Bool {
return activeHumanMemberIdsNoSyncCallsCount > 0
}
private let activeHumanMemberIdsNoSyncReturnValueLock = NSLock()
open var activeHumanMemberIdsNoSyncUnderlyingReturnValue: [String]!
open var activeHumanMemberIdsNoSyncReturnValue: [String]! {
get { activeHumanMemberIdsNoSyncReturnValueLock.withLock { activeHumanMemberIdsNoSyncUnderlyingReturnValue } }
set { activeHumanMemberIdsNoSyncReturnValueLock.withLock { activeHumanMemberIdsNoSyncUnderlyingReturnValue = newValue } }
}
open var activeHumanMemberIdsNoSyncClosure: (() async throws -> [String])?
open override func activeHumanMemberIdsNoSync() async throws -> [String] {
if let error = activeHumanMemberIdsNoSyncThrowableError {
throw error
}
activeHumanMemberIdsNoSyncCallsCountLock.withLock { activeHumanMemberIdsNoSyncUnderlyingCallsCount += 1 }
if let activeHumanMemberIdsNoSyncClosure = activeHumanMemberIdsNoSyncClosure {
return try await activeHumanMemberIdsNoSyncClosure()
} else {
return activeHumanMemberIdsNoSyncReturnValue
}
}
//MARK: - activeMembersCount
private let activeMembersCountCallsCountLock = NSLock()
private var activeMembersCountUnderlyingCallsCount = 0
open var activeMembersCountCallsCount: Int {
get { activeMembersCountCallsCountLock.withLock { activeMembersCountUnderlyingCallsCount } }
set { activeMembersCountCallsCountLock.withLock { activeMembersCountUnderlyingCallsCount = newValue } }
}
open var activeMembersCountCalled: Bool {
return activeMembersCountCallsCount > 0
}
private let activeMembersCountReturnValueLock = NSLock()
open var activeMembersCountUnderlyingReturnValue: UInt64!
open var activeMembersCountReturnValue: UInt64! {
get { activeMembersCountReturnValueLock.withLock { activeMembersCountUnderlyingReturnValue } }
set { activeMembersCountReturnValueLock.withLock { activeMembersCountUnderlyingReturnValue = newValue } }
}
open var activeMembersCountClosure: (() -> UInt64)?
open override func activeMembersCount() -> UInt64 {
activeMembersCountCallsCountLock.withLock { activeMembersCountUnderlyingCallsCount += 1 }
if let activeMembersCountClosure = activeMembersCountClosure {
return activeMembersCountClosure()
} else {
return activeMembersCountReturnValue
}
}
//MARK: - activeRoomCallParticipants
private let activeRoomCallParticipantsCallsCountLock = NSLock()
private var activeRoomCallParticipantsUnderlyingCallsCount = 0
open var activeRoomCallParticipantsCallsCount: Int {
get { activeRoomCallParticipantsCallsCountLock.withLock { activeRoomCallParticipantsUnderlyingCallsCount } }
set { activeRoomCallParticipantsCallsCountLock.withLock { activeRoomCallParticipantsUnderlyingCallsCount = newValue } }
}
open var activeRoomCallParticipantsCalled: Bool {
return activeRoomCallParticipantsCallsCount > 0
}
private let activeRoomCallParticipantsReturnValueLock = NSLock()
open var activeRoomCallParticipantsUnderlyingReturnValue: [String]!
open var activeRoomCallParticipantsReturnValue: [String]! {
get { activeRoomCallParticipantsReturnValueLock.withLock { activeRoomCallParticipantsUnderlyingReturnValue } }
set { activeRoomCallParticipantsReturnValueLock.withLock { activeRoomCallParticipantsUnderlyingReturnValue = newValue } }
}
open var activeRoomCallParticipantsClosure: (() -> [String])?
open override func activeRoomCallParticipants() -> [String] {
activeRoomCallParticipantsCallsCountLock.withLock { activeRoomCallParticipantsUnderlyingCallsCount += 1 }
if let activeRoomCallParticipantsClosure = activeRoomCallParticipantsClosure {
return activeRoomCallParticipantsClosure()
} else {
return activeRoomCallParticipantsReturnValue
}
}
//MARK: - alternativeAliases
private let alternativeAliasesCallsCountLock = NSLock()
private var alternativeAliasesUnderlyingCallsCount = 0
open var alternativeAliasesCallsCount: Int {
get { alternativeAliasesCallsCountLock.withLock { alternativeAliasesUnderlyingCallsCount } }
set { alternativeAliasesCallsCountLock.withLock { alternativeAliasesUnderlyingCallsCount = newValue } }
}
open var alternativeAliasesCalled: Bool {
return alternativeAliasesCallsCount > 0
}
private let alternativeAliasesReturnValueLock = NSLock()
open var alternativeAliasesUnderlyingReturnValue: [String]!
open var alternativeAliasesReturnValue: [String]! {
get { alternativeAliasesReturnValueLock.withLock { alternativeAliasesUnderlyingReturnValue } }
set { alternativeAliasesReturnValueLock.withLock { alternativeAliasesUnderlyingReturnValue = newValue } }
}
open var alternativeAliasesClosure: (() -> [String])?
open override func alternativeAliases() -> [String] {
alternativeAliasesCallsCountLock.withLock { alternativeAliasesUnderlyingCallsCount += 1 }
if let alternativeAliasesClosure = alternativeAliasesClosure {
return alternativeAliasesClosure()
} else {
return alternativeAliasesReturnValue
}
}
//MARK: - applyPowerLevelChanges
open var applyPowerLevelChangesChangesThrowableError: Error?
private let applyPowerLevelChangesChangesCallsCountLock = NSLock()
private var applyPowerLevelChangesChangesUnderlyingCallsCount = 0
open var applyPowerLevelChangesChangesCallsCount: Int {
get { applyPowerLevelChangesChangesCallsCountLock.withLock { applyPowerLevelChangesChangesUnderlyingCallsCount } }
set { applyPowerLevelChangesChangesCallsCountLock.withLock { applyPowerLevelChangesChangesUnderlyingCallsCount = newValue } }
}
open var applyPowerLevelChangesChangesCalled: Bool {
return applyPowerLevelChangesChangesCallsCount > 0
}
private let applyPowerLevelChangesChangesReceivedChangesLock = NSLock()
private var applyPowerLevelChangesChangesUnderlyingReceivedChanges: RoomPowerLevelChanges?
open var applyPowerLevelChangesChangesReceivedChanges: RoomPowerLevelChanges? {
get { applyPowerLevelChangesChangesReceivedChangesLock.withLock { applyPowerLevelChangesChangesUnderlyingReceivedChanges } }
set { applyPowerLevelChangesChangesReceivedChangesLock.withLock { applyPowerLevelChangesChangesUnderlyingReceivedChanges = newValue } }
}
private let applyPowerLevelChangesChangesReceivedInvocationsLock = NSLock()
private var applyPowerLevelChangesChangesUnderlyingReceivedInvocations: [RoomPowerLevelChanges] = []
open var applyPowerLevelChangesChangesReceivedInvocations: [RoomPowerLevelChanges] {
get { applyPowerLevelChangesChangesReceivedInvocationsLock.withLock { applyPowerLevelChangesChangesUnderlyingReceivedInvocations } }
set { applyPowerLevelChangesChangesReceivedInvocationsLock.withLock { applyPowerLevelChangesChangesUnderlyingReceivedInvocations = newValue } }
}
open var applyPowerLevelChangesChangesClosure: ((RoomPowerLevelChanges) async throws -> Void)?
open override func applyPowerLevelChanges(changes: RoomPowerLevelChanges) async throws {
if let error = applyPowerLevelChangesChangesThrowableError {
throw error
}
applyPowerLevelChangesChangesCallsCountLock.withLock { applyPowerLevelChangesChangesUnderlyingCallsCount += 1 }
applyPowerLevelChangesChangesReceivedChanges = changes
applyPowerLevelChangesChangesReceivedInvocationsLock.withLock { applyPowerLevelChangesChangesUnderlyingReceivedInvocations.append(changes) }
try await applyPowerLevelChangesChangesClosure?(changes)
}
//MARK: - avatarUrl
private let avatarUrlCallsCountLock = NSLock()
private var avatarUrlUnderlyingCallsCount = 0
open var avatarUrlCallsCount: Int {
get { avatarUrlCallsCountLock.withLock { avatarUrlUnderlyingCallsCount } }
set { avatarUrlCallsCountLock.withLock { avatarUrlUnderlyingCallsCount = newValue } }
}
open var avatarUrlCalled: Bool {
return avatarUrlCallsCount > 0
}
private let avatarUrlReturnValueLock = NSLock()
open var avatarUrlUnderlyingReturnValue: String?
open var avatarUrlReturnValue: String? {
get { avatarUrlReturnValueLock.withLock { avatarUrlUnderlyingReturnValue } }
set { avatarUrlReturnValueLock.withLock { avatarUrlUnderlyingReturnValue = newValue } }
}
open var avatarUrlClosure: (() -> String?)?
open override func avatarUrl() -> String? {
avatarUrlCallsCountLock.withLock { avatarUrlUnderlyingCallsCount += 1 }
if let avatarUrlClosure = avatarUrlClosure {
return avatarUrlClosure()
} else {
return avatarUrlReturnValue
}
}
//MARK: - banUser
open var banUserUserIdReasonThrowableError: Error?
private let banUserUserIdReasonCallsCountLock = NSLock()
private var banUserUserIdReasonUnderlyingCallsCount = 0
open var banUserUserIdReasonCallsCount: Int {
get { banUserUserIdReasonCallsCountLock.withLock { banUserUserIdReasonUnderlyingCallsCount } }
set { banUserUserIdReasonCallsCountLock.withLock { banUserUserIdReasonUnderlyingCallsCount = newValue } }
}
open var banUserUserIdReasonCalled: Bool {
return banUserUserIdReasonCallsCount > 0
}
private let banUserUserIdReasonReceivedArgumentsLock = NSLock()
private var banUserUserIdReasonUnderlyingReceivedArguments: (userId: String, reason: String?)?
open var banUserUserIdReasonReceivedArguments: (userId: String, reason: String?)? {
get { banUserUserIdReasonReceivedArgumentsLock.withLock { banUserUserIdReasonUnderlyingReceivedArguments } }
set { banUserUserIdReasonReceivedArgumentsLock.withLock { banUserUserIdReasonUnderlyingReceivedArguments = newValue } }
}
private let banUserUserIdReasonReceivedInvocationsLock = NSLock()
private var banUserUserIdReasonUnderlyingReceivedInvocations: [(userId: String, reason: String?)] = []
open var banUserUserIdReasonReceivedInvocations: [(userId: String, reason: String?)] {
get { banUserUserIdReasonReceivedInvocationsLock.withLock { banUserUserIdReasonUnderlyingReceivedInvocations } }
set { banUserUserIdReasonReceivedInvocationsLock.withLock { banUserUserIdReasonUnderlyingReceivedInvocations = newValue } }
}
open var banUserUserIdReasonClosure: ((String, String?) async throws -> Void)?
open override func banUser(userId: String, reason: String?) async throws {
if let error = banUserUserIdReasonThrowableError {
throw error
}
banUserUserIdReasonCallsCountLock.withLock { banUserUserIdReasonUnderlyingCallsCount += 1 }
banUserUserIdReasonReceivedArguments = (userId: userId, reason: reason)
banUserUserIdReasonReceivedInvocationsLock.withLock { banUserUserIdReasonUnderlyingReceivedInvocations.append((userId: userId, reason: reason)) }
try await banUserUserIdReasonClosure?(userId, reason)
}
//MARK: - canonicalAlias
private let canonicalAliasCallsCountLock = NSLock()
private var canonicalAliasUnderlyingCallsCount = 0
open var canonicalAliasCallsCount: Int {
get { canonicalAliasCallsCountLock.withLock { canonicalAliasUnderlyingCallsCount } }
set { canonicalAliasCallsCountLock.withLock { canonicalAliasUnderlyingCallsCount = newValue } }
}
open var canonicalAliasCalled: Bool {
return canonicalAliasCallsCount > 0
}
private let canonicalAliasReturnValueLock = NSLock()
open var canonicalAliasUnderlyingReturnValue: String?
open var canonicalAliasReturnValue: String? {
get { canonicalAliasReturnValueLock.withLock { canonicalAliasUnderlyingReturnValue } }
set { canonicalAliasReturnValueLock.withLock { canonicalAliasUnderlyingReturnValue = newValue } }
}
open var canonicalAliasClosure: (() -> String?)?
open override func canonicalAlias() -> String? {
canonicalAliasCallsCountLock.withLock { canonicalAliasUnderlyingCallsCount += 1 }
if let canonicalAliasClosure = canonicalAliasClosure {
return canonicalAliasClosure()
} else {
return canonicalAliasReturnValue
}
}
//MARK: - clearComposerDraft
open var clearComposerDraftThreadRootThrowableError: Error?
private let clearComposerDraftThreadRootCallsCountLock = NSLock()
private var clearComposerDraftThreadRootUnderlyingCallsCount = 0
open var clearComposerDraftThreadRootCallsCount: Int {
get { clearComposerDraftThreadRootCallsCountLock.withLock { clearComposerDraftThreadRootUnderlyingCallsCount } }
set { clearComposerDraftThreadRootCallsCountLock.withLock { clearComposerDraftThreadRootUnderlyingCallsCount = newValue } }
}
open var clearComposerDraftThreadRootCalled: Bool {
return clearComposerDraftThreadRootCallsCount > 0
}
private let clearComposerDraftThreadRootReceivedThreadRootLock = NSLock()
private var clearComposerDraftThreadRootUnderlyingReceivedThreadRoot: String?
open var clearComposerDraftThreadRootReceivedThreadRoot: String? {
get { clearComposerDraftThreadRootReceivedThreadRootLock.withLock { clearComposerDraftThreadRootUnderlyingReceivedThreadRoot } }
set { clearComposerDraftThreadRootReceivedThreadRootLock.withLock { clearComposerDraftThreadRootUnderlyingReceivedThreadRoot = newValue } }
}
private let clearComposerDraftThreadRootReceivedInvocationsLock = NSLock()
private var clearComposerDraftThreadRootUnderlyingReceivedInvocations: [String?] = []
open var clearComposerDraftThreadRootReceivedInvocations: [String?] {
get { clearComposerDraftThreadRootReceivedInvocationsLock.withLock { clearComposerDraftThreadRootUnderlyingReceivedInvocations } }
set { clearComposerDraftThreadRootReceivedInvocationsLock.withLock { clearComposerDraftThreadRootUnderlyingReceivedInvocations = newValue } }
}
open var clearComposerDraftThreadRootClosure: ((String?) async throws -> Void)?
open override func clearComposerDraft(threadRoot: String?) async throws {
if let error = clearComposerDraftThreadRootThrowableError {
throw error
}
clearComposerDraftThreadRootCallsCountLock.withLock { clearComposerDraftThreadRootUnderlyingCallsCount += 1 }
clearComposerDraftThreadRootReceivedThreadRoot = threadRoot
clearComposerDraftThreadRootReceivedInvocationsLock.withLock { clearComposerDraftThreadRootUnderlyingReceivedInvocations.append(threadRoot) }
try await clearComposerDraftThreadRootClosure?(threadRoot)
}
//MARK: - declineCall
open var declineCallRtcNotificationEventIdThrowableError: Error?
private let declineCallRtcNotificationEventIdCallsCountLock = NSLock()
private var declineCallRtcNotificationEventIdUnderlyingCallsCount = 0
open var declineCallRtcNotificationEventIdCallsCount: Int {
get { declineCallRtcNotificationEventIdCallsCountLock.withLock { declineCallRtcNotificationEventIdUnderlyingCallsCount } }
set { declineCallRtcNotificationEventIdCallsCountLock.withLock { declineCallRtcNotificationEventIdUnderlyingCallsCount = newValue } }
}
open var declineCallRtcNotificationEventIdCalled: Bool {
return declineCallRtcNotificationEventIdCallsCount > 0
}
private let declineCallRtcNotificationEventIdReceivedRtcNotificationEventIdLock = NSLock()
private var declineCallRtcNotificationEventIdUnderlyingReceivedRtcNotificationEventId: String?
open var declineCallRtcNotificationEventIdReceivedRtcNotificationEventId: String? {
get { declineCallRtcNotificationEventIdReceivedRtcNotificationEventIdLock.withLock { declineCallRtcNotificationEventIdUnderlyingReceivedRtcNotificationEventId } }
set { declineCallRtcNotificationEventIdReceivedRtcNotificationEventIdLock.withLock { declineCallRtcNotificationEventIdUnderlyingReceivedRtcNotificationEventId = newValue } }
}
private let declineCallRtcNotificationEventIdReceivedInvocationsLock = NSLock()
private var declineCallRtcNotificationEventIdUnderlyingReceivedInvocations: [String] = []
open var declineCallRtcNotificationEventIdReceivedInvocations: [String] {
get { declineCallRtcNotificationEventIdReceivedInvocationsLock.withLock { declineCallRtcNotificationEventIdUnderlyingReceivedInvocations } }
set { declineCallRtcNotificationEventIdReceivedInvocationsLock.withLock { declineCallRtcNotificationEventIdUnderlyingReceivedInvocations = newValue } }
}
open var declineCallRtcNotificationEventIdClosure: ((String) async throws -> Void)?
open override func declineCall(rtcNotificationEventId: String) async throws {
if let error = declineCallRtcNotificationEventIdThrowableError {
throw error
}
declineCallRtcNotificationEventIdCallsCountLock.withLock { declineCallRtcNotificationEventIdUnderlyingCallsCount += 1 }
declineCallRtcNotificationEventIdReceivedRtcNotificationEventId = rtcNotificationEventId
declineCallRtcNotificationEventIdReceivedInvocationsLock.withLock { declineCallRtcNotificationEventIdUnderlyingReceivedInvocations.append(rtcNotificationEventId) }
try await declineCallRtcNotificationEventIdClosure?(rtcNotificationEventId)
}
//MARK: - discardRoomKey
open var discardRoomKeyThrowableError: Error?
private let discardRoomKeyCallsCountLock = NSLock()
private var discardRoomKeyUnderlyingCallsCount = 0
open var discardRoomKeyCallsCount: Int {
get { discardRoomKeyCallsCountLock.withLock { discardRoomKeyUnderlyingCallsCount } }
set { discardRoomKeyCallsCountLock.withLock { discardRoomKeyUnderlyingCallsCount = newValue } }
}
open var discardRoomKeyCalled: Bool {
return discardRoomKeyCallsCount > 0
}
open var discardRoomKeyClosure: (() async throws -> Void)?
open override func discardRoomKey() async throws {
if let error = discardRoomKeyThrowableError {
throw error
}
discardRoomKeyCallsCountLock.withLock { discardRoomKeyUnderlyingCallsCount += 1 }
try await discardRoomKeyClosure?()
}
//MARK: - displayName
private let displayNameCallsCountLock = NSLock()
private var displayNameUnderlyingCallsCount = 0
open var displayNameCallsCount: Int {
get { displayNameCallsCountLock.withLock { displayNameUnderlyingCallsCount } }
set { displayNameCallsCountLock.withLock { displayNameUnderlyingCallsCount = newValue } }
}
open var displayNameCalled: Bool {
return displayNameCallsCount > 0
}
private let displayNameReturnValueLock = NSLock()
open var displayNameUnderlyingReturnValue: String?
open var displayNameReturnValue: String? {
get { displayNameReturnValueLock.withLock { displayNameUnderlyingReturnValue } }
set { displayNameReturnValueLock.withLock { displayNameUnderlyingReturnValue = newValue } }
}
open var displayNameClosure: (() -> String?)?
open override func displayName() -> String? {
displayNameCallsCountLock.withLock { displayNameUnderlyingCallsCount += 1 }
if let displayNameClosure = displayNameClosure {
return displayNameClosure()
} else {
return displayNameReturnValue
}
}
//MARK: - edit
open var editEventIdNewContentThrowableError: Error?
private let editEventIdNewContentCallsCountLock = NSLock()
private var editEventIdNewContentUnderlyingCallsCount = 0
open var editEventIdNewContentCallsCount: Int {
get { editEventIdNewContentCallsCountLock.withLock { editEventIdNewContentUnderlyingCallsCount } }
set { editEventIdNewContentCallsCountLock.withLock { editEventIdNewContentUnderlyingCallsCount = newValue } }
}
open var editEventIdNewContentCalled: Bool {
return editEventIdNewContentCallsCount > 0
}
private let editEventIdNewContentReceivedArgumentsLock = NSLock()
private var editEventIdNewContentUnderlyingReceivedArguments: (eventId: String, newContent: RoomMessageEventContentWithoutRelation)?
open var editEventIdNewContentReceivedArguments: (eventId: String, newContent: RoomMessageEventContentWithoutRelation)? {
get { editEventIdNewContentReceivedArgumentsLock.withLock { editEventIdNewContentUnderlyingReceivedArguments } }
set { editEventIdNewContentReceivedArgumentsLock.withLock { editEventIdNewContentUnderlyingReceivedArguments = newValue } }
}
private let editEventIdNewContentReceivedInvocationsLock = NSLock()
private var editEventIdNewContentUnderlyingReceivedInvocations: [(eventId: String, newContent: RoomMessageEventContentWithoutRelation)] = []
open var editEventIdNewContentReceivedInvocations: [(eventId: String, newContent: RoomMessageEventContentWithoutRelation)] {
get { editEventIdNewContentReceivedInvocationsLock.withLock { editEventIdNewContentUnderlyingReceivedInvocations } }
set { editEventIdNewContentReceivedInvocationsLock.withLock { editEventIdNewContentUnderlyingReceivedInvocations = newValue } }
}
open var editEventIdNewContentClosure: ((String, RoomMessageEventContentWithoutRelation) async throws -> Void)?
open override func edit(eventId: String, newContent: RoomMessageEventContentWithoutRelation) async throws {
if let error = editEventIdNewContentThrowableError {
throw error
}
editEventIdNewContentCallsCountLock.withLock { editEventIdNewContentUnderlyingCallsCount += 1 }
editEventIdNewContentReceivedArguments = (eventId: eventId, newContent: newContent)
editEventIdNewContentReceivedInvocationsLock.withLock { editEventIdNewContentUnderlyingReceivedInvocations.append((eventId: eventId, newContent: newContent)) }
try await editEventIdNewContentClosure?(eventId, newContent)
}
//MARK: - enableEncryption
open var enableEncryptionThrowableError: Error?
private let enableEncryptionCallsCountLock = NSLock()
private var enableEncryptionUnderlyingCallsCount = 0
open var enableEncryptionCallsCount: Int {
get { enableEncryptionCallsCountLock.withLock { enableEncryptionUnderlyingCallsCount } }
set { enableEncryptionCallsCountLock.withLock { enableEncryptionUnderlyingCallsCount = newValue } }
}
open var enableEncryptionCalled: Bool {
return enableEncryptionCallsCount > 0
}
open var enableEncryptionClosure: (() async throws -> Void)?
open override func enableEncryption() async throws {
if let error = enableEncryptionThrowableError {
throw error
}
enableEncryptionCallsCountLock.withLock { enableEncryptionUnderlyingCallsCount += 1 }
try await enableEncryptionClosure?()
}
//MARK: - enableSendQueue
private let enableSendQueueEnableCallsCountLock = NSLock()
private var enableSendQueueEnableUnderlyingCallsCount = 0
open var enableSendQueueEnableCallsCount: Int {
get { enableSendQueueEnableCallsCountLock.withLock { enableSendQueueEnableUnderlyingCallsCount } }
set { enableSendQueueEnableCallsCountLock.withLock { enableSendQueueEnableUnderlyingCallsCount = newValue } }
}
open var enableSendQueueEnableCalled: Bool {
return enableSendQueueEnableCallsCount > 0
}
private let enableSendQueueEnableReceivedEnableLock = NSLock()
private var enableSendQueueEnableUnderlyingReceivedEnable: Bool?
open var enableSendQueueEnableReceivedEnable: Bool? {
get { enableSendQueueEnableReceivedEnableLock.withLock { enableSendQueueEnableUnderlyingReceivedEnable } }
set { enableSendQueueEnableReceivedEnableLock.withLock { enableSendQueueEnableUnderlyingReceivedEnable = newValue } }
}
private let enableSendQueueEnableReceivedInvocationsLock = NSLock()
private var enableSendQueueEnableUnderlyingReceivedInvocations: [Bool] = []
open var enableSendQueueEnableReceivedInvocations: [Bool] {
get { enableSendQueueEnableReceivedInvocationsLock.withLock { enableSendQueueEnableUnderlyingReceivedInvocations } }
set { enableSendQueueEnableReceivedInvocationsLock.withLock { enableSendQueueEnableUnderlyingReceivedInvocations = newValue } }
}
open var enableSendQueueEnableClosure: ((Bool) -> Void)?
open override func enableSendQueue(enable: Bool) {
enableSendQueueEnableCallsCountLock.withLock { enableSendQueueEnableUnderlyingCallsCount += 1 }
enableSendQueueEnableReceivedEnable = enable
enableSendQueueEnableReceivedInvocationsLock.withLock { enableSendQueueEnableUnderlyingReceivedInvocations.append(enable) }
enableSendQueueEnableClosure?(enable)
}
//MARK: - encryptionState
private let encryptionStateCallsCountLock = NSLock()
private var encryptionStateUnderlyingCallsCount = 0
open var encryptionStateCallsCount: Int {
get { encryptionStateCallsCountLock.withLock { encryptionStateUnderlyingCallsCount } }
set { encryptionStateCallsCountLock.withLock { encryptionStateUnderlyingCallsCount = newValue } }
}
open var encryptionStateCalled: Bool {
return encryptionStateCallsCount > 0
}
private let encryptionStateReturnValueLock = NSLock()
open var encryptionStateUnderlyingReturnValue: EncryptionState!
open var encryptionStateReturnValue: EncryptionState! {
get { encryptionStateReturnValueLock.withLock { encryptionStateUnderlyingReturnValue } }
set { encryptionStateReturnValueLock.withLock { encryptionStateUnderlyingReturnValue = newValue } }
}
open var encryptionStateClosure: (() -> EncryptionState)?
open override func encryptionState() -> EncryptionState {
encryptionStateCallsCountLock.withLock { encryptionStateUnderlyingCallsCount += 1 }
if let encryptionStateClosure = encryptionStateClosure {
return encryptionStateClosure()
} else {
return encryptionStateReturnValue
}
}
//MARK: - fetchThreadSubscription
open var fetchThreadSubscriptionThreadRootEventIdThrowableError: Error?
private let fetchThreadSubscriptionThreadRootEventIdCallsCountLock = NSLock()
private var fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount = 0
open var fetchThreadSubscriptionThreadRootEventIdCallsCount: Int {
get { fetchThreadSubscriptionThreadRootEventIdCallsCountLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount } }
set { fetchThreadSubscriptionThreadRootEventIdCallsCountLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount = newValue } }
}
open var fetchThreadSubscriptionThreadRootEventIdCalled: Bool {
return fetchThreadSubscriptionThreadRootEventIdCallsCount > 0
}
private let fetchThreadSubscriptionThreadRootEventIdReceivedThreadRootEventIdLock = NSLock()
private var fetchThreadSubscriptionThreadRootEventIdUnderlyingReceivedThreadRootEventId: String?
open var fetchThreadSubscriptionThreadRootEventIdReceivedThreadRootEventId: String? {
get { fetchThreadSubscriptionThreadRootEventIdReceivedThreadRootEventIdLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingReceivedThreadRootEventId } }
set { fetchThreadSubscriptionThreadRootEventIdReceivedThreadRootEventIdLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingReceivedThreadRootEventId = newValue } }
}
private let fetchThreadSubscriptionThreadRootEventIdReceivedInvocationsLock = NSLock()
private var fetchThreadSubscriptionThreadRootEventIdUnderlyingReceivedInvocations: [String] = []
open var fetchThreadSubscriptionThreadRootEventIdReceivedInvocations: [String] {
get { fetchThreadSubscriptionThreadRootEventIdReceivedInvocationsLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingReceivedInvocations } }
set { fetchThreadSubscriptionThreadRootEventIdReceivedInvocationsLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingReceivedInvocations = newValue } }
}
private let fetchThreadSubscriptionThreadRootEventIdReturnValueLock = NSLock()
open var fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue: ThreadSubscription?
open var fetchThreadSubscriptionThreadRootEventIdReturnValue: ThreadSubscription? {
get { fetchThreadSubscriptionThreadRootEventIdReturnValueLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue } }
set { fetchThreadSubscriptionThreadRootEventIdReturnValueLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingReturnValue = newValue } }
}
open var fetchThreadSubscriptionThreadRootEventIdClosure: ((String) async throws -> ThreadSubscription?)?
open override func fetchThreadSubscription(threadRootEventId: String) async throws -> ThreadSubscription? {
if let error = fetchThreadSubscriptionThreadRootEventIdThrowableError {
throw error
}
fetchThreadSubscriptionThreadRootEventIdCallsCountLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingCallsCount += 1 }
fetchThreadSubscriptionThreadRootEventIdReceivedThreadRootEventId = threadRootEventId
fetchThreadSubscriptionThreadRootEventIdReceivedInvocationsLock.withLock { fetchThreadSubscriptionThreadRootEventIdUnderlyingReceivedInvocations.append(threadRootEventId) }
if let fetchThreadSubscriptionThreadRootEventIdClosure = fetchThreadSubscriptionThreadRootEventIdClosure {
return try await fetchThreadSubscriptionThreadRootEventIdClosure(threadRootEventId)
} else {
return fetchThreadSubscriptionThreadRootEventIdReturnValue
}
}
//MARK: - forget
open var forgetThrowableError: Error?
private let forgetCallsCountLock = NSLock()
private var forgetUnderlyingCallsCount = 0
open var forgetCallsCount: Int {
get { forgetCallsCountLock.withLock { forgetUnderlyingCallsCount } }
set { forgetCallsCountLock.withLock { forgetUnderlyingCallsCount = newValue } }
}
open var forgetCalled: Bool {
return forgetCallsCount > 0
}
open var forgetClosure: (() async throws -> Void)?
open override func forget() async throws {
if let error = forgetThrowableError {
throw error
}
forgetCallsCountLock.withLock { forgetUnderlyingCallsCount += 1 }
try await forgetClosure?()
}
//MARK: - getPowerLevels
open var getPowerLevelsThrowableError: Error?
private let getPowerLevelsCallsCountLock = NSLock()
private var getPowerLevelsUnderlyingCallsCount = 0
open var getPowerLevelsCallsCount: Int {
get { getPowerLevelsCallsCountLock.withLock { getPowerLevelsUnderlyingCallsCount } }
set { getPowerLevelsCallsCountLock.withLock { getPowerLevelsUnderlyingCallsCount = newValue } }
}
open var getPowerLevelsCalled: Bool {
return getPowerLevelsCallsCount > 0
}
private let getPowerLevelsReturnValueLock = NSLock()
open var getPowerLevelsUnderlyingReturnValue: RoomPowerLevels!
open var getPowerLevelsReturnValue: RoomPowerLevels! {
get { getPowerLevelsReturnValueLock.withLock { getPowerLevelsUnderlyingReturnValue } }
set { getPowerLevelsReturnValueLock.withLock { getPowerLevelsUnderlyingReturnValue = newValue } }
}
open var getPowerLevelsClosure: (() async throws -> RoomPowerLevels)?
open override func getPowerLevels() async throws -> RoomPowerLevels {
if let error = getPowerLevelsThrowableError {
throw error
}
getPowerLevelsCallsCountLock.withLock { getPowerLevelsUnderlyingCallsCount += 1 }
if let getPowerLevelsClosure = getPowerLevelsClosure {
return try await getPowerLevelsClosure()
} else {
return getPowerLevelsReturnValue
}
}
//MARK: - getRoomVisibility
open var getRoomVisibilityThrowableError: Error?
private let getRoomVisibilityCallsCountLock = NSLock()
private var getRoomVisibilityUnderlyingCallsCount = 0
open var getRoomVisibilityCallsCount: Int {
get { getRoomVisibilityCallsCountLock.withLock { getRoomVisibilityUnderlyingCallsCount } }
set { getRoomVisibilityCallsCountLock.withLock { getRoomVisibilityUnderlyingCallsCount = newValue } }
}
open var getRoomVisibilityCalled: Bool {
return getRoomVisibilityCallsCount > 0
}
private let getRoomVisibilityReturnValueLock = NSLock()
open var getRoomVisibilityUnderlyingReturnValue: RoomVisibility!
open var getRoomVisibilityReturnValue: RoomVisibility! {
get { getRoomVisibilityReturnValueLock.withLock { getRoomVisibilityUnderlyingReturnValue } }
set { getRoomVisibilityReturnValueLock.withLock { getRoomVisibilityUnderlyingReturnValue = newValue } }
}
open var getRoomVisibilityClosure: (() async throws -> RoomVisibility)?
open override func getRoomVisibility() async throws -> RoomVisibility {
if let error = getRoomVisibilityThrowableError {
throw error
}
getRoomVisibilityCallsCountLock.withLock { getRoomVisibilityUnderlyingCallsCount += 1 }
if let getRoomVisibilityClosure = getRoomVisibilityClosure {
return try await getRoomVisibilityClosure()
} else {
return getRoomVisibilityReturnValue
}
}
//MARK: - hasActiveRoomCall
private let hasActiveRoomCallCallsCountLock = NSLock()
private var hasActiveRoomCallUnderlyingCallsCount = 0
open var hasActiveRoomCallCallsCount: Int {
get { hasActiveRoomCallCallsCountLock.withLock { hasActiveRoomCallUnderlyingCallsCount } }
set { hasActiveRoomCallCallsCountLock.withLock { hasActiveRoomCallUnderlyingCallsCount = newValue } }
}
open var hasActiveRoomCallCalled: Bool {
return hasActiveRoomCallCallsCount > 0
}
private let hasActiveRoomCallReturnValueLock = NSLock()
open var hasActiveRoomCallUnderlyingReturnValue: Bool!
open var hasActiveRoomCallReturnValue: Bool! {
get { hasActiveRoomCallReturnValueLock.withLock { hasActiveRoomCallUnderlyingReturnValue } }
set { hasActiveRoomCallReturnValueLock.withLock { hasActiveRoomCallUnderlyingReturnValue = newValue } }
}
open var hasActiveRoomCallClosure: (() -> Bool)?
open override func hasActiveRoomCall() -> Bool {
hasActiveRoomCallCallsCountLock.withLock { hasActiveRoomCallUnderlyingCallsCount += 1 }
if let hasActiveRoomCallClosure = hasActiveRoomCallClosure {
return hasActiveRoomCallClosure()
} else {
return hasActiveRoomCallReturnValue
}
}
//MARK: - heroes
private let heroesCallsCountLock = NSLock()
private var heroesUnderlyingCallsCount = 0
open var heroesCallsCount: Int {
get { heroesCallsCountLock.withLock { heroesUnderlyingCallsCount } }
set { heroesCallsCountLock.withLock { heroesUnderlyingCallsCount = newValue } }
}
open var heroesCalled: Bool {
return heroesCallsCount > 0
}
private let heroesReturnValueLock = NSLock()
open var heroesUnderlyingReturnValue: [RoomHero]!
open var heroesReturnValue: [RoomHero]! {
get { heroesReturnValueLock.withLock { heroesUnderlyingReturnValue } }
set { heroesReturnValueLock.withLock { heroesUnderlyingReturnValue = newValue } }
}
open var heroesClosure: (() async -> [RoomHero])?
open override func heroes() async -> [RoomHero] {
heroesCallsCountLock.withLock { heroesUnderlyingCallsCount += 1 }
if let heroesClosure = heroesClosure {
return await heroesClosure()
} else {
return heroesReturnValue
}
}
//MARK: - id
private let idCallsCountLock = NSLock()
private var idUnderlyingCallsCount = 0
open var idCallsCount: Int {
get { idCallsCountLock.withLock { idUnderlyingCallsCount } }
set { idCallsCountLock.withLock { idUnderlyingCallsCount = newValue } }
}
open var idCalled: Bool {
return idCallsCount > 0
}
private let idReturnValueLock = NSLock()
open var idUnderlyingReturnValue: String!
open var idReturnValue: String! {
get { idReturnValueLock.withLock { idUnderlyingReturnValue } }
set { idReturnValueLock.withLock { idUnderlyingReturnValue = newValue } }
}
open var idClosure: (() -> String)?
open override func id() -> String {
idCallsCountLock.withLock { idUnderlyingCallsCount += 1 }
if let idClosure = idClosure {
return idClosure()
} else {
return idReturnValue
}
}
//MARK: - ignoreDeviceTrustAndResend
open var ignoreDeviceTrustAndResendDevicesSendHandleThrowableError: Error?
private let ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock = NSLock()
private var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount = 0
open var ignoreDeviceTrustAndResendDevicesSendHandleCallsCount: Int {
get { ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount } }
set { ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount = newValue } }
}
open var ignoreDeviceTrustAndResendDevicesSendHandleCalled: Bool {
return ignoreDeviceTrustAndResendDevicesSendHandleCallsCount > 0
}
private let ignoreDeviceTrustAndResendDevicesSendHandleReceivedArgumentsLock = NSLock()
private var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedArguments: (devices: [String: [String]], sendHandle: SendHandle)?
open var ignoreDeviceTrustAndResendDevicesSendHandleReceivedArguments: (devices: [String: [String]], sendHandle: SendHandle)? {
get { ignoreDeviceTrustAndResendDevicesSendHandleReceivedArgumentsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedArguments } }
set { ignoreDeviceTrustAndResendDevicesSendHandleReceivedArgumentsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedArguments = newValue } }
}
private let ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock = NSLock()
private var ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations: [(devices: [String: [String]], sendHandle: SendHandle)] = []
open var ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocations: [(devices: [String: [String]], sendHandle: SendHandle)] {
get { ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations } }
set { ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations = newValue } }
}
open var ignoreDeviceTrustAndResendDevicesSendHandleClosure: (([String: [String]], SendHandle) async throws -> Void)?
open override func ignoreDeviceTrustAndResend(devices: [String: [String]], sendHandle: SendHandle) async throws {
if let error = ignoreDeviceTrustAndResendDevicesSendHandleThrowableError {
throw error
}
ignoreDeviceTrustAndResendDevicesSendHandleCallsCountLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingCallsCount += 1 }
ignoreDeviceTrustAndResendDevicesSendHandleReceivedArguments = (devices: devices, sendHandle: sendHandle)
ignoreDeviceTrustAndResendDevicesSendHandleReceivedInvocationsLock.withLock { ignoreDeviceTrustAndResendDevicesSendHandleUnderlyingReceivedInvocations.append((devices: devices, sendHandle: sendHandle)) }
try await ignoreDeviceTrustAndResendDevicesSendHandleClosure?(devices, sendHandle)
}
//MARK: - ignoreUser
open var ignoreUserUserIdThrowableError: Error?
private let ignoreUserUserIdCallsCountLock = NSLock()
private var ignoreUserUserIdUnderlyingCallsCount = 0
open var ignoreUserUserIdCallsCount: Int {
get { ignoreUserUserIdCallsCountLock.withLock { ignoreUserUserIdUnderlyingCallsCount } }
set { ignoreUserUserIdCallsCountLock.withLock { ignoreUserUserIdUnderlyingCallsCount = newValue } }
}
open var ignoreUserUserIdCalled: Bool {
return ignoreUserUserIdCallsCount > 0
}
private let ignoreUserUserIdReceivedUserIdLock = NSLock()
private var ignoreUserUserIdUnderlyingReceivedUserId: String?
open var ignoreUserUserIdReceivedUserId: String? {
get { ignoreUserUserIdReceivedUserIdLock.withLock { ignoreUserUserIdUnderlyingReceivedUserId } }
set { ignoreUserUserIdReceivedUserIdLock.withLock { ignoreUserUserIdUnderlyingReceivedUserId = newValue } }
}
private let ignoreUserUserIdReceivedInvocationsLock = NSLock()
private var ignoreUserUserIdUnderlyingReceivedInvocations: [String] = []
open var ignoreUserUserIdReceivedInvocations: [String] {
get { ignoreUserUserIdReceivedInvocationsLock.withLock { ignoreUserUserIdUnderlyingReceivedInvocations } }
set { ignoreUserUserIdReceivedInvocationsLock.withLock { ignoreUserUserIdUnderlyingReceivedInvocations = newValue } }
}
open var ignoreUserUserIdClosure: ((String) async throws -> Void)?
open override func ignoreUser(userId: String) async throws {
if let error = ignoreUserUserIdThrowableError {
throw error
}
ignoreUserUserIdCallsCountLock.withLock { ignoreUserUserIdUnderlyingCallsCount += 1 }
ignoreUserUserIdReceivedUserId = userId
ignoreUserUserIdReceivedInvocationsLock.withLock { ignoreUserUserIdUnderlyingReceivedInvocations.append(userId) }
try await ignoreUserUserIdClosure?(userId)
}
//MARK: - inviteUserById
open var inviteUserByIdUserIdThrowableError: Error?
private let inviteUserByIdUserIdCallsCountLock = NSLock()
private var inviteUserByIdUserIdUnderlyingCallsCount = 0
open var inviteUserByIdUserIdCallsCount: Int {
get { inviteUserByIdUserIdCallsCountLock.withLock { inviteUserByIdUserIdUnderlyingCallsCount } }
set { inviteUserByIdUserIdCallsCountLock.withLock { inviteUserByIdUserIdUnderlyingCallsCount = newValue } }
}
open var inviteUserByIdUserIdCalled: Bool {
return inviteUserByIdUserIdCallsCount > 0
}
private let inviteUserByIdUserIdReceivedUserIdLock = NSLock()
private var inviteUserByIdUserIdUnderlyingReceivedUserId: String?
open var inviteUserByIdUserIdReceivedUserId: String? {
get { inviteUserByIdUserIdReceivedUserIdLock.withLock { inviteUserByIdUserIdUnderlyingReceivedUserId } }
set { inviteUserByIdUserIdReceivedUserIdLock.withLock { inviteUserByIdUserIdUnderlyingReceivedUserId = newValue } }
}
private let inviteUserByIdUserIdReceivedInvocationsLock = NSLock()
private var inviteUserByIdUserIdUnderlyingReceivedInvocations: [String] = []
open var inviteUserByIdUserIdReceivedInvocations: [String] {
get { inviteUserByIdUserIdReceivedInvocationsLock.withLock { inviteUserByIdUserIdUnderlyingReceivedInvocations } }
set { inviteUserByIdUserIdReceivedInvocationsLock.withLock { inviteUserByIdUserIdUnderlyingReceivedInvocations = newValue } }
}
open var inviteUserByIdUserIdClosure: ((String) async throws -> Void)?
open override func inviteUserById(userId: String) async throws {
if let error = inviteUserByIdUserIdThrowableError {
throw error
}
inviteUserByIdUserIdCallsCountLock.withLock { inviteUserByIdUserIdUnderlyingCallsCount += 1 }
inviteUserByIdUserIdReceivedUserId = userId
inviteUserByIdUserIdReceivedInvocationsLock.withLock { inviteUserByIdUserIdUnderlyingReceivedInvocations.append(userId) }
try await inviteUserByIdUserIdClosure?(userId)
}
//MARK: - invitedMembersCount
private let invitedMembersCountCallsCountLock = NSLock()
private var invitedMembersCountUnderlyingCallsCount = 0
open var invitedMembersCountCallsCount: Int {
get { invitedMembersCountCallsCountLock.withLock { invitedMembersCountUnderlyingCallsCount } }
set { invitedMembersCountCallsCountLock.withLock { invitedMembersCountUnderlyingCallsCount = newValue } }
}
open var invitedMembersCountCalled: Bool {
return invitedMembersCountCallsCount > 0
}
private let invitedMembersCountReturnValueLock = NSLock()
open var invitedMembersCountUnderlyingReturnValue: UInt64!
open var invitedMembersCountReturnValue: UInt64! {
get { invitedMembersCountReturnValueLock.withLock { invitedMembersCountUnderlyingReturnValue } }
set { invitedMembersCountReturnValueLock.withLock { invitedMembersCountUnderlyingReturnValue = newValue } }
}
open var invitedMembersCountClosure: (() -> UInt64)?
open override func invitedMembersCount() -> UInt64 {
invitedMembersCountCallsCountLock.withLock { invitedMembersCountUnderlyingCallsCount += 1 }
if let invitedMembersCountClosure = invitedMembersCountClosure {
return invitedMembersCountClosure()
} else {
return invitedMembersCountReturnValue
}
}
//MARK: - inviter
open var inviterThrowableError: Error?
private let inviterCallsCountLock = NSLock()
private var inviterUnderlyingCallsCount = 0
open var inviterCallsCount: Int {
get { inviterCallsCountLock.withLock { inviterUnderlyingCallsCount } }
set { inviterCallsCountLock.withLock { inviterUnderlyingCallsCount = newValue } }
}
open var inviterCalled: Bool {
return inviterCallsCount > 0
}
private let inviterReturnValueLock = NSLock()
open var inviterUnderlyingReturnValue: RoomMember?
open var inviterReturnValue: RoomMember? {
get { inviterReturnValueLock.withLock { inviterUnderlyingReturnValue } }
set { inviterReturnValueLock.withLock { inviterUnderlyingReturnValue = newValue } }
}
open var inviterClosure: (() async throws -> RoomMember?)?
open override func inviter() async throws -> RoomMember? {
if let error = inviterThrowableError {
throw error
}
inviterCallsCountLock.withLock { inviterUnderlyingCallsCount += 1 }
if let inviterClosure = inviterClosure {
return try await inviterClosure()
} else {
return inviterReturnValue
}
}
//MARK: - isDirect
private let isDirectCallsCountLock = NSLock()
private var isDirectUnderlyingCallsCount = 0
open var isDirectCallsCount: Int {
get { isDirectCallsCountLock.withLock { isDirectUnderlyingCallsCount } }
set { isDirectCallsCountLock.withLock { isDirectUnderlyingCallsCount = newValue } }
}
open var isDirectCalled: Bool {
return isDirectCallsCount > 0
}
private let isDirectReturnValueLock = NSLock()
open var isDirectUnderlyingReturnValue: Bool!
open var isDirectReturnValue: Bool! {
get { isDirectReturnValueLock.withLock { isDirectUnderlyingReturnValue } }
set { isDirectReturnValueLock.withLock { isDirectUnderlyingReturnValue = newValue } }
}
open var isDirectClosure: (() async -> Bool)?
open override func isDirect() async -> Bool {
isDirectCallsCountLock.withLock { isDirectUnderlyingCallsCount += 1 }
if let isDirectClosure = isDirectClosure {
return await isDirectClosure()
} else {
return isDirectReturnValue
}
}
//MARK: - isEncrypted
private let isEncryptedCallsCountLock = NSLock()
private var isEncryptedUnderlyingCallsCount = 0
open var isEncryptedCallsCount: Int {
get { isEncryptedCallsCountLock.withLock { isEncryptedUnderlyingCallsCount } }
set { isEncryptedCallsCountLock.withLock { isEncryptedUnderlyingCallsCount = newValue } }
}
open var isEncryptedCalled: Bool {
return isEncryptedCallsCount > 0
}
private let isEncryptedReturnValueLock = NSLock()
open var isEncryptedUnderlyingReturnValue: Bool!
open var isEncryptedReturnValue: Bool! {
get { isEncryptedReturnValueLock.withLock { isEncryptedUnderlyingReturnValue } }
set { isEncryptedReturnValueLock.withLock { isEncryptedUnderlyingReturnValue = newValue } }
}
open var isEncryptedClosure: (() async -> Bool)?
open override func isEncrypted() async -> Bool {
isEncryptedCallsCountLock.withLock { isEncryptedUnderlyingCallsCount += 1 }
if let isEncryptedClosure = isEncryptedClosure {
return await isEncryptedClosure()
} else {
return isEncryptedReturnValue
}
}
//MARK: - isPublic
private let isPublicCallsCountLock = NSLock()
private var isPublicUnderlyingCallsCount = 0
open var isPublicCallsCount: Int {
get { isPublicCallsCountLock.withLock { isPublicUnderlyingCallsCount } }
set { isPublicCallsCountLock.withLock { isPublicUnderlyingCallsCount = newValue } }
}
open var isPublicCalled: Bool {
return isPublicCallsCount > 0
}
private let isPublicReturnValueLock = NSLock()
open var isPublicUnderlyingReturnValue: Bool?
open var isPublicReturnValue: Bool? {
get { isPublicReturnValueLock.withLock { isPublicUnderlyingReturnValue } }
set { isPublicReturnValueLock.withLock { isPublicUnderlyingReturnValue = newValue } }
}
open var isPublicClosure: (() -> Bool?)?
open override func isPublic() -> Bool? {
isPublicCallsCountLock.withLock { isPublicUnderlyingCallsCount += 1 }
if let isPublicClosure = isPublicClosure {
return isPublicClosure()
} else {
return isPublicReturnValue
}
}
//MARK: - isSendQueueEnabled
private let isSendQueueEnabledCallsCountLock = NSLock()
private var isSendQueueEnabledUnderlyingCallsCount = 0
open var isSendQueueEnabledCallsCount: Int {
get { isSendQueueEnabledCallsCountLock.withLock { isSendQueueEnabledUnderlyingCallsCount } }
set { isSendQueueEnabledCallsCountLock.withLock { isSendQueueEnabledUnderlyingCallsCount = newValue } }
}
open var isSendQueueEnabledCalled: Bool {
return isSendQueueEnabledCallsCount > 0
}
private let isSendQueueEnabledReturnValueLock = NSLock()
open var isSendQueueEnabledUnderlyingReturnValue: Bool!
open var isSendQueueEnabledReturnValue: Bool! {
get { isSendQueueEnabledReturnValueLock.withLock { isSendQueueEnabledUnderlyingReturnValue } }
set { isSendQueueEnabledReturnValueLock.withLock { isSendQueueEnabledUnderlyingReturnValue = newValue } }
}
open var isSendQueueEnabledClosure: (() -> Bool)?
open override func isSendQueueEnabled() -> Bool {
isSendQueueEnabledCallsCountLock.withLock { isSendQueueEnabledUnderlyingCallsCount += 1 }
if let isSendQueueEnabledClosure = isSendQueueEnabledClosure {
return isSendQueueEnabledClosure()
} else {
return isSendQueueEnabledReturnValue
}
}
//MARK: - isSpace
private let isSpaceCallsCountLock = NSLock()
private var isSpaceUnderlyingCallsCount = 0
open var isSpaceCallsCount: Int {
get { isSpaceCallsCountLock.withLock { isSpaceUnderlyingCallsCount } }
set { isSpaceCallsCountLock.withLock { isSpaceUnderlyingCallsCount = newValue } }
}
open var isSpaceCalled: Bool {
return isSpaceCallsCount > 0
}
private let isSpaceReturnValueLock = NSLock()
open var isSpaceUnderlyingReturnValue: Bool!
open var isSpaceReturnValue: Bool! {
get { isSpaceReturnValueLock.withLock { isSpaceUnderlyingReturnValue } }
set { isSpaceReturnValueLock.withLock { isSpaceUnderlyingReturnValue = newValue } }
}
open var isSpaceClosure: (() -> Bool)?
open override func isSpace() -> Bool {
isSpaceCallsCountLock.withLock { isSpaceUnderlyingCallsCount += 1 }
if let isSpaceClosure = isSpaceClosure {
return isSpaceClosure()
} else {
return isSpaceReturnValue
}
}
//MARK: - join
open var joinThrowableError: Error?
private let joinCallsCountLock = NSLock()
private var joinUnderlyingCallsCount = 0
open var joinCallsCount: Int {
get { joinCallsCountLock.withLock { joinUnderlyingCallsCount } }
set { joinCallsCountLock.withLock { joinUnderlyingCallsCount = newValue } }
}
open var joinCalled: Bool {
return joinCallsCount > 0
}
open var joinClosure: (() async throws -> Void)?
open override func join() async throws {
if let error = joinThrowableError {
throw error
}
joinCallsCountLock.withLock { joinUnderlyingCallsCount += 1 }
try await joinClosure?()
}
//MARK: - joinedMembersCount
private let joinedMembersCountCallsCountLock = NSLock()
private var joinedMembersCountUnderlyingCallsCount = 0
open var joinedMembersCountCallsCount: Int {
get { joinedMembersCountCallsCountLock.withLock { joinedMembersCountUnderlyingCallsCount } }
set { joinedMembersCountCallsCountLock.withLock { joinedMembersCountUnderlyingCallsCount = newValue } }
}
open var joinedMembersCountCalled: Bool {
return joinedMembersCountCallsCount > 0
}
private let joinedMembersCountReturnValueLock = NSLock()
open var joinedMembersCountUnderlyingReturnValue: UInt64!
open var joinedMembersCountReturnValue: UInt64! {
get { joinedMembersCountReturnValueLock.withLock { joinedMembersCountUnderlyingReturnValue } }
set { joinedMembersCountReturnValueLock.withLock { joinedMembersCountUnderlyingReturnValue = newValue } }
}
open var joinedMembersCountClosure: (() -> UInt64)?
open override func joinedMembersCount() -> UInt64 {
joinedMembersCountCallsCountLock.withLock { joinedMembersCountUnderlyingCallsCount += 1 }
if let joinedMembersCountClosure = joinedMembersCountClosure {
return joinedMembersCountClosure()
} else {
return joinedMembersCountReturnValue
}
}
//MARK: - kickUser
open var kickUserUserIdReasonThrowableError: Error?
private let kickUserUserIdReasonCallsCountLock = NSLock()
private var kickUserUserIdReasonUnderlyingCallsCount = 0
open var kickUserUserIdReasonCallsCount: Int {
get { kickUserUserIdReasonCallsCountLock.withLock { kickUserUserIdReasonUnderlyingCallsCount } }
set { kickUserUserIdReasonCallsCountLock.withLock { kickUserUserIdReasonUnderlyingCallsCount = newValue } }
}
open var kickUserUserIdReasonCalled: Bool {
return kickUserUserIdReasonCallsCount > 0
}
private let kickUserUserIdReasonReceivedArgumentsLock = NSLock()
private var kickUserUserIdReasonUnderlyingReceivedArguments: (userId: String, reason: String?)?
open var kickUserUserIdReasonReceivedArguments: (userId: String, reason: String?)? {
get { kickUserUserIdReasonReceivedArgumentsLock.withLock { kickUserUserIdReasonUnderlyingReceivedArguments } }
set { kickUserUserIdReasonReceivedArgumentsLock.withLock { kickUserUserIdReasonUnderlyingReceivedArguments = newValue } }
}
private let kickUserUserIdReasonReceivedInvocationsLock = NSLock()
private var kickUserUserIdReasonUnderlyingReceivedInvocations: [(userId: String, reason: String?)] = []
open var kickUserUserIdReasonReceivedInvocations: [(userId: String, reason: String?)] {
get { kickUserUserIdReasonReceivedInvocationsLock.withLock { kickUserUserIdReasonUnderlyingReceivedInvocations } }
set { kickUserUserIdReasonReceivedInvocationsLock.withLock { kickUserUserIdReasonUnderlyingReceivedInvocations = newValue } }
}
open var kickUserUserIdReasonClosure: ((String, String?) async throws -> Void)?
open override func kickUser(userId: String, reason: String?) async throws {
if let error = kickUserUserIdReasonThrowableError {
throw error
}
kickUserUserIdReasonCallsCountLock.withLock { kickUserUserIdReasonUnderlyingCallsCount += 1 }
kickUserUserIdReasonReceivedArguments = (userId: userId, reason: reason)
kickUserUserIdReasonReceivedInvocationsLock.withLock { kickUserUserIdReasonUnderlyingReceivedInvocations.append((userId: userId, reason: reason)) }
try await kickUserUserIdReasonClosure?(userId, reason)
}
//MARK: - latestEncryptionState
open var latestEncryptionStateThrowableError: Error?
private let latestEncryptionStateCallsCountLock = NSLock()
private var latestEncryptionStateUnderlyingCallsCount = 0
open var latestEncryptionStateCallsCount: Int {
get { latestEncryptionStateCallsCountLock.withLock { latestEncryptionStateUnderlyingCallsCount } }
set { latestEncryptionStateCallsCountLock.withLock { latestEncryptionStateUnderlyingCallsCount = newValue } }
}
open var latestEncryptionStateCalled: Bool {
return latestEncryptionStateCallsCount > 0
}
private let latestEncryptionStateReturnValueLock = NSLock()
open var latestEncryptionStateUnderlyingReturnValue: EncryptionState!
open var latestEncryptionStateReturnValue: EncryptionState! {
get { latestEncryptionStateReturnValueLock.withLock { latestEncryptionStateUnderlyingReturnValue } }
set { latestEncryptionStateReturnValueLock.withLock { latestEncryptionStateUnderlyingReturnValue = newValue } }
}
open var latestEncryptionStateClosure: (() async throws -> EncryptionState)?
open override func latestEncryptionState() async throws -> EncryptionState {
if let error = latestEncryptionStateThrowableError {
throw error
}
latestEncryptionStateCallsCountLock.withLock { latestEncryptionStateUnderlyingCallsCount += 1 }
if let latestEncryptionStateClosure = latestEncryptionStateClosure {
return try await latestEncryptionStateClosure()
} else {
return latestEncryptionStateReturnValue
}
}
//MARK: - latestEvent
private let latestEventCallsCountLock = NSLock()
private var latestEventUnderlyingCallsCount = 0
open var latestEventCallsCount: Int {
get { latestEventCallsCountLock.withLock { latestEventUnderlyingCallsCount } }
set { latestEventCallsCountLock.withLock { latestEventUnderlyingCallsCount = newValue } }
}
open var latestEventCalled: Bool {
return latestEventCallsCount > 0
}
private let latestEventReturnValueLock = NSLock()
open var latestEventUnderlyingReturnValue: LatestEventValue!
open var latestEventReturnValue: LatestEventValue! {
get { latestEventReturnValueLock.withLock { latestEventUnderlyingReturnValue } }
set { latestEventReturnValueLock.withLock { latestEventUnderlyingReturnValue = newValue } }
}
open var latestEventClosure: (() async -> LatestEventValue)?
open override func latestEvent() async -> LatestEventValue {
latestEventCallsCountLock.withLock { latestEventUnderlyingCallsCount += 1 }
if let latestEventClosure = latestEventClosure {
return await latestEventClosure()
} else {
return latestEventReturnValue
}
}
//MARK: - leave
open var leaveThrowableError: Error?
private let leaveCallsCountLock = NSLock()
private var leaveUnderlyingCallsCount = 0
open var leaveCallsCount: Int {
get { leaveCallsCountLock.withLock { leaveUnderlyingCallsCount } }
set { leaveCallsCountLock.withLock { leaveUnderlyingCallsCount = newValue } }
}
open var leaveCalled: Bool {
return leaveCallsCount > 0
}
open var leaveClosure: (() async throws -> Void)?
open override func leave() async throws {
if let error = leaveThrowableError {
throw error
}
leaveCallsCountLock.withLock { leaveUnderlyingCallsCount += 1 }
try await leaveClosure?()
}
//MARK: - liveLocationsObserver
private let liveLocationsObserverCallsCountLock = NSLock()
private var liveLocationsObserverUnderlyingCallsCount = 0
open var liveLocationsObserverCallsCount: Int {
get { liveLocationsObserverCallsCountLock.withLock { liveLocationsObserverUnderlyingCallsCount } }
set { liveLocationsObserverCallsCountLock.withLock { liveLocationsObserverUnderlyingCallsCount = newValue } }
}
open var liveLocationsObserverCalled: Bool {
return liveLocationsObserverCallsCount > 0
}
private let liveLocationsObserverReturnValueLock = NSLock()
open var liveLocationsObserverUnderlyingReturnValue: LiveLocationsObserver!
open var liveLocationsObserverReturnValue: LiveLocationsObserver! {
get { liveLocationsObserverReturnValueLock.withLock { liveLocationsObserverUnderlyingReturnValue } }
set { liveLocationsObserverReturnValueLock.withLock { liveLocationsObserverUnderlyingReturnValue = newValue } }
}
open var liveLocationsObserverClosure: (() async -> LiveLocationsObserver)?
open override func liveLocationsObserver() async -> LiveLocationsObserver {
liveLocationsObserverCallsCountLock.withLock { liveLocationsObserverUnderlyingCallsCount += 1 }
if let liveLocationsObserverClosure = liveLocationsObserverClosure {
return await liveLocationsObserverClosure()
} else {
return liveLocationsObserverReturnValue
}
}
//MARK: - loadComposerDraft
open var loadComposerDraftThreadRootThrowableError: Error?
private let loadComposerDraftThreadRootCallsCountLock = NSLock()
private var loadComposerDraftThreadRootUnderlyingCallsCount = 0
open var loadComposerDraftThreadRootCallsCount: Int {
get { loadComposerDraftThreadRootCallsCountLock.withLock { loadComposerDraftThreadRootUnderlyingCallsCount } }
set { loadComposerDraftThreadRootCallsCountLock.withLock { loadComposerDraftThreadRootUnderlyingCallsCount = newValue } }
}
open var loadComposerDraftThreadRootCalled: Bool {
return loadComposerDraftThreadRootCallsCount > 0
}
private let loadComposerDraftThreadRootReceivedThreadRootLock = NSLock()
private var loadComposerDraftThreadRootUnderlyingReceivedThreadRoot: String?
open var loadComposerDraftThreadRootReceivedThreadRoot: String? {
get { loadComposerDraftThreadRootReceivedThreadRootLock.withLock { loadComposerDraftThreadRootUnderlyingReceivedThreadRoot } }
set { loadComposerDraftThreadRootReceivedThreadRootLock.withLock { loadComposerDraftThreadRootUnderlyingReceivedThreadRoot = newValue } }
}
private let loadComposerDraftThreadRootReceivedInvocationsLock = NSLock()
private var loadComposerDraftThreadRootUnderlyingReceivedInvocations: [String?] = []
open var loadComposerDraftThreadRootReceivedInvocations: [String?] {
get { loadComposerDraftThreadRootReceivedInvocationsLock.withLock { loadComposerDraftThreadRootUnderlyingReceivedInvocations } }
set { loadComposerDraftThreadRootReceivedInvocationsLock.withLock { loadComposerDraftThreadRootUnderlyingReceivedInvocations = newValue } }
}
private let loadComposerDraftThreadRootReturnValueLock = NSLock()
open var loadComposerDraftThreadRootUnderlyingReturnValue: ComposerDraft?
open var loadComposerDraftThreadRootReturnValue: ComposerDraft? {
get { loadComposerDraftThreadRootReturnValueLock.withLock { loadComposerDraftThreadRootUnderlyingReturnValue } }
set { loadComposerDraftThreadRootReturnValueLock.withLock { loadComposerDraftThreadRootUnderlyingReturnValue = newValue } }
}
open var loadComposerDraftThreadRootClosure: ((String?) async throws -> ComposerDraft?)?
open override func loadComposerDraft(threadRoot: String?) async throws -> ComposerDraft? {
if let error = loadComposerDraftThreadRootThrowableError {
throw error
}
loadComposerDraftThreadRootCallsCountLock.withLock { loadComposerDraftThreadRootUnderlyingCallsCount += 1 }
loadComposerDraftThreadRootReceivedThreadRoot = threadRoot
loadComposerDraftThreadRootReceivedInvocationsLock.withLock { loadComposerDraftThreadRootUnderlyingReceivedInvocations.append(threadRoot) }
if let loadComposerDraftThreadRootClosure = loadComposerDraftThreadRootClosure {
return try await loadComposerDraftThreadRootClosure(threadRoot)
} else {
return loadComposerDraftThreadRootReturnValue
}
}
//MARK: - loadOrFetchEvent
open var loadOrFetchEventEventIdThrowableError: Error?
private let loadOrFetchEventEventIdCallsCountLock = NSLock()
private var loadOrFetchEventEventIdUnderlyingCallsCount = 0
open var loadOrFetchEventEventIdCallsCount: Int {
get { loadOrFetchEventEventIdCallsCountLock.withLock { loadOrFetchEventEventIdUnderlyingCallsCount } }
set { loadOrFetchEventEventIdCallsCountLock.withLock { loadOrFetchEventEventIdUnderlyingCallsCount = newValue } }
}
open var loadOrFetchEventEventIdCalled: Bool {
return loadOrFetchEventEventIdCallsCount > 0
}
private let loadOrFetchEventEventIdReceivedEventIdLock = NSLock()
private var loadOrFetchEventEventIdUnderlyingReceivedEventId: String?
open var loadOrFetchEventEventIdReceivedEventId: String? {
get { loadOrFetchEventEventIdReceivedEventIdLock.withLock { loadOrFetchEventEventIdUnderlyingReceivedEventId } }
set { loadOrFetchEventEventIdReceivedEventIdLock.withLock { loadOrFetchEventEventIdUnderlyingReceivedEventId = newValue } }
}
private let loadOrFetchEventEventIdReceivedInvocationsLock = NSLock()
private var loadOrFetchEventEventIdUnderlyingReceivedInvocations: [String] = []
open var loadOrFetchEventEventIdReceivedInvocations: [String] {
get { loadOrFetchEventEventIdReceivedInvocationsLock.withLock { loadOrFetchEventEventIdUnderlyingReceivedInvocations } }
set { loadOrFetchEventEventIdReceivedInvocationsLock.withLock { loadOrFetchEventEventIdUnderlyingReceivedInvocations = newValue } }
}
private let loadOrFetchEventEventIdReturnValueLock = NSLock()
open var loadOrFetchEventEventIdUnderlyingReturnValue: TimelineEvent!
open var loadOrFetchEventEventIdReturnValue: TimelineEvent! {
get { loadOrFetchEventEventIdReturnValueLock.withLock { loadOrFetchEventEventIdUnderlyingReturnValue } }
set { loadOrFetchEventEventIdReturnValueLock.withLock { loadOrFetchEventEventIdUnderlyingReturnValue = newValue } }
}
open var loadOrFetchEventEventIdClosure: ((String) async throws -> TimelineEvent)?
open override func loadOrFetchEvent(eventId: String) async throws -> TimelineEvent {
if let error = loadOrFetchEventEventIdThrowableError {
throw error
}
loadOrFetchEventEventIdCallsCountLock.withLock { loadOrFetchEventEventIdUnderlyingCallsCount += 1 }
loadOrFetchEventEventIdReceivedEventId = eventId
loadOrFetchEventEventIdReceivedInvocationsLock.withLock { loadOrFetchEventEventIdUnderlyingReceivedInvocations.append(eventId) }
if let loadOrFetchEventEventIdClosure = loadOrFetchEventEventIdClosure {
return try await loadOrFetchEventEventIdClosure(eventId)
} else {
return loadOrFetchEventEventIdReturnValue
}
}
//MARK: - loadOrFetchEventWithRelations
open var loadOrFetchEventWithRelationsEventIdRelationFilterThrowableError: Error?
private let loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock = NSLock()
private var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount = 0
open var loadOrFetchEventWithRelationsEventIdRelationFilterCallsCount: Int {
get { loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount } }
set { loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount = newValue } }
}
open var loadOrFetchEventWithRelationsEventIdRelationFilterCalled: Bool {
return loadOrFetchEventWithRelationsEventIdRelationFilterCallsCount > 0
}
private let loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArgumentsLock = NSLock()
private var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedArguments: (eventId: String, relationFilter: [RelationType]?)?
open var loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArguments: (eventId: String, relationFilter: [RelationType]?)? {
get { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArgumentsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedArguments } }
set { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArgumentsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedArguments = newValue } }
}
private let loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock = NSLock()
private var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations: [(eventId: String, relationFilter: [RelationType]?)] = []
open var loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocations: [(eventId: String, relationFilter: [RelationType]?)] {
get { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations } }
set { loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations = newValue } }
}
private let loadOrFetchEventWithRelationsEventIdRelationFilterReturnValueLock = NSLock()
open var loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReturnValue: EventWithRelations!
open var loadOrFetchEventWithRelationsEventIdRelationFilterReturnValue: EventWithRelations! {
get { loadOrFetchEventWithRelationsEventIdRelationFilterReturnValueLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReturnValue } }
set { loadOrFetchEventWithRelationsEventIdRelationFilterReturnValueLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReturnValue = newValue } }
}
open var loadOrFetchEventWithRelationsEventIdRelationFilterClosure: ((String, [RelationType]?) async throws -> EventWithRelations)?
open override func loadOrFetchEventWithRelations(eventId: String, relationFilter: [RelationType]?) async throws -> EventWithRelations {
if let error = loadOrFetchEventWithRelationsEventIdRelationFilterThrowableError {
throw error
}
loadOrFetchEventWithRelationsEventIdRelationFilterCallsCountLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingCallsCount += 1 }
loadOrFetchEventWithRelationsEventIdRelationFilterReceivedArguments = (eventId: eventId, relationFilter: relationFilter)
loadOrFetchEventWithRelationsEventIdRelationFilterReceivedInvocationsLock.withLock { loadOrFetchEventWithRelationsEventIdRelationFilterUnderlyingReceivedInvocations.append((eventId: eventId, relationFilter: relationFilter)) }
if let loadOrFetchEventWithRelationsEventIdRelationFilterClosure = loadOrFetchEventWithRelationsEventIdRelationFilterClosure {
return try await loadOrFetchEventWithRelationsEventIdRelationFilterClosure(eventId, relationFilter)
} else {
return loadOrFetchEventWithRelationsEventIdRelationFilterReturnValue
}
}
//MARK: - loadUserReceipt
open var loadUserReceiptReceiptTypeThreadUserIdThrowableError: Error?
private let loadUserReceiptReceiptTypeThreadUserIdCallsCountLock = NSLock()
private var loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount = 0
open var loadUserReceiptReceiptTypeThreadUserIdCallsCount: Int {
get { loadUserReceiptReceiptTypeThreadUserIdCallsCountLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount } }
set { loadUserReceiptReceiptTypeThreadUserIdCallsCountLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount = newValue } }
}
open var loadUserReceiptReceiptTypeThreadUserIdCalled: Bool {
return loadUserReceiptReceiptTypeThreadUserIdCallsCount > 0
}
private let loadUserReceiptReceiptTypeThreadUserIdReceivedArgumentsLock = NSLock()
private var loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, userId: String)?
open var loadUserReceiptReceiptTypeThreadUserIdReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, userId: String)? {
get { loadUserReceiptReceiptTypeThreadUserIdReceivedArgumentsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedArguments } }
set { loadUserReceiptReceiptTypeThreadUserIdReceivedArgumentsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedArguments = newValue } }
}
private let loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock = NSLock()
private var loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, userId: String)] = []
open var loadUserReceiptReceiptTypeThreadUserIdReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, userId: String)] {
get { loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations } }
set { loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations = newValue } }
}
private let loadUserReceiptReceiptTypeThreadUserIdReturnValueLock = NSLock()
open var loadUserReceiptReceiptTypeThreadUserIdUnderlyingReturnValue: UserReceipt?
open var loadUserReceiptReceiptTypeThreadUserIdReturnValue: UserReceipt? {
get { loadUserReceiptReceiptTypeThreadUserIdReturnValueLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReturnValue } }
set { loadUserReceiptReceiptTypeThreadUserIdReturnValueLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReturnValue = newValue } }
}
open var loadUserReceiptReceiptTypeThreadUserIdClosure: ((ReceiptType, ReceiptThread, String) async throws -> UserReceipt?)?
open override func loadUserReceipt(receiptType: ReceiptType, thread: ReceiptThread, userId: String) async throws -> UserReceipt? {
if let error = loadUserReceiptReceiptTypeThreadUserIdThrowableError {
throw error
}
loadUserReceiptReceiptTypeThreadUserIdCallsCountLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingCallsCount += 1 }
loadUserReceiptReceiptTypeThreadUserIdReceivedArguments = (receiptType: receiptType, thread: thread, userId: userId)
loadUserReceiptReceiptTypeThreadUserIdReceivedInvocationsLock.withLock { loadUserReceiptReceiptTypeThreadUserIdUnderlyingReceivedInvocations.append((receiptType: receiptType, thread: thread, userId: userId)) }
if let loadUserReceiptReceiptTypeThreadUserIdClosure = loadUserReceiptReceiptTypeThreadUserIdClosure {
return try await loadUserReceiptReceiptTypeThreadUserIdClosure(receiptType, thread, userId)
} else {
return loadUserReceiptReceiptTypeThreadUserIdReturnValue
}
}
//MARK: - markAsFullyReadUnchecked
open var markAsFullyReadUncheckedEventIdThrowableError: Error?
private let markAsFullyReadUncheckedEventIdCallsCountLock = NSLock()
private var markAsFullyReadUncheckedEventIdUnderlyingCallsCount = 0
open var markAsFullyReadUncheckedEventIdCallsCount: Int {
get { markAsFullyReadUncheckedEventIdCallsCountLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingCallsCount } }
set { markAsFullyReadUncheckedEventIdCallsCountLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingCallsCount = newValue } }
}
open var markAsFullyReadUncheckedEventIdCalled: Bool {
return markAsFullyReadUncheckedEventIdCallsCount > 0
}
private let markAsFullyReadUncheckedEventIdReceivedEventIdLock = NSLock()
private var markAsFullyReadUncheckedEventIdUnderlyingReceivedEventId: String?
open var markAsFullyReadUncheckedEventIdReceivedEventId: String? {
get { markAsFullyReadUncheckedEventIdReceivedEventIdLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingReceivedEventId } }
set { markAsFullyReadUncheckedEventIdReceivedEventIdLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingReceivedEventId = newValue } }
}
private let markAsFullyReadUncheckedEventIdReceivedInvocationsLock = NSLock()
private var markAsFullyReadUncheckedEventIdUnderlyingReceivedInvocations: [String] = []
open var markAsFullyReadUncheckedEventIdReceivedInvocations: [String] {
get { markAsFullyReadUncheckedEventIdReceivedInvocationsLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingReceivedInvocations } }
set { markAsFullyReadUncheckedEventIdReceivedInvocationsLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingReceivedInvocations = newValue } }
}
open var markAsFullyReadUncheckedEventIdClosure: ((String) async throws -> Void)?
open override func markAsFullyReadUnchecked(eventId: String) async throws {
if let error = markAsFullyReadUncheckedEventIdThrowableError {
throw error
}
markAsFullyReadUncheckedEventIdCallsCountLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingCallsCount += 1 }
markAsFullyReadUncheckedEventIdReceivedEventId = eventId
markAsFullyReadUncheckedEventIdReceivedInvocationsLock.withLock { markAsFullyReadUncheckedEventIdUnderlyingReceivedInvocations.append(eventId) }
try await markAsFullyReadUncheckedEventIdClosure?(eventId)
}
//MARK: - markAsRead
open var markAsReadReceiptTypeThrowableError: Error?
private let markAsReadReceiptTypeCallsCountLock = NSLock()
private var markAsReadReceiptTypeUnderlyingCallsCount = 0
open var markAsReadReceiptTypeCallsCount: Int {
get { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount } }
set { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount = newValue } }
}
open var markAsReadReceiptTypeCalled: Bool {
return markAsReadReceiptTypeCallsCount > 0
}
private let markAsReadReceiptTypeReceivedReceiptTypeLock = NSLock()
private var markAsReadReceiptTypeUnderlyingReceivedReceiptType: ReceiptType?
open var markAsReadReceiptTypeReceivedReceiptType: ReceiptType? {
get { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType } }
set { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType = newValue } }
}
private let markAsReadReceiptTypeReceivedInvocationsLock = NSLock()
private var markAsReadReceiptTypeUnderlyingReceivedInvocations: [ReceiptType] = []
open var markAsReadReceiptTypeReceivedInvocations: [ReceiptType] {
get { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations } }
set { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations = newValue } }
}
open var markAsReadReceiptTypeClosure: ((ReceiptType) async throws -> Void)?
open override func markAsRead(receiptType: ReceiptType) async throws {
if let error = markAsReadReceiptTypeThrowableError {
throw error
}
markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount += 1 }
markAsReadReceiptTypeReceivedReceiptType = receiptType
markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations.append(receiptType) }
try await markAsReadReceiptTypeClosure?(receiptType)
}
//MARK: - matrixToEventPermalink
open var matrixToEventPermalinkEventIdThrowableError: Error?
private let matrixToEventPermalinkEventIdCallsCountLock = NSLock()
private var matrixToEventPermalinkEventIdUnderlyingCallsCount = 0
open var matrixToEventPermalinkEventIdCallsCount: Int {
get { matrixToEventPermalinkEventIdCallsCountLock.withLock { matrixToEventPermalinkEventIdUnderlyingCallsCount } }
set { matrixToEventPermalinkEventIdCallsCountLock.withLock { matrixToEventPermalinkEventIdUnderlyingCallsCount = newValue } }
}
open var matrixToEventPermalinkEventIdCalled: Bool {
return matrixToEventPermalinkEventIdCallsCount > 0
}
private let matrixToEventPermalinkEventIdReceivedEventIdLock = NSLock()
private var matrixToEventPermalinkEventIdUnderlyingReceivedEventId: String?
open var matrixToEventPermalinkEventIdReceivedEventId: String? {
get { matrixToEventPermalinkEventIdReceivedEventIdLock.withLock { matrixToEventPermalinkEventIdUnderlyingReceivedEventId } }
set { matrixToEventPermalinkEventIdReceivedEventIdLock.withLock { matrixToEventPermalinkEventIdUnderlyingReceivedEventId = newValue } }
}
private let matrixToEventPermalinkEventIdReceivedInvocationsLock = NSLock()
private var matrixToEventPermalinkEventIdUnderlyingReceivedInvocations: [String] = []
open var matrixToEventPermalinkEventIdReceivedInvocations: [String] {
get { matrixToEventPermalinkEventIdReceivedInvocationsLock.withLock { matrixToEventPermalinkEventIdUnderlyingReceivedInvocations } }
set { matrixToEventPermalinkEventIdReceivedInvocationsLock.withLock { matrixToEventPermalinkEventIdUnderlyingReceivedInvocations = newValue } }
}
private let matrixToEventPermalinkEventIdReturnValueLock = NSLock()
open var matrixToEventPermalinkEventIdUnderlyingReturnValue: String!
open var matrixToEventPermalinkEventIdReturnValue: String! {
get { matrixToEventPermalinkEventIdReturnValueLock.withLock { matrixToEventPermalinkEventIdUnderlyingReturnValue } }
set { matrixToEventPermalinkEventIdReturnValueLock.withLock { matrixToEventPermalinkEventIdUnderlyingReturnValue = newValue } }
}
open var matrixToEventPermalinkEventIdClosure: ((String) async throws -> String)?
open override func matrixToEventPermalink(eventId: String) async throws -> String {
if let error = matrixToEventPermalinkEventIdThrowableError {
throw error
}
matrixToEventPermalinkEventIdCallsCountLock.withLock { matrixToEventPermalinkEventIdUnderlyingCallsCount += 1 }
matrixToEventPermalinkEventIdReceivedEventId = eventId
matrixToEventPermalinkEventIdReceivedInvocationsLock.withLock { matrixToEventPermalinkEventIdUnderlyingReceivedInvocations.append(eventId) }
if let matrixToEventPermalinkEventIdClosure = matrixToEventPermalinkEventIdClosure {
return try await matrixToEventPermalinkEventIdClosure(eventId)
} else {
return matrixToEventPermalinkEventIdReturnValue
}
}
//MARK: - matrixToPermalink
open var matrixToPermalinkThrowableError: Error?
private let matrixToPermalinkCallsCountLock = NSLock()
private var matrixToPermalinkUnderlyingCallsCount = 0
open var matrixToPermalinkCallsCount: Int {
get { matrixToPermalinkCallsCountLock.withLock { matrixToPermalinkUnderlyingCallsCount } }
set { matrixToPermalinkCallsCountLock.withLock { matrixToPermalinkUnderlyingCallsCount = newValue } }
}
open var matrixToPermalinkCalled: Bool {
return matrixToPermalinkCallsCount > 0
}
private let matrixToPermalinkReturnValueLock = NSLock()
open var matrixToPermalinkUnderlyingReturnValue: String!
open var matrixToPermalinkReturnValue: String! {
get { matrixToPermalinkReturnValueLock.withLock { matrixToPermalinkUnderlyingReturnValue } }
set { matrixToPermalinkReturnValueLock.withLock { matrixToPermalinkUnderlyingReturnValue = newValue } }
}
open var matrixToPermalinkClosure: (() async throws -> String)?
open override func matrixToPermalink() async throws -> String {
if let error = matrixToPermalinkThrowableError {
throw error
}
matrixToPermalinkCallsCountLock.withLock { matrixToPermalinkUnderlyingCallsCount += 1 }
if let matrixToPermalinkClosure = matrixToPermalinkClosure {
return try await matrixToPermalinkClosure()
} else {
return matrixToPermalinkReturnValue
}
}
//MARK: - member
open var memberUserIdThrowableError: Error?
private let memberUserIdCallsCountLock = NSLock()
private var memberUserIdUnderlyingCallsCount = 0
open var memberUserIdCallsCount: Int {
get { memberUserIdCallsCountLock.withLock { memberUserIdUnderlyingCallsCount } }
set { memberUserIdCallsCountLock.withLock { memberUserIdUnderlyingCallsCount = newValue } }
}
open var memberUserIdCalled: Bool {
return memberUserIdCallsCount > 0
}
private let memberUserIdReceivedUserIdLock = NSLock()
private var memberUserIdUnderlyingReceivedUserId: String?
open var memberUserIdReceivedUserId: String? {
get { memberUserIdReceivedUserIdLock.withLock { memberUserIdUnderlyingReceivedUserId } }
set { memberUserIdReceivedUserIdLock.withLock { memberUserIdUnderlyingReceivedUserId = newValue } }
}
private let memberUserIdReceivedInvocationsLock = NSLock()
private var memberUserIdUnderlyingReceivedInvocations: [String] = []
open var memberUserIdReceivedInvocations: [String] {
get { memberUserIdReceivedInvocationsLock.withLock { memberUserIdUnderlyingReceivedInvocations } }
set { memberUserIdReceivedInvocationsLock.withLock { memberUserIdUnderlyingReceivedInvocations = newValue } }
}
private let memberUserIdReturnValueLock = NSLock()
open var memberUserIdUnderlyingReturnValue: RoomMember!
open var memberUserIdReturnValue: RoomMember! {
get { memberUserIdReturnValueLock.withLock { memberUserIdUnderlyingReturnValue } }
set { memberUserIdReturnValueLock.withLock { memberUserIdUnderlyingReturnValue = newValue } }
}
open var memberUserIdClosure: ((String) async throws -> RoomMember)?
open override func member(userId: String) async throws -> RoomMember {
if let error = memberUserIdThrowableError {
throw error
}
memberUserIdCallsCountLock.withLock { memberUserIdUnderlyingCallsCount += 1 }
memberUserIdReceivedUserId = userId
memberUserIdReceivedInvocationsLock.withLock { memberUserIdUnderlyingReceivedInvocations.append(userId) }
if let memberUserIdClosure = memberUserIdClosure {
return try await memberUserIdClosure(userId)
} else {
return memberUserIdReturnValue
}
}
//MARK: - memberAvatarUrl
open var memberAvatarUrlUserIdThrowableError: Error?
private let memberAvatarUrlUserIdCallsCountLock = NSLock()
private var memberAvatarUrlUserIdUnderlyingCallsCount = 0
open var memberAvatarUrlUserIdCallsCount: Int {
get { memberAvatarUrlUserIdCallsCountLock.withLock { memberAvatarUrlUserIdUnderlyingCallsCount } }
set { memberAvatarUrlUserIdCallsCountLock.withLock { memberAvatarUrlUserIdUnderlyingCallsCount = newValue } }
}
open var memberAvatarUrlUserIdCalled: Bool {
return memberAvatarUrlUserIdCallsCount > 0
}
private let memberAvatarUrlUserIdReceivedUserIdLock = NSLock()
private var memberAvatarUrlUserIdUnderlyingReceivedUserId: String?
open var memberAvatarUrlUserIdReceivedUserId: String? {
get { memberAvatarUrlUserIdReceivedUserIdLock.withLock { memberAvatarUrlUserIdUnderlyingReceivedUserId } }
set { memberAvatarUrlUserIdReceivedUserIdLock.withLock { memberAvatarUrlUserIdUnderlyingReceivedUserId = newValue } }
}
private let memberAvatarUrlUserIdReceivedInvocationsLock = NSLock()
private var memberAvatarUrlUserIdUnderlyingReceivedInvocations: [String] = []
open var memberAvatarUrlUserIdReceivedInvocations: [String] {
get { memberAvatarUrlUserIdReceivedInvocationsLock.withLock { memberAvatarUrlUserIdUnderlyingReceivedInvocations } }
set { memberAvatarUrlUserIdReceivedInvocationsLock.withLock { memberAvatarUrlUserIdUnderlyingReceivedInvocations = newValue } }
}
private let memberAvatarUrlUserIdReturnValueLock = NSLock()
open var memberAvatarUrlUserIdUnderlyingReturnValue: String?
open var memberAvatarUrlUserIdReturnValue: String? {
get { memberAvatarUrlUserIdReturnValueLock.withLock { memberAvatarUrlUserIdUnderlyingReturnValue } }
set { memberAvatarUrlUserIdReturnValueLock.withLock { memberAvatarUrlUserIdUnderlyingReturnValue = newValue } }
}
open var memberAvatarUrlUserIdClosure: ((String) async throws -> String?)?
open override func memberAvatarUrl(userId: String) async throws -> String? {
if let error = memberAvatarUrlUserIdThrowableError {
throw error
}
memberAvatarUrlUserIdCallsCountLock.withLock { memberAvatarUrlUserIdUnderlyingCallsCount += 1 }
memberAvatarUrlUserIdReceivedUserId = userId
memberAvatarUrlUserIdReceivedInvocationsLock.withLock { memberAvatarUrlUserIdUnderlyingReceivedInvocations.append(userId) }
if let memberAvatarUrlUserIdClosure = memberAvatarUrlUserIdClosure {
return try await memberAvatarUrlUserIdClosure(userId)
} else {
return memberAvatarUrlUserIdReturnValue
}
}
//MARK: - memberDisplayName
open var memberDisplayNameUserIdThrowableError: Error?
private let memberDisplayNameUserIdCallsCountLock = NSLock()
private var memberDisplayNameUserIdUnderlyingCallsCount = 0
open var memberDisplayNameUserIdCallsCount: Int {
get { memberDisplayNameUserIdCallsCountLock.withLock { memberDisplayNameUserIdUnderlyingCallsCount } }
set { memberDisplayNameUserIdCallsCountLock.withLock { memberDisplayNameUserIdUnderlyingCallsCount = newValue } }
}
open var memberDisplayNameUserIdCalled: Bool {
return memberDisplayNameUserIdCallsCount > 0
}
private let memberDisplayNameUserIdReceivedUserIdLock = NSLock()
private var memberDisplayNameUserIdUnderlyingReceivedUserId: String?
open var memberDisplayNameUserIdReceivedUserId: String? {
get { memberDisplayNameUserIdReceivedUserIdLock.withLock { memberDisplayNameUserIdUnderlyingReceivedUserId } }
set { memberDisplayNameUserIdReceivedUserIdLock.withLock { memberDisplayNameUserIdUnderlyingReceivedUserId = newValue } }
}
private let memberDisplayNameUserIdReceivedInvocationsLock = NSLock()
private var memberDisplayNameUserIdUnderlyingReceivedInvocations: [String] = []
open var memberDisplayNameUserIdReceivedInvocations: [String] {
get { memberDisplayNameUserIdReceivedInvocationsLock.withLock { memberDisplayNameUserIdUnderlyingReceivedInvocations } }
set { memberDisplayNameUserIdReceivedInvocationsLock.withLock { memberDisplayNameUserIdUnderlyingReceivedInvocations = newValue } }
}
private let memberDisplayNameUserIdReturnValueLock = NSLock()
open var memberDisplayNameUserIdUnderlyingReturnValue: String?
open var memberDisplayNameUserIdReturnValue: String? {
get { memberDisplayNameUserIdReturnValueLock.withLock { memberDisplayNameUserIdUnderlyingReturnValue } }
set { memberDisplayNameUserIdReturnValueLock.withLock { memberDisplayNameUserIdUnderlyingReturnValue = newValue } }
}
open var memberDisplayNameUserIdClosure: ((String) async throws -> String?)?
open override func memberDisplayName(userId: String) async throws -> String? {
if let error = memberDisplayNameUserIdThrowableError {
throw error
}
memberDisplayNameUserIdCallsCountLock.withLock { memberDisplayNameUserIdUnderlyingCallsCount += 1 }
memberDisplayNameUserIdReceivedUserId = userId
memberDisplayNameUserIdReceivedInvocationsLock.withLock { memberDisplayNameUserIdUnderlyingReceivedInvocations.append(userId) }
if let memberDisplayNameUserIdClosure = memberDisplayNameUserIdClosure {
return try await memberDisplayNameUserIdClosure(userId)
} else {
return memberDisplayNameUserIdReturnValue
}
}
//MARK: - memberWithSenderInfo
open var memberWithSenderInfoUserIdThrowableError: Error?
private let memberWithSenderInfoUserIdCallsCountLock = NSLock()
private var memberWithSenderInfoUserIdUnderlyingCallsCount = 0
open var memberWithSenderInfoUserIdCallsCount: Int {
get { memberWithSenderInfoUserIdCallsCountLock.withLock { memberWithSenderInfoUserIdUnderlyingCallsCount } }
set { memberWithSenderInfoUserIdCallsCountLock.withLock { memberWithSenderInfoUserIdUnderlyingCallsCount = newValue } }
}
open var memberWithSenderInfoUserIdCalled: Bool {
return memberWithSenderInfoUserIdCallsCount > 0
}
private let memberWithSenderInfoUserIdReceivedUserIdLock = NSLock()
private var memberWithSenderInfoUserIdUnderlyingReceivedUserId: String?
open var memberWithSenderInfoUserIdReceivedUserId: String? {
get { memberWithSenderInfoUserIdReceivedUserIdLock.withLock { memberWithSenderInfoUserIdUnderlyingReceivedUserId } }
set { memberWithSenderInfoUserIdReceivedUserIdLock.withLock { memberWithSenderInfoUserIdUnderlyingReceivedUserId = newValue } }
}
private let memberWithSenderInfoUserIdReceivedInvocationsLock = NSLock()
private var memberWithSenderInfoUserIdUnderlyingReceivedInvocations: [String] = []
open var memberWithSenderInfoUserIdReceivedInvocations: [String] {
get { memberWithSenderInfoUserIdReceivedInvocationsLock.withLock { memberWithSenderInfoUserIdUnderlyingReceivedInvocations } }
set { memberWithSenderInfoUserIdReceivedInvocationsLock.withLock { memberWithSenderInfoUserIdUnderlyingReceivedInvocations = newValue } }
}
private let memberWithSenderInfoUserIdReturnValueLock = NSLock()
open var memberWithSenderInfoUserIdUnderlyingReturnValue: RoomMemberWithSenderInfo!
open var memberWithSenderInfoUserIdReturnValue: RoomMemberWithSenderInfo! {
get { memberWithSenderInfoUserIdReturnValueLock.withLock { memberWithSenderInfoUserIdUnderlyingReturnValue } }
set { memberWithSenderInfoUserIdReturnValueLock.withLock { memberWithSenderInfoUserIdUnderlyingReturnValue = newValue } }
}
open var memberWithSenderInfoUserIdClosure: ((String) async throws -> RoomMemberWithSenderInfo)?
open override func memberWithSenderInfo(userId: String) async throws -> RoomMemberWithSenderInfo {
if let error = memberWithSenderInfoUserIdThrowableError {
throw error
}
memberWithSenderInfoUserIdCallsCountLock.withLock { memberWithSenderInfoUserIdUnderlyingCallsCount += 1 }
memberWithSenderInfoUserIdReceivedUserId = userId
memberWithSenderInfoUserIdReceivedInvocationsLock.withLock { memberWithSenderInfoUserIdUnderlyingReceivedInvocations.append(userId) }
if let memberWithSenderInfoUserIdClosure = memberWithSenderInfoUserIdClosure {
return try await memberWithSenderInfoUserIdClosure(userId)
} else {
return memberWithSenderInfoUserIdReturnValue
}
}
//MARK: - members
open var membersThrowableError: Error?
private let membersCallsCountLock = NSLock()
private var membersUnderlyingCallsCount = 0
open var membersCallsCount: Int {
get { membersCallsCountLock.withLock { membersUnderlyingCallsCount } }
set { membersCallsCountLock.withLock { membersUnderlyingCallsCount = newValue } }
}
open var membersCalled: Bool {
return membersCallsCount > 0
}
private let membersReturnValueLock = NSLock()
open var membersUnderlyingReturnValue: RoomMembersIterator!
open var membersReturnValue: RoomMembersIterator! {
get { membersReturnValueLock.withLock { membersUnderlyingReturnValue } }
set { membersReturnValueLock.withLock { membersUnderlyingReturnValue = newValue } }
}
open var membersClosure: (() async throws -> RoomMembersIterator)?
open override func members() async throws -> RoomMembersIterator {
if let error = membersThrowableError {
throw error
}
membersCallsCountLock.withLock { membersUnderlyingCallsCount += 1 }
if let membersClosure = membersClosure {
return try await membersClosure()
} else {
return membersReturnValue
}
}
//MARK: - membersNoSync
open var membersNoSyncThrowableError: Error?
private let membersNoSyncCallsCountLock = NSLock()
private var membersNoSyncUnderlyingCallsCount = 0
open var membersNoSyncCallsCount: Int {
get { membersNoSyncCallsCountLock.withLock { membersNoSyncUnderlyingCallsCount } }
set { membersNoSyncCallsCountLock.withLock { membersNoSyncUnderlyingCallsCount = newValue } }
}
open var membersNoSyncCalled: Bool {
return membersNoSyncCallsCount > 0
}
private let membersNoSyncReturnValueLock = NSLock()
open var membersNoSyncUnderlyingReturnValue: RoomMembersIterator!
open var membersNoSyncReturnValue: RoomMembersIterator! {
get { membersNoSyncReturnValueLock.withLock { membersNoSyncUnderlyingReturnValue } }
set { membersNoSyncReturnValueLock.withLock { membersNoSyncUnderlyingReturnValue = newValue } }
}
open var membersNoSyncClosure: (() async throws -> RoomMembersIterator)?
open override func membersNoSync() async throws -> RoomMembersIterator {
if let error = membersNoSyncThrowableError {
throw error
}
membersNoSyncCallsCountLock.withLock { membersNoSyncUnderlyingCallsCount += 1 }
if let membersNoSyncClosure = membersNoSyncClosure {
return try await membersNoSyncClosure()
} else {
return membersNoSyncReturnValue
}
}
//MARK: - membership
private let membershipCallsCountLock = NSLock()
private var membershipUnderlyingCallsCount = 0
open var membershipCallsCount: Int {
get { membershipCallsCountLock.withLock { membershipUnderlyingCallsCount } }
set { membershipCallsCountLock.withLock { membershipUnderlyingCallsCount = newValue } }
}
open var membershipCalled: Bool {
return membershipCallsCount > 0
}
private let membershipReturnValueLock = NSLock()
open var membershipUnderlyingReturnValue: Membership!
open var membershipReturnValue: Membership! {
get { membershipReturnValueLock.withLock { membershipUnderlyingReturnValue } }
set { membershipReturnValueLock.withLock { membershipUnderlyingReturnValue = newValue } }
}
open var membershipClosure: (() -> Membership)?
open override func membership() -> Membership {
membershipCallsCountLock.withLock { membershipUnderlyingCallsCount += 1 }
if let membershipClosure = membershipClosure {
return membershipClosure()
} else {
return membershipReturnValue
}
}
//MARK: - ownUserId
private let ownUserIdCallsCountLock = NSLock()
private var ownUserIdUnderlyingCallsCount = 0
open var ownUserIdCallsCount: Int {
get { ownUserIdCallsCountLock.withLock { ownUserIdUnderlyingCallsCount } }
set { ownUserIdCallsCountLock.withLock { ownUserIdUnderlyingCallsCount = newValue } }
}
open var ownUserIdCalled: Bool {
return ownUserIdCallsCount > 0
}
private let ownUserIdReturnValueLock = NSLock()
open var ownUserIdUnderlyingReturnValue: String!
open var ownUserIdReturnValue: String! {
get { ownUserIdReturnValueLock.withLock { ownUserIdUnderlyingReturnValue } }
set { ownUserIdReturnValueLock.withLock { ownUserIdUnderlyingReturnValue = newValue } }
}
open var ownUserIdClosure: (() -> String)?
open override func ownUserId() -> String {
ownUserIdCallsCountLock.withLock { ownUserIdUnderlyingCallsCount += 1 }
if let ownUserIdClosure = ownUserIdClosure {
return ownUserIdClosure()
} else {
return ownUserIdReturnValue
}
}
//MARK: - predecessorRoom
private let predecessorRoomCallsCountLock = NSLock()
private var predecessorRoomUnderlyingCallsCount = 0
open var predecessorRoomCallsCount: Int {
get { predecessorRoomCallsCountLock.withLock { predecessorRoomUnderlyingCallsCount } }
set { predecessorRoomCallsCountLock.withLock { predecessorRoomUnderlyingCallsCount = newValue } }
}
open var predecessorRoomCalled: Bool {
return predecessorRoomCallsCount > 0
}
private let predecessorRoomReturnValueLock = NSLock()
open var predecessorRoomUnderlyingReturnValue: PredecessorRoom?
open var predecessorRoomReturnValue: PredecessorRoom? {
get { predecessorRoomReturnValueLock.withLock { predecessorRoomUnderlyingReturnValue } }
set { predecessorRoomReturnValueLock.withLock { predecessorRoomUnderlyingReturnValue = newValue } }
}
open var predecessorRoomClosure: (() -> PredecessorRoom?)?
open override func predecessorRoom() -> PredecessorRoom? {
predecessorRoomCallsCountLock.withLock { predecessorRoomUnderlyingCallsCount += 1 }
if let predecessorRoomClosure = predecessorRoomClosure {
return predecessorRoomClosure()
} else {
return predecessorRoomReturnValue
}
}
//MARK: - previewRoom
open var previewRoomViaThrowableError: Error?
private let previewRoomViaCallsCountLock = NSLock()
private var previewRoomViaUnderlyingCallsCount = 0
open var previewRoomViaCallsCount: Int {
get { previewRoomViaCallsCountLock.withLock { previewRoomViaUnderlyingCallsCount } }
set { previewRoomViaCallsCountLock.withLock { previewRoomViaUnderlyingCallsCount = newValue } }
}
open var previewRoomViaCalled: Bool {
return previewRoomViaCallsCount > 0
}
private let previewRoomViaReceivedViaLock = NSLock()
private var previewRoomViaUnderlyingReceivedVia: [String]?
open var previewRoomViaReceivedVia: [String]? {
get { previewRoomViaReceivedViaLock.withLock { previewRoomViaUnderlyingReceivedVia } }
set { previewRoomViaReceivedViaLock.withLock { previewRoomViaUnderlyingReceivedVia = newValue } }
}
private let previewRoomViaReceivedInvocationsLock = NSLock()
private var previewRoomViaUnderlyingReceivedInvocations: [[String]] = []
open var previewRoomViaReceivedInvocations: [[String]] {
get { previewRoomViaReceivedInvocationsLock.withLock { previewRoomViaUnderlyingReceivedInvocations } }
set { previewRoomViaReceivedInvocationsLock.withLock { previewRoomViaUnderlyingReceivedInvocations = newValue } }
}
private let previewRoomViaReturnValueLock = NSLock()
open var previewRoomViaUnderlyingReturnValue: RoomPreview!
open var previewRoomViaReturnValue: RoomPreview! {
get { previewRoomViaReturnValueLock.withLock { previewRoomViaUnderlyingReturnValue } }
set { previewRoomViaReturnValueLock.withLock { previewRoomViaUnderlyingReturnValue = newValue } }
}
open var previewRoomViaClosure: (([String]) async throws -> RoomPreview)?
open override func previewRoom(via: [String]) async throws -> RoomPreview {
if let error = previewRoomViaThrowableError {
throw error
}
previewRoomViaCallsCountLock.withLock { previewRoomViaUnderlyingCallsCount += 1 }
previewRoomViaReceivedVia = via
previewRoomViaReceivedInvocationsLock.withLock { previewRoomViaUnderlyingReceivedInvocations.append(via) }
if let previewRoomViaClosure = previewRoomViaClosure {
return try await previewRoomViaClosure(via)
} else {
return previewRoomViaReturnValue
}
}
//MARK: - publishRoomAliasInRoomDirectory
open var publishRoomAliasInRoomDirectoryAliasThrowableError: Error?
private let publishRoomAliasInRoomDirectoryAliasCallsCountLock = NSLock()
private var publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount = 0
open var publishRoomAliasInRoomDirectoryAliasCallsCount: Int {
get { publishRoomAliasInRoomDirectoryAliasCallsCountLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount } }
set { publishRoomAliasInRoomDirectoryAliasCallsCountLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount = newValue } }
}
open var publishRoomAliasInRoomDirectoryAliasCalled: Bool {
return publishRoomAliasInRoomDirectoryAliasCallsCount > 0
}
private let publishRoomAliasInRoomDirectoryAliasReceivedAliasLock = NSLock()
private var publishRoomAliasInRoomDirectoryAliasUnderlyingReceivedAlias: String?
open var publishRoomAliasInRoomDirectoryAliasReceivedAlias: String? {
get { publishRoomAliasInRoomDirectoryAliasReceivedAliasLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingReceivedAlias } }
set { publishRoomAliasInRoomDirectoryAliasReceivedAliasLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingReceivedAlias = newValue } }
}
private let publishRoomAliasInRoomDirectoryAliasReceivedInvocationsLock = NSLock()
private var publishRoomAliasInRoomDirectoryAliasUnderlyingReceivedInvocations: [String] = []
open var publishRoomAliasInRoomDirectoryAliasReceivedInvocations: [String] {
get { publishRoomAliasInRoomDirectoryAliasReceivedInvocationsLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingReceivedInvocations } }
set { publishRoomAliasInRoomDirectoryAliasReceivedInvocationsLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingReceivedInvocations = newValue } }
}
private let publishRoomAliasInRoomDirectoryAliasReturnValueLock = NSLock()
open var publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue: Bool!
open var publishRoomAliasInRoomDirectoryAliasReturnValue: Bool! {
get { publishRoomAliasInRoomDirectoryAliasReturnValueLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue } }
set { publishRoomAliasInRoomDirectoryAliasReturnValueLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingReturnValue = newValue } }
}
open var publishRoomAliasInRoomDirectoryAliasClosure: ((String) async throws -> Bool)?
open override func publishRoomAliasInRoomDirectory(alias: String) async throws -> Bool {
if let error = publishRoomAliasInRoomDirectoryAliasThrowableError {
throw error
}
publishRoomAliasInRoomDirectoryAliasCallsCountLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingCallsCount += 1 }
publishRoomAliasInRoomDirectoryAliasReceivedAlias = alias
publishRoomAliasInRoomDirectoryAliasReceivedInvocationsLock.withLock { publishRoomAliasInRoomDirectoryAliasUnderlyingReceivedInvocations.append(alias) }
if let publishRoomAliasInRoomDirectoryAliasClosure = publishRoomAliasInRoomDirectoryAliasClosure {
return try await publishRoomAliasInRoomDirectoryAliasClosure(alias)
} else {
return publishRoomAliasInRoomDirectoryAliasReturnValue
}
}
//MARK: - rawName
private let rawNameCallsCountLock = NSLock()
private var rawNameUnderlyingCallsCount = 0
open var rawNameCallsCount: Int {
get { rawNameCallsCountLock.withLock { rawNameUnderlyingCallsCount } }
set { rawNameCallsCountLock.withLock { rawNameUnderlyingCallsCount = newValue } }
}
open var rawNameCalled: Bool {
return rawNameCallsCount > 0
}
private let rawNameReturnValueLock = NSLock()
open var rawNameUnderlyingReturnValue: String?
open var rawNameReturnValue: String? {
get { rawNameReturnValueLock.withLock { rawNameUnderlyingReturnValue } }
set { rawNameReturnValueLock.withLock { rawNameUnderlyingReturnValue = newValue } }
}
open var rawNameClosure: (() -> String?)?
open override func rawName() -> String? {
rawNameCallsCountLock.withLock { rawNameUnderlyingCallsCount += 1 }
if let rawNameClosure = rawNameClosure {
return rawNameClosure()
} else {
return rawNameReturnValue
}
}
//MARK: - redact
open var redactEventIdReasonThrowableError: Error?
private let redactEventIdReasonCallsCountLock = NSLock()
private var redactEventIdReasonUnderlyingCallsCount = 0
open var redactEventIdReasonCallsCount: Int {
get { redactEventIdReasonCallsCountLock.withLock { redactEventIdReasonUnderlyingCallsCount } }
set { redactEventIdReasonCallsCountLock.withLock { redactEventIdReasonUnderlyingCallsCount = newValue } }
}
open var redactEventIdReasonCalled: Bool {
return redactEventIdReasonCallsCount > 0
}
private let redactEventIdReasonReceivedArgumentsLock = NSLock()
private var redactEventIdReasonUnderlyingReceivedArguments: (eventId: String, reason: String?)?
open var redactEventIdReasonReceivedArguments: (eventId: String, reason: String?)? {
get { redactEventIdReasonReceivedArgumentsLock.withLock { redactEventIdReasonUnderlyingReceivedArguments } }
set { redactEventIdReasonReceivedArgumentsLock.withLock { redactEventIdReasonUnderlyingReceivedArguments = newValue } }
}
private let redactEventIdReasonReceivedInvocationsLock = NSLock()
private var redactEventIdReasonUnderlyingReceivedInvocations: [(eventId: String, reason: String?)] = []
open var redactEventIdReasonReceivedInvocations: [(eventId: String, reason: String?)] {
get { redactEventIdReasonReceivedInvocationsLock.withLock { redactEventIdReasonUnderlyingReceivedInvocations } }
set { redactEventIdReasonReceivedInvocationsLock.withLock { redactEventIdReasonUnderlyingReceivedInvocations = newValue } }
}
open var redactEventIdReasonClosure: ((String, String?) async throws -> Void)?
open override func redact(eventId: String, reason: String?) async throws {
if let error = redactEventIdReasonThrowableError {
throw error
}
redactEventIdReasonCallsCountLock.withLock { redactEventIdReasonUnderlyingCallsCount += 1 }
redactEventIdReasonReceivedArguments = (eventId: eventId, reason: reason)
redactEventIdReasonReceivedInvocationsLock.withLock { redactEventIdReasonUnderlyingReceivedInvocations.append((eventId: eventId, reason: reason)) }
try await redactEventIdReasonClosure?(eventId, reason)
}
//MARK: - removeAvatar
open var removeAvatarThrowableError: Error?
private let removeAvatarCallsCountLock = NSLock()
private var removeAvatarUnderlyingCallsCount = 0
open var removeAvatarCallsCount: Int {
get { removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount } }
set { removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount = newValue } }
}
open var removeAvatarCalled: Bool {
return removeAvatarCallsCount > 0
}
open var removeAvatarClosure: (() async throws -> Void)?
open override func removeAvatar() async throws {
if let error = removeAvatarThrowableError {
throw error
}
removeAvatarCallsCountLock.withLock { removeAvatarUnderlyingCallsCount += 1 }
try await removeAvatarClosure?()
}
//MARK: - removeRoomAliasFromRoomDirectory
open var removeRoomAliasFromRoomDirectoryAliasThrowableError: Error?
private let removeRoomAliasFromRoomDirectoryAliasCallsCountLock = NSLock()
private var removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount = 0
open var removeRoomAliasFromRoomDirectoryAliasCallsCount: Int {
get { removeRoomAliasFromRoomDirectoryAliasCallsCountLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount } }
set { removeRoomAliasFromRoomDirectoryAliasCallsCountLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount = newValue } }
}
open var removeRoomAliasFromRoomDirectoryAliasCalled: Bool {
return removeRoomAliasFromRoomDirectoryAliasCallsCount > 0
}
private let removeRoomAliasFromRoomDirectoryAliasReceivedAliasLock = NSLock()
private var removeRoomAliasFromRoomDirectoryAliasUnderlyingReceivedAlias: String?
open var removeRoomAliasFromRoomDirectoryAliasReceivedAlias: String? {
get { removeRoomAliasFromRoomDirectoryAliasReceivedAliasLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingReceivedAlias } }
set { removeRoomAliasFromRoomDirectoryAliasReceivedAliasLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingReceivedAlias = newValue } }
}
private let removeRoomAliasFromRoomDirectoryAliasReceivedInvocationsLock = NSLock()
private var removeRoomAliasFromRoomDirectoryAliasUnderlyingReceivedInvocations: [String] = []
open var removeRoomAliasFromRoomDirectoryAliasReceivedInvocations: [String] {
get { removeRoomAliasFromRoomDirectoryAliasReceivedInvocationsLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingReceivedInvocations } }
set { removeRoomAliasFromRoomDirectoryAliasReceivedInvocationsLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingReceivedInvocations = newValue } }
}
private let removeRoomAliasFromRoomDirectoryAliasReturnValueLock = NSLock()
open var removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue: Bool!
open var removeRoomAliasFromRoomDirectoryAliasReturnValue: Bool! {
get { removeRoomAliasFromRoomDirectoryAliasReturnValueLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue } }
set { removeRoomAliasFromRoomDirectoryAliasReturnValueLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingReturnValue = newValue } }
}
open var removeRoomAliasFromRoomDirectoryAliasClosure: ((String) async throws -> Bool)?
open override func removeRoomAliasFromRoomDirectory(alias: String) async throws -> Bool {
if let error = removeRoomAliasFromRoomDirectoryAliasThrowableError {
throw error
}
removeRoomAliasFromRoomDirectoryAliasCallsCountLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingCallsCount += 1 }
removeRoomAliasFromRoomDirectoryAliasReceivedAlias = alias
removeRoomAliasFromRoomDirectoryAliasReceivedInvocationsLock.withLock { removeRoomAliasFromRoomDirectoryAliasUnderlyingReceivedInvocations.append(alias) }
if let removeRoomAliasFromRoomDirectoryAliasClosure = removeRoomAliasFromRoomDirectoryAliasClosure {
return try await removeRoomAliasFromRoomDirectoryAliasClosure(alias)
} else {
return removeRoomAliasFromRoomDirectoryAliasReturnValue
}
}
//MARK: - reportContent
open var reportContentEventIdReasonThrowableError: Error?
private let reportContentEventIdReasonCallsCountLock = NSLock()
private var reportContentEventIdReasonUnderlyingCallsCount = 0
open var reportContentEventIdReasonCallsCount: Int {
get { reportContentEventIdReasonCallsCountLock.withLock { reportContentEventIdReasonUnderlyingCallsCount } }
set { reportContentEventIdReasonCallsCountLock.withLock { reportContentEventIdReasonUnderlyingCallsCount = newValue } }
}
open var reportContentEventIdReasonCalled: Bool {
return reportContentEventIdReasonCallsCount > 0
}
private let reportContentEventIdReasonReceivedArgumentsLock = NSLock()
private var reportContentEventIdReasonUnderlyingReceivedArguments: (eventId: String, reason: String?)?
open var reportContentEventIdReasonReceivedArguments: (eventId: String, reason: String?)? {
get { reportContentEventIdReasonReceivedArgumentsLock.withLock { reportContentEventIdReasonUnderlyingReceivedArguments } }
set { reportContentEventIdReasonReceivedArgumentsLock.withLock { reportContentEventIdReasonUnderlyingReceivedArguments = newValue } }
}
private let reportContentEventIdReasonReceivedInvocationsLock = NSLock()
private var reportContentEventIdReasonUnderlyingReceivedInvocations: [(eventId: String, reason: String?)] = []
open var reportContentEventIdReasonReceivedInvocations: [(eventId: String, reason: String?)] {
get { reportContentEventIdReasonReceivedInvocationsLock.withLock { reportContentEventIdReasonUnderlyingReceivedInvocations } }
set { reportContentEventIdReasonReceivedInvocationsLock.withLock { reportContentEventIdReasonUnderlyingReceivedInvocations = newValue } }
}
open var reportContentEventIdReasonClosure: ((String, String?) async throws -> Void)?
open override func reportContent(eventId: String, reason: String?) async throws {
if let error = reportContentEventIdReasonThrowableError {
throw error
}
reportContentEventIdReasonCallsCountLock.withLock { reportContentEventIdReasonUnderlyingCallsCount += 1 }
reportContentEventIdReasonReceivedArguments = (eventId: eventId, reason: reason)
reportContentEventIdReasonReceivedInvocationsLock.withLock { reportContentEventIdReasonUnderlyingReceivedInvocations.append((eventId: eventId, reason: reason)) }
try await reportContentEventIdReasonClosure?(eventId, reason)
}
//MARK: - reportRoom
open var reportRoomReasonThrowableError: Error?
private let reportRoomReasonCallsCountLock = NSLock()
private var reportRoomReasonUnderlyingCallsCount = 0
open var reportRoomReasonCallsCount: Int {
get { reportRoomReasonCallsCountLock.withLock { reportRoomReasonUnderlyingCallsCount } }
set { reportRoomReasonCallsCountLock.withLock { reportRoomReasonUnderlyingCallsCount = newValue } }
}
open var reportRoomReasonCalled: Bool {
return reportRoomReasonCallsCount > 0
}
private let reportRoomReasonReceivedReasonLock = NSLock()
private var reportRoomReasonUnderlyingReceivedReason: String?
open var reportRoomReasonReceivedReason: String? {
get { reportRoomReasonReceivedReasonLock.withLock { reportRoomReasonUnderlyingReceivedReason } }
set { reportRoomReasonReceivedReasonLock.withLock { reportRoomReasonUnderlyingReceivedReason = newValue } }
}
private let reportRoomReasonReceivedInvocationsLock = NSLock()
private var reportRoomReasonUnderlyingReceivedInvocations: [String] = []
open var reportRoomReasonReceivedInvocations: [String] {
get { reportRoomReasonReceivedInvocationsLock.withLock { reportRoomReasonUnderlyingReceivedInvocations } }
set { reportRoomReasonReceivedInvocationsLock.withLock { reportRoomReasonUnderlyingReceivedInvocations = newValue } }
}
open var reportRoomReasonClosure: ((String) async throws -> Void)?
open override func reportRoom(reason: String) async throws {
if let error = reportRoomReasonThrowableError {
throw error
}
reportRoomReasonCallsCountLock.withLock { reportRoomReasonUnderlyingCallsCount += 1 }
reportRoomReasonReceivedReason = reason
reportRoomReasonReceivedInvocationsLock.withLock { reportRoomReasonUnderlyingReceivedInvocations.append(reason) }
try await reportRoomReasonClosure?(reason)
}
//MARK: - resetPowerLevels
open var resetPowerLevelsThrowableError: Error?
private let resetPowerLevelsCallsCountLock = NSLock()
private var resetPowerLevelsUnderlyingCallsCount = 0
open var resetPowerLevelsCallsCount: Int {
get { resetPowerLevelsCallsCountLock.withLock { resetPowerLevelsUnderlyingCallsCount } }
set { resetPowerLevelsCallsCountLock.withLock { resetPowerLevelsUnderlyingCallsCount = newValue } }
}
open var resetPowerLevelsCalled: Bool {
return resetPowerLevelsCallsCount > 0
}
private let resetPowerLevelsReturnValueLock = NSLock()
open var resetPowerLevelsUnderlyingReturnValue: RoomPowerLevels!
open var resetPowerLevelsReturnValue: RoomPowerLevels! {
get { resetPowerLevelsReturnValueLock.withLock { resetPowerLevelsUnderlyingReturnValue } }
set { resetPowerLevelsReturnValueLock.withLock { resetPowerLevelsUnderlyingReturnValue = newValue } }
}
open var resetPowerLevelsClosure: (() async throws -> RoomPowerLevels)?
open override func resetPowerLevels() async throws -> RoomPowerLevels {
if let error = resetPowerLevelsThrowableError {
throw error
}
resetPowerLevelsCallsCountLock.withLock { resetPowerLevelsUnderlyingCallsCount += 1 }
if let resetPowerLevelsClosure = resetPowerLevelsClosure {
return try await resetPowerLevelsClosure()
} else {
return resetPowerLevelsReturnValue
}
}
//MARK: - roomEventsDebugString
open var roomEventsDebugStringThrowableError: Error?
private let roomEventsDebugStringCallsCountLock = NSLock()
private var roomEventsDebugStringUnderlyingCallsCount = 0
open var roomEventsDebugStringCallsCount: Int {
get { roomEventsDebugStringCallsCountLock.withLock { roomEventsDebugStringUnderlyingCallsCount } }
set { roomEventsDebugStringCallsCountLock.withLock { roomEventsDebugStringUnderlyingCallsCount = newValue } }
}
open var roomEventsDebugStringCalled: Bool {
return roomEventsDebugStringCallsCount > 0
}
private let roomEventsDebugStringReturnValueLock = NSLock()
open var roomEventsDebugStringUnderlyingReturnValue: [String]!
open var roomEventsDebugStringReturnValue: [String]! {
get { roomEventsDebugStringReturnValueLock.withLock { roomEventsDebugStringUnderlyingReturnValue } }
set { roomEventsDebugStringReturnValueLock.withLock { roomEventsDebugStringUnderlyingReturnValue = newValue } }
}
open var roomEventsDebugStringClosure: (() async throws -> [String])?
open override func roomEventsDebugString() async throws -> [String] {
if let error = roomEventsDebugStringThrowableError {
throw error
}
roomEventsDebugStringCallsCountLock.withLock { roomEventsDebugStringUnderlyingCallsCount += 1 }
if let roomEventsDebugStringClosure = roomEventsDebugStringClosure {
return try await roomEventsDebugStringClosure()
} else {
return roomEventsDebugStringReturnValue
}
}
//MARK: - roomInfo
open var roomInfoThrowableError: Error?
private let roomInfoCallsCountLock = NSLock()
private var roomInfoUnderlyingCallsCount = 0
open var roomInfoCallsCount: Int {
get { roomInfoCallsCountLock.withLock { roomInfoUnderlyingCallsCount } }
set { roomInfoCallsCountLock.withLock { roomInfoUnderlyingCallsCount = newValue } }
}
open var roomInfoCalled: Bool {
return roomInfoCallsCount > 0
}
private let roomInfoReturnValueLock = NSLock()
open var roomInfoUnderlyingReturnValue: RoomInfo!
open var roomInfoReturnValue: RoomInfo! {
get { roomInfoReturnValueLock.withLock { roomInfoUnderlyingReturnValue } }
set { roomInfoReturnValueLock.withLock { roomInfoUnderlyingReturnValue = newValue } }
}
open var roomInfoClosure: (() async throws -> RoomInfo)?
open override func roomInfo() async throws -> RoomInfo {
if let error = roomInfoThrowableError {
throw error
}
roomInfoCallsCountLock.withLock { roomInfoUnderlyingCallsCount += 1 }
if let roomInfoClosure = roomInfoClosure {
return try await roomInfoClosure()
} else {
return roomInfoReturnValue
}
}
//MARK: - saveComposerDraft
open var saveComposerDraftDraftThreadRootThrowableError: Error?
private let saveComposerDraftDraftThreadRootCallsCountLock = NSLock()
private var saveComposerDraftDraftThreadRootUnderlyingCallsCount = 0
open var saveComposerDraftDraftThreadRootCallsCount: Int {
get { saveComposerDraftDraftThreadRootCallsCountLock.withLock { saveComposerDraftDraftThreadRootUnderlyingCallsCount } }
set { saveComposerDraftDraftThreadRootCallsCountLock.withLock { saveComposerDraftDraftThreadRootUnderlyingCallsCount = newValue } }
}
open var saveComposerDraftDraftThreadRootCalled: Bool {
return saveComposerDraftDraftThreadRootCallsCount > 0
}
private let saveComposerDraftDraftThreadRootReceivedArgumentsLock = NSLock()
private var saveComposerDraftDraftThreadRootUnderlyingReceivedArguments: (draft: ComposerDraft, threadRoot: String?)?
open var saveComposerDraftDraftThreadRootReceivedArguments: (draft: ComposerDraft, threadRoot: String?)? {
get { saveComposerDraftDraftThreadRootReceivedArgumentsLock.withLock { saveComposerDraftDraftThreadRootUnderlyingReceivedArguments } }
set { saveComposerDraftDraftThreadRootReceivedArgumentsLock.withLock { saveComposerDraftDraftThreadRootUnderlyingReceivedArguments = newValue } }
}
private let saveComposerDraftDraftThreadRootReceivedInvocationsLock = NSLock()
private var saveComposerDraftDraftThreadRootUnderlyingReceivedInvocations: [(draft: ComposerDraft, threadRoot: String?)] = []
open var saveComposerDraftDraftThreadRootReceivedInvocations: [(draft: ComposerDraft, threadRoot: String?)] {
get { saveComposerDraftDraftThreadRootReceivedInvocationsLock.withLock { saveComposerDraftDraftThreadRootUnderlyingReceivedInvocations } }
set { saveComposerDraftDraftThreadRootReceivedInvocationsLock.withLock { saveComposerDraftDraftThreadRootUnderlyingReceivedInvocations = newValue } }
}
open var saveComposerDraftDraftThreadRootClosure: ((ComposerDraft, String?) async throws -> Void)?
open override func saveComposerDraft(draft: ComposerDraft, threadRoot: String?) async throws {
if let error = saveComposerDraftDraftThreadRootThrowableError {
throw error
}
saveComposerDraftDraftThreadRootCallsCountLock.withLock { saveComposerDraftDraftThreadRootUnderlyingCallsCount += 1 }
saveComposerDraftDraftThreadRootReceivedArguments = (draft: draft, threadRoot: threadRoot)
saveComposerDraftDraftThreadRootReceivedInvocationsLock.withLock { saveComposerDraftDraftThreadRootUnderlyingReceivedInvocations.append((draft: draft, threadRoot: threadRoot)) }
try await saveComposerDraftDraftThreadRootClosure?(draft, threadRoot)
}
//MARK: - sendLiveLocation
open var sendLiveLocationGeoUriThrowableError: Error?
private let sendLiveLocationGeoUriCallsCountLock = NSLock()
private var sendLiveLocationGeoUriUnderlyingCallsCount = 0
open var sendLiveLocationGeoUriCallsCount: Int {
get { sendLiveLocationGeoUriCallsCountLock.withLock { sendLiveLocationGeoUriUnderlyingCallsCount } }
set { sendLiveLocationGeoUriCallsCountLock.withLock { sendLiveLocationGeoUriUnderlyingCallsCount = newValue } }
}
open var sendLiveLocationGeoUriCalled: Bool {
return sendLiveLocationGeoUriCallsCount > 0
}
private let sendLiveLocationGeoUriReceivedGeoUriLock = NSLock()
private var sendLiveLocationGeoUriUnderlyingReceivedGeoUri: String?
open var sendLiveLocationGeoUriReceivedGeoUri: String? {
get { sendLiveLocationGeoUriReceivedGeoUriLock.withLock { sendLiveLocationGeoUriUnderlyingReceivedGeoUri } }
set { sendLiveLocationGeoUriReceivedGeoUriLock.withLock { sendLiveLocationGeoUriUnderlyingReceivedGeoUri = newValue } }
}
private let sendLiveLocationGeoUriReceivedInvocationsLock = NSLock()
private var sendLiveLocationGeoUriUnderlyingReceivedInvocations: [String] = []
open var sendLiveLocationGeoUriReceivedInvocations: [String] {
get { sendLiveLocationGeoUriReceivedInvocationsLock.withLock { sendLiveLocationGeoUriUnderlyingReceivedInvocations } }
set { sendLiveLocationGeoUriReceivedInvocationsLock.withLock { sendLiveLocationGeoUriUnderlyingReceivedInvocations = newValue } }
}
open var sendLiveLocationGeoUriClosure: ((String) async throws -> Void)?
open override func sendLiveLocation(geoUri: String) async throws {
if let error = sendLiveLocationGeoUriThrowableError {
throw error
}
sendLiveLocationGeoUriCallsCountLock.withLock { sendLiveLocationGeoUriUnderlyingCallsCount += 1 }
sendLiveLocationGeoUriReceivedGeoUri = geoUri
sendLiveLocationGeoUriReceivedInvocationsLock.withLock { sendLiveLocationGeoUriUnderlyingReceivedInvocations.append(geoUri) }
try await sendLiveLocationGeoUriClosure?(geoUri)
}
//MARK: - sendRaw
open var sendRawEventTypeContentThrowableError: Error?
private let sendRawEventTypeContentCallsCountLock = NSLock()
private var sendRawEventTypeContentUnderlyingCallsCount = 0
open var sendRawEventTypeContentCallsCount: Int {
get { sendRawEventTypeContentCallsCountLock.withLock { sendRawEventTypeContentUnderlyingCallsCount } }
set { sendRawEventTypeContentCallsCountLock.withLock { sendRawEventTypeContentUnderlyingCallsCount = newValue } }
}
open var sendRawEventTypeContentCalled: Bool {
return sendRawEventTypeContentCallsCount > 0
}
private let sendRawEventTypeContentReceivedArgumentsLock = NSLock()
private var sendRawEventTypeContentUnderlyingReceivedArguments: (eventType: String, content: String)?
open var sendRawEventTypeContentReceivedArguments: (eventType: String, content: String)? {
get { sendRawEventTypeContentReceivedArgumentsLock.withLock { sendRawEventTypeContentUnderlyingReceivedArguments } }
set { sendRawEventTypeContentReceivedArgumentsLock.withLock { sendRawEventTypeContentUnderlyingReceivedArguments = newValue } }
}
private let sendRawEventTypeContentReceivedInvocationsLock = NSLock()
private var sendRawEventTypeContentUnderlyingReceivedInvocations: [(eventType: String, content: String)] = []
open var sendRawEventTypeContentReceivedInvocations: [(eventType: String, content: String)] {
get { sendRawEventTypeContentReceivedInvocationsLock.withLock { sendRawEventTypeContentUnderlyingReceivedInvocations } }
set { sendRawEventTypeContentReceivedInvocationsLock.withLock { sendRawEventTypeContentUnderlyingReceivedInvocations = newValue } }
}
open var sendRawEventTypeContentClosure: ((String, String) async throws -> Void)?
open override func sendRaw(eventType: String, content: String) async throws {
if let error = sendRawEventTypeContentThrowableError {
throw error
}
sendRawEventTypeContentCallsCountLock.withLock { sendRawEventTypeContentUnderlyingCallsCount += 1 }
sendRawEventTypeContentReceivedArguments = (eventType: eventType, content: content)
sendRawEventTypeContentReceivedInvocationsLock.withLock { sendRawEventTypeContentUnderlyingReceivedInvocations.append((eventType: eventType, content: content)) }
try await sendRawEventTypeContentClosure?(eventType, content)
}
//MARK: - sendSingleReceipt
open var sendSingleReceiptReceiptTypeThreadEventIdThrowableError: Error?
private let sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock = NSLock()
private var sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount = 0
open var sendSingleReceiptReceiptTypeThreadEventIdCallsCount: Int {
get { sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount } }
set { sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount = newValue } }
}
open var sendSingleReceiptReceiptTypeThreadEventIdCalled: Bool {
return sendSingleReceiptReceiptTypeThreadEventIdCallsCount > 0
}
private let sendSingleReceiptReceiptTypeThreadEventIdReceivedArgumentsLock = NSLock()
private var sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, eventId: String)?
open var sendSingleReceiptReceiptTypeThreadEventIdReceivedArguments: (receiptType: ReceiptType, thread: ReceiptThread, eventId: String)? {
get { sendSingleReceiptReceiptTypeThreadEventIdReceivedArgumentsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedArguments } }
set { sendSingleReceiptReceiptTypeThreadEventIdReceivedArgumentsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedArguments = newValue } }
}
private let sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock = NSLock()
private var sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, eventId: String)] = []
open var sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocations: [(receiptType: ReceiptType, thread: ReceiptThread, eventId: String)] {
get { sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations } }
set { sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations = newValue } }
}
open var sendSingleReceiptReceiptTypeThreadEventIdClosure: ((ReceiptType, ReceiptThread, String) async throws -> Void)?
open override func sendSingleReceipt(receiptType: ReceiptType, thread: ReceiptThread, eventId: String) async throws {
if let error = sendSingleReceiptReceiptTypeThreadEventIdThrowableError {
throw error
}
sendSingleReceiptReceiptTypeThreadEventIdCallsCountLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingCallsCount += 1 }
sendSingleReceiptReceiptTypeThreadEventIdReceivedArguments = (receiptType: receiptType, thread: thread, eventId: eventId)
sendSingleReceiptReceiptTypeThreadEventIdReceivedInvocationsLock.withLock { sendSingleReceiptReceiptTypeThreadEventIdUnderlyingReceivedInvocations.append((receiptType: receiptType, thread: thread, eventId: eventId)) }
try await sendSingleReceiptReceiptTypeThreadEventIdClosure?(receiptType, thread, eventId)
}
//MARK: - sendStateEventRaw
open var sendStateEventRawEventTypeStateKeyContentThrowableError: Error?
private let sendStateEventRawEventTypeStateKeyContentCallsCountLock = NSLock()
private var sendStateEventRawEventTypeStateKeyContentUnderlyingCallsCount = 0
open var sendStateEventRawEventTypeStateKeyContentCallsCount: Int {
get { sendStateEventRawEventTypeStateKeyContentCallsCountLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingCallsCount } }
set { sendStateEventRawEventTypeStateKeyContentCallsCountLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingCallsCount = newValue } }
}
open var sendStateEventRawEventTypeStateKeyContentCalled: Bool {
return sendStateEventRawEventTypeStateKeyContentCallsCount > 0
}
private let sendStateEventRawEventTypeStateKeyContentReceivedArgumentsLock = NSLock()
private var sendStateEventRawEventTypeStateKeyContentUnderlyingReceivedArguments: (eventType: String, stateKey: String, content: String)?
open var sendStateEventRawEventTypeStateKeyContentReceivedArguments: (eventType: String, stateKey: String, content: String)? {
get { sendStateEventRawEventTypeStateKeyContentReceivedArgumentsLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingReceivedArguments } }
set { sendStateEventRawEventTypeStateKeyContentReceivedArgumentsLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingReceivedArguments = newValue } }
}
private let sendStateEventRawEventTypeStateKeyContentReceivedInvocationsLock = NSLock()
private var sendStateEventRawEventTypeStateKeyContentUnderlyingReceivedInvocations: [(eventType: String, stateKey: String, content: String)] = []
open var sendStateEventRawEventTypeStateKeyContentReceivedInvocations: [(eventType: String, stateKey: String, content: String)] {
get { sendStateEventRawEventTypeStateKeyContentReceivedInvocationsLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingReceivedInvocations } }
set { sendStateEventRawEventTypeStateKeyContentReceivedInvocationsLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingReceivedInvocations = newValue } }
}
private let sendStateEventRawEventTypeStateKeyContentReturnValueLock = NSLock()
open var sendStateEventRawEventTypeStateKeyContentUnderlyingReturnValue: String!
open var sendStateEventRawEventTypeStateKeyContentReturnValue: String! {
get { sendStateEventRawEventTypeStateKeyContentReturnValueLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingReturnValue } }
set { sendStateEventRawEventTypeStateKeyContentReturnValueLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingReturnValue = newValue } }
}
open var sendStateEventRawEventTypeStateKeyContentClosure: ((String, String, String) async throws -> String)?
open override func sendStateEventRaw(eventType: String, stateKey: String, content: String) async throws -> String {
if let error = sendStateEventRawEventTypeStateKeyContentThrowableError {
throw error
}
sendStateEventRawEventTypeStateKeyContentCallsCountLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingCallsCount += 1 }
sendStateEventRawEventTypeStateKeyContentReceivedArguments = (eventType: eventType, stateKey: stateKey, content: content)
sendStateEventRawEventTypeStateKeyContentReceivedInvocationsLock.withLock { sendStateEventRawEventTypeStateKeyContentUnderlyingReceivedInvocations.append((eventType: eventType, stateKey: stateKey, content: content)) }
if let sendStateEventRawEventTypeStateKeyContentClosure = sendStateEventRawEventTypeStateKeyContentClosure {
return try await sendStateEventRawEventTypeStateKeyContentClosure(eventType, stateKey, content)
} else {
return sendStateEventRawEventTypeStateKeyContentReturnValue
}
}
//MARK: - setIsFavourite
open var setIsFavouriteIsFavouriteTagOrderThrowableError: Error?
private let setIsFavouriteIsFavouriteTagOrderCallsCountLock = NSLock()
private var setIsFavouriteIsFavouriteTagOrderUnderlyingCallsCount = 0
open var setIsFavouriteIsFavouriteTagOrderCallsCount: Int {
get { setIsFavouriteIsFavouriteTagOrderCallsCountLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingCallsCount } }
set { setIsFavouriteIsFavouriteTagOrderCallsCountLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingCallsCount = newValue } }
}
open var setIsFavouriteIsFavouriteTagOrderCalled: Bool {
return setIsFavouriteIsFavouriteTagOrderCallsCount > 0
}
private let setIsFavouriteIsFavouriteTagOrderReceivedArgumentsLock = NSLock()
private var setIsFavouriteIsFavouriteTagOrderUnderlyingReceivedArguments: (isFavourite: Bool, tagOrder: Double?)?
open var setIsFavouriteIsFavouriteTagOrderReceivedArguments: (isFavourite: Bool, tagOrder: Double?)? {
get { setIsFavouriteIsFavouriteTagOrderReceivedArgumentsLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingReceivedArguments } }
set { setIsFavouriteIsFavouriteTagOrderReceivedArgumentsLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingReceivedArguments = newValue } }
}
private let setIsFavouriteIsFavouriteTagOrderReceivedInvocationsLock = NSLock()
private var setIsFavouriteIsFavouriteTagOrderUnderlyingReceivedInvocations: [(isFavourite: Bool, tagOrder: Double?)] = []
open var setIsFavouriteIsFavouriteTagOrderReceivedInvocations: [(isFavourite: Bool, tagOrder: Double?)] {
get { setIsFavouriteIsFavouriteTagOrderReceivedInvocationsLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingReceivedInvocations } }
set { setIsFavouriteIsFavouriteTagOrderReceivedInvocationsLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingReceivedInvocations = newValue } }
}
open var setIsFavouriteIsFavouriteTagOrderClosure: ((Bool, Double?) async throws -> Void)?
open override func setIsFavourite(isFavourite: Bool, tagOrder: Double?) async throws {
if let error = setIsFavouriteIsFavouriteTagOrderThrowableError {
throw error
}
setIsFavouriteIsFavouriteTagOrderCallsCountLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingCallsCount += 1 }
setIsFavouriteIsFavouriteTagOrderReceivedArguments = (isFavourite: isFavourite, tagOrder: tagOrder)
setIsFavouriteIsFavouriteTagOrderReceivedInvocationsLock.withLock { setIsFavouriteIsFavouriteTagOrderUnderlyingReceivedInvocations.append((isFavourite: isFavourite, tagOrder: tagOrder)) }
try await setIsFavouriteIsFavouriteTagOrderClosure?(isFavourite, tagOrder)
}
//MARK: - setIsLowPriority
open var setIsLowPriorityIsLowPriorityTagOrderThrowableError: Error?
private let setIsLowPriorityIsLowPriorityTagOrderCallsCountLock = NSLock()
private var setIsLowPriorityIsLowPriorityTagOrderUnderlyingCallsCount = 0
open var setIsLowPriorityIsLowPriorityTagOrderCallsCount: Int {
get { setIsLowPriorityIsLowPriorityTagOrderCallsCountLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingCallsCount } }
set { setIsLowPriorityIsLowPriorityTagOrderCallsCountLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingCallsCount = newValue } }
}
open var setIsLowPriorityIsLowPriorityTagOrderCalled: Bool {
return setIsLowPriorityIsLowPriorityTagOrderCallsCount > 0
}
private let setIsLowPriorityIsLowPriorityTagOrderReceivedArgumentsLock = NSLock()
private var setIsLowPriorityIsLowPriorityTagOrderUnderlyingReceivedArguments: (isLowPriority: Bool, tagOrder: Double?)?
open var setIsLowPriorityIsLowPriorityTagOrderReceivedArguments: (isLowPriority: Bool, tagOrder: Double?)? {
get { setIsLowPriorityIsLowPriorityTagOrderReceivedArgumentsLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingReceivedArguments } }
set { setIsLowPriorityIsLowPriorityTagOrderReceivedArgumentsLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingReceivedArguments = newValue } }
}
private let setIsLowPriorityIsLowPriorityTagOrderReceivedInvocationsLock = NSLock()
private var setIsLowPriorityIsLowPriorityTagOrderUnderlyingReceivedInvocations: [(isLowPriority: Bool, tagOrder: Double?)] = []
open var setIsLowPriorityIsLowPriorityTagOrderReceivedInvocations: [(isLowPriority: Bool, tagOrder: Double?)] {
get { setIsLowPriorityIsLowPriorityTagOrderReceivedInvocationsLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingReceivedInvocations } }
set { setIsLowPriorityIsLowPriorityTagOrderReceivedInvocationsLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingReceivedInvocations = newValue } }
}
open var setIsLowPriorityIsLowPriorityTagOrderClosure: ((Bool, Double?) async throws -> Void)?
open override func setIsLowPriority(isLowPriority: Bool, tagOrder: Double?) async throws {
if let error = setIsLowPriorityIsLowPriorityTagOrderThrowableError {
throw error
}
setIsLowPriorityIsLowPriorityTagOrderCallsCountLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingCallsCount += 1 }
setIsLowPriorityIsLowPriorityTagOrderReceivedArguments = (isLowPriority: isLowPriority, tagOrder: tagOrder)
setIsLowPriorityIsLowPriorityTagOrderReceivedInvocationsLock.withLock { setIsLowPriorityIsLowPriorityTagOrderUnderlyingReceivedInvocations.append((isLowPriority: isLowPriority, tagOrder: tagOrder)) }
try await setIsLowPriorityIsLowPriorityTagOrderClosure?(isLowPriority, tagOrder)
}
//MARK: - setName
open var setNameNameThrowableError: Error?
private let setNameNameCallsCountLock = NSLock()
private var setNameNameUnderlyingCallsCount = 0
open var setNameNameCallsCount: Int {
get { setNameNameCallsCountLock.withLock { setNameNameUnderlyingCallsCount } }
set { setNameNameCallsCountLock.withLock { setNameNameUnderlyingCallsCount = newValue } }
}
open var setNameNameCalled: Bool {
return setNameNameCallsCount > 0
}
private let setNameNameReceivedNameLock = NSLock()
private var setNameNameUnderlyingReceivedName: String?
open var setNameNameReceivedName: String? {
get { setNameNameReceivedNameLock.withLock { setNameNameUnderlyingReceivedName } }
set { setNameNameReceivedNameLock.withLock { setNameNameUnderlyingReceivedName = newValue } }
}
private let setNameNameReceivedInvocationsLock = NSLock()
private var setNameNameUnderlyingReceivedInvocations: [String] = []
open var setNameNameReceivedInvocations: [String] {
get { setNameNameReceivedInvocationsLock.withLock { setNameNameUnderlyingReceivedInvocations } }
set { setNameNameReceivedInvocationsLock.withLock { setNameNameUnderlyingReceivedInvocations = newValue } }
}
open var setNameNameClosure: ((String) async throws -> Void)?
open override func setName(name: String) async throws {
if let error = setNameNameThrowableError {
throw error
}
setNameNameCallsCountLock.withLock { setNameNameUnderlyingCallsCount += 1 }
setNameNameReceivedName = name
setNameNameReceivedInvocationsLock.withLock { setNameNameUnderlyingReceivedInvocations.append(name) }
try await setNameNameClosure?(name)
}
//MARK: - setOwnMemberDisplayName
open var setOwnMemberDisplayNameDisplayNameThrowableError: Error?
private let setOwnMemberDisplayNameDisplayNameCallsCountLock = NSLock()
private var setOwnMemberDisplayNameDisplayNameUnderlyingCallsCount = 0
open var setOwnMemberDisplayNameDisplayNameCallsCount: Int {
get { setOwnMemberDisplayNameDisplayNameCallsCountLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingCallsCount } }
set { setOwnMemberDisplayNameDisplayNameCallsCountLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingCallsCount = newValue } }
}
open var setOwnMemberDisplayNameDisplayNameCalled: Bool {
return setOwnMemberDisplayNameDisplayNameCallsCount > 0
}
private let setOwnMemberDisplayNameDisplayNameReceivedDisplayNameLock = NSLock()
private var setOwnMemberDisplayNameDisplayNameUnderlyingReceivedDisplayName: String?
open var setOwnMemberDisplayNameDisplayNameReceivedDisplayName: String? {
get { setOwnMemberDisplayNameDisplayNameReceivedDisplayNameLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingReceivedDisplayName } }
set { setOwnMemberDisplayNameDisplayNameReceivedDisplayNameLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingReceivedDisplayName = newValue } }
}
private let setOwnMemberDisplayNameDisplayNameReceivedInvocationsLock = NSLock()
private var setOwnMemberDisplayNameDisplayNameUnderlyingReceivedInvocations: [String?] = []
open var setOwnMemberDisplayNameDisplayNameReceivedInvocations: [String?] {
get { setOwnMemberDisplayNameDisplayNameReceivedInvocationsLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingReceivedInvocations } }
set { setOwnMemberDisplayNameDisplayNameReceivedInvocationsLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingReceivedInvocations = newValue } }
}
open var setOwnMemberDisplayNameDisplayNameClosure: ((String?) async throws -> Void)?
open override func setOwnMemberDisplayName(displayName: String?) async throws {
if let error = setOwnMemberDisplayNameDisplayNameThrowableError {
throw error
}
setOwnMemberDisplayNameDisplayNameCallsCountLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingCallsCount += 1 }
setOwnMemberDisplayNameDisplayNameReceivedDisplayName = displayName
setOwnMemberDisplayNameDisplayNameReceivedInvocationsLock.withLock { setOwnMemberDisplayNameDisplayNameUnderlyingReceivedInvocations.append(displayName) }
try await setOwnMemberDisplayNameDisplayNameClosure?(displayName)
}
//MARK: - setThreadSubscription
open var setThreadSubscriptionThreadRootEventIdSubscribedThrowableError: Error?
private let setThreadSubscriptionThreadRootEventIdSubscribedCallsCountLock = NSLock()
private var setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount = 0
open var setThreadSubscriptionThreadRootEventIdSubscribedCallsCount: Int {
get { setThreadSubscriptionThreadRootEventIdSubscribedCallsCountLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount } }
set { setThreadSubscriptionThreadRootEventIdSubscribedCallsCountLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount = newValue } }
}
open var setThreadSubscriptionThreadRootEventIdSubscribedCalled: Bool {
return setThreadSubscriptionThreadRootEventIdSubscribedCallsCount > 0
}
private let setThreadSubscriptionThreadRootEventIdSubscribedReceivedArgumentsLock = NSLock()
private var setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingReceivedArguments: (threadRootEventId: String, subscribed: Bool)?
open var setThreadSubscriptionThreadRootEventIdSubscribedReceivedArguments: (threadRootEventId: String, subscribed: Bool)? {
get { setThreadSubscriptionThreadRootEventIdSubscribedReceivedArgumentsLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingReceivedArguments } }
set { setThreadSubscriptionThreadRootEventIdSubscribedReceivedArgumentsLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingReceivedArguments = newValue } }
}
private let setThreadSubscriptionThreadRootEventIdSubscribedReceivedInvocationsLock = NSLock()
private var setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingReceivedInvocations: [(threadRootEventId: String, subscribed: Bool)] = []
open var setThreadSubscriptionThreadRootEventIdSubscribedReceivedInvocations: [(threadRootEventId: String, subscribed: Bool)] {
get { setThreadSubscriptionThreadRootEventIdSubscribedReceivedInvocationsLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingReceivedInvocations } }
set { setThreadSubscriptionThreadRootEventIdSubscribedReceivedInvocationsLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingReceivedInvocations = newValue } }
}
open var setThreadSubscriptionThreadRootEventIdSubscribedClosure: ((String, Bool) async throws -> Void)?
open override func setThreadSubscription(threadRootEventId: String, subscribed: Bool) async throws {
if let error = setThreadSubscriptionThreadRootEventIdSubscribedThrowableError {
throw error
}
setThreadSubscriptionThreadRootEventIdSubscribedCallsCountLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingCallsCount += 1 }
setThreadSubscriptionThreadRootEventIdSubscribedReceivedArguments = (threadRootEventId: threadRootEventId, subscribed: subscribed)
setThreadSubscriptionThreadRootEventIdSubscribedReceivedInvocationsLock.withLock { setThreadSubscriptionThreadRootEventIdSubscribedUnderlyingReceivedInvocations.append((threadRootEventId: threadRootEventId, subscribed: subscribed)) }
try await setThreadSubscriptionThreadRootEventIdSubscribedClosure?(threadRootEventId, subscribed)
}
//MARK: - setTopic
open var setTopicTopicThrowableError: Error?
private let setTopicTopicCallsCountLock = NSLock()
private var setTopicTopicUnderlyingCallsCount = 0
open var setTopicTopicCallsCount: Int {
get { setTopicTopicCallsCountLock.withLock { setTopicTopicUnderlyingCallsCount } }
set { setTopicTopicCallsCountLock.withLock { setTopicTopicUnderlyingCallsCount = newValue } }
}
open var setTopicTopicCalled: Bool {
return setTopicTopicCallsCount > 0
}
private let setTopicTopicReceivedTopicLock = NSLock()
private var setTopicTopicUnderlyingReceivedTopic: String?
open var setTopicTopicReceivedTopic: String? {
get { setTopicTopicReceivedTopicLock.withLock { setTopicTopicUnderlyingReceivedTopic } }
set { setTopicTopicReceivedTopicLock.withLock { setTopicTopicUnderlyingReceivedTopic = newValue } }
}
private let setTopicTopicReceivedInvocationsLock = NSLock()
private var setTopicTopicUnderlyingReceivedInvocations: [String] = []
open var setTopicTopicReceivedInvocations: [String] {
get { setTopicTopicReceivedInvocationsLock.withLock { setTopicTopicUnderlyingReceivedInvocations } }
set { setTopicTopicReceivedInvocationsLock.withLock { setTopicTopicUnderlyingReceivedInvocations = newValue } }
}
open var setTopicTopicClosure: ((String) async throws -> Void)?
open override func setTopic(topic: String) async throws {
if let error = setTopicTopicThrowableError {
throw error
}
setTopicTopicCallsCountLock.withLock { setTopicTopicUnderlyingCallsCount += 1 }
setTopicTopicReceivedTopic = topic
setTopicTopicReceivedInvocationsLock.withLock { setTopicTopicUnderlyingReceivedInvocations.append(topic) }
try await setTopicTopicClosure?(topic)
}
//MARK: - setUnreadFlag
open var setUnreadFlagNewValueThrowableError: Error?
private let setUnreadFlagNewValueCallsCountLock = NSLock()
private var setUnreadFlagNewValueUnderlyingCallsCount = 0
open var setUnreadFlagNewValueCallsCount: Int {
get { setUnreadFlagNewValueCallsCountLock.withLock { setUnreadFlagNewValueUnderlyingCallsCount } }
set { setUnreadFlagNewValueCallsCountLock.withLock { setUnreadFlagNewValueUnderlyingCallsCount = newValue } }
}
open var setUnreadFlagNewValueCalled: Bool {
return setUnreadFlagNewValueCallsCount > 0
}
private let setUnreadFlagNewValueReceivedNewValueLock = NSLock()
private var setUnreadFlagNewValueUnderlyingReceivedNewValue: Bool?
open var setUnreadFlagNewValueReceivedNewValue: Bool? {
get { setUnreadFlagNewValueReceivedNewValueLock.withLock { setUnreadFlagNewValueUnderlyingReceivedNewValue } }
set { setUnreadFlagNewValueReceivedNewValueLock.withLock { setUnreadFlagNewValueUnderlyingReceivedNewValue = newValue } }
}
private let setUnreadFlagNewValueReceivedInvocationsLock = NSLock()
private var setUnreadFlagNewValueUnderlyingReceivedInvocations: [Bool] = []
open var setUnreadFlagNewValueReceivedInvocations: [Bool] {
get { setUnreadFlagNewValueReceivedInvocationsLock.withLock { setUnreadFlagNewValueUnderlyingReceivedInvocations } }
set { setUnreadFlagNewValueReceivedInvocationsLock.withLock { setUnreadFlagNewValueUnderlyingReceivedInvocations = newValue } }
}
open var setUnreadFlagNewValueClosure: ((Bool) async throws -> Void)?
open override func setUnreadFlag(newValue: Bool) async throws {
if let error = setUnreadFlagNewValueThrowableError {
throw error
}
setUnreadFlagNewValueCallsCountLock.withLock { setUnreadFlagNewValueUnderlyingCallsCount += 1 }
setUnreadFlagNewValueReceivedNewValue = newValue
setUnreadFlagNewValueReceivedInvocationsLock.withLock { setUnreadFlagNewValueUnderlyingReceivedInvocations.append(newValue) }
try await setUnreadFlagNewValueClosure?(newValue)
}
//MARK: - startLiveLocationShare
open var startLiveLocationShareDurationMillisThrowableError: Error?
private let startLiveLocationShareDurationMillisCallsCountLock = NSLock()
private var startLiveLocationShareDurationMillisUnderlyingCallsCount = 0
open var startLiveLocationShareDurationMillisCallsCount: Int {
get { startLiveLocationShareDurationMillisCallsCountLock.withLock { startLiveLocationShareDurationMillisUnderlyingCallsCount } }
set { startLiveLocationShareDurationMillisCallsCountLock.withLock { startLiveLocationShareDurationMillisUnderlyingCallsCount = newValue } }
}
open var startLiveLocationShareDurationMillisCalled: Bool {
return startLiveLocationShareDurationMillisCallsCount > 0
}
private let startLiveLocationShareDurationMillisReceivedDurationMillisLock = NSLock()
private var startLiveLocationShareDurationMillisUnderlyingReceivedDurationMillis: UInt64?
open var startLiveLocationShareDurationMillisReceivedDurationMillis: UInt64? {
get { startLiveLocationShareDurationMillisReceivedDurationMillisLock.withLock { startLiveLocationShareDurationMillisUnderlyingReceivedDurationMillis } }
set { startLiveLocationShareDurationMillisReceivedDurationMillisLock.withLock { startLiveLocationShareDurationMillisUnderlyingReceivedDurationMillis = newValue } }
}
private let startLiveLocationShareDurationMillisReceivedInvocationsLock = NSLock()
private var startLiveLocationShareDurationMillisUnderlyingReceivedInvocations: [UInt64] = []
open var startLiveLocationShareDurationMillisReceivedInvocations: [UInt64] {
get { startLiveLocationShareDurationMillisReceivedInvocationsLock.withLock { startLiveLocationShareDurationMillisUnderlyingReceivedInvocations } }
set { startLiveLocationShareDurationMillisReceivedInvocationsLock.withLock { startLiveLocationShareDurationMillisUnderlyingReceivedInvocations = newValue } }
}
private let startLiveLocationShareDurationMillisReturnValueLock = NSLock()
open var startLiveLocationShareDurationMillisUnderlyingReturnValue: String!
open var startLiveLocationShareDurationMillisReturnValue: String! {
get { startLiveLocationShareDurationMillisReturnValueLock.withLock { startLiveLocationShareDurationMillisUnderlyingReturnValue } }
set { startLiveLocationShareDurationMillisReturnValueLock.withLock { startLiveLocationShareDurationMillisUnderlyingReturnValue = newValue } }
}
open var startLiveLocationShareDurationMillisClosure: ((UInt64) async throws -> String)?
open override func startLiveLocationShare(durationMillis: UInt64) async throws -> String {
if let error = startLiveLocationShareDurationMillisThrowableError {
throw error
}
startLiveLocationShareDurationMillisCallsCountLock.withLock { startLiveLocationShareDurationMillisUnderlyingCallsCount += 1 }
startLiveLocationShareDurationMillisReceivedDurationMillis = durationMillis
startLiveLocationShareDurationMillisReceivedInvocationsLock.withLock { startLiveLocationShareDurationMillisUnderlyingReceivedInvocations.append(durationMillis) }
if let startLiveLocationShareDurationMillisClosure = startLiveLocationShareDurationMillisClosure {
return try await startLiveLocationShareDurationMillisClosure(durationMillis)
} else {
return startLiveLocationShareDurationMillisReturnValue
}
}
//MARK: - stopLiveLocationShare
open var stopLiveLocationShareThrowableError: Error?
private let stopLiveLocationShareCallsCountLock = NSLock()
private var stopLiveLocationShareUnderlyingCallsCount = 0
open var stopLiveLocationShareCallsCount: Int {
get { stopLiveLocationShareCallsCountLock.withLock { stopLiveLocationShareUnderlyingCallsCount } }
set { stopLiveLocationShareCallsCountLock.withLock { stopLiveLocationShareUnderlyingCallsCount = newValue } }
}
open var stopLiveLocationShareCalled: Bool {
return stopLiveLocationShareCallsCount > 0
}
open var stopLiveLocationShareClosure: (() async throws -> Void)?
open override func stopLiveLocationShare() async throws {
if let error = stopLiveLocationShareThrowableError {
throw error
}
stopLiveLocationShareCallsCountLock.withLock { stopLiveLocationShareUnderlyingCallsCount += 1 }
try await stopLiveLocationShareClosure?()
}
//MARK: - subscribeToCallDeclineEvents
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerThrowableError: Error?
private let subscribeToCallDeclineEventsRtcNotificationEventIdListenerCallsCountLock = NSLock()
private var subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingCallsCount = 0
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerCallsCount: Int {
get { subscribeToCallDeclineEventsRtcNotificationEventIdListenerCallsCountLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingCallsCount } }
set { subscribeToCallDeclineEventsRtcNotificationEventIdListenerCallsCountLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerCalled: Bool {
return subscribeToCallDeclineEventsRtcNotificationEventIdListenerCallsCount > 0
}
private let subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedArgumentsLock = NSLock()
private var subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReceivedArguments: (rtcNotificationEventId: String, listener: CallDeclineListener)?
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedArguments: (rtcNotificationEventId: String, listener: CallDeclineListener)? {
get { subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedArgumentsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReceivedArguments } }
set { subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedArgumentsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReceivedArguments = newValue } }
}
private let subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedInvocationsLock = NSLock()
private var subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReceivedInvocations: [(rtcNotificationEventId: String, listener: CallDeclineListener)] = []
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedInvocations: [(rtcNotificationEventId: String, listener: CallDeclineListener)] {
get { subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedInvocationsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReceivedInvocations } }
set { subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedInvocationsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToCallDeclineEventsRtcNotificationEventIdListenerReturnValueLock = NSLock()
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerReturnValue: TaskHandle! {
get { subscribeToCallDeclineEventsRtcNotificationEventIdListenerReturnValueLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReturnValue } }
set { subscribeToCallDeclineEventsRtcNotificationEventIdListenerReturnValueLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToCallDeclineEventsRtcNotificationEventIdListenerClosure: ((String, CallDeclineListener) throws -> TaskHandle)?
open override func subscribeToCallDeclineEvents(rtcNotificationEventId: String, listener: CallDeclineListener) throws -> TaskHandle {
if let error = subscribeToCallDeclineEventsRtcNotificationEventIdListenerThrowableError {
throw error
}
subscribeToCallDeclineEventsRtcNotificationEventIdListenerCallsCountLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingCallsCount += 1 }
subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedArguments = (rtcNotificationEventId: rtcNotificationEventId, listener: listener)
subscribeToCallDeclineEventsRtcNotificationEventIdListenerReceivedInvocationsLock.withLock { subscribeToCallDeclineEventsRtcNotificationEventIdListenerUnderlyingReceivedInvocations.append((rtcNotificationEventId: rtcNotificationEventId, listener: listener)) }
if let subscribeToCallDeclineEventsRtcNotificationEventIdListenerClosure = subscribeToCallDeclineEventsRtcNotificationEventIdListenerClosure {
return try subscribeToCallDeclineEventsRtcNotificationEventIdListenerClosure(rtcNotificationEventId, listener)
} else {
return subscribeToCallDeclineEventsRtcNotificationEventIdListenerReturnValue
}
}
//MARK: - subscribeToIdentityStatusChanges
open var subscribeToIdentityStatusChangesListenerThrowableError: Error?
private let subscribeToIdentityStatusChangesListenerCallsCountLock = NSLock()
private var subscribeToIdentityStatusChangesListenerUnderlyingCallsCount = 0
open var subscribeToIdentityStatusChangesListenerCallsCount: Int {
get { subscribeToIdentityStatusChangesListenerCallsCountLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingCallsCount } }
set { subscribeToIdentityStatusChangesListenerCallsCountLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToIdentityStatusChangesListenerCalled: Bool {
return subscribeToIdentityStatusChangesListenerCallsCount > 0
}
private let subscribeToIdentityStatusChangesListenerReceivedListenerLock = NSLock()
private var subscribeToIdentityStatusChangesListenerUnderlyingReceivedListener: IdentityStatusChangeListener?
open var subscribeToIdentityStatusChangesListenerReceivedListener: IdentityStatusChangeListener? {
get { subscribeToIdentityStatusChangesListenerReceivedListenerLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingReceivedListener } }
set { subscribeToIdentityStatusChangesListenerReceivedListenerLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToIdentityStatusChangesListenerReceivedInvocationsLock = NSLock()
private var subscribeToIdentityStatusChangesListenerUnderlyingReceivedInvocations: [IdentityStatusChangeListener] = []
open var subscribeToIdentityStatusChangesListenerReceivedInvocations: [IdentityStatusChangeListener] {
get { subscribeToIdentityStatusChangesListenerReceivedInvocationsLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingReceivedInvocations } }
set { subscribeToIdentityStatusChangesListenerReceivedInvocationsLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToIdentityStatusChangesListenerReturnValueLock = NSLock()
open var subscribeToIdentityStatusChangesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToIdentityStatusChangesListenerReturnValue: TaskHandle! {
get { subscribeToIdentityStatusChangesListenerReturnValueLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingReturnValue } }
set { subscribeToIdentityStatusChangesListenerReturnValueLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToIdentityStatusChangesListenerClosure: ((IdentityStatusChangeListener) async throws -> TaskHandle)?
open override func subscribeToIdentityStatusChanges(listener: IdentityStatusChangeListener) async throws -> TaskHandle {
if let error = subscribeToIdentityStatusChangesListenerThrowableError {
throw error
}
subscribeToIdentityStatusChangesListenerCallsCountLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingCallsCount += 1 }
subscribeToIdentityStatusChangesListenerReceivedListener = listener
subscribeToIdentityStatusChangesListenerReceivedInvocationsLock.withLock { subscribeToIdentityStatusChangesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToIdentityStatusChangesListenerClosure = subscribeToIdentityStatusChangesListenerClosure {
return try await subscribeToIdentityStatusChangesListenerClosure(listener)
} else {
return subscribeToIdentityStatusChangesListenerReturnValue
}
}
//MARK: - subscribeToKnockRequests
open var subscribeToKnockRequestsListenerThrowableError: Error?
private let subscribeToKnockRequestsListenerCallsCountLock = NSLock()
private var subscribeToKnockRequestsListenerUnderlyingCallsCount = 0
open var subscribeToKnockRequestsListenerCallsCount: Int {
get { subscribeToKnockRequestsListenerCallsCountLock.withLock { subscribeToKnockRequestsListenerUnderlyingCallsCount } }
set { subscribeToKnockRequestsListenerCallsCountLock.withLock { subscribeToKnockRequestsListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToKnockRequestsListenerCalled: Bool {
return subscribeToKnockRequestsListenerCallsCount > 0
}
private let subscribeToKnockRequestsListenerReceivedListenerLock = NSLock()
private var subscribeToKnockRequestsListenerUnderlyingReceivedListener: KnockRequestsListener?
open var subscribeToKnockRequestsListenerReceivedListener: KnockRequestsListener? {
get { subscribeToKnockRequestsListenerReceivedListenerLock.withLock { subscribeToKnockRequestsListenerUnderlyingReceivedListener } }
set { subscribeToKnockRequestsListenerReceivedListenerLock.withLock { subscribeToKnockRequestsListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToKnockRequestsListenerReceivedInvocationsLock = NSLock()
private var subscribeToKnockRequestsListenerUnderlyingReceivedInvocations: [KnockRequestsListener] = []
open var subscribeToKnockRequestsListenerReceivedInvocations: [KnockRequestsListener] {
get { subscribeToKnockRequestsListenerReceivedInvocationsLock.withLock { subscribeToKnockRequestsListenerUnderlyingReceivedInvocations } }
set { subscribeToKnockRequestsListenerReceivedInvocationsLock.withLock { subscribeToKnockRequestsListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToKnockRequestsListenerReturnValueLock = NSLock()
open var subscribeToKnockRequestsListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToKnockRequestsListenerReturnValue: TaskHandle! {
get { subscribeToKnockRequestsListenerReturnValueLock.withLock { subscribeToKnockRequestsListenerUnderlyingReturnValue } }
set { subscribeToKnockRequestsListenerReturnValueLock.withLock { subscribeToKnockRequestsListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToKnockRequestsListenerClosure: ((KnockRequestsListener) async throws -> TaskHandle)?
open override func subscribeToKnockRequests(listener: KnockRequestsListener) async throws -> TaskHandle {
if let error = subscribeToKnockRequestsListenerThrowableError {
throw error
}
subscribeToKnockRequestsListenerCallsCountLock.withLock { subscribeToKnockRequestsListenerUnderlyingCallsCount += 1 }
subscribeToKnockRequestsListenerReceivedListener = listener
subscribeToKnockRequestsListenerReceivedInvocationsLock.withLock { subscribeToKnockRequestsListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToKnockRequestsListenerClosure = subscribeToKnockRequestsListenerClosure {
return try await subscribeToKnockRequestsListenerClosure(listener)
} else {
return subscribeToKnockRequestsListenerReturnValue
}
}
//MARK: - subscribeToRoomInfoUpdates
private let subscribeToRoomInfoUpdatesListenerCallsCountLock = NSLock()
private var subscribeToRoomInfoUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToRoomInfoUpdatesListenerCallsCount: Int {
get { subscribeToRoomInfoUpdatesListenerCallsCountLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingCallsCount } }
set { subscribeToRoomInfoUpdatesListenerCallsCountLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToRoomInfoUpdatesListenerCalled: Bool {
return subscribeToRoomInfoUpdatesListenerCallsCount > 0
}
private let subscribeToRoomInfoUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToRoomInfoUpdatesListenerUnderlyingReceivedListener: RoomInfoListener?
open var subscribeToRoomInfoUpdatesListenerReceivedListener: RoomInfoListener? {
get { subscribeToRoomInfoUpdatesListenerReceivedListenerLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToRoomInfoUpdatesListenerReceivedListenerLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToRoomInfoUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToRoomInfoUpdatesListenerUnderlyingReceivedInvocations: [RoomInfoListener] = []
open var subscribeToRoomInfoUpdatesListenerReceivedInvocations: [RoomInfoListener] {
get { subscribeToRoomInfoUpdatesListenerReceivedInvocationsLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToRoomInfoUpdatesListenerReceivedInvocationsLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToRoomInfoUpdatesListenerReturnValueLock = NSLock()
open var subscribeToRoomInfoUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToRoomInfoUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToRoomInfoUpdatesListenerReturnValueLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingReturnValue } }
set { subscribeToRoomInfoUpdatesListenerReturnValueLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToRoomInfoUpdatesListenerClosure: ((RoomInfoListener) -> TaskHandle)?
open override func subscribeToRoomInfoUpdates(listener: RoomInfoListener) -> TaskHandle {
subscribeToRoomInfoUpdatesListenerCallsCountLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToRoomInfoUpdatesListenerReceivedListener = listener
subscribeToRoomInfoUpdatesListenerReceivedInvocationsLock.withLock { subscribeToRoomInfoUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToRoomInfoUpdatesListenerClosure = subscribeToRoomInfoUpdatesListenerClosure {
return subscribeToRoomInfoUpdatesListenerClosure(listener)
} else {
return subscribeToRoomInfoUpdatesListenerReturnValue
}
}
//MARK: - subscribeToSendQueueUpdates
open var subscribeToSendQueueUpdatesListenerThrowableError: Error?
private let subscribeToSendQueueUpdatesListenerCallsCountLock = NSLock()
private var subscribeToSendQueueUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToSendQueueUpdatesListenerCallsCount: Int {
get { subscribeToSendQueueUpdatesListenerCallsCountLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingCallsCount } }
set { subscribeToSendQueueUpdatesListenerCallsCountLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToSendQueueUpdatesListenerCalled: Bool {
return subscribeToSendQueueUpdatesListenerCallsCount > 0
}
private let subscribeToSendQueueUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToSendQueueUpdatesListenerUnderlyingReceivedListener: SendQueueListener?
open var subscribeToSendQueueUpdatesListenerReceivedListener: SendQueueListener? {
get { subscribeToSendQueueUpdatesListenerReceivedListenerLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToSendQueueUpdatesListenerReceivedListenerLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToSendQueueUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations: [SendQueueListener] = []
open var subscribeToSendQueueUpdatesListenerReceivedInvocations: [SendQueueListener] {
get { subscribeToSendQueueUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToSendQueueUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToSendQueueUpdatesListenerReturnValueLock = NSLock()
open var subscribeToSendQueueUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToSendQueueUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToSendQueueUpdatesListenerReturnValueLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReturnValue } }
set { subscribeToSendQueueUpdatesListenerReturnValueLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToSendQueueUpdatesListenerClosure: ((SendQueueListener) async throws -> TaskHandle)?
open override func subscribeToSendQueueUpdates(listener: SendQueueListener) async throws -> TaskHandle {
if let error = subscribeToSendQueueUpdatesListenerThrowableError {
throw error
}
subscribeToSendQueueUpdatesListenerCallsCountLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToSendQueueUpdatesListenerReceivedListener = listener
subscribeToSendQueueUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSendQueueUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToSendQueueUpdatesListenerClosure = subscribeToSendQueueUpdatesListenerClosure {
return try await subscribeToSendQueueUpdatesListenerClosure(listener)
} else {
return subscribeToSendQueueUpdatesListenerReturnValue
}
}
//MARK: - subscribeToTypingNotifications
private let subscribeToTypingNotificationsListenerCallsCountLock = NSLock()
private var subscribeToTypingNotificationsListenerUnderlyingCallsCount = 0
open var subscribeToTypingNotificationsListenerCallsCount: Int {
get { subscribeToTypingNotificationsListenerCallsCountLock.withLock { subscribeToTypingNotificationsListenerUnderlyingCallsCount } }
set { subscribeToTypingNotificationsListenerCallsCountLock.withLock { subscribeToTypingNotificationsListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToTypingNotificationsListenerCalled: Bool {
return subscribeToTypingNotificationsListenerCallsCount > 0
}
private let subscribeToTypingNotificationsListenerReceivedListenerLock = NSLock()
private var subscribeToTypingNotificationsListenerUnderlyingReceivedListener: TypingNotificationsListener?
open var subscribeToTypingNotificationsListenerReceivedListener: TypingNotificationsListener? {
get { subscribeToTypingNotificationsListenerReceivedListenerLock.withLock { subscribeToTypingNotificationsListenerUnderlyingReceivedListener } }
set { subscribeToTypingNotificationsListenerReceivedListenerLock.withLock { subscribeToTypingNotificationsListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToTypingNotificationsListenerReceivedInvocationsLock = NSLock()
private var subscribeToTypingNotificationsListenerUnderlyingReceivedInvocations: [TypingNotificationsListener] = []
open var subscribeToTypingNotificationsListenerReceivedInvocations: [TypingNotificationsListener] {
get { subscribeToTypingNotificationsListenerReceivedInvocationsLock.withLock { subscribeToTypingNotificationsListenerUnderlyingReceivedInvocations } }
set { subscribeToTypingNotificationsListenerReceivedInvocationsLock.withLock { subscribeToTypingNotificationsListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToTypingNotificationsListenerReturnValueLock = NSLock()
open var subscribeToTypingNotificationsListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToTypingNotificationsListenerReturnValue: TaskHandle! {
get { subscribeToTypingNotificationsListenerReturnValueLock.withLock { subscribeToTypingNotificationsListenerUnderlyingReturnValue } }
set { subscribeToTypingNotificationsListenerReturnValueLock.withLock { subscribeToTypingNotificationsListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToTypingNotificationsListenerClosure: ((TypingNotificationsListener) -> TaskHandle)?
open override func subscribeToTypingNotifications(listener: TypingNotificationsListener) -> TaskHandle {
subscribeToTypingNotificationsListenerCallsCountLock.withLock { subscribeToTypingNotificationsListenerUnderlyingCallsCount += 1 }
subscribeToTypingNotificationsListenerReceivedListener = listener
subscribeToTypingNotificationsListenerReceivedInvocationsLock.withLock { subscribeToTypingNotificationsListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToTypingNotificationsListenerClosure = subscribeToTypingNotificationsListenerClosure {
return subscribeToTypingNotificationsListenerClosure(listener)
} else {
return subscribeToTypingNotificationsListenerReturnValue
}
}
//MARK: - successorRoom
private let successorRoomCallsCountLock = NSLock()
private var successorRoomUnderlyingCallsCount = 0
open var successorRoomCallsCount: Int {
get { successorRoomCallsCountLock.withLock { successorRoomUnderlyingCallsCount } }
set { successorRoomCallsCountLock.withLock { successorRoomUnderlyingCallsCount = newValue } }
}
open var successorRoomCalled: Bool {
return successorRoomCallsCount > 0
}
private let successorRoomReturnValueLock = NSLock()
open var successorRoomUnderlyingReturnValue: SuccessorRoom?
open var successorRoomReturnValue: SuccessorRoom? {
get { successorRoomReturnValueLock.withLock { successorRoomUnderlyingReturnValue } }
set { successorRoomReturnValueLock.withLock { successorRoomUnderlyingReturnValue = newValue } }
}
open var successorRoomClosure: (() -> SuccessorRoom?)?
open override func successorRoom() -> SuccessorRoom? {
successorRoomCallsCountLock.withLock { successorRoomUnderlyingCallsCount += 1 }
if let successorRoomClosure = successorRoomClosure {
return successorRoomClosure()
} else {
return successorRoomReturnValue
}
}
//MARK: - suggestedRoleForUser
open var suggestedRoleForUserUserIdThrowableError: Error?
private let suggestedRoleForUserUserIdCallsCountLock = NSLock()
private var suggestedRoleForUserUserIdUnderlyingCallsCount = 0
open var suggestedRoleForUserUserIdCallsCount: Int {
get { suggestedRoleForUserUserIdCallsCountLock.withLock { suggestedRoleForUserUserIdUnderlyingCallsCount } }
set { suggestedRoleForUserUserIdCallsCountLock.withLock { suggestedRoleForUserUserIdUnderlyingCallsCount = newValue } }
}
open var suggestedRoleForUserUserIdCalled: Bool {
return suggestedRoleForUserUserIdCallsCount > 0
}
private let suggestedRoleForUserUserIdReceivedUserIdLock = NSLock()
private var suggestedRoleForUserUserIdUnderlyingReceivedUserId: String?
open var suggestedRoleForUserUserIdReceivedUserId: String? {
get { suggestedRoleForUserUserIdReceivedUserIdLock.withLock { suggestedRoleForUserUserIdUnderlyingReceivedUserId } }
set { suggestedRoleForUserUserIdReceivedUserIdLock.withLock { suggestedRoleForUserUserIdUnderlyingReceivedUserId = newValue } }
}
private let suggestedRoleForUserUserIdReceivedInvocationsLock = NSLock()
private var suggestedRoleForUserUserIdUnderlyingReceivedInvocations: [String] = []
open var suggestedRoleForUserUserIdReceivedInvocations: [String] {
get { suggestedRoleForUserUserIdReceivedInvocationsLock.withLock { suggestedRoleForUserUserIdUnderlyingReceivedInvocations } }
set { suggestedRoleForUserUserIdReceivedInvocationsLock.withLock { suggestedRoleForUserUserIdUnderlyingReceivedInvocations = newValue } }
}
private let suggestedRoleForUserUserIdReturnValueLock = NSLock()
open var suggestedRoleForUserUserIdUnderlyingReturnValue: RoomMemberRole!
open var suggestedRoleForUserUserIdReturnValue: RoomMemberRole! {
get { suggestedRoleForUserUserIdReturnValueLock.withLock { suggestedRoleForUserUserIdUnderlyingReturnValue } }
set { suggestedRoleForUserUserIdReturnValueLock.withLock { suggestedRoleForUserUserIdUnderlyingReturnValue = newValue } }
}
open var suggestedRoleForUserUserIdClosure: ((String) async throws -> RoomMemberRole)?
open override func suggestedRoleForUser(userId: String) async throws -> RoomMemberRole {
if let error = suggestedRoleForUserUserIdThrowableError {
throw error
}
suggestedRoleForUserUserIdCallsCountLock.withLock { suggestedRoleForUserUserIdUnderlyingCallsCount += 1 }
suggestedRoleForUserUserIdReceivedUserId = userId
suggestedRoleForUserUserIdReceivedInvocationsLock.withLock { suggestedRoleForUserUserIdUnderlyingReceivedInvocations.append(userId) }
if let suggestedRoleForUserUserIdClosure = suggestedRoleForUserUserIdClosure {
return try await suggestedRoleForUserUserIdClosure(userId)
} else {
return suggestedRoleForUserUserIdReturnValue
}
}
//MARK: - threadListService
private let threadListServiceCallsCountLock = NSLock()
private var threadListServiceUnderlyingCallsCount = 0
open var threadListServiceCallsCount: Int {
get { threadListServiceCallsCountLock.withLock { threadListServiceUnderlyingCallsCount } }
set { threadListServiceCallsCountLock.withLock { threadListServiceUnderlyingCallsCount = newValue } }
}
open var threadListServiceCalled: Bool {
return threadListServiceCallsCount > 0
}
private let threadListServiceReturnValueLock = NSLock()
open var threadListServiceUnderlyingReturnValue: ThreadListService!
open var threadListServiceReturnValue: ThreadListService! {
get { threadListServiceReturnValueLock.withLock { threadListServiceUnderlyingReturnValue } }
set { threadListServiceReturnValueLock.withLock { threadListServiceUnderlyingReturnValue = newValue } }
}
open var threadListServiceClosure: (() -> ThreadListService)?
open override func threadListService() -> ThreadListService {
threadListServiceCallsCountLock.withLock { threadListServiceUnderlyingCallsCount += 1 }
if let threadListServiceClosure = threadListServiceClosure {
return threadListServiceClosure()
} else {
return threadListServiceReturnValue
}
}
//MARK: - timeline
open var timelineThrowableError: Error?
private let timelineCallsCountLock = NSLock()
private var timelineUnderlyingCallsCount = 0
open var timelineCallsCount: Int {
get { timelineCallsCountLock.withLock { timelineUnderlyingCallsCount } }
set { timelineCallsCountLock.withLock { timelineUnderlyingCallsCount = newValue } }
}
open var timelineCalled: Bool {
return timelineCallsCount > 0
}
private let timelineReturnValueLock = NSLock()
open var timelineUnderlyingReturnValue: Timeline!
open var timelineReturnValue: Timeline! {
get { timelineReturnValueLock.withLock { timelineUnderlyingReturnValue } }
set { timelineReturnValueLock.withLock { timelineUnderlyingReturnValue = newValue } }
}
open var timelineClosure: (() async throws -> Timeline)?
open override func timeline() async throws -> Timeline {
if let error = timelineThrowableError {
throw error
}
timelineCallsCountLock.withLock { timelineUnderlyingCallsCount += 1 }
if let timelineClosure = timelineClosure {
return try await timelineClosure()
} else {
return timelineReturnValue
}
}
//MARK: - timelineWithConfiguration
open var timelineWithConfigurationConfigurationThrowableError: Error?
private let timelineWithConfigurationConfigurationCallsCountLock = NSLock()
private var timelineWithConfigurationConfigurationUnderlyingCallsCount = 0
open var timelineWithConfigurationConfigurationCallsCount: Int {
get { timelineWithConfigurationConfigurationCallsCountLock.withLock { timelineWithConfigurationConfigurationUnderlyingCallsCount } }
set { timelineWithConfigurationConfigurationCallsCountLock.withLock { timelineWithConfigurationConfigurationUnderlyingCallsCount = newValue } }
}
open var timelineWithConfigurationConfigurationCalled: Bool {
return timelineWithConfigurationConfigurationCallsCount > 0
}
private let timelineWithConfigurationConfigurationReceivedConfigurationLock = NSLock()
private var timelineWithConfigurationConfigurationUnderlyingReceivedConfiguration: TimelineConfiguration?
open var timelineWithConfigurationConfigurationReceivedConfiguration: TimelineConfiguration? {
get { timelineWithConfigurationConfigurationReceivedConfigurationLock.withLock { timelineWithConfigurationConfigurationUnderlyingReceivedConfiguration } }
set { timelineWithConfigurationConfigurationReceivedConfigurationLock.withLock { timelineWithConfigurationConfigurationUnderlyingReceivedConfiguration = newValue } }
}
private let timelineWithConfigurationConfigurationReceivedInvocationsLock = NSLock()
private var timelineWithConfigurationConfigurationUnderlyingReceivedInvocations: [TimelineConfiguration] = []
open var timelineWithConfigurationConfigurationReceivedInvocations: [TimelineConfiguration] {
get { timelineWithConfigurationConfigurationReceivedInvocationsLock.withLock { timelineWithConfigurationConfigurationUnderlyingReceivedInvocations } }
set { timelineWithConfigurationConfigurationReceivedInvocationsLock.withLock { timelineWithConfigurationConfigurationUnderlyingReceivedInvocations = newValue } }
}
private let timelineWithConfigurationConfigurationReturnValueLock = NSLock()
open var timelineWithConfigurationConfigurationUnderlyingReturnValue: Timeline!
open var timelineWithConfigurationConfigurationReturnValue: Timeline! {
get { timelineWithConfigurationConfigurationReturnValueLock.withLock { timelineWithConfigurationConfigurationUnderlyingReturnValue } }
set { timelineWithConfigurationConfigurationReturnValueLock.withLock { timelineWithConfigurationConfigurationUnderlyingReturnValue = newValue } }
}
open var timelineWithConfigurationConfigurationClosure: ((TimelineConfiguration) async throws -> Timeline)?
open override func timelineWithConfiguration(configuration: TimelineConfiguration) async throws -> Timeline {
if let error = timelineWithConfigurationConfigurationThrowableError {
throw error
}
timelineWithConfigurationConfigurationCallsCountLock.withLock { timelineWithConfigurationConfigurationUnderlyingCallsCount += 1 }
timelineWithConfigurationConfigurationReceivedConfiguration = configuration
timelineWithConfigurationConfigurationReceivedInvocationsLock.withLock { timelineWithConfigurationConfigurationUnderlyingReceivedInvocations.append(configuration) }
if let timelineWithConfigurationConfigurationClosure = timelineWithConfigurationConfigurationClosure {
return try await timelineWithConfigurationConfigurationClosure(configuration)
} else {
return timelineWithConfigurationConfigurationReturnValue
}
}
//MARK: - topic
private let topicCallsCountLock = NSLock()
private var topicUnderlyingCallsCount = 0
open var topicCallsCount: Int {
get { topicCallsCountLock.withLock { topicUnderlyingCallsCount } }
set { topicCallsCountLock.withLock { topicUnderlyingCallsCount = newValue } }
}
open var topicCalled: Bool {
return topicCallsCount > 0
}
private let topicReturnValueLock = NSLock()
open var topicUnderlyingReturnValue: String?
open var topicReturnValue: String? {
get { topicReturnValueLock.withLock { topicUnderlyingReturnValue } }
set { topicReturnValueLock.withLock { topicUnderlyingReturnValue = newValue } }
}
open var topicClosure: (() -> String?)?
open override func topic() -> String? {
topicCallsCountLock.withLock { topicUnderlyingCallsCount += 1 }
if let topicClosure = topicClosure {
return topicClosure()
} else {
return topicReturnValue
}
}
//MARK: - typingNotice
open var typingNoticeIsTypingThrowableError: Error?
private let typingNoticeIsTypingCallsCountLock = NSLock()
private var typingNoticeIsTypingUnderlyingCallsCount = 0
open var typingNoticeIsTypingCallsCount: Int {
get { typingNoticeIsTypingCallsCountLock.withLock { typingNoticeIsTypingUnderlyingCallsCount } }
set { typingNoticeIsTypingCallsCountLock.withLock { typingNoticeIsTypingUnderlyingCallsCount = newValue } }
}
open var typingNoticeIsTypingCalled: Bool {
return typingNoticeIsTypingCallsCount > 0
}
private let typingNoticeIsTypingReceivedIsTypingLock = NSLock()
private var typingNoticeIsTypingUnderlyingReceivedIsTyping: Bool?
open var typingNoticeIsTypingReceivedIsTyping: Bool? {
get { typingNoticeIsTypingReceivedIsTypingLock.withLock { typingNoticeIsTypingUnderlyingReceivedIsTyping } }
set { typingNoticeIsTypingReceivedIsTypingLock.withLock { typingNoticeIsTypingUnderlyingReceivedIsTyping = newValue } }
}
private let typingNoticeIsTypingReceivedInvocationsLock = NSLock()
private var typingNoticeIsTypingUnderlyingReceivedInvocations: [Bool] = []
open var typingNoticeIsTypingReceivedInvocations: [Bool] {
get { typingNoticeIsTypingReceivedInvocationsLock.withLock { typingNoticeIsTypingUnderlyingReceivedInvocations } }
set { typingNoticeIsTypingReceivedInvocationsLock.withLock { typingNoticeIsTypingUnderlyingReceivedInvocations = newValue } }
}
open var typingNoticeIsTypingClosure: ((Bool) async throws -> Void)?
open override func typingNotice(isTyping: Bool) async throws {
if let error = typingNoticeIsTypingThrowableError {
throw error
}
typingNoticeIsTypingCallsCountLock.withLock { typingNoticeIsTypingUnderlyingCallsCount += 1 }
typingNoticeIsTypingReceivedIsTyping = isTyping
typingNoticeIsTypingReceivedInvocationsLock.withLock { typingNoticeIsTypingUnderlyingReceivedInvocations.append(isTyping) }
try await typingNoticeIsTypingClosure?(isTyping)
}
//MARK: - unbanUser
open var unbanUserUserIdReasonThrowableError: Error?
private let unbanUserUserIdReasonCallsCountLock = NSLock()
private var unbanUserUserIdReasonUnderlyingCallsCount = 0
open var unbanUserUserIdReasonCallsCount: Int {
get { unbanUserUserIdReasonCallsCountLock.withLock { unbanUserUserIdReasonUnderlyingCallsCount } }
set { unbanUserUserIdReasonCallsCountLock.withLock { unbanUserUserIdReasonUnderlyingCallsCount = newValue } }
}
open var unbanUserUserIdReasonCalled: Bool {
return unbanUserUserIdReasonCallsCount > 0
}
private let unbanUserUserIdReasonReceivedArgumentsLock = NSLock()
private var unbanUserUserIdReasonUnderlyingReceivedArguments: (userId: String, reason: String?)?
open var unbanUserUserIdReasonReceivedArguments: (userId: String, reason: String?)? {
get { unbanUserUserIdReasonReceivedArgumentsLock.withLock { unbanUserUserIdReasonUnderlyingReceivedArguments } }
set { unbanUserUserIdReasonReceivedArgumentsLock.withLock { unbanUserUserIdReasonUnderlyingReceivedArguments = newValue } }
}
private let unbanUserUserIdReasonReceivedInvocationsLock = NSLock()
private var unbanUserUserIdReasonUnderlyingReceivedInvocations: [(userId: String, reason: String?)] = []
open var unbanUserUserIdReasonReceivedInvocations: [(userId: String, reason: String?)] {
get { unbanUserUserIdReasonReceivedInvocationsLock.withLock { unbanUserUserIdReasonUnderlyingReceivedInvocations } }
set { unbanUserUserIdReasonReceivedInvocationsLock.withLock { unbanUserUserIdReasonUnderlyingReceivedInvocations = newValue } }
}
open var unbanUserUserIdReasonClosure: ((String, String?) async throws -> Void)?
open override func unbanUser(userId: String, reason: String?) async throws {
if let error = unbanUserUserIdReasonThrowableError {
throw error
}
unbanUserUserIdReasonCallsCountLock.withLock { unbanUserUserIdReasonUnderlyingCallsCount += 1 }
unbanUserUserIdReasonReceivedArguments = (userId: userId, reason: reason)
unbanUserUserIdReasonReceivedInvocationsLock.withLock { unbanUserUserIdReasonUnderlyingReceivedInvocations.append((userId: userId, reason: reason)) }
try await unbanUserUserIdReasonClosure?(userId, reason)
}
//MARK: - updateCanonicalAlias
open var updateCanonicalAliasAliasAltAliasesThrowableError: Error?
private let updateCanonicalAliasAliasAltAliasesCallsCountLock = NSLock()
private var updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount = 0
open var updateCanonicalAliasAliasAltAliasesCallsCount: Int {
get { updateCanonicalAliasAliasAltAliasesCallsCountLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount } }
set { updateCanonicalAliasAliasAltAliasesCallsCountLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount = newValue } }
}
open var updateCanonicalAliasAliasAltAliasesCalled: Bool {
return updateCanonicalAliasAliasAltAliasesCallsCount > 0
}
private let updateCanonicalAliasAliasAltAliasesReceivedArgumentsLock = NSLock()
private var updateCanonicalAliasAliasAltAliasesUnderlyingReceivedArguments: (alias: String?, altAliases: [String])?
open var updateCanonicalAliasAliasAltAliasesReceivedArguments: (alias: String?, altAliases: [String])? {
get { updateCanonicalAliasAliasAltAliasesReceivedArgumentsLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingReceivedArguments } }
set { updateCanonicalAliasAliasAltAliasesReceivedArgumentsLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingReceivedArguments = newValue } }
}
private let updateCanonicalAliasAliasAltAliasesReceivedInvocationsLock = NSLock()
private var updateCanonicalAliasAliasAltAliasesUnderlyingReceivedInvocations: [(alias: String?, altAliases: [String])] = []
open var updateCanonicalAliasAliasAltAliasesReceivedInvocations: [(alias: String?, altAliases: [String])] {
get { updateCanonicalAliasAliasAltAliasesReceivedInvocationsLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingReceivedInvocations } }
set { updateCanonicalAliasAliasAltAliasesReceivedInvocationsLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingReceivedInvocations = newValue } }
}
open var updateCanonicalAliasAliasAltAliasesClosure: ((String?, [String]) async throws -> Void)?
open override func updateCanonicalAlias(alias: String?, altAliases: [String]) async throws {
if let error = updateCanonicalAliasAliasAltAliasesThrowableError {
throw error
}
updateCanonicalAliasAliasAltAliasesCallsCountLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingCallsCount += 1 }
updateCanonicalAliasAliasAltAliasesReceivedArguments = (alias: alias, altAliases: altAliases)
updateCanonicalAliasAliasAltAliasesReceivedInvocationsLock.withLock { updateCanonicalAliasAliasAltAliasesUnderlyingReceivedInvocations.append((alias: alias, altAliases: altAliases)) }
try await updateCanonicalAliasAliasAltAliasesClosure?(alias, altAliases)
}
//MARK: - updateHistoryVisibility
open var updateHistoryVisibilityVisibilityThrowableError: Error?
private let updateHistoryVisibilityVisibilityCallsCountLock = NSLock()
private var updateHistoryVisibilityVisibilityUnderlyingCallsCount = 0
open var updateHistoryVisibilityVisibilityCallsCount: Int {
get { updateHistoryVisibilityVisibilityCallsCountLock.withLock { updateHistoryVisibilityVisibilityUnderlyingCallsCount } }
set { updateHistoryVisibilityVisibilityCallsCountLock.withLock { updateHistoryVisibilityVisibilityUnderlyingCallsCount = newValue } }
}
open var updateHistoryVisibilityVisibilityCalled: Bool {
return updateHistoryVisibilityVisibilityCallsCount > 0
}
private let updateHistoryVisibilityVisibilityReceivedVisibilityLock = NSLock()
private var updateHistoryVisibilityVisibilityUnderlyingReceivedVisibility: RoomHistoryVisibility?
open var updateHistoryVisibilityVisibilityReceivedVisibility: RoomHistoryVisibility? {
get { updateHistoryVisibilityVisibilityReceivedVisibilityLock.withLock { updateHistoryVisibilityVisibilityUnderlyingReceivedVisibility } }
set { updateHistoryVisibilityVisibilityReceivedVisibilityLock.withLock { updateHistoryVisibilityVisibilityUnderlyingReceivedVisibility = newValue } }
}
private let updateHistoryVisibilityVisibilityReceivedInvocationsLock = NSLock()
private var updateHistoryVisibilityVisibilityUnderlyingReceivedInvocations: [RoomHistoryVisibility] = []
open var updateHistoryVisibilityVisibilityReceivedInvocations: [RoomHistoryVisibility] {
get { updateHistoryVisibilityVisibilityReceivedInvocationsLock.withLock { updateHistoryVisibilityVisibilityUnderlyingReceivedInvocations } }
set { updateHistoryVisibilityVisibilityReceivedInvocationsLock.withLock { updateHistoryVisibilityVisibilityUnderlyingReceivedInvocations = newValue } }
}
open var updateHistoryVisibilityVisibilityClosure: ((RoomHistoryVisibility) async throws -> Void)?
open override func updateHistoryVisibility(visibility: RoomHistoryVisibility) async throws {
if let error = updateHistoryVisibilityVisibilityThrowableError {
throw error
}
updateHistoryVisibilityVisibilityCallsCountLock.withLock { updateHistoryVisibilityVisibilityUnderlyingCallsCount += 1 }
updateHistoryVisibilityVisibilityReceivedVisibility = visibility
updateHistoryVisibilityVisibilityReceivedInvocationsLock.withLock { updateHistoryVisibilityVisibilityUnderlyingReceivedInvocations.append(visibility) }
try await updateHistoryVisibilityVisibilityClosure?(visibility)
}
//MARK: - updateJoinRules
open var updateJoinRulesNewRuleThrowableError: Error?
private let updateJoinRulesNewRuleCallsCountLock = NSLock()
private var updateJoinRulesNewRuleUnderlyingCallsCount = 0
open var updateJoinRulesNewRuleCallsCount: Int {
get { updateJoinRulesNewRuleCallsCountLock.withLock { updateJoinRulesNewRuleUnderlyingCallsCount } }
set { updateJoinRulesNewRuleCallsCountLock.withLock { updateJoinRulesNewRuleUnderlyingCallsCount = newValue } }
}
open var updateJoinRulesNewRuleCalled: Bool {
return updateJoinRulesNewRuleCallsCount > 0
}
private let updateJoinRulesNewRuleReceivedNewRuleLock = NSLock()
private var updateJoinRulesNewRuleUnderlyingReceivedNewRule: JoinRule?
open var updateJoinRulesNewRuleReceivedNewRule: JoinRule? {
get { updateJoinRulesNewRuleReceivedNewRuleLock.withLock { updateJoinRulesNewRuleUnderlyingReceivedNewRule } }
set { updateJoinRulesNewRuleReceivedNewRuleLock.withLock { updateJoinRulesNewRuleUnderlyingReceivedNewRule = newValue } }
}
private let updateJoinRulesNewRuleReceivedInvocationsLock = NSLock()
private var updateJoinRulesNewRuleUnderlyingReceivedInvocations: [JoinRule] = []
open var updateJoinRulesNewRuleReceivedInvocations: [JoinRule] {
get { updateJoinRulesNewRuleReceivedInvocationsLock.withLock { updateJoinRulesNewRuleUnderlyingReceivedInvocations } }
set { updateJoinRulesNewRuleReceivedInvocationsLock.withLock { updateJoinRulesNewRuleUnderlyingReceivedInvocations = newValue } }
}
open var updateJoinRulesNewRuleClosure: ((JoinRule) async throws -> Void)?
open override func updateJoinRules(newRule: JoinRule) async throws {
if let error = updateJoinRulesNewRuleThrowableError {
throw error
}
updateJoinRulesNewRuleCallsCountLock.withLock { updateJoinRulesNewRuleUnderlyingCallsCount += 1 }
updateJoinRulesNewRuleReceivedNewRule = newRule
updateJoinRulesNewRuleReceivedInvocationsLock.withLock { updateJoinRulesNewRuleUnderlyingReceivedInvocations.append(newRule) }
try await updateJoinRulesNewRuleClosure?(newRule)
}
//MARK: - updatePowerLevelsForUsers
open var updatePowerLevelsForUsersUpdatesThrowableError: Error?
private let updatePowerLevelsForUsersUpdatesCallsCountLock = NSLock()
private var updatePowerLevelsForUsersUpdatesUnderlyingCallsCount = 0
open var updatePowerLevelsForUsersUpdatesCallsCount: Int {
get { updatePowerLevelsForUsersUpdatesCallsCountLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingCallsCount } }
set { updatePowerLevelsForUsersUpdatesCallsCountLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingCallsCount = newValue } }
}
open var updatePowerLevelsForUsersUpdatesCalled: Bool {
return updatePowerLevelsForUsersUpdatesCallsCount > 0
}
private let updatePowerLevelsForUsersUpdatesReceivedUpdatesLock = NSLock()
private var updatePowerLevelsForUsersUpdatesUnderlyingReceivedUpdates: [UserPowerLevelUpdate]?
open var updatePowerLevelsForUsersUpdatesReceivedUpdates: [UserPowerLevelUpdate]? {
get { updatePowerLevelsForUsersUpdatesReceivedUpdatesLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingReceivedUpdates } }
set { updatePowerLevelsForUsersUpdatesReceivedUpdatesLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingReceivedUpdates = newValue } }
}
private let updatePowerLevelsForUsersUpdatesReceivedInvocationsLock = NSLock()
private var updatePowerLevelsForUsersUpdatesUnderlyingReceivedInvocations: [[UserPowerLevelUpdate]] = []
open var updatePowerLevelsForUsersUpdatesReceivedInvocations: [[UserPowerLevelUpdate]] {
get { updatePowerLevelsForUsersUpdatesReceivedInvocationsLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingReceivedInvocations } }
set { updatePowerLevelsForUsersUpdatesReceivedInvocationsLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingReceivedInvocations = newValue } }
}
open var updatePowerLevelsForUsersUpdatesClosure: (([UserPowerLevelUpdate]) async throws -> Void)?
open override func updatePowerLevelsForUsers(updates: [UserPowerLevelUpdate]) async throws {
if let error = updatePowerLevelsForUsersUpdatesThrowableError {
throw error
}
updatePowerLevelsForUsersUpdatesCallsCountLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingCallsCount += 1 }
updatePowerLevelsForUsersUpdatesReceivedUpdates = updates
updatePowerLevelsForUsersUpdatesReceivedInvocationsLock.withLock { updatePowerLevelsForUsersUpdatesUnderlyingReceivedInvocations.append(updates) }
try await updatePowerLevelsForUsersUpdatesClosure?(updates)
}
//MARK: - updateRoomVisibility
open var updateRoomVisibilityVisibilityThrowableError: Error?
private let updateRoomVisibilityVisibilityCallsCountLock = NSLock()
private var updateRoomVisibilityVisibilityUnderlyingCallsCount = 0
open var updateRoomVisibilityVisibilityCallsCount: Int {
get { updateRoomVisibilityVisibilityCallsCountLock.withLock { updateRoomVisibilityVisibilityUnderlyingCallsCount } }
set { updateRoomVisibilityVisibilityCallsCountLock.withLock { updateRoomVisibilityVisibilityUnderlyingCallsCount = newValue } }
}
open var updateRoomVisibilityVisibilityCalled: Bool {
return updateRoomVisibilityVisibilityCallsCount > 0
}
private let updateRoomVisibilityVisibilityReceivedVisibilityLock = NSLock()
private var updateRoomVisibilityVisibilityUnderlyingReceivedVisibility: RoomVisibility?
open var updateRoomVisibilityVisibilityReceivedVisibility: RoomVisibility? {
get { updateRoomVisibilityVisibilityReceivedVisibilityLock.withLock { updateRoomVisibilityVisibilityUnderlyingReceivedVisibility } }
set { updateRoomVisibilityVisibilityReceivedVisibilityLock.withLock { updateRoomVisibilityVisibilityUnderlyingReceivedVisibility = newValue } }
}
private let updateRoomVisibilityVisibilityReceivedInvocationsLock = NSLock()
private var updateRoomVisibilityVisibilityUnderlyingReceivedInvocations: [RoomVisibility] = []
open var updateRoomVisibilityVisibilityReceivedInvocations: [RoomVisibility] {
get { updateRoomVisibilityVisibilityReceivedInvocationsLock.withLock { updateRoomVisibilityVisibilityUnderlyingReceivedInvocations } }
set { updateRoomVisibilityVisibilityReceivedInvocationsLock.withLock { updateRoomVisibilityVisibilityUnderlyingReceivedInvocations = newValue } }
}
open var updateRoomVisibilityVisibilityClosure: ((RoomVisibility) async throws -> Void)?
open override func updateRoomVisibility(visibility: RoomVisibility) async throws {
if let error = updateRoomVisibilityVisibilityThrowableError {
throw error
}
updateRoomVisibilityVisibilityCallsCountLock.withLock { updateRoomVisibilityVisibilityUnderlyingCallsCount += 1 }
updateRoomVisibilityVisibilityReceivedVisibility = visibility
updateRoomVisibilityVisibilityReceivedInvocationsLock.withLock { updateRoomVisibilityVisibilityUnderlyingReceivedInvocations.append(visibility) }
try await updateRoomVisibilityVisibilityClosure?(visibility)
}
//MARK: - uploadAvatar
open var uploadAvatarMimeTypeDataMediaInfoThrowableError: Error?
private let uploadAvatarMimeTypeDataMediaInfoCallsCountLock = NSLock()
private var uploadAvatarMimeTypeDataMediaInfoUnderlyingCallsCount = 0
open var uploadAvatarMimeTypeDataMediaInfoCallsCount: Int {
get { uploadAvatarMimeTypeDataMediaInfoCallsCountLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingCallsCount } }
set { uploadAvatarMimeTypeDataMediaInfoCallsCountLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingCallsCount = newValue } }
}
open var uploadAvatarMimeTypeDataMediaInfoCalled: Bool {
return uploadAvatarMimeTypeDataMediaInfoCallsCount > 0
}
private let uploadAvatarMimeTypeDataMediaInfoReceivedArgumentsLock = NSLock()
private var uploadAvatarMimeTypeDataMediaInfoUnderlyingReceivedArguments: (mimeType: String, data: Data, mediaInfo: ImageInfo?)?
open var uploadAvatarMimeTypeDataMediaInfoReceivedArguments: (mimeType: String, data: Data, mediaInfo: ImageInfo?)? {
get { uploadAvatarMimeTypeDataMediaInfoReceivedArgumentsLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingReceivedArguments } }
set { uploadAvatarMimeTypeDataMediaInfoReceivedArgumentsLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingReceivedArguments = newValue } }
}
private let uploadAvatarMimeTypeDataMediaInfoReceivedInvocationsLock = NSLock()
private var uploadAvatarMimeTypeDataMediaInfoUnderlyingReceivedInvocations: [(mimeType: String, data: Data, mediaInfo: ImageInfo?)] = []
open var uploadAvatarMimeTypeDataMediaInfoReceivedInvocations: [(mimeType: String, data: Data, mediaInfo: ImageInfo?)] {
get { uploadAvatarMimeTypeDataMediaInfoReceivedInvocationsLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingReceivedInvocations } }
set { uploadAvatarMimeTypeDataMediaInfoReceivedInvocationsLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingReceivedInvocations = newValue } }
}
open var uploadAvatarMimeTypeDataMediaInfoClosure: ((String, Data, ImageInfo?) async throws -> Void)?
open override func uploadAvatar(mimeType: String, data: Data, mediaInfo: ImageInfo?) async throws {
if let error = uploadAvatarMimeTypeDataMediaInfoThrowableError {
throw error
}
uploadAvatarMimeTypeDataMediaInfoCallsCountLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingCallsCount += 1 }
uploadAvatarMimeTypeDataMediaInfoReceivedArguments = (mimeType: mimeType, data: data, mediaInfo: mediaInfo)
uploadAvatarMimeTypeDataMediaInfoReceivedInvocationsLock.withLock { uploadAvatarMimeTypeDataMediaInfoUnderlyingReceivedInvocations.append((mimeType: mimeType, data: data, mediaInfo: mediaInfo)) }
try await uploadAvatarMimeTypeDataMediaInfoClosure?(mimeType, data, mediaInfo)
}
//MARK: - withdrawVerificationAndResend
open var withdrawVerificationAndResendUserIdsSendHandleThrowableError: Error?
private let withdrawVerificationAndResendUserIdsSendHandleCallsCountLock = NSLock()
private var withdrawVerificationAndResendUserIdsSendHandleUnderlyingCallsCount = 0
open var withdrawVerificationAndResendUserIdsSendHandleCallsCount: Int {
get { withdrawVerificationAndResendUserIdsSendHandleCallsCountLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingCallsCount } }
set { withdrawVerificationAndResendUserIdsSendHandleCallsCountLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingCallsCount = newValue } }
}
open var withdrawVerificationAndResendUserIdsSendHandleCalled: Bool {
return withdrawVerificationAndResendUserIdsSendHandleCallsCount > 0
}
private let withdrawVerificationAndResendUserIdsSendHandleReceivedArgumentsLock = NSLock()
private var withdrawVerificationAndResendUserIdsSendHandleUnderlyingReceivedArguments: (userIds: [String], sendHandle: SendHandle)?
open var withdrawVerificationAndResendUserIdsSendHandleReceivedArguments: (userIds: [String], sendHandle: SendHandle)? {
get { withdrawVerificationAndResendUserIdsSendHandleReceivedArgumentsLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingReceivedArguments } }
set { withdrawVerificationAndResendUserIdsSendHandleReceivedArgumentsLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingReceivedArguments = newValue } }
}
private let withdrawVerificationAndResendUserIdsSendHandleReceivedInvocationsLock = NSLock()
private var withdrawVerificationAndResendUserIdsSendHandleUnderlyingReceivedInvocations: [(userIds: [String], sendHandle: SendHandle)] = []
open var withdrawVerificationAndResendUserIdsSendHandleReceivedInvocations: [(userIds: [String], sendHandle: SendHandle)] {
get { withdrawVerificationAndResendUserIdsSendHandleReceivedInvocationsLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingReceivedInvocations } }
set { withdrawVerificationAndResendUserIdsSendHandleReceivedInvocationsLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingReceivedInvocations = newValue } }
}
open var withdrawVerificationAndResendUserIdsSendHandleClosure: (([String], SendHandle) async throws -> Void)?
open override func withdrawVerificationAndResend(userIds: [String], sendHandle: SendHandle) async throws {
if let error = withdrawVerificationAndResendUserIdsSendHandleThrowableError {
throw error
}
withdrawVerificationAndResendUserIdsSendHandleCallsCountLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingCallsCount += 1 }
withdrawVerificationAndResendUserIdsSendHandleReceivedArguments = (userIds: userIds, sendHandle: sendHandle)
withdrawVerificationAndResendUserIdsSendHandleReceivedInvocationsLock.withLock { withdrawVerificationAndResendUserIdsSendHandleUnderlyingReceivedInvocations.append((userIds: userIds, sendHandle: sendHandle)) }
try await withdrawVerificationAndResendUserIdsSendHandleClosure?(userIds, sendHandle)
}
}
open class RoomDirectorySearchSDKMock: MatrixRustSDK.RoomDirectorySearch, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - isAtLastPage
open var isAtLastPageThrowableError: Error?
private let isAtLastPageCallsCountLock = NSLock()
private var isAtLastPageUnderlyingCallsCount = 0
open var isAtLastPageCallsCount: Int {
get { isAtLastPageCallsCountLock.withLock { isAtLastPageUnderlyingCallsCount } }
set { isAtLastPageCallsCountLock.withLock { isAtLastPageUnderlyingCallsCount = newValue } }
}
open var isAtLastPageCalled: Bool {
return isAtLastPageCallsCount > 0
}
private let isAtLastPageReturnValueLock = NSLock()
open var isAtLastPageUnderlyingReturnValue: Bool!
open var isAtLastPageReturnValue: Bool! {
get { isAtLastPageReturnValueLock.withLock { isAtLastPageUnderlyingReturnValue } }
set { isAtLastPageReturnValueLock.withLock { isAtLastPageUnderlyingReturnValue = newValue } }
}
open var isAtLastPageClosure: (() async throws -> Bool)?
open override func isAtLastPage() async throws -> Bool {
if let error = isAtLastPageThrowableError {
throw error
}
isAtLastPageCallsCountLock.withLock { isAtLastPageUnderlyingCallsCount += 1 }
if let isAtLastPageClosure = isAtLastPageClosure {
return try await isAtLastPageClosure()
} else {
return isAtLastPageReturnValue
}
}
//MARK: - loadedPages
open var loadedPagesThrowableError: Error?
private let loadedPagesCallsCountLock = NSLock()
private var loadedPagesUnderlyingCallsCount = 0
open var loadedPagesCallsCount: Int {
get { loadedPagesCallsCountLock.withLock { loadedPagesUnderlyingCallsCount } }
set { loadedPagesCallsCountLock.withLock { loadedPagesUnderlyingCallsCount = newValue } }
}
open var loadedPagesCalled: Bool {
return loadedPagesCallsCount > 0
}
private let loadedPagesReturnValueLock = NSLock()
open var loadedPagesUnderlyingReturnValue: UInt32!
open var loadedPagesReturnValue: UInt32! {
get { loadedPagesReturnValueLock.withLock { loadedPagesUnderlyingReturnValue } }
set { loadedPagesReturnValueLock.withLock { loadedPagesUnderlyingReturnValue = newValue } }
}
open var loadedPagesClosure: (() async throws -> UInt32)?
open override func loadedPages() async throws -> UInt32 {
if let error = loadedPagesThrowableError {
throw error
}
loadedPagesCallsCountLock.withLock { loadedPagesUnderlyingCallsCount += 1 }
if let loadedPagesClosure = loadedPagesClosure {
return try await loadedPagesClosure()
} else {
return loadedPagesReturnValue
}
}
//MARK: - nextPage
open var nextPageThrowableError: Error?
private let nextPageCallsCountLock = NSLock()
private var nextPageUnderlyingCallsCount = 0
open var nextPageCallsCount: Int {
get { nextPageCallsCountLock.withLock { nextPageUnderlyingCallsCount } }
set { nextPageCallsCountLock.withLock { nextPageUnderlyingCallsCount = newValue } }
}
open var nextPageCalled: Bool {
return nextPageCallsCount > 0
}
open var nextPageClosure: (() async throws -> Void)?
open override func nextPage() async throws {
if let error = nextPageThrowableError {
throw error
}
nextPageCallsCountLock.withLock { nextPageUnderlyingCallsCount += 1 }
try await nextPageClosure?()
}
//MARK: - results
private let resultsListenerCallsCountLock = NSLock()
private var resultsListenerUnderlyingCallsCount = 0
open var resultsListenerCallsCount: Int {
get { resultsListenerCallsCountLock.withLock { resultsListenerUnderlyingCallsCount } }
set { resultsListenerCallsCountLock.withLock { resultsListenerUnderlyingCallsCount = newValue } }
}
open var resultsListenerCalled: Bool {
return resultsListenerCallsCount > 0
}
private let resultsListenerReceivedListenerLock = NSLock()
private var resultsListenerUnderlyingReceivedListener: RoomDirectorySearchEntriesListener?
open var resultsListenerReceivedListener: RoomDirectorySearchEntriesListener? {
get { resultsListenerReceivedListenerLock.withLock { resultsListenerUnderlyingReceivedListener } }
set { resultsListenerReceivedListenerLock.withLock { resultsListenerUnderlyingReceivedListener = newValue } }
}
private let resultsListenerReceivedInvocationsLock = NSLock()
private var resultsListenerUnderlyingReceivedInvocations: [RoomDirectorySearchEntriesListener] = []
open var resultsListenerReceivedInvocations: [RoomDirectorySearchEntriesListener] {
get { resultsListenerReceivedInvocationsLock.withLock { resultsListenerUnderlyingReceivedInvocations } }
set { resultsListenerReceivedInvocationsLock.withLock { resultsListenerUnderlyingReceivedInvocations = newValue } }
}
private let resultsListenerReturnValueLock = NSLock()
open var resultsListenerUnderlyingReturnValue: TaskHandle!
open var resultsListenerReturnValue: TaskHandle! {
get { resultsListenerReturnValueLock.withLock { resultsListenerUnderlyingReturnValue } }
set { resultsListenerReturnValueLock.withLock { resultsListenerUnderlyingReturnValue = newValue } }
}
open var resultsListenerClosure: ((RoomDirectorySearchEntriesListener) async -> TaskHandle)?
open override func results(listener: RoomDirectorySearchEntriesListener) async -> TaskHandle {
resultsListenerCallsCountLock.withLock { resultsListenerUnderlyingCallsCount += 1 }
resultsListenerReceivedListener = listener
resultsListenerReceivedInvocationsLock.withLock { resultsListenerUnderlyingReceivedInvocations.append(listener) }
if let resultsListenerClosure = resultsListenerClosure {
return await resultsListenerClosure(listener)
} else {
return resultsListenerReturnValue
}
}
//MARK: - search
open var searchFilterBatchSizeViaServerNameThrowableError: Error?
private let searchFilterBatchSizeViaServerNameCallsCountLock = NSLock()
private var searchFilterBatchSizeViaServerNameUnderlyingCallsCount = 0
open var searchFilterBatchSizeViaServerNameCallsCount: Int {
get { searchFilterBatchSizeViaServerNameCallsCountLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingCallsCount } }
set { searchFilterBatchSizeViaServerNameCallsCountLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingCallsCount = newValue } }
}
open var searchFilterBatchSizeViaServerNameCalled: Bool {
return searchFilterBatchSizeViaServerNameCallsCount > 0
}
private let searchFilterBatchSizeViaServerNameReceivedArgumentsLock = NSLock()
private var searchFilterBatchSizeViaServerNameUnderlyingReceivedArguments: (filter: String?, batchSize: UInt32, viaServerName: String?)?
open var searchFilterBatchSizeViaServerNameReceivedArguments: (filter: String?, batchSize: UInt32, viaServerName: String?)? {
get { searchFilterBatchSizeViaServerNameReceivedArgumentsLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingReceivedArguments } }
set { searchFilterBatchSizeViaServerNameReceivedArgumentsLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingReceivedArguments = newValue } }
}
private let searchFilterBatchSizeViaServerNameReceivedInvocationsLock = NSLock()
private var searchFilterBatchSizeViaServerNameUnderlyingReceivedInvocations: [(filter: String?, batchSize: UInt32, viaServerName: String?)] = []
open var searchFilterBatchSizeViaServerNameReceivedInvocations: [(filter: String?, batchSize: UInt32, viaServerName: String?)] {
get { searchFilterBatchSizeViaServerNameReceivedInvocationsLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingReceivedInvocations } }
set { searchFilterBatchSizeViaServerNameReceivedInvocationsLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingReceivedInvocations = newValue } }
}
open var searchFilterBatchSizeViaServerNameClosure: ((String?, UInt32, String?) async throws -> Void)?
open override func search(filter: String?, batchSize: UInt32, viaServerName: String?) async throws {
if let error = searchFilterBatchSizeViaServerNameThrowableError {
throw error
}
searchFilterBatchSizeViaServerNameCallsCountLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingCallsCount += 1 }
searchFilterBatchSizeViaServerNameReceivedArguments = (filter: filter, batchSize: batchSize, viaServerName: viaServerName)
searchFilterBatchSizeViaServerNameReceivedInvocationsLock.withLock { searchFilterBatchSizeViaServerNameUnderlyingReceivedInvocations.append((filter: filter, batchSize: batchSize, viaServerName: viaServerName)) }
try await searchFilterBatchSizeViaServerNameClosure?(filter, batchSize, viaServerName)
}
}
open class RoomListSDKMock: MatrixRustSDK.RoomList, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - entriesWithDynamicAdapters
private let entriesWithDynamicAdaptersPageSizeListenerCallsCountLock = NSLock()
private var entriesWithDynamicAdaptersPageSizeListenerUnderlyingCallsCount = 0
open var entriesWithDynamicAdaptersPageSizeListenerCallsCount: Int {
get { entriesWithDynamicAdaptersPageSizeListenerCallsCountLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingCallsCount } }
set { entriesWithDynamicAdaptersPageSizeListenerCallsCountLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingCallsCount = newValue } }
}
open var entriesWithDynamicAdaptersPageSizeListenerCalled: Bool {
return entriesWithDynamicAdaptersPageSizeListenerCallsCount > 0
}
private let entriesWithDynamicAdaptersPageSizeListenerReceivedArgumentsLock = NSLock()
private var entriesWithDynamicAdaptersPageSizeListenerUnderlyingReceivedArguments: (pageSize: UInt32, listener: RoomListEntriesListener)?
open var entriesWithDynamicAdaptersPageSizeListenerReceivedArguments: (pageSize: UInt32, listener: RoomListEntriesListener)? {
get { entriesWithDynamicAdaptersPageSizeListenerReceivedArgumentsLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingReceivedArguments } }
set { entriesWithDynamicAdaptersPageSizeListenerReceivedArgumentsLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingReceivedArguments = newValue } }
}
private let entriesWithDynamicAdaptersPageSizeListenerReceivedInvocationsLock = NSLock()
private var entriesWithDynamicAdaptersPageSizeListenerUnderlyingReceivedInvocations: [(pageSize: UInt32, listener: RoomListEntriesListener)] = []
open var entriesWithDynamicAdaptersPageSizeListenerReceivedInvocations: [(pageSize: UInt32, listener: RoomListEntriesListener)] {
get { entriesWithDynamicAdaptersPageSizeListenerReceivedInvocationsLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingReceivedInvocations } }
set { entriesWithDynamicAdaptersPageSizeListenerReceivedInvocationsLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingReceivedInvocations = newValue } }
}
private let entriesWithDynamicAdaptersPageSizeListenerReturnValueLock = NSLock()
open var entriesWithDynamicAdaptersPageSizeListenerUnderlyingReturnValue: RoomListEntriesWithDynamicAdaptersResult!
open var entriesWithDynamicAdaptersPageSizeListenerReturnValue: RoomListEntriesWithDynamicAdaptersResult! {
get { entriesWithDynamicAdaptersPageSizeListenerReturnValueLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingReturnValue } }
set { entriesWithDynamicAdaptersPageSizeListenerReturnValueLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingReturnValue = newValue } }
}
open var entriesWithDynamicAdaptersPageSizeListenerClosure: ((UInt32, RoomListEntriesListener) -> RoomListEntriesWithDynamicAdaptersResult)?
open override func entriesWithDynamicAdapters(pageSize: UInt32, listener: RoomListEntriesListener) -> RoomListEntriesWithDynamicAdaptersResult {
entriesWithDynamicAdaptersPageSizeListenerCallsCountLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingCallsCount += 1 }
entriesWithDynamicAdaptersPageSizeListenerReceivedArguments = (pageSize: pageSize, listener: listener)
entriesWithDynamicAdaptersPageSizeListenerReceivedInvocationsLock.withLock { entriesWithDynamicAdaptersPageSizeListenerUnderlyingReceivedInvocations.append((pageSize: pageSize, listener: listener)) }
if let entriesWithDynamicAdaptersPageSizeListenerClosure = entriesWithDynamicAdaptersPageSizeListenerClosure {
return entriesWithDynamicAdaptersPageSizeListenerClosure(pageSize, listener)
} else {
return entriesWithDynamicAdaptersPageSizeListenerReturnValue
}
}
//MARK: - loadingState
open var loadingStateListenerThrowableError: Error?
private let loadingStateListenerCallsCountLock = NSLock()
private var loadingStateListenerUnderlyingCallsCount = 0
open var loadingStateListenerCallsCount: Int {
get { loadingStateListenerCallsCountLock.withLock { loadingStateListenerUnderlyingCallsCount } }
set { loadingStateListenerCallsCountLock.withLock { loadingStateListenerUnderlyingCallsCount = newValue } }
}
open var loadingStateListenerCalled: Bool {
return loadingStateListenerCallsCount > 0
}
private let loadingStateListenerReceivedListenerLock = NSLock()
private var loadingStateListenerUnderlyingReceivedListener: RoomListLoadingStateListener?
open var loadingStateListenerReceivedListener: RoomListLoadingStateListener? {
get { loadingStateListenerReceivedListenerLock.withLock { loadingStateListenerUnderlyingReceivedListener } }
set { loadingStateListenerReceivedListenerLock.withLock { loadingStateListenerUnderlyingReceivedListener = newValue } }
}
private let loadingStateListenerReceivedInvocationsLock = NSLock()
private var loadingStateListenerUnderlyingReceivedInvocations: [RoomListLoadingStateListener] = []
open var loadingStateListenerReceivedInvocations: [RoomListLoadingStateListener] {
get { loadingStateListenerReceivedInvocationsLock.withLock { loadingStateListenerUnderlyingReceivedInvocations } }
set { loadingStateListenerReceivedInvocationsLock.withLock { loadingStateListenerUnderlyingReceivedInvocations = newValue } }
}
private let loadingStateListenerReturnValueLock = NSLock()
open var loadingStateListenerUnderlyingReturnValue: RoomListLoadingStateResult!
open var loadingStateListenerReturnValue: RoomListLoadingStateResult! {
get { loadingStateListenerReturnValueLock.withLock { loadingStateListenerUnderlyingReturnValue } }
set { loadingStateListenerReturnValueLock.withLock { loadingStateListenerUnderlyingReturnValue = newValue } }
}
open var loadingStateListenerClosure: ((RoomListLoadingStateListener) throws -> RoomListLoadingStateResult)?
open override func loadingState(listener: RoomListLoadingStateListener) throws -> RoomListLoadingStateResult {
if let error = loadingStateListenerThrowableError {
throw error
}
loadingStateListenerCallsCountLock.withLock { loadingStateListenerUnderlyingCallsCount += 1 }
loadingStateListenerReceivedListener = listener
loadingStateListenerReceivedInvocationsLock.withLock { loadingStateListenerUnderlyingReceivedInvocations.append(listener) }
if let loadingStateListenerClosure = loadingStateListenerClosure {
return try loadingStateListenerClosure(listener)
} else {
return loadingStateListenerReturnValue
}
}
//MARK: - room
open var roomRoomIdThrowableError: Error?
private let roomRoomIdCallsCountLock = NSLock()
private var roomRoomIdUnderlyingCallsCount = 0
open var roomRoomIdCallsCount: Int {
get { roomRoomIdCallsCountLock.withLock { roomRoomIdUnderlyingCallsCount } }
set { roomRoomIdCallsCountLock.withLock { roomRoomIdUnderlyingCallsCount = newValue } }
}
open var roomRoomIdCalled: Bool {
return roomRoomIdCallsCount > 0
}
private let roomRoomIdReceivedRoomIdLock = NSLock()
private var roomRoomIdUnderlyingReceivedRoomId: String?
open var roomRoomIdReceivedRoomId: String? {
get { roomRoomIdReceivedRoomIdLock.withLock { roomRoomIdUnderlyingReceivedRoomId } }
set { roomRoomIdReceivedRoomIdLock.withLock { roomRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let roomRoomIdReceivedInvocationsLock = NSLock()
private var roomRoomIdUnderlyingReceivedInvocations: [String] = []
open var roomRoomIdReceivedInvocations: [String] {
get { roomRoomIdReceivedInvocationsLock.withLock { roomRoomIdUnderlyingReceivedInvocations } }
set { roomRoomIdReceivedInvocationsLock.withLock { roomRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let roomRoomIdReturnValueLock = NSLock()
open var roomRoomIdUnderlyingReturnValue: Room!
open var roomRoomIdReturnValue: Room! {
get { roomRoomIdReturnValueLock.withLock { roomRoomIdUnderlyingReturnValue } }
set { roomRoomIdReturnValueLock.withLock { roomRoomIdUnderlyingReturnValue = newValue } }
}
open var roomRoomIdClosure: ((String) throws -> Room)?
open override func room(roomId: String) throws -> Room {
if let error = roomRoomIdThrowableError {
throw error
}
roomRoomIdCallsCountLock.withLock { roomRoomIdUnderlyingCallsCount += 1 }
roomRoomIdReceivedRoomId = roomId
roomRoomIdReceivedInvocationsLock.withLock { roomRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let roomRoomIdClosure = roomRoomIdClosure {
return try roomRoomIdClosure(roomId)
} else {
return roomRoomIdReturnValue
}
}
}
open class RoomListDynamicEntriesControllerSDKMock: MatrixRustSDK.RoomListDynamicEntriesController, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - addOnePage
private let addOnePageCallsCountLock = NSLock()
private var addOnePageUnderlyingCallsCount = 0
open var addOnePageCallsCount: Int {
get { addOnePageCallsCountLock.withLock { addOnePageUnderlyingCallsCount } }
set { addOnePageCallsCountLock.withLock { addOnePageUnderlyingCallsCount = newValue } }
}
open var addOnePageCalled: Bool {
return addOnePageCallsCount > 0
}
open var addOnePageClosure: (() -> Void)?
open override func addOnePage() {
addOnePageCallsCountLock.withLock { addOnePageUnderlyingCallsCount += 1 }
addOnePageClosure?()
}
//MARK: - resetToOnePage
private let resetToOnePageCallsCountLock = NSLock()
private var resetToOnePageUnderlyingCallsCount = 0
open var resetToOnePageCallsCount: Int {
get { resetToOnePageCallsCountLock.withLock { resetToOnePageUnderlyingCallsCount } }
set { resetToOnePageCallsCountLock.withLock { resetToOnePageUnderlyingCallsCount = newValue } }
}
open var resetToOnePageCalled: Bool {
return resetToOnePageCallsCount > 0
}
open var resetToOnePageClosure: (() -> Void)?
open override func resetToOnePage() {
resetToOnePageCallsCountLock.withLock { resetToOnePageUnderlyingCallsCount += 1 }
resetToOnePageClosure?()
}
//MARK: - setFilter
private let setFilterKindCallsCountLock = NSLock()
private var setFilterKindUnderlyingCallsCount = 0
open var setFilterKindCallsCount: Int {
get { setFilterKindCallsCountLock.withLock { setFilterKindUnderlyingCallsCount } }
set { setFilterKindCallsCountLock.withLock { setFilterKindUnderlyingCallsCount = newValue } }
}
open var setFilterKindCalled: Bool {
return setFilterKindCallsCount > 0
}
private let setFilterKindReceivedKindLock = NSLock()
private var setFilterKindUnderlyingReceivedKind: RoomListEntriesDynamicFilterKind?
open var setFilterKindReceivedKind: RoomListEntriesDynamicFilterKind? {
get { setFilterKindReceivedKindLock.withLock { setFilterKindUnderlyingReceivedKind } }
set { setFilterKindReceivedKindLock.withLock { setFilterKindUnderlyingReceivedKind = newValue } }
}
private let setFilterKindReceivedInvocationsLock = NSLock()
private var setFilterKindUnderlyingReceivedInvocations: [RoomListEntriesDynamicFilterKind] = []
open var setFilterKindReceivedInvocations: [RoomListEntriesDynamicFilterKind] {
get { setFilterKindReceivedInvocationsLock.withLock { setFilterKindUnderlyingReceivedInvocations } }
set { setFilterKindReceivedInvocationsLock.withLock { setFilterKindUnderlyingReceivedInvocations = newValue } }
}
private let setFilterKindReturnValueLock = NSLock()
open var setFilterKindUnderlyingReturnValue: Bool!
open var setFilterKindReturnValue: Bool! {
get { setFilterKindReturnValueLock.withLock { setFilterKindUnderlyingReturnValue } }
set { setFilterKindReturnValueLock.withLock { setFilterKindUnderlyingReturnValue = newValue } }
}
open var setFilterKindClosure: ((RoomListEntriesDynamicFilterKind) -> Bool)?
open override func setFilter(kind: RoomListEntriesDynamicFilterKind) -> Bool {
setFilterKindCallsCountLock.withLock { setFilterKindUnderlyingCallsCount += 1 }
setFilterKindReceivedKind = kind
setFilterKindReceivedInvocationsLock.withLock { setFilterKindUnderlyingReceivedInvocations.append(kind) }
if let setFilterKindClosure = setFilterKindClosure {
return setFilterKindClosure(kind)
} else {
return setFilterKindReturnValue
}
}
}
open class RoomListEntriesWithDynamicAdaptersResultSDKMock: MatrixRustSDK.RoomListEntriesWithDynamicAdaptersResult, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - controller
private let controllerCallsCountLock = NSLock()
private var controllerUnderlyingCallsCount = 0
open var controllerCallsCount: Int {
get { controllerCallsCountLock.withLock { controllerUnderlyingCallsCount } }
set { controllerCallsCountLock.withLock { controllerUnderlyingCallsCount = newValue } }
}
open var controllerCalled: Bool {
return controllerCallsCount > 0
}
private let controllerReturnValueLock = NSLock()
open var controllerUnderlyingReturnValue: RoomListDynamicEntriesController!
open var controllerReturnValue: RoomListDynamicEntriesController! {
get { controllerReturnValueLock.withLock { controllerUnderlyingReturnValue } }
set { controllerReturnValueLock.withLock { controllerUnderlyingReturnValue = newValue } }
}
open var controllerClosure: (() -> RoomListDynamicEntriesController)?
open override func controller() -> RoomListDynamicEntriesController {
controllerCallsCountLock.withLock { controllerUnderlyingCallsCount += 1 }
if let controllerClosure = controllerClosure {
return controllerClosure()
} else {
return controllerReturnValue
}
}
//MARK: - entriesStream
private let entriesStreamCallsCountLock = NSLock()
private var entriesStreamUnderlyingCallsCount = 0
open var entriesStreamCallsCount: Int {
get { entriesStreamCallsCountLock.withLock { entriesStreamUnderlyingCallsCount } }
set { entriesStreamCallsCountLock.withLock { entriesStreamUnderlyingCallsCount = newValue } }
}
open var entriesStreamCalled: Bool {
return entriesStreamCallsCount > 0
}
private let entriesStreamReturnValueLock = NSLock()
open var entriesStreamUnderlyingReturnValue: TaskHandle!
open var entriesStreamReturnValue: TaskHandle! {
get { entriesStreamReturnValueLock.withLock { entriesStreamUnderlyingReturnValue } }
set { entriesStreamReturnValueLock.withLock { entriesStreamUnderlyingReturnValue = newValue } }
}
open var entriesStreamClosure: (() -> TaskHandle)?
open override func entriesStream() -> TaskHandle {
entriesStreamCallsCountLock.withLock { entriesStreamUnderlyingCallsCount += 1 }
if let entriesStreamClosure = entriesStreamClosure {
return entriesStreamClosure()
} else {
return entriesStreamReturnValue
}
}
}
open class RoomListServiceSDKMock: MatrixRustSDK.RoomListService, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - allRooms
open var allRoomsThrowableError: Error?
private let allRoomsCallsCountLock = NSLock()
private var allRoomsUnderlyingCallsCount = 0
open var allRoomsCallsCount: Int {
get { allRoomsCallsCountLock.withLock { allRoomsUnderlyingCallsCount } }
set { allRoomsCallsCountLock.withLock { allRoomsUnderlyingCallsCount = newValue } }
}
open var allRoomsCalled: Bool {
return allRoomsCallsCount > 0
}
private let allRoomsReturnValueLock = NSLock()
open var allRoomsUnderlyingReturnValue: RoomList!
open var allRoomsReturnValue: RoomList! {
get { allRoomsReturnValueLock.withLock { allRoomsUnderlyingReturnValue } }
set { allRoomsReturnValueLock.withLock { allRoomsUnderlyingReturnValue = newValue } }
}
open var allRoomsClosure: (() async throws -> RoomList)?
open override func allRooms() async throws -> RoomList {
if let error = allRoomsThrowableError {
throw error
}
allRoomsCallsCountLock.withLock { allRoomsUnderlyingCallsCount += 1 }
if let allRoomsClosure = allRoomsClosure {
return try await allRoomsClosure()
} else {
return allRoomsReturnValue
}
}
//MARK: - removeRoomSubscriptions
open var removeRoomSubscriptionsRoomIdsThrowableError: Error?
private let removeRoomSubscriptionsRoomIdsCallsCountLock = NSLock()
private var removeRoomSubscriptionsRoomIdsUnderlyingCallsCount = 0
open var removeRoomSubscriptionsRoomIdsCallsCount: Int {
get { removeRoomSubscriptionsRoomIdsCallsCountLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingCallsCount } }
set { removeRoomSubscriptionsRoomIdsCallsCountLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingCallsCount = newValue } }
}
open var removeRoomSubscriptionsRoomIdsCalled: Bool {
return removeRoomSubscriptionsRoomIdsCallsCount > 0
}
private let removeRoomSubscriptionsRoomIdsReceivedRoomIdsLock = NSLock()
private var removeRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds: [String]?
open var removeRoomSubscriptionsRoomIdsReceivedRoomIds: [String]? {
get { removeRoomSubscriptionsRoomIdsReceivedRoomIdsLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds } }
set { removeRoomSubscriptionsRoomIdsReceivedRoomIdsLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds = newValue } }
}
private let removeRoomSubscriptionsRoomIdsReceivedInvocationsLock = NSLock()
private var removeRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations: [[String]] = []
open var removeRoomSubscriptionsRoomIdsReceivedInvocations: [[String]] {
get { removeRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations } }
set { removeRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations = newValue } }
}
open var removeRoomSubscriptionsRoomIdsClosure: (([String]) throws -> Void)?
open override func removeRoomSubscriptions(roomIds: [String]) throws {
if let error = removeRoomSubscriptionsRoomIdsThrowableError {
throw error
}
removeRoomSubscriptionsRoomIdsCallsCountLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingCallsCount += 1 }
removeRoomSubscriptionsRoomIdsReceivedRoomIds = roomIds
removeRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { removeRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations.append(roomIds) }
try removeRoomSubscriptionsRoomIdsClosure?(roomIds)
}
//MARK: - resetAndAddRoomSubscriptions
open var resetAndAddRoomSubscriptionsRoomIdsThrowableError: Error?
private let resetAndAddRoomSubscriptionsRoomIdsCallsCountLock = NSLock()
private var resetAndAddRoomSubscriptionsRoomIdsUnderlyingCallsCount = 0
open var resetAndAddRoomSubscriptionsRoomIdsCallsCount: Int {
get { resetAndAddRoomSubscriptionsRoomIdsCallsCountLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingCallsCount } }
set { resetAndAddRoomSubscriptionsRoomIdsCallsCountLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingCallsCount = newValue } }
}
open var resetAndAddRoomSubscriptionsRoomIdsCalled: Bool {
return resetAndAddRoomSubscriptionsRoomIdsCallsCount > 0
}
private let resetAndAddRoomSubscriptionsRoomIdsReceivedRoomIdsLock = NSLock()
private var resetAndAddRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds: [String]?
open var resetAndAddRoomSubscriptionsRoomIdsReceivedRoomIds: [String]? {
get { resetAndAddRoomSubscriptionsRoomIdsReceivedRoomIdsLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds } }
set { resetAndAddRoomSubscriptionsRoomIdsReceivedRoomIdsLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds = newValue } }
}
private let resetAndAddRoomSubscriptionsRoomIdsReceivedInvocationsLock = NSLock()
private var resetAndAddRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations: [[String]] = []
open var resetAndAddRoomSubscriptionsRoomIdsReceivedInvocations: [[String]] {
get { resetAndAddRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations } }
set { resetAndAddRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations = newValue } }
}
open var resetAndAddRoomSubscriptionsRoomIdsClosure: (([String]) async throws -> Void)?
open override func resetAndAddRoomSubscriptions(roomIds: [String]) async throws {
if let error = resetAndAddRoomSubscriptionsRoomIdsThrowableError {
throw error
}
resetAndAddRoomSubscriptionsRoomIdsCallsCountLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingCallsCount += 1 }
resetAndAddRoomSubscriptionsRoomIdsReceivedRoomIds = roomIds
resetAndAddRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { resetAndAddRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations.append(roomIds) }
try await resetAndAddRoomSubscriptionsRoomIdsClosure?(roomIds)
}
//MARK: - room
open var roomRoomIdThrowableError: Error?
private let roomRoomIdCallsCountLock = NSLock()
private var roomRoomIdUnderlyingCallsCount = 0
open var roomRoomIdCallsCount: Int {
get { roomRoomIdCallsCountLock.withLock { roomRoomIdUnderlyingCallsCount } }
set { roomRoomIdCallsCountLock.withLock { roomRoomIdUnderlyingCallsCount = newValue } }
}
open var roomRoomIdCalled: Bool {
return roomRoomIdCallsCount > 0
}
private let roomRoomIdReceivedRoomIdLock = NSLock()
private var roomRoomIdUnderlyingReceivedRoomId: String?
open var roomRoomIdReceivedRoomId: String? {
get { roomRoomIdReceivedRoomIdLock.withLock { roomRoomIdUnderlyingReceivedRoomId } }
set { roomRoomIdReceivedRoomIdLock.withLock { roomRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let roomRoomIdReceivedInvocationsLock = NSLock()
private var roomRoomIdUnderlyingReceivedInvocations: [String] = []
open var roomRoomIdReceivedInvocations: [String] {
get { roomRoomIdReceivedInvocationsLock.withLock { roomRoomIdUnderlyingReceivedInvocations } }
set { roomRoomIdReceivedInvocationsLock.withLock { roomRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let roomRoomIdReturnValueLock = NSLock()
open var roomRoomIdUnderlyingReturnValue: Room!
open var roomRoomIdReturnValue: Room! {
get { roomRoomIdReturnValueLock.withLock { roomRoomIdUnderlyingReturnValue } }
set { roomRoomIdReturnValueLock.withLock { roomRoomIdUnderlyingReturnValue = newValue } }
}
open var roomRoomIdClosure: ((String) throws -> Room)?
open override func room(roomId: String) throws -> Room {
if let error = roomRoomIdThrowableError {
throw error
}
roomRoomIdCallsCountLock.withLock { roomRoomIdUnderlyingCallsCount += 1 }
roomRoomIdReceivedRoomId = roomId
roomRoomIdReceivedInvocationsLock.withLock { roomRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let roomRoomIdClosure = roomRoomIdClosure {
return try roomRoomIdClosure(roomId)
} else {
return roomRoomIdReturnValue
}
}
//MARK: - setRoomSubscriptions
open var setRoomSubscriptionsRoomIdsThrowableError: Error?
private let setRoomSubscriptionsRoomIdsCallsCountLock = NSLock()
private var setRoomSubscriptionsRoomIdsUnderlyingCallsCount = 0
open var setRoomSubscriptionsRoomIdsCallsCount: Int {
get { setRoomSubscriptionsRoomIdsCallsCountLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingCallsCount } }
set { setRoomSubscriptionsRoomIdsCallsCountLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingCallsCount = newValue } }
}
open var setRoomSubscriptionsRoomIdsCalled: Bool {
return setRoomSubscriptionsRoomIdsCallsCount > 0
}
private let setRoomSubscriptionsRoomIdsReceivedRoomIdsLock = NSLock()
private var setRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds: [String]?
open var setRoomSubscriptionsRoomIdsReceivedRoomIds: [String]? {
get { setRoomSubscriptionsRoomIdsReceivedRoomIdsLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds } }
set { setRoomSubscriptionsRoomIdsReceivedRoomIdsLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingReceivedRoomIds = newValue } }
}
private let setRoomSubscriptionsRoomIdsReceivedInvocationsLock = NSLock()
private var setRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations: [[String]] = []
open var setRoomSubscriptionsRoomIdsReceivedInvocations: [[String]] {
get { setRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations } }
set { setRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations = newValue } }
}
open var setRoomSubscriptionsRoomIdsClosure: (([String]) async throws -> Void)?
open override func setRoomSubscriptions(roomIds: [String]) async throws {
if let error = setRoomSubscriptionsRoomIdsThrowableError {
throw error
}
setRoomSubscriptionsRoomIdsCallsCountLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingCallsCount += 1 }
setRoomSubscriptionsRoomIdsReceivedRoomIds = roomIds
setRoomSubscriptionsRoomIdsReceivedInvocationsLock.withLock { setRoomSubscriptionsRoomIdsUnderlyingReceivedInvocations.append(roomIds) }
try await setRoomSubscriptionsRoomIdsClosure?(roomIds)
}
//MARK: - state
private let stateListenerCallsCountLock = NSLock()
private var stateListenerUnderlyingCallsCount = 0
open var stateListenerCallsCount: Int {
get { stateListenerCallsCountLock.withLock { stateListenerUnderlyingCallsCount } }
set { stateListenerCallsCountLock.withLock { stateListenerUnderlyingCallsCount = newValue } }
}
open var stateListenerCalled: Bool {
return stateListenerCallsCount > 0
}
private let stateListenerReceivedListenerLock = NSLock()
private var stateListenerUnderlyingReceivedListener: RoomListServiceStateListener?
open var stateListenerReceivedListener: RoomListServiceStateListener? {
get { stateListenerReceivedListenerLock.withLock { stateListenerUnderlyingReceivedListener } }
set { stateListenerReceivedListenerLock.withLock { stateListenerUnderlyingReceivedListener = newValue } }
}
private let stateListenerReceivedInvocationsLock = NSLock()
private var stateListenerUnderlyingReceivedInvocations: [RoomListServiceStateListener] = []
open var stateListenerReceivedInvocations: [RoomListServiceStateListener] {
get { stateListenerReceivedInvocationsLock.withLock { stateListenerUnderlyingReceivedInvocations } }
set { stateListenerReceivedInvocationsLock.withLock { stateListenerUnderlyingReceivedInvocations = newValue } }
}
private let stateListenerReturnValueLock = NSLock()
open var stateListenerUnderlyingReturnValue: TaskHandle!
open var stateListenerReturnValue: TaskHandle! {
get { stateListenerReturnValueLock.withLock { stateListenerUnderlyingReturnValue } }
set { stateListenerReturnValueLock.withLock { stateListenerUnderlyingReturnValue = newValue } }
}
open var stateListenerClosure: ((RoomListServiceStateListener) -> TaskHandle)?
open override func state(listener: RoomListServiceStateListener) -> TaskHandle {
stateListenerCallsCountLock.withLock { stateListenerUnderlyingCallsCount += 1 }
stateListenerReceivedListener = listener
stateListenerReceivedInvocationsLock.withLock { stateListenerUnderlyingReceivedInvocations.append(listener) }
if let stateListenerClosure = stateListenerClosure {
return stateListenerClosure(listener)
} else {
return stateListenerReturnValue
}
}
//MARK: - syncIndicator
private let syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerCallsCountLock = NSLock()
private var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingCallsCount = 0
open var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerCallsCount: Int {
get { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerCallsCountLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingCallsCount } }
set { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerCallsCountLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingCallsCount = newValue } }
}
open var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerCalled: Bool {
return syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerCallsCount > 0
}
private let syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedArgumentsLock = NSLock()
private var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReceivedArguments: (delayBeforeShowingInMs: UInt32, delayBeforeHidingInMs: UInt32, listener: RoomListServiceSyncIndicatorListener)?
open var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedArguments: (delayBeforeShowingInMs: UInt32, delayBeforeHidingInMs: UInt32, listener: RoomListServiceSyncIndicatorListener)? {
get { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedArgumentsLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReceivedArguments } }
set { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedArgumentsLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReceivedArguments = newValue } }
}
private let syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedInvocationsLock = NSLock()
private var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReceivedInvocations: [(delayBeforeShowingInMs: UInt32, delayBeforeHidingInMs: UInt32, listener: RoomListServiceSyncIndicatorListener)] = []
open var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedInvocations: [(delayBeforeShowingInMs: UInt32, delayBeforeHidingInMs: UInt32, listener: RoomListServiceSyncIndicatorListener)] {
get { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedInvocationsLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReceivedInvocations } }
set { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedInvocationsLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReceivedInvocations = newValue } }
}
private let syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReturnValueLock = NSLock()
open var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReturnValue: TaskHandle!
open var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReturnValue: TaskHandle! {
get { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReturnValueLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReturnValue } }
set { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReturnValueLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReturnValue = newValue } }
}
open var syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerClosure: ((UInt32, UInt32, RoomListServiceSyncIndicatorListener) -> TaskHandle)?
open override func syncIndicator(delayBeforeShowingInMs: UInt32, delayBeforeHidingInMs: UInt32, listener: RoomListServiceSyncIndicatorListener) -> TaskHandle {
syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerCallsCountLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingCallsCount += 1 }
syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedArguments = (delayBeforeShowingInMs: delayBeforeShowingInMs, delayBeforeHidingInMs: delayBeforeHidingInMs, listener: listener)
syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReceivedInvocationsLock.withLock { syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerUnderlyingReceivedInvocations.append((delayBeforeShowingInMs: delayBeforeShowingInMs, delayBeforeHidingInMs: delayBeforeHidingInMs, listener: listener)) }
if let syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerClosure = syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerClosure {
return syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerClosure(delayBeforeShowingInMs, delayBeforeHidingInMs, listener)
} else {
return syncIndicatorDelayBeforeShowingInMsDelayBeforeHidingInMsListenerReturnValue
}
}
}
open class RoomMembersIteratorSDKMock: MatrixRustSDK.RoomMembersIterator, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - len
private let lenCallsCountLock = NSLock()
private var lenUnderlyingCallsCount = 0
open var lenCallsCount: Int {
get { lenCallsCountLock.withLock { lenUnderlyingCallsCount } }
set { lenCallsCountLock.withLock { lenUnderlyingCallsCount = newValue } }
}
open var lenCalled: Bool {
return lenCallsCount > 0
}
private let lenReturnValueLock = NSLock()
open var lenUnderlyingReturnValue: UInt32!
open var lenReturnValue: UInt32! {
get { lenReturnValueLock.withLock { lenUnderlyingReturnValue } }
set { lenReturnValueLock.withLock { lenUnderlyingReturnValue = newValue } }
}
open var lenClosure: (() -> UInt32)?
open override func len() -> UInt32 {
lenCallsCountLock.withLock { lenUnderlyingCallsCount += 1 }
if let lenClosure = lenClosure {
return lenClosure()
} else {
return lenReturnValue
}
}
//MARK: - nextChunk
private let nextChunkChunkSizeCallsCountLock = NSLock()
private var nextChunkChunkSizeUnderlyingCallsCount = 0
open var nextChunkChunkSizeCallsCount: Int {
get { nextChunkChunkSizeCallsCountLock.withLock { nextChunkChunkSizeUnderlyingCallsCount } }
set { nextChunkChunkSizeCallsCountLock.withLock { nextChunkChunkSizeUnderlyingCallsCount = newValue } }
}
open var nextChunkChunkSizeCalled: Bool {
return nextChunkChunkSizeCallsCount > 0
}
private let nextChunkChunkSizeReceivedChunkSizeLock = NSLock()
private var nextChunkChunkSizeUnderlyingReceivedChunkSize: UInt32?
open var nextChunkChunkSizeReceivedChunkSize: UInt32? {
get { nextChunkChunkSizeReceivedChunkSizeLock.withLock { nextChunkChunkSizeUnderlyingReceivedChunkSize } }
set { nextChunkChunkSizeReceivedChunkSizeLock.withLock { nextChunkChunkSizeUnderlyingReceivedChunkSize = newValue } }
}
private let nextChunkChunkSizeReceivedInvocationsLock = NSLock()
private var nextChunkChunkSizeUnderlyingReceivedInvocations: [UInt32] = []
open var nextChunkChunkSizeReceivedInvocations: [UInt32] {
get { nextChunkChunkSizeReceivedInvocationsLock.withLock { nextChunkChunkSizeUnderlyingReceivedInvocations } }
set { nextChunkChunkSizeReceivedInvocationsLock.withLock { nextChunkChunkSizeUnderlyingReceivedInvocations = newValue } }
}
private let nextChunkChunkSizeReturnValueLock = NSLock()
open var nextChunkChunkSizeUnderlyingReturnValue: [RoomMember]?
open var nextChunkChunkSizeReturnValue: [RoomMember]? {
get { nextChunkChunkSizeReturnValueLock.withLock { nextChunkChunkSizeUnderlyingReturnValue } }
set { nextChunkChunkSizeReturnValueLock.withLock { nextChunkChunkSizeUnderlyingReturnValue = newValue } }
}
open var nextChunkChunkSizeClosure: ((UInt32) -> [RoomMember]?)?
open override func nextChunk(chunkSize: UInt32) -> [RoomMember]? {
nextChunkChunkSizeCallsCountLock.withLock { nextChunkChunkSizeUnderlyingCallsCount += 1 }
nextChunkChunkSizeReceivedChunkSize = chunkSize
nextChunkChunkSizeReceivedInvocationsLock.withLock { nextChunkChunkSizeUnderlyingReceivedInvocations.append(chunkSize) }
if let nextChunkChunkSizeClosure = nextChunkChunkSizeClosure {
return nextChunkChunkSizeClosure(chunkSize)
} else {
return nextChunkChunkSizeReturnValue
}
}
}
open class RoomMessageEventContentWithoutRelationSDKMock: MatrixRustSDK.RoomMessageEventContentWithoutRelation, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - withMentions
private let withMentionsMentionsCallsCountLock = NSLock()
private var withMentionsMentionsUnderlyingCallsCount = 0
open var withMentionsMentionsCallsCount: Int {
get { withMentionsMentionsCallsCountLock.withLock { withMentionsMentionsUnderlyingCallsCount } }
set { withMentionsMentionsCallsCountLock.withLock { withMentionsMentionsUnderlyingCallsCount = newValue } }
}
open var withMentionsMentionsCalled: Bool {
return withMentionsMentionsCallsCount > 0
}
private let withMentionsMentionsReceivedMentionsLock = NSLock()
private var withMentionsMentionsUnderlyingReceivedMentions: Mentions?
open var withMentionsMentionsReceivedMentions: Mentions? {
get { withMentionsMentionsReceivedMentionsLock.withLock { withMentionsMentionsUnderlyingReceivedMentions } }
set { withMentionsMentionsReceivedMentionsLock.withLock { withMentionsMentionsUnderlyingReceivedMentions = newValue } }
}
private let withMentionsMentionsReceivedInvocationsLock = NSLock()
private var withMentionsMentionsUnderlyingReceivedInvocations: [Mentions] = []
open var withMentionsMentionsReceivedInvocations: [Mentions] {
get { withMentionsMentionsReceivedInvocationsLock.withLock { withMentionsMentionsUnderlyingReceivedInvocations } }
set { withMentionsMentionsReceivedInvocationsLock.withLock { withMentionsMentionsUnderlyingReceivedInvocations = newValue } }
}
private let withMentionsMentionsReturnValueLock = NSLock()
open var withMentionsMentionsUnderlyingReturnValue: RoomMessageEventContentWithoutRelation!
open var withMentionsMentionsReturnValue: RoomMessageEventContentWithoutRelation! {
get { withMentionsMentionsReturnValueLock.withLock { withMentionsMentionsUnderlyingReturnValue } }
set { withMentionsMentionsReturnValueLock.withLock { withMentionsMentionsUnderlyingReturnValue = newValue } }
}
open var withMentionsMentionsClosure: ((Mentions) -> RoomMessageEventContentWithoutRelation)?
open override func withMentions(mentions: Mentions) -> RoomMessageEventContentWithoutRelation {
withMentionsMentionsCallsCountLock.withLock { withMentionsMentionsUnderlyingCallsCount += 1 }
withMentionsMentionsReceivedMentions = mentions
withMentionsMentionsReceivedInvocationsLock.withLock { withMentionsMentionsUnderlyingReceivedInvocations.append(mentions) }
if let withMentionsMentionsClosure = withMentionsMentionsClosure {
return withMentionsMentionsClosure(mentions)
} else {
return withMentionsMentionsReturnValue
}
}
}
open class RoomPowerLevelsSDKMock: MatrixRustSDK.RoomPowerLevels, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - canOwnUserBan
private let canOwnUserBanCallsCountLock = NSLock()
private var canOwnUserBanUnderlyingCallsCount = 0
open var canOwnUserBanCallsCount: Int {
get { canOwnUserBanCallsCountLock.withLock { canOwnUserBanUnderlyingCallsCount } }
set { canOwnUserBanCallsCountLock.withLock { canOwnUserBanUnderlyingCallsCount = newValue } }
}
open var canOwnUserBanCalled: Bool {
return canOwnUserBanCallsCount > 0
}
private let canOwnUserBanReturnValueLock = NSLock()
open var canOwnUserBanUnderlyingReturnValue: Bool!
open var canOwnUserBanReturnValue: Bool! {
get { canOwnUserBanReturnValueLock.withLock { canOwnUserBanUnderlyingReturnValue } }
set { canOwnUserBanReturnValueLock.withLock { canOwnUserBanUnderlyingReturnValue = newValue } }
}
open var canOwnUserBanClosure: (() -> Bool)?
open override func canOwnUserBan() -> Bool {
canOwnUserBanCallsCountLock.withLock { canOwnUserBanUnderlyingCallsCount += 1 }
if let canOwnUserBanClosure = canOwnUserBanClosure {
return canOwnUserBanClosure()
} else {
return canOwnUserBanReturnValue
}
}
//MARK: - canOwnUserInvite
private let canOwnUserInviteCallsCountLock = NSLock()
private var canOwnUserInviteUnderlyingCallsCount = 0
open var canOwnUserInviteCallsCount: Int {
get { canOwnUserInviteCallsCountLock.withLock { canOwnUserInviteUnderlyingCallsCount } }
set { canOwnUserInviteCallsCountLock.withLock { canOwnUserInviteUnderlyingCallsCount = newValue } }
}
open var canOwnUserInviteCalled: Bool {
return canOwnUserInviteCallsCount > 0
}
private let canOwnUserInviteReturnValueLock = NSLock()
open var canOwnUserInviteUnderlyingReturnValue: Bool!
open var canOwnUserInviteReturnValue: Bool! {
get { canOwnUserInviteReturnValueLock.withLock { canOwnUserInviteUnderlyingReturnValue } }
set { canOwnUserInviteReturnValueLock.withLock { canOwnUserInviteUnderlyingReturnValue = newValue } }
}
open var canOwnUserInviteClosure: (() -> Bool)?
open override func canOwnUserInvite() -> Bool {
canOwnUserInviteCallsCountLock.withLock { canOwnUserInviteUnderlyingCallsCount += 1 }
if let canOwnUserInviteClosure = canOwnUserInviteClosure {
return canOwnUserInviteClosure()
} else {
return canOwnUserInviteReturnValue
}
}
//MARK: - canOwnUserKick
private let canOwnUserKickCallsCountLock = NSLock()
private var canOwnUserKickUnderlyingCallsCount = 0
open var canOwnUserKickCallsCount: Int {
get { canOwnUserKickCallsCountLock.withLock { canOwnUserKickUnderlyingCallsCount } }
set { canOwnUserKickCallsCountLock.withLock { canOwnUserKickUnderlyingCallsCount = newValue } }
}
open var canOwnUserKickCalled: Bool {
return canOwnUserKickCallsCount > 0
}
private let canOwnUserKickReturnValueLock = NSLock()
open var canOwnUserKickUnderlyingReturnValue: Bool!
open var canOwnUserKickReturnValue: Bool! {
get { canOwnUserKickReturnValueLock.withLock { canOwnUserKickUnderlyingReturnValue } }
set { canOwnUserKickReturnValueLock.withLock { canOwnUserKickUnderlyingReturnValue = newValue } }
}
open var canOwnUserKickClosure: (() -> Bool)?
open override func canOwnUserKick() -> Bool {
canOwnUserKickCallsCountLock.withLock { canOwnUserKickUnderlyingCallsCount += 1 }
if let canOwnUserKickClosure = canOwnUserKickClosure {
return canOwnUserKickClosure()
} else {
return canOwnUserKickReturnValue
}
}
//MARK: - canOwnUserPinUnpin
private let canOwnUserPinUnpinCallsCountLock = NSLock()
private var canOwnUserPinUnpinUnderlyingCallsCount = 0
open var canOwnUserPinUnpinCallsCount: Int {
get { canOwnUserPinUnpinCallsCountLock.withLock { canOwnUserPinUnpinUnderlyingCallsCount } }
set { canOwnUserPinUnpinCallsCountLock.withLock { canOwnUserPinUnpinUnderlyingCallsCount = newValue } }
}
open var canOwnUserPinUnpinCalled: Bool {
return canOwnUserPinUnpinCallsCount > 0
}
private let canOwnUserPinUnpinReturnValueLock = NSLock()
open var canOwnUserPinUnpinUnderlyingReturnValue: Bool!
open var canOwnUserPinUnpinReturnValue: Bool! {
get { canOwnUserPinUnpinReturnValueLock.withLock { canOwnUserPinUnpinUnderlyingReturnValue } }
set { canOwnUserPinUnpinReturnValueLock.withLock { canOwnUserPinUnpinUnderlyingReturnValue = newValue } }
}
open var canOwnUserPinUnpinClosure: (() -> Bool)?
open override func canOwnUserPinUnpin() -> Bool {
canOwnUserPinUnpinCallsCountLock.withLock { canOwnUserPinUnpinUnderlyingCallsCount += 1 }
if let canOwnUserPinUnpinClosure = canOwnUserPinUnpinClosure {
return canOwnUserPinUnpinClosure()
} else {
return canOwnUserPinUnpinReturnValue
}
}
//MARK: - canOwnUserRedactOther
private let canOwnUserRedactOtherCallsCountLock = NSLock()
private var canOwnUserRedactOtherUnderlyingCallsCount = 0
open var canOwnUserRedactOtherCallsCount: Int {
get { canOwnUserRedactOtherCallsCountLock.withLock { canOwnUserRedactOtherUnderlyingCallsCount } }
set { canOwnUserRedactOtherCallsCountLock.withLock { canOwnUserRedactOtherUnderlyingCallsCount = newValue } }
}
open var canOwnUserRedactOtherCalled: Bool {
return canOwnUserRedactOtherCallsCount > 0
}
private let canOwnUserRedactOtherReturnValueLock = NSLock()
open var canOwnUserRedactOtherUnderlyingReturnValue: Bool!
open var canOwnUserRedactOtherReturnValue: Bool! {
get { canOwnUserRedactOtherReturnValueLock.withLock { canOwnUserRedactOtherUnderlyingReturnValue } }
set { canOwnUserRedactOtherReturnValueLock.withLock { canOwnUserRedactOtherUnderlyingReturnValue = newValue } }
}
open var canOwnUserRedactOtherClosure: (() -> Bool)?
open override func canOwnUserRedactOther() -> Bool {
canOwnUserRedactOtherCallsCountLock.withLock { canOwnUserRedactOtherUnderlyingCallsCount += 1 }
if let canOwnUserRedactOtherClosure = canOwnUserRedactOtherClosure {
return canOwnUserRedactOtherClosure()
} else {
return canOwnUserRedactOtherReturnValue
}
}
//MARK: - canOwnUserRedactOwn
private let canOwnUserRedactOwnCallsCountLock = NSLock()
private var canOwnUserRedactOwnUnderlyingCallsCount = 0
open var canOwnUserRedactOwnCallsCount: Int {
get { canOwnUserRedactOwnCallsCountLock.withLock { canOwnUserRedactOwnUnderlyingCallsCount } }
set { canOwnUserRedactOwnCallsCountLock.withLock { canOwnUserRedactOwnUnderlyingCallsCount = newValue } }
}
open var canOwnUserRedactOwnCalled: Bool {
return canOwnUserRedactOwnCallsCount > 0
}
private let canOwnUserRedactOwnReturnValueLock = NSLock()
open var canOwnUserRedactOwnUnderlyingReturnValue: Bool!
open var canOwnUserRedactOwnReturnValue: Bool! {
get { canOwnUserRedactOwnReturnValueLock.withLock { canOwnUserRedactOwnUnderlyingReturnValue } }
set { canOwnUserRedactOwnReturnValueLock.withLock { canOwnUserRedactOwnUnderlyingReturnValue = newValue } }
}
open var canOwnUserRedactOwnClosure: (() -> Bool)?
open override func canOwnUserRedactOwn() -> Bool {
canOwnUserRedactOwnCallsCountLock.withLock { canOwnUserRedactOwnUnderlyingCallsCount += 1 }
if let canOwnUserRedactOwnClosure = canOwnUserRedactOwnClosure {
return canOwnUserRedactOwnClosure()
} else {
return canOwnUserRedactOwnReturnValue
}
}
//MARK: - canOwnUserSendMessage
private let canOwnUserSendMessageMessageCallsCountLock = NSLock()
private var canOwnUserSendMessageMessageUnderlyingCallsCount = 0
open var canOwnUserSendMessageMessageCallsCount: Int {
get { canOwnUserSendMessageMessageCallsCountLock.withLock { canOwnUserSendMessageMessageUnderlyingCallsCount } }
set { canOwnUserSendMessageMessageCallsCountLock.withLock { canOwnUserSendMessageMessageUnderlyingCallsCount = newValue } }
}
open var canOwnUserSendMessageMessageCalled: Bool {
return canOwnUserSendMessageMessageCallsCount > 0
}
private let canOwnUserSendMessageMessageReceivedMessageLock = NSLock()
private var canOwnUserSendMessageMessageUnderlyingReceivedMessage: MessageLikeEventType?
open var canOwnUserSendMessageMessageReceivedMessage: MessageLikeEventType? {
get { canOwnUserSendMessageMessageReceivedMessageLock.withLock { canOwnUserSendMessageMessageUnderlyingReceivedMessage } }
set { canOwnUserSendMessageMessageReceivedMessageLock.withLock { canOwnUserSendMessageMessageUnderlyingReceivedMessage = newValue } }
}
private let canOwnUserSendMessageMessageReceivedInvocationsLock = NSLock()
private var canOwnUserSendMessageMessageUnderlyingReceivedInvocations: [MessageLikeEventType] = []
open var canOwnUserSendMessageMessageReceivedInvocations: [MessageLikeEventType] {
get { canOwnUserSendMessageMessageReceivedInvocationsLock.withLock { canOwnUserSendMessageMessageUnderlyingReceivedInvocations } }
set { canOwnUserSendMessageMessageReceivedInvocationsLock.withLock { canOwnUserSendMessageMessageUnderlyingReceivedInvocations = newValue } }
}
private let canOwnUserSendMessageMessageReturnValueLock = NSLock()
open var canOwnUserSendMessageMessageUnderlyingReturnValue: Bool!
open var canOwnUserSendMessageMessageReturnValue: Bool! {
get { canOwnUserSendMessageMessageReturnValueLock.withLock { canOwnUserSendMessageMessageUnderlyingReturnValue } }
set { canOwnUserSendMessageMessageReturnValueLock.withLock { canOwnUserSendMessageMessageUnderlyingReturnValue = newValue } }
}
open var canOwnUserSendMessageMessageClosure: ((MessageLikeEventType) -> Bool)?
open override func canOwnUserSendMessage(message: MessageLikeEventType) -> Bool {
canOwnUserSendMessageMessageCallsCountLock.withLock { canOwnUserSendMessageMessageUnderlyingCallsCount += 1 }
canOwnUserSendMessageMessageReceivedMessage = message
canOwnUserSendMessageMessageReceivedInvocationsLock.withLock { canOwnUserSendMessageMessageUnderlyingReceivedInvocations.append(message) }
if let canOwnUserSendMessageMessageClosure = canOwnUserSendMessageMessageClosure {
return canOwnUserSendMessageMessageClosure(message)
} else {
return canOwnUserSendMessageMessageReturnValue
}
}
//MARK: - canOwnUserSendState
private let canOwnUserSendStateStateEventCallsCountLock = NSLock()
private var canOwnUserSendStateStateEventUnderlyingCallsCount = 0
open var canOwnUserSendStateStateEventCallsCount: Int {
get { canOwnUserSendStateStateEventCallsCountLock.withLock { canOwnUserSendStateStateEventUnderlyingCallsCount } }
set { canOwnUserSendStateStateEventCallsCountLock.withLock { canOwnUserSendStateStateEventUnderlyingCallsCount = newValue } }
}
open var canOwnUserSendStateStateEventCalled: Bool {
return canOwnUserSendStateStateEventCallsCount > 0
}
private let canOwnUserSendStateStateEventReceivedStateEventLock = NSLock()
private var canOwnUserSendStateStateEventUnderlyingReceivedStateEvent: StateEventType?
open var canOwnUserSendStateStateEventReceivedStateEvent: StateEventType? {
get { canOwnUserSendStateStateEventReceivedStateEventLock.withLock { canOwnUserSendStateStateEventUnderlyingReceivedStateEvent } }
set { canOwnUserSendStateStateEventReceivedStateEventLock.withLock { canOwnUserSendStateStateEventUnderlyingReceivedStateEvent = newValue } }
}
private let canOwnUserSendStateStateEventReceivedInvocationsLock = NSLock()
private var canOwnUserSendStateStateEventUnderlyingReceivedInvocations: [StateEventType] = []
open var canOwnUserSendStateStateEventReceivedInvocations: [StateEventType] {
get { canOwnUserSendStateStateEventReceivedInvocationsLock.withLock { canOwnUserSendStateStateEventUnderlyingReceivedInvocations } }
set { canOwnUserSendStateStateEventReceivedInvocationsLock.withLock { canOwnUserSendStateStateEventUnderlyingReceivedInvocations = newValue } }
}
private let canOwnUserSendStateStateEventReturnValueLock = NSLock()
open var canOwnUserSendStateStateEventUnderlyingReturnValue: Bool!
open var canOwnUserSendStateStateEventReturnValue: Bool! {
get { canOwnUserSendStateStateEventReturnValueLock.withLock { canOwnUserSendStateStateEventUnderlyingReturnValue } }
set { canOwnUserSendStateStateEventReturnValueLock.withLock { canOwnUserSendStateStateEventUnderlyingReturnValue = newValue } }
}
open var canOwnUserSendStateStateEventClosure: ((StateEventType) -> Bool)?
open override func canOwnUserSendState(stateEvent: StateEventType) -> Bool {
canOwnUserSendStateStateEventCallsCountLock.withLock { canOwnUserSendStateStateEventUnderlyingCallsCount += 1 }
canOwnUserSendStateStateEventReceivedStateEvent = stateEvent
canOwnUserSendStateStateEventReceivedInvocationsLock.withLock { canOwnUserSendStateStateEventUnderlyingReceivedInvocations.append(stateEvent) }
if let canOwnUserSendStateStateEventClosure = canOwnUserSendStateStateEventClosure {
return canOwnUserSendStateStateEventClosure(stateEvent)
} else {
return canOwnUserSendStateStateEventReturnValue
}
}
//MARK: - canOwnUserTriggerRoomNotification
private let canOwnUserTriggerRoomNotificationCallsCountLock = NSLock()
private var canOwnUserTriggerRoomNotificationUnderlyingCallsCount = 0
open var canOwnUserTriggerRoomNotificationCallsCount: Int {
get { canOwnUserTriggerRoomNotificationCallsCountLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingCallsCount } }
set { canOwnUserTriggerRoomNotificationCallsCountLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingCallsCount = newValue } }
}
open var canOwnUserTriggerRoomNotificationCalled: Bool {
return canOwnUserTriggerRoomNotificationCallsCount > 0
}
private let canOwnUserTriggerRoomNotificationReturnValueLock = NSLock()
open var canOwnUserTriggerRoomNotificationUnderlyingReturnValue: Bool!
open var canOwnUserTriggerRoomNotificationReturnValue: Bool! {
get { canOwnUserTriggerRoomNotificationReturnValueLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingReturnValue } }
set { canOwnUserTriggerRoomNotificationReturnValueLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingReturnValue = newValue } }
}
open var canOwnUserTriggerRoomNotificationClosure: (() -> Bool)?
open override func canOwnUserTriggerRoomNotification() -> Bool {
canOwnUserTriggerRoomNotificationCallsCountLock.withLock { canOwnUserTriggerRoomNotificationUnderlyingCallsCount += 1 }
if let canOwnUserTriggerRoomNotificationClosure = canOwnUserTriggerRoomNotificationClosure {
return canOwnUserTriggerRoomNotificationClosure()
} else {
return canOwnUserTriggerRoomNotificationReturnValue
}
}
//MARK: - canUserBan
open var canUserBanUserIdThrowableError: Error?
private let canUserBanUserIdCallsCountLock = NSLock()
private var canUserBanUserIdUnderlyingCallsCount = 0
open var canUserBanUserIdCallsCount: Int {
get { canUserBanUserIdCallsCountLock.withLock { canUserBanUserIdUnderlyingCallsCount } }
set { canUserBanUserIdCallsCountLock.withLock { canUserBanUserIdUnderlyingCallsCount = newValue } }
}
open var canUserBanUserIdCalled: Bool {
return canUserBanUserIdCallsCount > 0
}
private let canUserBanUserIdReceivedUserIdLock = NSLock()
private var canUserBanUserIdUnderlyingReceivedUserId: String?
open var canUserBanUserIdReceivedUserId: String? {
get { canUserBanUserIdReceivedUserIdLock.withLock { canUserBanUserIdUnderlyingReceivedUserId } }
set { canUserBanUserIdReceivedUserIdLock.withLock { canUserBanUserIdUnderlyingReceivedUserId = newValue } }
}
private let canUserBanUserIdReceivedInvocationsLock = NSLock()
private var canUserBanUserIdUnderlyingReceivedInvocations: [String] = []
open var canUserBanUserIdReceivedInvocations: [String] {
get { canUserBanUserIdReceivedInvocationsLock.withLock { canUserBanUserIdUnderlyingReceivedInvocations } }
set { canUserBanUserIdReceivedInvocationsLock.withLock { canUserBanUserIdUnderlyingReceivedInvocations = newValue } }
}
private let canUserBanUserIdReturnValueLock = NSLock()
open var canUserBanUserIdUnderlyingReturnValue: Bool!
open var canUserBanUserIdReturnValue: Bool! {
get { canUserBanUserIdReturnValueLock.withLock { canUserBanUserIdUnderlyingReturnValue } }
set { canUserBanUserIdReturnValueLock.withLock { canUserBanUserIdUnderlyingReturnValue = newValue } }
}
open var canUserBanUserIdClosure: ((String) throws -> Bool)?
open override func canUserBan(userId: String) throws -> Bool {
if let error = canUserBanUserIdThrowableError {
throw error
}
canUserBanUserIdCallsCountLock.withLock { canUserBanUserIdUnderlyingCallsCount += 1 }
canUserBanUserIdReceivedUserId = userId
canUserBanUserIdReceivedInvocationsLock.withLock { canUserBanUserIdUnderlyingReceivedInvocations.append(userId) }
if let canUserBanUserIdClosure = canUserBanUserIdClosure {
return try canUserBanUserIdClosure(userId)
} else {
return canUserBanUserIdReturnValue
}
}
//MARK: - canUserInvite
open var canUserInviteUserIdThrowableError: Error?
private let canUserInviteUserIdCallsCountLock = NSLock()
private var canUserInviteUserIdUnderlyingCallsCount = 0
open var canUserInviteUserIdCallsCount: Int {
get { canUserInviteUserIdCallsCountLock.withLock { canUserInviteUserIdUnderlyingCallsCount } }
set { canUserInviteUserIdCallsCountLock.withLock { canUserInviteUserIdUnderlyingCallsCount = newValue } }
}
open var canUserInviteUserIdCalled: Bool {
return canUserInviteUserIdCallsCount > 0
}
private let canUserInviteUserIdReceivedUserIdLock = NSLock()
private var canUserInviteUserIdUnderlyingReceivedUserId: String?
open var canUserInviteUserIdReceivedUserId: String? {
get { canUserInviteUserIdReceivedUserIdLock.withLock { canUserInviteUserIdUnderlyingReceivedUserId } }
set { canUserInviteUserIdReceivedUserIdLock.withLock { canUserInviteUserIdUnderlyingReceivedUserId = newValue } }
}
private let canUserInviteUserIdReceivedInvocationsLock = NSLock()
private var canUserInviteUserIdUnderlyingReceivedInvocations: [String] = []
open var canUserInviteUserIdReceivedInvocations: [String] {
get { canUserInviteUserIdReceivedInvocationsLock.withLock { canUserInviteUserIdUnderlyingReceivedInvocations } }
set { canUserInviteUserIdReceivedInvocationsLock.withLock { canUserInviteUserIdUnderlyingReceivedInvocations = newValue } }
}
private let canUserInviteUserIdReturnValueLock = NSLock()
open var canUserInviteUserIdUnderlyingReturnValue: Bool!
open var canUserInviteUserIdReturnValue: Bool! {
get { canUserInviteUserIdReturnValueLock.withLock { canUserInviteUserIdUnderlyingReturnValue } }
set { canUserInviteUserIdReturnValueLock.withLock { canUserInviteUserIdUnderlyingReturnValue = newValue } }
}
open var canUserInviteUserIdClosure: ((String) throws -> Bool)?
open override func canUserInvite(userId: String) throws -> Bool {
if let error = canUserInviteUserIdThrowableError {
throw error
}
canUserInviteUserIdCallsCountLock.withLock { canUserInviteUserIdUnderlyingCallsCount += 1 }
canUserInviteUserIdReceivedUserId = userId
canUserInviteUserIdReceivedInvocationsLock.withLock { canUserInviteUserIdUnderlyingReceivedInvocations.append(userId) }
if let canUserInviteUserIdClosure = canUserInviteUserIdClosure {
return try canUserInviteUserIdClosure(userId)
} else {
return canUserInviteUserIdReturnValue
}
}
//MARK: - canUserKick
open var canUserKickUserIdThrowableError: Error?
private let canUserKickUserIdCallsCountLock = NSLock()
private var canUserKickUserIdUnderlyingCallsCount = 0
open var canUserKickUserIdCallsCount: Int {
get { canUserKickUserIdCallsCountLock.withLock { canUserKickUserIdUnderlyingCallsCount } }
set { canUserKickUserIdCallsCountLock.withLock { canUserKickUserIdUnderlyingCallsCount = newValue } }
}
open var canUserKickUserIdCalled: Bool {
return canUserKickUserIdCallsCount > 0
}
private let canUserKickUserIdReceivedUserIdLock = NSLock()
private var canUserKickUserIdUnderlyingReceivedUserId: String?
open var canUserKickUserIdReceivedUserId: String? {
get { canUserKickUserIdReceivedUserIdLock.withLock { canUserKickUserIdUnderlyingReceivedUserId } }
set { canUserKickUserIdReceivedUserIdLock.withLock { canUserKickUserIdUnderlyingReceivedUserId = newValue } }
}
private let canUserKickUserIdReceivedInvocationsLock = NSLock()
private var canUserKickUserIdUnderlyingReceivedInvocations: [String] = []
open var canUserKickUserIdReceivedInvocations: [String] {
get { canUserKickUserIdReceivedInvocationsLock.withLock { canUserKickUserIdUnderlyingReceivedInvocations } }
set { canUserKickUserIdReceivedInvocationsLock.withLock { canUserKickUserIdUnderlyingReceivedInvocations = newValue } }
}
private let canUserKickUserIdReturnValueLock = NSLock()
open var canUserKickUserIdUnderlyingReturnValue: Bool!
open var canUserKickUserIdReturnValue: Bool! {
get { canUserKickUserIdReturnValueLock.withLock { canUserKickUserIdUnderlyingReturnValue } }
set { canUserKickUserIdReturnValueLock.withLock { canUserKickUserIdUnderlyingReturnValue = newValue } }
}
open var canUserKickUserIdClosure: ((String) throws -> Bool)?
open override func canUserKick(userId: String) throws -> Bool {
if let error = canUserKickUserIdThrowableError {
throw error
}
canUserKickUserIdCallsCountLock.withLock { canUserKickUserIdUnderlyingCallsCount += 1 }
canUserKickUserIdReceivedUserId = userId
canUserKickUserIdReceivedInvocationsLock.withLock { canUserKickUserIdUnderlyingReceivedInvocations.append(userId) }
if let canUserKickUserIdClosure = canUserKickUserIdClosure {
return try canUserKickUserIdClosure(userId)
} else {
return canUserKickUserIdReturnValue
}
}
//MARK: - canUserPinUnpin
open var canUserPinUnpinUserIdThrowableError: Error?
private let canUserPinUnpinUserIdCallsCountLock = NSLock()
private var canUserPinUnpinUserIdUnderlyingCallsCount = 0
open var canUserPinUnpinUserIdCallsCount: Int {
get { canUserPinUnpinUserIdCallsCountLock.withLock { canUserPinUnpinUserIdUnderlyingCallsCount } }
set { canUserPinUnpinUserIdCallsCountLock.withLock { canUserPinUnpinUserIdUnderlyingCallsCount = newValue } }
}
open var canUserPinUnpinUserIdCalled: Bool {
return canUserPinUnpinUserIdCallsCount > 0
}
private let canUserPinUnpinUserIdReceivedUserIdLock = NSLock()
private var canUserPinUnpinUserIdUnderlyingReceivedUserId: String?
open var canUserPinUnpinUserIdReceivedUserId: String? {
get { canUserPinUnpinUserIdReceivedUserIdLock.withLock { canUserPinUnpinUserIdUnderlyingReceivedUserId } }
set { canUserPinUnpinUserIdReceivedUserIdLock.withLock { canUserPinUnpinUserIdUnderlyingReceivedUserId = newValue } }
}
private let canUserPinUnpinUserIdReceivedInvocationsLock = NSLock()
private var canUserPinUnpinUserIdUnderlyingReceivedInvocations: [String] = []
open var canUserPinUnpinUserIdReceivedInvocations: [String] {
get { canUserPinUnpinUserIdReceivedInvocationsLock.withLock { canUserPinUnpinUserIdUnderlyingReceivedInvocations } }
set { canUserPinUnpinUserIdReceivedInvocationsLock.withLock { canUserPinUnpinUserIdUnderlyingReceivedInvocations = newValue } }
}
private let canUserPinUnpinUserIdReturnValueLock = NSLock()
open var canUserPinUnpinUserIdUnderlyingReturnValue: Bool!
open var canUserPinUnpinUserIdReturnValue: Bool! {
get { canUserPinUnpinUserIdReturnValueLock.withLock { canUserPinUnpinUserIdUnderlyingReturnValue } }
set { canUserPinUnpinUserIdReturnValueLock.withLock { canUserPinUnpinUserIdUnderlyingReturnValue = newValue } }
}
open var canUserPinUnpinUserIdClosure: ((String) throws -> Bool)?
open override func canUserPinUnpin(userId: String) throws -> Bool {
if let error = canUserPinUnpinUserIdThrowableError {
throw error
}
canUserPinUnpinUserIdCallsCountLock.withLock { canUserPinUnpinUserIdUnderlyingCallsCount += 1 }
canUserPinUnpinUserIdReceivedUserId = userId
canUserPinUnpinUserIdReceivedInvocationsLock.withLock { canUserPinUnpinUserIdUnderlyingReceivedInvocations.append(userId) }
if let canUserPinUnpinUserIdClosure = canUserPinUnpinUserIdClosure {
return try canUserPinUnpinUserIdClosure(userId)
} else {
return canUserPinUnpinUserIdReturnValue
}
}
//MARK: - canUserRedactOther
open var canUserRedactOtherUserIdThrowableError: Error?
private let canUserRedactOtherUserIdCallsCountLock = NSLock()
private var canUserRedactOtherUserIdUnderlyingCallsCount = 0
open var canUserRedactOtherUserIdCallsCount: Int {
get { canUserRedactOtherUserIdCallsCountLock.withLock { canUserRedactOtherUserIdUnderlyingCallsCount } }
set { canUserRedactOtherUserIdCallsCountLock.withLock { canUserRedactOtherUserIdUnderlyingCallsCount = newValue } }
}
open var canUserRedactOtherUserIdCalled: Bool {
return canUserRedactOtherUserIdCallsCount > 0
}
private let canUserRedactOtherUserIdReceivedUserIdLock = NSLock()
private var canUserRedactOtherUserIdUnderlyingReceivedUserId: String?
open var canUserRedactOtherUserIdReceivedUserId: String? {
get { canUserRedactOtherUserIdReceivedUserIdLock.withLock { canUserRedactOtherUserIdUnderlyingReceivedUserId } }
set { canUserRedactOtherUserIdReceivedUserIdLock.withLock { canUserRedactOtherUserIdUnderlyingReceivedUserId = newValue } }
}
private let canUserRedactOtherUserIdReceivedInvocationsLock = NSLock()
private var canUserRedactOtherUserIdUnderlyingReceivedInvocations: [String] = []
open var canUserRedactOtherUserIdReceivedInvocations: [String] {
get { canUserRedactOtherUserIdReceivedInvocationsLock.withLock { canUserRedactOtherUserIdUnderlyingReceivedInvocations } }
set { canUserRedactOtherUserIdReceivedInvocationsLock.withLock { canUserRedactOtherUserIdUnderlyingReceivedInvocations = newValue } }
}
private let canUserRedactOtherUserIdReturnValueLock = NSLock()
open var canUserRedactOtherUserIdUnderlyingReturnValue: Bool!
open var canUserRedactOtherUserIdReturnValue: Bool! {
get { canUserRedactOtherUserIdReturnValueLock.withLock { canUserRedactOtherUserIdUnderlyingReturnValue } }
set { canUserRedactOtherUserIdReturnValueLock.withLock { canUserRedactOtherUserIdUnderlyingReturnValue = newValue } }
}
open var canUserRedactOtherUserIdClosure: ((String) throws -> Bool)?
open override func canUserRedactOther(userId: String) throws -> Bool {
if let error = canUserRedactOtherUserIdThrowableError {
throw error
}
canUserRedactOtherUserIdCallsCountLock.withLock { canUserRedactOtherUserIdUnderlyingCallsCount += 1 }
canUserRedactOtherUserIdReceivedUserId = userId
canUserRedactOtherUserIdReceivedInvocationsLock.withLock { canUserRedactOtherUserIdUnderlyingReceivedInvocations.append(userId) }
if let canUserRedactOtherUserIdClosure = canUserRedactOtherUserIdClosure {
return try canUserRedactOtherUserIdClosure(userId)
} else {
return canUserRedactOtherUserIdReturnValue
}
}
//MARK: - canUserRedactOwn
open var canUserRedactOwnUserIdThrowableError: Error?
private let canUserRedactOwnUserIdCallsCountLock = NSLock()
private var canUserRedactOwnUserIdUnderlyingCallsCount = 0
open var canUserRedactOwnUserIdCallsCount: Int {
get { canUserRedactOwnUserIdCallsCountLock.withLock { canUserRedactOwnUserIdUnderlyingCallsCount } }
set { canUserRedactOwnUserIdCallsCountLock.withLock { canUserRedactOwnUserIdUnderlyingCallsCount = newValue } }
}
open var canUserRedactOwnUserIdCalled: Bool {
return canUserRedactOwnUserIdCallsCount > 0
}
private let canUserRedactOwnUserIdReceivedUserIdLock = NSLock()
private var canUserRedactOwnUserIdUnderlyingReceivedUserId: String?
open var canUserRedactOwnUserIdReceivedUserId: String? {
get { canUserRedactOwnUserIdReceivedUserIdLock.withLock { canUserRedactOwnUserIdUnderlyingReceivedUserId } }
set { canUserRedactOwnUserIdReceivedUserIdLock.withLock { canUserRedactOwnUserIdUnderlyingReceivedUserId = newValue } }
}
private let canUserRedactOwnUserIdReceivedInvocationsLock = NSLock()
private var canUserRedactOwnUserIdUnderlyingReceivedInvocations: [String] = []
open var canUserRedactOwnUserIdReceivedInvocations: [String] {
get { canUserRedactOwnUserIdReceivedInvocationsLock.withLock { canUserRedactOwnUserIdUnderlyingReceivedInvocations } }
set { canUserRedactOwnUserIdReceivedInvocationsLock.withLock { canUserRedactOwnUserIdUnderlyingReceivedInvocations = newValue } }
}
private let canUserRedactOwnUserIdReturnValueLock = NSLock()
open var canUserRedactOwnUserIdUnderlyingReturnValue: Bool!
open var canUserRedactOwnUserIdReturnValue: Bool! {
get { canUserRedactOwnUserIdReturnValueLock.withLock { canUserRedactOwnUserIdUnderlyingReturnValue } }
set { canUserRedactOwnUserIdReturnValueLock.withLock { canUserRedactOwnUserIdUnderlyingReturnValue = newValue } }
}
open var canUserRedactOwnUserIdClosure: ((String) throws -> Bool)?
open override func canUserRedactOwn(userId: String) throws -> Bool {
if let error = canUserRedactOwnUserIdThrowableError {
throw error
}
canUserRedactOwnUserIdCallsCountLock.withLock { canUserRedactOwnUserIdUnderlyingCallsCount += 1 }
canUserRedactOwnUserIdReceivedUserId = userId
canUserRedactOwnUserIdReceivedInvocationsLock.withLock { canUserRedactOwnUserIdUnderlyingReceivedInvocations.append(userId) }
if let canUserRedactOwnUserIdClosure = canUserRedactOwnUserIdClosure {
return try canUserRedactOwnUserIdClosure(userId)
} else {
return canUserRedactOwnUserIdReturnValue
}
}
//MARK: - canUserSendMessage
open var canUserSendMessageUserIdMessageThrowableError: Error?
private let canUserSendMessageUserIdMessageCallsCountLock = NSLock()
private var canUserSendMessageUserIdMessageUnderlyingCallsCount = 0
open var canUserSendMessageUserIdMessageCallsCount: Int {
get { canUserSendMessageUserIdMessageCallsCountLock.withLock { canUserSendMessageUserIdMessageUnderlyingCallsCount } }
set { canUserSendMessageUserIdMessageCallsCountLock.withLock { canUserSendMessageUserIdMessageUnderlyingCallsCount = newValue } }
}
open var canUserSendMessageUserIdMessageCalled: Bool {
return canUserSendMessageUserIdMessageCallsCount > 0
}
private let canUserSendMessageUserIdMessageReceivedArgumentsLock = NSLock()
private var canUserSendMessageUserIdMessageUnderlyingReceivedArguments: (userId: String, message: MessageLikeEventType)?
open var canUserSendMessageUserIdMessageReceivedArguments: (userId: String, message: MessageLikeEventType)? {
get { canUserSendMessageUserIdMessageReceivedArgumentsLock.withLock { canUserSendMessageUserIdMessageUnderlyingReceivedArguments } }
set { canUserSendMessageUserIdMessageReceivedArgumentsLock.withLock { canUserSendMessageUserIdMessageUnderlyingReceivedArguments = newValue } }
}
private let canUserSendMessageUserIdMessageReceivedInvocationsLock = NSLock()
private var canUserSendMessageUserIdMessageUnderlyingReceivedInvocations: [(userId: String, message: MessageLikeEventType)] = []
open var canUserSendMessageUserIdMessageReceivedInvocations: [(userId: String, message: MessageLikeEventType)] {
get { canUserSendMessageUserIdMessageReceivedInvocationsLock.withLock { canUserSendMessageUserIdMessageUnderlyingReceivedInvocations } }
set { canUserSendMessageUserIdMessageReceivedInvocationsLock.withLock { canUserSendMessageUserIdMessageUnderlyingReceivedInvocations = newValue } }
}
private let canUserSendMessageUserIdMessageReturnValueLock = NSLock()
open var canUserSendMessageUserIdMessageUnderlyingReturnValue: Bool!
open var canUserSendMessageUserIdMessageReturnValue: Bool! {
get { canUserSendMessageUserIdMessageReturnValueLock.withLock { canUserSendMessageUserIdMessageUnderlyingReturnValue } }
set { canUserSendMessageUserIdMessageReturnValueLock.withLock { canUserSendMessageUserIdMessageUnderlyingReturnValue = newValue } }
}
open var canUserSendMessageUserIdMessageClosure: ((String, MessageLikeEventType) throws -> Bool)?
open override func canUserSendMessage(userId: String, message: MessageLikeEventType) throws -> Bool {
if let error = canUserSendMessageUserIdMessageThrowableError {
throw error
}
canUserSendMessageUserIdMessageCallsCountLock.withLock { canUserSendMessageUserIdMessageUnderlyingCallsCount += 1 }
canUserSendMessageUserIdMessageReceivedArguments = (userId: userId, message: message)
canUserSendMessageUserIdMessageReceivedInvocationsLock.withLock { canUserSendMessageUserIdMessageUnderlyingReceivedInvocations.append((userId: userId, message: message)) }
if let canUserSendMessageUserIdMessageClosure = canUserSendMessageUserIdMessageClosure {
return try canUserSendMessageUserIdMessageClosure(userId, message)
} else {
return canUserSendMessageUserIdMessageReturnValue
}
}
//MARK: - canUserSendState
open var canUserSendStateUserIdStateEventThrowableError: Error?
private let canUserSendStateUserIdStateEventCallsCountLock = NSLock()
private var canUserSendStateUserIdStateEventUnderlyingCallsCount = 0
open var canUserSendStateUserIdStateEventCallsCount: Int {
get { canUserSendStateUserIdStateEventCallsCountLock.withLock { canUserSendStateUserIdStateEventUnderlyingCallsCount } }
set { canUserSendStateUserIdStateEventCallsCountLock.withLock { canUserSendStateUserIdStateEventUnderlyingCallsCount = newValue } }
}
open var canUserSendStateUserIdStateEventCalled: Bool {
return canUserSendStateUserIdStateEventCallsCount > 0
}
private let canUserSendStateUserIdStateEventReceivedArgumentsLock = NSLock()
private var canUserSendStateUserIdStateEventUnderlyingReceivedArguments: (userId: String, stateEvent: StateEventType)?
open var canUserSendStateUserIdStateEventReceivedArguments: (userId: String, stateEvent: StateEventType)? {
get { canUserSendStateUserIdStateEventReceivedArgumentsLock.withLock { canUserSendStateUserIdStateEventUnderlyingReceivedArguments } }
set { canUserSendStateUserIdStateEventReceivedArgumentsLock.withLock { canUserSendStateUserIdStateEventUnderlyingReceivedArguments = newValue } }
}
private let canUserSendStateUserIdStateEventReceivedInvocationsLock = NSLock()
private var canUserSendStateUserIdStateEventUnderlyingReceivedInvocations: [(userId: String, stateEvent: StateEventType)] = []
open var canUserSendStateUserIdStateEventReceivedInvocations: [(userId: String, stateEvent: StateEventType)] {
get { canUserSendStateUserIdStateEventReceivedInvocationsLock.withLock { canUserSendStateUserIdStateEventUnderlyingReceivedInvocations } }
set { canUserSendStateUserIdStateEventReceivedInvocationsLock.withLock { canUserSendStateUserIdStateEventUnderlyingReceivedInvocations = newValue } }
}
private let canUserSendStateUserIdStateEventReturnValueLock = NSLock()
open var canUserSendStateUserIdStateEventUnderlyingReturnValue: Bool!
open var canUserSendStateUserIdStateEventReturnValue: Bool! {
get { canUserSendStateUserIdStateEventReturnValueLock.withLock { canUserSendStateUserIdStateEventUnderlyingReturnValue } }
set { canUserSendStateUserIdStateEventReturnValueLock.withLock { canUserSendStateUserIdStateEventUnderlyingReturnValue = newValue } }
}
open var canUserSendStateUserIdStateEventClosure: ((String, StateEventType) throws -> Bool)?
open override func canUserSendState(userId: String, stateEvent: StateEventType) throws -> Bool {
if let error = canUserSendStateUserIdStateEventThrowableError {
throw error
}
canUserSendStateUserIdStateEventCallsCountLock.withLock { canUserSendStateUserIdStateEventUnderlyingCallsCount += 1 }
canUserSendStateUserIdStateEventReceivedArguments = (userId: userId, stateEvent: stateEvent)
canUserSendStateUserIdStateEventReceivedInvocationsLock.withLock { canUserSendStateUserIdStateEventUnderlyingReceivedInvocations.append((userId: userId, stateEvent: stateEvent)) }
if let canUserSendStateUserIdStateEventClosure = canUserSendStateUserIdStateEventClosure {
return try canUserSendStateUserIdStateEventClosure(userId, stateEvent)
} else {
return canUserSendStateUserIdStateEventReturnValue
}
}
//MARK: - canUserTriggerRoomNotification
open var canUserTriggerRoomNotificationUserIdThrowableError: Error?
private let canUserTriggerRoomNotificationUserIdCallsCountLock = NSLock()
private var canUserTriggerRoomNotificationUserIdUnderlyingCallsCount = 0
open var canUserTriggerRoomNotificationUserIdCallsCount: Int {
get { canUserTriggerRoomNotificationUserIdCallsCountLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingCallsCount } }
set { canUserTriggerRoomNotificationUserIdCallsCountLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingCallsCount = newValue } }
}
open var canUserTriggerRoomNotificationUserIdCalled: Bool {
return canUserTriggerRoomNotificationUserIdCallsCount > 0
}
private let canUserTriggerRoomNotificationUserIdReceivedUserIdLock = NSLock()
private var canUserTriggerRoomNotificationUserIdUnderlyingReceivedUserId: String?
open var canUserTriggerRoomNotificationUserIdReceivedUserId: String? {
get { canUserTriggerRoomNotificationUserIdReceivedUserIdLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingReceivedUserId } }
set { canUserTriggerRoomNotificationUserIdReceivedUserIdLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingReceivedUserId = newValue } }
}
private let canUserTriggerRoomNotificationUserIdReceivedInvocationsLock = NSLock()
private var canUserTriggerRoomNotificationUserIdUnderlyingReceivedInvocations: [String] = []
open var canUserTriggerRoomNotificationUserIdReceivedInvocations: [String] {
get { canUserTriggerRoomNotificationUserIdReceivedInvocationsLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingReceivedInvocations } }
set { canUserTriggerRoomNotificationUserIdReceivedInvocationsLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingReceivedInvocations = newValue } }
}
private let canUserTriggerRoomNotificationUserIdReturnValueLock = NSLock()
open var canUserTriggerRoomNotificationUserIdUnderlyingReturnValue: Bool!
open var canUserTriggerRoomNotificationUserIdReturnValue: Bool! {
get { canUserTriggerRoomNotificationUserIdReturnValueLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingReturnValue } }
set { canUserTriggerRoomNotificationUserIdReturnValueLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingReturnValue = newValue } }
}
open var canUserTriggerRoomNotificationUserIdClosure: ((String) throws -> Bool)?
open override func canUserTriggerRoomNotification(userId: String) throws -> Bool {
if let error = canUserTriggerRoomNotificationUserIdThrowableError {
throw error
}
canUserTriggerRoomNotificationUserIdCallsCountLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingCallsCount += 1 }
canUserTriggerRoomNotificationUserIdReceivedUserId = userId
canUserTriggerRoomNotificationUserIdReceivedInvocationsLock.withLock { canUserTriggerRoomNotificationUserIdUnderlyingReceivedInvocations.append(userId) }
if let canUserTriggerRoomNotificationUserIdClosure = canUserTriggerRoomNotificationUserIdClosure {
return try canUserTriggerRoomNotificationUserIdClosure(userId)
} else {
return canUserTriggerRoomNotificationUserIdReturnValue
}
}
//MARK: - events
private let eventsCallsCountLock = NSLock()
private var eventsUnderlyingCallsCount = 0
open var eventsCallsCount: Int {
get { eventsCallsCountLock.withLock { eventsUnderlyingCallsCount } }
set { eventsCallsCountLock.withLock { eventsUnderlyingCallsCount = newValue } }
}
open var eventsCalled: Bool {
return eventsCallsCount > 0
}
private let eventsReturnValueLock = NSLock()
open var eventsUnderlyingReturnValue: [FfiTimelineEventType: Int64]!
open var eventsReturnValue: [FfiTimelineEventType: Int64]! {
get { eventsReturnValueLock.withLock { eventsUnderlyingReturnValue } }
set { eventsReturnValueLock.withLock { eventsUnderlyingReturnValue = newValue } }
}
open var eventsClosure: (() -> [FfiTimelineEventType: Int64])?
open override func events() -> [FfiTimelineEventType: Int64] {
eventsCallsCountLock.withLock { eventsUnderlyingCallsCount += 1 }
if let eventsClosure = eventsClosure {
return eventsClosure()
} else {
return eventsReturnValue
}
}
//MARK: - userPowerLevels
private let userPowerLevelsCallsCountLock = NSLock()
private var userPowerLevelsUnderlyingCallsCount = 0
open var userPowerLevelsCallsCount: Int {
get { userPowerLevelsCallsCountLock.withLock { userPowerLevelsUnderlyingCallsCount } }
set { userPowerLevelsCallsCountLock.withLock { userPowerLevelsUnderlyingCallsCount = newValue } }
}
open var userPowerLevelsCalled: Bool {
return userPowerLevelsCallsCount > 0
}
private let userPowerLevelsReturnValueLock = NSLock()
open var userPowerLevelsUnderlyingReturnValue: [String: Int64]!
open var userPowerLevelsReturnValue: [String: Int64]! {
get { userPowerLevelsReturnValueLock.withLock { userPowerLevelsUnderlyingReturnValue } }
set { userPowerLevelsReturnValueLock.withLock { userPowerLevelsUnderlyingReturnValue = newValue } }
}
open var userPowerLevelsClosure: (() -> [String: Int64])?
open override func userPowerLevels() -> [String: Int64] {
userPowerLevelsCallsCountLock.withLock { userPowerLevelsUnderlyingCallsCount += 1 }
if let userPowerLevelsClosure = userPowerLevelsClosure {
return userPowerLevelsClosure()
} else {
return userPowerLevelsReturnValue
}
}
//MARK: - values
private let valuesCallsCountLock = NSLock()
private var valuesUnderlyingCallsCount = 0
open var valuesCallsCount: Int {
get { valuesCallsCountLock.withLock { valuesUnderlyingCallsCount } }
set { valuesCallsCountLock.withLock { valuesUnderlyingCallsCount = newValue } }
}
open var valuesCalled: Bool {
return valuesCallsCount > 0
}
private let valuesReturnValueLock = NSLock()
open var valuesUnderlyingReturnValue: RoomPowerLevelsValues!
open var valuesReturnValue: RoomPowerLevelsValues! {
get { valuesReturnValueLock.withLock { valuesUnderlyingReturnValue } }
set { valuesReturnValueLock.withLock { valuesUnderlyingReturnValue = newValue } }
}
open var valuesClosure: (() -> RoomPowerLevelsValues)?
open override func values() -> RoomPowerLevelsValues {
valuesCallsCountLock.withLock { valuesUnderlyingCallsCount += 1 }
if let valuesClosure = valuesClosure {
return valuesClosure()
} else {
return valuesReturnValue
}
}
}
open class RoomPreviewSDKMock: MatrixRustSDK.RoomPreview, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - forget
open var forgetThrowableError: Error?
private let forgetCallsCountLock = NSLock()
private var forgetUnderlyingCallsCount = 0
open var forgetCallsCount: Int {
get { forgetCallsCountLock.withLock { forgetUnderlyingCallsCount } }
set { forgetCallsCountLock.withLock { forgetUnderlyingCallsCount = newValue } }
}
open var forgetCalled: Bool {
return forgetCallsCount > 0
}
open var forgetClosure: (() async throws -> Void)?
open override func forget() async throws {
if let error = forgetThrowableError {
throw error
}
forgetCallsCountLock.withLock { forgetUnderlyingCallsCount += 1 }
try await forgetClosure?()
}
//MARK: - info
private let infoCallsCountLock = NSLock()
private var infoUnderlyingCallsCount = 0
open var infoCallsCount: Int {
get { infoCallsCountLock.withLock { infoUnderlyingCallsCount } }
set { infoCallsCountLock.withLock { infoUnderlyingCallsCount = newValue } }
}
open var infoCalled: Bool {
return infoCallsCount > 0
}
private let infoReturnValueLock = NSLock()
open var infoUnderlyingReturnValue: RoomPreviewInfo!
open var infoReturnValue: RoomPreviewInfo! {
get { infoReturnValueLock.withLock { infoUnderlyingReturnValue } }
set { infoReturnValueLock.withLock { infoUnderlyingReturnValue = newValue } }
}
open var infoClosure: (() -> RoomPreviewInfo)?
open override func info() -> RoomPreviewInfo {
infoCallsCountLock.withLock { infoUnderlyingCallsCount += 1 }
if let infoClosure = infoClosure {
return infoClosure()
} else {
return infoReturnValue
}
}
//MARK: - inviter
private let inviterCallsCountLock = NSLock()
private var inviterUnderlyingCallsCount = 0
open var inviterCallsCount: Int {
get { inviterCallsCountLock.withLock { inviterUnderlyingCallsCount } }
set { inviterCallsCountLock.withLock { inviterUnderlyingCallsCount = newValue } }
}
open var inviterCalled: Bool {
return inviterCallsCount > 0
}
private let inviterReturnValueLock = NSLock()
open var inviterUnderlyingReturnValue: RoomMember?
open var inviterReturnValue: RoomMember? {
get { inviterReturnValueLock.withLock { inviterUnderlyingReturnValue } }
set { inviterReturnValueLock.withLock { inviterUnderlyingReturnValue = newValue } }
}
open var inviterClosure: (() async -> RoomMember?)?
open override func inviter() async -> RoomMember? {
inviterCallsCountLock.withLock { inviterUnderlyingCallsCount += 1 }
if let inviterClosure = inviterClosure {
return await inviterClosure()
} else {
return inviterReturnValue
}
}
//MARK: - leave
open var leaveThrowableError: Error?
private let leaveCallsCountLock = NSLock()
private var leaveUnderlyingCallsCount = 0
open var leaveCallsCount: Int {
get { leaveCallsCountLock.withLock { leaveUnderlyingCallsCount } }
set { leaveCallsCountLock.withLock { leaveUnderlyingCallsCount = newValue } }
}
open var leaveCalled: Bool {
return leaveCallsCount > 0
}
open var leaveClosure: (() async throws -> Void)?
open override func leave() async throws {
if let error = leaveThrowableError {
throw error
}
leaveCallsCountLock.withLock { leaveUnderlyingCallsCount += 1 }
try await leaveClosure?()
}
//MARK: - ownMembershipDetails
private let ownMembershipDetailsCallsCountLock = NSLock()
private var ownMembershipDetailsUnderlyingCallsCount = 0
open var ownMembershipDetailsCallsCount: Int {
get { ownMembershipDetailsCallsCountLock.withLock { ownMembershipDetailsUnderlyingCallsCount } }
set { ownMembershipDetailsCallsCountLock.withLock { ownMembershipDetailsUnderlyingCallsCount = newValue } }
}
open var ownMembershipDetailsCalled: Bool {
return ownMembershipDetailsCallsCount > 0
}
private let ownMembershipDetailsReturnValueLock = NSLock()
open var ownMembershipDetailsUnderlyingReturnValue: RoomMemberWithSenderInfo?
open var ownMembershipDetailsReturnValue: RoomMemberWithSenderInfo? {
get { ownMembershipDetailsReturnValueLock.withLock { ownMembershipDetailsUnderlyingReturnValue } }
set { ownMembershipDetailsReturnValueLock.withLock { ownMembershipDetailsUnderlyingReturnValue = newValue } }
}
open var ownMembershipDetailsClosure: (() async -> RoomMemberWithSenderInfo?)?
open override func ownMembershipDetails() async -> RoomMemberWithSenderInfo? {
ownMembershipDetailsCallsCountLock.withLock { ownMembershipDetailsUnderlyingCallsCount += 1 }
if let ownMembershipDetailsClosure = ownMembershipDetailsClosure {
return await ownMembershipDetailsClosure()
} else {
return ownMembershipDetailsReturnValue
}
}
}
open class SearchServiceSDKMock: MatrixRustSDK.SearchService, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - paginate
open var paginateThrowableError: Error?
private let paginateCallsCountLock = NSLock()
private var paginateUnderlyingCallsCount = 0
open var paginateCallsCount: Int {
get { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount } }
set { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount = newValue } }
}
open var paginateCalled: Bool {
return paginateCallsCount > 0
}
open var paginateClosure: (() async throws -> Void)?
open override func paginate() async throws {
if let error = paginateThrowableError {
throw error
}
paginateCallsCountLock.withLock { paginateUnderlyingCallsCount += 1 }
try await paginateClosure?()
}
//MARK: - paginationState
private let paginationStateCallsCountLock = NSLock()
private var paginationStateUnderlyingCallsCount = 0
open var paginationStateCallsCount: Int {
get { paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount } }
set { paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount = newValue } }
}
open var paginationStateCalled: Bool {
return paginationStateCallsCount > 0
}
private let paginationStateReturnValueLock = NSLock()
open var paginationStateUnderlyingReturnValue: SearchServicePaginationState!
open var paginationStateReturnValue: SearchServicePaginationState! {
get { paginationStateReturnValueLock.withLock { paginationStateUnderlyingReturnValue } }
set { paginationStateReturnValueLock.withLock { paginationStateUnderlyingReturnValue = newValue } }
}
open var paginationStateClosure: (() -> SearchServicePaginationState)?
open override func paginationState() -> SearchServicePaginationState {
paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount += 1 }
if let paginationStateClosure = paginationStateClosure {
return paginationStateClosure()
} else {
return paginationStateReturnValue
}
}
//MARK: - setQuery
open var setQueryQueryThrowableError: Error?
private let setQueryQueryCallsCountLock = NSLock()
private var setQueryQueryUnderlyingCallsCount = 0
open var setQueryQueryCallsCount: Int {
get { setQueryQueryCallsCountLock.withLock { setQueryQueryUnderlyingCallsCount } }
set { setQueryQueryCallsCountLock.withLock { setQueryQueryUnderlyingCallsCount = newValue } }
}
open var setQueryQueryCalled: Bool {
return setQueryQueryCallsCount > 0
}
private let setQueryQueryReceivedQueryLock = NSLock()
private var setQueryQueryUnderlyingReceivedQuery: String?
open var setQueryQueryReceivedQuery: String? {
get { setQueryQueryReceivedQueryLock.withLock { setQueryQueryUnderlyingReceivedQuery } }
set { setQueryQueryReceivedQueryLock.withLock { setQueryQueryUnderlyingReceivedQuery = newValue } }
}
private let setQueryQueryReceivedInvocationsLock = NSLock()
private var setQueryQueryUnderlyingReceivedInvocations: [String] = []
open var setQueryQueryReceivedInvocations: [String] {
get { setQueryQueryReceivedInvocationsLock.withLock { setQueryQueryUnderlyingReceivedInvocations } }
set { setQueryQueryReceivedInvocationsLock.withLock { setQueryQueryUnderlyingReceivedInvocations = newValue } }
}
open var setQueryQueryClosure: ((String) async throws -> Void)?
open override func setQuery(query: String) async throws {
if let error = setQueryQueryThrowableError {
throw error
}
setQueryQueryCallsCountLock.withLock { setQueryQueryUnderlyingCallsCount += 1 }
setQueryQueryReceivedQuery = query
setQueryQueryReceivedInvocationsLock.withLock { setQueryQueryUnderlyingReceivedInvocations.append(query) }
try await setQueryQueryClosure?(query)
}
//MARK: - subscribeToPaginationStateUpdates
private let subscribeToPaginationStateUpdatesListenerCallsCountLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToPaginationStateUpdatesListenerCallsCount: Int {
get { subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount } }
set { subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToPaginationStateUpdatesListenerCalled: Bool {
return subscribeToPaginationStateUpdatesListenerCallsCount > 0
}
private let subscribeToPaginationStateUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener: SearchServicePaginationStateListener?
open var subscribeToPaginationStateUpdatesListenerReceivedListener: SearchServicePaginationStateListener? {
get { subscribeToPaginationStateUpdatesListenerReceivedListenerLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToPaginationStateUpdatesListenerReceivedListenerLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations: [SearchServicePaginationStateListener] = []
open var subscribeToPaginationStateUpdatesListenerReceivedInvocations: [SearchServicePaginationStateListener] {
get { subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToPaginationStateUpdatesListenerReturnValueLock = NSLock()
open var subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToPaginationStateUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToPaginationStateUpdatesListenerReturnValueLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue } }
set { subscribeToPaginationStateUpdatesListenerReturnValueLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToPaginationStateUpdatesListenerClosure: ((SearchServicePaginationStateListener) -> TaskHandle)?
open override func subscribeToPaginationStateUpdates(listener: SearchServicePaginationStateListener) -> TaskHandle {
subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToPaginationStateUpdatesListenerReceivedListener = listener
subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToPaginationStateUpdatesListenerClosure = subscribeToPaginationStateUpdatesListenerClosure {
return subscribeToPaginationStateUpdatesListenerClosure(listener)
} else {
return subscribeToPaginationStateUpdatesListenerReturnValue
}
}
//MARK: - subscribeToResults
private let subscribeToResultsListenerCallsCountLock = NSLock()
private var subscribeToResultsListenerUnderlyingCallsCount = 0
open var subscribeToResultsListenerCallsCount: Int {
get { subscribeToResultsListenerCallsCountLock.withLock { subscribeToResultsListenerUnderlyingCallsCount } }
set { subscribeToResultsListenerCallsCountLock.withLock { subscribeToResultsListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToResultsListenerCalled: Bool {
return subscribeToResultsListenerCallsCount > 0
}
private let subscribeToResultsListenerReceivedListenerLock = NSLock()
private var subscribeToResultsListenerUnderlyingReceivedListener: SearchServiceResultsListener?
open var subscribeToResultsListenerReceivedListener: SearchServiceResultsListener? {
get { subscribeToResultsListenerReceivedListenerLock.withLock { subscribeToResultsListenerUnderlyingReceivedListener } }
set { subscribeToResultsListenerReceivedListenerLock.withLock { subscribeToResultsListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToResultsListenerReceivedInvocationsLock = NSLock()
private var subscribeToResultsListenerUnderlyingReceivedInvocations: [SearchServiceResultsListener] = []
open var subscribeToResultsListenerReceivedInvocations: [SearchServiceResultsListener] {
get { subscribeToResultsListenerReceivedInvocationsLock.withLock { subscribeToResultsListenerUnderlyingReceivedInvocations } }
set { subscribeToResultsListenerReceivedInvocationsLock.withLock { subscribeToResultsListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToResultsListenerReturnValueLock = NSLock()
open var subscribeToResultsListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToResultsListenerReturnValue: TaskHandle! {
get { subscribeToResultsListenerReturnValueLock.withLock { subscribeToResultsListenerUnderlyingReturnValue } }
set { subscribeToResultsListenerReturnValueLock.withLock { subscribeToResultsListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToResultsListenerClosure: ((SearchServiceResultsListener) async -> TaskHandle)?
open override func subscribeToResults(listener: SearchServiceResultsListener) async -> TaskHandle {
subscribeToResultsListenerCallsCountLock.withLock { subscribeToResultsListenerUnderlyingCallsCount += 1 }
subscribeToResultsListenerReceivedListener = listener
subscribeToResultsListenerReceivedInvocationsLock.withLock { subscribeToResultsListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToResultsListenerClosure = subscribeToResultsListenerClosure {
return await subscribeToResultsListenerClosure(listener)
} else {
return subscribeToResultsListenerReturnValue
}
}
}
open class SecretsBundleSDKMock: MatrixRustSDK.SecretsBundle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
}
open class SecretsBundleWithUserIdSDKMock: MatrixRustSDK.SecretsBundleWithUserId, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
static func reset()
{
}
//MARK: - containsBackupKey
private let containsBackupKeyCallsCountLock = NSLock()
private var containsBackupKeyUnderlyingCallsCount = 0
open var containsBackupKeyCallsCount: Int {
get { containsBackupKeyCallsCountLock.withLock { containsBackupKeyUnderlyingCallsCount } }
set { containsBackupKeyCallsCountLock.withLock { containsBackupKeyUnderlyingCallsCount = newValue } }
}
open var containsBackupKeyCalled: Bool {
return containsBackupKeyCallsCount > 0
}
private let containsBackupKeyReturnValueLock = NSLock()
open var containsBackupKeyUnderlyingReturnValue: Bool!
open var containsBackupKeyReturnValue: Bool! {
get { containsBackupKeyReturnValueLock.withLock { containsBackupKeyUnderlyingReturnValue } }
set { containsBackupKeyReturnValueLock.withLock { containsBackupKeyUnderlyingReturnValue = newValue } }
}
open var containsBackupKeyClosure: (() -> Bool)?
open override func containsBackupKey() -> Bool {
containsBackupKeyCallsCountLock.withLock { containsBackupKeyUnderlyingCallsCount += 1 }
if let containsBackupKeyClosure = containsBackupKeyClosure {
return containsBackupKeyClosure()
} else {
return containsBackupKeyReturnValue
}
}
}
open class SendAttachmentJoinHandleSDKMock: MatrixRustSDK.SendAttachmentJoinHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - cancel
private let cancelCallsCountLock = NSLock()
private var cancelUnderlyingCallsCount = 0
open var cancelCallsCount: Int {
get { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount } }
set { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount = newValue } }
}
open var cancelCalled: Bool {
return cancelCallsCount > 0
}
open var cancelClosure: (() -> Void)?
open override func cancel() {
cancelCallsCountLock.withLock { cancelUnderlyingCallsCount += 1 }
cancelClosure?()
}
//MARK: - join
open var joinThrowableError: Error?
private let joinCallsCountLock = NSLock()
private var joinUnderlyingCallsCount = 0
open var joinCallsCount: Int {
get { joinCallsCountLock.withLock { joinUnderlyingCallsCount } }
set { joinCallsCountLock.withLock { joinUnderlyingCallsCount = newValue } }
}
open var joinCalled: Bool {
return joinCallsCount > 0
}
open var joinClosure: (() async throws -> Void)?
open override func join() async throws {
if let error = joinThrowableError {
throw error
}
joinCallsCountLock.withLock { joinUnderlyingCallsCount += 1 }
try await joinClosure?()
}
}
open class SendGalleryJoinHandleSDKMock: MatrixRustSDK.SendGalleryJoinHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - cancel
private let cancelCallsCountLock = NSLock()
private var cancelUnderlyingCallsCount = 0
open var cancelCallsCount: Int {
get { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount } }
set { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount = newValue } }
}
open var cancelCalled: Bool {
return cancelCallsCount > 0
}
open var cancelClosure: (() -> Void)?
open override func cancel() {
cancelCallsCountLock.withLock { cancelUnderlyingCallsCount += 1 }
cancelClosure?()
}
//MARK: - join
open var joinThrowableError: Error?
private let joinCallsCountLock = NSLock()
private var joinUnderlyingCallsCount = 0
open var joinCallsCount: Int {
get { joinCallsCountLock.withLock { joinUnderlyingCallsCount } }
set { joinCallsCountLock.withLock { joinUnderlyingCallsCount = newValue } }
}
open var joinCalled: Bool {
return joinCallsCount > 0
}
open var joinClosure: (() async throws -> Void)?
open override func join() async throws {
if let error = joinThrowableError {
throw error
}
joinCallsCountLock.withLock { joinUnderlyingCallsCount += 1 }
try await joinClosure?()
}
}
open class SendHandleSDKMock: MatrixRustSDK.SendHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - abort
open var abortReasonThrowableError: Error?
private let abortReasonCallsCountLock = NSLock()
private var abortReasonUnderlyingCallsCount = 0
open var abortReasonCallsCount: Int {
get { abortReasonCallsCountLock.withLock { abortReasonUnderlyingCallsCount } }
set { abortReasonCallsCountLock.withLock { abortReasonUnderlyingCallsCount = newValue } }
}
open var abortReasonCalled: Bool {
return abortReasonCallsCount > 0
}
private let abortReasonReceivedReasonLock = NSLock()
private var abortReasonUnderlyingReceivedReason: String?
open var abortReasonReceivedReason: String? {
get { abortReasonReceivedReasonLock.withLock { abortReasonUnderlyingReceivedReason } }
set { abortReasonReceivedReasonLock.withLock { abortReasonUnderlyingReceivedReason = newValue } }
}
private let abortReasonReceivedInvocationsLock = NSLock()
private var abortReasonUnderlyingReceivedInvocations: [String?] = []
open var abortReasonReceivedInvocations: [String?] {
get { abortReasonReceivedInvocationsLock.withLock { abortReasonUnderlyingReceivedInvocations } }
set { abortReasonReceivedInvocationsLock.withLock { abortReasonUnderlyingReceivedInvocations = newValue } }
}
private let abortReasonReturnValueLock = NSLock()
open var abortReasonUnderlyingReturnValue: Bool!
open var abortReasonReturnValue: Bool! {
get { abortReasonReturnValueLock.withLock { abortReasonUnderlyingReturnValue } }
set { abortReasonReturnValueLock.withLock { abortReasonUnderlyingReturnValue = newValue } }
}
open var abortReasonClosure: ((String?) async throws -> Bool)?
open override func abort(reason: String? = nil) async throws -> Bool {
if let error = abortReasonThrowableError {
throw error
}
abortReasonCallsCountLock.withLock { abortReasonUnderlyingCallsCount += 1 }
abortReasonReceivedReason = reason
abortReasonReceivedInvocationsLock.withLock { abortReasonUnderlyingReceivedInvocations.append(reason) }
if let abortReasonClosure = abortReasonClosure {
return try await abortReasonClosure(reason)
} else {
return abortReasonReturnValue
}
}
//MARK: - tryResend
open var tryResendThrowableError: Error?
private let tryResendCallsCountLock = NSLock()
private var tryResendUnderlyingCallsCount = 0
open var tryResendCallsCount: Int {
get { tryResendCallsCountLock.withLock { tryResendUnderlyingCallsCount } }
set { tryResendCallsCountLock.withLock { tryResendUnderlyingCallsCount = newValue } }
}
open var tryResendCalled: Bool {
return tryResendCallsCount > 0
}
open var tryResendClosure: (() async throws -> Void)?
open override func tryResend() async throws {
if let error = tryResendThrowableError {
throw error
}
tryResendCallsCountLock.withLock { tryResendUnderlyingCallsCount += 1 }
try await tryResendClosure?()
}
}
open class SessionVerificationControllerSDKMock: MatrixRustSDK.SessionVerificationController, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - acceptVerificationRequest
open var acceptVerificationRequestThrowableError: Error?
private let acceptVerificationRequestCallsCountLock = NSLock()
private var acceptVerificationRequestUnderlyingCallsCount = 0
open var acceptVerificationRequestCallsCount: Int {
get { acceptVerificationRequestCallsCountLock.withLock { acceptVerificationRequestUnderlyingCallsCount } }
set { acceptVerificationRequestCallsCountLock.withLock { acceptVerificationRequestUnderlyingCallsCount = newValue } }
}
open var acceptVerificationRequestCalled: Bool {
return acceptVerificationRequestCallsCount > 0
}
open var acceptVerificationRequestClosure: (() async throws -> Void)?
open override func acceptVerificationRequest() async throws {
if let error = acceptVerificationRequestThrowableError {
throw error
}
acceptVerificationRequestCallsCountLock.withLock { acceptVerificationRequestUnderlyingCallsCount += 1 }
try await acceptVerificationRequestClosure?()
}
//MARK: - acknowledgeVerificationRequest
open var acknowledgeVerificationRequestSenderIdFlowIdThrowableError: Error?
private let acknowledgeVerificationRequestSenderIdFlowIdCallsCountLock = NSLock()
private var acknowledgeVerificationRequestSenderIdFlowIdUnderlyingCallsCount = 0
open var acknowledgeVerificationRequestSenderIdFlowIdCallsCount: Int {
get { acknowledgeVerificationRequestSenderIdFlowIdCallsCountLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingCallsCount } }
set { acknowledgeVerificationRequestSenderIdFlowIdCallsCountLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingCallsCount = newValue } }
}
open var acknowledgeVerificationRequestSenderIdFlowIdCalled: Bool {
return acknowledgeVerificationRequestSenderIdFlowIdCallsCount > 0
}
private let acknowledgeVerificationRequestSenderIdFlowIdReceivedArgumentsLock = NSLock()
private var acknowledgeVerificationRequestSenderIdFlowIdUnderlyingReceivedArguments: (senderId: String, flowId: String)?
open var acknowledgeVerificationRequestSenderIdFlowIdReceivedArguments: (senderId: String, flowId: String)? {
get { acknowledgeVerificationRequestSenderIdFlowIdReceivedArgumentsLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingReceivedArguments } }
set { acknowledgeVerificationRequestSenderIdFlowIdReceivedArgumentsLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingReceivedArguments = newValue } }
}
private let acknowledgeVerificationRequestSenderIdFlowIdReceivedInvocationsLock = NSLock()
private var acknowledgeVerificationRequestSenderIdFlowIdUnderlyingReceivedInvocations: [(senderId: String, flowId: String)] = []
open var acknowledgeVerificationRequestSenderIdFlowIdReceivedInvocations: [(senderId: String, flowId: String)] {
get { acknowledgeVerificationRequestSenderIdFlowIdReceivedInvocationsLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingReceivedInvocations } }
set { acknowledgeVerificationRequestSenderIdFlowIdReceivedInvocationsLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingReceivedInvocations = newValue } }
}
open var acknowledgeVerificationRequestSenderIdFlowIdClosure: ((String, String) async throws -> Void)?
open override func acknowledgeVerificationRequest(senderId: String, flowId: String) async throws {
if let error = acknowledgeVerificationRequestSenderIdFlowIdThrowableError {
throw error
}
acknowledgeVerificationRequestSenderIdFlowIdCallsCountLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingCallsCount += 1 }
acknowledgeVerificationRequestSenderIdFlowIdReceivedArguments = (senderId: senderId, flowId: flowId)
acknowledgeVerificationRequestSenderIdFlowIdReceivedInvocationsLock.withLock { acknowledgeVerificationRequestSenderIdFlowIdUnderlyingReceivedInvocations.append((senderId: senderId, flowId: flowId)) }
try await acknowledgeVerificationRequestSenderIdFlowIdClosure?(senderId, flowId)
}
//MARK: - approveVerification
open var approveVerificationThrowableError: Error?
private let approveVerificationCallsCountLock = NSLock()
private var approveVerificationUnderlyingCallsCount = 0
open var approveVerificationCallsCount: Int {
get { approveVerificationCallsCountLock.withLock { approveVerificationUnderlyingCallsCount } }
set { approveVerificationCallsCountLock.withLock { approveVerificationUnderlyingCallsCount = newValue } }
}
open var approveVerificationCalled: Bool {
return approveVerificationCallsCount > 0
}
open var approveVerificationClosure: (() async throws -> Void)?
open override func approveVerification() async throws {
if let error = approveVerificationThrowableError {
throw error
}
approveVerificationCallsCountLock.withLock { approveVerificationUnderlyingCallsCount += 1 }
try await approveVerificationClosure?()
}
//MARK: - cancelVerification
open var cancelVerificationThrowableError: Error?
private let cancelVerificationCallsCountLock = NSLock()
private var cancelVerificationUnderlyingCallsCount = 0
open var cancelVerificationCallsCount: Int {
get { cancelVerificationCallsCountLock.withLock { cancelVerificationUnderlyingCallsCount } }
set { cancelVerificationCallsCountLock.withLock { cancelVerificationUnderlyingCallsCount = newValue } }
}
open var cancelVerificationCalled: Bool {
return cancelVerificationCallsCount > 0
}
open var cancelVerificationClosure: (() async throws -> Void)?
open override func cancelVerification() async throws {
if let error = cancelVerificationThrowableError {
throw error
}
cancelVerificationCallsCountLock.withLock { cancelVerificationUnderlyingCallsCount += 1 }
try await cancelVerificationClosure?()
}
//MARK: - declineVerification
open var declineVerificationThrowableError: Error?
private let declineVerificationCallsCountLock = NSLock()
private var declineVerificationUnderlyingCallsCount = 0
open var declineVerificationCallsCount: Int {
get { declineVerificationCallsCountLock.withLock { declineVerificationUnderlyingCallsCount } }
set { declineVerificationCallsCountLock.withLock { declineVerificationUnderlyingCallsCount = newValue } }
}
open var declineVerificationCalled: Bool {
return declineVerificationCallsCount > 0
}
open var declineVerificationClosure: (() async throws -> Void)?
open override func declineVerification() async throws {
if let error = declineVerificationThrowableError {
throw error
}
declineVerificationCallsCountLock.withLock { declineVerificationUnderlyingCallsCount += 1 }
try await declineVerificationClosure?()
}
//MARK: - requestDeviceVerification
open var requestDeviceVerificationThrowableError: Error?
private let requestDeviceVerificationCallsCountLock = NSLock()
private var requestDeviceVerificationUnderlyingCallsCount = 0
open var requestDeviceVerificationCallsCount: Int {
get { requestDeviceVerificationCallsCountLock.withLock { requestDeviceVerificationUnderlyingCallsCount } }
set { requestDeviceVerificationCallsCountLock.withLock { requestDeviceVerificationUnderlyingCallsCount = newValue } }
}
open var requestDeviceVerificationCalled: Bool {
return requestDeviceVerificationCallsCount > 0
}
open var requestDeviceVerificationClosure: (() async throws -> Void)?
open override func requestDeviceVerification() async throws {
if let error = requestDeviceVerificationThrowableError {
throw error
}
requestDeviceVerificationCallsCountLock.withLock { requestDeviceVerificationUnderlyingCallsCount += 1 }
try await requestDeviceVerificationClosure?()
}
//MARK: - requestUserVerification
open var requestUserVerificationUserIdThrowableError: Error?
private let requestUserVerificationUserIdCallsCountLock = NSLock()
private var requestUserVerificationUserIdUnderlyingCallsCount = 0
open var requestUserVerificationUserIdCallsCount: Int {
get { requestUserVerificationUserIdCallsCountLock.withLock { requestUserVerificationUserIdUnderlyingCallsCount } }
set { requestUserVerificationUserIdCallsCountLock.withLock { requestUserVerificationUserIdUnderlyingCallsCount = newValue } }
}
open var requestUserVerificationUserIdCalled: Bool {
return requestUserVerificationUserIdCallsCount > 0
}
private let requestUserVerificationUserIdReceivedUserIdLock = NSLock()
private var requestUserVerificationUserIdUnderlyingReceivedUserId: String?
open var requestUserVerificationUserIdReceivedUserId: String? {
get { requestUserVerificationUserIdReceivedUserIdLock.withLock { requestUserVerificationUserIdUnderlyingReceivedUserId } }
set { requestUserVerificationUserIdReceivedUserIdLock.withLock { requestUserVerificationUserIdUnderlyingReceivedUserId = newValue } }
}
private let requestUserVerificationUserIdReceivedInvocationsLock = NSLock()
private var requestUserVerificationUserIdUnderlyingReceivedInvocations: [String] = []
open var requestUserVerificationUserIdReceivedInvocations: [String] {
get { requestUserVerificationUserIdReceivedInvocationsLock.withLock { requestUserVerificationUserIdUnderlyingReceivedInvocations } }
set { requestUserVerificationUserIdReceivedInvocationsLock.withLock { requestUserVerificationUserIdUnderlyingReceivedInvocations = newValue } }
}
open var requestUserVerificationUserIdClosure: ((String) async throws -> Void)?
open override func requestUserVerification(userId: String) async throws {
if let error = requestUserVerificationUserIdThrowableError {
throw error
}
requestUserVerificationUserIdCallsCountLock.withLock { requestUserVerificationUserIdUnderlyingCallsCount += 1 }
requestUserVerificationUserIdReceivedUserId = userId
requestUserVerificationUserIdReceivedInvocationsLock.withLock { requestUserVerificationUserIdUnderlyingReceivedInvocations.append(userId) }
try await requestUserVerificationUserIdClosure?(userId)
}
//MARK: - setDelegate
private let setDelegateDelegateCallsCountLock = NSLock()
private var setDelegateDelegateUnderlyingCallsCount = 0
open var setDelegateDelegateCallsCount: Int {
get { setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount } }
set { setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount = newValue } }
}
open var setDelegateDelegateCalled: Bool {
return setDelegateDelegateCallsCount > 0
}
private let setDelegateDelegateReceivedDelegateLock = NSLock()
private var setDelegateDelegateUnderlyingReceivedDelegate: SessionVerificationControllerDelegate?
open var setDelegateDelegateReceivedDelegate: SessionVerificationControllerDelegate? {
get { setDelegateDelegateReceivedDelegateLock.withLock { setDelegateDelegateUnderlyingReceivedDelegate } }
set { setDelegateDelegateReceivedDelegateLock.withLock { setDelegateDelegateUnderlyingReceivedDelegate = newValue } }
}
private let setDelegateDelegateReceivedInvocationsLock = NSLock()
private var setDelegateDelegateUnderlyingReceivedInvocations: [SessionVerificationControllerDelegate?] = []
open var setDelegateDelegateReceivedInvocations: [SessionVerificationControllerDelegate?] {
get { setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations } }
set { setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations = newValue } }
}
open var setDelegateDelegateClosure: ((SessionVerificationControllerDelegate?) -> Void)?
open override func setDelegate(delegate: SessionVerificationControllerDelegate?) {
setDelegateDelegateCallsCountLock.withLock { setDelegateDelegateUnderlyingCallsCount += 1 }
setDelegateDelegateReceivedDelegate = delegate
setDelegateDelegateReceivedInvocationsLock.withLock { setDelegateDelegateUnderlyingReceivedInvocations.append(delegate) }
setDelegateDelegateClosure?(delegate)
}
//MARK: - startSasVerification
open var startSasVerificationThrowableError: Error?
private let startSasVerificationCallsCountLock = NSLock()
private var startSasVerificationUnderlyingCallsCount = 0
open var startSasVerificationCallsCount: Int {
get { startSasVerificationCallsCountLock.withLock { startSasVerificationUnderlyingCallsCount } }
set { startSasVerificationCallsCountLock.withLock { startSasVerificationUnderlyingCallsCount = newValue } }
}
open var startSasVerificationCalled: Bool {
return startSasVerificationCallsCount > 0
}
open var startSasVerificationClosure: (() async throws -> Void)?
open override func startSasVerification() async throws {
if let error = startSasVerificationThrowableError {
throw error
}
startSasVerificationCallsCountLock.withLock { startSasVerificationUnderlyingCallsCount += 1 }
try await startSasVerificationClosure?()
}
}
open class SessionVerificationEmojiSDKMock: MatrixRustSDK.SessionVerificationEmoji, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - description
private let descriptionCallsCountLock = NSLock()
private var descriptionUnderlyingCallsCount = 0
open var descriptionCallsCount: Int {
get { descriptionCallsCountLock.withLock { descriptionUnderlyingCallsCount } }
set { descriptionCallsCountLock.withLock { descriptionUnderlyingCallsCount = newValue } }
}
open var descriptionCalled: Bool {
return descriptionCallsCount > 0
}
private let descriptionReturnValueLock = NSLock()
open var descriptionUnderlyingReturnValue: String!
open var descriptionReturnValue: String! {
get { descriptionReturnValueLock.withLock { descriptionUnderlyingReturnValue } }
set { descriptionReturnValueLock.withLock { descriptionUnderlyingReturnValue = newValue } }
}
open var descriptionClosure: (() -> String)?
open override func description() -> String {
descriptionCallsCountLock.withLock { descriptionUnderlyingCallsCount += 1 }
if let descriptionClosure = descriptionClosure {
return descriptionClosure()
} else {
return descriptionReturnValue
}
}
//MARK: - symbol
private let symbolCallsCountLock = NSLock()
private var symbolUnderlyingCallsCount = 0
open var symbolCallsCount: Int {
get { symbolCallsCountLock.withLock { symbolUnderlyingCallsCount } }
set { symbolCallsCountLock.withLock { symbolUnderlyingCallsCount = newValue } }
}
open var symbolCalled: Bool {
return symbolCallsCount > 0
}
private let symbolReturnValueLock = NSLock()
open var symbolUnderlyingReturnValue: String!
open var symbolReturnValue: String! {
get { symbolReturnValueLock.withLock { symbolUnderlyingReturnValue } }
set { symbolReturnValueLock.withLock { symbolUnderlyingReturnValue = newValue } }
}
open var symbolClosure: (() -> String)?
open override func symbol() -> String {
symbolCallsCountLock.withLock { symbolUnderlyingCallsCount += 1 }
if let symbolClosure = symbolClosure {
return symbolClosure()
} else {
return symbolReturnValue
}
}
}
open class SpaceRoomListSDKMock: MatrixRustSDK.SpaceRoomList, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - paginate
open var paginateThrowableError: Error?
private let paginateCallsCountLock = NSLock()
private var paginateUnderlyingCallsCount = 0
open var paginateCallsCount: Int {
get { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount } }
set { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount = newValue } }
}
open var paginateCalled: Bool {
return paginateCallsCount > 0
}
open var paginateClosure: (() async throws -> Void)?
open override func paginate() async throws {
if let error = paginateThrowableError {
throw error
}
paginateCallsCountLock.withLock { paginateUnderlyingCallsCount += 1 }
try await paginateClosure?()
}
//MARK: - paginationState
private let paginationStateCallsCountLock = NSLock()
private var paginationStateUnderlyingCallsCount = 0
open var paginationStateCallsCount: Int {
get { paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount } }
set { paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount = newValue } }
}
open var paginationStateCalled: Bool {
return paginationStateCallsCount > 0
}
private let paginationStateReturnValueLock = NSLock()
open var paginationStateUnderlyingReturnValue: SpaceRoomListPaginationState!
open var paginationStateReturnValue: SpaceRoomListPaginationState! {
get { paginationStateReturnValueLock.withLock { paginationStateUnderlyingReturnValue } }
set { paginationStateReturnValueLock.withLock { paginationStateUnderlyingReturnValue = newValue } }
}
open var paginationStateClosure: (() -> SpaceRoomListPaginationState)?
open override func paginationState() -> SpaceRoomListPaginationState {
paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount += 1 }
if let paginationStateClosure = paginationStateClosure {
return paginationStateClosure()
} else {
return paginationStateReturnValue
}
}
//MARK: - reset
private let resetCallsCountLock = NSLock()
private var resetUnderlyingCallsCount = 0
open var resetCallsCount: Int {
get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } }
set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } }
}
open var resetCalled: Bool {
return resetCallsCount > 0
}
open var resetClosure: (() async -> Void)?
open override func reset() async {
resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 }
await resetClosure?()
}
//MARK: - rooms
private let roomsCallsCountLock = NSLock()
private var roomsUnderlyingCallsCount = 0
open var roomsCallsCount: Int {
get { roomsCallsCountLock.withLock { roomsUnderlyingCallsCount } }
set { roomsCallsCountLock.withLock { roomsUnderlyingCallsCount = newValue } }
}
open var roomsCalled: Bool {
return roomsCallsCount > 0
}
private let roomsReturnValueLock = NSLock()
open var roomsUnderlyingReturnValue: [SpaceRoom]!
open var roomsReturnValue: [SpaceRoom]! {
get { roomsReturnValueLock.withLock { roomsUnderlyingReturnValue } }
set { roomsReturnValueLock.withLock { roomsUnderlyingReturnValue = newValue } }
}
open var roomsClosure: (() async -> [SpaceRoom])?
open override func rooms() async -> [SpaceRoom] {
roomsCallsCountLock.withLock { roomsUnderlyingCallsCount += 1 }
if let roomsClosure = roomsClosure {
return await roomsClosure()
} else {
return roomsReturnValue
}
}
//MARK: - space
private let spaceCallsCountLock = NSLock()
private var spaceUnderlyingCallsCount = 0
open var spaceCallsCount: Int {
get { spaceCallsCountLock.withLock { spaceUnderlyingCallsCount } }
set { spaceCallsCountLock.withLock { spaceUnderlyingCallsCount = newValue } }
}
open var spaceCalled: Bool {
return spaceCallsCount > 0
}
private let spaceReturnValueLock = NSLock()
open var spaceUnderlyingReturnValue: SpaceRoom?
open var spaceReturnValue: SpaceRoom? {
get { spaceReturnValueLock.withLock { spaceUnderlyingReturnValue } }
set { spaceReturnValueLock.withLock { spaceUnderlyingReturnValue = newValue } }
}
open var spaceClosure: (() -> SpaceRoom?)?
open override func space() -> SpaceRoom? {
spaceCallsCountLock.withLock { spaceUnderlyingCallsCount += 1 }
if let spaceClosure = spaceClosure {
return spaceClosure()
} else {
return spaceReturnValue
}
}
//MARK: - subscribeToPaginationStateUpdates
private let subscribeToPaginationStateUpdatesListenerCallsCountLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToPaginationStateUpdatesListenerCallsCount: Int {
get { subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount } }
set { subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToPaginationStateUpdatesListenerCalled: Bool {
return subscribeToPaginationStateUpdatesListenerCallsCount > 0
}
private let subscribeToPaginationStateUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener: SpaceRoomListPaginationStateListener?
open var subscribeToPaginationStateUpdatesListenerReceivedListener: SpaceRoomListPaginationStateListener? {
get { subscribeToPaginationStateUpdatesListenerReceivedListenerLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToPaginationStateUpdatesListenerReceivedListenerLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations: [SpaceRoomListPaginationStateListener] = []
open var subscribeToPaginationStateUpdatesListenerReceivedInvocations: [SpaceRoomListPaginationStateListener] {
get { subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToPaginationStateUpdatesListenerReturnValueLock = NSLock()
open var subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToPaginationStateUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToPaginationStateUpdatesListenerReturnValueLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue } }
set { subscribeToPaginationStateUpdatesListenerReturnValueLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToPaginationStateUpdatesListenerClosure: ((SpaceRoomListPaginationStateListener) -> TaskHandle)?
open override func subscribeToPaginationStateUpdates(listener: SpaceRoomListPaginationStateListener) -> TaskHandle {
subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToPaginationStateUpdatesListenerReceivedListener = listener
subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToPaginationStateUpdatesListenerClosure = subscribeToPaginationStateUpdatesListenerClosure {
return subscribeToPaginationStateUpdatesListenerClosure(listener)
} else {
return subscribeToPaginationStateUpdatesListenerReturnValue
}
}
//MARK: - subscribeToRoomUpdate
private let subscribeToRoomUpdateListenerCallsCountLock = NSLock()
private var subscribeToRoomUpdateListenerUnderlyingCallsCount = 0
open var subscribeToRoomUpdateListenerCallsCount: Int {
get { subscribeToRoomUpdateListenerCallsCountLock.withLock { subscribeToRoomUpdateListenerUnderlyingCallsCount } }
set { subscribeToRoomUpdateListenerCallsCountLock.withLock { subscribeToRoomUpdateListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToRoomUpdateListenerCalled: Bool {
return subscribeToRoomUpdateListenerCallsCount > 0
}
private let subscribeToRoomUpdateListenerReceivedListenerLock = NSLock()
private var subscribeToRoomUpdateListenerUnderlyingReceivedListener: SpaceRoomListEntriesListener?
open var subscribeToRoomUpdateListenerReceivedListener: SpaceRoomListEntriesListener? {
get { subscribeToRoomUpdateListenerReceivedListenerLock.withLock { subscribeToRoomUpdateListenerUnderlyingReceivedListener } }
set { subscribeToRoomUpdateListenerReceivedListenerLock.withLock { subscribeToRoomUpdateListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToRoomUpdateListenerReceivedInvocationsLock = NSLock()
private var subscribeToRoomUpdateListenerUnderlyingReceivedInvocations: [SpaceRoomListEntriesListener] = []
open var subscribeToRoomUpdateListenerReceivedInvocations: [SpaceRoomListEntriesListener] {
get { subscribeToRoomUpdateListenerReceivedInvocationsLock.withLock { subscribeToRoomUpdateListenerUnderlyingReceivedInvocations } }
set { subscribeToRoomUpdateListenerReceivedInvocationsLock.withLock { subscribeToRoomUpdateListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToRoomUpdateListenerReturnValueLock = NSLock()
open var subscribeToRoomUpdateListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToRoomUpdateListenerReturnValue: TaskHandle! {
get { subscribeToRoomUpdateListenerReturnValueLock.withLock { subscribeToRoomUpdateListenerUnderlyingReturnValue } }
set { subscribeToRoomUpdateListenerReturnValueLock.withLock { subscribeToRoomUpdateListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToRoomUpdateListenerClosure: ((SpaceRoomListEntriesListener) async -> TaskHandle)?
open override func subscribeToRoomUpdate(listener: SpaceRoomListEntriesListener) async -> TaskHandle {
subscribeToRoomUpdateListenerCallsCountLock.withLock { subscribeToRoomUpdateListenerUnderlyingCallsCount += 1 }
subscribeToRoomUpdateListenerReceivedListener = listener
subscribeToRoomUpdateListenerReceivedInvocationsLock.withLock { subscribeToRoomUpdateListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToRoomUpdateListenerClosure = subscribeToRoomUpdateListenerClosure {
return await subscribeToRoomUpdateListenerClosure(listener)
} else {
return subscribeToRoomUpdateListenerReturnValue
}
}
//MARK: - subscribeToSpaceUpdates
private let subscribeToSpaceUpdatesListenerCallsCountLock = NSLock()
private var subscribeToSpaceUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToSpaceUpdatesListenerCallsCount: Int {
get { subscribeToSpaceUpdatesListenerCallsCountLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingCallsCount } }
set { subscribeToSpaceUpdatesListenerCallsCountLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToSpaceUpdatesListenerCalled: Bool {
return subscribeToSpaceUpdatesListenerCallsCount > 0
}
private let subscribeToSpaceUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToSpaceUpdatesListenerUnderlyingReceivedListener: SpaceRoomListSpaceListener?
open var subscribeToSpaceUpdatesListenerReceivedListener: SpaceRoomListSpaceListener? {
get { subscribeToSpaceUpdatesListenerReceivedListenerLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToSpaceUpdatesListenerReceivedListenerLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToSpaceUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToSpaceUpdatesListenerUnderlyingReceivedInvocations: [SpaceRoomListSpaceListener] = []
open var subscribeToSpaceUpdatesListenerReceivedInvocations: [SpaceRoomListSpaceListener] {
get { subscribeToSpaceUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToSpaceUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToSpaceUpdatesListenerReturnValueLock = NSLock()
open var subscribeToSpaceUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToSpaceUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToSpaceUpdatesListenerReturnValueLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingReturnValue } }
set { subscribeToSpaceUpdatesListenerReturnValueLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToSpaceUpdatesListenerClosure: ((SpaceRoomListSpaceListener) -> TaskHandle)?
open override func subscribeToSpaceUpdates(listener: SpaceRoomListSpaceListener) -> TaskHandle {
subscribeToSpaceUpdatesListenerCallsCountLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToSpaceUpdatesListenerReceivedListener = listener
subscribeToSpaceUpdatesListenerReceivedInvocationsLock.withLock { subscribeToSpaceUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToSpaceUpdatesListenerClosure = subscribeToSpaceUpdatesListenerClosure {
return subscribeToSpaceUpdatesListenerClosure(listener)
} else {
return subscribeToSpaceUpdatesListenerReturnValue
}
}
}
open class SpaceServiceSDKMock: MatrixRustSDK.SpaceService, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - addChildToSpace
open var addChildToSpaceChildIdSpaceIdThrowableError: Error?
private let addChildToSpaceChildIdSpaceIdCallsCountLock = NSLock()
private var addChildToSpaceChildIdSpaceIdUnderlyingCallsCount = 0
open var addChildToSpaceChildIdSpaceIdCallsCount: Int {
get { addChildToSpaceChildIdSpaceIdCallsCountLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingCallsCount } }
set { addChildToSpaceChildIdSpaceIdCallsCountLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingCallsCount = newValue } }
}
open var addChildToSpaceChildIdSpaceIdCalled: Bool {
return addChildToSpaceChildIdSpaceIdCallsCount > 0
}
private let addChildToSpaceChildIdSpaceIdReceivedArgumentsLock = NSLock()
private var addChildToSpaceChildIdSpaceIdUnderlyingReceivedArguments: (childId: String, spaceId: String)?
open var addChildToSpaceChildIdSpaceIdReceivedArguments: (childId: String, spaceId: String)? {
get { addChildToSpaceChildIdSpaceIdReceivedArgumentsLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingReceivedArguments } }
set { addChildToSpaceChildIdSpaceIdReceivedArgumentsLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingReceivedArguments = newValue } }
}
private let addChildToSpaceChildIdSpaceIdReceivedInvocationsLock = NSLock()
private var addChildToSpaceChildIdSpaceIdUnderlyingReceivedInvocations: [(childId: String, spaceId: String)] = []
open var addChildToSpaceChildIdSpaceIdReceivedInvocations: [(childId: String, spaceId: String)] {
get { addChildToSpaceChildIdSpaceIdReceivedInvocationsLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingReceivedInvocations } }
set { addChildToSpaceChildIdSpaceIdReceivedInvocationsLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingReceivedInvocations = newValue } }
}
open var addChildToSpaceChildIdSpaceIdClosure: ((String, String) async throws -> Void)?
open override func addChildToSpace(childId: String, spaceId: String) async throws {
if let error = addChildToSpaceChildIdSpaceIdThrowableError {
throw error
}
addChildToSpaceChildIdSpaceIdCallsCountLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingCallsCount += 1 }
addChildToSpaceChildIdSpaceIdReceivedArguments = (childId: childId, spaceId: spaceId)
addChildToSpaceChildIdSpaceIdReceivedInvocationsLock.withLock { addChildToSpaceChildIdSpaceIdUnderlyingReceivedInvocations.append((childId: childId, spaceId: spaceId)) }
try await addChildToSpaceChildIdSpaceIdClosure?(childId, spaceId)
}
//MARK: - editableSpaces
private let editableSpacesCallsCountLock = NSLock()
private var editableSpacesUnderlyingCallsCount = 0
open var editableSpacesCallsCount: Int {
get { editableSpacesCallsCountLock.withLock { editableSpacesUnderlyingCallsCount } }
set { editableSpacesCallsCountLock.withLock { editableSpacesUnderlyingCallsCount = newValue } }
}
open var editableSpacesCalled: Bool {
return editableSpacesCallsCount > 0
}
private let editableSpacesReturnValueLock = NSLock()
open var editableSpacesUnderlyingReturnValue: [SpaceRoom]!
open var editableSpacesReturnValue: [SpaceRoom]! {
get { editableSpacesReturnValueLock.withLock { editableSpacesUnderlyingReturnValue } }
set { editableSpacesReturnValueLock.withLock { editableSpacesUnderlyingReturnValue = newValue } }
}
open var editableSpacesClosure: (() async -> [SpaceRoom])?
open override func editableSpaces() async -> [SpaceRoom] {
editableSpacesCallsCountLock.withLock { editableSpacesUnderlyingCallsCount += 1 }
if let editableSpacesClosure = editableSpacesClosure {
return await editableSpacesClosure()
} else {
return editableSpacesReturnValue
}
}
//MARK: - getSpaceRoom
open var getSpaceRoomRoomIdThrowableError: Error?
private let getSpaceRoomRoomIdCallsCountLock = NSLock()
private var getSpaceRoomRoomIdUnderlyingCallsCount = 0
open var getSpaceRoomRoomIdCallsCount: Int {
get { getSpaceRoomRoomIdCallsCountLock.withLock { getSpaceRoomRoomIdUnderlyingCallsCount } }
set { getSpaceRoomRoomIdCallsCountLock.withLock { getSpaceRoomRoomIdUnderlyingCallsCount = newValue } }
}
open var getSpaceRoomRoomIdCalled: Bool {
return getSpaceRoomRoomIdCallsCount > 0
}
private let getSpaceRoomRoomIdReceivedRoomIdLock = NSLock()
private var getSpaceRoomRoomIdUnderlyingReceivedRoomId: String?
open var getSpaceRoomRoomIdReceivedRoomId: String? {
get { getSpaceRoomRoomIdReceivedRoomIdLock.withLock { getSpaceRoomRoomIdUnderlyingReceivedRoomId } }
set { getSpaceRoomRoomIdReceivedRoomIdLock.withLock { getSpaceRoomRoomIdUnderlyingReceivedRoomId = newValue } }
}
private let getSpaceRoomRoomIdReceivedInvocationsLock = NSLock()
private var getSpaceRoomRoomIdUnderlyingReceivedInvocations: [String] = []
open var getSpaceRoomRoomIdReceivedInvocations: [String] {
get { getSpaceRoomRoomIdReceivedInvocationsLock.withLock { getSpaceRoomRoomIdUnderlyingReceivedInvocations } }
set { getSpaceRoomRoomIdReceivedInvocationsLock.withLock { getSpaceRoomRoomIdUnderlyingReceivedInvocations = newValue } }
}
private let getSpaceRoomRoomIdReturnValueLock = NSLock()
open var getSpaceRoomRoomIdUnderlyingReturnValue: SpaceRoom?
open var getSpaceRoomRoomIdReturnValue: SpaceRoom? {
get { getSpaceRoomRoomIdReturnValueLock.withLock { getSpaceRoomRoomIdUnderlyingReturnValue } }
set { getSpaceRoomRoomIdReturnValueLock.withLock { getSpaceRoomRoomIdUnderlyingReturnValue = newValue } }
}
open var getSpaceRoomRoomIdClosure: ((String) async throws -> SpaceRoom?)?
open override func getSpaceRoom(roomId: String) async throws -> SpaceRoom? {
if let error = getSpaceRoomRoomIdThrowableError {
throw error
}
getSpaceRoomRoomIdCallsCountLock.withLock { getSpaceRoomRoomIdUnderlyingCallsCount += 1 }
getSpaceRoomRoomIdReceivedRoomId = roomId
getSpaceRoomRoomIdReceivedInvocationsLock.withLock { getSpaceRoomRoomIdUnderlyingReceivedInvocations.append(roomId) }
if let getSpaceRoomRoomIdClosure = getSpaceRoomRoomIdClosure {
return try await getSpaceRoomRoomIdClosure(roomId)
} else {
return getSpaceRoomRoomIdReturnValue
}
}
//MARK: - joinedParentsOfChild
open var joinedParentsOfChildChildIdThrowableError: Error?
private let joinedParentsOfChildChildIdCallsCountLock = NSLock()
private var joinedParentsOfChildChildIdUnderlyingCallsCount = 0
open var joinedParentsOfChildChildIdCallsCount: Int {
get { joinedParentsOfChildChildIdCallsCountLock.withLock { joinedParentsOfChildChildIdUnderlyingCallsCount } }
set { joinedParentsOfChildChildIdCallsCountLock.withLock { joinedParentsOfChildChildIdUnderlyingCallsCount = newValue } }
}
open var joinedParentsOfChildChildIdCalled: Bool {
return joinedParentsOfChildChildIdCallsCount > 0
}
private let joinedParentsOfChildChildIdReceivedChildIdLock = NSLock()
private var joinedParentsOfChildChildIdUnderlyingReceivedChildId: String?
open var joinedParentsOfChildChildIdReceivedChildId: String? {
get { joinedParentsOfChildChildIdReceivedChildIdLock.withLock { joinedParentsOfChildChildIdUnderlyingReceivedChildId } }
set { joinedParentsOfChildChildIdReceivedChildIdLock.withLock { joinedParentsOfChildChildIdUnderlyingReceivedChildId = newValue } }
}
private let joinedParentsOfChildChildIdReceivedInvocationsLock = NSLock()
private var joinedParentsOfChildChildIdUnderlyingReceivedInvocations: [String] = []
open var joinedParentsOfChildChildIdReceivedInvocations: [String] {
get { joinedParentsOfChildChildIdReceivedInvocationsLock.withLock { joinedParentsOfChildChildIdUnderlyingReceivedInvocations } }
set { joinedParentsOfChildChildIdReceivedInvocationsLock.withLock { joinedParentsOfChildChildIdUnderlyingReceivedInvocations = newValue } }
}
private let joinedParentsOfChildChildIdReturnValueLock = NSLock()
open var joinedParentsOfChildChildIdUnderlyingReturnValue: [SpaceRoom]!
open var joinedParentsOfChildChildIdReturnValue: [SpaceRoom]! {
get { joinedParentsOfChildChildIdReturnValueLock.withLock { joinedParentsOfChildChildIdUnderlyingReturnValue } }
set { joinedParentsOfChildChildIdReturnValueLock.withLock { joinedParentsOfChildChildIdUnderlyingReturnValue = newValue } }
}
open var joinedParentsOfChildChildIdClosure: ((String) async throws -> [SpaceRoom])?
open override func joinedParentsOfChild(childId: String) async throws -> [SpaceRoom] {
if let error = joinedParentsOfChildChildIdThrowableError {
throw error
}
joinedParentsOfChildChildIdCallsCountLock.withLock { joinedParentsOfChildChildIdUnderlyingCallsCount += 1 }
joinedParentsOfChildChildIdReceivedChildId = childId
joinedParentsOfChildChildIdReceivedInvocationsLock.withLock { joinedParentsOfChildChildIdUnderlyingReceivedInvocations.append(childId) }
if let joinedParentsOfChildChildIdClosure = joinedParentsOfChildChildIdClosure {
return try await joinedParentsOfChildChildIdClosure(childId)
} else {
return joinedParentsOfChildChildIdReturnValue
}
}
//MARK: - leaveSpace
open var leaveSpaceSpaceIdThrowableError: Error?
private let leaveSpaceSpaceIdCallsCountLock = NSLock()
private var leaveSpaceSpaceIdUnderlyingCallsCount = 0
open var leaveSpaceSpaceIdCallsCount: Int {
get { leaveSpaceSpaceIdCallsCountLock.withLock { leaveSpaceSpaceIdUnderlyingCallsCount } }
set { leaveSpaceSpaceIdCallsCountLock.withLock { leaveSpaceSpaceIdUnderlyingCallsCount = newValue } }
}
open var leaveSpaceSpaceIdCalled: Bool {
return leaveSpaceSpaceIdCallsCount > 0
}
private let leaveSpaceSpaceIdReceivedSpaceIdLock = NSLock()
private var leaveSpaceSpaceIdUnderlyingReceivedSpaceId: String?
open var leaveSpaceSpaceIdReceivedSpaceId: String? {
get { leaveSpaceSpaceIdReceivedSpaceIdLock.withLock { leaveSpaceSpaceIdUnderlyingReceivedSpaceId } }
set { leaveSpaceSpaceIdReceivedSpaceIdLock.withLock { leaveSpaceSpaceIdUnderlyingReceivedSpaceId = newValue } }
}
private let leaveSpaceSpaceIdReceivedInvocationsLock = NSLock()
private var leaveSpaceSpaceIdUnderlyingReceivedInvocations: [String] = []
open var leaveSpaceSpaceIdReceivedInvocations: [String] {
get { leaveSpaceSpaceIdReceivedInvocationsLock.withLock { leaveSpaceSpaceIdUnderlyingReceivedInvocations } }
set { leaveSpaceSpaceIdReceivedInvocationsLock.withLock { leaveSpaceSpaceIdUnderlyingReceivedInvocations = newValue } }
}
private let leaveSpaceSpaceIdReturnValueLock = NSLock()
open var leaveSpaceSpaceIdUnderlyingReturnValue: LeaveSpaceHandle!
open var leaveSpaceSpaceIdReturnValue: LeaveSpaceHandle! {
get { leaveSpaceSpaceIdReturnValueLock.withLock { leaveSpaceSpaceIdUnderlyingReturnValue } }
set { leaveSpaceSpaceIdReturnValueLock.withLock { leaveSpaceSpaceIdUnderlyingReturnValue = newValue } }
}
open var leaveSpaceSpaceIdClosure: ((String) async throws -> LeaveSpaceHandle)?
open override func leaveSpace(spaceId: String) async throws -> LeaveSpaceHandle {
if let error = leaveSpaceSpaceIdThrowableError {
throw error
}
leaveSpaceSpaceIdCallsCountLock.withLock { leaveSpaceSpaceIdUnderlyingCallsCount += 1 }
leaveSpaceSpaceIdReceivedSpaceId = spaceId
leaveSpaceSpaceIdReceivedInvocationsLock.withLock { leaveSpaceSpaceIdUnderlyingReceivedInvocations.append(spaceId) }
if let leaveSpaceSpaceIdClosure = leaveSpaceSpaceIdClosure {
return try await leaveSpaceSpaceIdClosure(spaceId)
} else {
return leaveSpaceSpaceIdReturnValue
}
}
//MARK: - removeChildFromSpace
open var removeChildFromSpaceChildIdSpaceIdThrowableError: Error?
private let removeChildFromSpaceChildIdSpaceIdCallsCountLock = NSLock()
private var removeChildFromSpaceChildIdSpaceIdUnderlyingCallsCount = 0
open var removeChildFromSpaceChildIdSpaceIdCallsCount: Int {
get { removeChildFromSpaceChildIdSpaceIdCallsCountLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingCallsCount } }
set { removeChildFromSpaceChildIdSpaceIdCallsCountLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingCallsCount = newValue } }
}
open var removeChildFromSpaceChildIdSpaceIdCalled: Bool {
return removeChildFromSpaceChildIdSpaceIdCallsCount > 0
}
private let removeChildFromSpaceChildIdSpaceIdReceivedArgumentsLock = NSLock()
private var removeChildFromSpaceChildIdSpaceIdUnderlyingReceivedArguments: (childId: String, spaceId: String)?
open var removeChildFromSpaceChildIdSpaceIdReceivedArguments: (childId: String, spaceId: String)? {
get { removeChildFromSpaceChildIdSpaceIdReceivedArgumentsLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingReceivedArguments } }
set { removeChildFromSpaceChildIdSpaceIdReceivedArgumentsLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingReceivedArguments = newValue } }
}
private let removeChildFromSpaceChildIdSpaceIdReceivedInvocationsLock = NSLock()
private var removeChildFromSpaceChildIdSpaceIdUnderlyingReceivedInvocations: [(childId: String, spaceId: String)] = []
open var removeChildFromSpaceChildIdSpaceIdReceivedInvocations: [(childId: String, spaceId: String)] {
get { removeChildFromSpaceChildIdSpaceIdReceivedInvocationsLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingReceivedInvocations } }
set { removeChildFromSpaceChildIdSpaceIdReceivedInvocationsLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingReceivedInvocations = newValue } }
}
open var removeChildFromSpaceChildIdSpaceIdClosure: ((String, String) async throws -> Void)?
open override func removeChildFromSpace(childId: String, spaceId: String) async throws {
if let error = removeChildFromSpaceChildIdSpaceIdThrowableError {
throw error
}
removeChildFromSpaceChildIdSpaceIdCallsCountLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingCallsCount += 1 }
removeChildFromSpaceChildIdSpaceIdReceivedArguments = (childId: childId, spaceId: spaceId)
removeChildFromSpaceChildIdSpaceIdReceivedInvocationsLock.withLock { removeChildFromSpaceChildIdSpaceIdUnderlyingReceivedInvocations.append((childId: childId, spaceId: spaceId)) }
try await removeChildFromSpaceChildIdSpaceIdClosure?(childId, spaceId)
}
//MARK: - spaceFilters
private let spaceFiltersCallsCountLock = NSLock()
private var spaceFiltersUnderlyingCallsCount = 0
open var spaceFiltersCallsCount: Int {
get { spaceFiltersCallsCountLock.withLock { spaceFiltersUnderlyingCallsCount } }
set { spaceFiltersCallsCountLock.withLock { spaceFiltersUnderlyingCallsCount = newValue } }
}
open var spaceFiltersCalled: Bool {
return spaceFiltersCallsCount > 0
}
private let spaceFiltersReturnValueLock = NSLock()
open var spaceFiltersUnderlyingReturnValue: [SpaceFilter]!
open var spaceFiltersReturnValue: [SpaceFilter]! {
get { spaceFiltersReturnValueLock.withLock { spaceFiltersUnderlyingReturnValue } }
set { spaceFiltersReturnValueLock.withLock { spaceFiltersUnderlyingReturnValue = newValue } }
}
open var spaceFiltersClosure: (() async -> [SpaceFilter])?
open override func spaceFilters() async -> [SpaceFilter] {
spaceFiltersCallsCountLock.withLock { spaceFiltersUnderlyingCallsCount += 1 }
if let spaceFiltersClosure = spaceFiltersClosure {
return await spaceFiltersClosure()
} else {
return spaceFiltersReturnValue
}
}
//MARK: - spaceRoomList
open var spaceRoomListSpaceIdThrowableError: Error?
private let spaceRoomListSpaceIdCallsCountLock = NSLock()
private var spaceRoomListSpaceIdUnderlyingCallsCount = 0
open var spaceRoomListSpaceIdCallsCount: Int {
get { spaceRoomListSpaceIdCallsCountLock.withLock { spaceRoomListSpaceIdUnderlyingCallsCount } }
set { spaceRoomListSpaceIdCallsCountLock.withLock { spaceRoomListSpaceIdUnderlyingCallsCount = newValue } }
}
open var spaceRoomListSpaceIdCalled: Bool {
return spaceRoomListSpaceIdCallsCount > 0
}
private let spaceRoomListSpaceIdReceivedSpaceIdLock = NSLock()
private var spaceRoomListSpaceIdUnderlyingReceivedSpaceId: String?
open var spaceRoomListSpaceIdReceivedSpaceId: String? {
get { spaceRoomListSpaceIdReceivedSpaceIdLock.withLock { spaceRoomListSpaceIdUnderlyingReceivedSpaceId } }
set { spaceRoomListSpaceIdReceivedSpaceIdLock.withLock { spaceRoomListSpaceIdUnderlyingReceivedSpaceId = newValue } }
}
private let spaceRoomListSpaceIdReceivedInvocationsLock = NSLock()
private var spaceRoomListSpaceIdUnderlyingReceivedInvocations: [String] = []
open var spaceRoomListSpaceIdReceivedInvocations: [String] {
get { spaceRoomListSpaceIdReceivedInvocationsLock.withLock { spaceRoomListSpaceIdUnderlyingReceivedInvocations } }
set { spaceRoomListSpaceIdReceivedInvocationsLock.withLock { spaceRoomListSpaceIdUnderlyingReceivedInvocations = newValue } }
}
private let spaceRoomListSpaceIdReturnValueLock = NSLock()
open var spaceRoomListSpaceIdUnderlyingReturnValue: SpaceRoomList!
open var spaceRoomListSpaceIdReturnValue: SpaceRoomList! {
get { spaceRoomListSpaceIdReturnValueLock.withLock { spaceRoomListSpaceIdUnderlyingReturnValue } }
set { spaceRoomListSpaceIdReturnValueLock.withLock { spaceRoomListSpaceIdUnderlyingReturnValue = newValue } }
}
open var spaceRoomListSpaceIdClosure: ((String) async throws -> SpaceRoomList)?
open override func spaceRoomList(spaceId: String) async throws -> SpaceRoomList {
if let error = spaceRoomListSpaceIdThrowableError {
throw error
}
spaceRoomListSpaceIdCallsCountLock.withLock { spaceRoomListSpaceIdUnderlyingCallsCount += 1 }
spaceRoomListSpaceIdReceivedSpaceId = spaceId
spaceRoomListSpaceIdReceivedInvocationsLock.withLock { spaceRoomListSpaceIdUnderlyingReceivedInvocations.append(spaceId) }
if let spaceRoomListSpaceIdClosure = spaceRoomListSpaceIdClosure {
return try await spaceRoomListSpaceIdClosure(spaceId)
} else {
return spaceRoomListSpaceIdReturnValue
}
}
//MARK: - subscribeToSpaceFilters
private let subscribeToSpaceFiltersListenerCallsCountLock = NSLock()
private var subscribeToSpaceFiltersListenerUnderlyingCallsCount = 0
open var subscribeToSpaceFiltersListenerCallsCount: Int {
get { subscribeToSpaceFiltersListenerCallsCountLock.withLock { subscribeToSpaceFiltersListenerUnderlyingCallsCount } }
set { subscribeToSpaceFiltersListenerCallsCountLock.withLock { subscribeToSpaceFiltersListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToSpaceFiltersListenerCalled: Bool {
return subscribeToSpaceFiltersListenerCallsCount > 0
}
private let subscribeToSpaceFiltersListenerReceivedListenerLock = NSLock()
private var subscribeToSpaceFiltersListenerUnderlyingReceivedListener: SpaceServiceSpaceFiltersListener?
open var subscribeToSpaceFiltersListenerReceivedListener: SpaceServiceSpaceFiltersListener? {
get { subscribeToSpaceFiltersListenerReceivedListenerLock.withLock { subscribeToSpaceFiltersListenerUnderlyingReceivedListener } }
set { subscribeToSpaceFiltersListenerReceivedListenerLock.withLock { subscribeToSpaceFiltersListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToSpaceFiltersListenerReceivedInvocationsLock = NSLock()
private var subscribeToSpaceFiltersListenerUnderlyingReceivedInvocations: [SpaceServiceSpaceFiltersListener] = []
open var subscribeToSpaceFiltersListenerReceivedInvocations: [SpaceServiceSpaceFiltersListener] {
get { subscribeToSpaceFiltersListenerReceivedInvocationsLock.withLock { subscribeToSpaceFiltersListenerUnderlyingReceivedInvocations } }
set { subscribeToSpaceFiltersListenerReceivedInvocationsLock.withLock { subscribeToSpaceFiltersListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToSpaceFiltersListenerReturnValueLock = NSLock()
open var subscribeToSpaceFiltersListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToSpaceFiltersListenerReturnValue: TaskHandle! {
get { subscribeToSpaceFiltersListenerReturnValueLock.withLock { subscribeToSpaceFiltersListenerUnderlyingReturnValue } }
set { subscribeToSpaceFiltersListenerReturnValueLock.withLock { subscribeToSpaceFiltersListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToSpaceFiltersListenerClosure: ((SpaceServiceSpaceFiltersListener) async -> TaskHandle)?
open override func subscribeToSpaceFilters(listener: SpaceServiceSpaceFiltersListener) async -> TaskHandle {
subscribeToSpaceFiltersListenerCallsCountLock.withLock { subscribeToSpaceFiltersListenerUnderlyingCallsCount += 1 }
subscribeToSpaceFiltersListenerReceivedListener = listener
subscribeToSpaceFiltersListenerReceivedInvocationsLock.withLock { subscribeToSpaceFiltersListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToSpaceFiltersListenerClosure = subscribeToSpaceFiltersListenerClosure {
return await subscribeToSpaceFiltersListenerClosure(listener)
} else {
return subscribeToSpaceFiltersListenerReturnValue
}
}
//MARK: - subscribeToTopLevelJoinedSpaces
private let subscribeToTopLevelJoinedSpacesListenerCallsCountLock = NSLock()
private var subscribeToTopLevelJoinedSpacesListenerUnderlyingCallsCount = 0
open var subscribeToTopLevelJoinedSpacesListenerCallsCount: Int {
get { subscribeToTopLevelJoinedSpacesListenerCallsCountLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingCallsCount } }
set { subscribeToTopLevelJoinedSpacesListenerCallsCountLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToTopLevelJoinedSpacesListenerCalled: Bool {
return subscribeToTopLevelJoinedSpacesListenerCallsCount > 0
}
private let subscribeToTopLevelJoinedSpacesListenerReceivedListenerLock = NSLock()
private var subscribeToTopLevelJoinedSpacesListenerUnderlyingReceivedListener: SpaceServiceJoinedSpacesListener?
open var subscribeToTopLevelJoinedSpacesListenerReceivedListener: SpaceServiceJoinedSpacesListener? {
get { subscribeToTopLevelJoinedSpacesListenerReceivedListenerLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingReceivedListener } }
set { subscribeToTopLevelJoinedSpacesListenerReceivedListenerLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToTopLevelJoinedSpacesListenerReceivedInvocationsLock = NSLock()
private var subscribeToTopLevelJoinedSpacesListenerUnderlyingReceivedInvocations: [SpaceServiceJoinedSpacesListener] = []
open var subscribeToTopLevelJoinedSpacesListenerReceivedInvocations: [SpaceServiceJoinedSpacesListener] {
get { subscribeToTopLevelJoinedSpacesListenerReceivedInvocationsLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingReceivedInvocations } }
set { subscribeToTopLevelJoinedSpacesListenerReceivedInvocationsLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToTopLevelJoinedSpacesListenerReturnValueLock = NSLock()
open var subscribeToTopLevelJoinedSpacesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToTopLevelJoinedSpacesListenerReturnValue: TaskHandle! {
get { subscribeToTopLevelJoinedSpacesListenerReturnValueLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingReturnValue } }
set { subscribeToTopLevelJoinedSpacesListenerReturnValueLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToTopLevelJoinedSpacesListenerClosure: ((SpaceServiceJoinedSpacesListener) async -> TaskHandle)?
open override func subscribeToTopLevelJoinedSpaces(listener: SpaceServiceJoinedSpacesListener) async -> TaskHandle {
subscribeToTopLevelJoinedSpacesListenerCallsCountLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingCallsCount += 1 }
subscribeToTopLevelJoinedSpacesListenerReceivedListener = listener
subscribeToTopLevelJoinedSpacesListenerReceivedInvocationsLock.withLock { subscribeToTopLevelJoinedSpacesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToTopLevelJoinedSpacesListenerClosure = subscribeToTopLevelJoinedSpacesListenerClosure {
return await subscribeToTopLevelJoinedSpacesListenerClosure(listener)
} else {
return subscribeToTopLevelJoinedSpacesListenerReturnValue
}
}
//MARK: - topLevelJoinedSpaces
private let topLevelJoinedSpacesCallsCountLock = NSLock()
private var topLevelJoinedSpacesUnderlyingCallsCount = 0
open var topLevelJoinedSpacesCallsCount: Int {
get { topLevelJoinedSpacesCallsCountLock.withLock { topLevelJoinedSpacesUnderlyingCallsCount } }
set { topLevelJoinedSpacesCallsCountLock.withLock { topLevelJoinedSpacesUnderlyingCallsCount = newValue } }
}
open var topLevelJoinedSpacesCalled: Bool {
return topLevelJoinedSpacesCallsCount > 0
}
private let topLevelJoinedSpacesReturnValueLock = NSLock()
open var topLevelJoinedSpacesUnderlyingReturnValue: [SpaceRoom]!
open var topLevelJoinedSpacesReturnValue: [SpaceRoom]! {
get { topLevelJoinedSpacesReturnValueLock.withLock { topLevelJoinedSpacesUnderlyingReturnValue } }
set { topLevelJoinedSpacesReturnValueLock.withLock { topLevelJoinedSpacesUnderlyingReturnValue = newValue } }
}
open var topLevelJoinedSpacesClosure: (() async -> [SpaceRoom])?
open override func topLevelJoinedSpaces() async -> [SpaceRoom] {
topLevelJoinedSpacesCallsCountLock.withLock { topLevelJoinedSpacesUnderlyingCallsCount += 1 }
if let topLevelJoinedSpacesClosure = topLevelJoinedSpacesClosure {
return await topLevelJoinedSpacesClosure()
} else {
return topLevelJoinedSpacesReturnValue
}
}
}
open class SpanSDKMock: MatrixRustSDK.Span, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
static func reset()
{
}
//MARK: - enter
private let enterCallsCountLock = NSLock()
private var enterUnderlyingCallsCount = 0
open var enterCallsCount: Int {
get { enterCallsCountLock.withLock { enterUnderlyingCallsCount } }
set { enterCallsCountLock.withLock { enterUnderlyingCallsCount = newValue } }
}
open var enterCalled: Bool {
return enterCallsCount > 0
}
open var enterClosure: (() -> Void)?
open override func enter() {
enterCallsCountLock.withLock { enterUnderlyingCallsCount += 1 }
enterClosure?()
}
//MARK: - exit
private let exitCallsCountLock = NSLock()
private var exitUnderlyingCallsCount = 0
open var exitCallsCount: Int {
get { exitCallsCountLock.withLock { exitUnderlyingCallsCount } }
set { exitCallsCountLock.withLock { exitUnderlyingCallsCount = newValue } }
}
open var exitCalled: Bool {
return exitCallsCount > 0
}
open var exitClosure: (() -> Void)?
open override func exit() {
exitCallsCountLock.withLock { exitUnderlyingCallsCount += 1 }
exitClosure?()
}
//MARK: - isNone
private let isNoneCallsCountLock = NSLock()
private var isNoneUnderlyingCallsCount = 0
open var isNoneCallsCount: Int {
get { isNoneCallsCountLock.withLock { isNoneUnderlyingCallsCount } }
set { isNoneCallsCountLock.withLock { isNoneUnderlyingCallsCount = newValue } }
}
open var isNoneCalled: Bool {
return isNoneCallsCount > 0
}
private let isNoneReturnValueLock = NSLock()
open var isNoneUnderlyingReturnValue: Bool!
open var isNoneReturnValue: Bool! {
get { isNoneReturnValueLock.withLock { isNoneUnderlyingReturnValue } }
set { isNoneReturnValueLock.withLock { isNoneUnderlyingReturnValue = newValue } }
}
open var isNoneClosure: (() -> Bool)?
open override func isNone() -> Bool {
isNoneCallsCountLock.withLock { isNoneUnderlyingCallsCount += 1 }
if let isNoneClosure = isNoneClosure {
return isNoneClosure()
} else {
return isNoneReturnValue
}
}
}
open class SqliteStoreBuilderSDKMock: MatrixRustSDK.SqliteStoreBuilder, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - cacheSize
private let cacheSizeCacheSizeCallsCountLock = NSLock()
private var cacheSizeCacheSizeUnderlyingCallsCount = 0
open var cacheSizeCacheSizeCallsCount: Int {
get { cacheSizeCacheSizeCallsCountLock.withLock { cacheSizeCacheSizeUnderlyingCallsCount } }
set { cacheSizeCacheSizeCallsCountLock.withLock { cacheSizeCacheSizeUnderlyingCallsCount = newValue } }
}
open var cacheSizeCacheSizeCalled: Bool {
return cacheSizeCacheSizeCallsCount > 0
}
private let cacheSizeCacheSizeReceivedCacheSizeLock = NSLock()
private var cacheSizeCacheSizeUnderlyingReceivedCacheSize: UInt32?
open var cacheSizeCacheSizeReceivedCacheSize: UInt32? {
get { cacheSizeCacheSizeReceivedCacheSizeLock.withLock { cacheSizeCacheSizeUnderlyingReceivedCacheSize } }
set { cacheSizeCacheSizeReceivedCacheSizeLock.withLock { cacheSizeCacheSizeUnderlyingReceivedCacheSize = newValue } }
}
private let cacheSizeCacheSizeReceivedInvocationsLock = NSLock()
private var cacheSizeCacheSizeUnderlyingReceivedInvocations: [UInt32?] = []
open var cacheSizeCacheSizeReceivedInvocations: [UInt32?] {
get { cacheSizeCacheSizeReceivedInvocationsLock.withLock { cacheSizeCacheSizeUnderlyingReceivedInvocations } }
set { cacheSizeCacheSizeReceivedInvocationsLock.withLock { cacheSizeCacheSizeUnderlyingReceivedInvocations = newValue } }
}
private let cacheSizeCacheSizeReturnValueLock = NSLock()
open var cacheSizeCacheSizeUnderlyingReturnValue: SqliteStoreBuilder!
open var cacheSizeCacheSizeReturnValue: SqliteStoreBuilder! {
get { cacheSizeCacheSizeReturnValueLock.withLock { cacheSizeCacheSizeUnderlyingReturnValue } }
set { cacheSizeCacheSizeReturnValueLock.withLock { cacheSizeCacheSizeUnderlyingReturnValue = newValue } }
}
open var cacheSizeCacheSizeClosure: ((UInt32?) -> SqliteStoreBuilder)?
open override func cacheSize(cacheSize: UInt32?) -> SqliteStoreBuilder {
cacheSizeCacheSizeCallsCountLock.withLock { cacheSizeCacheSizeUnderlyingCallsCount += 1 }
cacheSizeCacheSizeReceivedCacheSize = cacheSize
cacheSizeCacheSizeReceivedInvocationsLock.withLock { cacheSizeCacheSizeUnderlyingReceivedInvocations.append(cacheSize) }
if let cacheSizeCacheSizeClosure = cacheSizeCacheSizeClosure {
return cacheSizeCacheSizeClosure(cacheSize)
} else {
return cacheSizeCacheSizeReturnValue
}
}
//MARK: - journalSizeLimit
private let journalSizeLimitLimitCallsCountLock = NSLock()
private var journalSizeLimitLimitUnderlyingCallsCount = 0
open var journalSizeLimitLimitCallsCount: Int {
get { journalSizeLimitLimitCallsCountLock.withLock { journalSizeLimitLimitUnderlyingCallsCount } }
set { journalSizeLimitLimitCallsCountLock.withLock { journalSizeLimitLimitUnderlyingCallsCount = newValue } }
}
open var journalSizeLimitLimitCalled: Bool {
return journalSizeLimitLimitCallsCount > 0
}
private let journalSizeLimitLimitReceivedLimitLock = NSLock()
private var journalSizeLimitLimitUnderlyingReceivedLimit: UInt32?
open var journalSizeLimitLimitReceivedLimit: UInt32? {
get { journalSizeLimitLimitReceivedLimitLock.withLock { journalSizeLimitLimitUnderlyingReceivedLimit } }
set { journalSizeLimitLimitReceivedLimitLock.withLock { journalSizeLimitLimitUnderlyingReceivedLimit = newValue } }
}
private let journalSizeLimitLimitReceivedInvocationsLock = NSLock()
private var journalSizeLimitLimitUnderlyingReceivedInvocations: [UInt32?] = []
open var journalSizeLimitLimitReceivedInvocations: [UInt32?] {
get { journalSizeLimitLimitReceivedInvocationsLock.withLock { journalSizeLimitLimitUnderlyingReceivedInvocations } }
set { journalSizeLimitLimitReceivedInvocationsLock.withLock { journalSizeLimitLimitUnderlyingReceivedInvocations = newValue } }
}
private let journalSizeLimitLimitReturnValueLock = NSLock()
open var journalSizeLimitLimitUnderlyingReturnValue: SqliteStoreBuilder!
open var journalSizeLimitLimitReturnValue: SqliteStoreBuilder! {
get { journalSizeLimitLimitReturnValueLock.withLock { journalSizeLimitLimitUnderlyingReturnValue } }
set { journalSizeLimitLimitReturnValueLock.withLock { journalSizeLimitLimitUnderlyingReturnValue = newValue } }
}
open var journalSizeLimitLimitClosure: ((UInt32?) -> SqliteStoreBuilder)?
open override func journalSizeLimit(limit: UInt32?) -> SqliteStoreBuilder {
journalSizeLimitLimitCallsCountLock.withLock { journalSizeLimitLimitUnderlyingCallsCount += 1 }
journalSizeLimitLimitReceivedLimit = limit
journalSizeLimitLimitReceivedInvocationsLock.withLock { journalSizeLimitLimitUnderlyingReceivedInvocations.append(limit) }
if let journalSizeLimitLimitClosure = journalSizeLimitLimitClosure {
return journalSizeLimitLimitClosure(limit)
} else {
return journalSizeLimitLimitReturnValue
}
}
//MARK: - key
private let keyKeyCallsCountLock = NSLock()
private var keyKeyUnderlyingCallsCount = 0
open var keyKeyCallsCount: Int {
get { keyKeyCallsCountLock.withLock { keyKeyUnderlyingCallsCount } }
set { keyKeyCallsCountLock.withLock { keyKeyUnderlyingCallsCount = newValue } }
}
open var keyKeyCalled: Bool {
return keyKeyCallsCount > 0
}
private let keyKeyReceivedKeyLock = NSLock()
private var keyKeyUnderlyingReceivedKey: Data?
open var keyKeyReceivedKey: Data? {
get { keyKeyReceivedKeyLock.withLock { keyKeyUnderlyingReceivedKey } }
set { keyKeyReceivedKeyLock.withLock { keyKeyUnderlyingReceivedKey = newValue } }
}
private let keyKeyReceivedInvocationsLock = NSLock()
private var keyKeyUnderlyingReceivedInvocations: [Data?] = []
open var keyKeyReceivedInvocations: [Data?] {
get { keyKeyReceivedInvocationsLock.withLock { keyKeyUnderlyingReceivedInvocations } }
set { keyKeyReceivedInvocationsLock.withLock { keyKeyUnderlyingReceivedInvocations = newValue } }
}
private let keyKeyReturnValueLock = NSLock()
open var keyKeyUnderlyingReturnValue: SqliteStoreBuilder!
open var keyKeyReturnValue: SqliteStoreBuilder! {
get { keyKeyReturnValueLock.withLock { keyKeyUnderlyingReturnValue } }
set { keyKeyReturnValueLock.withLock { keyKeyUnderlyingReturnValue = newValue } }
}
open var keyKeyClosure: ((Data?) -> SqliteStoreBuilder)?
open override func key(key: Data?) -> SqliteStoreBuilder {
keyKeyCallsCountLock.withLock { keyKeyUnderlyingCallsCount += 1 }
keyKeyReceivedKey = key
keyKeyReceivedInvocationsLock.withLock { keyKeyUnderlyingReceivedInvocations.append(key) }
if let keyKeyClosure = keyKeyClosure {
return keyKeyClosure(key)
} else {
return keyKeyReturnValue
}
}
//MARK: - passphrase
private let passphrasePassphraseCallsCountLock = NSLock()
private var passphrasePassphraseUnderlyingCallsCount = 0
open var passphrasePassphraseCallsCount: Int {
get { passphrasePassphraseCallsCountLock.withLock { passphrasePassphraseUnderlyingCallsCount } }
set { passphrasePassphraseCallsCountLock.withLock { passphrasePassphraseUnderlyingCallsCount = newValue } }
}
open var passphrasePassphraseCalled: Bool {
return passphrasePassphraseCallsCount > 0
}
private let passphrasePassphraseReceivedPassphraseLock = NSLock()
private var passphrasePassphraseUnderlyingReceivedPassphrase: String?
open var passphrasePassphraseReceivedPassphrase: String? {
get { passphrasePassphraseReceivedPassphraseLock.withLock { passphrasePassphraseUnderlyingReceivedPassphrase } }
set { passphrasePassphraseReceivedPassphraseLock.withLock { passphrasePassphraseUnderlyingReceivedPassphrase = newValue } }
}
private let passphrasePassphraseReceivedInvocationsLock = NSLock()
private var passphrasePassphraseUnderlyingReceivedInvocations: [String?] = []
open var passphrasePassphraseReceivedInvocations: [String?] {
get { passphrasePassphraseReceivedInvocationsLock.withLock { passphrasePassphraseUnderlyingReceivedInvocations } }
set { passphrasePassphraseReceivedInvocationsLock.withLock { passphrasePassphraseUnderlyingReceivedInvocations = newValue } }
}
private let passphrasePassphraseReturnValueLock = NSLock()
open var passphrasePassphraseUnderlyingReturnValue: SqliteStoreBuilder!
open var passphrasePassphraseReturnValue: SqliteStoreBuilder! {
get { passphrasePassphraseReturnValueLock.withLock { passphrasePassphraseUnderlyingReturnValue } }
set { passphrasePassphraseReturnValueLock.withLock { passphrasePassphraseUnderlyingReturnValue = newValue } }
}
open var passphrasePassphraseClosure: ((String?) -> SqliteStoreBuilder)?
open override func passphrase(passphrase: String?) -> SqliteStoreBuilder {
passphrasePassphraseCallsCountLock.withLock { passphrasePassphraseUnderlyingCallsCount += 1 }
passphrasePassphraseReceivedPassphrase = passphrase
passphrasePassphraseReceivedInvocationsLock.withLock { passphrasePassphraseUnderlyingReceivedInvocations.append(passphrase) }
if let passphrasePassphraseClosure = passphrasePassphraseClosure {
return passphrasePassphraseClosure(passphrase)
} else {
return passphrasePassphraseReturnValue
}
}
//MARK: - poolMaxSize
private let poolMaxSizePoolMaxSizeCallsCountLock = NSLock()
private var poolMaxSizePoolMaxSizeUnderlyingCallsCount = 0
open var poolMaxSizePoolMaxSizeCallsCount: Int {
get { poolMaxSizePoolMaxSizeCallsCountLock.withLock { poolMaxSizePoolMaxSizeUnderlyingCallsCount } }
set { poolMaxSizePoolMaxSizeCallsCountLock.withLock { poolMaxSizePoolMaxSizeUnderlyingCallsCount = newValue } }
}
open var poolMaxSizePoolMaxSizeCalled: Bool {
return poolMaxSizePoolMaxSizeCallsCount > 0
}
private let poolMaxSizePoolMaxSizeReceivedPoolMaxSizeLock = NSLock()
private var poolMaxSizePoolMaxSizeUnderlyingReceivedPoolMaxSize: UInt32?
open var poolMaxSizePoolMaxSizeReceivedPoolMaxSize: UInt32? {
get { poolMaxSizePoolMaxSizeReceivedPoolMaxSizeLock.withLock { poolMaxSizePoolMaxSizeUnderlyingReceivedPoolMaxSize } }
set { poolMaxSizePoolMaxSizeReceivedPoolMaxSizeLock.withLock { poolMaxSizePoolMaxSizeUnderlyingReceivedPoolMaxSize = newValue } }
}
private let poolMaxSizePoolMaxSizeReceivedInvocationsLock = NSLock()
private var poolMaxSizePoolMaxSizeUnderlyingReceivedInvocations: [UInt32?] = []
open var poolMaxSizePoolMaxSizeReceivedInvocations: [UInt32?] {
get { poolMaxSizePoolMaxSizeReceivedInvocationsLock.withLock { poolMaxSizePoolMaxSizeUnderlyingReceivedInvocations } }
set { poolMaxSizePoolMaxSizeReceivedInvocationsLock.withLock { poolMaxSizePoolMaxSizeUnderlyingReceivedInvocations = newValue } }
}
private let poolMaxSizePoolMaxSizeReturnValueLock = NSLock()
open var poolMaxSizePoolMaxSizeUnderlyingReturnValue: SqliteStoreBuilder!
open var poolMaxSizePoolMaxSizeReturnValue: SqliteStoreBuilder! {
get { poolMaxSizePoolMaxSizeReturnValueLock.withLock { poolMaxSizePoolMaxSizeUnderlyingReturnValue } }
set { poolMaxSizePoolMaxSizeReturnValueLock.withLock { poolMaxSizePoolMaxSizeUnderlyingReturnValue = newValue } }
}
open var poolMaxSizePoolMaxSizeClosure: ((UInt32?) -> SqliteStoreBuilder)?
open override func poolMaxSize(poolMaxSize: UInt32?) -> SqliteStoreBuilder {
poolMaxSizePoolMaxSizeCallsCountLock.withLock { poolMaxSizePoolMaxSizeUnderlyingCallsCount += 1 }
poolMaxSizePoolMaxSizeReceivedPoolMaxSize = poolMaxSize
poolMaxSizePoolMaxSizeReceivedInvocationsLock.withLock { poolMaxSizePoolMaxSizeUnderlyingReceivedInvocations.append(poolMaxSize) }
if let poolMaxSizePoolMaxSizeClosure = poolMaxSizePoolMaxSizeClosure {
return poolMaxSizePoolMaxSizeClosure(poolMaxSize)
} else {
return poolMaxSizePoolMaxSizeReturnValue
}
}
//MARK: - systemIsMemoryConstrained
private let systemIsMemoryConstrainedCallsCountLock = NSLock()
private var systemIsMemoryConstrainedUnderlyingCallsCount = 0
open var systemIsMemoryConstrainedCallsCount: Int {
get { systemIsMemoryConstrainedCallsCountLock.withLock { systemIsMemoryConstrainedUnderlyingCallsCount } }
set { systemIsMemoryConstrainedCallsCountLock.withLock { systemIsMemoryConstrainedUnderlyingCallsCount = newValue } }
}
open var systemIsMemoryConstrainedCalled: Bool {
return systemIsMemoryConstrainedCallsCount > 0
}
private let systemIsMemoryConstrainedReturnValueLock = NSLock()
open var systemIsMemoryConstrainedUnderlyingReturnValue: SqliteStoreBuilder!
open var systemIsMemoryConstrainedReturnValue: SqliteStoreBuilder! {
get { systemIsMemoryConstrainedReturnValueLock.withLock { systemIsMemoryConstrainedUnderlyingReturnValue } }
set { systemIsMemoryConstrainedReturnValueLock.withLock { systemIsMemoryConstrainedUnderlyingReturnValue = newValue } }
}
open var systemIsMemoryConstrainedClosure: (() -> SqliteStoreBuilder)?
open override func systemIsMemoryConstrained() -> SqliteStoreBuilder {
systemIsMemoryConstrainedCallsCountLock.withLock { systemIsMemoryConstrainedUnderlyingCallsCount += 1 }
if let systemIsMemoryConstrainedClosure = systemIsMemoryConstrainedClosure {
return systemIsMemoryConstrainedClosure()
} else {
return systemIsMemoryConstrainedReturnValue
}
}
}
open class SsoHandlerSDKMock: MatrixRustSDK.SsoHandler, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - finish
open var finishCallbackUrlThrowableError: Error?
private let finishCallbackUrlCallsCountLock = NSLock()
private var finishCallbackUrlUnderlyingCallsCount = 0
open var finishCallbackUrlCallsCount: Int {
get { finishCallbackUrlCallsCountLock.withLock { finishCallbackUrlUnderlyingCallsCount } }
set { finishCallbackUrlCallsCountLock.withLock { finishCallbackUrlUnderlyingCallsCount = newValue } }
}
open var finishCallbackUrlCalled: Bool {
return finishCallbackUrlCallsCount > 0
}
private let finishCallbackUrlReceivedCallbackUrlLock = NSLock()
private var finishCallbackUrlUnderlyingReceivedCallbackUrl: String?
open var finishCallbackUrlReceivedCallbackUrl: String? {
get { finishCallbackUrlReceivedCallbackUrlLock.withLock { finishCallbackUrlUnderlyingReceivedCallbackUrl } }
set { finishCallbackUrlReceivedCallbackUrlLock.withLock { finishCallbackUrlUnderlyingReceivedCallbackUrl = newValue } }
}
private let finishCallbackUrlReceivedInvocationsLock = NSLock()
private var finishCallbackUrlUnderlyingReceivedInvocations: [String] = []
open var finishCallbackUrlReceivedInvocations: [String] {
get { finishCallbackUrlReceivedInvocationsLock.withLock { finishCallbackUrlUnderlyingReceivedInvocations } }
set { finishCallbackUrlReceivedInvocationsLock.withLock { finishCallbackUrlUnderlyingReceivedInvocations = newValue } }
}
open var finishCallbackUrlClosure: ((String) async throws -> Void)?
open override func finish(callbackUrl: String) async throws {
if let error = finishCallbackUrlThrowableError {
throw error
}
finishCallbackUrlCallsCountLock.withLock { finishCallbackUrlUnderlyingCallsCount += 1 }
finishCallbackUrlReceivedCallbackUrl = callbackUrl
finishCallbackUrlReceivedInvocationsLock.withLock { finishCallbackUrlUnderlyingReceivedInvocations.append(callbackUrl) }
try await finishCallbackUrlClosure?(callbackUrl)
}
//MARK: - url
private let urlCallsCountLock = NSLock()
private var urlUnderlyingCallsCount = 0
open var urlCallsCount: Int {
get { urlCallsCountLock.withLock { urlUnderlyingCallsCount } }
set { urlCallsCountLock.withLock { urlUnderlyingCallsCount = newValue } }
}
open var urlCalled: Bool {
return urlCallsCount > 0
}
private let urlReturnValueLock = NSLock()
open var urlUnderlyingReturnValue: String!
open var urlReturnValue: String! {
get { urlReturnValueLock.withLock { urlUnderlyingReturnValue } }
set { urlReturnValueLock.withLock { urlUnderlyingReturnValue = newValue } }
}
open var urlClosure: (() -> String)?
open override func url() -> String {
urlCallsCountLock.withLock { urlUnderlyingCallsCount += 1 }
if let urlClosure = urlClosure {
return urlClosure()
} else {
return urlReturnValue
}
}
}
open class SyncServiceSDKMock: MatrixRustSDK.SyncService, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - expireSessions
private let expireSessionsCallsCountLock = NSLock()
private var expireSessionsUnderlyingCallsCount = 0
open var expireSessionsCallsCount: Int {
get { expireSessionsCallsCountLock.withLock { expireSessionsUnderlyingCallsCount } }
set { expireSessionsCallsCountLock.withLock { expireSessionsUnderlyingCallsCount = newValue } }
}
open var expireSessionsCalled: Bool {
return expireSessionsCallsCount > 0
}
open var expireSessionsClosure: (() async -> Void)?
open override func expireSessions() async {
expireSessionsCallsCountLock.withLock { expireSessionsUnderlyingCallsCount += 1 }
await expireSessionsClosure?()
}
//MARK: - roomListService
private let roomListServiceCallsCountLock = NSLock()
private var roomListServiceUnderlyingCallsCount = 0
open var roomListServiceCallsCount: Int {
get { roomListServiceCallsCountLock.withLock { roomListServiceUnderlyingCallsCount } }
set { roomListServiceCallsCountLock.withLock { roomListServiceUnderlyingCallsCount = newValue } }
}
open var roomListServiceCalled: Bool {
return roomListServiceCallsCount > 0
}
private let roomListServiceReturnValueLock = NSLock()
open var roomListServiceUnderlyingReturnValue: RoomListService!
open var roomListServiceReturnValue: RoomListService! {
get { roomListServiceReturnValueLock.withLock { roomListServiceUnderlyingReturnValue } }
set { roomListServiceReturnValueLock.withLock { roomListServiceUnderlyingReturnValue = newValue } }
}
open var roomListServiceClosure: (() -> RoomListService)?
open override func roomListService() -> RoomListService {
roomListServiceCallsCountLock.withLock { roomListServiceUnderlyingCallsCount += 1 }
if let roomListServiceClosure = roomListServiceClosure {
return roomListServiceClosure()
} else {
return roomListServiceReturnValue
}
}
//MARK: - start
private let startCallsCountLock = NSLock()
private var startUnderlyingCallsCount = 0
open var startCallsCount: Int {
get { startCallsCountLock.withLock { startUnderlyingCallsCount } }
set { startCallsCountLock.withLock { startUnderlyingCallsCount = newValue } }
}
open var startCalled: Bool {
return startCallsCount > 0
}
open var startClosure: (() async -> Void)?
open override func start() async {
startCallsCountLock.withLock { startUnderlyingCallsCount += 1 }
await startClosure?()
}
//MARK: - state
private let stateListenerCallsCountLock = NSLock()
private var stateListenerUnderlyingCallsCount = 0
open var stateListenerCallsCount: Int {
get { stateListenerCallsCountLock.withLock { stateListenerUnderlyingCallsCount } }
set { stateListenerCallsCountLock.withLock { stateListenerUnderlyingCallsCount = newValue } }
}
open var stateListenerCalled: Bool {
return stateListenerCallsCount > 0
}
private let stateListenerReceivedListenerLock = NSLock()
private var stateListenerUnderlyingReceivedListener: SyncServiceStateObserver?
open var stateListenerReceivedListener: SyncServiceStateObserver? {
get { stateListenerReceivedListenerLock.withLock { stateListenerUnderlyingReceivedListener } }
set { stateListenerReceivedListenerLock.withLock { stateListenerUnderlyingReceivedListener = newValue } }
}
private let stateListenerReceivedInvocationsLock = NSLock()
private var stateListenerUnderlyingReceivedInvocations: [SyncServiceStateObserver] = []
open var stateListenerReceivedInvocations: [SyncServiceStateObserver] {
get { stateListenerReceivedInvocationsLock.withLock { stateListenerUnderlyingReceivedInvocations } }
set { stateListenerReceivedInvocationsLock.withLock { stateListenerUnderlyingReceivedInvocations = newValue } }
}
private let stateListenerReturnValueLock = NSLock()
open var stateListenerUnderlyingReturnValue: TaskHandle!
open var stateListenerReturnValue: TaskHandle! {
get { stateListenerReturnValueLock.withLock { stateListenerUnderlyingReturnValue } }
set { stateListenerReturnValueLock.withLock { stateListenerUnderlyingReturnValue = newValue } }
}
open var stateListenerClosure: ((SyncServiceStateObserver) -> TaskHandle)?
open override func state(listener: SyncServiceStateObserver) -> TaskHandle {
stateListenerCallsCountLock.withLock { stateListenerUnderlyingCallsCount += 1 }
stateListenerReceivedListener = listener
stateListenerReceivedInvocationsLock.withLock { stateListenerUnderlyingReceivedInvocations.append(listener) }
if let stateListenerClosure = stateListenerClosure {
return stateListenerClosure(listener)
} else {
return stateListenerReturnValue
}
}
//MARK: - stop
private let stopCallsCountLock = NSLock()
private var stopUnderlyingCallsCount = 0
open var stopCallsCount: Int {
get { stopCallsCountLock.withLock { stopUnderlyingCallsCount } }
set { stopCallsCountLock.withLock { stopUnderlyingCallsCount = newValue } }
}
open var stopCalled: Bool {
return stopCallsCount > 0
}
open var stopClosure: (() async -> Void)?
open override func stop() async {
stopCallsCountLock.withLock { stopUnderlyingCallsCount += 1 }
await stopClosure?()
}
}
open class SyncServiceBuilderSDKMock: MatrixRustSDK.SyncServiceBuilder, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - finish
open var finishThrowableError: Error?
private let finishCallsCountLock = NSLock()
private var finishUnderlyingCallsCount = 0
open var finishCallsCount: Int {
get { finishCallsCountLock.withLock { finishUnderlyingCallsCount } }
set { finishCallsCountLock.withLock { finishUnderlyingCallsCount = newValue } }
}
open var finishCalled: Bool {
return finishCallsCount > 0
}
private let finishReturnValueLock = NSLock()
open var finishUnderlyingReturnValue: SyncService!
open var finishReturnValue: SyncService! {
get { finishReturnValueLock.withLock { finishUnderlyingReturnValue } }
set { finishReturnValueLock.withLock { finishUnderlyingReturnValue = newValue } }
}
open var finishClosure: (() async throws -> SyncService)?
open override func finish() async throws -> SyncService {
if let error = finishThrowableError {
throw error
}
finishCallsCountLock.withLock { finishUnderlyingCallsCount += 1 }
if let finishClosure = finishClosure {
return try await finishClosure()
} else {
return finishReturnValue
}
}
//MARK: - withOfflineMode
private let withOfflineModeCallsCountLock = NSLock()
private var withOfflineModeUnderlyingCallsCount = 0
open var withOfflineModeCallsCount: Int {
get { withOfflineModeCallsCountLock.withLock { withOfflineModeUnderlyingCallsCount } }
set { withOfflineModeCallsCountLock.withLock { withOfflineModeUnderlyingCallsCount = newValue } }
}
open var withOfflineModeCalled: Bool {
return withOfflineModeCallsCount > 0
}
private let withOfflineModeReturnValueLock = NSLock()
open var withOfflineModeUnderlyingReturnValue: SyncServiceBuilder!
open var withOfflineModeReturnValue: SyncServiceBuilder! {
get { withOfflineModeReturnValueLock.withLock { withOfflineModeUnderlyingReturnValue } }
set { withOfflineModeReturnValueLock.withLock { withOfflineModeUnderlyingReturnValue = newValue } }
}
open var withOfflineModeClosure: (() -> SyncServiceBuilder)?
open override func withOfflineMode() -> SyncServiceBuilder {
withOfflineModeCallsCountLock.withLock { withOfflineModeUnderlyingCallsCount += 1 }
if let withOfflineModeClosure = withOfflineModeClosure {
return withOfflineModeClosure()
} else {
return withOfflineModeReturnValue
}
}
//MARK: - withParentSpan
private let withParentSpanSpanCallsCountLock = NSLock()
private var withParentSpanSpanUnderlyingCallsCount = 0
open var withParentSpanSpanCallsCount: Int {
get { withParentSpanSpanCallsCountLock.withLock { withParentSpanSpanUnderlyingCallsCount } }
set { withParentSpanSpanCallsCountLock.withLock { withParentSpanSpanUnderlyingCallsCount = newValue } }
}
open var withParentSpanSpanCalled: Bool {
return withParentSpanSpanCallsCount > 0
}
private let withParentSpanSpanReceivedSpanLock = NSLock()
private var withParentSpanSpanUnderlyingReceivedSpan: Span?
open var withParentSpanSpanReceivedSpan: Span? {
get { withParentSpanSpanReceivedSpanLock.withLock { withParentSpanSpanUnderlyingReceivedSpan } }
set { withParentSpanSpanReceivedSpanLock.withLock { withParentSpanSpanUnderlyingReceivedSpan = newValue } }
}
private let withParentSpanSpanReceivedInvocationsLock = NSLock()
private var withParentSpanSpanUnderlyingReceivedInvocations: [Span] = []
open var withParentSpanSpanReceivedInvocations: [Span] {
get { withParentSpanSpanReceivedInvocationsLock.withLock { withParentSpanSpanUnderlyingReceivedInvocations } }
set { withParentSpanSpanReceivedInvocationsLock.withLock { withParentSpanSpanUnderlyingReceivedInvocations = newValue } }
}
private let withParentSpanSpanReturnValueLock = NSLock()
open var withParentSpanSpanUnderlyingReturnValue: SyncServiceBuilder!
open var withParentSpanSpanReturnValue: SyncServiceBuilder! {
get { withParentSpanSpanReturnValueLock.withLock { withParentSpanSpanUnderlyingReturnValue } }
set { withParentSpanSpanReturnValueLock.withLock { withParentSpanSpanUnderlyingReturnValue = newValue } }
}
open var withParentSpanSpanClosure: ((Span) -> SyncServiceBuilder)?
open override func withParentSpan(span: Span) -> SyncServiceBuilder {
withParentSpanSpanCallsCountLock.withLock { withParentSpanSpanUnderlyingCallsCount += 1 }
withParentSpanSpanReceivedSpan = span
withParentSpanSpanReceivedInvocationsLock.withLock { withParentSpanSpanUnderlyingReceivedInvocations.append(span) }
if let withParentSpanSpanClosure = withParentSpanSpanClosure {
return withParentSpanSpanClosure(span)
} else {
return withParentSpanSpanReturnValue
}
}
//MARK: - withRoomListConnectionId
private let withRoomListConnectionIdConnectionIdCallsCountLock = NSLock()
private var withRoomListConnectionIdConnectionIdUnderlyingCallsCount = 0
open var withRoomListConnectionIdConnectionIdCallsCount: Int {
get { withRoomListConnectionIdConnectionIdCallsCountLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingCallsCount } }
set { withRoomListConnectionIdConnectionIdCallsCountLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingCallsCount = newValue } }
}
open var withRoomListConnectionIdConnectionIdCalled: Bool {
return withRoomListConnectionIdConnectionIdCallsCount > 0
}
private let withRoomListConnectionIdConnectionIdReceivedConnectionIdLock = NSLock()
private var withRoomListConnectionIdConnectionIdUnderlyingReceivedConnectionId: String?
open var withRoomListConnectionIdConnectionIdReceivedConnectionId: String? {
get { withRoomListConnectionIdConnectionIdReceivedConnectionIdLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingReceivedConnectionId } }
set { withRoomListConnectionIdConnectionIdReceivedConnectionIdLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingReceivedConnectionId = newValue } }
}
private let withRoomListConnectionIdConnectionIdReceivedInvocationsLock = NSLock()
private var withRoomListConnectionIdConnectionIdUnderlyingReceivedInvocations: [String] = []
open var withRoomListConnectionIdConnectionIdReceivedInvocations: [String] {
get { withRoomListConnectionIdConnectionIdReceivedInvocationsLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingReceivedInvocations } }
set { withRoomListConnectionIdConnectionIdReceivedInvocationsLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingReceivedInvocations = newValue } }
}
private let withRoomListConnectionIdConnectionIdReturnValueLock = NSLock()
open var withRoomListConnectionIdConnectionIdUnderlyingReturnValue: SyncServiceBuilder!
open var withRoomListConnectionIdConnectionIdReturnValue: SyncServiceBuilder! {
get { withRoomListConnectionIdConnectionIdReturnValueLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingReturnValue } }
set { withRoomListConnectionIdConnectionIdReturnValueLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingReturnValue = newValue } }
}
open var withRoomListConnectionIdConnectionIdClosure: ((String) -> SyncServiceBuilder)?
open override func withRoomListConnectionId(connectionId: String) -> SyncServiceBuilder {
withRoomListConnectionIdConnectionIdCallsCountLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingCallsCount += 1 }
withRoomListConnectionIdConnectionIdReceivedConnectionId = connectionId
withRoomListConnectionIdConnectionIdReceivedInvocationsLock.withLock { withRoomListConnectionIdConnectionIdUnderlyingReceivedInvocations.append(connectionId) }
if let withRoomListConnectionIdConnectionIdClosure = withRoomListConnectionIdConnectionIdClosure {
return withRoomListConnectionIdConnectionIdClosure(connectionId)
} else {
return withRoomListConnectionIdConnectionIdReturnValue
}
}
//MARK: - withRoomListTimelineLimit
private let withRoomListTimelineLimitLimitCallsCountLock = NSLock()
private var withRoomListTimelineLimitLimitUnderlyingCallsCount = 0
open var withRoomListTimelineLimitLimitCallsCount: Int {
get { withRoomListTimelineLimitLimitCallsCountLock.withLock { withRoomListTimelineLimitLimitUnderlyingCallsCount } }
set { withRoomListTimelineLimitLimitCallsCountLock.withLock { withRoomListTimelineLimitLimitUnderlyingCallsCount = newValue } }
}
open var withRoomListTimelineLimitLimitCalled: Bool {
return withRoomListTimelineLimitLimitCallsCount > 0
}
private let withRoomListTimelineLimitLimitReceivedLimitLock = NSLock()
private var withRoomListTimelineLimitLimitUnderlyingReceivedLimit: UInt32?
open var withRoomListTimelineLimitLimitReceivedLimit: UInt32? {
get { withRoomListTimelineLimitLimitReceivedLimitLock.withLock { withRoomListTimelineLimitLimitUnderlyingReceivedLimit } }
set { withRoomListTimelineLimitLimitReceivedLimitLock.withLock { withRoomListTimelineLimitLimitUnderlyingReceivedLimit = newValue } }
}
private let withRoomListTimelineLimitLimitReceivedInvocationsLock = NSLock()
private var withRoomListTimelineLimitLimitUnderlyingReceivedInvocations: [UInt32] = []
open var withRoomListTimelineLimitLimitReceivedInvocations: [UInt32] {
get { withRoomListTimelineLimitLimitReceivedInvocationsLock.withLock { withRoomListTimelineLimitLimitUnderlyingReceivedInvocations } }
set { withRoomListTimelineLimitLimitReceivedInvocationsLock.withLock { withRoomListTimelineLimitLimitUnderlyingReceivedInvocations = newValue } }
}
private let withRoomListTimelineLimitLimitReturnValueLock = NSLock()
open var withRoomListTimelineLimitLimitUnderlyingReturnValue: SyncServiceBuilder!
open var withRoomListTimelineLimitLimitReturnValue: SyncServiceBuilder! {
get { withRoomListTimelineLimitLimitReturnValueLock.withLock { withRoomListTimelineLimitLimitUnderlyingReturnValue } }
set { withRoomListTimelineLimitLimitReturnValueLock.withLock { withRoomListTimelineLimitLimitUnderlyingReturnValue = newValue } }
}
open var withRoomListTimelineLimitLimitClosure: ((UInt32) -> SyncServiceBuilder)?
open override func withRoomListTimelineLimit(limit: UInt32) -> SyncServiceBuilder {
withRoomListTimelineLimitLimitCallsCountLock.withLock { withRoomListTimelineLimitLimitUnderlyingCallsCount += 1 }
withRoomListTimelineLimitLimitReceivedLimit = limit
withRoomListTimelineLimitLimitReceivedInvocationsLock.withLock { withRoomListTimelineLimitLimitUnderlyingReceivedInvocations.append(limit) }
if let withRoomListTimelineLimitLimitClosure = withRoomListTimelineLimitLimitClosure {
return withRoomListTimelineLimitLimitClosure(limit)
} else {
return withRoomListTimelineLimitLimitReturnValue
}
}
//MARK: - withSharePos
private let withSharePosEnableCallsCountLock = NSLock()
private var withSharePosEnableUnderlyingCallsCount = 0
open var withSharePosEnableCallsCount: Int {
get { withSharePosEnableCallsCountLock.withLock { withSharePosEnableUnderlyingCallsCount } }
set { withSharePosEnableCallsCountLock.withLock { withSharePosEnableUnderlyingCallsCount = newValue } }
}
open var withSharePosEnableCalled: Bool {
return withSharePosEnableCallsCount > 0
}
private let withSharePosEnableReceivedEnableLock = NSLock()
private var withSharePosEnableUnderlyingReceivedEnable: Bool?
open var withSharePosEnableReceivedEnable: Bool? {
get { withSharePosEnableReceivedEnableLock.withLock { withSharePosEnableUnderlyingReceivedEnable } }
set { withSharePosEnableReceivedEnableLock.withLock { withSharePosEnableUnderlyingReceivedEnable = newValue } }
}
private let withSharePosEnableReceivedInvocationsLock = NSLock()
private var withSharePosEnableUnderlyingReceivedInvocations: [Bool] = []
open var withSharePosEnableReceivedInvocations: [Bool] {
get { withSharePosEnableReceivedInvocationsLock.withLock { withSharePosEnableUnderlyingReceivedInvocations } }
set { withSharePosEnableReceivedInvocationsLock.withLock { withSharePosEnableUnderlyingReceivedInvocations = newValue } }
}
private let withSharePosEnableReturnValueLock = NSLock()
open var withSharePosEnableUnderlyingReturnValue: SyncServiceBuilder!
open var withSharePosEnableReturnValue: SyncServiceBuilder! {
get { withSharePosEnableReturnValueLock.withLock { withSharePosEnableUnderlyingReturnValue } }
set { withSharePosEnableReturnValueLock.withLock { withSharePosEnableUnderlyingReturnValue = newValue } }
}
open var withSharePosEnableClosure: ((Bool) -> SyncServiceBuilder)?
open override func withSharePos(enable: Bool) -> SyncServiceBuilder {
withSharePosEnableCallsCountLock.withLock { withSharePosEnableUnderlyingCallsCount += 1 }
withSharePosEnableReceivedEnable = enable
withSharePosEnableReceivedInvocationsLock.withLock { withSharePosEnableUnderlyingReceivedInvocations.append(enable) }
if let withSharePosEnableClosure = withSharePosEnableClosure {
return withSharePosEnableClosure(enable)
} else {
return withSharePosEnableReturnValue
}
}
}
open class TaskHandleSDKMock: MatrixRustSDK.TaskHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - cancel
private let cancelCallsCountLock = NSLock()
private var cancelUnderlyingCallsCount = 0
open var cancelCallsCount: Int {
get { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount } }
set { cancelCallsCountLock.withLock { cancelUnderlyingCallsCount = newValue } }
}
open var cancelCalled: Bool {
return cancelCallsCount > 0
}
open var cancelClosure: (() -> Void)?
open override func cancel() {
cancelCallsCountLock.withLock { cancelUnderlyingCallsCount += 1 }
cancelClosure?()
}
//MARK: - isFinished
private let isFinishedCallsCountLock = NSLock()
private var isFinishedUnderlyingCallsCount = 0
open var isFinishedCallsCount: Int {
get { isFinishedCallsCountLock.withLock { isFinishedUnderlyingCallsCount } }
set { isFinishedCallsCountLock.withLock { isFinishedUnderlyingCallsCount = newValue } }
}
open var isFinishedCalled: Bool {
return isFinishedCallsCount > 0
}
private let isFinishedReturnValueLock = NSLock()
open var isFinishedUnderlyingReturnValue: Bool!
open var isFinishedReturnValue: Bool! {
get { isFinishedReturnValueLock.withLock { isFinishedUnderlyingReturnValue } }
set { isFinishedReturnValueLock.withLock { isFinishedUnderlyingReturnValue = newValue } }
}
open var isFinishedClosure: (() -> Bool)?
open override func isFinished() -> Bool {
isFinishedCallsCountLock.withLock { isFinishedUnderlyingCallsCount += 1 }
if let isFinishedClosure = isFinishedClosure {
return isFinishedClosure()
} else {
return isFinishedReturnValue
}
}
}
open class ThreadListServiceSDKMock: MatrixRustSDK.ThreadListService, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - items
private let itemsCallsCountLock = NSLock()
private var itemsUnderlyingCallsCount = 0
open var itemsCallsCount: Int {
get { itemsCallsCountLock.withLock { itemsUnderlyingCallsCount } }
set { itemsCallsCountLock.withLock { itemsUnderlyingCallsCount = newValue } }
}
open var itemsCalled: Bool {
return itemsCallsCount > 0
}
private let itemsReturnValueLock = NSLock()
open var itemsUnderlyingReturnValue: [ThreadListItem]!
open var itemsReturnValue: [ThreadListItem]! {
get { itemsReturnValueLock.withLock { itemsUnderlyingReturnValue } }
set { itemsReturnValueLock.withLock { itemsUnderlyingReturnValue = newValue } }
}
open var itemsClosure: (() -> [ThreadListItem])?
open override func items() -> [ThreadListItem] {
itemsCallsCountLock.withLock { itemsUnderlyingCallsCount += 1 }
if let itemsClosure = itemsClosure {
return itemsClosure()
} else {
return itemsReturnValue
}
}
//MARK: - paginate
open var paginateThrowableError: Error?
private let paginateCallsCountLock = NSLock()
private var paginateUnderlyingCallsCount = 0
open var paginateCallsCount: Int {
get { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount } }
set { paginateCallsCountLock.withLock { paginateUnderlyingCallsCount = newValue } }
}
open var paginateCalled: Bool {
return paginateCallsCount > 0
}
open var paginateClosure: (() async throws -> Void)?
open override func paginate() async throws {
if let error = paginateThrowableError {
throw error
}
paginateCallsCountLock.withLock { paginateUnderlyingCallsCount += 1 }
try await paginateClosure?()
}
//MARK: - paginationState
private let paginationStateCallsCountLock = NSLock()
private var paginationStateUnderlyingCallsCount = 0
open var paginationStateCallsCount: Int {
get { paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount } }
set { paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount = newValue } }
}
open var paginationStateCalled: Bool {
return paginationStateCallsCount > 0
}
private let paginationStateReturnValueLock = NSLock()
open var paginationStateUnderlyingReturnValue: ThreadListPaginationState!
open var paginationStateReturnValue: ThreadListPaginationState! {
get { paginationStateReturnValueLock.withLock { paginationStateUnderlyingReturnValue } }
set { paginationStateReturnValueLock.withLock { paginationStateUnderlyingReturnValue = newValue } }
}
open var paginationStateClosure: (() -> ThreadListPaginationState)?
open override func paginationState() -> ThreadListPaginationState {
paginationStateCallsCountLock.withLock { paginationStateUnderlyingCallsCount += 1 }
if let paginationStateClosure = paginationStateClosure {
return paginationStateClosure()
} else {
return paginationStateReturnValue
}
}
//MARK: - reset
private let resetCallsCountLock = NSLock()
private var resetUnderlyingCallsCount = 0
open var resetCallsCount: Int {
get { resetCallsCountLock.withLock { resetUnderlyingCallsCount } }
set { resetCallsCountLock.withLock { resetUnderlyingCallsCount = newValue } }
}
open var resetCalled: Bool {
return resetCallsCount > 0
}
open var resetClosure: (() async -> Void)?
open override func reset() async {
resetCallsCountLock.withLock { resetUnderlyingCallsCount += 1 }
await resetClosure?()
}
//MARK: - subscribeToItemsUpdates
private let subscribeToItemsUpdatesListenerCallsCountLock = NSLock()
private var subscribeToItemsUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToItemsUpdatesListenerCallsCount: Int {
get { subscribeToItemsUpdatesListenerCallsCountLock.withLock { subscribeToItemsUpdatesListenerUnderlyingCallsCount } }
set { subscribeToItemsUpdatesListenerCallsCountLock.withLock { subscribeToItemsUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToItemsUpdatesListenerCalled: Bool {
return subscribeToItemsUpdatesListenerCallsCount > 0
}
private let subscribeToItemsUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToItemsUpdatesListenerUnderlyingReceivedListener: ThreadListEntriesListener?
open var subscribeToItemsUpdatesListenerReceivedListener: ThreadListEntriesListener? {
get { subscribeToItemsUpdatesListenerReceivedListenerLock.withLock { subscribeToItemsUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToItemsUpdatesListenerReceivedListenerLock.withLock { subscribeToItemsUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToItemsUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToItemsUpdatesListenerUnderlyingReceivedInvocations: [ThreadListEntriesListener] = []
open var subscribeToItemsUpdatesListenerReceivedInvocations: [ThreadListEntriesListener] {
get { subscribeToItemsUpdatesListenerReceivedInvocationsLock.withLock { subscribeToItemsUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToItemsUpdatesListenerReceivedInvocationsLock.withLock { subscribeToItemsUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToItemsUpdatesListenerReturnValueLock = NSLock()
open var subscribeToItemsUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToItemsUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToItemsUpdatesListenerReturnValueLock.withLock { subscribeToItemsUpdatesListenerUnderlyingReturnValue } }
set { subscribeToItemsUpdatesListenerReturnValueLock.withLock { subscribeToItemsUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToItemsUpdatesListenerClosure: ((ThreadListEntriesListener) -> TaskHandle)?
open override func subscribeToItemsUpdates(listener: ThreadListEntriesListener) -> TaskHandle {
subscribeToItemsUpdatesListenerCallsCountLock.withLock { subscribeToItemsUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToItemsUpdatesListenerReceivedListener = listener
subscribeToItemsUpdatesListenerReceivedInvocationsLock.withLock { subscribeToItemsUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToItemsUpdatesListenerClosure = subscribeToItemsUpdatesListenerClosure {
return subscribeToItemsUpdatesListenerClosure(listener)
} else {
return subscribeToItemsUpdatesListenerReturnValue
}
}
//MARK: - subscribeToPaginationStateUpdates
private let subscribeToPaginationStateUpdatesListenerCallsCountLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = 0
open var subscribeToPaginationStateUpdatesListenerCallsCount: Int {
get { subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount } }
set { subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToPaginationStateUpdatesListenerCalled: Bool {
return subscribeToPaginationStateUpdatesListenerCallsCount > 0
}
private let subscribeToPaginationStateUpdatesListenerReceivedListenerLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener: ThreadListPaginationStateListener?
open var subscribeToPaginationStateUpdatesListenerReceivedListener: ThreadListPaginationStateListener? {
get { subscribeToPaginationStateUpdatesListenerReceivedListenerLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener } }
set { subscribeToPaginationStateUpdatesListenerReceivedListenerLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock = NSLock()
private var subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations: [ThreadListPaginationStateListener] = []
open var subscribeToPaginationStateUpdatesListenerReceivedInvocations: [ThreadListPaginationStateListener] {
get { subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations } }
set { subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToPaginationStateUpdatesListenerReturnValueLock = NSLock()
open var subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToPaginationStateUpdatesListenerReturnValue: TaskHandle! {
get { subscribeToPaginationStateUpdatesListenerReturnValueLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue } }
set { subscribeToPaginationStateUpdatesListenerReturnValueLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToPaginationStateUpdatesListenerClosure: ((ThreadListPaginationStateListener) -> TaskHandle)?
open override func subscribeToPaginationStateUpdates(listener: ThreadListPaginationStateListener) -> TaskHandle {
subscribeToPaginationStateUpdatesListenerCallsCountLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingCallsCount += 1 }
subscribeToPaginationStateUpdatesListenerReceivedListener = listener
subscribeToPaginationStateUpdatesListenerReceivedInvocationsLock.withLock { subscribeToPaginationStateUpdatesListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToPaginationStateUpdatesListenerClosure = subscribeToPaginationStateUpdatesListenerClosure {
return subscribeToPaginationStateUpdatesListenerClosure(listener)
} else {
return subscribeToPaginationStateUpdatesListenerReturnValue
}
}
}
open class ThreadSummarySDKMock: MatrixRustSDK.ThreadSummary, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - latestEvent
private let latestEventCallsCountLock = NSLock()
private var latestEventUnderlyingCallsCount = 0
open var latestEventCallsCount: Int {
get { latestEventCallsCountLock.withLock { latestEventUnderlyingCallsCount } }
set { latestEventCallsCountLock.withLock { latestEventUnderlyingCallsCount = newValue } }
}
open var latestEventCalled: Bool {
return latestEventCallsCount > 0
}
private let latestEventReturnValueLock = NSLock()
open var latestEventUnderlyingReturnValue: EmbeddedEventDetails!
open var latestEventReturnValue: EmbeddedEventDetails! {
get { latestEventReturnValueLock.withLock { latestEventUnderlyingReturnValue } }
set { latestEventReturnValueLock.withLock { latestEventUnderlyingReturnValue = newValue } }
}
open var latestEventClosure: (() -> EmbeddedEventDetails)?
open override func latestEvent() -> EmbeddedEventDetails {
latestEventCallsCountLock.withLock { latestEventUnderlyingCallsCount += 1 }
if let latestEventClosure = latestEventClosure {
return latestEventClosure()
} else {
return latestEventReturnValue
}
}
//MARK: - numReplies
private let numRepliesCallsCountLock = NSLock()
private var numRepliesUnderlyingCallsCount = 0
open var numRepliesCallsCount: Int {
get { numRepliesCallsCountLock.withLock { numRepliesUnderlyingCallsCount } }
set { numRepliesCallsCountLock.withLock { numRepliesUnderlyingCallsCount = newValue } }
}
open var numRepliesCalled: Bool {
return numRepliesCallsCount > 0
}
private let numRepliesReturnValueLock = NSLock()
open var numRepliesUnderlyingReturnValue: UInt64!
open var numRepliesReturnValue: UInt64! {
get { numRepliesReturnValueLock.withLock { numRepliesUnderlyingReturnValue } }
set { numRepliesReturnValueLock.withLock { numRepliesUnderlyingReturnValue = newValue } }
}
open var numRepliesClosure: (() -> UInt64)?
open override func numReplies() -> UInt64 {
numRepliesCallsCountLock.withLock { numRepliesUnderlyingCallsCount += 1 }
if let numRepliesClosure = numRepliesClosure {
return numRepliesClosure()
} else {
return numRepliesReturnValue
}
}
}
open class TimelineSDKMock: MatrixRustSDK.Timeline, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - addListener
private let addListenerListenerCallsCountLock = NSLock()
private var addListenerListenerUnderlyingCallsCount = 0
open var addListenerListenerCallsCount: Int {
get { addListenerListenerCallsCountLock.withLock { addListenerListenerUnderlyingCallsCount } }
set { addListenerListenerCallsCountLock.withLock { addListenerListenerUnderlyingCallsCount = newValue } }
}
open var addListenerListenerCalled: Bool {
return addListenerListenerCallsCount > 0
}
private let addListenerListenerReceivedListenerLock = NSLock()
private var addListenerListenerUnderlyingReceivedListener: TimelineListener?
open var addListenerListenerReceivedListener: TimelineListener? {
get { addListenerListenerReceivedListenerLock.withLock { addListenerListenerUnderlyingReceivedListener } }
set { addListenerListenerReceivedListenerLock.withLock { addListenerListenerUnderlyingReceivedListener = newValue } }
}
private let addListenerListenerReceivedInvocationsLock = NSLock()
private var addListenerListenerUnderlyingReceivedInvocations: [TimelineListener] = []
open var addListenerListenerReceivedInvocations: [TimelineListener] {
get { addListenerListenerReceivedInvocationsLock.withLock { addListenerListenerUnderlyingReceivedInvocations } }
set { addListenerListenerReceivedInvocationsLock.withLock { addListenerListenerUnderlyingReceivedInvocations = newValue } }
}
private let addListenerListenerReturnValueLock = NSLock()
open var addListenerListenerUnderlyingReturnValue: TaskHandle!
open var addListenerListenerReturnValue: TaskHandle! {
get { addListenerListenerReturnValueLock.withLock { addListenerListenerUnderlyingReturnValue } }
set { addListenerListenerReturnValueLock.withLock { addListenerListenerUnderlyingReturnValue = newValue } }
}
open var addListenerListenerClosure: ((TimelineListener) async -> TaskHandle)?
open override func addListener(listener: TimelineListener) async -> TaskHandle {
addListenerListenerCallsCountLock.withLock { addListenerListenerUnderlyingCallsCount += 1 }
addListenerListenerReceivedListener = listener
addListenerListenerReceivedInvocationsLock.withLock { addListenerListenerUnderlyingReceivedInvocations.append(listener) }
if let addListenerListenerClosure = addListenerListenerClosure {
return await addListenerListenerClosure(listener)
} else {
return addListenerListenerReturnValue
}
}
//MARK: - createMessageContent
private let createMessageContentMsgTypeCallsCountLock = NSLock()
private var createMessageContentMsgTypeUnderlyingCallsCount = 0
open var createMessageContentMsgTypeCallsCount: Int {
get { createMessageContentMsgTypeCallsCountLock.withLock { createMessageContentMsgTypeUnderlyingCallsCount } }
set { createMessageContentMsgTypeCallsCountLock.withLock { createMessageContentMsgTypeUnderlyingCallsCount = newValue } }
}
open var createMessageContentMsgTypeCalled: Bool {
return createMessageContentMsgTypeCallsCount > 0
}
private let createMessageContentMsgTypeReceivedMsgTypeLock = NSLock()
private var createMessageContentMsgTypeUnderlyingReceivedMsgType: MessageType?
open var createMessageContentMsgTypeReceivedMsgType: MessageType? {
get { createMessageContentMsgTypeReceivedMsgTypeLock.withLock { createMessageContentMsgTypeUnderlyingReceivedMsgType } }
set { createMessageContentMsgTypeReceivedMsgTypeLock.withLock { createMessageContentMsgTypeUnderlyingReceivedMsgType = newValue } }
}
private let createMessageContentMsgTypeReceivedInvocationsLock = NSLock()
private var createMessageContentMsgTypeUnderlyingReceivedInvocations: [MessageType] = []
open var createMessageContentMsgTypeReceivedInvocations: [MessageType] {
get { createMessageContentMsgTypeReceivedInvocationsLock.withLock { createMessageContentMsgTypeUnderlyingReceivedInvocations } }
set { createMessageContentMsgTypeReceivedInvocationsLock.withLock { createMessageContentMsgTypeUnderlyingReceivedInvocations = newValue } }
}
private let createMessageContentMsgTypeReturnValueLock = NSLock()
open var createMessageContentMsgTypeUnderlyingReturnValue: RoomMessageEventContentWithoutRelation?
open var createMessageContentMsgTypeReturnValue: RoomMessageEventContentWithoutRelation? {
get { createMessageContentMsgTypeReturnValueLock.withLock { createMessageContentMsgTypeUnderlyingReturnValue } }
set { createMessageContentMsgTypeReturnValueLock.withLock { createMessageContentMsgTypeUnderlyingReturnValue = newValue } }
}
open var createMessageContentMsgTypeClosure: ((MessageType) -> RoomMessageEventContentWithoutRelation?)?
open override func createMessageContent(msgType: MessageType) -> RoomMessageEventContentWithoutRelation? {
createMessageContentMsgTypeCallsCountLock.withLock { createMessageContentMsgTypeUnderlyingCallsCount += 1 }
createMessageContentMsgTypeReceivedMsgType = msgType
createMessageContentMsgTypeReceivedInvocationsLock.withLock { createMessageContentMsgTypeUnderlyingReceivedInvocations.append(msgType) }
if let createMessageContentMsgTypeClosure = createMessageContentMsgTypeClosure {
return createMessageContentMsgTypeClosure(msgType)
} else {
return createMessageContentMsgTypeReturnValue
}
}
//MARK: - createPoll
open var createPollQuestionAnswersMaxSelectionsPollKindThrowableError: Error?
private let createPollQuestionAnswersMaxSelectionsPollKindCallsCountLock = NSLock()
private var createPollQuestionAnswersMaxSelectionsPollKindUnderlyingCallsCount = 0
open var createPollQuestionAnswersMaxSelectionsPollKindCallsCount: Int {
get { createPollQuestionAnswersMaxSelectionsPollKindCallsCountLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingCallsCount } }
set { createPollQuestionAnswersMaxSelectionsPollKindCallsCountLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingCallsCount = newValue } }
}
open var createPollQuestionAnswersMaxSelectionsPollKindCalled: Bool {
return createPollQuestionAnswersMaxSelectionsPollKindCallsCount > 0
}
private let createPollQuestionAnswersMaxSelectionsPollKindReceivedArgumentsLock = NSLock()
private var createPollQuestionAnswersMaxSelectionsPollKindUnderlyingReceivedArguments: (question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind)?
open var createPollQuestionAnswersMaxSelectionsPollKindReceivedArguments: (question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind)? {
get { createPollQuestionAnswersMaxSelectionsPollKindReceivedArgumentsLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingReceivedArguments } }
set { createPollQuestionAnswersMaxSelectionsPollKindReceivedArgumentsLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingReceivedArguments = newValue } }
}
private let createPollQuestionAnswersMaxSelectionsPollKindReceivedInvocationsLock = NSLock()
private var createPollQuestionAnswersMaxSelectionsPollKindUnderlyingReceivedInvocations: [(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind)] = []
open var createPollQuestionAnswersMaxSelectionsPollKindReceivedInvocations: [(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind)] {
get { createPollQuestionAnswersMaxSelectionsPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingReceivedInvocations } }
set { createPollQuestionAnswersMaxSelectionsPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingReceivedInvocations = newValue } }
}
open var createPollQuestionAnswersMaxSelectionsPollKindClosure: ((String, [String], UInt8, PollKind) async throws -> Void)?
open override func createPoll(question: String, answers: [String], maxSelections: UInt8, pollKind: PollKind) async throws {
if let error = createPollQuestionAnswersMaxSelectionsPollKindThrowableError {
throw error
}
createPollQuestionAnswersMaxSelectionsPollKindCallsCountLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingCallsCount += 1 }
createPollQuestionAnswersMaxSelectionsPollKindReceivedArguments = (question: question, answers: answers, maxSelections: maxSelections, pollKind: pollKind)
createPollQuestionAnswersMaxSelectionsPollKindReceivedInvocationsLock.withLock { createPollQuestionAnswersMaxSelectionsPollKindUnderlyingReceivedInvocations.append((question: question, answers: answers, maxSelections: maxSelections, pollKind: pollKind)) }
try await createPollQuestionAnswersMaxSelectionsPollKindClosure?(question, answers, maxSelections, pollKind)
}
//MARK: - edit
open var editEventOrTransactionIdNewContentThrowableError: Error?
private let editEventOrTransactionIdNewContentCallsCountLock = NSLock()
private var editEventOrTransactionIdNewContentUnderlyingCallsCount = 0
open var editEventOrTransactionIdNewContentCallsCount: Int {
get { editEventOrTransactionIdNewContentCallsCountLock.withLock { editEventOrTransactionIdNewContentUnderlyingCallsCount } }
set { editEventOrTransactionIdNewContentCallsCountLock.withLock { editEventOrTransactionIdNewContentUnderlyingCallsCount = newValue } }
}
open var editEventOrTransactionIdNewContentCalled: Bool {
return editEventOrTransactionIdNewContentCallsCount > 0
}
private let editEventOrTransactionIdNewContentReceivedArgumentsLock = NSLock()
private var editEventOrTransactionIdNewContentUnderlyingReceivedArguments: (eventOrTransactionId: EventOrTransactionId, newContent: EditedContent)?
open var editEventOrTransactionIdNewContentReceivedArguments: (eventOrTransactionId: EventOrTransactionId, newContent: EditedContent)? {
get { editEventOrTransactionIdNewContentReceivedArgumentsLock.withLock { editEventOrTransactionIdNewContentUnderlyingReceivedArguments } }
set { editEventOrTransactionIdNewContentReceivedArgumentsLock.withLock { editEventOrTransactionIdNewContentUnderlyingReceivedArguments = newValue } }
}
private let editEventOrTransactionIdNewContentReceivedInvocationsLock = NSLock()
private var editEventOrTransactionIdNewContentUnderlyingReceivedInvocations: [(eventOrTransactionId: EventOrTransactionId, newContent: EditedContent)] = []
open var editEventOrTransactionIdNewContentReceivedInvocations: [(eventOrTransactionId: EventOrTransactionId, newContent: EditedContent)] {
get { editEventOrTransactionIdNewContentReceivedInvocationsLock.withLock { editEventOrTransactionIdNewContentUnderlyingReceivedInvocations } }
set { editEventOrTransactionIdNewContentReceivedInvocationsLock.withLock { editEventOrTransactionIdNewContentUnderlyingReceivedInvocations = newValue } }
}
open var editEventOrTransactionIdNewContentClosure: ((EventOrTransactionId, EditedContent) async throws -> Void)?
open override func edit(eventOrTransactionId: EventOrTransactionId, newContent: EditedContent) async throws {
if let error = editEventOrTransactionIdNewContentThrowableError {
throw error
}
editEventOrTransactionIdNewContentCallsCountLock.withLock { editEventOrTransactionIdNewContentUnderlyingCallsCount += 1 }
editEventOrTransactionIdNewContentReceivedArguments = (eventOrTransactionId: eventOrTransactionId, newContent: newContent)
editEventOrTransactionIdNewContentReceivedInvocationsLock.withLock { editEventOrTransactionIdNewContentUnderlyingReceivedInvocations.append((eventOrTransactionId: eventOrTransactionId, newContent: newContent)) }
try await editEventOrTransactionIdNewContentClosure?(eventOrTransactionId, newContent)
}
//MARK: - editRevisions
open var editRevisionsEventIdThrowableError: Error?
private let editRevisionsEventIdCallsCountLock = NSLock()
private var editRevisionsEventIdUnderlyingCallsCount = 0
open var editRevisionsEventIdCallsCount: Int {
get { editRevisionsEventIdCallsCountLock.withLock { editRevisionsEventIdUnderlyingCallsCount } }
set { editRevisionsEventIdCallsCountLock.withLock { editRevisionsEventIdUnderlyingCallsCount = newValue } }
}
open var editRevisionsEventIdCalled: Bool {
return editRevisionsEventIdCallsCount > 0
}
private let editRevisionsEventIdReceivedEventIdLock = NSLock()
private var editRevisionsEventIdUnderlyingReceivedEventId: String?
open var editRevisionsEventIdReceivedEventId: String? {
get { editRevisionsEventIdReceivedEventIdLock.withLock { editRevisionsEventIdUnderlyingReceivedEventId } }
set { editRevisionsEventIdReceivedEventIdLock.withLock { editRevisionsEventIdUnderlyingReceivedEventId = newValue } }
}
private let editRevisionsEventIdReceivedInvocationsLock = NSLock()
private var editRevisionsEventIdUnderlyingReceivedInvocations: [String] = []
open var editRevisionsEventIdReceivedInvocations: [String] {
get { editRevisionsEventIdReceivedInvocationsLock.withLock { editRevisionsEventIdUnderlyingReceivedInvocations } }
set { editRevisionsEventIdReceivedInvocationsLock.withLock { editRevisionsEventIdUnderlyingReceivedInvocations = newValue } }
}
private let editRevisionsEventIdReturnValueLock = NSLock()
open var editRevisionsEventIdUnderlyingReturnValue: [EditRevisionRecord]!
open var editRevisionsEventIdReturnValue: [EditRevisionRecord]! {
get { editRevisionsEventIdReturnValueLock.withLock { editRevisionsEventIdUnderlyingReturnValue } }
set { editRevisionsEventIdReturnValueLock.withLock { editRevisionsEventIdUnderlyingReturnValue = newValue } }
}
open var editRevisionsEventIdClosure: ((String) async throws -> [EditRevisionRecord])?
open override func editRevisions(eventId: String) async throws -> [EditRevisionRecord] {
if let error = editRevisionsEventIdThrowableError {
throw error
}
editRevisionsEventIdCallsCountLock.withLock { editRevisionsEventIdUnderlyingCallsCount += 1 }
editRevisionsEventIdReceivedEventId = eventId
editRevisionsEventIdReceivedInvocationsLock.withLock { editRevisionsEventIdUnderlyingReceivedInvocations.append(eventId) }
if let editRevisionsEventIdClosure = editRevisionsEventIdClosure {
return try await editRevisionsEventIdClosure(eventId)
} else {
return editRevisionsEventIdReturnValue
}
}
//MARK: - endPoll
open var endPollPollStartEventIdTextThrowableError: Error?
private let endPollPollStartEventIdTextCallsCountLock = NSLock()
private var endPollPollStartEventIdTextUnderlyingCallsCount = 0
open var endPollPollStartEventIdTextCallsCount: Int {
get { endPollPollStartEventIdTextCallsCountLock.withLock { endPollPollStartEventIdTextUnderlyingCallsCount } }
set { endPollPollStartEventIdTextCallsCountLock.withLock { endPollPollStartEventIdTextUnderlyingCallsCount = newValue } }
}
open var endPollPollStartEventIdTextCalled: Bool {
return endPollPollStartEventIdTextCallsCount > 0
}
private let endPollPollStartEventIdTextReceivedArgumentsLock = NSLock()
private var endPollPollStartEventIdTextUnderlyingReceivedArguments: (pollStartEventId: String, text: String)?
open var endPollPollStartEventIdTextReceivedArguments: (pollStartEventId: String, text: String)? {
get { endPollPollStartEventIdTextReceivedArgumentsLock.withLock { endPollPollStartEventIdTextUnderlyingReceivedArguments } }
set { endPollPollStartEventIdTextReceivedArgumentsLock.withLock { endPollPollStartEventIdTextUnderlyingReceivedArguments = newValue } }
}
private let endPollPollStartEventIdTextReceivedInvocationsLock = NSLock()
private var endPollPollStartEventIdTextUnderlyingReceivedInvocations: [(pollStartEventId: String, text: String)] = []
open var endPollPollStartEventIdTextReceivedInvocations: [(pollStartEventId: String, text: String)] {
get { endPollPollStartEventIdTextReceivedInvocationsLock.withLock { endPollPollStartEventIdTextUnderlyingReceivedInvocations } }
set { endPollPollStartEventIdTextReceivedInvocationsLock.withLock { endPollPollStartEventIdTextUnderlyingReceivedInvocations = newValue } }
}
open var endPollPollStartEventIdTextClosure: ((String, String) async throws -> Void)?
open override func endPoll(pollStartEventId: String, text: String) async throws {
if let error = endPollPollStartEventIdTextThrowableError {
throw error
}
endPollPollStartEventIdTextCallsCountLock.withLock { endPollPollStartEventIdTextUnderlyingCallsCount += 1 }
endPollPollStartEventIdTextReceivedArguments = (pollStartEventId: pollStartEventId, text: text)
endPollPollStartEventIdTextReceivedInvocationsLock.withLock { endPollPollStartEventIdTextUnderlyingReceivedInvocations.append((pollStartEventId: pollStartEventId, text: text)) }
try await endPollPollStartEventIdTextClosure?(pollStartEventId, text)
}
//MARK: - fetchDetailsForEvent
open var fetchDetailsForEventEventIdThrowableError: Error?
private let fetchDetailsForEventEventIdCallsCountLock = NSLock()
private var fetchDetailsForEventEventIdUnderlyingCallsCount = 0
open var fetchDetailsForEventEventIdCallsCount: Int {
get { fetchDetailsForEventEventIdCallsCountLock.withLock { fetchDetailsForEventEventIdUnderlyingCallsCount } }
set { fetchDetailsForEventEventIdCallsCountLock.withLock { fetchDetailsForEventEventIdUnderlyingCallsCount = newValue } }
}
open var fetchDetailsForEventEventIdCalled: Bool {
return fetchDetailsForEventEventIdCallsCount > 0
}
private let fetchDetailsForEventEventIdReceivedEventIdLock = NSLock()
private var fetchDetailsForEventEventIdUnderlyingReceivedEventId: String?
open var fetchDetailsForEventEventIdReceivedEventId: String? {
get { fetchDetailsForEventEventIdReceivedEventIdLock.withLock { fetchDetailsForEventEventIdUnderlyingReceivedEventId } }
set { fetchDetailsForEventEventIdReceivedEventIdLock.withLock { fetchDetailsForEventEventIdUnderlyingReceivedEventId = newValue } }
}
private let fetchDetailsForEventEventIdReceivedInvocationsLock = NSLock()
private var fetchDetailsForEventEventIdUnderlyingReceivedInvocations: [String] = []
open var fetchDetailsForEventEventIdReceivedInvocations: [String] {
get { fetchDetailsForEventEventIdReceivedInvocationsLock.withLock { fetchDetailsForEventEventIdUnderlyingReceivedInvocations } }
set { fetchDetailsForEventEventIdReceivedInvocationsLock.withLock { fetchDetailsForEventEventIdUnderlyingReceivedInvocations = newValue } }
}
open var fetchDetailsForEventEventIdClosure: ((String) async throws -> Void)?
open override func fetchDetailsForEvent(eventId: String) async throws {
if let error = fetchDetailsForEventEventIdThrowableError {
throw error
}
fetchDetailsForEventEventIdCallsCountLock.withLock { fetchDetailsForEventEventIdUnderlyingCallsCount += 1 }
fetchDetailsForEventEventIdReceivedEventId = eventId
fetchDetailsForEventEventIdReceivedInvocationsLock.withLock { fetchDetailsForEventEventIdUnderlyingReceivedInvocations.append(eventId) }
try await fetchDetailsForEventEventIdClosure?(eventId)
}
//MARK: - fetchMembers
private let fetchMembersCallsCountLock = NSLock()
private var fetchMembersUnderlyingCallsCount = 0
open var fetchMembersCallsCount: Int {
get { fetchMembersCallsCountLock.withLock { fetchMembersUnderlyingCallsCount } }
set { fetchMembersCallsCountLock.withLock { fetchMembersUnderlyingCallsCount = newValue } }
}
open var fetchMembersCalled: Bool {
return fetchMembersCallsCount > 0
}
open var fetchMembersClosure: (() async -> Void)?
open override func fetchMembers() async {
fetchMembersCallsCountLock.withLock { fetchMembersUnderlyingCallsCount += 1 }
await fetchMembersClosure?()
}
//MARK: - getEventTimelineItemByEventId
open var getEventTimelineItemByEventIdEventIdThrowableError: Error?
private let getEventTimelineItemByEventIdEventIdCallsCountLock = NSLock()
private var getEventTimelineItemByEventIdEventIdUnderlyingCallsCount = 0
open var getEventTimelineItemByEventIdEventIdCallsCount: Int {
get { getEventTimelineItemByEventIdEventIdCallsCountLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingCallsCount } }
set { getEventTimelineItemByEventIdEventIdCallsCountLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingCallsCount = newValue } }
}
open var getEventTimelineItemByEventIdEventIdCalled: Bool {
return getEventTimelineItemByEventIdEventIdCallsCount > 0
}
private let getEventTimelineItemByEventIdEventIdReceivedEventIdLock = NSLock()
private var getEventTimelineItemByEventIdEventIdUnderlyingReceivedEventId: String?
open var getEventTimelineItemByEventIdEventIdReceivedEventId: String? {
get { getEventTimelineItemByEventIdEventIdReceivedEventIdLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingReceivedEventId } }
set { getEventTimelineItemByEventIdEventIdReceivedEventIdLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingReceivedEventId = newValue } }
}
private let getEventTimelineItemByEventIdEventIdReceivedInvocationsLock = NSLock()
private var getEventTimelineItemByEventIdEventIdUnderlyingReceivedInvocations: [String] = []
open var getEventTimelineItemByEventIdEventIdReceivedInvocations: [String] {
get { getEventTimelineItemByEventIdEventIdReceivedInvocationsLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingReceivedInvocations } }
set { getEventTimelineItemByEventIdEventIdReceivedInvocationsLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingReceivedInvocations = newValue } }
}
private let getEventTimelineItemByEventIdEventIdReturnValueLock = NSLock()
open var getEventTimelineItemByEventIdEventIdUnderlyingReturnValue: EventTimelineItem!
open var getEventTimelineItemByEventIdEventIdReturnValue: EventTimelineItem! {
get { getEventTimelineItemByEventIdEventIdReturnValueLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingReturnValue } }
set { getEventTimelineItemByEventIdEventIdReturnValueLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingReturnValue = newValue } }
}
open var getEventTimelineItemByEventIdEventIdClosure: ((String) async throws -> EventTimelineItem)?
open override func getEventTimelineItemByEventId(eventId: String) async throws -> EventTimelineItem {
if let error = getEventTimelineItemByEventIdEventIdThrowableError {
throw error
}
getEventTimelineItemByEventIdEventIdCallsCountLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingCallsCount += 1 }
getEventTimelineItemByEventIdEventIdReceivedEventId = eventId
getEventTimelineItemByEventIdEventIdReceivedInvocationsLock.withLock { getEventTimelineItemByEventIdEventIdUnderlyingReceivedInvocations.append(eventId) }
if let getEventTimelineItemByEventIdEventIdClosure = getEventTimelineItemByEventIdEventIdClosure {
return try await getEventTimelineItemByEventIdEventIdClosure(eventId)
} else {
return getEventTimelineItemByEventIdEventIdReturnValue
}
}
//MARK: - latestEventId
private let latestEventIdCallsCountLock = NSLock()
private var latestEventIdUnderlyingCallsCount = 0
open var latestEventIdCallsCount: Int {
get { latestEventIdCallsCountLock.withLock { latestEventIdUnderlyingCallsCount } }
set { latestEventIdCallsCountLock.withLock { latestEventIdUnderlyingCallsCount = newValue } }
}
open var latestEventIdCalled: Bool {
return latestEventIdCallsCount > 0
}
private let latestEventIdReturnValueLock = NSLock()
open var latestEventIdUnderlyingReturnValue: String?
open var latestEventIdReturnValue: String? {
get { latestEventIdReturnValueLock.withLock { latestEventIdUnderlyingReturnValue } }
set { latestEventIdReturnValueLock.withLock { latestEventIdUnderlyingReturnValue = newValue } }
}
open var latestEventIdClosure: (() async -> String?)?
open override func latestEventId() async -> String? {
latestEventIdCallsCountLock.withLock { latestEventIdUnderlyingCallsCount += 1 }
if let latestEventIdClosure = latestEventIdClosure {
return await latestEventIdClosure()
} else {
return latestEventIdReturnValue
}
}
//MARK: - loadReplyDetails
open var loadReplyDetailsEventIdStrThrowableError: Error?
private let loadReplyDetailsEventIdStrCallsCountLock = NSLock()
private var loadReplyDetailsEventIdStrUnderlyingCallsCount = 0
open var loadReplyDetailsEventIdStrCallsCount: Int {
get { loadReplyDetailsEventIdStrCallsCountLock.withLock { loadReplyDetailsEventIdStrUnderlyingCallsCount } }
set { loadReplyDetailsEventIdStrCallsCountLock.withLock { loadReplyDetailsEventIdStrUnderlyingCallsCount = newValue } }
}
open var loadReplyDetailsEventIdStrCalled: Bool {
return loadReplyDetailsEventIdStrCallsCount > 0
}
private let loadReplyDetailsEventIdStrReceivedEventIdStrLock = NSLock()
private var loadReplyDetailsEventIdStrUnderlyingReceivedEventIdStr: String?
open var loadReplyDetailsEventIdStrReceivedEventIdStr: String? {
get { loadReplyDetailsEventIdStrReceivedEventIdStrLock.withLock { loadReplyDetailsEventIdStrUnderlyingReceivedEventIdStr } }
set { loadReplyDetailsEventIdStrReceivedEventIdStrLock.withLock { loadReplyDetailsEventIdStrUnderlyingReceivedEventIdStr = newValue } }
}
private let loadReplyDetailsEventIdStrReceivedInvocationsLock = NSLock()
private var loadReplyDetailsEventIdStrUnderlyingReceivedInvocations: [String] = []
open var loadReplyDetailsEventIdStrReceivedInvocations: [String] {
get { loadReplyDetailsEventIdStrReceivedInvocationsLock.withLock { loadReplyDetailsEventIdStrUnderlyingReceivedInvocations } }
set { loadReplyDetailsEventIdStrReceivedInvocationsLock.withLock { loadReplyDetailsEventIdStrUnderlyingReceivedInvocations = newValue } }
}
private let loadReplyDetailsEventIdStrReturnValueLock = NSLock()
open var loadReplyDetailsEventIdStrUnderlyingReturnValue: InReplyToDetails!
open var loadReplyDetailsEventIdStrReturnValue: InReplyToDetails! {
get { loadReplyDetailsEventIdStrReturnValueLock.withLock { loadReplyDetailsEventIdStrUnderlyingReturnValue } }
set { loadReplyDetailsEventIdStrReturnValueLock.withLock { loadReplyDetailsEventIdStrUnderlyingReturnValue = newValue } }
}
open var loadReplyDetailsEventIdStrClosure: ((String) async throws -> InReplyToDetails)?
open override func loadReplyDetails(eventIdStr: String) async throws -> InReplyToDetails {
if let error = loadReplyDetailsEventIdStrThrowableError {
throw error
}
loadReplyDetailsEventIdStrCallsCountLock.withLock { loadReplyDetailsEventIdStrUnderlyingCallsCount += 1 }
loadReplyDetailsEventIdStrReceivedEventIdStr = eventIdStr
loadReplyDetailsEventIdStrReceivedInvocationsLock.withLock { loadReplyDetailsEventIdStrUnderlyingReceivedInvocations.append(eventIdStr) }
if let loadReplyDetailsEventIdStrClosure = loadReplyDetailsEventIdStrClosure {
return try await loadReplyDetailsEventIdStrClosure(eventIdStr)
} else {
return loadReplyDetailsEventIdStrReturnValue
}
}
//MARK: - markAsRead
open var markAsReadReceiptTypeThrowableError: Error?
private let markAsReadReceiptTypeCallsCountLock = NSLock()
private var markAsReadReceiptTypeUnderlyingCallsCount = 0
open var markAsReadReceiptTypeCallsCount: Int {
get { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount } }
set { markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount = newValue } }
}
open var markAsReadReceiptTypeCalled: Bool {
return markAsReadReceiptTypeCallsCount > 0
}
private let markAsReadReceiptTypeReceivedReceiptTypeLock = NSLock()
private var markAsReadReceiptTypeUnderlyingReceivedReceiptType: ReceiptType?
open var markAsReadReceiptTypeReceivedReceiptType: ReceiptType? {
get { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType } }
set { markAsReadReceiptTypeReceivedReceiptTypeLock.withLock { markAsReadReceiptTypeUnderlyingReceivedReceiptType = newValue } }
}
private let markAsReadReceiptTypeReceivedInvocationsLock = NSLock()
private var markAsReadReceiptTypeUnderlyingReceivedInvocations: [ReceiptType] = []
open var markAsReadReceiptTypeReceivedInvocations: [ReceiptType] {
get { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations } }
set { markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations = newValue } }
}
open var markAsReadReceiptTypeClosure: ((ReceiptType) async throws -> Void)?
open override func markAsRead(receiptType: ReceiptType) async throws {
if let error = markAsReadReceiptTypeThrowableError {
throw error
}
markAsReadReceiptTypeCallsCountLock.withLock { markAsReadReceiptTypeUnderlyingCallsCount += 1 }
markAsReadReceiptTypeReceivedReceiptType = receiptType
markAsReadReceiptTypeReceivedInvocationsLock.withLock { markAsReadReceiptTypeUnderlyingReceivedInvocations.append(receiptType) }
try await markAsReadReceiptTypeClosure?(receiptType)
}
//MARK: - paginateBackwards
open var paginateBackwardsNumEventsThrowableError: Error?
private let paginateBackwardsNumEventsCallsCountLock = NSLock()
private var paginateBackwardsNumEventsUnderlyingCallsCount = 0
open var paginateBackwardsNumEventsCallsCount: Int {
get { paginateBackwardsNumEventsCallsCountLock.withLock { paginateBackwardsNumEventsUnderlyingCallsCount } }
set { paginateBackwardsNumEventsCallsCountLock.withLock { paginateBackwardsNumEventsUnderlyingCallsCount = newValue } }
}
open var paginateBackwardsNumEventsCalled: Bool {
return paginateBackwardsNumEventsCallsCount > 0
}
private let paginateBackwardsNumEventsReceivedNumEventsLock = NSLock()
private var paginateBackwardsNumEventsUnderlyingReceivedNumEvents: UInt16?
open var paginateBackwardsNumEventsReceivedNumEvents: UInt16? {
get { paginateBackwardsNumEventsReceivedNumEventsLock.withLock { paginateBackwardsNumEventsUnderlyingReceivedNumEvents } }
set { paginateBackwardsNumEventsReceivedNumEventsLock.withLock { paginateBackwardsNumEventsUnderlyingReceivedNumEvents = newValue } }
}
private let paginateBackwardsNumEventsReceivedInvocationsLock = NSLock()
private var paginateBackwardsNumEventsUnderlyingReceivedInvocations: [UInt16] = []
open var paginateBackwardsNumEventsReceivedInvocations: [UInt16] {
get { paginateBackwardsNumEventsReceivedInvocationsLock.withLock { paginateBackwardsNumEventsUnderlyingReceivedInvocations } }
set { paginateBackwardsNumEventsReceivedInvocationsLock.withLock { paginateBackwardsNumEventsUnderlyingReceivedInvocations = newValue } }
}
private let paginateBackwardsNumEventsReturnValueLock = NSLock()
open var paginateBackwardsNumEventsUnderlyingReturnValue: Bool!
open var paginateBackwardsNumEventsReturnValue: Bool! {
get { paginateBackwardsNumEventsReturnValueLock.withLock { paginateBackwardsNumEventsUnderlyingReturnValue } }
set { paginateBackwardsNumEventsReturnValueLock.withLock { paginateBackwardsNumEventsUnderlyingReturnValue = newValue } }
}
open var paginateBackwardsNumEventsClosure: ((UInt16) async throws -> Bool)?
open override func paginateBackwards(numEvents: UInt16) async throws -> Bool {
if let error = paginateBackwardsNumEventsThrowableError {
throw error
}
paginateBackwardsNumEventsCallsCountLock.withLock { paginateBackwardsNumEventsUnderlyingCallsCount += 1 }
paginateBackwardsNumEventsReceivedNumEvents = numEvents
paginateBackwardsNumEventsReceivedInvocationsLock.withLock { paginateBackwardsNumEventsUnderlyingReceivedInvocations.append(numEvents) }
if let paginateBackwardsNumEventsClosure = paginateBackwardsNumEventsClosure {
return try await paginateBackwardsNumEventsClosure(numEvents)
} else {
return paginateBackwardsNumEventsReturnValue
}
}
//MARK: - paginateForwards
open var paginateForwardsNumEventsThrowableError: Error?
private let paginateForwardsNumEventsCallsCountLock = NSLock()
private var paginateForwardsNumEventsUnderlyingCallsCount = 0
open var paginateForwardsNumEventsCallsCount: Int {
get { paginateForwardsNumEventsCallsCountLock.withLock { paginateForwardsNumEventsUnderlyingCallsCount } }
set { paginateForwardsNumEventsCallsCountLock.withLock { paginateForwardsNumEventsUnderlyingCallsCount = newValue } }
}
open var paginateForwardsNumEventsCalled: Bool {
return paginateForwardsNumEventsCallsCount > 0
}
private let paginateForwardsNumEventsReceivedNumEventsLock = NSLock()
private var paginateForwardsNumEventsUnderlyingReceivedNumEvents: UInt16?
open var paginateForwardsNumEventsReceivedNumEvents: UInt16? {
get { paginateForwardsNumEventsReceivedNumEventsLock.withLock { paginateForwardsNumEventsUnderlyingReceivedNumEvents } }
set { paginateForwardsNumEventsReceivedNumEventsLock.withLock { paginateForwardsNumEventsUnderlyingReceivedNumEvents = newValue } }
}
private let paginateForwardsNumEventsReceivedInvocationsLock = NSLock()
private var paginateForwardsNumEventsUnderlyingReceivedInvocations: [UInt16] = []
open var paginateForwardsNumEventsReceivedInvocations: [UInt16] {
get { paginateForwardsNumEventsReceivedInvocationsLock.withLock { paginateForwardsNumEventsUnderlyingReceivedInvocations } }
set { paginateForwardsNumEventsReceivedInvocationsLock.withLock { paginateForwardsNumEventsUnderlyingReceivedInvocations = newValue } }
}
private let paginateForwardsNumEventsReturnValueLock = NSLock()
open var paginateForwardsNumEventsUnderlyingReturnValue: Bool!
open var paginateForwardsNumEventsReturnValue: Bool! {
get { paginateForwardsNumEventsReturnValueLock.withLock { paginateForwardsNumEventsUnderlyingReturnValue } }
set { paginateForwardsNumEventsReturnValueLock.withLock { paginateForwardsNumEventsUnderlyingReturnValue = newValue } }
}
open var paginateForwardsNumEventsClosure: ((UInt16) async throws -> Bool)?
open override func paginateForwards(numEvents: UInt16) async throws -> Bool {
if let error = paginateForwardsNumEventsThrowableError {
throw error
}
paginateForwardsNumEventsCallsCountLock.withLock { paginateForwardsNumEventsUnderlyingCallsCount += 1 }
paginateForwardsNumEventsReceivedNumEvents = numEvents
paginateForwardsNumEventsReceivedInvocationsLock.withLock { paginateForwardsNumEventsUnderlyingReceivedInvocations.append(numEvents) }
if let paginateForwardsNumEventsClosure = paginateForwardsNumEventsClosure {
return try await paginateForwardsNumEventsClosure(numEvents)
} else {
return paginateForwardsNumEventsReturnValue
}
}
//MARK: - pinEvent
open var pinEventEventIdThrowableError: Error?
private let pinEventEventIdCallsCountLock = NSLock()
private var pinEventEventIdUnderlyingCallsCount = 0
open var pinEventEventIdCallsCount: Int {
get { pinEventEventIdCallsCountLock.withLock { pinEventEventIdUnderlyingCallsCount } }
set { pinEventEventIdCallsCountLock.withLock { pinEventEventIdUnderlyingCallsCount = newValue } }
}
open var pinEventEventIdCalled: Bool {
return pinEventEventIdCallsCount > 0
}
private let pinEventEventIdReceivedEventIdLock = NSLock()
private var pinEventEventIdUnderlyingReceivedEventId: String?
open var pinEventEventIdReceivedEventId: String? {
get { pinEventEventIdReceivedEventIdLock.withLock { pinEventEventIdUnderlyingReceivedEventId } }
set { pinEventEventIdReceivedEventIdLock.withLock { pinEventEventIdUnderlyingReceivedEventId = newValue } }
}
private let pinEventEventIdReceivedInvocationsLock = NSLock()
private var pinEventEventIdUnderlyingReceivedInvocations: [String] = []
open var pinEventEventIdReceivedInvocations: [String] {
get { pinEventEventIdReceivedInvocationsLock.withLock { pinEventEventIdUnderlyingReceivedInvocations } }
set { pinEventEventIdReceivedInvocationsLock.withLock { pinEventEventIdUnderlyingReceivedInvocations = newValue } }
}
private let pinEventEventIdReturnValueLock = NSLock()
open var pinEventEventIdUnderlyingReturnValue: Bool!
open var pinEventEventIdReturnValue: Bool! {
get { pinEventEventIdReturnValueLock.withLock { pinEventEventIdUnderlyingReturnValue } }
set { pinEventEventIdReturnValueLock.withLock { pinEventEventIdUnderlyingReturnValue = newValue } }
}
open var pinEventEventIdClosure: ((String) async throws -> Bool)?
open override func pinEvent(eventId: String) async throws -> Bool {
if let error = pinEventEventIdThrowableError {
throw error
}
pinEventEventIdCallsCountLock.withLock { pinEventEventIdUnderlyingCallsCount += 1 }
pinEventEventIdReceivedEventId = eventId
pinEventEventIdReceivedInvocationsLock.withLock { pinEventEventIdUnderlyingReceivedInvocations.append(eventId) }
if let pinEventEventIdClosure = pinEventEventIdClosure {
return try await pinEventEventIdClosure(eventId)
} else {
return pinEventEventIdReturnValue
}
}
//MARK: - redactEvent
open var redactEventEventOrTransactionIdReasonThrowableError: Error?
private let redactEventEventOrTransactionIdReasonCallsCountLock = NSLock()
private var redactEventEventOrTransactionIdReasonUnderlyingCallsCount = 0
open var redactEventEventOrTransactionIdReasonCallsCount: Int {
get { redactEventEventOrTransactionIdReasonCallsCountLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingCallsCount } }
set { redactEventEventOrTransactionIdReasonCallsCountLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingCallsCount = newValue } }
}
open var redactEventEventOrTransactionIdReasonCalled: Bool {
return redactEventEventOrTransactionIdReasonCallsCount > 0
}
private let redactEventEventOrTransactionIdReasonReceivedArgumentsLock = NSLock()
private var redactEventEventOrTransactionIdReasonUnderlyingReceivedArguments: (eventOrTransactionId: EventOrTransactionId, reason: String?)?
open var redactEventEventOrTransactionIdReasonReceivedArguments: (eventOrTransactionId: EventOrTransactionId, reason: String?)? {
get { redactEventEventOrTransactionIdReasonReceivedArgumentsLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingReceivedArguments } }
set { redactEventEventOrTransactionIdReasonReceivedArgumentsLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingReceivedArguments = newValue } }
}
private let redactEventEventOrTransactionIdReasonReceivedInvocationsLock = NSLock()
private var redactEventEventOrTransactionIdReasonUnderlyingReceivedInvocations: [(eventOrTransactionId: EventOrTransactionId, reason: String?)] = []
open var redactEventEventOrTransactionIdReasonReceivedInvocations: [(eventOrTransactionId: EventOrTransactionId, reason: String?)] {
get { redactEventEventOrTransactionIdReasonReceivedInvocationsLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingReceivedInvocations } }
set { redactEventEventOrTransactionIdReasonReceivedInvocationsLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingReceivedInvocations = newValue } }
}
open var redactEventEventOrTransactionIdReasonClosure: ((EventOrTransactionId, String?) async throws -> Void)?
open override func redactEvent(eventOrTransactionId: EventOrTransactionId, reason: String?) async throws {
if let error = redactEventEventOrTransactionIdReasonThrowableError {
throw error
}
redactEventEventOrTransactionIdReasonCallsCountLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingCallsCount += 1 }
redactEventEventOrTransactionIdReasonReceivedArguments = (eventOrTransactionId: eventOrTransactionId, reason: reason)
redactEventEventOrTransactionIdReasonReceivedInvocationsLock.withLock { redactEventEventOrTransactionIdReasonUnderlyingReceivedInvocations.append((eventOrTransactionId: eventOrTransactionId, reason: reason)) }
try await redactEventEventOrTransactionIdReasonClosure?(eventOrTransactionId, reason)
}
//MARK: - retryDecryption
private let retryDecryptionSessionIdsCallsCountLock = NSLock()
private var retryDecryptionSessionIdsUnderlyingCallsCount = 0
open var retryDecryptionSessionIdsCallsCount: Int {
get { retryDecryptionSessionIdsCallsCountLock.withLock { retryDecryptionSessionIdsUnderlyingCallsCount } }
set { retryDecryptionSessionIdsCallsCountLock.withLock { retryDecryptionSessionIdsUnderlyingCallsCount = newValue } }
}
open var retryDecryptionSessionIdsCalled: Bool {
return retryDecryptionSessionIdsCallsCount > 0
}
private let retryDecryptionSessionIdsReceivedSessionIdsLock = NSLock()
private var retryDecryptionSessionIdsUnderlyingReceivedSessionIds: [String]?
open var retryDecryptionSessionIdsReceivedSessionIds: [String]? {
get { retryDecryptionSessionIdsReceivedSessionIdsLock.withLock { retryDecryptionSessionIdsUnderlyingReceivedSessionIds } }
set { retryDecryptionSessionIdsReceivedSessionIdsLock.withLock { retryDecryptionSessionIdsUnderlyingReceivedSessionIds = newValue } }
}
private let retryDecryptionSessionIdsReceivedInvocationsLock = NSLock()
private var retryDecryptionSessionIdsUnderlyingReceivedInvocations: [[String]] = []
open var retryDecryptionSessionIdsReceivedInvocations: [[String]] {
get { retryDecryptionSessionIdsReceivedInvocationsLock.withLock { retryDecryptionSessionIdsUnderlyingReceivedInvocations } }
set { retryDecryptionSessionIdsReceivedInvocationsLock.withLock { retryDecryptionSessionIdsUnderlyingReceivedInvocations = newValue } }
}
open var retryDecryptionSessionIdsClosure: (([String]) -> Void)?
open override func retryDecryption(sessionIds: [String]) {
retryDecryptionSessionIdsCallsCountLock.withLock { retryDecryptionSessionIdsUnderlyingCallsCount += 1 }
retryDecryptionSessionIdsReceivedSessionIds = sessionIds
retryDecryptionSessionIdsReceivedInvocationsLock.withLock { retryDecryptionSessionIdsUnderlyingReceivedInvocations.append(sessionIds) }
retryDecryptionSessionIdsClosure?(sessionIds)
}
//MARK: - send
open var sendMsgThrowableError: Error?
private let sendMsgCallsCountLock = NSLock()
private var sendMsgUnderlyingCallsCount = 0
open var sendMsgCallsCount: Int {
get { sendMsgCallsCountLock.withLock { sendMsgUnderlyingCallsCount } }
set { sendMsgCallsCountLock.withLock { sendMsgUnderlyingCallsCount = newValue } }
}
open var sendMsgCalled: Bool {
return sendMsgCallsCount > 0
}
private let sendMsgReceivedMsgLock = NSLock()
private var sendMsgUnderlyingReceivedMsg: RoomMessageEventContentWithoutRelation?
open var sendMsgReceivedMsg: RoomMessageEventContentWithoutRelation? {
get { sendMsgReceivedMsgLock.withLock { sendMsgUnderlyingReceivedMsg } }
set { sendMsgReceivedMsgLock.withLock { sendMsgUnderlyingReceivedMsg = newValue } }
}
private let sendMsgReceivedInvocationsLock = NSLock()
private var sendMsgUnderlyingReceivedInvocations: [RoomMessageEventContentWithoutRelation] = []
open var sendMsgReceivedInvocations: [RoomMessageEventContentWithoutRelation] {
get { sendMsgReceivedInvocationsLock.withLock { sendMsgUnderlyingReceivedInvocations } }
set { sendMsgReceivedInvocationsLock.withLock { sendMsgUnderlyingReceivedInvocations = newValue } }
}
private let sendMsgReturnValueLock = NSLock()
open var sendMsgUnderlyingReturnValue: SendHandle!
open var sendMsgReturnValue: SendHandle! {
get { sendMsgReturnValueLock.withLock { sendMsgUnderlyingReturnValue } }
set { sendMsgReturnValueLock.withLock { sendMsgUnderlyingReturnValue = newValue } }
}
open var sendMsgClosure: ((RoomMessageEventContentWithoutRelation) async throws -> SendHandle)?
open override func send(msg: RoomMessageEventContentWithoutRelation) async throws -> SendHandle {
if let error = sendMsgThrowableError {
throw error
}
sendMsgCallsCountLock.withLock { sendMsgUnderlyingCallsCount += 1 }
sendMsgReceivedMsg = msg
sendMsgReceivedInvocationsLock.withLock { sendMsgUnderlyingReceivedInvocations.append(msg) }
if let sendMsgClosure = sendMsgClosure {
return try await sendMsgClosure(msg)
} else {
return sendMsgReturnValue
}
}
//MARK: - sendAudio
open var sendAudioParamsAudioInfoThrowableError: Error?
private let sendAudioParamsAudioInfoCallsCountLock = NSLock()
private var sendAudioParamsAudioInfoUnderlyingCallsCount = 0
open var sendAudioParamsAudioInfoCallsCount: Int {
get { sendAudioParamsAudioInfoCallsCountLock.withLock { sendAudioParamsAudioInfoUnderlyingCallsCount } }
set { sendAudioParamsAudioInfoCallsCountLock.withLock { sendAudioParamsAudioInfoUnderlyingCallsCount = newValue } }
}
open var sendAudioParamsAudioInfoCalled: Bool {
return sendAudioParamsAudioInfoCallsCount > 0
}
private let sendAudioParamsAudioInfoReceivedArgumentsLock = NSLock()
private var sendAudioParamsAudioInfoUnderlyingReceivedArguments: (params: UploadParameters, audioInfo: AudioInfo)?
open var sendAudioParamsAudioInfoReceivedArguments: (params: UploadParameters, audioInfo: AudioInfo)? {
get { sendAudioParamsAudioInfoReceivedArgumentsLock.withLock { sendAudioParamsAudioInfoUnderlyingReceivedArguments } }
set { sendAudioParamsAudioInfoReceivedArgumentsLock.withLock { sendAudioParamsAudioInfoUnderlyingReceivedArguments = newValue } }
}
private let sendAudioParamsAudioInfoReceivedInvocationsLock = NSLock()
private var sendAudioParamsAudioInfoUnderlyingReceivedInvocations: [(params: UploadParameters, audioInfo: AudioInfo)] = []
open var sendAudioParamsAudioInfoReceivedInvocations: [(params: UploadParameters, audioInfo: AudioInfo)] {
get { sendAudioParamsAudioInfoReceivedInvocationsLock.withLock { sendAudioParamsAudioInfoUnderlyingReceivedInvocations } }
set { sendAudioParamsAudioInfoReceivedInvocationsLock.withLock { sendAudioParamsAudioInfoUnderlyingReceivedInvocations = newValue } }
}
private let sendAudioParamsAudioInfoReturnValueLock = NSLock()
open var sendAudioParamsAudioInfoUnderlyingReturnValue: SendAttachmentJoinHandle!
open var sendAudioParamsAudioInfoReturnValue: SendAttachmentJoinHandle! {
get { sendAudioParamsAudioInfoReturnValueLock.withLock { sendAudioParamsAudioInfoUnderlyingReturnValue } }
set { sendAudioParamsAudioInfoReturnValueLock.withLock { sendAudioParamsAudioInfoUnderlyingReturnValue = newValue } }
}
open var sendAudioParamsAudioInfoClosure: ((UploadParameters, AudioInfo) throws -> SendAttachmentJoinHandle)?
open override func sendAudio(params: UploadParameters, audioInfo: AudioInfo) throws -> SendAttachmentJoinHandle {
if let error = sendAudioParamsAudioInfoThrowableError {
throw error
}
sendAudioParamsAudioInfoCallsCountLock.withLock { sendAudioParamsAudioInfoUnderlyingCallsCount += 1 }
sendAudioParamsAudioInfoReceivedArguments = (params: params, audioInfo: audioInfo)
sendAudioParamsAudioInfoReceivedInvocationsLock.withLock { sendAudioParamsAudioInfoUnderlyingReceivedInvocations.append((params: params, audioInfo: audioInfo)) }
if let sendAudioParamsAudioInfoClosure = sendAudioParamsAudioInfoClosure {
return try sendAudioParamsAudioInfoClosure(params, audioInfo)
} else {
return sendAudioParamsAudioInfoReturnValue
}
}
//MARK: - sendFile
open var sendFileParamsFileInfoThrowableError: Error?
private let sendFileParamsFileInfoCallsCountLock = NSLock()
private var sendFileParamsFileInfoUnderlyingCallsCount = 0
open var sendFileParamsFileInfoCallsCount: Int {
get { sendFileParamsFileInfoCallsCountLock.withLock { sendFileParamsFileInfoUnderlyingCallsCount } }
set { sendFileParamsFileInfoCallsCountLock.withLock { sendFileParamsFileInfoUnderlyingCallsCount = newValue } }
}
open var sendFileParamsFileInfoCalled: Bool {
return sendFileParamsFileInfoCallsCount > 0
}
private let sendFileParamsFileInfoReceivedArgumentsLock = NSLock()
private var sendFileParamsFileInfoUnderlyingReceivedArguments: (params: UploadParameters, fileInfo: FileInfo)?
open var sendFileParamsFileInfoReceivedArguments: (params: UploadParameters, fileInfo: FileInfo)? {
get { sendFileParamsFileInfoReceivedArgumentsLock.withLock { sendFileParamsFileInfoUnderlyingReceivedArguments } }
set { sendFileParamsFileInfoReceivedArgumentsLock.withLock { sendFileParamsFileInfoUnderlyingReceivedArguments = newValue } }
}
private let sendFileParamsFileInfoReceivedInvocationsLock = NSLock()
private var sendFileParamsFileInfoUnderlyingReceivedInvocations: [(params: UploadParameters, fileInfo: FileInfo)] = []
open var sendFileParamsFileInfoReceivedInvocations: [(params: UploadParameters, fileInfo: FileInfo)] {
get { sendFileParamsFileInfoReceivedInvocationsLock.withLock { sendFileParamsFileInfoUnderlyingReceivedInvocations } }
set { sendFileParamsFileInfoReceivedInvocationsLock.withLock { sendFileParamsFileInfoUnderlyingReceivedInvocations = newValue } }
}
private let sendFileParamsFileInfoReturnValueLock = NSLock()
open var sendFileParamsFileInfoUnderlyingReturnValue: SendAttachmentJoinHandle!
open var sendFileParamsFileInfoReturnValue: SendAttachmentJoinHandle! {
get { sendFileParamsFileInfoReturnValueLock.withLock { sendFileParamsFileInfoUnderlyingReturnValue } }
set { sendFileParamsFileInfoReturnValueLock.withLock { sendFileParamsFileInfoUnderlyingReturnValue = newValue } }
}
open var sendFileParamsFileInfoClosure: ((UploadParameters, FileInfo) throws -> SendAttachmentJoinHandle)?
open override func sendFile(params: UploadParameters, fileInfo: FileInfo) throws -> SendAttachmentJoinHandle {
if let error = sendFileParamsFileInfoThrowableError {
throw error
}
sendFileParamsFileInfoCallsCountLock.withLock { sendFileParamsFileInfoUnderlyingCallsCount += 1 }
sendFileParamsFileInfoReceivedArguments = (params: params, fileInfo: fileInfo)
sendFileParamsFileInfoReceivedInvocationsLock.withLock { sendFileParamsFileInfoUnderlyingReceivedInvocations.append((params: params, fileInfo: fileInfo)) }
if let sendFileParamsFileInfoClosure = sendFileParamsFileInfoClosure {
return try sendFileParamsFileInfoClosure(params, fileInfo)
} else {
return sendFileParamsFileInfoReturnValue
}
}
//MARK: - sendImage
open var sendImageParamsThumbnailSourceImageInfoThrowableError: Error?
private let sendImageParamsThumbnailSourceImageInfoCallsCountLock = NSLock()
private var sendImageParamsThumbnailSourceImageInfoUnderlyingCallsCount = 0
open var sendImageParamsThumbnailSourceImageInfoCallsCount: Int {
get { sendImageParamsThumbnailSourceImageInfoCallsCountLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingCallsCount } }
set { sendImageParamsThumbnailSourceImageInfoCallsCountLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingCallsCount = newValue } }
}
open var sendImageParamsThumbnailSourceImageInfoCalled: Bool {
return sendImageParamsThumbnailSourceImageInfoCallsCount > 0
}
private let sendImageParamsThumbnailSourceImageInfoReceivedArgumentsLock = NSLock()
private var sendImageParamsThumbnailSourceImageInfoUnderlyingReceivedArguments: (params: UploadParameters, thumbnailSource: UploadSource?, imageInfo: ImageInfo)?
open var sendImageParamsThumbnailSourceImageInfoReceivedArguments: (params: UploadParameters, thumbnailSource: UploadSource?, imageInfo: ImageInfo)? {
get { sendImageParamsThumbnailSourceImageInfoReceivedArgumentsLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingReceivedArguments } }
set { sendImageParamsThumbnailSourceImageInfoReceivedArgumentsLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingReceivedArguments = newValue } }
}
private let sendImageParamsThumbnailSourceImageInfoReceivedInvocationsLock = NSLock()
private var sendImageParamsThumbnailSourceImageInfoUnderlyingReceivedInvocations: [(params: UploadParameters, thumbnailSource: UploadSource?, imageInfo: ImageInfo)] = []
open var sendImageParamsThumbnailSourceImageInfoReceivedInvocations: [(params: UploadParameters, thumbnailSource: UploadSource?, imageInfo: ImageInfo)] {
get { sendImageParamsThumbnailSourceImageInfoReceivedInvocationsLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingReceivedInvocations } }
set { sendImageParamsThumbnailSourceImageInfoReceivedInvocationsLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingReceivedInvocations = newValue } }
}
private let sendImageParamsThumbnailSourceImageInfoReturnValueLock = NSLock()
open var sendImageParamsThumbnailSourceImageInfoUnderlyingReturnValue: SendAttachmentJoinHandle!
open var sendImageParamsThumbnailSourceImageInfoReturnValue: SendAttachmentJoinHandle! {
get { sendImageParamsThumbnailSourceImageInfoReturnValueLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingReturnValue } }
set { sendImageParamsThumbnailSourceImageInfoReturnValueLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingReturnValue = newValue } }
}
open var sendImageParamsThumbnailSourceImageInfoClosure: ((UploadParameters, UploadSource?, ImageInfo) throws -> SendAttachmentJoinHandle)?
open override func sendImage(params: UploadParameters, thumbnailSource: UploadSource?, imageInfo: ImageInfo) throws -> SendAttachmentJoinHandle {
if let error = sendImageParamsThumbnailSourceImageInfoThrowableError {
throw error
}
sendImageParamsThumbnailSourceImageInfoCallsCountLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingCallsCount += 1 }
sendImageParamsThumbnailSourceImageInfoReceivedArguments = (params: params, thumbnailSource: thumbnailSource, imageInfo: imageInfo)
sendImageParamsThumbnailSourceImageInfoReceivedInvocationsLock.withLock { sendImageParamsThumbnailSourceImageInfoUnderlyingReceivedInvocations.append((params: params, thumbnailSource: thumbnailSource, imageInfo: imageInfo)) }
if let sendImageParamsThumbnailSourceImageInfoClosure = sendImageParamsThumbnailSourceImageInfoClosure {
return try sendImageParamsThumbnailSourceImageInfoClosure(params, thumbnailSource, imageInfo)
} else {
return sendImageParamsThumbnailSourceImageInfoReturnValue
}
}
//MARK: - sendLocation
open var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdThrowableError: Error?
private let sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdCallsCountLock = NSLock()
private var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingCallsCount = 0
open var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdCallsCount: Int {
get { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdCallsCountLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingCallsCount } }
set { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdCallsCountLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingCallsCount = newValue } }
}
open var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdCalled: Bool {
return sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdCallsCount > 0
}
private let sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedArgumentsLock = NSLock()
private var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingReceivedArguments: (body: String, geoUri: String, description: String?, zoomLevel: UInt8?, assetType: AssetType?, repliedToEventId: String?)?
open var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedArguments: (body: String, geoUri: String, description: String?, zoomLevel: UInt8?, assetType: AssetType?, repliedToEventId: String?)? {
get { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedArgumentsLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingReceivedArguments } }
set { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedArgumentsLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingReceivedArguments = newValue } }
}
private let sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedInvocationsLock = NSLock()
private var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingReceivedInvocations: [(body: String, geoUri: String, description: String?, zoomLevel: UInt8?, assetType: AssetType?, repliedToEventId: String?)] = []
open var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedInvocations: [(body: String, geoUri: String, description: String?, zoomLevel: UInt8?, assetType: AssetType?, repliedToEventId: String?)] {
get { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedInvocationsLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingReceivedInvocations } }
set { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedInvocationsLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingReceivedInvocations = newValue } }
}
open var sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdClosure: ((String, String, String?, UInt8?, AssetType?, String?) async throws -> Void)?
open override func sendLocation(body: String, geoUri: String, description: String?, zoomLevel: UInt8?, assetType: AssetType?, repliedToEventId: String?) async throws {
if let error = sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdThrowableError {
throw error
}
sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdCallsCountLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingCallsCount += 1 }
sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedArguments = (body: body, geoUri: geoUri, description: description, zoomLevel: zoomLevel, assetType: assetType, repliedToEventId: repliedToEventId)
sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdReceivedInvocationsLock.withLock { sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdUnderlyingReceivedInvocations.append((body: body, geoUri: geoUri, description: description, zoomLevel: zoomLevel, assetType: assetType, repliedToEventId: repliedToEventId)) }
try await sendLocationBodyGeoUriDescriptionZoomLevelAssetTypeRepliedToEventIdClosure?(body, geoUri, description, zoomLevel, assetType, repliedToEventId)
}
//MARK: - sendPollResponse
open var sendPollResponsePollStartEventIdAnswersThrowableError: Error?
private let sendPollResponsePollStartEventIdAnswersCallsCountLock = NSLock()
private var sendPollResponsePollStartEventIdAnswersUnderlyingCallsCount = 0
open var sendPollResponsePollStartEventIdAnswersCallsCount: Int {
get { sendPollResponsePollStartEventIdAnswersCallsCountLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingCallsCount } }
set { sendPollResponsePollStartEventIdAnswersCallsCountLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingCallsCount = newValue } }
}
open var sendPollResponsePollStartEventIdAnswersCalled: Bool {
return sendPollResponsePollStartEventIdAnswersCallsCount > 0
}
private let sendPollResponsePollStartEventIdAnswersReceivedArgumentsLock = NSLock()
private var sendPollResponsePollStartEventIdAnswersUnderlyingReceivedArguments: (pollStartEventId: String, answers: [String])?
open var sendPollResponsePollStartEventIdAnswersReceivedArguments: (pollStartEventId: String, answers: [String])? {
get { sendPollResponsePollStartEventIdAnswersReceivedArgumentsLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingReceivedArguments } }
set { sendPollResponsePollStartEventIdAnswersReceivedArgumentsLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingReceivedArguments = newValue } }
}
private let sendPollResponsePollStartEventIdAnswersReceivedInvocationsLock = NSLock()
private var sendPollResponsePollStartEventIdAnswersUnderlyingReceivedInvocations: [(pollStartEventId: String, answers: [String])] = []
open var sendPollResponsePollStartEventIdAnswersReceivedInvocations: [(pollStartEventId: String, answers: [String])] {
get { sendPollResponsePollStartEventIdAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingReceivedInvocations } }
set { sendPollResponsePollStartEventIdAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingReceivedInvocations = newValue } }
}
open var sendPollResponsePollStartEventIdAnswersClosure: ((String, [String]) async throws -> Void)?
open override func sendPollResponse(pollStartEventId: String, answers: [String]) async throws {
if let error = sendPollResponsePollStartEventIdAnswersThrowableError {
throw error
}
sendPollResponsePollStartEventIdAnswersCallsCountLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingCallsCount += 1 }
sendPollResponsePollStartEventIdAnswersReceivedArguments = (pollStartEventId: pollStartEventId, answers: answers)
sendPollResponsePollStartEventIdAnswersReceivedInvocationsLock.withLock { sendPollResponsePollStartEventIdAnswersUnderlyingReceivedInvocations.append((pollStartEventId: pollStartEventId, answers: answers)) }
try await sendPollResponsePollStartEventIdAnswersClosure?(pollStartEventId, answers)
}
//MARK: - sendReadReceipt
open var sendReadReceiptReceiptTypeEventIdThrowableError: Error?
private let sendReadReceiptReceiptTypeEventIdCallsCountLock = NSLock()
private var sendReadReceiptReceiptTypeEventIdUnderlyingCallsCount = 0
open var sendReadReceiptReceiptTypeEventIdCallsCount: Int {
get { sendReadReceiptReceiptTypeEventIdCallsCountLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingCallsCount } }
set { sendReadReceiptReceiptTypeEventIdCallsCountLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingCallsCount = newValue } }
}
open var sendReadReceiptReceiptTypeEventIdCalled: Bool {
return sendReadReceiptReceiptTypeEventIdCallsCount > 0
}
private let sendReadReceiptReceiptTypeEventIdReceivedArgumentsLock = NSLock()
private var sendReadReceiptReceiptTypeEventIdUnderlyingReceivedArguments: (receiptType: ReceiptType, eventId: String)?
open var sendReadReceiptReceiptTypeEventIdReceivedArguments: (receiptType: ReceiptType, eventId: String)? {
get { sendReadReceiptReceiptTypeEventIdReceivedArgumentsLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingReceivedArguments } }
set { sendReadReceiptReceiptTypeEventIdReceivedArgumentsLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingReceivedArguments = newValue } }
}
private let sendReadReceiptReceiptTypeEventIdReceivedInvocationsLock = NSLock()
private var sendReadReceiptReceiptTypeEventIdUnderlyingReceivedInvocations: [(receiptType: ReceiptType, eventId: String)] = []
open var sendReadReceiptReceiptTypeEventIdReceivedInvocations: [(receiptType: ReceiptType, eventId: String)] {
get { sendReadReceiptReceiptTypeEventIdReceivedInvocationsLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingReceivedInvocations } }
set { sendReadReceiptReceiptTypeEventIdReceivedInvocationsLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingReceivedInvocations = newValue } }
}
open var sendReadReceiptReceiptTypeEventIdClosure: ((ReceiptType, String) async throws -> Void)?
open override func sendReadReceipt(receiptType: ReceiptType, eventId: String) async throws {
if let error = sendReadReceiptReceiptTypeEventIdThrowableError {
throw error
}
sendReadReceiptReceiptTypeEventIdCallsCountLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingCallsCount += 1 }
sendReadReceiptReceiptTypeEventIdReceivedArguments = (receiptType: receiptType, eventId: eventId)
sendReadReceiptReceiptTypeEventIdReceivedInvocationsLock.withLock { sendReadReceiptReceiptTypeEventIdUnderlyingReceivedInvocations.append((receiptType: receiptType, eventId: eventId)) }
try await sendReadReceiptReceiptTypeEventIdClosure?(receiptType, eventId)
}
//MARK: - sendReply
open var sendReplyMsgEventIdThrowableError: Error?
private let sendReplyMsgEventIdCallsCountLock = NSLock()
private var sendReplyMsgEventIdUnderlyingCallsCount = 0
open var sendReplyMsgEventIdCallsCount: Int {
get { sendReplyMsgEventIdCallsCountLock.withLock { sendReplyMsgEventIdUnderlyingCallsCount } }
set { sendReplyMsgEventIdCallsCountLock.withLock { sendReplyMsgEventIdUnderlyingCallsCount = newValue } }
}
open var sendReplyMsgEventIdCalled: Bool {
return sendReplyMsgEventIdCallsCount > 0
}
private let sendReplyMsgEventIdReceivedArgumentsLock = NSLock()
private var sendReplyMsgEventIdUnderlyingReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, eventId: String)?
open var sendReplyMsgEventIdReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, eventId: String)? {
get { sendReplyMsgEventIdReceivedArgumentsLock.withLock { sendReplyMsgEventIdUnderlyingReceivedArguments } }
set { sendReplyMsgEventIdReceivedArgumentsLock.withLock { sendReplyMsgEventIdUnderlyingReceivedArguments = newValue } }
}
private let sendReplyMsgEventIdReceivedInvocationsLock = NSLock()
private var sendReplyMsgEventIdUnderlyingReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, eventId: String)] = []
open var sendReplyMsgEventIdReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, eventId: String)] {
get { sendReplyMsgEventIdReceivedInvocationsLock.withLock { sendReplyMsgEventIdUnderlyingReceivedInvocations } }
set { sendReplyMsgEventIdReceivedInvocationsLock.withLock { sendReplyMsgEventIdUnderlyingReceivedInvocations = newValue } }
}
private let sendReplyMsgEventIdReturnValueLock = NSLock()
open var sendReplyMsgEventIdUnderlyingReturnValue: SendHandle!
open var sendReplyMsgEventIdReturnValue: SendHandle! {
get { sendReplyMsgEventIdReturnValueLock.withLock { sendReplyMsgEventIdUnderlyingReturnValue } }
set { sendReplyMsgEventIdReturnValueLock.withLock { sendReplyMsgEventIdUnderlyingReturnValue = newValue } }
}
open var sendReplyMsgEventIdClosure: ((RoomMessageEventContentWithoutRelation, String) async throws -> SendHandle)?
open override func sendReply(msg: RoomMessageEventContentWithoutRelation, eventId: String) async throws -> SendHandle {
if let error = sendReplyMsgEventIdThrowableError {
throw error
}
sendReplyMsgEventIdCallsCountLock.withLock { sendReplyMsgEventIdUnderlyingCallsCount += 1 }
sendReplyMsgEventIdReceivedArguments = (msg: msg, eventId: eventId)
sendReplyMsgEventIdReceivedInvocationsLock.withLock { sendReplyMsgEventIdUnderlyingReceivedInvocations.append((msg: msg, eventId: eventId)) }
if let sendReplyMsgEventIdClosure = sendReplyMsgEventIdClosure {
return try await sendReplyMsgEventIdClosure(msg, eventId)
} else {
return sendReplyMsgEventIdReturnValue
}
}
//MARK: - sendVideo
open var sendVideoParamsThumbnailSourceVideoInfoThrowableError: Error?
private let sendVideoParamsThumbnailSourceVideoInfoCallsCountLock = NSLock()
private var sendVideoParamsThumbnailSourceVideoInfoUnderlyingCallsCount = 0
open var sendVideoParamsThumbnailSourceVideoInfoCallsCount: Int {
get { sendVideoParamsThumbnailSourceVideoInfoCallsCountLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingCallsCount } }
set { sendVideoParamsThumbnailSourceVideoInfoCallsCountLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingCallsCount = newValue } }
}
open var sendVideoParamsThumbnailSourceVideoInfoCalled: Bool {
return sendVideoParamsThumbnailSourceVideoInfoCallsCount > 0
}
private let sendVideoParamsThumbnailSourceVideoInfoReceivedArgumentsLock = NSLock()
private var sendVideoParamsThumbnailSourceVideoInfoUnderlyingReceivedArguments: (params: UploadParameters, thumbnailSource: UploadSource?, videoInfo: VideoInfo)?
open var sendVideoParamsThumbnailSourceVideoInfoReceivedArguments: (params: UploadParameters, thumbnailSource: UploadSource?, videoInfo: VideoInfo)? {
get { sendVideoParamsThumbnailSourceVideoInfoReceivedArgumentsLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingReceivedArguments } }
set { sendVideoParamsThumbnailSourceVideoInfoReceivedArgumentsLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingReceivedArguments = newValue } }
}
private let sendVideoParamsThumbnailSourceVideoInfoReceivedInvocationsLock = NSLock()
private var sendVideoParamsThumbnailSourceVideoInfoUnderlyingReceivedInvocations: [(params: UploadParameters, thumbnailSource: UploadSource?, videoInfo: VideoInfo)] = []
open var sendVideoParamsThumbnailSourceVideoInfoReceivedInvocations: [(params: UploadParameters, thumbnailSource: UploadSource?, videoInfo: VideoInfo)] {
get { sendVideoParamsThumbnailSourceVideoInfoReceivedInvocationsLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingReceivedInvocations } }
set { sendVideoParamsThumbnailSourceVideoInfoReceivedInvocationsLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingReceivedInvocations = newValue } }
}
private let sendVideoParamsThumbnailSourceVideoInfoReturnValueLock = NSLock()
open var sendVideoParamsThumbnailSourceVideoInfoUnderlyingReturnValue: SendAttachmentJoinHandle!
open var sendVideoParamsThumbnailSourceVideoInfoReturnValue: SendAttachmentJoinHandle! {
get { sendVideoParamsThumbnailSourceVideoInfoReturnValueLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingReturnValue } }
set { sendVideoParamsThumbnailSourceVideoInfoReturnValueLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingReturnValue = newValue } }
}
open var sendVideoParamsThumbnailSourceVideoInfoClosure: ((UploadParameters, UploadSource?, VideoInfo) throws -> SendAttachmentJoinHandle)?
open override func sendVideo(params: UploadParameters, thumbnailSource: UploadSource?, videoInfo: VideoInfo) throws -> SendAttachmentJoinHandle {
if let error = sendVideoParamsThumbnailSourceVideoInfoThrowableError {
throw error
}
sendVideoParamsThumbnailSourceVideoInfoCallsCountLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingCallsCount += 1 }
sendVideoParamsThumbnailSourceVideoInfoReceivedArguments = (params: params, thumbnailSource: thumbnailSource, videoInfo: videoInfo)
sendVideoParamsThumbnailSourceVideoInfoReceivedInvocationsLock.withLock { sendVideoParamsThumbnailSourceVideoInfoUnderlyingReceivedInvocations.append((params: params, thumbnailSource: thumbnailSource, videoInfo: videoInfo)) }
if let sendVideoParamsThumbnailSourceVideoInfoClosure = sendVideoParamsThumbnailSourceVideoInfoClosure {
return try sendVideoParamsThumbnailSourceVideoInfoClosure(params, thumbnailSource, videoInfo)
} else {
return sendVideoParamsThumbnailSourceVideoInfoReturnValue
}
}
//MARK: - sendVoiceMessage
open var sendVoiceMessageParamsAudioInfoWaveformThrowableError: Error?
private let sendVoiceMessageParamsAudioInfoWaveformCallsCountLock = NSLock()
private var sendVoiceMessageParamsAudioInfoWaveformUnderlyingCallsCount = 0
open var sendVoiceMessageParamsAudioInfoWaveformCallsCount: Int {
get { sendVoiceMessageParamsAudioInfoWaveformCallsCountLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingCallsCount } }
set { sendVoiceMessageParamsAudioInfoWaveformCallsCountLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingCallsCount = newValue } }
}
open var sendVoiceMessageParamsAudioInfoWaveformCalled: Bool {
return sendVoiceMessageParamsAudioInfoWaveformCallsCount > 0
}
private let sendVoiceMessageParamsAudioInfoWaveformReceivedArgumentsLock = NSLock()
private var sendVoiceMessageParamsAudioInfoWaveformUnderlyingReceivedArguments: (params: UploadParameters, audioInfo: AudioInfo, waveform: [Float])?
open var sendVoiceMessageParamsAudioInfoWaveformReceivedArguments: (params: UploadParameters, audioInfo: AudioInfo, waveform: [Float])? {
get { sendVoiceMessageParamsAudioInfoWaveformReceivedArgumentsLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingReceivedArguments } }
set { sendVoiceMessageParamsAudioInfoWaveformReceivedArgumentsLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingReceivedArguments = newValue } }
}
private let sendVoiceMessageParamsAudioInfoWaveformReceivedInvocationsLock = NSLock()
private var sendVoiceMessageParamsAudioInfoWaveformUnderlyingReceivedInvocations: [(params: UploadParameters, audioInfo: AudioInfo, waveform: [Float])] = []
open var sendVoiceMessageParamsAudioInfoWaveformReceivedInvocations: [(params: UploadParameters, audioInfo: AudioInfo, waveform: [Float])] {
get { sendVoiceMessageParamsAudioInfoWaveformReceivedInvocationsLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingReceivedInvocations } }
set { sendVoiceMessageParamsAudioInfoWaveformReceivedInvocationsLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingReceivedInvocations = newValue } }
}
private let sendVoiceMessageParamsAudioInfoWaveformReturnValueLock = NSLock()
open var sendVoiceMessageParamsAudioInfoWaveformUnderlyingReturnValue: SendAttachmentJoinHandle!
open var sendVoiceMessageParamsAudioInfoWaveformReturnValue: SendAttachmentJoinHandle! {
get { sendVoiceMessageParamsAudioInfoWaveformReturnValueLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingReturnValue } }
set { sendVoiceMessageParamsAudioInfoWaveformReturnValueLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingReturnValue = newValue } }
}
open var sendVoiceMessageParamsAudioInfoWaveformClosure: ((UploadParameters, AudioInfo, [Float]) throws -> SendAttachmentJoinHandle)?
open override func sendVoiceMessage(params: UploadParameters, audioInfo: AudioInfo, waveform: [Float]) throws -> SendAttachmentJoinHandle {
if let error = sendVoiceMessageParamsAudioInfoWaveformThrowableError {
throw error
}
sendVoiceMessageParamsAudioInfoWaveformCallsCountLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingCallsCount += 1 }
sendVoiceMessageParamsAudioInfoWaveformReceivedArguments = (params: params, audioInfo: audioInfo, waveform: waveform)
sendVoiceMessageParamsAudioInfoWaveformReceivedInvocationsLock.withLock { sendVoiceMessageParamsAudioInfoWaveformUnderlyingReceivedInvocations.append((params: params, audioInfo: audioInfo, waveform: waveform)) }
if let sendVoiceMessageParamsAudioInfoWaveformClosure = sendVoiceMessageParamsAudioInfoWaveformClosure {
return try sendVoiceMessageParamsAudioInfoWaveformClosure(params, audioInfo, waveform)
} else {
return sendVoiceMessageParamsAudioInfoWaveformReturnValue
}
}
//MARK: - sendWithExtraContent
open var sendWithExtraContentMsgExtraContentJsonThrowableError: Error?
private let sendWithExtraContentMsgExtraContentJsonCallsCountLock = NSLock()
private var sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount = 0
open var sendWithExtraContentMsgExtraContentJsonCallsCount: Int {
get { sendWithExtraContentMsgExtraContentJsonCallsCountLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount } }
set { sendWithExtraContentMsgExtraContentJsonCallsCountLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount = newValue } }
}
open var sendWithExtraContentMsgExtraContentJsonCalled: Bool {
return sendWithExtraContentMsgExtraContentJsonCallsCount > 0
}
private let sendWithExtraContentMsgExtraContentJsonReceivedArgumentsLock = NSLock()
private var sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)?
open var sendWithExtraContentMsgExtraContentJsonReceivedArguments: (msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)? {
get { sendWithExtraContentMsgExtraContentJsonReceivedArgumentsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedArguments } }
set { sendWithExtraContentMsgExtraContentJsonReceivedArgumentsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedArguments = newValue } }
}
private let sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock = NSLock()
private var sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)] = []
open var sendWithExtraContentMsgExtraContentJsonReceivedInvocations: [(msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?)] {
get { sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations } }
set { sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations = newValue } }
}
private let sendWithExtraContentMsgExtraContentJsonReturnValueLock = NSLock()
open var sendWithExtraContentMsgExtraContentJsonUnderlyingReturnValue: SendHandle!
open var sendWithExtraContentMsgExtraContentJsonReturnValue: SendHandle! {
get { sendWithExtraContentMsgExtraContentJsonReturnValueLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReturnValue } }
set { sendWithExtraContentMsgExtraContentJsonReturnValueLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReturnValue = newValue } }
}
open var sendWithExtraContentMsgExtraContentJsonClosure: ((RoomMessageEventContentWithoutRelation, String?) async throws -> SendHandle)?
open override func sendWithExtraContent(msg: RoomMessageEventContentWithoutRelation, extraContentJson: String?) async throws -> SendHandle {
if let error = sendWithExtraContentMsgExtraContentJsonThrowableError {
throw error
}
sendWithExtraContentMsgExtraContentJsonCallsCountLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingCallsCount += 1 }
sendWithExtraContentMsgExtraContentJsonReceivedArguments = (msg: msg, extraContentJson: extraContentJson)
sendWithExtraContentMsgExtraContentJsonReceivedInvocationsLock.withLock { sendWithExtraContentMsgExtraContentJsonUnderlyingReceivedInvocations.append((msg: msg, extraContentJson: extraContentJson)) }
if let sendWithExtraContentMsgExtraContentJsonClosure = sendWithExtraContentMsgExtraContentJsonClosure {
return try await sendWithExtraContentMsgExtraContentJsonClosure(msg, extraContentJson)
} else {
return sendWithExtraContentMsgExtraContentJsonReturnValue
}
}
//MARK: - subscribeToBackPaginationStatus
open var subscribeToBackPaginationStatusListenerThrowableError: Error?
private let subscribeToBackPaginationStatusListenerCallsCountLock = NSLock()
private var subscribeToBackPaginationStatusListenerUnderlyingCallsCount = 0
open var subscribeToBackPaginationStatusListenerCallsCount: Int {
get { subscribeToBackPaginationStatusListenerCallsCountLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingCallsCount } }
set { subscribeToBackPaginationStatusListenerCallsCountLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingCallsCount = newValue } }
}
open var subscribeToBackPaginationStatusListenerCalled: Bool {
return subscribeToBackPaginationStatusListenerCallsCount > 0
}
private let subscribeToBackPaginationStatusListenerReceivedListenerLock = NSLock()
private var subscribeToBackPaginationStatusListenerUnderlyingReceivedListener: PaginationStatusListener?
open var subscribeToBackPaginationStatusListenerReceivedListener: PaginationStatusListener? {
get { subscribeToBackPaginationStatusListenerReceivedListenerLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingReceivedListener } }
set { subscribeToBackPaginationStatusListenerReceivedListenerLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingReceivedListener = newValue } }
}
private let subscribeToBackPaginationStatusListenerReceivedInvocationsLock = NSLock()
private var subscribeToBackPaginationStatusListenerUnderlyingReceivedInvocations: [PaginationStatusListener] = []
open var subscribeToBackPaginationStatusListenerReceivedInvocations: [PaginationStatusListener] {
get { subscribeToBackPaginationStatusListenerReceivedInvocationsLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingReceivedInvocations } }
set { subscribeToBackPaginationStatusListenerReceivedInvocationsLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingReceivedInvocations = newValue } }
}
private let subscribeToBackPaginationStatusListenerReturnValueLock = NSLock()
open var subscribeToBackPaginationStatusListenerUnderlyingReturnValue: TaskHandle!
open var subscribeToBackPaginationStatusListenerReturnValue: TaskHandle! {
get { subscribeToBackPaginationStatusListenerReturnValueLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingReturnValue } }
set { subscribeToBackPaginationStatusListenerReturnValueLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingReturnValue = newValue } }
}
open var subscribeToBackPaginationStatusListenerClosure: ((PaginationStatusListener) async throws -> TaskHandle)?
open override func subscribeToBackPaginationStatus(listener: PaginationStatusListener) async throws -> TaskHandle {
if let error = subscribeToBackPaginationStatusListenerThrowableError {
throw error
}
subscribeToBackPaginationStatusListenerCallsCountLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingCallsCount += 1 }
subscribeToBackPaginationStatusListenerReceivedListener = listener
subscribeToBackPaginationStatusListenerReceivedInvocationsLock.withLock { subscribeToBackPaginationStatusListenerUnderlyingReceivedInvocations.append(listener) }
if let subscribeToBackPaginationStatusListenerClosure = subscribeToBackPaginationStatusListenerClosure {
return try await subscribeToBackPaginationStatusListenerClosure(listener)
} else {
return subscribeToBackPaginationStatusListenerReturnValue
}
}
//MARK: - toggleReaction
open var toggleReactionItemIdKeyThrowableError: Error?
private let toggleReactionItemIdKeyCallsCountLock = NSLock()
private var toggleReactionItemIdKeyUnderlyingCallsCount = 0
open var toggleReactionItemIdKeyCallsCount: Int {
get { toggleReactionItemIdKeyCallsCountLock.withLock { toggleReactionItemIdKeyUnderlyingCallsCount } }
set { toggleReactionItemIdKeyCallsCountLock.withLock { toggleReactionItemIdKeyUnderlyingCallsCount = newValue } }
}
open var toggleReactionItemIdKeyCalled: Bool {
return toggleReactionItemIdKeyCallsCount > 0
}
private let toggleReactionItemIdKeyReceivedArgumentsLock = NSLock()
private var toggleReactionItemIdKeyUnderlyingReceivedArguments: (itemId: EventOrTransactionId, key: String)?
open var toggleReactionItemIdKeyReceivedArguments: (itemId: EventOrTransactionId, key: String)? {
get { toggleReactionItemIdKeyReceivedArgumentsLock.withLock { toggleReactionItemIdKeyUnderlyingReceivedArguments } }
set { toggleReactionItemIdKeyReceivedArgumentsLock.withLock { toggleReactionItemIdKeyUnderlyingReceivedArguments = newValue } }
}
private let toggleReactionItemIdKeyReceivedInvocationsLock = NSLock()
private var toggleReactionItemIdKeyUnderlyingReceivedInvocations: [(itemId: EventOrTransactionId, key: String)] = []
open var toggleReactionItemIdKeyReceivedInvocations: [(itemId: EventOrTransactionId, key: String)] {
get { toggleReactionItemIdKeyReceivedInvocationsLock.withLock { toggleReactionItemIdKeyUnderlyingReceivedInvocations } }
set { toggleReactionItemIdKeyReceivedInvocationsLock.withLock { toggleReactionItemIdKeyUnderlyingReceivedInvocations = newValue } }
}
private let toggleReactionItemIdKeyReturnValueLock = NSLock()
open var toggleReactionItemIdKeyUnderlyingReturnValue: Bool!
open var toggleReactionItemIdKeyReturnValue: Bool! {
get { toggleReactionItemIdKeyReturnValueLock.withLock { toggleReactionItemIdKeyUnderlyingReturnValue } }
set { toggleReactionItemIdKeyReturnValueLock.withLock { toggleReactionItemIdKeyUnderlyingReturnValue = newValue } }
}
open var toggleReactionItemIdKeyClosure: ((EventOrTransactionId, String) async throws -> Bool)?
open override func toggleReaction(itemId: EventOrTransactionId, key: String) async throws -> Bool {
if let error = toggleReactionItemIdKeyThrowableError {
throw error
}
toggleReactionItemIdKeyCallsCountLock.withLock { toggleReactionItemIdKeyUnderlyingCallsCount += 1 }
toggleReactionItemIdKeyReceivedArguments = (itemId: itemId, key: key)
toggleReactionItemIdKeyReceivedInvocationsLock.withLock { toggleReactionItemIdKeyUnderlyingReceivedInvocations.append((itemId: itemId, key: key)) }
if let toggleReactionItemIdKeyClosure = toggleReactionItemIdKeyClosure {
return try await toggleReactionItemIdKeyClosure(itemId, key)
} else {
return toggleReactionItemIdKeyReturnValue
}
}
//MARK: - toggleReactionWithExtraContent
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonThrowableError: Error?
private let toggleReactionWithExtraContentItemIdKeyExtraContentJsonCallsCountLock = NSLock()
private var toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingCallsCount = 0
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonCallsCount: Int {
get { toggleReactionWithExtraContentItemIdKeyExtraContentJsonCallsCountLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingCallsCount } }
set { toggleReactionWithExtraContentItemIdKeyExtraContentJsonCallsCountLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingCallsCount = newValue } }
}
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonCalled: Bool {
return toggleReactionWithExtraContentItemIdKeyExtraContentJsonCallsCount > 0
}
private let toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedArgumentsLock = NSLock()
private var toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReceivedArguments: (itemId: EventOrTransactionId, key: String, extraContentJson: String?)?
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedArguments: (itemId: EventOrTransactionId, key: String, extraContentJson: String?)? {
get { toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedArgumentsLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReceivedArguments } }
set { toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedArgumentsLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReceivedArguments = newValue } }
}
private let toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedInvocationsLock = NSLock()
private var toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReceivedInvocations: [(itemId: EventOrTransactionId, key: String, extraContentJson: String?)] = []
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedInvocations: [(itemId: EventOrTransactionId, key: String, extraContentJson: String?)] {
get { toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedInvocationsLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReceivedInvocations } }
set { toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedInvocationsLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReceivedInvocations = newValue } }
}
private let toggleReactionWithExtraContentItemIdKeyExtraContentJsonReturnValueLock = NSLock()
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReturnValue: Bool!
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonReturnValue: Bool! {
get { toggleReactionWithExtraContentItemIdKeyExtraContentJsonReturnValueLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReturnValue } }
set { toggleReactionWithExtraContentItemIdKeyExtraContentJsonReturnValueLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReturnValue = newValue } }
}
open var toggleReactionWithExtraContentItemIdKeyExtraContentJsonClosure: ((EventOrTransactionId, String, String?) async throws -> Bool)?
open override func toggleReactionWithExtraContent(itemId: EventOrTransactionId, key: String, extraContentJson: String?) async throws -> Bool {
if let error = toggleReactionWithExtraContentItemIdKeyExtraContentJsonThrowableError {
throw error
}
toggleReactionWithExtraContentItemIdKeyExtraContentJsonCallsCountLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingCallsCount += 1 }
toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedArguments = (itemId: itemId, key: key, extraContentJson: extraContentJson)
toggleReactionWithExtraContentItemIdKeyExtraContentJsonReceivedInvocationsLock.withLock { toggleReactionWithExtraContentItemIdKeyExtraContentJsonUnderlyingReceivedInvocations.append((itemId: itemId, key: key, extraContentJson: extraContentJson)) }
if let toggleReactionWithExtraContentItemIdKeyExtraContentJsonClosure = toggleReactionWithExtraContentItemIdKeyExtraContentJsonClosure {
return try await toggleReactionWithExtraContentItemIdKeyExtraContentJsonClosure(itemId, key, extraContentJson)
} else {
return toggleReactionWithExtraContentItemIdKeyExtraContentJsonReturnValue
}
}
//MARK: - unpinEvent
open var unpinEventEventIdThrowableError: Error?
private let unpinEventEventIdCallsCountLock = NSLock()
private var unpinEventEventIdUnderlyingCallsCount = 0
open var unpinEventEventIdCallsCount: Int {
get { unpinEventEventIdCallsCountLock.withLock { unpinEventEventIdUnderlyingCallsCount } }
set { unpinEventEventIdCallsCountLock.withLock { unpinEventEventIdUnderlyingCallsCount = newValue } }
}
open var unpinEventEventIdCalled: Bool {
return unpinEventEventIdCallsCount > 0
}
private let unpinEventEventIdReceivedEventIdLock = NSLock()
private var unpinEventEventIdUnderlyingReceivedEventId: String?
open var unpinEventEventIdReceivedEventId: String? {
get { unpinEventEventIdReceivedEventIdLock.withLock { unpinEventEventIdUnderlyingReceivedEventId } }
set { unpinEventEventIdReceivedEventIdLock.withLock { unpinEventEventIdUnderlyingReceivedEventId = newValue } }
}
private let unpinEventEventIdReceivedInvocationsLock = NSLock()
private var unpinEventEventIdUnderlyingReceivedInvocations: [String] = []
open var unpinEventEventIdReceivedInvocations: [String] {
get { unpinEventEventIdReceivedInvocationsLock.withLock { unpinEventEventIdUnderlyingReceivedInvocations } }
set { unpinEventEventIdReceivedInvocationsLock.withLock { unpinEventEventIdUnderlyingReceivedInvocations = newValue } }
}
private let unpinEventEventIdReturnValueLock = NSLock()
open var unpinEventEventIdUnderlyingReturnValue: Bool!
open var unpinEventEventIdReturnValue: Bool! {
get { unpinEventEventIdReturnValueLock.withLock { unpinEventEventIdUnderlyingReturnValue } }
set { unpinEventEventIdReturnValueLock.withLock { unpinEventEventIdUnderlyingReturnValue = newValue } }
}
open var unpinEventEventIdClosure: ((String) async throws -> Bool)?
open override func unpinEvent(eventId: String) async throws -> Bool {
if let error = unpinEventEventIdThrowableError {
throw error
}
unpinEventEventIdCallsCountLock.withLock { unpinEventEventIdUnderlyingCallsCount += 1 }
unpinEventEventIdReceivedEventId = eventId
unpinEventEventIdReceivedInvocationsLock.withLock { unpinEventEventIdUnderlyingReceivedInvocations.append(eventId) }
if let unpinEventEventIdClosure = unpinEventEventIdClosure {
return try await unpinEventEventIdClosure(eventId)
} else {
return unpinEventEventIdReturnValue
}
}
//MARK: - sendGallery
open var sendGalleryParamsItemInfosThrowableError: Error?
private let sendGalleryParamsItemInfosCallsCountLock = NSLock()
private var sendGalleryParamsItemInfosUnderlyingCallsCount = 0
open var sendGalleryParamsItemInfosCallsCount: Int {
get { sendGalleryParamsItemInfosCallsCountLock.withLock { sendGalleryParamsItemInfosUnderlyingCallsCount } }
set { sendGalleryParamsItemInfosCallsCountLock.withLock { sendGalleryParamsItemInfosUnderlyingCallsCount = newValue } }
}
open var sendGalleryParamsItemInfosCalled: Bool {
return sendGalleryParamsItemInfosCallsCount > 0
}
private let sendGalleryParamsItemInfosReceivedArgumentsLock = NSLock()
private var sendGalleryParamsItemInfosUnderlyingReceivedArguments: (params: GalleryUploadParameters, itemInfos: [GalleryItemInfo])?
open var sendGalleryParamsItemInfosReceivedArguments: (params: GalleryUploadParameters, itemInfos: [GalleryItemInfo])? {
get { sendGalleryParamsItemInfosReceivedArgumentsLock.withLock { sendGalleryParamsItemInfosUnderlyingReceivedArguments } }
set { sendGalleryParamsItemInfosReceivedArgumentsLock.withLock { sendGalleryParamsItemInfosUnderlyingReceivedArguments = newValue } }
}
private let sendGalleryParamsItemInfosReceivedInvocationsLock = NSLock()
private var sendGalleryParamsItemInfosUnderlyingReceivedInvocations: [(params: GalleryUploadParameters, itemInfos: [GalleryItemInfo])] = []
open var sendGalleryParamsItemInfosReceivedInvocations: [(params: GalleryUploadParameters, itemInfos: [GalleryItemInfo])] {
get { sendGalleryParamsItemInfosReceivedInvocationsLock.withLock { sendGalleryParamsItemInfosUnderlyingReceivedInvocations } }
set { sendGalleryParamsItemInfosReceivedInvocationsLock.withLock { sendGalleryParamsItemInfosUnderlyingReceivedInvocations = newValue } }
}
private let sendGalleryParamsItemInfosReturnValueLock = NSLock()
open var sendGalleryParamsItemInfosUnderlyingReturnValue: SendGalleryJoinHandle!
open var sendGalleryParamsItemInfosReturnValue: SendGalleryJoinHandle! {
get { sendGalleryParamsItemInfosReturnValueLock.withLock { sendGalleryParamsItemInfosUnderlyingReturnValue } }
set { sendGalleryParamsItemInfosReturnValueLock.withLock { sendGalleryParamsItemInfosUnderlyingReturnValue = newValue } }
}
open var sendGalleryParamsItemInfosClosure: ((GalleryUploadParameters, [GalleryItemInfo]) throws -> SendGalleryJoinHandle)?
open override func sendGallery(params: GalleryUploadParameters, itemInfos: [GalleryItemInfo]) throws -> SendGalleryJoinHandle {
if let error = sendGalleryParamsItemInfosThrowableError {
throw error
}
sendGalleryParamsItemInfosCallsCountLock.withLock { sendGalleryParamsItemInfosUnderlyingCallsCount += 1 }
sendGalleryParamsItemInfosReceivedArguments = (params: params, itemInfos: itemInfos)
sendGalleryParamsItemInfosReceivedInvocationsLock.withLock { sendGalleryParamsItemInfosUnderlyingReceivedInvocations.append((params: params, itemInfos: itemInfos)) }
if let sendGalleryParamsItemInfosClosure = sendGalleryParamsItemInfosClosure {
return try sendGalleryParamsItemInfosClosure(params, itemInfos)
} else {
return sendGalleryParamsItemInfosReturnValue
}
}
}
open class TimelineEventSDKMock: MatrixRustSDK.TimelineEvent, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - content
open var contentThrowableError: Error?
private let contentCallsCountLock = NSLock()
private var contentUnderlyingCallsCount = 0
open var contentCallsCount: Int {
get { contentCallsCountLock.withLock { contentUnderlyingCallsCount } }
set { contentCallsCountLock.withLock { contentUnderlyingCallsCount = newValue } }
}
open var contentCalled: Bool {
return contentCallsCount > 0
}
private let contentReturnValueLock = NSLock()
open var contentUnderlyingReturnValue: TimelineEventContent!
open var contentReturnValue: TimelineEventContent! {
get { contentReturnValueLock.withLock { contentUnderlyingReturnValue } }
set { contentReturnValueLock.withLock { contentUnderlyingReturnValue = newValue } }
}
open var contentClosure: (() throws -> TimelineEventContent)?
open override func content() throws -> TimelineEventContent {
if let error = contentThrowableError {
throw error
}
contentCallsCountLock.withLock { contentUnderlyingCallsCount += 1 }
if let contentClosure = contentClosure {
return try contentClosure()
} else {
return contentReturnValue
}
}
//MARK: - eventId
private let eventIdCallsCountLock = NSLock()
private var eventIdUnderlyingCallsCount = 0
open var eventIdCallsCount: Int {
get { eventIdCallsCountLock.withLock { eventIdUnderlyingCallsCount } }
set { eventIdCallsCountLock.withLock { eventIdUnderlyingCallsCount = newValue } }
}
open var eventIdCalled: Bool {
return eventIdCallsCount > 0
}
private let eventIdReturnValueLock = NSLock()
open var eventIdUnderlyingReturnValue: String!
open var eventIdReturnValue: String! {
get { eventIdReturnValueLock.withLock { eventIdUnderlyingReturnValue } }
set { eventIdReturnValueLock.withLock { eventIdUnderlyingReturnValue = newValue } }
}
open var eventIdClosure: (() -> String)?
open override func eventId() -> String {
eventIdCallsCountLock.withLock { eventIdUnderlyingCallsCount += 1 }
if let eventIdClosure = eventIdClosure {
return eventIdClosure()
} else {
return eventIdReturnValue
}
}
//MARK: - senderId
private let senderIdCallsCountLock = NSLock()
private var senderIdUnderlyingCallsCount = 0
open var senderIdCallsCount: Int {
get { senderIdCallsCountLock.withLock { senderIdUnderlyingCallsCount } }
set { senderIdCallsCountLock.withLock { senderIdUnderlyingCallsCount = newValue } }
}
open var senderIdCalled: Bool {
return senderIdCallsCount > 0
}
private let senderIdReturnValueLock = NSLock()
open var senderIdUnderlyingReturnValue: String!
open var senderIdReturnValue: String! {
get { senderIdReturnValueLock.withLock { senderIdUnderlyingReturnValue } }
set { senderIdReturnValueLock.withLock { senderIdUnderlyingReturnValue = newValue } }
}
open var senderIdClosure: (() -> String)?
open override func senderId() -> String {
senderIdCallsCountLock.withLock { senderIdUnderlyingCallsCount += 1 }
if let senderIdClosure = senderIdClosure {
return senderIdClosure()
} else {
return senderIdReturnValue
}
}
//MARK: - threadRootEventId
private let threadRootEventIdCallsCountLock = NSLock()
private var threadRootEventIdUnderlyingCallsCount = 0
open var threadRootEventIdCallsCount: Int {
get { threadRootEventIdCallsCountLock.withLock { threadRootEventIdUnderlyingCallsCount } }
set { threadRootEventIdCallsCountLock.withLock { threadRootEventIdUnderlyingCallsCount = newValue } }
}
open var threadRootEventIdCalled: Bool {
return threadRootEventIdCallsCount > 0
}
private let threadRootEventIdReturnValueLock = NSLock()
open var threadRootEventIdUnderlyingReturnValue: String?
open var threadRootEventIdReturnValue: String? {
get { threadRootEventIdReturnValueLock.withLock { threadRootEventIdUnderlyingReturnValue } }
set { threadRootEventIdReturnValueLock.withLock { threadRootEventIdUnderlyingReturnValue = newValue } }
}
open var threadRootEventIdClosure: (() -> String?)?
open override func threadRootEventId() -> String? {
threadRootEventIdCallsCountLock.withLock { threadRootEventIdUnderlyingCallsCount += 1 }
if let threadRootEventIdClosure = threadRootEventIdClosure {
return threadRootEventIdClosure()
} else {
return threadRootEventIdReturnValue
}
}
//MARK: - timestamp
private let timestampCallsCountLock = NSLock()
private var timestampUnderlyingCallsCount = 0
open var timestampCallsCount: Int {
get { timestampCallsCountLock.withLock { timestampUnderlyingCallsCount } }
set { timestampCallsCountLock.withLock { timestampUnderlyingCallsCount = newValue } }
}
open var timestampCalled: Bool {
return timestampCallsCount > 0
}
private let timestampReturnValueLock = NSLock()
open var timestampUnderlyingReturnValue: Timestamp!
open var timestampReturnValue: Timestamp! {
get { timestampReturnValueLock.withLock { timestampUnderlyingReturnValue } }
set { timestampReturnValueLock.withLock { timestampUnderlyingReturnValue = newValue } }
}
open var timestampClosure: (() -> Timestamp)?
open override func timestamp() -> Timestamp {
timestampCallsCountLock.withLock { timestampUnderlyingCallsCount += 1 }
if let timestampClosure = timestampClosure {
return timestampClosure()
} else {
return timestampReturnValue
}
}
}
open class TimelineItemSDKMock: MatrixRustSDK.TimelineItem, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - asEvent
private let asEventCallsCountLock = NSLock()
private var asEventUnderlyingCallsCount = 0
open var asEventCallsCount: Int {
get { asEventCallsCountLock.withLock { asEventUnderlyingCallsCount } }
set { asEventCallsCountLock.withLock { asEventUnderlyingCallsCount = newValue } }
}
open var asEventCalled: Bool {
return asEventCallsCount > 0
}
private let asEventReturnValueLock = NSLock()
open var asEventUnderlyingReturnValue: EventTimelineItem?
open var asEventReturnValue: EventTimelineItem? {
get { asEventReturnValueLock.withLock { asEventUnderlyingReturnValue } }
set { asEventReturnValueLock.withLock { asEventUnderlyingReturnValue = newValue } }
}
open var asEventClosure: (() -> EventTimelineItem?)?
open override func asEvent() -> EventTimelineItem? {
asEventCallsCountLock.withLock { asEventUnderlyingCallsCount += 1 }
if let asEventClosure = asEventClosure {
return asEventClosure()
} else {
return asEventReturnValue
}
}
//MARK: - asVirtual
private let asVirtualCallsCountLock = NSLock()
private var asVirtualUnderlyingCallsCount = 0
open var asVirtualCallsCount: Int {
get { asVirtualCallsCountLock.withLock { asVirtualUnderlyingCallsCount } }
set { asVirtualCallsCountLock.withLock { asVirtualUnderlyingCallsCount = newValue } }
}
open var asVirtualCalled: Bool {
return asVirtualCallsCount > 0
}
private let asVirtualReturnValueLock = NSLock()
open var asVirtualUnderlyingReturnValue: VirtualTimelineItem?
open var asVirtualReturnValue: VirtualTimelineItem? {
get { asVirtualReturnValueLock.withLock { asVirtualUnderlyingReturnValue } }
set { asVirtualReturnValueLock.withLock { asVirtualUnderlyingReturnValue = newValue } }
}
open var asVirtualClosure: (() -> VirtualTimelineItem?)?
open override func asVirtual() -> VirtualTimelineItem? {
asVirtualCallsCountLock.withLock { asVirtualUnderlyingCallsCount += 1 }
if let asVirtualClosure = asVirtualClosure {
return asVirtualClosure()
} else {
return asVirtualReturnValue
}
}
//MARK: - fmtDebug
private let fmtDebugCallsCountLock = NSLock()
private var fmtDebugUnderlyingCallsCount = 0
open var fmtDebugCallsCount: Int {
get { fmtDebugCallsCountLock.withLock { fmtDebugUnderlyingCallsCount } }
set { fmtDebugCallsCountLock.withLock { fmtDebugUnderlyingCallsCount = newValue } }
}
open var fmtDebugCalled: Bool {
return fmtDebugCallsCount > 0
}
private let fmtDebugReturnValueLock = NSLock()
open var fmtDebugUnderlyingReturnValue: String!
open var fmtDebugReturnValue: String! {
get { fmtDebugReturnValueLock.withLock { fmtDebugUnderlyingReturnValue } }
set { fmtDebugReturnValueLock.withLock { fmtDebugUnderlyingReturnValue = newValue } }
}
open var fmtDebugClosure: (() -> String)?
open override func fmtDebug() -> String {
fmtDebugCallsCountLock.withLock { fmtDebugUnderlyingCallsCount += 1 }
if let fmtDebugClosure = fmtDebugClosure {
return fmtDebugClosure()
} else {
return fmtDebugReturnValue
}
}
//MARK: - uniqueId
private let uniqueIdCallsCountLock = NSLock()
private var uniqueIdUnderlyingCallsCount = 0
open var uniqueIdCallsCount: Int {
get { uniqueIdCallsCountLock.withLock { uniqueIdUnderlyingCallsCount } }
set { uniqueIdCallsCountLock.withLock { uniqueIdUnderlyingCallsCount = newValue } }
}
open var uniqueIdCalled: Bool {
return uniqueIdCallsCount > 0
}
private let uniqueIdReturnValueLock = NSLock()
open var uniqueIdUnderlyingReturnValue: TimelineUniqueId!
open var uniqueIdReturnValue: TimelineUniqueId! {
get { uniqueIdReturnValueLock.withLock { uniqueIdUnderlyingReturnValue } }
set { uniqueIdReturnValueLock.withLock { uniqueIdUnderlyingReturnValue = newValue } }
}
open var uniqueIdClosure: (() -> TimelineUniqueId)?
open override func uniqueId() -> TimelineUniqueId {
uniqueIdCallsCountLock.withLock { uniqueIdUnderlyingCallsCount += 1 }
if let uniqueIdClosure = uniqueIdClosure {
return uniqueIdClosure()
} else {
return uniqueIdReturnValue
}
}
}
open class UnreadNotificationsCountSDKMock: MatrixRustSDK.UnreadNotificationsCount, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - hasNotifications
private let hasNotificationsCallsCountLock = NSLock()
private var hasNotificationsUnderlyingCallsCount = 0
open var hasNotificationsCallsCount: Int {
get { hasNotificationsCallsCountLock.withLock { hasNotificationsUnderlyingCallsCount } }
set { hasNotificationsCallsCountLock.withLock { hasNotificationsUnderlyingCallsCount = newValue } }
}
open var hasNotificationsCalled: Bool {
return hasNotificationsCallsCount > 0
}
private let hasNotificationsReturnValueLock = NSLock()
open var hasNotificationsUnderlyingReturnValue: Bool!
open var hasNotificationsReturnValue: Bool! {
get { hasNotificationsReturnValueLock.withLock { hasNotificationsUnderlyingReturnValue } }
set { hasNotificationsReturnValueLock.withLock { hasNotificationsUnderlyingReturnValue = newValue } }
}
open var hasNotificationsClosure: (() -> Bool)?
open override func hasNotifications() -> Bool {
hasNotificationsCallsCountLock.withLock { hasNotificationsUnderlyingCallsCount += 1 }
if let hasNotificationsClosure = hasNotificationsClosure {
return hasNotificationsClosure()
} else {
return hasNotificationsReturnValue
}
}
//MARK: - highlightCount
private let highlightCountCallsCountLock = NSLock()
private var highlightCountUnderlyingCallsCount = 0
open var highlightCountCallsCount: Int {
get { highlightCountCallsCountLock.withLock { highlightCountUnderlyingCallsCount } }
set { highlightCountCallsCountLock.withLock { highlightCountUnderlyingCallsCount = newValue } }
}
open var highlightCountCalled: Bool {
return highlightCountCallsCount > 0
}
private let highlightCountReturnValueLock = NSLock()
open var highlightCountUnderlyingReturnValue: UInt32!
open var highlightCountReturnValue: UInt32! {
get { highlightCountReturnValueLock.withLock { highlightCountUnderlyingReturnValue } }
set { highlightCountReturnValueLock.withLock { highlightCountUnderlyingReturnValue = newValue } }
}
open var highlightCountClosure: (() -> UInt32)?
open override func highlightCount() -> UInt32 {
highlightCountCallsCountLock.withLock { highlightCountUnderlyingCallsCount += 1 }
if let highlightCountClosure = highlightCountClosure {
return highlightCountClosure()
} else {
return highlightCountReturnValue
}
}
//MARK: - notificationCount
private let notificationCountCallsCountLock = NSLock()
private var notificationCountUnderlyingCallsCount = 0
open var notificationCountCallsCount: Int {
get { notificationCountCallsCountLock.withLock { notificationCountUnderlyingCallsCount } }
set { notificationCountCallsCountLock.withLock { notificationCountUnderlyingCallsCount = newValue } }
}
open var notificationCountCalled: Bool {
return notificationCountCallsCount > 0
}
private let notificationCountReturnValueLock = NSLock()
open var notificationCountUnderlyingReturnValue: UInt32!
open var notificationCountReturnValue: UInt32! {
get { notificationCountReturnValueLock.withLock { notificationCountUnderlyingReturnValue } }
set { notificationCountReturnValueLock.withLock { notificationCountUnderlyingReturnValue = newValue } }
}
open var notificationCountClosure: (() -> UInt32)?
open override func notificationCount() -> UInt32 {
notificationCountCallsCountLock.withLock { notificationCountUnderlyingCallsCount += 1 }
if let notificationCountClosure = notificationCountClosure {
return notificationCountClosure()
} else {
return notificationCountReturnValue
}
}
}
open class UserIdentitySDKMock: MatrixRustSDK.UserIdentity, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - hasVerificationViolation
private let hasVerificationViolationCallsCountLock = NSLock()
private var hasVerificationViolationUnderlyingCallsCount = 0
open var hasVerificationViolationCallsCount: Int {
get { hasVerificationViolationCallsCountLock.withLock { hasVerificationViolationUnderlyingCallsCount } }
set { hasVerificationViolationCallsCountLock.withLock { hasVerificationViolationUnderlyingCallsCount = newValue } }
}
open var hasVerificationViolationCalled: Bool {
return hasVerificationViolationCallsCount > 0
}
private let hasVerificationViolationReturnValueLock = NSLock()
open var hasVerificationViolationUnderlyingReturnValue: Bool!
open var hasVerificationViolationReturnValue: Bool! {
get { hasVerificationViolationReturnValueLock.withLock { hasVerificationViolationUnderlyingReturnValue } }
set { hasVerificationViolationReturnValueLock.withLock { hasVerificationViolationUnderlyingReturnValue = newValue } }
}
open var hasVerificationViolationClosure: (() -> Bool)?
open override func hasVerificationViolation() -> Bool {
hasVerificationViolationCallsCountLock.withLock { hasVerificationViolationUnderlyingCallsCount += 1 }
if let hasVerificationViolationClosure = hasVerificationViolationClosure {
return hasVerificationViolationClosure()
} else {
return hasVerificationViolationReturnValue
}
}
//MARK: - isVerified
private let isVerifiedCallsCountLock = NSLock()
private var isVerifiedUnderlyingCallsCount = 0
open var isVerifiedCallsCount: Int {
get { isVerifiedCallsCountLock.withLock { isVerifiedUnderlyingCallsCount } }
set { isVerifiedCallsCountLock.withLock { isVerifiedUnderlyingCallsCount = newValue } }
}
open var isVerifiedCalled: Bool {
return isVerifiedCallsCount > 0
}
private let isVerifiedReturnValueLock = NSLock()
open var isVerifiedUnderlyingReturnValue: Bool!
open var isVerifiedReturnValue: Bool! {
get { isVerifiedReturnValueLock.withLock { isVerifiedUnderlyingReturnValue } }
set { isVerifiedReturnValueLock.withLock { isVerifiedUnderlyingReturnValue = newValue } }
}
open var isVerifiedClosure: (() -> Bool)?
open override func isVerified() -> Bool {
isVerifiedCallsCountLock.withLock { isVerifiedUnderlyingCallsCount += 1 }
if let isVerifiedClosure = isVerifiedClosure {
return isVerifiedClosure()
} else {
return isVerifiedReturnValue
}
}
//MARK: - masterKey
private let masterKeyCallsCountLock = NSLock()
private var masterKeyUnderlyingCallsCount = 0
open var masterKeyCallsCount: Int {
get { masterKeyCallsCountLock.withLock { masterKeyUnderlyingCallsCount } }
set { masterKeyCallsCountLock.withLock { masterKeyUnderlyingCallsCount = newValue } }
}
open var masterKeyCalled: Bool {
return masterKeyCallsCount > 0
}
private let masterKeyReturnValueLock = NSLock()
open var masterKeyUnderlyingReturnValue: String?
open var masterKeyReturnValue: String? {
get { masterKeyReturnValueLock.withLock { masterKeyUnderlyingReturnValue } }
set { masterKeyReturnValueLock.withLock { masterKeyUnderlyingReturnValue = newValue } }
}
open var masterKeyClosure: (() -> String?)?
open override func masterKey() -> String? {
masterKeyCallsCountLock.withLock { masterKeyUnderlyingCallsCount += 1 }
if let masterKeyClosure = masterKeyClosure {
return masterKeyClosure()
} else {
return masterKeyReturnValue
}
}
//MARK: - pin
open var pinThrowableError: Error?
private let pinCallsCountLock = NSLock()
private var pinUnderlyingCallsCount = 0
open var pinCallsCount: Int {
get { pinCallsCountLock.withLock { pinUnderlyingCallsCount } }
set { pinCallsCountLock.withLock { pinUnderlyingCallsCount = newValue } }
}
open var pinCalled: Bool {
return pinCallsCount > 0
}
open var pinClosure: (() async throws -> Void)?
open override func pin() async throws {
if let error = pinThrowableError {
throw error
}
pinCallsCountLock.withLock { pinUnderlyingCallsCount += 1 }
try await pinClosure?()
}
//MARK: - wasPreviouslyVerified
private let wasPreviouslyVerifiedCallsCountLock = NSLock()
private var wasPreviouslyVerifiedUnderlyingCallsCount = 0
open var wasPreviouslyVerifiedCallsCount: Int {
get { wasPreviouslyVerifiedCallsCountLock.withLock { wasPreviouslyVerifiedUnderlyingCallsCount } }
set { wasPreviouslyVerifiedCallsCountLock.withLock { wasPreviouslyVerifiedUnderlyingCallsCount = newValue } }
}
open var wasPreviouslyVerifiedCalled: Bool {
return wasPreviouslyVerifiedCallsCount > 0
}
private let wasPreviouslyVerifiedReturnValueLock = NSLock()
open var wasPreviouslyVerifiedUnderlyingReturnValue: Bool!
open var wasPreviouslyVerifiedReturnValue: Bool! {
get { wasPreviouslyVerifiedReturnValueLock.withLock { wasPreviouslyVerifiedUnderlyingReturnValue } }
set { wasPreviouslyVerifiedReturnValueLock.withLock { wasPreviouslyVerifiedUnderlyingReturnValue = newValue } }
}
open var wasPreviouslyVerifiedClosure: (() -> Bool)?
open override func wasPreviouslyVerified() -> Bool {
wasPreviouslyVerifiedCallsCountLock.withLock { wasPreviouslyVerifiedUnderlyingCallsCount += 1 }
if let wasPreviouslyVerifiedClosure = wasPreviouslyVerifiedClosure {
return wasPreviouslyVerifiedClosure()
} else {
return wasPreviouslyVerifiedReturnValue
}
}
//MARK: - withdrawVerification
open var withdrawVerificationThrowableError: Error?
private let withdrawVerificationCallsCountLock = NSLock()
private var withdrawVerificationUnderlyingCallsCount = 0
open var withdrawVerificationCallsCount: Int {
get { withdrawVerificationCallsCountLock.withLock { withdrawVerificationUnderlyingCallsCount } }
set { withdrawVerificationCallsCountLock.withLock { withdrawVerificationUnderlyingCallsCount = newValue } }
}
open var withdrawVerificationCalled: Bool {
return withdrawVerificationCallsCount > 0
}
open var withdrawVerificationClosure: (() async throws -> Void)?
open override func withdrawVerification() async throws {
if let error = withdrawVerificationThrowableError {
throw error
}
withdrawVerificationCallsCountLock.withLock { withdrawVerificationUnderlyingCallsCount += 1 }
try await withdrawVerificationClosure?()
}
}
open class WidgetDriverSDKMock: MatrixRustSDK.WidgetDriver, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - run
private let runRoomCapabilitiesProviderCallsCountLock = NSLock()
private var runRoomCapabilitiesProviderUnderlyingCallsCount = 0
open var runRoomCapabilitiesProviderCallsCount: Int {
get { runRoomCapabilitiesProviderCallsCountLock.withLock { runRoomCapabilitiesProviderUnderlyingCallsCount } }
set { runRoomCapabilitiesProviderCallsCountLock.withLock { runRoomCapabilitiesProviderUnderlyingCallsCount = newValue } }
}
open var runRoomCapabilitiesProviderCalled: Bool {
return runRoomCapabilitiesProviderCallsCount > 0
}
private let runRoomCapabilitiesProviderReceivedArgumentsLock = NSLock()
private var runRoomCapabilitiesProviderUnderlyingReceivedArguments: (room: Room, capabilitiesProvider: WidgetCapabilitiesProvider)?
open var runRoomCapabilitiesProviderReceivedArguments: (room: Room, capabilitiesProvider: WidgetCapabilitiesProvider)? {
get { runRoomCapabilitiesProviderReceivedArgumentsLock.withLock { runRoomCapabilitiesProviderUnderlyingReceivedArguments } }
set { runRoomCapabilitiesProviderReceivedArgumentsLock.withLock { runRoomCapabilitiesProviderUnderlyingReceivedArguments = newValue } }
}
private let runRoomCapabilitiesProviderReceivedInvocationsLock = NSLock()
private var runRoomCapabilitiesProviderUnderlyingReceivedInvocations: [(room: Room, capabilitiesProvider: WidgetCapabilitiesProvider)] = []
open var runRoomCapabilitiesProviderReceivedInvocations: [(room: Room, capabilitiesProvider: WidgetCapabilitiesProvider)] {
get { runRoomCapabilitiesProviderReceivedInvocationsLock.withLock { runRoomCapabilitiesProviderUnderlyingReceivedInvocations } }
set { runRoomCapabilitiesProviderReceivedInvocationsLock.withLock { runRoomCapabilitiesProviderUnderlyingReceivedInvocations = newValue } }
}
open var runRoomCapabilitiesProviderClosure: ((Room, WidgetCapabilitiesProvider) async -> Void)?
open override func run(room: Room, capabilitiesProvider: WidgetCapabilitiesProvider) async {
runRoomCapabilitiesProviderCallsCountLock.withLock { runRoomCapabilitiesProviderUnderlyingCallsCount += 1 }
runRoomCapabilitiesProviderReceivedArguments = (room: room, capabilitiesProvider: capabilitiesProvider)
runRoomCapabilitiesProviderReceivedInvocationsLock.withLock { runRoomCapabilitiesProviderUnderlyingReceivedInvocations.append((room: room, capabilitiesProvider: capabilitiesProvider)) }
await runRoomCapabilitiesProviderClosure?(room, capabilitiesProvider)
}
}
open class WidgetDriverHandleSDKMock: MatrixRustSDK.WidgetDriverHandle, @unchecked Sendable {
public init() {
super.init(noHandle: .init())
}
public required init(unsafeFromHandle handle: UInt64) {
fatalError("init(unsafeFromHandle:) has not been implemented")
}
fileprivate var handle: UInt64 {
get { return underlyingHandle }
set(value) { underlyingHandle = value }
}
fileprivate var underlyingHandle: UInt64!
//MARK: - recv
private let recvCallsCountLock = NSLock()
private var recvUnderlyingCallsCount = 0
open var recvCallsCount: Int {
get { recvCallsCountLock.withLock { recvUnderlyingCallsCount } }
set { recvCallsCountLock.withLock { recvUnderlyingCallsCount = newValue } }
}
open var recvCalled: Bool {
return recvCallsCount > 0
}
private let recvReturnValueLock = NSLock()
open var recvUnderlyingReturnValue: String?
open var recvReturnValue: String? {
get { recvReturnValueLock.withLock { recvUnderlyingReturnValue } }
set { recvReturnValueLock.withLock { recvUnderlyingReturnValue = newValue } }
}
open var recvClosure: (() async -> String?)?
open override func recv() async -> String? {
recvCallsCountLock.withLock { recvUnderlyingCallsCount += 1 }
if let recvClosure = recvClosure {
return await recvClosure()
} else {
return recvReturnValue
}
}
//MARK: - send
private let sendMsgCallsCountLock = NSLock()
private var sendMsgUnderlyingCallsCount = 0
open var sendMsgCallsCount: Int {
get { sendMsgCallsCountLock.withLock { sendMsgUnderlyingCallsCount } }
set { sendMsgCallsCountLock.withLock { sendMsgUnderlyingCallsCount = newValue } }
}
open var sendMsgCalled: Bool {
return sendMsgCallsCount > 0
}
private let sendMsgReceivedMsgLock = NSLock()
private var sendMsgUnderlyingReceivedMsg: String?
open var sendMsgReceivedMsg: String? {
get { sendMsgReceivedMsgLock.withLock { sendMsgUnderlyingReceivedMsg } }
set { sendMsgReceivedMsgLock.withLock { sendMsgUnderlyingReceivedMsg = newValue } }
}
private let sendMsgReceivedInvocationsLock = NSLock()
private var sendMsgUnderlyingReceivedInvocations: [String] = []
open var sendMsgReceivedInvocations: [String] {
get { sendMsgReceivedInvocationsLock.withLock { sendMsgUnderlyingReceivedInvocations } }
set { sendMsgReceivedInvocationsLock.withLock { sendMsgUnderlyingReceivedInvocations = newValue } }
}
private let sendMsgReturnValueLock = NSLock()
open var sendMsgUnderlyingReturnValue: Bool!
open var sendMsgReturnValue: Bool! {
get { sendMsgReturnValueLock.withLock { sendMsgUnderlyingReturnValue } }
set { sendMsgReturnValueLock.withLock { sendMsgUnderlyingReturnValue = newValue } }
}
open var sendMsgClosure: ((String) async -> Bool)?
open override func send(msg: String) async -> Bool {
sendMsgCallsCountLock.withLock { sendMsgUnderlyingCallsCount += 1 }
sendMsgReceivedMsg = msg
sendMsgReceivedInvocationsLock.withLock { sendMsgUnderlyingReceivedInvocations.append(msg) }
if let sendMsgClosure = sendMsgClosure {
return await sendMsgClosure(msg)
} else {
return sendMsgReturnValue
}
}
}
// swiftlint:enable all