Skip to content

Commit 1c33ddf

Browse files
Update Newtonsoft reference, enable group/team creation in fluent API
Merge commit #352 from microsoftgraph/1.13.0-preview.2 Update project Newtonsoft package reference and enable team creation on group
2 parents 1a0e1c9 + dc8e2d2 commit 1c33ddf

File tree

5 files changed

+100
-6
lines changed

5 files changed

+100
-6
lines changed

src/Microsoft.Graph.Core/Microsoft.Graph.Core.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
<PackageId>Microsoft.Graph.Core</PackageId>
1414
<PackageTags>Microsoft Office365;Graph;GraphServiceClient;Outlook;OneDrive;AzureAD;GraphAPI;Productivity;SharePoint;Intune;SDK</PackageTags>
1515
<PackageReleaseNotes>
16-
December 2018 Release Summary (version 1.13.0)
16+
January 2019 Release Summary (version 1.13.0-preview.2)
1717

1818
- Authentication handler added.
19+
- Removed Newtonsoft.Json package reference upper bound limitation.
1920
</PackageReleaseNotes>
2021
<PackageProjectUrl>https://developer.microsoft.com/graph</PackageProjectUrl>
2122
<PackageLicenseUrl>http://aka.ms/devservicesagreement</PackageLicenseUrl>
@@ -35,7 +36,7 @@ December 2018 Release Summary (version 1.13.0)
3536
<DelaySign>false</DelaySign>
3637
<AssemblyOriginatorKeyFile>35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
3738
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
38-
<Version>1.13.0-preview</Version>
39+
<Version>1.13.0-preview.2</Version>
3940
</PropertyGroup>
4041
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.1|AnyCPU'">
4142
<DocumentationFile>bin\Release\netstandard1.1\Microsoft.Graph.Core.xml</DocumentationFile>
@@ -54,7 +55,7 @@ December 2018 Release Summary (version 1.13.0)
5455
<Reference Include="System.Net.Http" />
5556
<Reference Include="System" />
5657
<Reference Include="Microsoft.CSharp" />
57-
<PackageReference Include="Newtonsoft.Json" Version="[6.0.1,12)" />
58+
<PackageReference Include="Newtonsoft.Json" Version="6.0.1" />
5859
</ItemGroup>
5960
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
6061
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />

src/Microsoft.Graph/Microsoft.Graph.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageId>Microsoft.Graph</PackageId>
1414
<PackageTags>Microsoft Office365;Graph;GraphServiceClient;Outlook;OneDrive;AzureAD;GraphAPI;Productivity;SharePoint;Intune;SDK</PackageTags>
1515
<PackageReleaseNotes>
16-
December 2018 Release Summary (version 1.13.0)
16+
January 2019 Release Summary (version 1.13.0-preview.2)
1717

