Skip to content

Commit 20db892

Browse files
committed
Sync with private repo
1 parent 88401f9 commit 20db892

File tree

84 files changed

+2897
-2678
lines changed

Some content is hidden

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

84 files changed

+2897
-2678
lines changed

Dropbox.Api/Dropbox.Api.Doc.csproj

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,70 +64,70 @@
6464
<Compile Include="DropboxClient.common.cs" />
6565
<Compile Include="DropboxClient.cs" />
6666
<Compile Include="DropboxOauth2Helper.cs" />
67-
<Compile Include="Files\CommitConflictError.cs" />
68-
<Compile Include="Files\CommitError.cs" />
6967
<Compile Include="Files\CommitInfo.cs" />
7068
<Compile Include="Files\CreateFolderArg.cs" />
69+
<Compile Include="Files\CreateFolderError.cs" />
7170
<Compile Include="Files\DeleteArg.cs" />
71+
<Compile Include="Files\DeleteError.cs" />
7272
<Compile Include="Files\DeletedMetadata.cs" />
73-
<Compile Include="Files\Disallowed.cs" />
74-
<Compile Include="Files\DisallowedReason.cs" />
7573
<Compile Include="Files\DownloadArg.cs" />
7674
<Compile Include="Files\DownloadError.cs" />
7775
<Compile Include="Files\FileMetadata.cs" />
7876
<Compile Include="Files\FilesRoutes.cs" />
7977
<Compile Include="Files\FolderMetadata.cs" />
80-
<Compile Include="Files\FolderPathError.cs" />
8178
<Compile Include="Files\GetMetadataArg.cs" />
8279
<Compile Include="Files\GetMetadataError.cs" />
8380
<Compile Include="Files\ListFolderArg.cs" />
8481
<Compile Include="Files\ListFolderContinueArg.cs" />
8582
<Compile Include="Files\ListFolderContinueError.cs" />
8683
<Compile Include="Files\ListFolderError.cs" />
8784
<Compile Include="Files\ListFolderGetLatestCursorResult.cs" />
85+
<Compile Include="Files\ListFolderLongpollArg.cs" />
86+
<Compile Include="Files\ListFolderLongpollError.cs" />
87+
<Compile Include="Files\ListFolderLongpollResult.cs" />
8888
<Compile Include="Files\ListFolderResult.cs" />
8989
<Compile Include="Files\ListRevisionsArg.cs" />
9090
<Compile Include="Files\ListRevisionsError.cs" />
9191
<Compile Include="Files\ListRevisionsResult.cs" />
92+
<Compile Include="Files\LookupError.cs" />
9293
<Compile Include="Files\Metadata.cs" />
93-
<Compile Include="Files\NoFile.cs" />
94-
<Compile Include="Files\NoFileReason.cs" />
95-
<Compile Include="Files\PathError.cs" />
9694
<Compile Include="Files\PreviewArg.cs" />
9795
<Compile Include="Files\PreviewError.cs" />
9896
<Compile Include="Files\RelocationArg.cs" />
9997
<Compile Include="Files\RelocationError.cs" />
10098
<Compile Include="Files\RestoreArg.cs" />
10199
<Compile Include="Files\RestoreError.cs" />
102-
<Compile Include="Files\Restricted.cs" />
103-
<Compile Include="Files\RestrictedReason.cs" />
100+
<Compile Include="Files\SearchArg.cs" />
104101
<Compile Include="Files\SearchError.cs" />
105102
<Compile Include="Files\SearchMatch.cs" />
106103
<Compile Include="Files\SearchMatchType.cs" />
107104
<Compile Include="Files\SearchMode.cs" />
108-
<Compile Include="Files\SearchQuery.cs" />
109-
<Compile Include="Files\SearchResults.cs" />
105+
<Compile Include="Files\SearchResult.cs" />
110106
<Compile Include="Files\ThumbnailArg.cs" />
111107
<Compile Include="Files\ThumbnailError.cs" />
112108
<Compile Include="Files\ThumbnailFormat.cs" />
113109
<Compile Include="Files\ThumbnailSize.cs" />
114-
<Compile Include="Files\UploadCommitError.cs" />
115110
<Compile Include="Files\UploadError.cs" />
116111
<Compile Include="Files\UploadSessionCursor.cs" />
117112
<Compile Include="Files\UploadSessionFinishArg.cs" />
118113
<Compile Include="Files\UploadSessionFinishError.cs" />
119114
<Compile Include="Files\UploadSessionLookupError.cs" />
120115
<Compile Include="Files\UploadSessionOffsetError.cs" />
121116
<Compile Include="Files\UploadSessionStartResult.cs" />
117+
<Compile Include="Files\UploadWriteFailed.cs" />
118+
<Compile Include="Files\WriteConflictError.cs" />
119+
<Compile Include="Files\WriteError.cs" />
122120
<Compile Include="Files\WriteMode.cs" />
123121
<Compile Include="Properties\AssemblyInfo.cs" />
124122
<Compile Include="Sharing\AccessType.cs" />
125123
<Compile Include="Sharing\BasicSharedFolderMetadata.cs" />
126124
<Compile Include="Sharing\CollectionLinkMetadata.cs" />
127125
<Compile Include="Sharing\CreateSharedLinkArg.cs" />
126+
<Compile Include="Sharing\CreateSharedLinkError.cs" />
128127
<Compile Include="Sharing\FullSharedFolderMetadata.cs" />
129128
<Compile Include="Sharing\GetSharedFolderArgs.cs" />
130129
<Compile Include="Sharing\GetSharedLinksArg.cs" />
130+
<Compile Include="Sharing\GetSharedLinksError.cs" />
131131
<Compile Include="Sharing\GetSharedLinksResult.cs" />
132132
<Compile Include="Sharing\GroupInfo.cs" />
133133
<Compile Include="Sharing\GroupMembershipInfo.cs" />
@@ -163,13 +163,6 @@
163163
<Content Include="namespace_summaries.xml" />
164164
</ItemGroup>
165165
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
166-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
167-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
168-
<PropertyGroup>
169-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
170-
</PropertyGroup>
171-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
172-
</Target>
173166
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
174167
Other similar extension points exist, see Microsoft.Common.targets.
175168
<Target Name="BeforeBuild">

