-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathAttributeList.cs
More file actions
39 lines (33 loc) · 1023 Bytes
/
AttributeList.cs
File metadata and controls
39 lines (33 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using Appwrite.Enums;
using Appwrite.Extensions;
namespace Appwrite.Models
{
public class AttributeList
{
[JsonPropertyName("total")]
public long Total { get; private set; }
[JsonPropertyName("attributes")]
public List<object> Attributes { get; private set; }
public AttributeList(
long total,
List<object> attributes
) {
Total = total;
Attributes = attributes;
}
public static AttributeList From(Dictionary<string, object> map) => new AttributeList(
total: Convert.ToInt64(map["total"]),
attributes: map["attributes"].ConvertToList<object>()
);
public Dictionary<string, object?> ToMap() => new Dictionary<string, object?>()
{
{ "total", Total },
{ "attributes", Attributes }
};
}
}