Skip to content

Commit 8abced6

Browse files
authored
Release 4.9.3 (#90)
* Fix API tests to nest under a folder instead of acting at the root - Doing this enables using user accounts that don't have an empty root * Update to new routes
1 parent a158f2d commit 8abced6

File tree

58 files changed

+6141
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+6141
-305
lines changed

buildall.ps1

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,41 @@ $nugetPath = "$nugetDir\nuget.exe"
1919
$nugetSpecPath = "$sourceDir\Dropbox.Api.nuspec"
2020
$docBuildPath = Resolve-Path "doc\StoneDocs.shfbproj"
2121
$majorVersion = "4.0"
22-
$releaseVersion = "4.9.2"
22+
$releaseVersion = "4.9.3"
2323
$assemblyInfoPath = "$sourceDir\AppProperties\AssemblyInfo.cs"
2424
$signKeyPath = "$sourceDir\dropbox_api_key.snk"
2525
$releaseNotes = @'
2626
What's New:
27-
- Files Namespace:
28-
- Updated doc strings
2927
30-
- Team_log Namespace:
31-
- Updated event docstrings
32-
- New reset field for loading events with a cursor
28+
- Common Namespace:
29+
- Force matching dot character in alias EmailAddress
30+
- Allow DisplayNameLegacy to support a name of zero chars
31+
32+
- Contacts namespace:
33+
- New namespace
34+
- New routes: delete_manual_contacts and delete_manual_contacts_batch
35+
- New argument structs for new routes
36+
37+
- File_properties namespace:
38+
- Doesn't allow app folder app to access file property endpoints.
39+
40+
- Files namespace:
41+
- Create copy_batch:2 and move_batch:2 endpoints. Deprecate existing copy_batch and move_batch.
42+
43+
- Sharing namespace:
44+
- Add no_one option to LinkAudience union
45+
46+
- Sharing_files namespace:
47+
- Doesn't allow app folder app to access sharing files endpoints.
48+
49+
- Teams namespace:
50+
- Only Team apps with Team member file access can access team/properties endpoints.
51+
- Add is_disconnected boolean to RemovedStatus struct
52+
- Add error response type to namespace/list route
53+
54+
- Team_log namespace:
3355
- New event types added
3456
35-
- Team_policies Namespace:
36-
- New CameraUploadsPolicyState union
3757
'@
3858

3959
$builds = @(

dropbox-sdk-dotnet/Dropbox.Api.Tests/DropboxApiTests.cs

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace Dropbox.Api.Tests
2020
using Dropbox.Api.Auth;
2121
using Dropbox.Api.Common;
2222
using Dropbox.Api.Users;
23+
using Dropbox.Api.Files;
2324

2425
/// <summary>
2526
/// The test class for Dropbox API.
@@ -47,6 +48,7 @@ public class DropboxApiTests
4748
/// </summary>
4849
public static DropboxAppClient AppClient;
4950

51+
private readonly static string TestingPath = "/Testing/Dropbox.Api.Tests";
5052

5153
[ClassInitialize]
5254
public static void Initialize(TestContext context)
@@ -64,20 +66,28 @@ public static void Initialize(TestContext context)
6466
}
6567

6668
[TestInitialize]
67-
public void Initialize()
69+
public async void Initialize()
6870
{
69-
var result = Client.Files.ListFolderAsync("").Result;
70-
Assert.AreEqual(result.Entries.Count, 0);
71+
try
72+
{
73+
var result = await Client.Files.ListFolderAsync(TestingPath);
74+
Assert.AreEqual(0, result.Entries.Count);
75+
} catch (ApiException<ListFolderError>)
76+
{
77+
// create folder if it doesn't exist
78+
var result = Client.Files.CreateFolderV2Async(TestingPath).Result;
79+
Assert.AreEqual(TestingPath, result.Metadata.PathDisplay);
80+
}
7181
}
7282

7383

7484
[TestCleanup]
7585
public void Cleanup()
7686
{
77-
var result = Client.Files.ListFolderAsync("").Result;
87+
var result = Client.Files.ListFolderAsync(TestingPath).Result;
7888

7989
foreach (var entry in result.Entries) {
80-
Client.Files.DeleteAsync(entry.PathLower).Wait();
90+
Client.Files.DeleteV2Async(entry.PathLower).Wait();
8191
}
8292
}
8393

@@ -88,11 +98,11 @@ public void Cleanup()
8898
[TestMethod]
8999
public async Task TestGetMetadata()
90100
{
91-
await Client.Files.UploadAsync("/Foo.txt", body: GetStream("abc"));
92-
var metadata = await Client.Files.GetMetadataAsync("/Foo.txt");
101+
await Client.Files.UploadAsync(TestingPath + "/Foo.txt", body: GetStream("abc"));
102+
var metadata = await Client.Files.GetMetadataAsync(TestingPath + "/Foo.txt");
93103
Assert.AreEqual("Foo.txt", metadata.Name);
94-
Assert.AreEqual("/foo.txt", metadata.PathLower);
95-
Assert.AreEqual("/Foo.txt", metadata.PathDisplay);
104+
Assert.AreEqual(TestingPath.ToLower() + "/foo.txt", metadata.PathLower);
105+
Assert.AreEqual(TestingPath + "/Foo.txt", metadata.PathDisplay);
96106
Assert.IsTrue(metadata.IsFile);
97107

98108
var file = metadata.AsFile;
@@ -106,17 +116,17 @@ public async Task TestGetMetadata()
106116
[TestMethod]
107117
public async Task TestListFolder()
108118
{
109-
var files = new HashSet<string> { "/a.txt", "/b.txt", "/c.txt" };
119+
var files = new HashSet<string> { "a.txt", "b.txt", "c.txt" };
110120
foreach (var file in files)
111121
{
112-
await Client.Files.UploadAsync(file, body: GetStream("abc"));
122+
await Client.Files.UploadAsync(TestingPath + "/" + file, body: GetStream("abc"));
113123
}
114124

115-
var response = await Client.Files.ListFolderAsync("");
125+
var response = await Client.Files.ListFolderAsync(TestingPath);
116126
Assert.AreEqual(files.Count, response.Entries.Count);
117127
foreach (var entry in response.Entries)
118128
{
119-
Assert.IsTrue(files.Contains(entry.PathLower));
129+
Assert.IsTrue(files.Contains(entry.Name));
120130
Assert.IsTrue(entry.IsFile);
121131
var file = entry.AsFile;
122132
Assert.AreEqual(3, (int)file.Size);
@@ -130,11 +140,11 @@ public async Task TestListFolder()
130140
[TestMethod]
131141
public async Task TestUpload()
132142
{
133-
var response = await Client.Files.UploadAsync("/Foo.txt", body: GetStream("abc"));
143+
var response = await Client.Files.UploadAsync(TestingPath + "/Foo.txt", body: GetStream("abc"));
134144
Assert.AreEqual(response.Name, "Foo.txt");
135-
Assert.AreEqual(response.PathLower, "/foo.txt");
136-
Assert.AreEqual(response.PathDisplay, "/Foo.txt");
137-
var downloadResponse = await Client.Files.DownloadAsync("/Foo.txt");
145+
Assert.AreEqual(response.PathLower, TestingPath.ToLower() + "/foo.txt");
146+
Assert.AreEqual(response.PathDisplay, TestingPath + "/Foo.txt");
147+
var downloadResponse = await Client.Files.DownloadAsync(TestingPath + "/Foo.txt");
138148
var content = await downloadResponse.GetContentAsStringAsync();
139149
Assert.AreEqual("abc", content);
140150
}
@@ -168,8 +178,8 @@ public async Task TestUploadRetry()
168178
UserAccessToken,
169179
new DropboxClientConfig { HttpClient = mockClient, MaxRetriesOnError = 10 });
170180

171-
var response = await client.Files.UploadAsync("/Foo.txt", body: GetStream("abc"));
172-
var downloadResponse = await Client.Files.DownloadAsync("/Foo.txt");
181+
var response = await client.Files.UploadAsync(TestingPath + "/Foo.txt", body: GetStream("abc"));
182+
var downloadResponse = await Client.Files.DownloadAsync(TestingPath + "/Foo.txt");
173183
var content = await downloadResponse.GetContentAsStringAsync();
174184
Assert.AreEqual("abc", content);
175185
}
@@ -182,14 +192,14 @@ public async Task TestUploadRetry()
182192
[TestMethod]
183193
public async Task TestDownload()
184194
{
185-
await Client.Files.UploadAsync("/Foo.txt", body: GetStream("abc"));
186-
var downloadResponse = await Client.Files.DownloadAsync("/Foo.txt");
195+
await Client.Files.UploadAsync(TestingPath + "/Foo.txt", body: GetStream("abc"));
196+
var downloadResponse = await Client.Files.DownloadAsync(TestingPath + "/Foo.txt");
187197
var content = await downloadResponse.GetContentAsStringAsync();
188198
Assert.AreEqual("abc", content);
189199
var response = downloadResponse.Response;
190200
Assert.AreEqual(response.Name, "Foo.txt");
191-
Assert.AreEqual(response.PathLower, "/foo.txt");
192-
Assert.AreEqual(response.PathDisplay, "/Foo.txt");
201+
Assert.AreEqual(response.PathLower, TestingPath.ToLower() + "/foo.txt");
202+
Assert.AreEqual(response.PathDisplay, TestingPath + "/Foo.txt");
193203
}
194204

195205
/// Test rate limit error handling.
@@ -211,7 +221,7 @@ public async Task TestRateLimit()
211221
var client = new DropboxClient("dummy", new DropboxClientConfig { HttpClient = mockClient });
212222
try
213223
{
214-
await client.Files.GetMetadataAsync("/a.txt");
224+
await client.Files.GetMetadataAsync(TestingPath + "/a.txt");
215225
}
216226
catch (RateLimitException ex)
217227
{
@@ -294,19 +304,18 @@ public async Task TestTeamAuthSelectAdmin()
294304
[TestMethod]
295305
public async Task TestPathRoot()
296306
{
297-
await Client.Files.UploadAsync("/Foo.txt", body: GetStream("abc"));
307+
await Client.Files.UploadAsync(TestingPath + "/Foo.txt", body: GetStream("abc"));
298308

299309
var pathRootClient = Client.WithPathRoot(PathRoot.Home.Instance);
300-
var metadata = await pathRootClient.Files.GetMetadataAsync("/Foo.txt");
301-
Assert.AreEqual("/foo.txt", metadata.PathLower);
302-
310+
var metadata = await pathRootClient.Files.GetMetadataAsync(TestingPath + "/Foo.txt");
311+
Assert.AreEqual(TestingPath.ToLower() + "/foo.txt", metadata.PathLower);
303312
pathRootClient = Client.WithPathRoot(new PathRoot.Root("123"));
304313

305314
var exceptionRaised = false;
306315

307316
try
308317
{
309-
await pathRootClient.Files.GetMetadataAsync("/Foo.txt");
318+
await pathRootClient.Files.GetMetadataAsync(TestingPath + "/Foo.txt");
310319
}
311320
catch (PathRootException e)
312321
{
@@ -344,7 +353,7 @@ public async Task TestNoAuth()
344353
var cursor = result.Cursor;
345354

346355
var task = Client.Files.ListFolderLongpollAsync(cursor);
347-
await Client.Files.UploadAsync("/foo.txt", body: GetStream("abc"));
356+
await Client.Files.UploadAsync(TestingPath + "/foo.txt", body: GetStream("abc"));
348357
var response = await task;
349358
Assert.IsTrue(response.Changes);
350359
}

dropbox-sdk-dotnet/Dropbox.Api.sln

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio 2013
3-
VisualStudioVersion = 12.0.40629.0
2+
# Visual Studio 15
3+
VisualStudioVersion = 15.0.28307.168
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleBlogDemo", "Examples\SimpleBlogDemo\SimpleBlogDemo.csproj", "{8772EB1E-3019-4FB3-9059-67681693E873}"
66
EndProject
@@ -27,8 +27,8 @@ EndProject
2727
Global
2828
GlobalSection(SharedMSBuildProjectFiles) = preSolution
2929
Examples\UniversalDemo\UniversalDemo\UniversalDemo.Shared\UniversalDemo.Shared.projitems*{51d9899c-31d6-4c22-b894-e9498cb90577}*SharedItemsImports = 4
30-
Examples\UniversalDemo\UniversalDemo\UniversalDemo.Shared\UniversalDemo.Shared.projitems*{6bcc4215-b726-4b37-a932-4dca74a1d465}*SharedItemsImports = 13
3130
Examples\UniversalDemo\UniversalDemo\UniversalDemo.Shared\UniversalDemo.Shared.projitems*{680e8f6f-aa67-4912-ae20-f89e482dc2cd}*SharedItemsImports = 4
31+
Examples\UniversalDemo\UniversalDemo\UniversalDemo.Shared\UniversalDemo.Shared.projitems*{6bcc4215-b726-4b37-a932-4dca74a1d465}*SharedItemsImports = 13
3232
EndGlobalSection
3333
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3434
Debug|Any CPU = Debug|Any CPU
@@ -135,6 +135,22 @@ Global
135135
{68180B54-4724-4CD1-BAA6-EE7BC309797C}.Release|ARM.ActiveCfg = Release|Any CPU
136136
{68180B54-4724-4CD1-BAA6-EE7BC309797C}.Release|x64.ActiveCfg = Release|Any CPU
137137
{68180B54-4724-4CD1-BAA6-EE7BC309797C}.Release|x86.ActiveCfg = Release|Any CPU
138+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
139+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|Any CPU.Build.0 = Debug|Any CPU
140+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|ARM.ActiveCfg = Debug|Any CPU
141+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|ARM.Build.0 = Debug|Any CPU
142+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|x64.ActiveCfg = Debug|Any CPU
143+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|x64.Build.0 = Debug|Any CPU
144+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|x86.ActiveCfg = Debug|Any CPU
145+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Debug|x86.Build.0 = Debug|Any CPU
146+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|Any CPU.ActiveCfg = Release|Any CPU
147+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|Any CPU.Build.0 = Release|Any CPU
148+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|ARM.ActiveCfg = Release|Any CPU
149+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|ARM.Build.0 = Release|Any CPU
150+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|x64.ActiveCfg = Release|Any CPU
151+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|x64.Build.0 = Release|Any CPU
152+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|x86.ActiveCfg = Release|Any CPU
153+
{B562AEC0-DAF8-457C-B5ED-AF03B133F168}.Release|x86.Build.0 = Release|Any CPU
138154
{B762DE35-E606-4B57-8860-1A662DF5624C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
139155
{B762DE35-E606-4B57-8860-1A662DF5624C}.Debug|Any CPU.Build.0 = Debug|Any CPU
140156
{B762DE35-E606-4B57-8860-1A662DF5624C}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -159,4 +175,7 @@ Global
159175
GlobalSection(SolutionProperties) = preSolution
160176
HideSolutionNode = FALSE
161177
EndGlobalSection
178+
GlobalSection(ExtensibilityGlobals) = postSolution
179+
SolutionGuid = {B3C08646-2DF0-404C-9A72-D460143D9639}
180+
EndGlobalSection
162181
EndGlobal

dropbox-sdk-dotnet/Dropbox.Api/AppProperties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[assembly: AssemblyCulture("")]
1919

2020
[assembly: AssemblyVersion("4.0.0")]
21-
[assembly: AssemblyFileVersion("4.0.6885")]
21+
[assembly: AssemblyFileVersion("4.0.6925")]
2222

2323
#if DEBUG
2424
[assembly: InternalsVisibleTo("Dropbox.Api.Tests")]

dropbox-sdk-dotnet/Dropbox.Api/Dropbox.Api.Doc.csproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
<Compile Include="Generated\Common\RootInfo.cs" />
100100
<Compile Include="Generated\Common\TeamRootInfo.cs" />
101101
<Compile Include="Generated\Common\UserRootInfo.cs" />
102+
<Compile Include="Generated\Contacts\ContactsUserRoutes.cs" />
103+
<Compile Include="Generated\Contacts\DeleteManualContactsArg.cs" />
104+
<Compile Include="Generated\Contacts\DeleteManualContactsError.cs" />
102105
<Compile Include="Generated\DropboxAppClient.cs" />
103106
<Compile Include="Generated\DropboxClient.cs" />
104107
<Compile Include="Generated\DropboxTeamClient.cs" />
@@ -231,16 +234,23 @@
231234
<Compile Include="Generated\Files\MediaInfo.cs" />
232235
<Compile Include="Generated\Files\MediaMetadata.cs" />
233236
<Compile Include="Generated\Files\Metadata.cs" />
237+
<Compile Include="Generated\Files\MoveBatchArg.cs" />
234238
<Compile Include="Generated\Files\PhotoMetadata.cs" />
235239
<Compile Include="Generated\Files\PreviewArg.cs" />
236240
<Compile Include="Generated\Files\PreviewError.cs" />
237241
<Compile Include="Generated\Files\RelocationArg.cs" />
238242
<Compile Include="Generated\Files\RelocationBatchArg.cs" />
243+
<Compile Include="Generated\Files\RelocationBatchArgBase.cs" />
239244
<Compile Include="Generated\Files\RelocationBatchError.cs" />
245+
<Compile Include="Generated\Files\RelocationBatchErrorEntry.cs" />
240246
<Compile Include="Generated\Files\RelocationBatchJobStatus.cs" />
241247
<Compile Include="Generated\Files\RelocationBatchLaunch.cs" />
242248
<Compile Include="Generated\Files\RelocationBatchResult.cs" />
243249
<Compile Include="Generated\Files\RelocationBatchResultData.cs" />
250+
<Compile Include="Generated\Files\RelocationBatchResultEntry.cs" />
251+
<Compile Include="Generated\Files\RelocationBatchV2JobStatus.cs" />
252+
<Compile Include="Generated\Files\RelocationBatchV2Launch.cs" />
253+
<Compile Include="Generated\Files\RelocationBatchV2Result.cs" />
244254
<Compile Include="Generated\Files\RelocationError.cs" />
245255
<Compile Include="Generated\Files\RelocationPath.cs" />
246256
<Compile Include="Generated\Files\RelocationResult.cs" />
@@ -676,6 +686,7 @@
676686
<Compile Include="Generated\Team\TeamNamespacesListArg.cs" />
677687
<Compile Include="Generated\Team\TeamNamespacesListContinueArg.cs" />
678688
<Compile Include="Generated\Team\TeamNamespacesListContinueError.cs" />
689+
<Compile Include="Generated\Team\TeamNamespacesListError.cs" />
679690
<Compile Include="Generated\Team\TeamNamespacesListResult.cs" />
680691
<Compile Include="Generated\Team\TeamTeamRoutes.cs" />
681692
<Compile Include="Generated\Team\TokenGetAuthenticatedAdminError.cs" />
@@ -722,6 +733,9 @@
722733
<Compile Include="Generated\TeamLog\AppUnlinkUserDetails.cs" />
723734
<Compile Include="Generated\TeamLog\AppUnlinkUserType.cs" />
724735
<Compile Include="Generated\TeamLog\AssetLogInfo.cs" />
736+
<Compile Include="Generated\TeamLog\CameraUploadsPolicy.cs" />
737+
<Compile Include="Generated\TeamLog\CameraUploadsPolicyChangedDetails.cs" />
738+
<Compile Include="Generated\TeamLog\CameraUploadsPolicyChangedType.cs" />
725739
<Compile Include="Generated\TeamLog\Certificate.cs" />
726740
<Compile Include="Generated\TeamLog\CollectionShareDetails.cs" />
727741
<Compile Include="Generated\TeamLog\CollectionShareType.cs" />
@@ -837,6 +851,8 @@
837851
<Compile Include="Generated\TeamLog\FileDeleteType.cs" />
838852
<Compile Include="Generated\TeamLog\FileDownloadDetails.cs" />
839853
<Compile Include="Generated\TeamLog\FileDownloadType.cs" />
854+
<Compile Include="Generated\TeamLog\FileEditCommentDetails.cs" />
855+
<Compile Include="Generated\TeamLog\FileEditCommentType.cs" />
840856
<Compile Include="Generated\TeamLog\FileEditDetails.cs" />
841857
<Compile Include="Generated\TeamLog\FileEditType.cs" />
842858
<Compile Include="Generated\TeamLog\FileGetCopyReferenceDetails.cs" />
@@ -1397,6 +1413,8 @@
13971413
<Compile Include="Generated\TeamLog\TfaResetDetails.cs" />
13981414
<Compile Include="Generated\TeamLog\TfaResetType.cs" />
13991415
<Compile Include="Generated\TeamLog\TimeUnit.cs" />
1416+
<Compile Include="Generated\TeamLog\TrustedNonTeamMemberLogInfo.cs" />
1417+
<Compile Include="Generated\TeamLog\TrustedNonTeamMemberType.cs" />
14001418
<Compile Include="Generated\TeamLog\TwoAccountChangePolicyDetails.cs" />
14011419
<Compile Include="Generated\TeamLog\TwoAccountChangePolicyType.cs" />
14021420
<Compile Include="Generated\TeamLog\TwoAccountPolicy.cs" />

0 commit comments

Comments
 (0)