-
Notifications
You must be signed in to change notification settings - Fork 450
/
MembersRemoveArg.cs
198 lines (179 loc) · 8.96 KB
/
MembersRemoveArg.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// <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 members remove arg object</para>
/// </summary>
/// <seealso cref="Global::Dropbox.Api.Team.MembersDeactivateArg" />
public class MembersRemoveArg : MembersDeactivateArg
{
#pragma warning disable 108
/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<MembersRemoveArg> Encoder = new MembersRemoveArgEncoder();
/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<MembersRemoveArg> Decoder = new MembersRemoveArgDecoder();
/// <summary>
/// <para>Initializes a new instance of the <see cref="MembersRemoveArg" />
/// class.</para>
/// </summary>
/// <param name="user">Identity of user to remove/suspend/have their files
/// moved.</param>
/// <param name="wipeData">If provided, controls if the user's data will be deleted on
/// their linked devices.</param>
/// <param name="transferDestId">If provided, files from the deleted member account
/// will be transferred to this user.</param>
/// <param name="transferAdminId">If provided, errors during the transfer process will
/// be sent via email to this user. If the transfer_dest_id argument was provided, then
/// this argument must be provided as well.</param>
/// <param name="keepAccount">Downgrade the member to a Basic account. The user will
/// retain the email address associated with their Dropbox account and data in their
/// account that is not restricted to team members. In order to keep the account the
/// argument <paramref name="wipeData" /> should be set to <c>false</c>.</param>
/// <param name="retainTeamShares">If provided, allows removed users to keep access to
/// Dropbox folders (not Dropbox Paper folders) already explicitly shared with them
/// (not via a group) when they are downgraded to a Basic account. Users will not
/// retain access to folders that do not allow external sharing. In order to keep the
/// sharing relationships, the arguments <paramref name="wipeData" /> should be set to
/// <c>false</c> and <paramref name="keepAccount" /> should be set to
/// <c>true</c>.</param>
public MembersRemoveArg(UserSelectorArg user,
bool wipeData = true,
UserSelectorArg transferDestId = null,
UserSelectorArg transferAdminId = null,
bool keepAccount = false,
bool retainTeamShares = false)
: base(user, wipeData)
{
this.TransferDestId = transferDestId;
this.TransferAdminId = transferAdminId;
this.KeepAccount = keepAccount;
this.RetainTeamShares = retainTeamShares;
}
/// <summary>
/// <para>Initializes a new instance of the <see cref="MembersRemoveArg" />
/// class.</para>
/// </summary>
/// <remarks>This is to construct an instance of the object when
/// deserializing.</remarks>
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
public MembersRemoveArg()
{
this.KeepAccount = false;
this.RetainTeamShares = false;
}
/// <summary>
/// <para>If provided, files from the deleted member account will be transferred to
/// this user.</para>
/// </summary>
public UserSelectorArg TransferDestId { get; protected set; }
/// <summary>
/// <para>If provided, errors during the transfer process will be sent via email to
/// this user. If the transfer_dest_id argument was provided, then this argument must
/// be provided as well.</para>
/// </summary>
public UserSelectorArg TransferAdminId { get; protected set; }
/// <summary>
/// <para>Downgrade the member to a Basic account. The user will retain the email
/// address associated with their Dropbox account and data in their account that is
/// not restricted to team members. In order to keep the account the argument <see
/// cref="WipeData" /> should be set to <c>false</c>.</para>
/// </summary>
public bool KeepAccount { get; protected set; }
/// <summary>
/// <para>If provided, allows removed users to keep access to Dropbox folders (not
/// Dropbox Paper folders) already explicitly shared with them (not via a group) when
/// they are downgraded to a Basic account. Users will not retain access to folders
/// that do not allow external sharing. In order to keep the sharing relationships, the
/// arguments <see cref="WipeData" /> should be set to <c>false</c> and <see
/// cref="KeepAccount" /> should be set to <c>true</c>.</para>
/// </summary>
public bool RetainTeamShares { get; protected set; }
#region Encoder class
/// <summary>
/// <para>Encoder for <see cref="MembersRemoveArg" />.</para>
/// </summary>
private class MembersRemoveArgEncoder : enc.StructEncoder<MembersRemoveArg>
{
/// <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(MembersRemoveArg value, enc.IJsonWriter writer)
{
WriteProperty("user", value.User, writer, global::Dropbox.Api.Team.UserSelectorArg.Encoder);
WriteProperty("wipe_data", value.WipeData, writer, enc.BooleanEncoder.Instance);
if (value.TransferDestId != null)
{
WriteProperty("transfer_dest_id", value.TransferDestId, writer, global::Dropbox.Api.Team.UserSelectorArg.Encoder);
}
if (value.TransferAdminId != null)
{
WriteProperty("transfer_admin_id", value.TransferAdminId, writer, global::Dropbox.Api.Team.UserSelectorArg.Encoder);
}
WriteProperty("keep_account", value.KeepAccount, writer, enc.BooleanEncoder.Instance);
WriteProperty("retain_team_shares", value.RetainTeamShares, writer, enc.BooleanEncoder.Instance);
}
}
#endregion
#region Decoder class
/// <summary>
/// <para>Decoder for <see cref="MembersRemoveArg" />.</para>
/// </summary>
private class MembersRemoveArgDecoder : enc.StructDecoder<MembersRemoveArg>
{
/// <summary>
/// <para>Create a new instance of type <see cref="MembersRemoveArg" />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override MembersRemoveArg Create()
{
return new MembersRemoveArg();
}
/// <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(MembersRemoveArg value, string fieldName, enc.IJsonReader reader)
{
switch (fieldName)
{
case "user":
value.User = global::Dropbox.Api.Team.UserSelectorArg.Decoder.Decode(reader);
break;
case "wipe_data":
value.WipeData = enc.BooleanDecoder.Instance.Decode(reader);
break;
case "transfer_dest_id":
value.TransferDestId = global::Dropbox.Api.Team.UserSelectorArg.Decoder.Decode(reader);
break;
case "transfer_admin_id":
value.TransferAdminId = global::Dropbox.Api.Team.UserSelectorArg.Decoder.Decode(reader);
break;
case "keep_account":
value.KeepAccount = enc.BooleanDecoder.Instance.Decode(reader);
break;
case "retain_team_shares":
value.RetainTeamShares = enc.BooleanDecoder.Instance.Decode(reader);
break;
default:
reader.Skip();
break;
}
}
}
#endregion
}
}