Dropbox.Api/Dropbox.Api.csproj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,70 +85,70 @@
8585
<Compile Include="DropboxClient.common.cs" />
8686
<Compile Include="DropboxClient.cs" />
8787
<Compile Include="DropboxOauth2Helper.cs" />
88-
<Compile Include="Files\CommitConflictError.cs" />
89-
<Compile Include="Files\CommitError.cs" />
9088
<Compile Include="Files\CommitInfo.cs" />
9189
<Compile Include="Files\CreateFolderArg.cs" />
90+
<Compile Include="Files\CreateFolderError.cs" />
9291
<Compile Include="Files\DeleteArg.cs" />
92+
<Compile Include="Files\DeleteError.cs" />
9393
<Compile Include="Files\DeletedMetadata.cs" />
94-
<Compile Include="Files\Disallowed.cs" />
95-
<Compile Include="Files\DisallowedReason.cs" />
9694
<Compile Include="Files\DownloadArg.cs" />
9795
<Compile Include="Files\DownloadError.cs" />
9896
<Compile Include="Files\FileMetadata.cs" />
9997
<Compile Include="Files\FilesRoutes.cs" />
10098
<Compile Include="Files\FolderMetadata.cs" />
101-
<Compile Include="Files\FolderPathError.cs" />
10299
<Compile Include="Files\GetMetadataArg.cs" />
103100
<Compile Include="Files\GetMetadataError.cs" />
104101
<Compile Include="Files\ListFolderArg.cs" />
105102
<Compile Include="Files\ListFolderContinueArg.cs" />
106103
<Compile Include="Files\ListFolderContinueError.cs" />
107104
<Compile Include="Files\ListFolderError.cs" />
108105
<Compile Include="Files\ListFolderGetLatestCursorResult.cs" />
106+
<Compile Include="Files\ListFolderLongpollArg.cs" />
107+
<Compile Include="Files\ListFolderLongpollError.cs" />
108+
<Compile Include="Files\ListFolderLongpollResult.cs" />
109109
<Compile Include="Files\ListFolderResult.cs" />
110110
<Compile Include="Files\ListRevisionsArg.cs" />
111111
<Compile Include="Files\ListRevisionsError.cs" />
112112
<Compile Include="Files\ListRevisionsResult.cs" />
113+
<Compile Include="Files\LookupError.cs" />
113114
<Compile Include="Files\Metadata.cs" />
114-
<Compile Include="Files\NoFile.cs" />
115-
<Compile Include="Files\NoFileReason.cs" />
116-
<Compile Include="Files\PathError.cs" />
117115
<Compile Include="Files\PreviewArg.cs" />
118116
<Compile Include="Files\PreviewError.cs" />
119117
<Compile Include="Files\RelocationArg.cs" />
120118
<Compile Include="Files\RelocationError.cs" />
121119
<Compile Include="Files\RestoreArg.cs" />
122120
<Compile Include="Files\RestoreError.cs" />
123-
<Compile Include="Files\Restricted.cs" />
124-
<Compile Include="Files\RestrictedReason.cs" />
121+
<Compile Include="Files\SearchArg.cs" />
125122
<Compile Include="Files\SearchError.cs" />
126123
<Compile Include="Files\SearchMatch.cs" />
127124
<Compile Include="Files\SearchMatchType.cs" />
128125
<Compile Include="Files\SearchMode.cs" />
129-
<Compile Include="Files\SearchQuery.cs" />
130-
<Compile Include="Files\SearchResults.cs" />
126+
<Compile Include="Files\SearchResult.cs" />
131127
<Compile Include="Files\ThumbnailArg.cs" />
132128
<Compile Include="Files\ThumbnailError.cs" />
133129
<Compile Include="Files\ThumbnailFormat.cs" />
134130
<Compile Include="Files\ThumbnailSize.cs" />
135-
<Compile Include="Files\UploadCommitError.cs" />
136131
<Compile Include="Files\UploadError.cs" />
137132
<Compile Include="Files\UploadSessionCursor.cs" />
138133
<Compile Include="Files\UploadSessionFinishArg.cs" />
139134
<Compile Include="Files\UploadSessionFinishError.cs" />
140135
<Compile Include="Files\UploadSessionLookupError.cs" />
141136
<Compile Include="Files\UploadSessionOffsetError.cs" />
142137
<Compile Include="Files\UploadSessionStartResult.cs" />
138+
<Compile Include="Files\UploadWriteFailed.cs" />
139+
<Compile Include="Files\WriteConflictError.cs" />
140+
<Compile Include="Files\WriteError.cs" />
143141
<Compile Include="Files\WriteMode.cs" />
144142
<Compile Include="Properties\AssemblyInfo.cs" />
145143
<Compile Include="Sharing\AccessType.cs" />
146144
<Compile Include="Sharing\BasicSharedFolderMetadata.cs" />
147145
<Compile Include="Sharing\CollectionLinkMetadata.cs" />
148146
<Compile Include="Sharing\CreateSharedLinkArg.cs" />
147+
<Compile Include="Sharing\CreateSharedLinkError.cs" />
149148
<Compile Include="Sharing\FullSharedFolderMetadata.cs" />
150149
<Compile Include="Sharing\GetSharedFolderArgs.cs" />
151150
<Compile Include="Sharing\GetSharedLinksArg.cs" />
151+
<Compile Include="Sharing\GetSharedLinksError.cs" />
152152
<Compile Include="Sharing\GetSharedLinksResult.cs" />
153153
<Compile Include="Sharing\GroupInfo.cs" />
154154
<Compile Include="Sharing\GroupMembershipInfo.cs" />

