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

import NevisMobileAuthentication

struct TypedDeviceInformationSyncResult: Encodable {
	// MARK: Properties

	let wrapped: DeviceInformationSyncResult

	// MARK: Initialization

	init(wrapped: DeviceInformationSyncResult) {
		self.wrapped = wrapped
	}

	// MARK: Coding Keys

	enum CodingKeys: String, CodingKey {
		case errors
	}

	// MARK: Encodable

	func encode(to encoder: Encoder) throws {
		var container = encoder.container(keyedBy: CodingKeys.self)
		let errors = wrapped.errors.map { $0.asChannelError() }
		try container.encode(errors, forKey: .errors)
	}
}
