|
| 1 | +// <auto-generated> |
| 2 | +// Auto-generated by BabelAPI, do not modify. |
| 3 | +// </auto-generated> |
| 4 | + |
| 5 | +namespace Dropbox.Api.Async |
| 6 | +{ |
| 7 | + using sys = System; |
| 8 | + using col = System.Collections.Generic; |
| 9 | + using re = System.Text.RegularExpressions; |
| 10 | + |
| 11 | + using enc = Dropbox.Api.Babel; |
| 12 | + |
| 13 | + /// <summary> |
| 14 | + /// <para>Result returned by methods that may either launch an asynchronous job or complete |
| 15 | + /// synchronously. Upon synchronous completion of the job, no additional information is |
| 16 | + /// returned.</para> |
| 17 | + /// </summary> |
| 18 | + public class LaunchEmptyResult |
| 19 | + { |
| 20 | + #pragma warning disable 108 |
| 21 | + |
| 22 | + /// <summary> |
| 23 | + /// <para>The encoder instance.</para> |
| 24 | + /// </summary> |
| 25 | + internal static enc.StructEncoder<LaunchEmptyResult> Encoder = new LaunchEmptyResultEncoder(); |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// <para>The decoder instance.</para> |
| 29 | + /// </summary> |
| 30 | + internal static enc.StructDecoder<LaunchEmptyResult> Decoder = new LaunchEmptyResultDecoder(); |
| 31 | + |
| 32 | + /// <summary> |
| 33 | + /// <para>Initializes a new instance of the <see cref="LaunchEmptyResult" /> |
| 34 | + /// class.</para> |
| 35 | + /// </summary> |
| 36 | + public LaunchEmptyResult() |
| 37 | + { |
| 38 | + } |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// <para>Gets a value indicating whether this instance is Complete</para> |
| 42 | + /// </summary> |
| 43 | + public bool IsComplete |
| 44 | + { |
| 45 | + get |
| 46 | + { |
| 47 | + return this is Complete; |
| 48 | + } |
| 49 | + } |
| 50 | + |
| 51 | + /// <summary> |
| 52 | + /// <para>Gets this instance as a Complete, or <c>null</c>.</para> |
| 53 | + /// </summary> |
| 54 | + public Complete AsComplete |
| 55 | + { |
| 56 | + get |
| 57 | + { |
| 58 | + return this as Complete; |
| 59 | + } |
| 60 | + } |
| 61 | + |
| 62 | + #region Encoder class |
| 63 | + |
| 64 | + /// <summary> |
| 65 | + /// <para>Encoder for <see cref="LaunchEmptyResult" />.</para> |
| 66 | + /// </summary> |
| 67 | + private class LaunchEmptyResultEncoder : enc.StructEncoder<LaunchEmptyResult> |
| 68 | + { |
| 69 | + /// <summary> |
| 70 | + /// <para>Encode fields of given value.</para> |
| 71 | + /// </summary> |
| 72 | + /// <param name="value">The value.</param> |
| 73 | + /// <param name="writer">The writer.</param> |
| 74 | + public override void EncodeFields(LaunchEmptyResult value, enc.IJsonWriter writer) |
| 75 | + { |
| 76 | + if (value is Complete) |
| 77 | + { |
| 78 | + WriteProperty(".tag", "complete", writer, enc.StringEncoder.Instance); |
| 79 | + Complete.Encoder.EncodeFields((Complete)value, writer); |
| 80 | + return; |
| 81 | + } |
| 82 | + throw new sys.InvalidOperationException(); |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + #endregion |
| 87 | + |
| 88 | + #region Decoder class |
| 89 | + |
| 90 | + /// <summary> |
| 91 | + /// <para>Decoder for <see cref="LaunchEmptyResult" />.</para> |
| 92 | + /// </summary> |
| 93 | + private class LaunchEmptyResultDecoder : enc.UnionDecoder<LaunchEmptyResult> |
| 94 | + { |
| 95 | + /// <summary> |
| 96 | + /// <para>Create a new instance of type <see cref="LaunchEmptyResult" />.</para> |
| 97 | + /// </summary> |
| 98 | + /// <returns>The struct instance.</returns> |
| 99 | + protected override LaunchEmptyResult Create() |
| 100 | + { |
| 101 | + return new LaunchEmptyResult(); |
| 102 | + } |
| 103 | + |
| 104 | + /// <summary> |
| 105 | + /// <para>Decode based on given tag.</para> |
| 106 | + /// </summary> |
| 107 | + /// <param name="tag">The tag.</param> |
| 108 | + /// <param name="reader">The json reader.</param> |
| 109 | + /// <returns>The decoded object.</returns> |
| 110 | + protected override LaunchEmptyResult Decode(string tag, enc.IJsonReader reader) |
| 111 | + { |
| 112 | + switch (tag) |
| 113 | + { |
| 114 | + case "complete": |
| 115 | + return Complete.Decoder.DecodeFields(reader); |
| 116 | + default: |
| 117 | + throw new sys.InvalidOperationException(); |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + |
| 122 | + #endregion |
| 123 | + |
| 124 | + /// <summary> |
| 125 | + /// <para>The job finished synchronously and successfully.</para> |
| 126 | + /// </summary> |
| 127 | + public sealed class Complete : LaunchEmptyResult |
| 128 | + { |
| 129 | + #pragma warning disable 108 |
| 130 | + |
| 131 | + /// <summary> |
| 132 | + /// <para>The encoder instance.</para> |
| 133 | + /// </summary> |
| 134 | + internal static enc.StructEncoder<Complete> Encoder = new CompleteEncoder(); |
| 135 | + |
| 136 | + /// <summary> |
| 137 | + /// <para>The decoder instance.</para> |
| 138 | + /// </summary> |
| 139 | + internal static enc.StructDecoder<Complete> Decoder = new CompleteDecoder(); |
| 140 | + |
| 141 | + /// <summary> |
| 142 | + /// <para>Initializes a new instance of the <see cref="Complete" /> class.</para> |
| 143 | + /// </summary> |
| 144 | + private Complete() |
| 145 | + { |
| 146 | + } |
| 147 | + |
| 148 | + /// <summary> |
| 149 | + /// <para>A singleton instance of Complete</para> |
| 150 | + /// </summary> |
| 151 | + public static readonly Complete Instance = new Complete(); |
| 152 | + |
| 153 | + #region Encoder class |
| 154 | + |
| 155 | + /// <summary> |
| 156 | + /// <para>Encoder for <see cref="Complete" />.</para> |
| 157 | + /// </summary> |
| 158 | + private class CompleteEncoder : enc.StructEncoder<Complete> |
| 159 | + { |
| 160 | + /// <summary> |
| 161 | + /// <para>Encode fields of given value.</para> |
| 162 | + /// </summary> |
| 163 | + /// <param name="value">The value.</param> |
| 164 | + /// <param name="writer">The writer.</param> |
| 165 | + public override void EncodeFields(Complete value, enc.IJsonWriter writer) |
| 166 | + { |
| 167 | + } |
| 168 | + } |
| 169 | + |
| 170 | + #endregion |
| 171 | + |
| 172 | + #region Decoder class |
| 173 | + |
| 174 | + /// <summary> |
| 175 | + /// <para>Decoder for <see cref="Complete" />.</para> |
| 176 | + /// </summary> |
| 177 | + private class CompleteDecoder : enc.StructDecoder<Complete> |
| 178 | + { |
| 179 | + /// <summary> |
| 180 | + /// <para>Create a new instance of type <see cref="Complete" />.</para> |
| 181 | + /// </summary> |
| 182 | + /// <returns>The struct instance.</returns> |
| 183 | + protected override Complete Create() |
| 184 | + { |
| 185 | + return new Complete(); |
| 186 | + } |
| 187 | + |
| 188 | + /// <summary> |
| 189 | + /// <para>Decode fields without ensuring start and end object.</para> |
| 190 | + /// </summary> |
| 191 | + /// <param name="reader">The json reader.</param> |
| 192 | + /// <returns>The decoded object.</returns> |
| 193 | + public override Complete DecodeFields(enc.IJsonReader reader) |
| 194 | + { |
| 195 | + return Complete.Instance; |
| 196 | + } |
| 197 | + } |
| 198 | + |
| 199 | + #endregion |
| 200 | + } |
| 201 | + } |
| 202 | +} |
0 commit comments