//
// Copyright © 2024 Nevis Security AG. All rights reserved.
//

import NevisMobileAuthentication

struct DeviceInformationSyncMethodHandler: MethodHandler {
	func execute(using client: MobileAuthenticationClient, method: ReactMethod, with message: ChannelInMessage) async {
		let message: DeviceInformationSyncMessage = validate(message: message)
		let operation = DeviceInformationSyncOperation(operationId: message.operationId, method: method)
		await OperationCache.shared.put(operation, using: message.operationId)

		client.operations.deviceInformationSync
			.configure(by: message, operation: operation)
			.execute()
	}
}
