/* Options: Date: 2025-07-17 23:43:09 SwiftVersion: 5.0 Version: 6.40 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://hcbtas-q-albamfs-api.azurewebsites.net //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: ValidateNemIdRequestModel.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/nemidvalidatelogin", "GET") public class ValidateNemIdRequestModel : IReturn, Codable { public typealias Return = NemIDFlowResult required public init(){} } public class NemIDFlowResult : FlowResult { public var authenticationInfo:AuthenticationInfo? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case authenticationInfo } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) authenticationInfo = try container.decodeIfPresent(AuthenticationInfo.self, forKey: .authenticationInfo) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if authenticationInfo != nil { try container.encode(authenticationInfo, forKey: .authenticationInfo) } } } public class AuthenticationInfo : Codable { public var pid:String? public var dn:String? public var commonName:String? public var rid:String? public var cpr:String? public var cvr:String? public var company:String? public var email:String? public var signedXml:String? public var issuerDn:String? public var isYouthCert:Bool? public var certificateType:CertificateType? public var subjectSerialNumber:String? public var signProperties:IList? public var rememberUserIdToken:String? public var logonType:LogonType? public var certificateSerialNumber:String? public var clientCertificate:[UInt8] = [] public var authorizedToRepresent:String? required public init(){} } public enum ClientFlow : String, Codable { case NemID case NemIDSignature case NemIDKeyFile case NemIDKeyFileSignature case NL3Signature case Invalid case LoadTest } public enum FlowStatus : String, Codable { case Ok case UserCancel case ClientFlowError case FlowError case ValidationError } public class FlowResult : FlowMessage { public var clientFlow:ClientFlow? public var status:FlowStatus? public var isSuccess:Bool? public var message:String? public var userMessage:String? public var flowErrorCode:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case clientFlow case status case isSuccess case message case userMessage case flowErrorCode } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) clientFlow = try container.decodeIfPresent(ClientFlow.self, forKey: .clientFlow) status = try container.decodeIfPresent(FlowStatus.self, forKey: .status) isSuccess = try container.decodeIfPresent(Bool.self, forKey: .isSuccess) message = try container.decodeIfPresent(String.self, forKey: .message) userMessage = try container.decodeIfPresent(String.self, forKey: .userMessage) flowErrorCode = try container.decodeIfPresent(String.self, forKey: .flowErrorCode) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if clientFlow != nil { try container.encode(clientFlow, forKey: .clientFlow) } if status != nil { try container.encode(status, forKey: .status) } if isSuccess != nil { try container.encode(isSuccess, forKey: .isSuccess) } if message != nil { try container.encode(message, forKey: .message) } if userMessage != nil { try container.encode(userMessage, forKey: .userMessage) } if flowErrorCode != nil { try container.encode(flowErrorCode, forKey: .flowErrorCode) } } } public enum CertificateType : String, Codable { case Poces case Moces case Voces case Foces } public class SignProperty : Codable { public var name:String? public var value:String? required public init(){} } public enum LogonType : String, Codable { case Otp case KeyFile case Unknown } public class FlowMessage : Body { public var timestamp:String? public var transactionIdentifier:String? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case timestamp case transactionIdentifier } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) timestamp = try container.decodeIfPresent(String.self, forKey: .timestamp) transactionIdentifier = try container.decodeIfPresent(String.self, forKey: .transactionIdentifier) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if timestamp != nil { try container.encode(timestamp, forKey: .timestamp) } if transactionIdentifier != nil { try container.encode(transactionIdentifier, forKey: .transactionIdentifier) } } } public class Body : Codable { required public init(){} }