Files
sdk-for-swift/Sources/AppwriteModels/AttributeList.swift
T
2021-12-17 17:30:20 +05:45

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
]
}
}