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

import Foundation

class PasswordsChangeMessage: ChannelInMessage {
	// MARK: Properties

	let oldPassword: String
	let newPassword: String

	// MARK: Decodable

	enum CodingKeys: String, CodingKey {
		case oldPassword
		case newPassword
	}

	required init(from decoder: Decoder) throws {
		let container = try decoder.container(keyedBy: CodingKeys.self)
		self.oldPassword = try container.decode([String].self, forKey: .oldPassword).joined()
		self.newPassword = try container.decode([String].self, forKey: .newPassword).joined()
		try super.init(from: decoder)
	}
}
