Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 09fdf6b

Browse files
committed
Version 2.4.0.0
1 parent fe1c89d commit 09fdf6b

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

+410
-318
lines changed

Api/API - Backup.csproj

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0;netcoreapp2.0;net452;net472</TargetFrameworks>
5+
<AssemblyName>KoenZomers.OneDrive.Api</AssemblyName>
6+
<SignAssembly>true</SignAssembly>
7+
<AssemblyOriginatorKeyFile>KoenZomers.OneDrive.Api.snk</AssemblyOriginatorKeyFile>
8+
<Version>2.3.2.0</Version>
9+
<Authors>Koen Zomers</Authors>
10+
<Company>Koen Zomers</Company>
11+
<Description>API in .NET Standard 2.0, .NET Framework 4.5.2, .NET Framework 4.7.2 and .NET Core 2.0 to communicate with OneDrive Personal and OneDrive for Business</Description>
12+
<PackageProjectUrl>https://github.com/KoenZomers/OneDriveAPI</PackageProjectUrl>
13+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14+
<PackageReleaseNotes>- Added ```public virtual async Task&lt;OneDriveItemCollection&gt; GetNextChildrenByPath(string skipTokenUrl)``` which allows file requests from using i.e. ```public virtual async Task&lt;OneDriveItemCollection&gt; GetChildrenByPath(string path)``` on a large folder containing more than 100 files to retrieve the next batch of files. If your intend is to get all the results, use ```public virtual async Task&lt;OneDriveItem[]&gt; GetAllChildrenByPath(string path)``` instead. [Issue 28](https://github.com/KoenZomers/OneDriveAPI/issues/28)</PackageReleaseNotes>
15+
<PackageLicenseUrl>https://github.com/KoenZomers/OneDriveAPI/blob/master/LICENSE.md</PackageLicenseUrl>
16+
<Copyright>Koen Zomers</Copyright>
17+
<RootNamespace>KoenZomers.OneDrive.Api</RootNamespace>
18+
<AssemblyVersion>2.3.2.0</AssemblyVersion>
19+
<FileVersion>2.3.2.0</FileVersion>
20+
</PropertyGroup>
21+
22+
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
23+
<Reference Include="System.Net.Http" />
24+
<Reference Include="System.Web" />
25+
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
26+
</ItemGroup>
27+
28+
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
29+
<Reference Include="System.Net.Http" />
30+
<Reference Include="System.Web" />
31+
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
32+
</ItemGroup>
33+
34+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
35+
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
36+
</ItemGroup>
37+
38+
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
39+
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
40+
</ItemGroup>
41+
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
43+
<DocumentationFile>KoenZomers.OneDrive.Api.xml</DocumentationFile>
44+
</PropertyGroup>
45+
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
47+
<DocumentationFile>KoenZomers.OneDrive.Api.xml</DocumentationFile>
48+
</PropertyGroup>
49+
50+
</Project>

Api/API.csproj

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netcoreapp2.0;net452;net472</TargetFrameworks>
5-
<AssemblyName>KoenZomers.OneDrive.Api</AssemblyName>
6-
<SignAssembly>true</SignAssembly>
7-
<AssemblyOriginatorKeyFile>KoenZomers.OneDrive.Api.snk</AssemblyOriginatorKeyFile>
8-
<Version>2.3.2.0</Version>
9-
<Authors>Koen Zomers</Authors>
10-
<Company>Koen Zomers</Company>
11-
<Description>API in .NET Standard 2.0, .NET Framework 4.5.2, .NET Framework 4.7.2 and .NET Core 2.0 to communicate with OneDrive Personal and OneDrive for Business</Description>
12-
<PackageProjectUrl>https://github.com/KoenZomers/OneDriveAPI</PackageProjectUrl>
13-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14-
<PackageReleaseNotes>- Added ```public virtual async Task&lt;OneDriveItemCollection&gt; GetNextChildrenByPath(string skipTokenUrl)``` which allows file requests from using i.e. ```public virtual async Task&lt;OneDriveItemCollection&gt; GetChildrenByPath(string path)``` on a large folder containing more than 100 files to retrieve the next batch of files. If your intend is to get all the results, use ```public virtual async Task&lt;OneDriveItem[]&gt; GetAllChildrenByPath(string path)``` instead. [Issue 28](https://github.com/KoenZomers/OneDriveAPI/issues/28)</PackageReleaseNotes>
15-
<PackageLicenseUrl>https://github.com/KoenZomers/OneDriveAPI/blob/master/LICENSE.md</PackageLicenseUrl>
16-
<Copyright>Koen Zomers</Copyright>
17-
<RootNamespace>KoenZomers.OneDrive.Api</RootNamespace>
18-
<AssemblyVersion>2.3.2.0</AssemblyVersion>
19-
<FileVersion>2.3.2.0</FileVersion>
20-
</PropertyGroup>
21-
22-
<ItemGroup Condition=" '$(TargetFramework)' == 'net452' ">
23-
<Reference Include="System.Net.Http" />
24-
<Reference Include="System.Web" />
25-
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
26-
</ItemGroup>
27-
28-
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
29-
<Reference Include="System.Net.Http" />
30-
<Reference Include="System.Web" />
31-
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
32-
</ItemGroup>
33-
34-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
35-
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
36-
</ItemGroup>
37-
38-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
39-
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
40-
</ItemGroup>
41-
42-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
43-
<DocumentationFile>KoenZomers.OneDrive.Api.xml</DocumentationFile>
44-
</PropertyGroup>
45-
46-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
47-
<DocumentationFile>KoenZomers.OneDrive.Api.xml</DocumentationFile>
48-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>netcoreapp3.1;net48;net6</TargetFrameworks>
5+
<AssemblyName>KoenZomers.OneDrive.Api</AssemblyName>
6+
<SignAssembly>true</SignAssembly>
7+
<AssemblyOriginatorKeyFile>KoenZomers.OneDrive.Api.snk</AssemblyOriginatorKeyFile>
8+
<Version>2.4.0.0</Version>
9+
<Authors>Koen Zomers</Authors>
10+
<Company>Koen Zomers</Company>
11+
<Description>API in .NET Framework 4.8.0, and .NET Core 3.1 and .NET 6.0 to communicate with OneDrive Personal and OneDrive for Business</Description>
12+
<PackageProjectUrl>https://github.com/KoenZomers/OneDriveAPI</PackageProjectUrl>
13+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
14+
<PackageReleaseNotes>- Recompiled to support .NET Framework 4.8.0, .NET Core 3.1 and .NET 6.0
15+
- Removed Newtonsoft JSON dependency by switching to System.Text.Json</PackageReleaseNotes>
16+
<PackageLicenseUrl>https://github.com/KoenZomers/OneDriveAPI/blob/master/LICENSE.md</PackageLicenseUrl>
17+
<Copyright>Koen Zomers</Copyright>
18+
<RootNamespace>KoenZomers.OneDrive.Api</RootNamespace>
19+
<AssemblyVersion>2.4.0.0</AssemblyVersion>
20+
<FileVersion>2.4.0.0</FileVersion>
21+
</PropertyGroup>
22+
23+
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
24+
<Reference Include="System.Net.Http" />
25+
<Reference Include="System.Web" />
26+
<PackageReference Include="System.Text.Json" Version="6.0.4" />
27+
</ItemGroup>
28+
29+
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
30+
<PackageReference Include="System.Text.Json" Version="6.0.4" />
31+
</ItemGroup>
32+
33+
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.01' ">
34+
<PackageReference Include="System.Text.Json" Version="6.0.4" />
35+
</ItemGroup>
36+
37+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
38+
<DocumentationFile>KoenZomers.OneDrive.Api.xml</DocumentationFile>
39+
</PropertyGroup>
40+
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
42+
<DocumentationFile>KoenZomers.OneDrive.Api.xml</DocumentationFile>
43+
</PropertyGroup>
4944

5045
</Project>
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
using KoenZomers.OneDrive.Api.Enums;
2-
using Newtonsoft.Json;
3-
using Newtonsoft.Json.Converters;
2+
using System.Text.Json.Serialization;
43

54
namespace KoenZomers.OneDrive.Api.Entities
65
{
76
internal class GraphApiUploadSessionItem
87
{
9-
[JsonProperty("@microsoft.graph.conflictBehavior", DefaultValueHandling = DefaultValueHandling.Ignore), JsonConverter(typeof(StringEnumConverter))]
8+
[JsonPropertyName("@microsoft.graph.conflictBehavior")]
109
public NameConflictBehavior FilenameConflictBehavior { get; set; }
1110

12-
[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Ignore)]
11+
[JsonPropertyName("name")]
1312
public string Filename { get; set; }
1413
}
1514
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using Newtonsoft.Json;
1+
using System.Text.Json.Serialization;
22

33
namespace KoenZomers.OneDrive.Api.Entities
44
{
55
internal class GraphApiUploadSessionItemContainer : OneDriveItemBase
66
{
7-
[JsonProperty("item", DefaultValueHandling = DefaultValueHandling.Ignore)]
7+
[JsonPropertyName("item")]
88
public GraphApiUploadSessionItem Item { get; set; }
99
}
1010
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Newtonsoft.Json;
1+
using System.Text.Json.Serialization;
22

33
namespace KoenZomers.OneDrive.Api.Entities
44
{
@@ -7,22 +7,22 @@ namespace KoenZomers.OneDrive.Api.Entities
77
/// </summary>
88
public class OneDriveAccessToken
99
{
10-
[JsonProperty("token_type")]
10+
[JsonPropertyName("token_type")]
1111
public string TokenType { get; set; }
1212

13-
[JsonProperty("access_token")]
13+
[JsonPropertyName("access_token")]
1414
public string AccessToken { get; set; }
1515

16-
[JsonProperty("expires_in")]
16+
[JsonPropertyName("expires_in")]
1717
public int AccessTokenExpirationDuration { get; set; }
1818

19-
[JsonProperty("refresh_token")]
19+
[JsonPropertyName("refresh_token")]
2020
public string RefreshToken { get; set; }
2121

22-
[JsonProperty("scope")]
22+
[JsonPropertyName("scope")]
2323
public string Scopes { get; set; }
2424

25-
[JsonProperty("authentication_token")]
25+
[JsonPropertyName("authentication_token")]
2626
public string AuthenticationToken { get; set; }
2727
}
2828
}

Api/Entities/OneDriveAsyncTaskStatus.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
using Newtonsoft.Json;
2-
using Newtonsoft.Json.Converters;
1+
using System.Text.Json.Serialization;
32

43
namespace KoenZomers.OneDrive.Api.Entities
54
{
65
public class OneDriveAsyncTaskStatus : OneDriveItemBase
76
{
8-
[JsonProperty("operation"), JsonConverter(typeof(StringEnumConverter))]
7+
[JsonPropertyName("operation")]
98
public Enums.OneDriveAsyncJobType Operation { get; set; }
109

11-
[JsonProperty("percentageComplete")]
10+
[JsonPropertyName("percentageComplete")]
1211
public double PercentComplete { get; set; }
1312

14-
[JsonProperty("status"), JsonConverter(typeof(StringEnumConverter))]
13+
[JsonPropertyName("status")]
1514
public Enums.OneDriveAsyncJobStatus Status { get; set; }
1615

1716
}

Api/Entities/OneDriveAudioFacet.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
using Newtonsoft.Json;
1+
using System.Text.Json.Serialization;
22

33
namespace KoenZomers.OneDrive.Api.Entities
44
{
55
public class OneDriveAudioFacet
66
{
7-
[JsonProperty("album", NullValueHandling=NullValueHandling.Ignore)]
7+
[JsonPropertyName("album")]
88
public string Album { get; set; }
99

10-
[JsonProperty("albumArtist", NullValueHandling = NullValueHandling.Ignore)]
10+
[JsonPropertyName("albumArtist")]
1111
public string AlbumArtist { get; set; }
1212

13-
[JsonProperty("artist", NullValueHandling = NullValueHandling.Ignore)]
13+
[JsonPropertyName("artist")]
1414
public string Artist { get; set; }
1515

16-
[JsonProperty("bitrate", DefaultValueHandling=DefaultValueHandling.Ignore)]
16+
[JsonPropertyName("bitrate")]
1717
public int BitRate { get; set; }
1818

19-
[JsonProperty("copyright", NullValueHandling = NullValueHandling.Ignore)]
19+
[JsonPropertyName("copyright")]
2020
public string Copyright { get; set; }
2121

22-
[JsonProperty("disc", DefaultValueHandling = DefaultValueHandling.Ignore)]
22+
[JsonPropertyName("disc")]
2323
public int Disc { get; set; }
2424

25-
[JsonProperty("discCount", DefaultValueHandling = DefaultValueHandling.Ignore)]
25+
[JsonPropertyName("discCount")]
2626
public int DiscCount { get; set; }
2727

28-
[JsonProperty("duration", DefaultValueHandling = DefaultValueHandling.Ignore)]
28+
[JsonPropertyName("duration")]
2929
public int Duration { get; set; }
3030

31-
[JsonProperty("genre", DefaultValueHandling = DefaultValueHandling.Ignore)]
31+
[JsonPropertyName("genre")]
3232
public string Genre { get; set; }
3333

34-
[JsonProperty("hasDrm", DefaultValueHandling = DefaultValueHandling.Ignore)]
34+
[JsonPropertyName("hasDrm")]
3535
public bool HasDrm { get; set; }
3636

37-
[JsonProperty("isVariableBitrate", DefaultValueHandling = DefaultValueHandling.Ignore)]
37+
[JsonPropertyName("isVariableBitrate")]
3838
public bool IsVariableBitRate { get; set; }
3939

40-
[JsonProperty("title", DefaultValueHandling = DefaultValueHandling.Ignore)]
40+
[JsonPropertyName("title")]
4141
public string Title { get; set; }
4242

43-
[JsonProperty("track", DefaultValueHandling = DefaultValueHandling.Ignore)]
43+
[JsonPropertyName("track")]
4444
public int Track { get; set; }
4545

46-
[JsonProperty("trackCount", DefaultValueHandling = DefaultValueHandling.Ignore)]
46+
[JsonPropertyName("trackCount")]
4747
public int TrackCount { get; set; }
4848

49-
[JsonProperty("year", DefaultValueHandling = DefaultValueHandling.Ignore)]
49+
[JsonPropertyName("year")]
5050
public int Year { get; set; }
5151
}
5252
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
using Newtonsoft.Json;
1+
using System.Text.Json.Serialization;
22

33
namespace KoenZomers.OneDrive.Api.Entities
44
{
55
public class OneDriveCollectionResponse<T> : OneDriveItemBase
66
{
7-
[JsonProperty("value")]
7+
[JsonPropertyName("value")]
88
public T[] Collection { get; set; }
99

10-
[JsonProperty("@odata.nextLink")]
10+
[JsonPropertyName("@odata.nextLink")]
1111
public string NextLink { get; set; }
1212
}
1313
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
using Newtonsoft.Json;
1+
using System.Text.Json.Serialization;
22

33
namespace KoenZomers.OneDrive.Api.Entities
44
{
55
internal class OneDriveCreateFolder : OneDriveItemBase
66
{
7-
[JsonProperty("name")]
7+
[JsonPropertyName("name")]
88
public string Name { get; set; }
99

10-
[JsonProperty("folder")]
10+
[JsonPropertyName("folder")]
1111
public object Folder { get; set; }
1212
}
1313
}

Api/Entities/OneDriveDrive.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using KoenZomers.OneDrive.Api.Enums;
2-
using Newtonsoft.Json;
3-
using Newtonsoft.Json.Converters;
2+
using System.Text.Json.Serialization;
43

54
namespace KoenZomers.OneDrive.Api.Entities
65
{
@@ -12,25 +11,25 @@ public class OneDriveDrive : OneDriveItemBase
1211
/// <summary>
1312
/// The unique identifier of the drive
1413
/// </summary>
15-
[JsonProperty("id")]
14+
[JsonPropertyName("id")]
1615
public string Id { get; set; }
1716

1817
/// <summary>
1918
/// Enumerated value that identifies the type of drive account. OneDrive drives will show as personal.
2019
/// </summary>
21-
[JsonProperty("driveType"), JsonConverter(typeof(StringEnumConverter))]
20+
[JsonPropertyName("driveType")]
2221
public OneDriveDriveType DriveType { get; set; }
2322

2423
/// <summary>
2524
/// The user account that owns the drive
2625
/// </summary>
27-
[JsonProperty("owner")]
26+
[JsonPropertyName("owner")]
2827
public OneDriveIdentitySet Owner { get; set; }
2928

3029
/// <summary>
3130
/// Information about the drive's storage space quota
3231
/// </summary>
33-
[JsonProperty("quota")]
32+
[JsonPropertyName("quota")]
3433
public OneDriveQuotaFacet Quota { get; set; }
3534
}
3635
}

0 commit comments

Comments
 (0)