mirror of
https://github.com/appwrite/sdk-for-swift.git
synced 2026-04-07 19:17:48 +00:00
33 lines
675 B
Swift
33 lines
675 B
Swift
|
|
/// Attributes List
|
|
public class AttributeList {
|
|
|
|
/// Total sum of items in the list.
|
|
public let sum: Int
|
|
|
|
/// List of attributes.
|
|
public let attributes: [Any]
|
|
|
|
init(
|
|
sum: Int,
|
|
attributes: [Any]
|
|
) {
|
|
self.sum = sum
|
|
self.attributes = attributes
|
|
}
|
|
|
|
public static func from(map: [String: Any]) -> AttributeList {
|
|
return AttributeList(
|
|
sum: map["sum"] as! Int,
|
|
attributes: map["attributes"] as! [Any]
|
|
)
|
|
}
|
|
|
|
public func toMap() -> [String: Any] {
|
|
return [
|
|
"sum": sum as Any,
|
|
"attributes": attributes as Any
|
|
]
|
|
}
|
|
|
|
} |