-
Notifications
You must be signed in to change notification settings - Fork 450
/
GetTeamEventsResult.cs
180 lines (159 loc) · 7.4 KB
/
GetTeamEventsResult.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// <auto-generated>
// Auto-generated by StoneAPI, do not modify.
// </auto-generated>
namespace Dropbox.Api.TeamLog
{
using sys = System;
using col = System.Collections.Generic;
using re = System.Text.RegularExpressions;
using enc = Dropbox.Api.Stone;
/// <summary>
/// <para>The get team events result object</para>
/// </summary>
public class GetTeamEventsResult
{
#pragma warning disable 108
/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<GetTeamEventsResult> Encoder = new GetTeamEventsResultEncoder();
/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<GetTeamEventsResult> Decoder = new GetTeamEventsResultDecoder();
/// <summary>
/// <para>Initializes a new instance of the <see cref="GetTeamEventsResult" />
/// class.</para>
/// </summary>
/// <param name="events">List of events. Note that events are not guaranteed to be
/// sorted by their timestamp value.</param>
/// <param name="cursor">Pass the cursor into <see
/// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /> to
/// obtain additional events. The value of <paramref name="cursor" /> may change for
/// each response from <see
/// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" />,
/// regardless of the value of <paramref name="hasMore" />; older cursor strings may
/// expire. Thus, callers should ensure that they update their cursor based on the
/// latest value of <paramref name="cursor" /> after each call, and poll regularly if
/// they wish to poll for new events. Callers should handle reset exceptions for
/// expired cursors.</param>
/// <param name="hasMore">Is true if there may be additional events that have not been
/// returned yet. An additional call to <see
/// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /> can
/// retrieve them. Note that <paramref name="hasMore" /> may be <c>true</c>, even if
/// <paramref name="events" /> is empty.</param>
public GetTeamEventsResult(col.IEnumerable<TeamEvent> events,
string cursor,
bool hasMore)
{
var eventsList = enc.Util.ToList(events);
if (events == null)
{
throw new sys.ArgumentNullException("events");
}
if (cursor == null)
{
throw new sys.ArgumentNullException("cursor");
}
this.Events = eventsList;
this.Cursor = cursor;
this.HasMore = hasMore;
}
/// <summary>
/// <para>Initializes a new instance of the <see cref="GetTeamEventsResult" />
/// class.</para>
/// </summary>
/// <remarks>This is to construct an instance of the object when
/// deserializing.</remarks>
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
public GetTeamEventsResult()
{
}
/// <summary>
/// <para>List of events. Note that events are not guaranteed to be sorted by their
/// timestamp value.</para>
/// </summary>
public col.IList<TeamEvent> Events { get; protected set; }
/// <summary>
/// <para>Pass the cursor into <see
/// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /> to
/// obtain additional events.</para>
/// <para>The value of <see cref="Cursor" /> may change for each response from <see
/// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" />,
/// regardless of the value of <see cref="HasMore" />; older cursor strings may
/// expire.</para>
/// <para>Thus, callers should ensure that they update their cursor based on the latest
/// value of <see cref="Cursor" /> after each call, and poll regularly if they wish to
/// poll for new events.</para>
/// <para>Callers should handle reset exceptions for expired cursors.</para>
/// </summary>
public string Cursor { get; protected set; }
/// <summary>
/// <para>Is true if there may be additional events that have not been returned yet. An
/// additional call to <see
/// cref="Dropbox.Api.TeamLog.Routes.TeamLogTeamRoutes.GetEventsContinueAsync" /> can
/// retrieve them. Note that <see cref="HasMore" /> may be <c>true</c>, even if <see
/// cref="Events" /> is empty.</para>
/// </summary>
public bool HasMore { get; protected set; }
#region Encoder class
/// <summary>
/// <para>Encoder for <see cref="GetTeamEventsResult" />.</para>
/// </summary>
private class GetTeamEventsResultEncoder : enc.StructEncoder<GetTeamEventsResult>
{
/// <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(GetTeamEventsResult value, enc.IJsonWriter writer)
{
WriteListProperty("events", value.Events, writer, global::Dropbox.Api.TeamLog.TeamEvent.Encoder);
WriteProperty("cursor", value.Cursor, writer, enc.StringEncoder.Instance);
WriteProperty("has_more", value.HasMore, writer, enc.BooleanEncoder.Instance);
}
}
#endregion
#region Decoder class
/// <summary>
/// <para>Decoder for <see cref="GetTeamEventsResult" />.</para>
/// </summary>
private class GetTeamEventsResultDecoder : enc.StructDecoder<GetTeamEventsResult>
{
/// <summary>
/// <para>Create a new instance of type <see cref="GetTeamEventsResult" />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override GetTeamEventsResult Create()
{
return new GetTeamEventsResult();
}
/// <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(GetTeamEventsResult value, string fieldName, enc.IJsonReader reader)
{
switch (fieldName)
{
case "events":
value.Events = ReadList<TeamEvent>(reader, global::Dropbox.Api.TeamLog.TeamEvent.Decoder);
break;
case "cursor":
value.Cursor = enc.StringDecoder.Instance.Decode(reader);
break;
case "has_more":
value.HasMore = enc.BooleanDecoder.Instance.Decode(reader);
break;
default:
reader.Skip();
break;
}
}
}
#endregion
}
}