Skip to content

Commit

Permalink
Automated Spec Update (#235)
Browse files Browse the repository at this point in the history
4d5bb48ac801df6410ddc9c2cad0d9f5bb0a2365

 Change Notes:

Team Log Namespace:
- Add user_defined_tag to LabelType  union

Co-authored-by: DropboxBot <[email protected]>
  • Loading branch information
DropboxBot and DropboxBot authored May 12, 2021
1 parent 93728be commit bde2663
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 1 deletion.
100 changes: 100 additions & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/TeamLog/LabelType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,28 @@ public PersonalInformation AsPersonalInformation
}
}

/// <summary>
/// <para>Gets a value indicating whether this instance is UserDefinedTag</para>
/// </summary>
public bool IsUserDefinedTag
{
get
{
return this is UserDefinedTag;
}
}

/// <summary>
/// <para>Gets this instance as a UserDefinedTag, or <c>null</c>.</para>
/// </summary>
public UserDefinedTag AsUserDefinedTag
{
get
{
return this as UserDefinedTag;
}
}

/// <summary>
/// <para>Gets a value indicating whether this instance is Other</para>
/// </summary>
Expand Down Expand Up @@ -98,6 +120,12 @@ public override void EncodeFields(LabelType value, enc.IJsonWriter writer)
PersonalInformation.Encoder.EncodeFields((PersonalInformation)value, writer);
return;
}
if (value is UserDefinedTag)
{
WriteProperty(".tag", "user_defined_tag", writer, enc.StringEncoder.Instance);
UserDefinedTag.Encoder.EncodeFields((UserDefinedTag)value, writer);
return;
}
if (value is Other)
{
WriteProperty(".tag", "other", writer, enc.StringEncoder.Instance);
Expand Down Expand Up @@ -138,6 +166,8 @@ protected override LabelType Decode(string tag, enc.IJsonReader reader)
{
case "personal_information":
return PersonalInformation.Decoder.DecodeFields(reader);
case "user_defined_tag":
return UserDefinedTag.Decoder.DecodeFields(reader);
default:
return Other.Decoder.DecodeFields(reader);
}
Expand Down Expand Up @@ -217,6 +247,76 @@ protected override PersonalInformation Create()
#endregion
}

/// <summary>
/// <para>The user defined tag object</para>
/// </summary>
public sealed class UserDefinedTag : LabelType
{
#pragma warning disable 108

/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<UserDefinedTag> Encoder = new UserDefinedTagEncoder();

/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<UserDefinedTag> Decoder = new UserDefinedTagDecoder();

/// <summary>
/// <para>Initializes a new instance of the <see cref="UserDefinedTag" />
/// class.</para>
/// </summary>
private UserDefinedTag()
{
}

/// <summary>
/// <para>A singleton instance of UserDefinedTag</para>
/// </summary>
public static readonly UserDefinedTag Instance = new UserDefinedTag();

#region Encoder class

/// <summary>
/// <para>Encoder for <see cref="UserDefinedTag" />.</para>
/// </summary>
private class UserDefinedTagEncoder : enc.StructEncoder<UserDefinedTag>
{
/// <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(UserDefinedTag value, enc.IJsonWriter writer)
{
}
}

#endregion

#region Decoder class

/// <summary>
/// <para>Decoder for <see cref="UserDefinedTag" />.</para>
/// </summary>
private class UserDefinedTagDecoder : enc.StructDecoder<UserDefinedTag>
{
/// <summary>
/// <para>Create a new instance of type <see cref="UserDefinedTag" />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override UserDefinedTag Create()
{
return UserDefinedTag.Instance;
}

}

#endregion
}

/// <summary>
/// <para>The other object</para>
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion spec
Submodule spec updated 1 files
+1 −0 team_log_generated.stone

0 comments on commit bde2663

Please sign in to comment.