form rules
This commit is contained in:
parent
9b94128595
commit
d556d4b14a
@ -27,6 +27,7 @@ import Foundation
|
||||
case template
|
||||
case screenHeading
|
||||
case isAtomicTabs
|
||||
case formRules
|
||||
}
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
@ -34,6 +35,7 @@ import Foundation
|
||||
pageType = try typeContainer.decode(String.self, forKey: .pageType)
|
||||
screenHeading = try typeContainer.decodeIfPresent(String.self, forKey: .screenHeading)
|
||||
isAtomicTabs = try typeContainer.decodeIfPresent(Bool.self, forKey: .isAtomicTabs)
|
||||
formRules = try typeContainer.decodeIfPresent([FormGroupRule].self, forKey: .formRules)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
@ -42,5 +44,6 @@ import Foundation
|
||||
try container.encode(template, forKey: .template)
|
||||
try container.encodeIfPresent(screenHeading, forKey: .screenHeading)
|
||||
try container.encodeIfPresent(isAtomicTabs, forKey: .isAtomicTabs)
|
||||
try container.encodeIfPresent(formRules, forKey: .formRules)
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ import Foundation
|
||||
case footer
|
||||
case middle
|
||||
case isAtomicTabs
|
||||
case formRules
|
||||
}
|
||||
|
||||
required public init(from decoder: Decoder) throws {
|
||||
@ -48,6 +49,7 @@ import Foundation
|
||||
header = try typeContainer.decodeModelIfPresent(codingKey: .header)
|
||||
middle = try typeContainer.decodeModelIfPresent(codingKey: .middle)
|
||||
footer = try typeContainer.decodeModelIfPresent(codingKey: .footer)
|
||||
formRules = try typeContainer.decodeIfPresent([FormGroupRule].self, forKey: .formRules)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
@ -59,5 +61,6 @@ import Foundation
|
||||
try container.encodeModelIfPresent(header, forKey: .header)
|
||||
try container.encodeModelIfPresent(header, forKey: .middle)
|
||||
try container.encodeModelIfPresent(footer, forKey: .footer)
|
||||
try container.encodeIfPresent(formRules, forKey: .formRules)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user