diff --git a/Microsoft.Graph.Beta.sln b/Microsoft.Graph.Beta.sln index 4065b4e17d0..aa57ae96a45 100644 --- a/Microsoft.Graph.Beta.sln +++ b/Microsoft.Graph.Beta.sln @@ -4,6 +4,8 @@ VisualStudioVersion = 17.1.31903.286 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Graph.Beta", "src\Microsoft.Graph\Microsoft.Graph.Beta.csproj", "{660FA73B-987D-4085-A230-1B04F7EAEFBC}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Graph.DotnetCore.Test", "tests\Microsoft.Graph.DotnetCore.Test\Microsoft.Graph.DotnetCore.Test.csproj", "{6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -32,6 +34,22 @@ Global {660FA73B-987D-4085-A230-1B04F7EAEFBC}.Release|x64.Build.0 = Release|Any CPU {660FA73B-987D-4085-A230-1B04F7EAEFBC}.Release|x86.ActiveCfg = Release|Any CPU {660FA73B-987D-4085-A230-1B04F7EAEFBC}.Release|x86.Build.0 = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|ARM.ActiveCfg = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|ARM.Build.0 = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|x64.ActiveCfg = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|x64.Build.0 = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|x86.ActiveCfg = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Debug|x86.Build.0 = Debug|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|Any CPU.Build.0 = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|ARM.ActiveCfg = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|ARM.Build.0 = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|x64.ActiveCfg = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|x64.Build.0 = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|x86.ActiveCfg = Release|Any CPU + {6EEB8B5D-4297-4707-9380-85DB7BFEE2CF}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Microsoft.Graph/Extensions/DriveItemRequestBuilderExtensions.cs b/src/Microsoft.Graph/Extensions/DriveItemRequestBuilderExtensions.cs index 85cf6dbf44f..a786814596c 100644 --- a/src/Microsoft.Graph/Extensions/DriveItemRequestBuilderExtensions.cs +++ b/src/Microsoft.Graph/Extensions/DriveItemRequestBuilderExtensions.cs @@ -1,31 +1,28 @@ -/*using System; +using System; using System.Linq; using System.Reflection; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.Analytics; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.Children; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.Content; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.ListItem; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphCheckin; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphCheckout; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphCopy; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphCreateLink; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphCreateUploadSession; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphFollow; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphInvite; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphPreview; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphRestore; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphUnfollow; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphValidatePermission; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.Permissions; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.Subscriptions; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.Thumbnails; +using Microsoft.Graph.Beta.Drives.Item.List.Items.Item.Versions; using Microsoft.Kiota.Abstractions; -using Microsoft.Graph.Beta.Drive.Items.Item.Activities; -using Microsoft.Graph.Beta.Drive.Items.Item.Analytics; -using Microsoft.Graph.Beta.Drive.Items.Item.AssignSensitivityLabel; -using Microsoft.Graph.Beta.Drive.Items.Item.Checkin; -using Microsoft.Graph.Beta.Drive.Items.Item.Checkout; -using Microsoft.Graph.Beta.Drive.Items.Item.Children; -using Microsoft.Graph.Beta.Drive.Items.Item.Content; -using Microsoft.Graph.Beta.Drive.Items.Item.Copy; -using Microsoft.Graph.Beta.Drive.Items.Item.CreateLink; -using Microsoft.Graph.Beta.Drive.Items.Item.CreateUploadSession; -using Microsoft.Graph.Beta.Drive.Items.Item.ExtractSensitivityLabels; -using Microsoft.Graph.Beta.Drive.Items.Item.Follow; -using Microsoft.Graph.Beta.Drive.Items.Item.Invite; -using Microsoft.Graph.Beta.Drive.Items.Item.ListItem; -using Microsoft.Graph.Beta.Drive.Items.Item.Permissions; -using Microsoft.Graph.Beta.Drive.Items.Item.Preview; -using Microsoft.Graph.Beta.Drive.Items.Item.Restore; -using Microsoft.Graph.Beta.Drive.Items.Item.Subscriptions; -using Microsoft.Graph.Beta.Drive.Items.Item.Thumbnails; -using Microsoft.Graph.Beta.Drive.Items.Item.Unfollow; -using Microsoft.Graph.Beta.Drive.Items.Item.ValidatePermission; -using Microsoft.Graph.Beta.Drive.Items.Item.Versions; -namespace Microsoft.Graph.Beta; +namespace Microsoft.Graph; public static class DriveItemRequestBuilderExtensions { @@ -56,33 +53,6 @@ public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Grap return new CustomDriveItemItemRequestBuilder(builder.Uri.OriginalString, requestAdapter); } - /// - /// Gets drive item request builder for the specified drive item path. - /// The drive item request builder. - /// - public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Graph.Beta.Drive.Root.RootRequestBuilder rootRequestBuilder, string path) - { - if (!string.IsNullOrEmpty(path)) - { - if (!path.StartsWith("/")) - { - path = string.Format("/{0}", path); - } - } - - var requestInformation = rootRequestBuilder.ToGetRequestInformation(); - var requestAdapter = rootRequestBuilder.GetRequestAdapter(); - var requestUrl = requestInformation.URI.OriginalString; - - // Encode the path in accordance with the one drive spec - // https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/addressing-driveitems - UriBuilder builder = new UriBuilder(requestUrl); - builder.Path += string.Format(":{0}:", path); - - - return new CustomDriveItemItemRequestBuilder(builder.Uri.OriginalString, requestAdapter); - } - /// /// Gets drive item request builder for the specified drive item path. /// The drive item request builder. @@ -110,60 +80,6 @@ public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Grap return new CustomDriveItemItemRequestBuilder(builder.Uri.OriginalString, requestAdapter); } - /// - /// Gets drive item request builder for the specified drive item path. - /// The drive item request builder. - /// - public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Graph.Beta.Drive.Items.Item.DriveItemItemRequestBuilder rootRequestBuilder, string path) - { - if (!string.IsNullOrEmpty(path)) - { - if (!path.StartsWith("/")) - { - path = string.Format("/{0}", path); - } - } - - var requestInformation = rootRequestBuilder.ToGetRequestInformation(); - var requestAdapter = rootRequestBuilder.GetRequestAdapter(); - var requestUrl = requestInformation.URI.OriginalString; - - // Encode the path in accordance with the one drive spec - // https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/addressing-driveitems - UriBuilder builder = new UriBuilder(requestUrl); - builder.Path += string.Format(":{0}:", path); - - - return new CustomDriveItemItemRequestBuilder(builder.Uri.OriginalString, requestAdapter); - } - - /// - /// Gets drive item request builder for the specified drive item path. - /// The drive item request builder. - /// - public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Graph.Beta.Me.Drives.Item.Items.Item.DriveItemItemRequestBuilder rootRequestBuilder, string path) - { - if (!string.IsNullOrEmpty(path)) - { - if (!path.StartsWith("/")) - { - path = string.Format("/{0}", path); - } - } - - var requestInformation = rootRequestBuilder.ToGetRequestInformation(); - var requestAdapter = rootRequestBuilder.GetRequestAdapter(); - var requestUrl = requestInformation.URI.OriginalString; - - // Encode the path in accordance with the one drive spec - // https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/addressing-driveitems - UriBuilder builder = new UriBuilder(requestUrl); - builder.Path += string.Format(":{0}:", path); - - - return new CustomDriveItemItemRequestBuilder(builder.Uri.OriginalString, requestAdapter); - } - private static IRequestAdapter GetRequestAdapter(this object obj) { var field = obj.GetType() .GetFields(BindingFlags.NonPublic | BindingFlags.Instance) @@ -172,7 +88,7 @@ private static IRequestAdapter GetRequestAdapter(this object obj) { } } -public class CustomDriveItemItemRequestBuilder : Microsoft.Graph.Beta.Drive.Items.Item.DriveItemItemRequestBuilder +public class CustomDriveItemItemRequestBuilder : Microsoft.Graph.Beta.Drives.Item.Items.Item.DriveItemItemRequestBuilder { private readonly string _rawUrl; /// @@ -188,25 +104,17 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA this.RequestAdapter = requestAdapter; } - /// Provides operations to manage the activities property of the microsoft.graph.driveItem entity. - public new ActivitiesRequestBuilder Activities { get => - new ActivitiesRequestBuilder(this._rawUrl + "/activities", RequestAdapter); - } /// Provides operations to manage the analytics property of the microsoft.graph.driveItem entity. public new AnalyticsRequestBuilder Analytics { get => new AnalyticsRequestBuilder(this._rawUrl + "/analytics", RequestAdapter); } - /// Provides operations to call the assignSensitivityLabel method. - public new AssignSensitivityLabelRequestBuilder AssignSensitivityLabel { get => - new AssignSensitivityLabelRequestBuilder(this._rawUrl + "/microsoft.graph.assignSensitivityLabel", RequestAdapter); - } /// Provides operations to call the checkin method. - public new CheckinRequestBuilder Checkin { get => - new CheckinRequestBuilder(this._rawUrl + "/microsoft.graph.checkin", RequestAdapter); + public new MicrosoftGraphCheckinRequestBuilder MicrosoftGraphCheckin { get => + new MicrosoftGraphCheckinRequestBuilder(this._rawUrl + "/microsoft.graph.checkin", RequestAdapter); } /// Provides operations to call the checkout method. - public new CheckoutRequestBuilder Checkout { get => - new CheckoutRequestBuilder(this._rawUrl + "/microsoft.graph.checkout", RequestAdapter); + public new MicrosoftGraphCheckoutRequestBuilder MicrosoftGraphCheckout { get => + new MicrosoftGraphCheckoutRequestBuilder(this._rawUrl + "/microsoft.graph.checkout", RequestAdapter); } /// Provides operations to manage the children property of the microsoft.graph.driveItem entity. public new ChildrenRequestBuilder Children { get => @@ -217,28 +125,24 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA new ContentRequestBuilder(this._rawUrl + "/content", RequestAdapter); } /// Provides operations to call the copy method. - public new CopyRequestBuilder Copy { get => - new CopyRequestBuilder(this._rawUrl + "/microsoft.graph.copy", RequestAdapter); + public new MicrosoftGraphCopyRequestBuilder MicrosoftGraphCopy { get => + new MicrosoftGraphCopyRequestBuilder(this._rawUrl + "/microsoft.graph.copy", RequestAdapter); } /// Provides operations to call the createLink method. - public new CreateLinkRequestBuilder CreateLink { get => - new CreateLinkRequestBuilder(this._rawUrl + "/microsoft.graph.createLink", RequestAdapter); + public new MicrosoftGraphCreateLinkRequestBuilder MicrosoftGraphCreateLink { get => + new MicrosoftGraphCreateLinkRequestBuilder(this._rawUrl + "/microsoft.graph.createLink", RequestAdapter); } /// Provides operations to call the createUploadSession method. - public new CreateUploadSessionRequestBuilder CreateUploadSession { get => - new CreateUploadSessionRequestBuilder(this._rawUrl+"/microsoft.graph.createUploadSession" , RequestAdapter); - } - /// Provides operations to call the extractSensitivityLabels method. - public new ExtractSensitivityLabelsRequestBuilder ExtractSensitivityLabels { get => - new ExtractSensitivityLabelsRequestBuilder(this._rawUrl + "/microsoft.graph.extractSensitivityLabels", RequestAdapter); + public new MicrosoftGraphCreateUploadSessionRequestBuilder MicrosoftGraphCreateUploadSession { get => + new MicrosoftGraphCreateUploadSessionRequestBuilder(this._rawUrl+"/microsoft.graph.createUploadSession" , RequestAdapter); } /// Provides operations to call the follow method. - public new FollowRequestBuilder Follow { get => - new FollowRequestBuilder(this._rawUrl + "/microsoft.graph.follow", RequestAdapter); + public new MicrosoftGraphFollowRequestBuilder MicrosoftGraphFollow { get => + new MicrosoftGraphFollowRequestBuilder(this._rawUrl + "/microsoft.graph.follow", RequestAdapter); } /// Provides operations to call the invite method. - public new InviteRequestBuilder Invite { get => - new InviteRequestBuilder(this._rawUrl + "/microsoft.graph.invite", RequestAdapter); + public new MicrosoftGraphInviteRequestBuilder MicrosoftGraphInvite { get => + new MicrosoftGraphInviteRequestBuilder(this._rawUrl + "/microsoft.graph.invite", RequestAdapter); } /// Provides operations to manage the listItem property of the microsoft.graph.driveItem entity. public new ListItemRequestBuilder ListItem { get => @@ -249,14 +153,14 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA new PermissionsRequestBuilder(this._rawUrl+"/permissions", RequestAdapter); } /// Provides operations to call the preview method. - public new PreviewRequestBuilder Preview { get => - new PreviewRequestBuilder(this._rawUrl+"/microsoft.graph.preview", RequestAdapter); + public new MicrosoftGraphPreviewRequestBuilder MicrosoftGraphPreview { get => + new MicrosoftGraphPreviewRequestBuilder(this._rawUrl+"/microsoft.graph.preview", RequestAdapter); } /// The request adapter to use to execute the requests. private IRequestAdapter RequestAdapter { get; set; } /// Provides operations to call the restore method. - public new RestoreRequestBuilder Restore { get => - new RestoreRequestBuilder(this._rawUrl+"/microsoft.graph.restore", RequestAdapter); + public new MicrosoftGraphRestoreRequestBuilder MicrosoftGraphRestore { get => + new MicrosoftGraphRestoreRequestBuilder(this._rawUrl+"/microsoft.graph.restore", RequestAdapter); } /// Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity. public new SubscriptionsRequestBuilder Subscriptions { get => @@ -267,16 +171,15 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA new ThumbnailsRequestBuilder(this._rawUrl+"/thumbnails", RequestAdapter); } /// Provides operations to call the unfollow method. - public new UnfollowRequestBuilder Unfollow { get => - new UnfollowRequestBuilder(this._rawUrl+"/microsoft.graph.unfollow", RequestAdapter); + public new MicrosoftGraphUnfollowRequestBuilder MicrosoftGraphUnfollow { get => + new MicrosoftGraphUnfollowRequestBuilder(this._rawUrl+"/microsoft.graph.unfollow", RequestAdapter); } /// Provides operations to call the validatePermission method. - public new ValidatePermissionRequestBuilder ValidatePermission { get => - new ValidatePermissionRequestBuilder(this._rawUrl+"/microsoft.graph.validatePermission", RequestAdapter); + public new MicrosoftGraphValidatePermissionRequestBuilder MicrosoftGraphValidatePermission { get => + new MicrosoftGraphValidatePermissionRequestBuilder(this._rawUrl+"/microsoft.graph.validatePermission", RequestAdapter); } /// Provides operations to manage the versions property of the microsoft.graph.driveItem entity. public new VersionsRequestBuilder Versions { get => new VersionsRequestBuilder(this._rawUrl+"/versions", RequestAdapter); } } -*/ diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/DeltaQueryTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/DeltaQueryTests.cs index aef8b65a3a8..3691eb9f644 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/DeltaQueryTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/DeltaQueryTests.cs @@ -15,18 +15,18 @@ public class DeltaQueryTests: GraphTestBase public async Task DeltaLinkDriveItem() { // Get our first delta page. - var driveItemDeltaCollectionPage = await graphClient.Drives["driveId"].Root.Delta().GetAsync(); + var driveItemDeltaCollectionPage = await graphClient.Drives["driveId"].Items[""].MicrosoftGraphDelta.GetAsync(); // Go through all of the delta pages so that we can get the delta link on the last page. while (driveItemDeltaCollectionPage.OdataNextLink != null) { - driveItemDeltaCollectionPage = await new Microsoft.Graph.Beta.Drives.Item.Root.Delta.DeltaRequestBuilder(driveItemDeltaCollectionPage.OdataNextLink, graphClient.RequestAdapter).GetAsync(); + driveItemDeltaCollectionPage = await new Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(driveItemDeltaCollectionPage.OdataNextLink, graphClient.RequestAdapter).GetAsync(); } // Now let's use the deltalink to make sure there aren't any changes. There shouldn't be. if (driveItemDeltaCollectionPage.OdataDeltaLink != null) { - driveItemDeltaCollectionPage = await new Microsoft.Graph.Beta.Drives.Item.Root.Delta.DeltaRequestBuilder(driveItemDeltaCollectionPage.OdataDeltaLink, graphClient.RequestAdapter).GetAsync(); + driveItemDeltaCollectionPage = await new Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(driveItemDeltaCollectionPage.OdataDeltaLink, graphClient.RequestAdapter).GetAsync(); } Assert.Empty(driveItemDeltaCollectionPage.Value); @@ -38,7 +38,7 @@ public async Task DeltaLinkDriveItem() // Now let's use the deltalink to make sure there aren't any changes. if (driveItemDeltaCollectionPage.OdataDeltaLink != null) { - driveItemDeltaCollectionPage = await new Microsoft.Graph.Beta.Drives.Item.Root.Delta.DeltaRequestBuilder(driveItemDeltaCollectionPage.OdataDeltaLink, graphClient.RequestAdapter).GetAsync(); + driveItemDeltaCollectionPage = await new Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(driveItemDeltaCollectionPage.OdataDeltaLink, graphClient.RequestAdapter).GetAsync(); } // We expect two changes, one new item, and the root folder will have a change. @@ -54,18 +54,18 @@ public async Task DeltaLinkDriveItem() public async Task DeltaLinkMessages() { // Get our first delta page. - var messagesDeltaCollectionPage = await graphClient.Me.MailFolders["inbox"].Messages.Delta().GetAsync(); + var messagesDeltaCollectionPage = await graphClient.Me.MailFolders["inbox"].Messages.MicrosoftGraphDelta.GetAsync(); // Go through all of the delta pages so that we can get the delta link on the last page. while (messagesDeltaCollectionPage.OdataNextLink != null) { - messagesDeltaCollectionPage = await new Microsoft.Graph.Beta.Me.MailFolders.Item.Messages.Delta.DeltaRequestBuilder(messagesDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); + messagesDeltaCollectionPage = await new Microsoft.Graph.Beta.Me.MailFolders.Item.Messages.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(messagesDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); } // Now let's use the deltalink to make sure there aren't any changes. There shouldn't be. if (messagesDeltaCollectionPage.OdataDeltaLink != null) { - messagesDeltaCollectionPage = await new Microsoft.Graph.Beta.Me.MailFolders.Item.Messages.Delta.DeltaRequestBuilder(messagesDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); + messagesDeltaCollectionPage = await new Microsoft.Graph.Beta.Me.MailFolders.Item.Messages.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(messagesDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); } Assert.Empty(messagesDeltaCollectionPage.Value); @@ -75,7 +75,7 @@ public async Task DeltaLinkMessages() // Now let's use the deltalink to make sure there aren't any changes. We expect to see a new message. if (messagesDeltaCollectionPage.OdataDeltaLink != null) { - messagesDeltaCollectionPage = await new Microsoft.Graph.Beta.Me.MailFolders.Item.Messages.Delta.DeltaRequestBuilder(messagesDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); + messagesDeltaCollectionPage = await new Microsoft.Graph.Beta.Me.MailFolders.Item.Messages.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(messagesDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); } // We expect two changes, one new item, and the root folder will have a change. @@ -86,20 +86,20 @@ public async Task DeltaLinkMessages() public async Task UserDeltaLink() { // Get our first delta page. - var userDeltaCollectionPage = await graphClient.Users.Delta().GetAsync(); + var userDeltaCollectionPage = await graphClient.Users.MicrosoftGraphDelta.GetAsync(); //var userDeltaCollectionPage = userDeltaCollectionPageResult.Value; // Go through all of the delta pages so that we can get the delta link on the last page. while (userDeltaCollectionPage.OdataNextLink != null) { - userDeltaCollectionPage = await new Microsoft.Graph.Beta.Users.Delta.DeltaRequestBuilder(userDeltaCollectionPage.OdataNextLink, graphClient.RequestAdapter).GetAsync(); + userDeltaCollectionPage = await new Microsoft.Graph.Beta.Users.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(userDeltaCollectionPage.OdataNextLink, graphClient.RequestAdapter).GetAsync(); } // Now let's use the deltalink to make sure there aren't any changes. We won't test this collection // since other tests could be making changes to the users in the org. if (userDeltaCollectionPage.OdataDeltaLink != null) { - userDeltaCollectionPage = await new Microsoft.Graph.Beta.Users.Delta.DeltaRequestBuilder(userDeltaCollectionPage.OdataDeltaLink, graphClient.RequestAdapter).GetAsync(); + userDeltaCollectionPage = await new Microsoft.Graph.Beta.Users.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(userDeltaCollectionPage.OdataDeltaLink, graphClient.RequestAdapter).GetAsync(); } } @@ -107,18 +107,18 @@ public async Task UserDeltaLink() public async Task GroupDeltaLink() { // Get our first delta page. - var groupDeltaCollectionPage = await graphClient.Groups.Delta().GetAsync(); + var groupDeltaCollectionPage = await graphClient.Groups.MicrosoftGraphDelta.GetAsync(); // Go through all of the delta pages so that we can get the delta link on the last page. while (groupDeltaCollectionPage.OdataNextLink != null) { - groupDeltaCollectionPage = await new Microsoft.Graph.Beta.Groups.Delta.DeltaRequestBuilder(groupDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); + groupDeltaCollectionPage = await new Microsoft.Graph.Beta.Groups.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(groupDeltaCollectionPage.OdataNextLink,graphClient.RequestAdapter).GetAsync(); } // Now let's use the deltalink to make sure there aren't any changes. if (groupDeltaCollectionPage.OdataDeltaLink != null) { - groupDeltaCollectionPage = await new Microsoft.Graph.Beta.Groups.Delta.DeltaRequestBuilder(groupDeltaCollectionPage.OdataDeltaLink,graphClient.RequestAdapter).GetAsync(); + groupDeltaCollectionPage = await new Microsoft.Graph.Beta.Groups.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(groupDeltaCollectionPage.OdataDeltaLink,graphClient.RequestAdapter).GetAsync(); // This could be false in case a change has occurred to a group since the last deltapage. Assert.True((groupDeltaCollectionPage.Value.Count == 0), "groupDeltaCollectionPage has unexpected entry."); @@ -148,7 +148,7 @@ public async Task GroupDeltaLink() // Call with the deltalink. We have to wait since there is some latency between the time that the // group is created and the time when the delta is registered. await Task.Delay(10000); - groupDeltaCollectionPage = await new Microsoft.Graph.Beta.Groups.Delta.DeltaRequestBuilder(groupDeltaCollectionPage.OdataDeltaLink,graphClient.RequestAdapter).GetAsync(); + groupDeltaCollectionPage = await new Microsoft.Graph.Beta.Groups.MicrosoftGraphDelta.MicrosoftGraphDeltaRequestBuilder(groupDeltaCollectionPage.OdataDeltaLink,graphClient.RequestAdapter).GetAsync(); Assert.True((groupDeltaCollectionPage.Value.Count == 1)); diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/EventTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/EventTests.cs index 51d13ad8452..b9c9f0688d2 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/EventTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/EventTests.cs @@ -8,7 +8,7 @@ namespace Microsoft.Graph.DotnetCore.Test.Requests.Functional using System.Collections.Generic; using System.Threading.Tasks; using Xunit; - using Microsoft.Graph.Beta.Me.FindMeetingTimes; + using Microsoft.Graph.Beta.Me.MicrosoftGraphFindMeetingTimes; using Microsoft.Graph.Beta.Models; public class EventTests : GraphTestBase @@ -100,7 +100,7 @@ public async Task EventFindMeetingsTimes() IsOrganizerOptional = true, ReturnSuggestionReasons = false }; - MeetingTimeSuggestionsResult resultsFromISO8601 = await graphClient.Me.FindMeetingTimes.PostAsync(requestBody1); + MeetingTimeSuggestionsResult resultsFromISO8601 = await graphClient.Me.MicrosoftGraphFindMeetingTimes.PostAsync(requestBody1); var requestBody = new FindMeetingTimesPostRequestBody { @@ -109,7 +109,7 @@ public async Task EventFindMeetingsTimes() MinimumAttendeePercentage = 10.0, MaxCandidates = 2 }; - MeetingTimeSuggestionsResult resultsFromTimeSpan = await graphClient.Me.FindMeetingTimes.PostAsync(requestBody); + MeetingTimeSuggestionsResult resultsFromTimeSpan = await graphClient.Me.MicrosoftGraphFindMeetingTimes.PostAsync(requestBody); Assert.NotNull(resultsFromTimeSpan); // Make sure that our custom serialization results are the same for both scenarios. diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ExcelTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ExcelTests.cs index c1f26a1afc4..a19534fd290 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ExcelTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ExcelTests.cs @@ -33,7 +33,7 @@ private async Task OneDriveSearchForTestFile(string fileName = "_excelTestResour { // Check that this item hasn't already been created. // https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/item_search - var searchResults = await graphClient.Drives["driveId"].Root.SearchWithQ(fileName).GetAsync(); + var searchResults = await graphClient.Drives["driveId"].Items[""].MicrosoftGraphSearchWithQ(fileName).GetAsync(); foreach (var r in searchResults.Value) { if (r.Name != fileName) @@ -57,7 +57,7 @@ public async Task OneDriveCreateTestFile(string fileName) // https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/item_search // TODO fix the metadata // var excelWorkbookDriveItem = await graphClient.Drives["driveId"].Root.Children.PostAsync(excelWorkbook); - var excelWorkbookDriveItem = await graphClient.Drives["driveId"].Root.Children[""].GetAsync(); + var excelWorkbookDriveItem = await graphClient.Drives["driveId"].Items[""].Children[""].GetAsync(); //var excelWorkbookDriveItem = await graphClient.Me.Drive.Root.Children.Request().Filter($"name eq '{fileName}'").GetAsync(); //await OneDriveDeleteTestFile(excelWorkbookDriveItem.CurrentPage.FirstOrDefault().Id, 3000); diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/MailTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/MailTests.cs index f00f8f73d97..3a9ce9f7233 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/MailTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/MailTests.cs @@ -5,7 +5,7 @@ namespace Microsoft.Graph.DotnetCore.Test.Requests.Functional { using Microsoft.Graph.Beta.Models; - using Microsoft.Graph.Beta.Me.SendMail; + using Microsoft.Graph.Beta.Me.MicrosoftGraphSendMail; using Microsoft.Graph.DotnetCore.Test.Requests.Functional.Resources; using System; using System.Collections.Generic; @@ -59,7 +59,7 @@ public async System.Threading.Tasks.Task MailSendMail() SaveToSentItems = true }; // Send email to the test user. - await graphClient.Me.SendMail.PostAsync(sendMailBody); + await graphClient.Me.MicrosoftGraphSendMail.PostAsync(sendMailBody); // Check the we found the sent email in the sent items folder. var mailFolderMessagesCollectionPage = await graphClient.Me.MailFolders["sentitems"].Messages.GetAsync(requestConfiguration => requestConfiguration.QueryParameters.Filter = "Subject eq '" + message.Subject + "'"); @@ -97,7 +97,7 @@ public async System.Threading.Tasks.Task MailSendMailWithFileAttachment() Message = message, SaveToSentItems = true }; - await graphClient.Me.SendMail.PostAsync(sendMailBody); + await graphClient.Me.MicrosoftGraphSendMail.PostAsync(sendMailBody); } catch (ApiException e) { diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneDriveTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneDriveTests.cs index 7af52a71e19..43859531a62 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneDriveTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneDriveTests.cs @@ -2,6 +2,10 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ +using Microsoft.Graph.Beta.Drives.Item.Items.Item.Children; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphCreateLink; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphInvite; + namespace Microsoft.Graph.DotnetCore.Test.Requests.Functional { using System; @@ -10,10 +14,7 @@ namespace Microsoft.Graph.DotnetCore.Test.Requests.Functional using System.Net.Http; using System.Threading.Tasks; using Xunit; - using Microsoft.Graph.Beta.Drive.Items.Item.CreateLink; - using Microsoft.Graph.Beta.Drive.Items.Item.Invite; using Microsoft.Graph.Beta.Drives.Item.Items.Item.Permissions; - using Microsoft.Graph.Beta.Drives.Item.Root.Children; using Microsoft.Graph.Beta.Models; using Microsoft.Graph.Beta; @@ -23,7 +24,7 @@ public class OneDriveTests : GraphTestBase public async Task OneDriveSharedWithMe() { - var sharedDriveItems = await graphClient.Drives["driveId"].SharedWithMe().GetAsync(); + var sharedDriveItems = await graphClient.Drives["driveId"].MicrosoftGraphSharedWithMe.GetAsync(); var permissionsPage = await graphClient.Drives["driveId"].Items[sharedDriveItems.Value[0].Id].Permissions.GetAsync(); var permissions = new List(); permissions.AddRange(permissionsPage.Value); @@ -58,7 +59,7 @@ public async Task OneDriveDownloadLargeFile() try { // Get the collection of drive items. We'll only use one. - var driveItems = await graphClient.Drives["driveId"].Root.Children.GetAsync(); + var driveItems = await graphClient.Drives["driveId"].Items[""].Children.GetAsync(); foreach (var item in driveItems.Value) { @@ -139,7 +140,7 @@ public async Task OneDriveNextPageRequest() { var driveItems = new List(); - var driveItemsPage = await graphClient.Drives["driveId"].Root.Children.GetAsync(requestConfiguration => requestConfiguration.QueryParameters.Top = 4); + var driveItemsPage = await graphClient.Drives["driveId"].Items[""].Children.GetAsync(requestConfiguration => requestConfiguration.QueryParameters.Top = 4); Assert.NotNull(driveItemsPage); @@ -163,7 +164,7 @@ public async Task OneDriveGetContent() { try { - var driveItems = await graphClient.Drives["driveId"].Root.Children.GetAsync(); + var driveItems = await graphClient.Drives["driveId"].Items[""].Children.GetAsync(); foreach (var item in driveItems.Value) { @@ -189,7 +190,7 @@ public async Task OneDriveGetSetPermissions() try { var driveItems = await graphClient.Drives["driveId"] - .Root + .Items[""] .Children .GetAsync(); @@ -232,7 +233,7 @@ public async Task OneDriveSearchFile() try { // http://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/item_search - var driveItems = await graphClient.Drives["driveId"].SearchWithQ("employee services").GetAsync(); + var driveItems = await graphClient.Drives["driveId"].MicrosoftGraphSearchWithQ("employee services").GetAsync(); // Expecting two results. Assert.Equal(2, driveItems.Value.Count); @@ -250,7 +251,7 @@ public async Task OneDriveCreateSharingLink() { try { - var itemToShare = await graphClient.Drives["driveId"].Root + var itemToShare = await graphClient.Drives["driveId"].Items[""] .Children .GetAsync(requestConfiguration => requestConfiguration.QueryParameters.Filter = "startswith(name,'Timesheet')"); @@ -259,7 +260,7 @@ public async Task OneDriveCreateSharingLink() var requestBody = new CreateLinkPostRequestBody { Type = "edit", Scope = "organization" }; var permission = await graphClient.Drives["driveId"].Root .ItemWithPath(itemToShare.Value[0].Name) - .CreateLink + .MicrosoftGraphCreateLink .PostAsync(requestBody); Assert.Equal("organization", permission.Link.Scope); @@ -281,7 +282,7 @@ public async Task OneDriveInvite() try { // Get the item to share with another user. - var itemToShare = await graphClient.Drives["driveId"].Root + var itemToShare = await graphClient.Drives["driveId"].Items[""] .Children .GetAsync(requestConfiguration => requestConfiguration.QueryParameters.Filter = "startswith(name,'Timesheet')"); Assert.StartsWith("Timesheet", itemToShare.Value[0].Name); @@ -312,7 +313,7 @@ public async Task OneDriveInvite() var inviteCollection = await graphClient.Drives["driveId"] .Root .ItemWithPath(itemToShare.Value[0].Name) - .Invite + .MicrosoftGraphInvite .PostAsync(invitePostBody); Assert.Equal("Alex Wilber", inviteCollection.Value[0].GrantedTo.User.DisplayName); diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneNoteTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneNoteTests.cs index 8326d72fa5c..12e2003ae5c 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneNoteTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/OneNoteTests.cs @@ -228,7 +228,7 @@ public async Task OneNotePagePreview() OnenotePagePreview pagePreview = await graphClient.Me .Onenote .Pages[pageId] - .Preview() + .MicrosoftGraphPreview .GetAsync(); Assert.NotNull(pagePreview); diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ReportTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ReportTests.cs index 40ef2b9263e..7521212b49a 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ReportTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/ReportTests.cs @@ -20,7 +20,7 @@ public async Task ReportingGetUserCounts() try { // Create the request message. - var getOffice365ActiveUserCountsRequest = graphClient.Reports.GetOffice365ActiveUserCountsWithPeriod("D7").ToGetRequestInformation(); + var getOffice365ActiveUserCountsRequest = graphClient.Reports.MicrosoftGraphGetOffice365ActiveUserCountsWithPeriod("D7").ToGetRequestInformation(); // Send the request and get the response. It will automatically follow the redirect to get the Report file. var responseStream = await graphClient.RequestAdapter.SendPrimitiveAsync(getOffice365ActiveUserCountsRequest); diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserActivitiesTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserActivitiesTests.cs index 89b8e25fc47..519f662ef86 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserActivitiesTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserActivitiesTests.cs @@ -144,7 +144,7 @@ public async Task ActivitiesGetRecentActivities() // Get recent user activities //var getRecentResponse = await graphClient.Me.Activities.Recent().GetAsync(requestConfiguration => requestConfiguration.QueryParameters.Expand = new string[] { "historyItems" }); - var getRecentResponse = await graphClient.Me.Activities.Recent().GetAsync(); + var getRecentResponse = await graphClient.Me.Activities.MicrosoftGraphRecent.GetAsync(); Assert.NotNull(getRecentResponse); diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserTests.cs index 83a2e6bc0dc..7f456d0dbc9 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Functional/UserTests.cs @@ -4,9 +4,9 @@ namespace Microsoft.Graph.DotnetCore.Test.Requests.Functional { - using Microsoft.Graph.Beta.Me.GetMailTips; - using Microsoft.Graph.Beta.Me.GetMemberGroups; - using AssignLicensePostRequestBody = Microsoft.Graph.Beta.Me.AssignLicense.AssignLicensePostRequestBody; + using Microsoft.Graph.Beta.Me.MicrosoftGraphGetMailTips; + using Microsoft.Graph.Beta.Me.MicrosoftGraphGetMemberGroups; + using AssignLicensePostRequestBody = Microsoft.Graph.Beta.Me.MicrosoftGraphAssignLicense.AssignLicensePostRequestBody; using Microsoft.Graph.DotnetCore.Test.Requests.Functional.Resources; using Microsoft.Graph.Beta.Models; using System; @@ -34,7 +34,7 @@ public async Task UserGetMailtipsTestEnumFlags() { EmailAddresses = emailAddresses, MailTipsOptions = mailTipsOptions }; - var mailTipsCollectionPage = await graphClient.Me.GetMailTips.PostAsync(requestBody); + var mailTipsCollectionPage = await graphClient.Me.MicrosoftGraphGetMailTips.PostAsync(requestBody); foreach (var mt in mailTipsCollectionPage.Value) { @@ -301,7 +301,7 @@ public async Task UserAssignLicense() AddLicenses = new List(), RemoveLicenses = new () }; - var user = await graphClient.Me.AssignLicense.PostAsync(requestBody); + var user = await graphClient.Me.MicrosoftGraphAssignLicense.PostAsync(requestBody); Assert.Null(user); } @@ -320,7 +320,7 @@ public async Task UserGetMemberGroups_SecurityEnabledOnly_ValueSet() { try { - var getMemberGroupsRequest = graphClient.Me.GetMemberGroups; + var getMemberGroupsRequest = graphClient.Me.MicrosoftGraphGetMemberGroups; var requestBody = new GetMemberGroupsPostRequestBody { SecurityEnabledOnly = true @@ -346,7 +346,7 @@ public async Task UserGetMemberGroups_SecurityEnabledOnly_ValueNotSet() { try { - var getMemberGroupsRequest = graphClient.Me.GetMemberGroups; + var getMemberGroupsRequest = graphClient.Me.MicrosoftGraphGetMemberGroups; var requestBody = new GetMemberGroupsPostRequestBody(); var directoryObjectGetMemberGroupsCollectionPage = await getMemberGroupsRequest.PostAsync(requestBody); } diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/ActionRequestTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/ActionRequestTests.cs index d576f6114ba..6080d3f6506 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/ActionRequestTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/ActionRequestTests.cs @@ -9,10 +9,10 @@ using System.Threading.Tasks; using Microsoft.Graph.Beta; using Microsoft.Graph.DotnetCore.Test.Mocks; -using Microsoft.Graph.Beta.Drives.Item.Items.Item.CreateLink; -using Microsoft.Graph.Beta.Me.AssignLicense; -using Microsoft.Graph.Beta.Me.CheckMemberGroups; -using Microsoft.Graph.Beta.Me.GetMemberGroups; +using Microsoft.Graph.Beta.Drives.Item.Items.Item.MicrosoftGraphCreateLink; +using Microsoft.Graph.Beta.Me.MicrosoftGraphAssignLicense; +using Microsoft.Graph.Beta.Me.MicrosoftGraphCheckMemberGroups; +using Microsoft.Graph.Beta.Me.MicrosoftGraphGetMemberGroups; using Microsoft.Graph.Beta.Models; using Microsoft.Kiota.Abstractions; using Microsoft.Kiota.Abstractions.Serialization; @@ -40,7 +40,7 @@ public void MultipleRequiredParameters() RemoveLicenses = new () }; - var requestInformation = graphServiceClient.Me.AssignLicense.ToPostRequestInformation(requestBody); + var requestInformation = graphServiceClient.Me.MicrosoftGraphAssignLicense.ToPostRequestInformation(requestBody); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -56,7 +56,7 @@ public void OptionalParameterWithNonNullableType_NullValue() var expectedRequestUrl = $"{string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")}/me/microsoft.graph.getMemberGroups"; var requestBody = new GetMemberGroupsPostRequestBody { }; - var requestInformation = graphServiceClient.Me.GetMemberGroups.ToPostRequestInformation(requestBody); + var requestInformation = graphServiceClient.Me.MicrosoftGraphGetMemberGroups.ToPostRequestInformation(requestBody); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -73,7 +73,7 @@ public void OptionalParameterWithNonNullableType_ValueSet() var expectedRequestUrl = string.Format("{0}/me/microsoft.graph.getMemberGroups", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); var requestBody = new GetMemberGroupsPostRequestBody { SecurityEnabledOnly = true}; - var requestInformation = graphServiceClient.Me.GetMemberGroups.ToPostRequestInformation(requestBody); + var requestInformation = graphServiceClient.Me.MicrosoftGraphGetMemberGroups.ToPostRequestInformation(requestBody); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -90,7 +90,7 @@ public void NoParameters() var messageId = "messageId"; var expectedRequestUrl = string.Format("{0}/me/mailFolders/Drafts/messages/{1}/microsoft.graph.send", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta"), messageId); - var requestInformation = graphServiceClient.Me.MailFolders["Drafts"].Messages[messageId].Send.ToPostRequestInformation(); + var requestInformation = graphServiceClient.Me.MailFolders["Drafts"].Messages[messageId].MicrosoftGraphSend.ToPostRequestInformation(); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -106,7 +106,7 @@ public void MultipleRequiredParameters_FirstParameterNull() var graphServiceClient = new GraphServiceClient(mockRequestAdapter.Object); var removeLicenses = new List { new Guid() }; - Assert.ThrowsAsync(() => graphServiceClient.Me.AssignLicense.PostAsync(null)); + Assert.ThrowsAsync(() => graphServiceClient.Me.MicrosoftGraphAssignLicense.PostAsync(null)); } /// @@ -148,7 +148,7 @@ public async System.Threading.Tasks.Task PostAsync_CollectionOfPrimitivesReturnT { GroupIds = new List() }; - var returnedCollectionPage = await graphServiceClient.Me.CheckMemberGroups.PostAsync(requestBody); + var returnedCollectionPage = await graphServiceClient.Me.MicrosoftGraphCheckMemberGroups.PostAsync(requestBody); Assert.NotNull(returnedCollectionPage); Assert.Equal(checkMemberGroupsCollectionPage, returnedCollectionPage.Value); @@ -178,7 +178,7 @@ public async System.Threading.Tasks.Task PostAsync_NonCollectionReturnType() adapter => adapter.SerializationWriterFactory.GetSerializationWriter(It.IsAny()) ).Returns(new JsonSerializationWriter()); - var permission = await graphServiceClient.Drives["driveId"].Items["id"].CreateLink.PostAsync(requestBody); + var permission = await graphServiceClient.Drives["driveId"].Items["id"].MicrosoftGraphCreateLink.PostAsync(requestBody); Assert.NotNull(permission); Assert.Equal(expectedPermission, permission); @@ -196,7 +196,7 @@ public async System.Threading.Tasks.Task PostAsync_NoReturnValue() adapter => adapter.SendNoContentAsync(It.IsAny(), It.IsAny>>(),It.IsAny() ) ).Callback(() => {}).Returns(Task.CompletedTask); - await graphServiceClient.Me.MailFolders["Drafts"].Messages["messageId"].Send.PostAsync(); + await graphServiceClient.Me.MailFolders["Drafts"].Messages["messageId"].MicrosoftGraphSend.PostAsync(); } } } diff --git a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/FunctionRequestTests.cs b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/FunctionRequestTests.cs index 216f38562e8..0a30c3b07c8 100644 --- a/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/FunctionRequestTests.cs +++ b/tests/Microsoft.Graph.DotnetCore.Test/Requests/Generated/FunctionRequestTests.cs @@ -20,9 +20,9 @@ public class FunctionRequestTests public void NoParameters() { var graphServiceClient = new GraphServiceClient(new MockAuthenticationProvider().Object); - var expectedRequestUrl = string.Format("{0}/drives/id/root/microsoft.graph.delta()", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); + var expectedRequestUrl = string.Format("{0}/drives/id/items/id/microsoft.graph.delta()", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); - var requestInformation = graphServiceClient.Drives["id"].Root.Delta().ToGetRequestInformation(); + var requestInformation = graphServiceClient.Drives["id"].Items["id"].MicrosoftGraphDelta.ToGetRequestInformation(); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -37,10 +37,10 @@ public void OptionalParameter_ParameterSet() var graphServiceClient = new GraphServiceClient(new MockAuthenticationProvider().Object); var q = "value"; - var methodBaseUrl = string.Format("{0}/drives/id/root/microsoft.graph.search", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); + var methodBaseUrl = string.Format("{0}/drives/id/items/id/microsoft.graph.search", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); var expectedRequestUrl = string.Format("{0}(q='{1}')", methodBaseUrl, q); - var requestInformation = graphServiceClient.Drives["id"].Root.SearchWithQ(q).ToGetRequestInformation(); + var requestInformation = graphServiceClient.Drives["id"].Items["id"].MicrosoftGraphSearchWithQ(q).ToGetRequestInformation(); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -59,7 +59,7 @@ public void RequiredAndOptionalParameters_AllParametersSet() var methodBaseUrl = string.Format("{0}/me/microsoft.graph.reminderView", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); var expectedRequestUrl = string.Format("{0}(StartDateTime='{2}',EndDateTime='{1}')", methodBaseUrl, startDateTime, endDateTime); - var requestInformation = graphServiceClient.Me.ReminderViewWithStartDateTimeWithEndDateTime(startDateTime, endDateTime).ToGetRequestInformation(); + var requestInformation = graphServiceClient.Me.MicrosoftGraphReminderViewWithStartDateTimeWithEndDateTime(startDateTime, endDateTime).ToGetRequestInformation(); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -75,7 +75,7 @@ public void RequiredAndOptionalParameters_RequiredParameterNull() var graphServiceClient = new GraphServiceClient(mockRequestAdapter.Object); try { - Assert.Throws(() => graphServiceClient.Me.ReminderViewWithStartDateTimeWithEndDateTime("","")); + Assert.Throws(() => graphServiceClient.Me.MicrosoftGraphReminderViewWithStartDateTimeWithEndDateTime("","")); } catch (ServiceException serviceException) { @@ -97,7 +97,7 @@ public void Top() var graphServiceClient = new GraphServiceClient(new MockAuthenticationProvider().Object); var expectedRequestUrl = string.Format("{0}/me/microsoft.graph.reminderView(StartDateTime='now',EndDateTime='then')?%24top=1", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); - var requestInformation = graphServiceClient.Me.ReminderViewWithStartDateTimeWithEndDateTime("then","now").ToGetRequestInformation( requestConfiguration =>requestConfiguration.QueryParameters.Top =1 ); + var requestInformation = graphServiceClient.Me.MicrosoftGraphReminderViewWithStartDateTimeWithEndDateTime("then","now").ToGetRequestInformation( requestConfiguration =>requestConfiguration.QueryParameters.Top =1 ); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI); @@ -112,7 +112,7 @@ public void Skip() var graphServiceClient = new GraphServiceClient(new MockAuthenticationProvider().Object); var expectedRequestUrl = string.Format("{0}/me/microsoft.graph.reminderView(StartDateTime='now',EndDateTime='then')?%24skip=1", string.Format(Constants.Url.GraphBaseUrlFormatString, "beta")); - var requestInformation = graphServiceClient.Me.ReminderViewWithStartDateTimeWithEndDateTime("then","now").ToGetRequestInformation( requestConfiguration =>requestConfiguration.QueryParameters.Skip =1 ); + var requestInformation = graphServiceClient.Me.MicrosoftGraphReminderViewWithStartDateTimeWithEndDateTime("then","now").ToGetRequestInformation( requestConfiguration =>requestConfiguration.QueryParameters.Skip =1 ); Assert.NotNull(requestInformation); Assert.Equal(new Uri(expectedRequestUrl), requestInformation.URI);