Skip to content

Commit

Permalink
Update specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiming Yuan committed Oct 6, 2017
1 parent ba999ac commit 2539805
Show file tree
Hide file tree
Showing 12 changed files with 501 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("4.0.0")]
[assembly: AssemblyFileVersion("4.0.6488")]
[assembly: AssemblyFileVersion("4.0.6489")]
1 change: 1 addition & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Dropbox.Api.Doc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
<Compile Include="Generated\Files\ListFolderResult.cs" />
<Compile Include="Generated\Files\ListRevisionsArg.cs" />
<Compile Include="Generated\Files\ListRevisionsError.cs" />
<Compile Include="Generated\Files\ListRevisionsMode.cs" />
<Compile Include="Generated\Files\ListRevisionsResult.cs" />
<Compile Include="Generated\Files\LookupError.cs" />
<Compile Include="Generated\Files\MediaInfo.cs" />
Expand Down
1 change: 1 addition & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Dropbox.Api.Portable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
<Compile Include="Generated\Files\ListFolderResult.cs" />
<Compile Include="Generated\Files\ListRevisionsArg.cs" />
<Compile Include="Generated\Files\ListRevisionsError.cs" />
<Compile Include="Generated\Files\ListRevisionsMode.cs" />
<Compile Include="Generated\Files\ListRevisionsResult.cs" />
<Compile Include="Generated\Files\LookupError.cs" />
<Compile Include="Generated\Files\MediaInfo.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@
<Compile Include="Generated\Files\ListFolderResult.cs" />
<Compile Include="Generated\Files\ListRevisionsArg.cs" />
<Compile Include="Generated\Files\ListRevisionsError.cs" />
<Compile Include="Generated\Files\ListRevisionsMode.cs" />
<Compile Include="Generated\Files\ListRevisionsResult.cs" />
<Compile Include="Generated\Files\LookupError.cs" />
<Compile Include="Generated\Files\MediaInfo.cs" />
Expand Down
1 change: 1 addition & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Dropbox.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
<Compile Include="Generated\Files\ListFolderResult.cs" />
<Compile Include="Generated\Files\ListRevisionsArg.cs" />
<Compile Include="Generated\Files\ListRevisionsError.cs" />
<Compile Include="Generated\Files\ListRevisionsMode.cs" />
<Compile Include="Generated\Files\ListRevisionsResult.cs" />
<Compile Include="Generated\Files\LookupError.cs" />
<Compile Include="Generated\Files\MediaInfo.cs" />
Expand Down
5 changes: 3 additions & 2 deletions dropbox-sdk-dotnet/Dropbox.Api/Dropbox.Api.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<description>Portable class library for accessing the Dropbox v2 API</description>
<releaseNotes>
What's New:
- ListFolder now supports shared links.

- Files:
- ListFolder now supports shared links.
- Added Mode parameter to ListRevisions.
</releaseNotes>
<copyright>Copyright (c) Dropbox Inc. 2016</copyright>
<tags>Dropbox Api</tags>
Expand Down
90 changes: 58 additions & 32 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/FilesUserRoutes.cs

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/ListFolderArg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ public class ListFolderArg
/// <para>Initializes a new instance of the <see cref="ListFolderArg" /> class.</para>
/// </summary>
/// <param name="path">A unique identifier for the file.</param>
/// <param name="sharedLink">A shared link to list the contents of, if the link is
/// protected provide the password. if this field is present, <see
/// cref="Dropbox.Api.Files.ListFolderArg.Path" /> will be relative to root of the
/// shared link. Only non-recursive mode is supported for shared link.</param>
/// <param name="recursive">If true, the list folder operation will be applied
/// recursively to all subfolders and the response will contain contents of all
/// subfolders.</param>
Expand All @@ -51,14 +47,18 @@ public class ListFolderArg
/// <param name="limit">The maximum number of results to return per request. Note: This
/// is an approximate number and there can be slightly more entries returned in some
/// cases.</param>
/// <param name="sharedLink">A shared link to list the contents of. If the link is
/// password-protected, the password must be provided. If this field is present, <see
/// cref="Dropbox.Api.Files.ListFolderArg.Path" /> will be relative to root of the
/// shared link. Only non-recursive mode is supported for shared link.</param>
public ListFolderArg(string path,
SharedLink sharedLink = null,
bool recursive = false,
bool includeMediaInfo = false,
bool includeDeleted = false,
bool includeHasExplicitSharedMembers = false,
bool includeMountedFolders = true,
uint? limit = null)
uint? limit = null,
SharedLink sharedLink = null)
{
if (path == null)
{
Expand All @@ -82,13 +82,13 @@ public ListFolderArg(string path,
}

this.Path = path;
this.SharedLink = sharedLink;
this.Recursive = recursive;
this.IncludeMediaInfo = includeMediaInfo;
this.IncludeDeleted = includeDeleted;
this.IncludeHasExplicitSharedMembers = includeHasExplicitSharedMembers;
this.IncludeMountedFolders = includeMountedFolders;
this.Limit = limit;
this.SharedLink = sharedLink;
}

/// <summary>
Expand All @@ -111,14 +111,6 @@ public ListFolderArg()
/// </summary>
public string Path { get; protected set; }

/// <summary>
/// <para>A shared link to list the contents of, if the link is protected provide the
/// password. if this field is present, <see
/// cref="Dropbox.Api.Files.ListFolderArg.Path" /> will be relative to root of the
/// shared link. Only non-recursive mode is supported for shared link.</para>
/// </summary>
public SharedLink SharedLink { get; protected set; }

/// <summary>
/// <para>If true, the list folder operation will be applied recursively to all
/// subfolders and the response will contain contents of all subfolders.</para>
Expand Down Expand Up @@ -156,6 +148,14 @@ public ListFolderArg()
/// </summary>
public uint? Limit { get; protected set; }

/// <summary>
/// <para>A shared link to list the contents of. If the link is password-protected, the
/// password must be provided. If this field is present, <see
/// cref="Dropbox.Api.Files.ListFolderArg.Path" /> will be relative to root of the
/// shared link. Only non-recursive mode is supported for shared link.</para>
/// </summary>
public SharedLink SharedLink { get; protected set; }

#region Encoder class

/// <summary>
Expand All @@ -171,10 +171,6 @@ private class ListFolderArgEncoder : enc.StructEncoder<ListFolderArg>
public override void EncodeFields(ListFolderArg value, enc.IJsonWriter writer)
{
WriteProperty("path", value.Path, writer, enc.StringEncoder.Instance);
if (value.SharedLink != null)
{
WriteProperty("shared_link", value.SharedLink, writer, global::Dropbox.Api.Files.SharedLink.Encoder);
}
WriteProperty("recursive", value.Recursive, writer, enc.BooleanEncoder.Instance);
WriteProperty("include_media_info", value.IncludeMediaInfo, writer, enc.BooleanEncoder.Instance);
WriteProperty("include_deleted", value.IncludeDeleted, writer, enc.BooleanEncoder.Instance);
Expand All @@ -184,6 +180,10 @@ public override void EncodeFields(ListFolderArg value, enc.IJsonWriter writer)
{
WriteProperty("limit", value.Limit.Value, writer, enc.UInt32Encoder.Instance);
}
if (value.SharedLink != null)
{
WriteProperty("shared_link", value.SharedLink, writer, global::Dropbox.Api.Files.SharedLink.Encoder);
}
}
}