1818
New functionality
1919
- Added new Teams API functionality.
@@ -25,6 +25,7 @@ Updated functionality
2525
- Device is updated with the MemberOf relationship.
2626
- Group is updated with the isArchived property and Team relationship.
2727
- User is updated with the JoinedTeams relationship.
28+
- Removed Newtonsoft.Json package reference upper bound limitation.
2829
</PackageReleaseNotes>
2930
<PackageProjectUrl>https://developer.microsoft.com/graph</PackageProjectUrl>
3031
<PackageLicenseUrl>http://aka.ms/devservicesagreement</PackageLicenseUrl>
@@ -44,7 +45,7 @@ Updated functionality
4445
<DelaySign>false</DelaySign>
4546
<AssemblyOriginatorKeyFile>35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
4647
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
47-
<Version>1.13.0-preview</Version>
48+
<Version>1.13.0-preview.2</Version>
4849
</PropertyGroup>
4950
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.1|AnyCPU'">
5051
<DocumentationFile>bin\Release\Microsoft.Graph.xml</DocumentationFile>
@@ -57,7 +58,7 @@ Updated functionality
5758
<Reference Include="System" />
5859
<Reference Include="System.Net.Http" />
5960
<Reference Include="Microsoft.CSharp" />
60-
<PackageReference Include="Newtonsoft.Json" Version="[6.0.1,12)" />
61+
<PackageReference Include="Newtonsoft.Json" Version="6.0.1" />
6162
</ItemGroup>
6263
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.1' ">
6364
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System.Threading;
2+
3+
namespace Microsoft.Graph
4+
{
5+
public partial interface ITeamRequest
6+
{
7+
/// <summary>
8+
/// Creates the specified Team using PUT.
9+
/// </summary>
10+
/// <param name="teamToCreate">The Team to create.</param>
11+
/// <returns>The created Team.</returns>
12+
System.Threading.Tasks.Task<Team> PutAsync(Team teamToCreate);
13+
14+
/// <summary>
15+
/// Creates the specified Team using PUT.
16+
/// </summary>
17+
/// <param name="teamToCreate">The Team to create.</param>
18+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
19+
/// <returns>The created Team.</returns>
20+
System.Threading.Tasks.Task<Team> PutAsync(Team teamToCreate, CancellationToken cancellationToken);
21+
}
22+
23+
public partial class TeamRequest
24+
{
25+
/// <summary>
26+
/// Creates the specified Team using PUT.
27+
/// </summary>
28+
/// <param name="teamToCreate">The Team to create.</param>
29+
/// <returns>The created Team.</returns>
30+
public System.Threading.Tasks.Task<Team> PutAsync(Team teamToCreate)
31+
{
32+
return this.PutAsync(teamToCreate, CancellationToken.None);
33+
}
34+
35+
/// <summary>
36+
/// Creates the specified Team using PUT.
37+
/// </summary>
38+
/// <param name="teamToCreate">The Team to create.</param>
39+
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
40+
/// <returns>The created Team.</returns>
41+
public async System.Threading.Tasks.Task<Team> PutAsync(Team teamToCreate, CancellationToken cancellationToken)
42+
{
43+
this.ContentType = "application/json";
44+
this.Method = "PUT";
45+
var newEntity = await this.SendAsync<Team>(teamToCreate, cancellationToken).ConfigureAwait(false);
46+
this.InitializeCollectionProperties(newEntity);
47+
return newEntity;
48+
}
49+
}
50+
}

tests/Microsoft.Graph.Test/Microsoft.Graph.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
<Compile Include="Requests\Functional\ContactTests.cs" />
106106
<Compile Include="Requests\Functional\EventTests.cs" />
107107
<Compile Include="Requests\Functional\GraphTestBase.cs" />
108+
<Compile Include="Requests\Functional\GroupTests.cs" />
108109
<Compile Include="Requests\Functional\MailTests.cs" />
109110
<Compile Include="Requests\Functional\OneDriveTests.cs" />
110111
<Compile Include="Requests\Functional\ErrorTests.cs" />
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using System.Collections.Generic;
4+
using Async = System.Threading.Tasks;
5+
6+
namespace Microsoft.Graph.Test.Requests.Functional
7+
{
8+
[Ignore]
9+
[TestClass]
10+
public class GroupTests : GraphTestBase
11+
{
12+
/// <summary>
13+
/// Create a team on a group.
14+
/// </summary>
15+
[TestMethod]
16+
public async Async.Task GroupCreateTeam()
17+
{
18+
try
19+
{
20+
// Get a groups collection. We'll use the first entry to add the team. Results in a call to the service.
21+
IGraphServiceGroupsCollectionPage groupPage = await graphClient.Groups.Request().GetAsync();
22+
23+
// Create a team with settings.
24+
Team team = new Team()
25+
{
26+
MemberSettings = new TeamMemberSettings()
27+
{
28+
AllowCreateUpdateChannels = true
29+
}
30+
};
31+
32+
// Add a team to the group. Results in a call to the service.
33+
await graphClient.Groups[groupPage[8].Id].Team.Request().PutAsync(team);
34+
}
35+
catch (ServiceException e)
36+
{
37+
Assert.Fail(e.Error.ToString());
38+
}
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)