-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItemSettingsDefaults.cs
More file actions
64 lines (56 loc) · 2.26 KB
/
ItemSettingsDefaults.cs
File metadata and controls
64 lines (56 loc) · 2.26 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
// -------------------------------------------------------------------------
// Copyright (c) Mecalc (Pty) Limited. All rights reserved.
// -------------------------------------------------------------------------
using QProtocol.JsonProperties;
using System;
using System.Collections.Generic;
namespace QProtocol
{
/// <summary>
/// This class can be used with the /item/settings/defaults/ endpoint to deserialize the response received.
/// </summary>
[Serializable]
public class ItemSettingsDefaults : ItemInfo
{
/// <summary>
/// Gets or sets an array of additional information for this node.
/// </summary>
public List<Info> Info { get; set; }
/// <summary>
/// Gets or sets an string representing the current mode of operation.
/// </summary>
public SupportedValue OperationMode { get; set; }
/// <summary>
/// Gets or sets the item settings for the internal cache.
/// </summary>
public List<Setting> Settings { get; set; }
/// <summary>
/// Gets or sets a value controlling the data states.
/// </summary>
public List<Setting> Data { get; set; }
/// <summary>
/// Creates a new instance of the <see cref="ItemSettings"/> class.
/// </summary>
public ItemSettingsDefaults()
: base()
{
}
/// <summary>
/// Creates a new instance of the <see cref="ItemSettings"/> class.
/// </summary>
/// <param name="itemInfo">An instance of the item information which will be copied to this instance.</param>
public ItemSettingsDefaults(ItemInfo baseInfo)
: base(baseInfo.ItemId, baseInfo.ItemName, baseInfo.ItemTypeIdentifier, baseInfo.ItemType, baseInfo.ItemTypeIdentifier)
{
}
/// <summary>
/// This class can be used to convert the deserialized <see cref="Settings"/> property to a QProtocol defined Settings class.
/// </summary>
/// <typeparam name="T">Type of the QProtocol defined setting class</typeparam>
/// <returns>Instance of the QProtocol defined setting class</returns>
public T GetSettings<T>()
{
return Setting.ConvertTo<T>(Settings);
}
}
}