Skip to content

Commit

Permalink
Automated Spec Update (#329)
Browse files Browse the repository at this point in the history
18963b8a29fe125f6495d36c38eda5db2710d0dd

 Change Notes:

openid_openid_types Namespace
- Add OpenIdError, UserInfoError unions
- Remove UserInfoError structs
- Remove AuthError unions
- Update UserInfoArgs struct to include documentation

team_policies Namespace
- Add examples

Co-authored-by: Brent Bumann <bbumann@dropbox.com>

 c36ba27d8d56648555d3068bb3826e1d3a44d92b

Co-authored-by: DropboxBot <DropboxBot@users.noreply.github.com>
  • Loading branch information
DropboxBot and DropboxBot authored Oct 11, 2022
1 parent 7106a9e commit 0dbd222
Show file tree
Hide file tree
Showing 31 changed files with 4,176 additions and 282 deletions.
7 changes: 7 additions & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/DropboxClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace Dropbox.Api
using Dropbox.Api.FileProperties.Routes;
using Dropbox.Api.FileRequests.Routes;
using Dropbox.Api.Files.Routes;
using Dropbox.Api.Openid.Routes;
using Dropbox.Api.Paper.Routes;
using Dropbox.Api.Sharing.Routes;
using Dropbox.Api.Users.Routes;
Expand Down Expand Up @@ -55,6 +56,11 @@ public sealed partial class DropboxClient
/// </summary>
public FilesUserRoutes Files { get; private set; }

/// <summary>
/// <para>Gets the Openid routes.</para>
/// </summary>
public OpenidUserRoutes Openid { get; private set; }

/// <summary>
/// <para>Gets the Paper routes.</para>
/// </summary>
Expand Down Expand Up @@ -83,6 +89,7 @@ internal override void InitializeRoutes(ITransport transport)
this.FileProperties = new FilePropertiesUserRoutes(transport);
this.FileRequests = new FileRequestsUserRoutes(transport);
this.Files = new FilesUserRoutes(transport);
this.Openid = new OpenidUserRoutes(transport);
this.Paper = new PaperUserRoutes(transport);
this.Sharing = new SharingUserRoutes(transport);
this.Users = new UsersUserRoutes(transport);
Expand Down
6 changes: 4 additions & 2 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/AddTagArg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class AddTagArg
/// <para>Initializes a new instance of the <see cref="AddTagArg" /> class.</para>
/// </summary>
/// <param name="path">Path to the item to be tagged.</param>
/// <param name="tagText">The value of the tag to add.</param>
/// <param name="tagText">The value of the tag to add. Will be automatically converted
/// to lowercase letters.</param>
public AddTagArg(string path,
string tagText)
{
Expand Down Expand Up @@ -81,7 +82,8 @@ public AddTagArg()
public string Path { get; protected set; }

/// <summary>
/// <para>The value of the tag to add.</para>
/// <para>The value of the tag to add. Will be automatically converted to lowercase
/// letters.</para>
/// </summary>
public string TagText { get; protected set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6174,7 +6174,8 @@ public sys.IAsyncResult BeginTagsAdd(AddTagArg addTagArg, sys.AsyncCallback call
/// item.</para>
/// </summary>
/// <param name="path">Path to the item to be tagged.</param>
/// <param name="tagText">The value of the tag to add.</param>
/// <param name="tagText">The value of the tag to add. Will be automatically converted
/// to lowercase letters.</param>
/// <returns>The task that represents the asynchronous send operation.</returns>
/// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
/// processing the request; This will contain a <see cref="AddTagError"/>.</exception>
Expand All @@ -6191,7 +6192,8 @@ public t.Task TagsAddAsync(string path,
/// <para>Begins an asynchronous send to the tags add route.</para>
/// </summary>
/// <param name="path">Path to the item to be tagged.</param>
/// <param name="tagText">The value of the tag to add.</param>
/// <param name="tagText">The value of the tag to add. Will be automatically converted
/// to lowercase letters.</param>
/// <param name="callback">The method to be called when the asynchronous send is
/// completed.</param>
/// <param name="callbackState">A user provided object that distinguished this send
Expand Down Expand Up @@ -6340,7 +6342,8 @@ public sys.IAsyncResult BeginTagsRemove(RemoveTagArg removeTagArg, sys.AsyncCall
/// <para>Remove a tag from an item.</para>
/// </summary>
/// <param name="path">Path to the item to tag.</param>
/// <param name="tagText">The tag to remove.</param>
/// <param name="tagText">The tag to remove. Will be automatically converted to
/// lowercase letters.</param>
/// <returns>The task that represents the asynchronous send operation.</returns>
/// <exception cref="Dropbox.Api.ApiException{TError}">Thrown if there is an error
/// processing the request; This will contain a <see
Expand All @@ -6358,7 +6361,8 @@ public t.Task TagsRemoveAsync(string path,
/// <para>Begins an asynchronous send to the tags remove route.</para>
/// </summary>
/// <param name="path">Path to the item to tag.</param>
/// <param name="tagText">The tag to remove.</param>
/// <param name="tagText">The tag to remove. Will be automatically converted to
/// lowercase letters.</param>
/// <param name="callback">The method to be called when the asynchronous send is
/// completed.</param>
/// <param name="callbackState">A user provided object that distinguished this send
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public class RemoveTagArg
/// <para>Initializes a new instance of the <see cref="RemoveTagArg" /> class.</para>
/// </summary>
/// <param name="path">Path to the item to tag.</param>
/// <param name="tagText">The tag to remove.</param>
/// <param name="tagText">The tag to remove. Will be automatically converted to
/// lowercase letters.</param>
public RemoveTagArg(string path,
string tagText)
{
Expand Down Expand Up @@ -81,7 +82,8 @@ public RemoveTagArg()
public string Path { get; protected set; }

/// <summary>
/// <para>The tag to remove.</para>
/// <para>The tag to remove. Will be automatically converted to lowercase
/// letters.</para>
/// </summary>
public string TagText { get; protected set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,48 @@ namespace Dropbox.Api.Openid
using enc = Dropbox.Api.Stone;

/// <summary>
/// <para>The err union object</para>
/// <para>The open id error object</para>
/// </summary>
public class ErrUnion
public class OpenIdError
{
#pragma warning disable 108

/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<ErrUnion> Encoder = new ErrUnionEncoder();
internal static enc.StructEncoder<OpenIdError> Encoder = new OpenIdErrorEncoder();

/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<ErrUnion> Decoder = new ErrUnionDecoder();
internal static enc.StructDecoder<OpenIdError> Decoder = new OpenIdErrorDecoder();

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

/// <summary>
/// <para>Gets a value indicating whether this instance is AuthError</para>
/// <para>Gets a value indicating whether this instance is IncorrectOpenidScopes</para>
/// </summary>
public bool IsAuthError
public bool IsIncorrectOpenidScopes
{
get
{
return this is AuthError;
return this is IncorrectOpenidScopes;
}
}

/// <summary>
/// <para>Gets this instance as a AuthError, or <c>null</c>.</para>
/// <para>Gets this instance as a IncorrectOpenidScopes, or <c>null</c>.</para>
/// </summary>
public AuthError AsAuthError
public IncorrectOpenidScopes AsIncorrectOpenidScopes
{
get
{
return this as AuthError;
return this as IncorrectOpenidScopes;
}
}

Expand Down Expand Up @@ -81,21 +81,21 @@ public Other AsOther
#region Encoder class

/// <summary>
/// <para>Encoder for <see cref="ErrUnion" />.</para>
/// <para>Encoder for <see cref="OpenIdError" />.</para>
/// </summary>
private class ErrUnionEncoder : enc.StructEncoder<ErrUnion>
private class OpenIdErrorEncoder : enc.StructEncoder<OpenIdError>
{
/// <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(ErrUnion value, enc.IJsonWriter writer)
public override void EncodeFields(OpenIdError value, enc.IJsonWriter writer)
{
if (value is AuthError)
if (value is IncorrectOpenidScopes)
{
WriteProperty(".tag", "auth_error", writer, enc.StringEncoder.Instance);
AuthError.Encoder.EncodeFields((AuthError)value, writer);
WriteProperty(".tag", "incorrect_openid_scopes", writer, enc.StringEncoder.Instance);
IncorrectOpenidScopes.Encoder.EncodeFields((IncorrectOpenidScopes)value, writer);
return;
}
if (value is Other)
Expand All @@ -113,17 +113,17 @@ public override void EncodeFields(ErrUnion value, enc.IJsonWriter writer)
#region Decoder class

/// <summary>
/// <para>Decoder for <see cref="ErrUnion" />.</para>
/// <para>Decoder for <see cref="OpenIdError" />.</para>
/// </summary>
private class ErrUnionDecoder : enc.UnionDecoder<ErrUnion>
private class OpenIdErrorDecoder : enc.UnionDecoder<OpenIdError>
{
/// <summary>
/// <para>Create a new instance of type <see cref="ErrUnion" />.</para>
/// <para>Create a new instance of type <see cref="OpenIdError" />.</para>
/// </summary>
/// <returns>The struct instance.</returns>
protected override ErrUnion Create()
protected override OpenIdError Create()
{
return new ErrUnion();
return new OpenIdError();
}

/// <summary>
Expand All @@ -132,12 +132,12 @@ protected override ErrUnion Create()
/// <param name="tag">The tag.</param>
/// <param name="reader">The json reader.</param>
/// <returns>The decoded object.</returns>
protected override ErrUnion Decode(string tag, enc.IJsonReader reader)
protected override OpenIdError Decode(string tag, enc.IJsonReader reader)
{
switch (tag)
{
case "auth_error":
return AuthError.Decoder.DecodeFields(reader);
case "incorrect_openid_scopes":
return IncorrectOpenidScopes.Decoder.DecodeFields(reader);
default:
return Other.Decoder.DecodeFields(reader);
}
Expand All @@ -147,57 +147,49 @@ protected override ErrUnion Decode(string tag, enc.IJsonReader reader)
#endregion

/// <summary>
/// <para>The auth error object</para>
/// <para>Missing openid claims for the associated access token.</para>
/// </summary>
public sealed class AuthError : ErrUnion
public sealed class IncorrectOpenidScopes : OpenIdError
{
#pragma warning disable 108

/// <summary>
/// <para>The encoder instance.</para>
/// </summary>
internal static enc.StructEncoder<AuthError> Encoder = new AuthErrorEncoder();
internal static enc.StructEncoder<IncorrectOpenidScopes> Encoder = new IncorrectOpenidScopesEncoder();

/// <summary>
/// <para>The decoder instance.</para>
/// </summary>
internal static enc.StructDecoder<AuthError> Decoder = new AuthErrorDecoder();
internal static enc.StructDecoder<IncorrectOpenidScopes> Decoder = new IncorrectOpenidScopesDecoder();

/// <summary>
/// <para>Initializes a new instance of the <see cref="AuthError" /> class.</para>
/// <para>Initializes a new instance of the <see cref="IncorrectOpenidScopes" />
/// class.</para>
/// </summary>
/// <param name="value">The value</param>
public AuthError(global::Dropbox.Api.Openid.AuthError value)
{
this.Value = value;
}
/// <summary>
/// <para>Initializes a new instance of the <see cref="AuthError" /> class.</para>
/// </summary>
private AuthError()
private IncorrectOpenidScopes()
{
}

/// <summary>
/// <para>Gets the value of this instance.</para>
/// <para>A singleton instance of IncorrectOpenidScopes</para>
/// </summary>
public global::Dropbox.Api.Openid.AuthError Value { get; private set; }
public static readonly IncorrectOpenidScopes Instance = new IncorrectOpenidScopes();

#region Encoder class

/// <summary>
/// <para>Encoder for <see cref="AuthError" />.</para>
/// <para>Encoder for <see cref="IncorrectOpenidScopes" />.</para>
/// </summary>
private class AuthErrorEncoder : enc.StructEncoder<AuthError>
private class IncorrectOpenidScopesEncoder : enc.StructEncoder<IncorrectOpenidScopes>
{
/// <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(AuthError value, enc.IJsonWriter writer)
public override void EncodeFields(IncorrectOpenidScopes value, enc.IJsonWriter writer)
{
WriteProperty("auth_error", value.Value, writer, global::Dropbox.Api.Openid.AuthError.Encoder);
}
}

Expand All @@ -206,37 +198,20 @@ public override void EncodeFields(AuthError value, enc.IJsonWriter writer)
#region Decoder class

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

/// <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(AuthError value, string fieldName, enc.IJsonReader reader)
{
switch (fieldName)
{
case "auth_error":
value.Value = global::Dropbox.Api.Openid.AuthError.Decoder.Decode(reader);
break;
default:
reader.Skip();
break;
}
}
}

#endregion
Expand All @@ -245,7 +220,7 @@ protected override void SetField(AuthError value, string fieldName, enc.IJsonRea
/// <summary>
/// <para>The other object</para>
/// </summary>
public sealed class Other : ErrUnion
public sealed class Other : OpenIdError
{
#pragma warning disable 108

Expand Down
Loading

0 comments on commit 0dbd222

Please sign in to comment.