|
| 1 | +// <auto-generated> |
| 2 | +// Auto-generated by StoneAPI, do not modify. |
| 3 | +// </auto-generated> |
| 4 | + |
| 5 | +namespace Dropbox.Api.Files |
| 6 | +{ |
| 7 | + using sys = System; |
| 8 | + using col = System.Collections.Generic; |
| 9 | + using re = System.Text.RegularExpressions; |
| 10 | + |
| 11 | + using enc = Dropbox.Api.Stone; |
| 12 | + |
| 13 | + /// <summary> |
| 14 | + /// <para>The move into family error object</para> |
| 15 | + /// </summary> |
| 16 | + public class MoveIntoFamilyError |
| 17 | + { |
| 18 | + #pragma warning disable 108 |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// <para>The encoder instance.</para> |
| 22 | + /// </summary> |
| 23 | + internal static enc.StructEncoder<MoveIntoFamilyError> Encoder = new MoveIntoFamilyErrorEncoder(); |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// <para>The decoder instance.</para> |
| 27 | + /// </summary> |
| 28 | + internal static enc.StructDecoder<MoveIntoFamilyError> Decoder = new MoveIntoFamilyErrorDecoder(); |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// <para>Initializes a new instance of the <see cref="MoveIntoFamilyError" /> |
| 32 | + /// class.</para> |
| 33 | + /// </summary> |
| 34 | + public MoveIntoFamilyError() |
| 35 | + { |
| 36 | + } |
| 37 | + |
| 38 | + /// <summary> |
| 39 | + /// <para>Gets a value indicating whether this instance is IsSharedFolder</para> |
| 40 | + /// </summary> |
| 41 | + public bool IsIsSharedFolder |
| 42 | + { |
| 43 | + get |
| 44 | + { |
| 45 | + return this is IsSharedFolder; |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// <para>Gets this instance as a IsSharedFolder, or <c>null</c>.</para> |
| 51 | + /// </summary> |
| 52 | + public IsSharedFolder AsIsSharedFolder |
| 53 | + { |
| 54 | + get |
| 55 | + { |
| 56 | + return this as IsSharedFolder; |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// <para>Gets a value indicating whether this instance is Other</para> |
| 62 | + /// </summary> |
| 63 | + public bool IsOther |
| 64 | + { |
| 65 | + get |
| 66 | + { |
| 67 | + return this is Other; |
| 68 | + } |
| 69 | + } |
| 70 | + |
| 71 | + /// <summary> |
| 72 | + /// <para>Gets this instance as a Other, or <c>null</c>.</para> |
| 73 | + /// </summary> |
| 74 | + public Other AsOther |
| 75 | + { |
| 76 | + get |
| 77 | + { |
| 78 | + return this as Other; |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + #region Encoder class |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// <para>Encoder for <see cref="MoveIntoFamilyError" />.</para> |
| 86 | + /// </summary> |
| 87 | + private class MoveIntoFamilyErrorEncoder : enc.StructEncoder<MoveIntoFamilyError> |
| 88 | + { |
| 89 | + /// <summary> |
| 90 | + /// <para>Encode fields of given value.</para> |
| 91 | + /// </summary> |
| 92 | + /// <param name="value">The value.</param> |
| 93 | + /// <param name="writer">The writer.</param> |
| 94 | + public override void EncodeFields(MoveIntoFamilyError value, enc.IJsonWriter writer) |
| 95 | + { |
| 96 | + if (value is IsSharedFolder) |
| 97 | + { |
| 98 | + WriteProperty(".tag", "is_shared_folder", writer, enc.StringEncoder.Instance); |
| 99 | + IsSharedFolder.Encoder.EncodeFields((IsSharedFolder)value, writer); |
| 100 | + return; |
| 101 | + } |
| 102 | + if (value is Other) |
| 103 | + { |
| 104 | + WriteProperty(".tag", "other", writer, enc.StringEncoder.Instance); |
| 105 | + Other.Encoder.EncodeFields((Other)value, writer); |
| 106 | + return; |
| 107 | + } |
| 108 | + throw new sys.InvalidOperationException(); |
| 109 | + } |
| 110 | + } |
| 111 | + |
| 112 | + #endregion |
| 113 | + |
| 114 | + #region Decoder class |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// <para>Decoder for <see cref="MoveIntoFamilyError" />.</para> |
| 118 | + /// </summary> |
| 119 | + private class MoveIntoFamilyErrorDecoder : enc.UnionDecoder<MoveIntoFamilyError> |
| 120 | + { |
| 121 | + /// <summary> |
| 122 | + /// <para>Create a new instance of type <see cref="MoveIntoFamilyError" />.</para> |
| 123 | + /// </summary> |
| 124 | + /// <returns>The struct instance.</returns> |
| 125 | + protected override MoveIntoFamilyError Create() |
| 126 | + { |
| 127 | + return new MoveIntoFamilyError(); |
| 128 | + } |
| 129 | + |
| 130 | + /// <summary> |
| 131 | + /// <para>Decode based on given tag.</para> |
| 132 | + /// </summary> |
| 133 | + /// <param name="tag">The tag.</param> |
| 134 | + /// <param name="reader">The json reader.</param> |
| 135 | + /// <returns>The decoded object.</returns> |
| 136 | + protected override MoveIntoFamilyError Decode(string tag, enc.IJsonReader reader) |
| 137 | + { |
| 138 | + switch (tag) |
| 139 | + { |
| 140 | + case "is_shared_folder": |
| 141 | + return IsSharedFolder.Decoder.DecodeFields(reader); |
| 142 | + default: |
| 143 | + return Other.Decoder.DecodeFields(reader); |
| 144 | + } |
| 145 | + } |
| 146 | + } |
| 147 | + |
| 148 | + #endregion |
| 149 | + |
| 150 | + /// <summary> |
| 151 | + /// <para>Moving shared folder into Family Room folder is not allowed.</para> |
| 152 | + /// </summary> |
| 153 | + public sealed class IsSharedFolder : MoveIntoFamilyError |
| 154 | + { |
| 155 | + #pragma warning disable 108 |
| 156 | + |
| 157 | + /// <summary> |
| 158 | + /// <para>The encoder instance.</para> |
| 159 | + /// </summary> |
| 160 | + internal static enc.StructEncoder<IsSharedFolder> Encoder = new IsSharedFolderEncoder(); |
| 161 | + |
| 162 | + /// <summary> |
| 163 | + /// <para>The decoder instance.</para> |
| 164 | + /// </summary> |
| 165 | + internal static enc.StructDecoder<IsSharedFolder> Decoder = new IsSharedFolderDecoder(); |
| 166 | + |
| 167 | + /// <summary> |
| 168 | + /// <para>Initializes a new instance of the <see cref="IsSharedFolder" /> |
| 169 | + /// class.</para> |
| 170 | + /// </summary> |
| 171 | + private IsSharedFolder() |
| 172 | + { |
| 173 | + } |
| 174 | + |
| 175 | + /// <summary> |
| 176 | + /// <para>A singleton instance of IsSharedFolder</para> |
| 177 | + /// </summary> |
| 178 | + public static readonly IsSharedFolder Instance = new IsSharedFolder(); |
| 179 | + |
| 180 | + #region Encoder class |
| 181 | + |
| 182 | + /// <summary> |
| 183 | + /// <para>Encoder for <see cref="IsSharedFolder" />.</para> |
| 184 | + /// </summary> |
| 185 | + private class IsSharedFolderEncoder : enc.StructEncoder<IsSharedFolder> |
| 186 | + { |
| 187 | + /// <summary> |
| 188 | + /// <para>Encode fields of given value.</para> |
| 189 | + /// </summary> |
| 190 | + /// <param name="value">The value.</param> |
| 191 | + /// <param name="writer">The writer.</param> |
| 192 | + public override void EncodeFields(IsSharedFolder value, enc.IJsonWriter writer) |
| 193 | + { |
| 194 | + } |
| 195 | + } |
| 196 | + |
| 197 | + #endregion |
| 198 | + |
| 199 | + #region Decoder class |
| 200 | + |
| 201 | + /// <summary> |
| 202 | + /// <para>Decoder for <see cref="IsSharedFolder" />.</para> |
| 203 | + /// </summary> |
| 204 | + private class IsSharedFolderDecoder : enc.StructDecoder<IsSharedFolder> |
| 205 | + { |
| 206 | + /// <summary> |
| 207 | + /// <para>Create a new instance of type <see cref="IsSharedFolder" />.</para> |
| 208 | + /// </summary> |
| 209 | + /// <returns>The struct instance.</returns> |
| 210 | + protected override IsSharedFolder Create() |
| 211 | + { |
| 212 | + return IsSharedFolder.Instance; |
| 213 | + } |
| 214 | + |
| 215 | + } |
| 216 | + |
| 217 | + #endregion |
| 218 | + } |
| 219 | + |
| 220 | + /// <summary> |
| 221 | + /// <para>The other object</para> |
| 222 | + /// </summary> |
| 223 | + public sealed class Other : MoveIntoFamilyError |
| 224 | + { |
| 225 | + #pragma warning disable 108 |
| 226 | + |
| 227 | + /// <summary> |
| 228 | + /// <para>The encoder instance.</para> |
| 229 | + /// </summary> |
| 230 | + internal static enc.StructEncoder<Other> Encoder = new OtherEncoder(); |
| 231 | + |
| 232 | + /// <summary> |
| 233 | + /// <para>The decoder instance.</para> |
| 234 | + /// </summary> |
| 235 | + internal static enc.StructDecoder<Other> Decoder = new OtherDecoder(); |
| 236 | + |
| 237 | + /// <summary> |
| 238 | + /// <para>Initializes a new instance of the <see cref="Other" /> class.</para> |
| 239 | + /// </summary> |
| 240 | + private Other() |
| 241 | + { |
| 242 | + } |
| 243 | + |
| 244 | + /// <summary> |
| 245 | + /// <para>A singleton instance of Other</para> |
| 246 | + /// </summary> |
| 247 | + public static readonly Other Instance = new Other(); |
| 248 | + |
| 249 | + #region Encoder class |
| 250 | + |
| 251 | + /// <summary> |
| 252 | + /// <para>Encoder for <see cref="Other" />.</para> |
| 253 | + /// </summary> |
| 254 | + private class OtherEncoder : enc.StructEncoder<Other> |
| 255 | + { |
| 256 | + /// <summary> |
| 257 | + /// <para>Encode fields of given value.</para> |
| 258 | + /// </summary> |
| 259 | + /// <param name="value">The value.</param> |
| 260 | + /// <param name="writer">The writer.</param> |
| 261 | + public override void EncodeFields(Other value, enc.IJsonWriter writer) |
| 262 | + { |
| 263 | + } |
| 264 | + } |
| 265 | + |
| 266 | + #endregion |
| 267 | + |
| 268 | + #region Decoder class |
| 269 | + |
| 270 | + /// <summary> |
| 271 | + /// <para>Decoder for <see cref="Other" />.</para> |
| 272 | + /// </summary> |
| 273 | + private class OtherDecoder : enc.StructDecoder<Other> |
| 274 | + { |
| 275 | + /// <summary> |
| 276 | + /// <para>Create a new instance of type <see cref="Other" />.</para> |
| 277 | + /// </summary> |
| 278 | + /// <returns>The struct instance.</returns> |
| 279 | + protected override Other Create() |
| 280 | + { |
| 281 | + return Other.Instance; |
| 282 | + } |
| 283 | + |
| 284 | + } |
| 285 | + |
| 286 | + #endregion |
| 287 | + } |
| 288 | + } |
| 289 | +} |
0 commit comments