@@ -7,35 +7,82 @@ import Foundation
77
88public class PCUserUserPINRequest : APIModel {
99
10- /** 4-digit code */
11- public var pin : String ?
10+ public enum PCUserType : String , Codable , Equatable , CaseIterable {
11+ case pin = " pin "
12+ }
13+
14+ public var attributes : Attributes ?
15+
16+ public var id : String ?
17+
18+ public var type : PCUserType ?
19+
20+ public class Attributes : APIModel {
21+
22+ /** 4-digit code */
23+ public var pin : String
24+
25+ /** user otp */
26+ public var otp : String
1227
13- /** allows skipping credential verification */
14- public var skip : Bool ?
28+ public init ( pin: String , otp: String ) {
29+ self . pin = pin
30+ self . otp = otp
31+ }
32+
33+ public required init ( from decoder: Decoder ) throws {
34+ let container = try decoder. container ( keyedBy: StringCodingKey . self)
35+
36+ pin = try container. decode ( " pin " )
37+ otp = try container. decode ( " otp " )
38+ }
39+
40+ public func encode( to encoder: Encoder ) throws {
41+ var container = encoder. container ( keyedBy: StringCodingKey . self)
42+
43+ try container. encode ( pin, forKey: " pin " )
44+ try container. encode ( otp, forKey: " otp " )
45+ }
46+
47+ public func isEqual( to object: Any ? ) -> Bool {
48+ guard let object = object as? Attributes else { return false }
49+ guard self . pin == object. pin else { return false }
50+ guard self . otp == object. otp else { return false }
51+ return true
52+ }
53+
54+ public static func == ( lhs: Attributes , rhs: Attributes ) -> Bool {
55+ return lhs. isEqual ( to: rhs)
56+ }
57+ }
1558
16- public init ( pin: String ? = nil , skip: Bool ? = nil ) {
17- self . pin = pin
18- self . skip = skip
59+ public init ( attributes: Attributes ? = nil , id: String ? = nil , type: PCUserType ? = nil ) {
60+ self . attributes = attributes
61+ self . id = id
62+ self . type = type
1963 }
2064
2165 public required init ( from decoder: Decoder ) throws {
2266 let container = try decoder. container ( keyedBy: StringCodingKey . self)
2367
24- pin = try container. decodeIfPresent ( " pin " )
25- skip = try container. decodeIfPresent ( " skip " )
68+ attributes = try container. decodeIfPresent ( " attributes " )
69+ id = try container. decodeIfPresent ( " id " )
70+ type = try container. decodeIfPresent ( " type " )
2671 }
2772
2873 public func encode( to encoder: Encoder ) throws {
2974 var container = encoder. container ( keyedBy: StringCodingKey . self)
3075
31- try container. encodeIfPresent ( pin, forKey: " pin " )
32- try container. encodeIfPresent ( skip, forKey: " skip " )
76+ try container. encodeIfPresent ( attributes, forKey: " attributes " )
77+ try container. encodeIfPresent ( id, forKey: " id " )
78+ try container. encodeIfPresent ( type, forKey: " type " )
3379 }
3480
3581 public func isEqual( to object: Any ? ) -> Bool {
3682 guard let object = object as? PCUserUserPINRequest else { return false }
37- guard self . pin == object. pin else { return false }
38- guard self . skip == object. skip else { return false }
83+ guard self . attributes == object. attributes else { return false }
84+ guard self . id == object. id else { return false }
85+ guard self . type == object. type else { return false }
3986 return true
4087 }
4188
0 commit comments