|
| 1 | +// <auto-generated> |
| 2 | +// Auto-generated by StoneAPI, do not modify. |
| 3 | +// </auto-generated> |
| 4 | + |
| 5 | +namespace Dropbox.Api.Openid |
| 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 auth error object</para> |
| 15 | + /// </summary> |
| 16 | + public class AuthError |
| 17 | + { |
| 18 | + #pragma warning disable 108 |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// <para>The encoder instance.</para> |
| 22 | + /// </summary> |
| 23 | + internal static enc.StructEncoder<AuthError> Encoder = new AuthErrorEncoder(); |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// <para>The decoder instance.</para> |
| 27 | + /// </summary> |
| 28 | + internal static enc.StructDecoder<AuthError> Decoder = new AuthErrorDecoder(); |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// <para>Initializes a new instance of the <see cref="AuthError" /> class.</para> |
| 32 | + /// </summary> |
| 33 | + public AuthError() |
| 34 | + { |
| 35 | + } |
| 36 | + |
| 37 | + /// <summary> |
| 38 | + /// <para>Gets a value indicating whether this instance is InvalidToken</para> |
| 39 | + /// </summary> |
| 40 | + public bool IsInvalidToken |
| 41 | + { |
| 42 | + get |
| 43 | + { |
| 44 | + return this is InvalidToken; |
| 45 | + } |
| 46 | + } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// <para>Gets this instance as a InvalidToken, or <c>null</c>.</para> |
| 50 | + /// </summary> |
| 51 | + public InvalidToken AsInvalidToken |
| 52 | + { |
| 53 | + get |
| 54 | + { |
| 55 | + return this as InvalidToken; |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + /// <summary> |
| 60 | + /// <para>Gets a value indicating whether this instance is NoOpenidAuth</para> |
| 61 | + /// </summary> |
| 62 | + public bool IsNoOpenidAuth |
| 63 | + { |
| 64 | + get |
| 65 | + { |
| 66 | + return this is NoOpenidAuth; |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | + /// <summary> |
| 71 | + /// <para>Gets this instance as a NoOpenidAuth, or <c>null</c>.</para> |
| 72 | + /// </summary> |
| 73 | + public NoOpenidAuth AsNoOpenidAuth |
| 74 | + { |
| 75 | + get |
| 76 | + { |
| 77 | + return this as NoOpenidAuth; |
| 78 | + } |
| 79 | + } |
| 80 | + |
| 81 | + /// <summary> |
| 82 | + /// <para>Gets a value indicating whether this instance is Other</para> |
| 83 | + /// </summary> |
| 84 | + public bool IsOther |
| 85 | + { |
| 86 | + get |
| 87 | + { |
| 88 | + return this is Other; |
| 89 | + } |
| 90 | + } |
| 91 | + |
| 92 | + /// <summary> |
| 93 | + /// <para>Gets this instance as a Other, or <c>null</c>.</para> |
| 94 | + /// </summary> |
| 95 | + public Other AsOther |
| 96 | + { |
| 97 | + get |
| 98 | + { |
| 99 | + return this as Other; |
| 100 | + } |
| 101 | + } |
| 102 | + |
| 103 | + #region Encoder class |
| 104 | + |
| 105 | + /// <summary> |
| 106 | + /// <para>Encoder for <see cref="AuthError" />.</para> |
| 107 | + /// </summary> |
| 108 | + private class AuthErrorEncoder : enc.StructEncoder<AuthError> |
| 109 | + { |
| 110 | + /// <summary> |
| 111 | + /// <para>Encode fields of given value.</para> |
| 112 | + /// </summary> |
| 113 | + /// <param name="value">The value.</param> |
| 114 | + /// <param name="writer">The writer.</param> |
| 115 | + public override void EncodeFields(AuthError value, enc.IJsonWriter writer) |
| 116 | + { |
| 117 | + if (value is InvalidToken) |
| 118 | + { |
| 119 | + WriteProperty(".tag", "invalid_token", writer, enc.StringEncoder.Instance); |
| 120 | + InvalidToken.Encoder.EncodeFields((InvalidToken)value, writer); |
| 121 | + return; |
| 122 | + } |
| 123 | + if (value is NoOpenidAuth) |
| 124 | + { |
| 125 | + WriteProperty(".tag", "no_openid_auth", writer, enc.StringEncoder.Instance); |
| 126 | + NoOpenidAuth.Encoder.EncodeFields((NoOpenidAuth)value, writer); |
| 127 | + return; |
| 128 | + } |
| 129 | + if (value is Other) |
| 130 | + { |
| 131 | + WriteProperty(".tag", "other", writer, enc.StringEncoder.Instance); |
| 132 | + Other.Encoder.EncodeFields((Other)value, writer); |
| 133 | + return; |
| 134 | + } |
| 135 | + throw new sys.InvalidOperationException(); |
| 136 | + } |
| 137 | + } |
| 138 | + |
| 139 | + #endregion |
| 140 | + |
| 141 | + #region Decoder class |
| 142 | + |
| 143 | + /// <summary> |
| 144 | + /// <para>Decoder for <see cref="AuthError" />.</para> |
| 145 | + /// </summary> |
| 146 | + private class AuthErrorDecoder : enc.UnionDecoder<AuthError> |
| 147 | + { |
| 148 | + /// <summary> |
| 149 | + /// <para>Create a new instance of type <see cref="AuthError" />.</para> |
| 150 | + /// </summary> |
| 151 | + /// <returns>The struct instance.</returns> |
| 152 | + protected override AuthError Create() |
| 153 | + { |
| 154 | + return new AuthError(); |
| 155 | + } |
| 156 | + |
| 157 | + /// <summary> |
| 158 | + /// <para>Decode based on given tag.</para> |
| 159 | + /// </summary> |
| 160 | + /// <param name="tag">The tag.</param> |
| 161 | + /// <param name="reader">The json reader.</param> |
| 162 | + /// <returns>The decoded object.</returns> |
| 163 | + protected override AuthError Decode(string tag, enc.IJsonReader reader) |
| 164 | + { |
| 165 | + switch (tag) |
| 166 | + { |
| 167 | + case "invalid_token": |
| 168 | + return InvalidToken.Decoder.DecodeFields(reader); |
| 169 | + case "no_openid_auth": |
| 170 | + return NoOpenidAuth.Decoder.DecodeFields(reader); |
| 171 | + default: |
| 172 | + return Other.Decoder.DecodeFields(reader); |
| 173 | + } |
| 174 | + } |
| 175 | + } |
| 176 | + |
| 177 | + #endregion |
| 178 | + |
| 179 | + /// <summary> |
| 180 | + /// <para>The invalid token object</para> |
| 181 | + /// </summary> |
| 182 | + public sealed class InvalidToken : AuthError |
| 183 | + { |
| 184 | + #pragma warning disable 108 |
| 185 | + |
| 186 | + /// <summary> |
| 187 | + /// <para>The encoder instance.</para> |
| 188 | + /// </summary> |
| 189 | + internal static enc.StructEncoder<InvalidToken> Encoder = new InvalidTokenEncoder(); |
| 190 | + |
| 191 | + /// <summary> |
| 192 | + /// <para>The decoder instance.</para> |
| 193 | + /// </summary> |
| 194 | + internal static enc.StructDecoder<InvalidToken> Decoder = new InvalidTokenDecoder(); |
| 195 | + |
| 196 | + /// <summary> |
| 197 | + /// <para>Initializes a new instance of the <see cref="InvalidToken" /> |
| 198 | + /// class.</para> |
| 199 | + /// </summary> |
| 200 | + private InvalidToken() |
| 201 | + { |
| 202 | + } |
| 203 | + |
| 204 | + /// <summary> |
| 205 | + /// <para>A singleton instance of InvalidToken</para> |
| 206 | + /// </summary> |
| 207 | + public static readonly InvalidToken Instance = new InvalidToken(); |
| 208 | + |
| 209 | + #region Encoder class |
| 210 | + |
| 211 | + /// <summary> |
| 212 | + /// <para>Encoder for <see cref="InvalidToken" />.</para> |
| 213 | + /// </summary> |
| 214 | + private class InvalidTokenEncoder : enc.StructEncoder<InvalidToken> |
| 215 | + { |
| 216 | + /// <summary> |
| 217 | + /// <para>Encode fields of given value.</para> |
| 218 | + /// </summary> |
| 219 | + /// <param name="value">The value.</param> |
| 220 | + /// <param name="writer">The writer.</param> |
| 221 | + public override void EncodeFields(InvalidToken value, enc.IJsonWriter writer) |
| 222 | + { |
| 223 | + } |
| 224 | + } |
| 225 | + |
| 226 | + #endregion |
| 227 | + |
| 228 | + #region Decoder class |
| 229 | + |
| 230 | + /// <summary> |
| 231 | + /// <para>Decoder for <see cref="InvalidToken" />.</para> |
| 232 | + /// </summary> |
| 233 | + private class InvalidTokenDecoder : enc.StructDecoder<InvalidToken> |
| 234 | + { |
| 235 | + /// <summary> |
| 236 | + /// <para>Create a new instance of type <see cref="InvalidToken" />.</para> |
| 237 | + /// </summary> |
| 238 | + /// <returns>The struct instance.</returns> |
| 239 | + protected override InvalidToken Create() |
| 240 | + { |
| 241 | + return InvalidToken.Instance; |
| 242 | + } |
| 243 | + |
| 244 | + } |
| 245 | + |
| 246 | + #endregion |
| 247 | + } |
| 248 | + |
| 249 | + /// <summary> |
| 250 | + /// <para>The no openid auth object</para> |
| 251 | + /// </summary> |
| 252 | + public sealed class NoOpenidAuth : AuthError |
| 253 | + { |
| 254 | + #pragma warning disable 108 |
| 255 | + |
| 256 | + /// <summary> |
| 257 | + /// <para>The encoder instance.</para> |
| 258 | + /// </summary> |
| 259 | + internal static enc.StructEncoder<NoOpenidAuth> Encoder = new NoOpenidAuthEncoder(); |
| 260 | + |
| 261 | + /// <summary> |
| 262 | + /// <para>The decoder instance.</para> |
| 263 | + /// </summary> |
| 264 | + internal static enc.StructDecoder<NoOpenidAuth> Decoder = new NoOpenidAuthDecoder(); |
| 265 | + |
| 266 | + /// <summary> |
| 267 | + /// <para>Initializes a new instance of the <see cref="NoOpenidAuth" /> |
| 268 | + /// class.</para> |
| 269 | + /// </summary> |
| 270 | + private NoOpenidAuth() |
| 271 | + { |
| 272 | + } |
| 273 | + |
| 274 | + /// <summary> |
| 275 | + /// <para>A singleton instance of NoOpenidAuth</para> |
| 276 | + /// </summary> |
| 277 | + public static readonly NoOpenidAuth Instance = new NoOpenidAuth(); |
| 278 | + |
| 279 | + #region Encoder class |
| 280 | + |
| 281 | + /// <summary> |
| 282 | + /// <para>Encoder for <see cref="NoOpenidAuth" />.</para> |
| 283 | + /// </summary> |
| 284 | + private class NoOpenidAuthEncoder : enc.StructEncoder<NoOpenidAuth> |
| 285 | + { |
| 286 | + /// <summary> |
| 287 | + /// <para>Encode fields of given value.</para> |
| 288 | + /// </summary> |
| 289 | + /// <param name="value">The value.</param> |
| 290 | + /// <param name="writer">The writer.</param> |
| 291 | + public override void EncodeFields(NoOpenidAuth value, enc.IJsonWriter writer) |
| 292 | + { |
| 293 | + } |
| 294 | + } |
| 295 | + |
| 296 | + #endregion |
| 297 | + |
| 298 | + #region Decoder class |
| 299 | + |
| 300 | + /// <summary> |
| 301 | + /// <para>Decoder for <see cref="NoOpenidAuth" />.</para> |
| 302 | + /// </summary> |
| 303 | + private class NoOpenidAuthDecoder : enc.StructDecoder<NoOpenidAuth> |
| 304 | + { |
| 305 | + /// <summary> |
| 306 | + /// <para>Create a new instance of type <see cref="NoOpenidAuth" />.</para> |
| 307 | + /// </summary> |
| 308 | + /// <returns>The struct instance.</returns> |
| 309 | + protected override NoOpenidAuth Create() |
| 310 | + { |
| 311 | + return NoOpenidAuth.Instance; |
| 312 | + } |
| 313 | + |
| 314 | + } |
| 315 | + |
| 316 | + #endregion |
| 317 | + } |
| 318 | + |
| 319 | + /// <summary> |
| 320 | + /// <para>The other object</para> |
| 321 | + /// </summary> |
| 322 | + public sealed class Other : AuthError |
| 323 | + { |
| 324 | + #pragma warning disable 108 |
| 325 | + |
| 326 | + /// <summary> |
| 327 | + /// <para>The encoder instance.</para> |
| 328 | + /// </summary> |
| 329 | + internal static enc.StructEncoder<Other> Encoder = new OtherEncoder(); |
| 330 | + |
| 331 | + /// <summary> |
| 332 | + /// <para>The decoder instance.</para> |
| 333 | + /// </summary> |
| 334 | + internal static enc.StructDecoder<Other> Decoder = new OtherDecoder(); |
| 335 | + |
| 336 | + /// <summary> |
| 337 | + /// <para>Initializes a new instance of the <see cref="Other" /> class.</para> |
| 338 | + /// </summary> |
| 339 | + private Other() |
| 340 | + { |
| 341 | + } |
| 342 | + |
| 343 | + /// <summary> |
| 344 | + /// <para>A singleton instance of Other</para> |
| 345 | + /// </summary> |
| 346 | + public static readonly Other Instance = new Other(); |
| 347 | + |
| 348 | + #region Encoder class |
| 349 | + |
| 350 | + /// <summary> |
| 351 | + /// <para>Encoder for <see cref="Other" />.</para> |
| 352 | + /// </summary> |
| 353 | + private class OtherEncoder : enc.StructEncoder<Other> |
| 354 | + { |
| 355 | + /// <summary> |
| 356 | + /// <para>Encode fields of given value.</para> |
| 357 | + /// </summary> |
| 358 | + /// <param name="value">The value.</param> |
| 359 | + /// <param name="writer">The writer.</param> |
| 360 | + public override void EncodeFields(Other value, enc.IJsonWriter writer) |
| 361 | + { |
| 362 | + } |
| 363 | + } |
| 364 | + |
| 365 | + #endregion |
| 366 | + |
| 367 | + #region Decoder class |
| 368 | + |
| 369 | + /// <summary> |
| 370 | + /// <para>Decoder for <see cref="Other" />.</para> |
| 371 | + /// </summary> |
| 372 | + private class OtherDecoder : enc.StructDecoder<Other> |
| 373 | + { |
| 374 | + /// <summary> |
| 375 | + /// <para>Create a new instance of type <see cref="Other" />.</para> |
| 376 | + /// </summary> |
| 377 | + /// <returns>The struct instance.</returns> |
| 378 | + protected override Other Create() |
| 379 | + { |
| 380 | + return Other.Instance; |
| 381 | + } |
| 382 | + |
| 383 | + } |
| 384 | + |
| 385 | + #endregion |
| 386 | + } |
| 387 | + } |
| 388 | +} |
0 commit comments