Dropbox.Api/Dropbox.Api.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package >
33
<metadata>
44
<id>$id$</id>
5-
<version>1.0.2-beta</version>
5+
<version>1.1.2-beta</version>
66
<title>Dropbox v2 API</title>
77
<authors>Dropbox Inc</authors>
88
<owners>Dropbox Inc</owners>

Dropbox.Api/DropboxClient.common.cs

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public sealed partial class DropboxClient : ITransport, IDisposable
5454
/// <summary>
5555
/// The API version
5656
/// </summary>
57-
private const string ApiVersion = "2-beta-2";
57+
private const string ApiVersion = "2";
5858

5959
/// <summary>
6060
/// The default domain
6161
/// </summary>
62-
private const string DefaultDomain = "dropbox.com";
62+
private const string DefaultDomain = "dropboxapi.com";
6363

6464
/// <summary>
6565
/// The host for RPC-style routes.
@@ -107,10 +107,8 @@ public sealed partial class DropboxClient : ITransport, IDisposable
107107
/// <param name="oauth2AccessToken">The oauth2 access token for making client requests.</param>
108108
/// <param name="maxRetriesOnError">The maximum retries on a 5xx error.</param>
109109
/// <param name="userAgent">The user agent to use when making requests.</param>
110-
/// <param name="apiHostname">The hostname that will process api requests;
111-
/// this is for internal Dropbox use only.</param>
112-
/// <param name="apiContentHostname">The hostname that will process api content requests;
113-
/// this is for internal Dropbox use only.</param>
110+
/// <param name="httpClient">The custom http client. If not provided, a default
111+
/// http client will be created.</param>
114112
/// <remarks>
115113
/// The <paramref name="userAgent"/> helps Dropbox to identify requests coming from your application.
116114
/// We recommend that you use the format <c>"AppName/Version"</c>; if a value is supplied, the string
@@ -120,9 +118,30 @@ public DropboxClient(
120118
string oauth2AccessToken,
121119
int maxRetriesOnError = 4,
122120
string userAgent = null,
123-
string apiHostname = "api." + DefaultDomain,
124-
string apiContentHostname = "api-content." + DefaultDomain
125-
)
121+
HttpClient httpClient = null)
122+
: this(oauth2AccessToken, maxRetriesOnError, userAgent, "api." + DefaultDomain, "content." + DefaultDomain, httpClient)
123+
{
124+
}
125+
126+
/// <summary>
127+
/// Initializes a new instance of the <see cref="T:Dropbox.Api.DropboxClient"/> class.
128+
/// </summary>
129+
/// <param name="oauth2AccessToken">The oauth2 access token for making client requests.</param>
130+
/// <param name="maxRetriesOnError">The maximum retries on a 5xx error.</param>
131+
/// <param name="userAgent">The user agent to use when making requests.</param>
132+
/// <param name="apiHostname">The hostname that will process api requests;
133+
/// this is for internal Dropbox use only.</param>
134+
/// <param name="apiContentHostname">The hostname that will process api content requests;
135+
/// this is for internal Dropbox use only.</param>
136+
/// <param name="httpClient">The custom http client. If not provided, a default
137+
/// http client will be created.</param>
138+
internal DropboxClient(
139+
string oauth2AccessToken,
140+
int maxRetriesOnError,
141+
string userAgent,
142+
string apiHostname,
143+
string apiContentHostname,
144+
HttpClient httpClient = null)
126145
{
127146
if (string.IsNullOrEmpty(oauth2AccessToken))
128147
{
@@ -149,7 +168,7 @@ public DropboxClient(
149168
{ HostContent, apiContentHostname }
150169
};
151170

152-
this.httpClient = new HttpClient();
171+
this.httpClient = httpClient ?? new HttpClient();
153172
this.httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", oauth2AccessToken);
154173
this.httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", clientUserAgent);
155174

Dropbox.Api/Files/CommitInfo.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ namespace Dropbox.Api.Files
1111
using enc = Dropbox.Api.Babel;
1212

1313
/// <summary>
14-
/// <para>Arguments for <see cref="Dropbox.Api.Files.Routes.FilesRoutes.UploadAsync" />.
15-
/// Also part of the arguments to <see
16-
/// cref="Dropbox.Api.Files.Routes.FilesRoutes.UploadSessionFinishAsync" />.</para>
14+
/// <para>The commit info object</para>
1715
/// </summary>
1816
/// <seealso cref="UploadSessionFinishArg" />
1917
public sealed class CommitInfo : enc.IEncodable<CommitInfo>
@@ -45,6 +43,10 @@ public CommitInfo(string path,
4543
{
4644
throw new sys.ArgumentNullException("path");
4745
}
46+
else if (!re.Regex.IsMatch(path, @"/.*"))
47+
{
48+
throw new sys.ArgumentOutOfRangeException("path");
49+
}
4850

4951
if (mode == null)
5052
{

Dropbox.Api/Files/CreateFolderArg.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ namespace Dropbox.Api.Files
1111
using enc = Dropbox.Api.Babel;
1212

1313
/// <summary>
14-
/// <para>Arguments for <see cref="Dropbox.Api.Files.Routes.FilesRoutes.CreateFolderAsync"
15-
/// />.</para>
14+
/// <para>The create folder arg object</para>
1615
/// </summary>
1716
public sealed class CreateFolderArg : enc.IEncodable<CreateFolderArg>
1817
{
@@ -27,6 +26,10 @@ public CreateFolderArg(string path)
2726
{
2827
throw new sys.ArgumentNullException("path");
2928
}
29+
else if (!re.Regex.IsMatch(path, @"/.*"))
30+
{
31+
throw new sys.ArgumentOutOfRangeException("path");
32+
}
3033

3134
this.Path = path;
3235
}

0 commit comments

Comments
 (0)