Skip to content

Commit

Permalink
Reenables test after breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
andrueastman committed Feb 9, 2023
1 parent b8e091e commit eed7cca
Show file tree
Hide file tree
Showing 13 changed files with 129 additions and 207 deletions.
18 changes: 18 additions & 0 deletions Microsoft.Graph.Beta.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
185 changes: 44 additions & 141 deletions src/Microsoft.Graph/Extensions/DriveItemRequestBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down Expand Up @@ -56,33 +53,6 @@ public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Grap
return new CustomDriveItemItemRequestBuilder(builder.Uri.OriginalString, requestAdapter);
}

/// <summary>
/// Gets drive item request builder for the specified drive item path.
/// <returns>The drive item request builder.</returns>
/// </summary>
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);
}
/// <summary>
/// Gets drive item request builder for the specified drive item path.
/// <returns>The drive item request builder.</returns>
Expand Down Expand Up @@ -110,60 +80,6 @@ public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Grap
return new CustomDriveItemItemRequestBuilder(builder.Uri.OriginalString, requestAdapter);
}

/// <summary>
/// Gets drive item request builder for the specified drive item path.
/// <returns>The drive item request builder.</returns>
/// </summary>
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);
}
/// <summary>
/// Gets drive item request builder for the specified drive item path.
/// <returns>The drive item request builder.</returns>
/// </summary>
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)
Expand All @@ -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;
/// <summary>
Expand All @@ -188,25 +104,17 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA
this.RequestAdapter = requestAdapter;
}

/// <summary>Provides operations to manage the activities property of the microsoft.graph.driveItem entity.</summary>
public new ActivitiesRequestBuilder Activities { get =>
new ActivitiesRequestBuilder(this._rawUrl + "/activities", RequestAdapter);
}
/// <summary>Provides operations to manage the analytics property of the microsoft.graph.driveItem entity.</summary>
public new AnalyticsRequestBuilder Analytics { get =>
new AnalyticsRequestBuilder(this._rawUrl + "/analytics", RequestAdapter);
}
/// <summary>Provides operations to call the assignSensitivityLabel method.</summary>
public new AssignSensitivityLabelRequestBuilder AssignSensitivityLabel { get =>
new AssignSensitivityLabelRequestBuilder(this._rawUrl + "/microsoft.graph.assignSensitivityLabel", RequestAdapter);
}
/// <summary>Provides operations to call the checkin method.</summary>
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);
}
/// <summary>Provides operations to call the checkout method.</summary>
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);
}
/// <summary>Provides operations to manage the children property of the microsoft.graph.driveItem entity.</summary>
public new ChildrenRequestBuilder Children { get =>
Expand All @@ -217,28 +125,24 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA
new ContentRequestBuilder(this._rawUrl + "/content", RequestAdapter);
}
/// <summary>Provides operations to call the copy method.</summary>
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);
}
/// <summary>Provides operations to call the createLink method.</summary>
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);
}
/// <summary>Provides operations to call the createUploadSession method.</summary>
public new CreateUploadSessionRequestBuilder CreateUploadSession { get =>
new CreateUploadSessionRequestBuilder(this._rawUrl+"/microsoft.graph.createUploadSession" , RequestAdapter);
}
/// <summary>Provides operations to call the extractSensitivityLabels method.</summary>
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);
}
/// <summary>Provides operations to call the follow method.</summary>
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);
}
/// <summary>Provides operations to call the invite method.</summary>
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);
}
/// <summary>Provides operations to manage the listItem property of the microsoft.graph.driveItem entity.</summary>
public new ListItemRequestBuilder ListItem { get =>
Expand All @@ -249,14 +153,14 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA
new PermissionsRequestBuilder(this._rawUrl+"/permissions", RequestAdapter);
}
/// <summary>Provides operations to call the preview method.</summary>
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);
}
/// <summary>The request adapter to use to execute the requests.</summary>
private IRequestAdapter RequestAdapter { get; set; }
/// <summary>Provides operations to call the restore method.</summary>
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);
}
/// <summary>Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity.</summary>
public new SubscriptionsRequestBuilder Subscriptions { get =>
Expand All @@ -267,16 +171,15 @@ public CustomDriveItemItemRequestBuilder(string rawUrl, IRequestAdapter requestA
new ThumbnailsRequestBuilder(this._rawUrl+"/thumbnails", RequestAdapter);
}
/// <summary>Provides operations to call the unfollow method.</summary>
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);
}
/// <summary>Provides operations to call the validatePermission method.</summary>
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);
}
/// <summary>Provides operations to manage the versions property of the microsoft.graph.driveItem entity.</summary>
public new VersionsRequestBuilder Versions { get =>
new VersionsRequestBuilder(this._rawUrl+"/versions", RequestAdapter);
}
}
*/
Loading

0 comments on commit eed7cca

Please sign in to comment.