-
Notifications
You must be signed in to change notification settings - Fork 450
/
ListMemberDevicesResult.cs
158 lines (137 loc) · 6.38 KB
/
ListMemberDevicesResult.cs
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// <auto-generated>
// Auto-generated by StoneAPI, do not modify.
// </auto-generated>
namespace Dropbox.Api.Team
{
using sys = System;
using col = System.Collections.Generic;
using re = System.Text.RegularExpressions;
using enc = Dropbox.Api.Stone;
/// <summary>
/// <para>The list member devices result object</para>
/// </summary>
public class ListMemberDevicesResult
{
#pragma warning disable 108
/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<ListMemberDevicesResult> Encoder = new ListMemberDevicesResultEncoder();
/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<ListMemberDevicesResult> Decoder = new ListMemberDevicesResultDecoder();
/// <summary>
/// <para>Initializes a new instance of the <see cref="ListMemberDevicesResult" />
/// class.</para>
/// </summary>
/// <param name="activeWebSessions">List of web sessions made by this team
/// member.</param>
/// <param name="desktopClientSessions">List of desktop clients used by this team
/// member.</param>
/// <param name="mobileClientSessions">List of mobile client used by this team
/// member.</param>
public ListMemberDevicesResult(col.IEnumerable<ActiveWebSession> activeWebSessions = null,
col.IEnumerable<DesktopClientSession> desktopClientSessions = null,
col.IEnumerable<MobileClientSession> mobileClientSessions = null)
{
var activeWebSessionsList = enc.Util.ToList(activeWebSessions);
var desktopClientSessionsList = enc.Util.ToList(desktopClientSessions);
var mobileClientSessionsList = enc.Util.ToList(mobileClientSessions);
this.ActiveWebSessions = activeWebSessionsList;
this.DesktopClientSessions = desktopClientSessionsList;
this.MobileClientSessions = mobileClientSessionsList;
}
/// <summary>
/// <para>Initializes a new instance of the <see cref="ListMemberDevicesResult" />
/// class.</para>
/// </summary>
/// <remarks>This is to construct an instance of the object when
/// deserializing.</remarks>
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
public ListMemberDevicesResult()
{
}
/// <summary>
/// <para>List of web sessions made by this team member.</para>
/// </summary>
public col.IList<ActiveWebSession> ActiveWebSessions { get; protected set; }
/// <summary>
/// <para>List of desktop clients used by this team member.</para>
/// </summary>
public col.IList<DesktopClientSession> DesktopClientSessions { get; protected set; }
/// <summary>
/// <para>List of mobile client used by this team member.</para>
/// </summary>
public col.IList<MobileClientSession> MobileClientSessions { get; protected set; }
#region Encoder class
/// <summary>
/// <para>Encoder for <see cref="ListMemberDevicesResult" />.</para>
/// </summary>
private class ListMemberDevicesResultEncoder : enc.StructEncoder<ListMemberDevicesResult>
{
/// <summary>
/// <para>Encode fields of given value.</para>
/// </summary>
/// <param name="value">The value.</param>
/// <param name="writer">The writer.</param>
public override void EncodeFields(ListMemberDevicesResult value, enc.IJsonWriter writer)
{
if (value.ActiveWebSessions.Count > 0)
{
WriteListProperty("active_web_sessions", value.ActiveWebSessions, writer, global::Dropbox.Api.Team.ActiveWebSession.Encoder);
}
if (value.DesktopClientSessions.Count > 0)
{
WriteListProperty("desktop_client_sessions", value.DesktopClientSessions, writer, global::Dropbox.Api.Team.DesktopClientSession.Encoder);
}
if (value.MobileClientSessions.Count > 0)
{
WriteListProperty("mobile_client_sessions", value.MobileClientSessions, writer, global::Dropbox.Api.Team.MobileClientSession.Encoder);
}
}
}
#endregion
#region Decoder class
/// <summary>
/// <para>Decoder for <see cref="ListMemberDevicesResult" />.</para>
/// </summary>
private class ListMemberDevicesResultDecoder : enc.StructDecoder<ListMemberDevicesResult>
{
/// <summary>
/// <para>Create a new instance of type <see cref="ListMemberDevicesResult"
/// />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override ListMemberDevicesResult Create()
{
return new ListMemberDevicesResult();
}
/// <summary>
/// <para>Set given field.</para>
/// </summary>
/// <param name="value">The field value.</param>
/// <param name="fieldName">The field name.</param>
/// <param name="reader">The json reader.</param>
protected override void SetField(ListMemberDevicesResult value, string fieldName, enc.IJsonReader reader)
{
switch (fieldName)
{
case "active_web_sessions":
value.ActiveWebSessions = ReadList<ActiveWebSession>(reader, global::Dropbox.Api.Team.ActiveWebSession.Decoder);
break;
case "desktop_client_sessions":
value.DesktopClientSessions = ReadList<DesktopClientSession>(reader, global::Dropbox.Api.Team.DesktopClientSession.Decoder);
break;
case "mobile_client_sessions":
value.MobileClientSessions = ReadList<MobileClientSession>(reader, global::Dropbox.Api.Team.MobileClientSession.Decoder);
break;
default:
reader.Skip();
break;
}
}
}
#endregion
}
}