Expand Down Expand Up @@ -219,9 +219,6 @@ protected override void SetField(ListFolderArg value, string fieldName, enc.IJso
case "path":
value.Path = enc.StringDecoder.Instance.Decode(reader);
break;
case "shared_link":
value.SharedLink = global::Dropbox.Api.Files.SharedLink.Decoder.Decode(reader);
break;
case "recursive":
value.Recursive = enc.BooleanDecoder.Instance.Decode(reader);
break;
Expand All @@ -240,6 +237,9 @@ protected override void SetField(ListFolderArg value, string fieldName, enc.IJso
case "limit":
value.Limit = enc.UInt32Decoder.Instance.Decode(reader);
break;
case "shared_link":
value.SharedLink = global::Dropbox.Api.Files.SharedLink.Decoder.Decode(reader);
break;
default:
reader.Skip();
break;
Expand Down
19 changes: 19 additions & 0 deletions dropbox-sdk-dotnet/Dropbox.Api/Generated/Files/ListRevisionsArg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ public class ListRevisionsArg
/// class.</para>
/// </summary>
/// <param name="path">The path to the file you want to see the revisions of.</param>
/// <param name="mode">Determines the behavior of the API in listing the revisions for
/// a given file path or id.</param>
/// <param name="limit">The maximum number of revision entries returned.</param>
public ListRevisionsArg(string path,
ListRevisionsMode mode = null,
ulong limit = 10)
{
if (path == null)
Expand All @@ -45,6 +48,10 @@ public ListRevisionsArg(string path,
throw new sys.ArgumentOutOfRangeException("path", @"Value should match pattern '\A(?:/(.|[\r\n])*|id:.*|(ns:[0-9]+(/.*)?))\z'");
}

if (mode == null)
{
mode = global::Dropbox.Api.Files.ListRevisionsMode.Path.Instance;
}
if (limit < 1UL)
{
throw new sys.ArgumentOutOfRangeException("limit", "Value should be greater or equal than 1");
Expand All @@ -55,6 +62,7 @@ public ListRevisionsArg(string path,
}

this.Path = path;
this.Mode = mode;
this.Limit = limit;
}

Expand All @@ -67,6 +75,7 @@ public ListRevisionsArg(string path,
[sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)]
public ListRevisionsArg()
{
this.Mode = global::Dropbox.Api.Files.ListRevisionsMode.Path.Instance;
this.Limit = 10;
}

Expand All @@ -75,6 +84,12 @@ public ListRevisionsArg()
/// </summary>
public string Path { get; protected set; }

/// <summary>
/// <para>Determines the behavior of the API in listing the revisions for a given file
/// path or id.</para>
/// </summary>
public ListRevisionsMode Mode { get; protected set; }

/// <summary>
/// <para>The maximum number of revision entries returned.</para>
/// </summary>
Expand All @@ -95,6 +110,7 @@ private class ListRevisionsArgEncoder : enc.StructEncoder<ListRevisionsArg>
public override void EncodeFields(ListRevisionsArg value, enc.IJsonWriter writer)
{
WriteProperty("path", value.Path, writer, enc.StringEncoder.Instance);
WriteProperty("mode", value.Mode, writer, global::Dropbox.Api.Files.ListRevisionsMode.Encoder);
WriteProperty("limit", value.Limit, writer, enc.UInt64Encoder.Instance);
}
}
Expand Down Expand Up @@ -131,6 +147,9 @@ protected override void SetField(ListRevisionsArg value, string fieldName, enc.I
case "path":
value.Path = enc.StringDecoder.Instance.Decode(reader);
break;
case "mode":
value.Mode = global::Dropbox.Api.Files.ListRevisionsMode.Decoder.Decode(reader);
break;
case "limit":
value.Limit = enc.UInt64Decoder.Instance.Decode(reader);
break;
Expand Down
Loading

0 comments on commit 2539805

Please sign in to comment.