-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTermModel.cs
More file actions
83 lines (64 loc) · 2.56 KB
/
Copy pathTermModel.cs
File metadata and controls
83 lines (64 loc) · 2.56 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Contentstack.Management.Core.Models
{
/// <summary>
/// Model for Term create/update and API response.
/// </summary>
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class TermModel
{
[JsonProperty(propertyName: "uid")]
public string Uid { get; set; }
[JsonProperty(propertyName: "name")]
public string Name { get; set; }
[JsonProperty(propertyName: "taxonomy_uid")]
public string TaxonomyUid { get; set; }
[JsonProperty(propertyName: "parent_uid")]
public string ParentUid { get; set; }
[JsonProperty(propertyName: "depth")]
public int? Depth { get; set; }
[JsonProperty(propertyName: "children_count")]
public int? ChildrenCount { get; set; }
[JsonProperty(propertyName: "referenced_entries_count")]
public int? ReferencedEntriesCount { get; set; }
[JsonProperty(propertyName: "ancestors")]
public List<TermAncestorDescendant> Ancestors { get; set; }
[JsonProperty(propertyName: "descendants")]
public List<TermAncestorDescendant> Descendants { get; set; }
[JsonProperty(propertyName: "created_at")]
public string CreatedAt { get; set; }
[JsonProperty(propertyName: "updated_at")]
public string UpdatedAt { get; set; }
}
/// <summary>
/// Represents an ancestor or descendant term in hierarchy.
/// </summary>
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class TermAncestorDescendant
{
[JsonProperty(propertyName: "uid")]
public string Uid { get; set; }
[JsonProperty(propertyName: "name")]
public string Name { get; set; }
[JsonProperty(propertyName: "parent_uid")]
public string ParentUid { get; set; }
[JsonProperty(propertyName: "depth")]
public int? Depth { get; set; }
[JsonProperty(propertyName: "children_count")]
public int? ChildrenCount { get; set; }
[JsonProperty(propertyName: "referenced_entries_count")]
public int? ReferencedEntriesCount { get; set; }
}
/// <summary>
/// Model for Term move operation (parent_uid, order).
/// </summary>
[JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)]
public class TermMoveModel
{
[JsonProperty(propertyName: "parent_uid")]
public string ParentUid { get; set; }
[JsonProperty(propertyName: "order")]
public int? Order { get; set; }
}
}