Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
02d1d18
Migrate Users shared directives with reviewed legacy lineage
ramsessanchez Oct 22, 2026
b804a38
Regenerate Users v1.0 Kiota client and cmdlets
ramsessanchez Oct 22, 2026
95cf49d
Preserve the published Users sponsor item command
ramsessanchez Oct 22, 2026
ca62204
Pin Users beta photo route fidelity and published defaults
ramsessanchez Oct 22, 2026
ec2bd4d
Validate Users reviewed ledger against actual profile specs
ramsessanchez Oct 22, 2026
78f77dc
Merge remote-tracking branch 'origin/powershell-v3' into ramsessanche…
ramsessanchez Oct 30, 2026
01e70c6
Align Users migration with merged shared operation-variant APIs
ramsessanchez Oct 30, 2026
238d056
Regenerate Users v1.0 on merged operation-variant framework
ramsessanchez Oct 30, 2026
685c465
Generate Users beta Kiota client and cmdlets on current framework
ramsessanchez Oct 30, 2026
69a2262
Merge remote-tracking branch 'origin/powershell-v3' into ramsessanche…
ramsessanchez Nov 5, 2026
6d6c22e
Revalidate Users required QueryId contract after normal framework merge
ramsessanchez Nov 5, 2026
a0c22cf
Regenerate Users v1.0 after merged required-query and Auth integration
ramsessanchez Nov 5, 2026
f103473
Regenerate Users beta with mandatory queries and adapted Authentication
ramsessanchez Nov 5, 2026
579e9b6
Merge remote-tracking branch 'origin/powershell-v3' into ramsessanche…
ramsessanchez Nov 6, 2026
9122523
Pin Users one-operation PATCH result contract on merged target
ramsessanchez Nov 6, 2026
21d1c58
Regenerate Users v1.0 with one-operation PATCH results
ramsessanchez Nov 6, 2026
6877b31
Regenerate Users beta with single-request PATCH success
ramsessanchez Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions src/Users/Users.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,44 @@ require:

> see https://github.com/Azure/autorest/blob/master/docs/powershell/directives.md

The reviewed wrapper migration covers only this shared file, for both v1.0 and
beta; no profiles are excluded. Profile-local readmes (including their local
directive groups) and `src/readme.graph.md` are explicitly ignored and unchanged.
Parameter aliases/transforms and schema/response directives are deferred, not
implemented by this cmdlet-surface migration; none occur in this shared file.
Exact legacy-to-compatible evidence is recorded in
`wrapper/Users_directiveMigrationMap.json`, with regression coverage in
`tools/WrapperGenerator.Tests/UsersDirectiveMigrationTests.cs`.

``` yaml
directive:
# Remove invalid root paths e.g. users{id}/todo
# Wrapper migration, directive 1: the ORIGINAL case-sensitive regex selects only
# root todo GET/PATCH/DELETE in each legacy profile. All three survive with
# aligned compatible IDs and exact method/path module suppressions.
# It does not select user_GetOutlook or any nested todo/lists operation.
- remove-path-by-operation: user_(Get|Create|Update|Delete|Set)(Todo|outlook)
# Remove commands
# Wrapper migration, directive 2: suppress POST .../licenseDetails only. The
# curated entry preserves existing v1.0 derived behavior and also covers beta.
- where:
verb: New
subject: ^UserLicenseDetail$
remove: true
# Wrapper migration, directive 3: subsumed by directive 1's earlier root-path
# removal. The actual legacy todo GET returns a singleton, not a List response.
# Record the surviving GET as lineage, not API absence; add no redundant rename.
- where:
verb: Get
subject: ^(UserTodo)$
variant: List
set:
subject: $1List
# Wrapper migration, directive 4: suppress PATCH .../photo only, retaining the
# existing curated /photos behavior and all unaffected photo/content neighbors.
- where:
verb: Update
subject: ^UserPhoto$
remove: true
# Keep these original directives active until the AutoRest pipeline is retired.
```
24 changes: 24 additions & 0 deletions src/Users/wrapper/Users_cmdletConfigurations.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
using System.Collections.Generic;
using System.Net.Http;

namespace WrapperGenerator;

public static partial class CmdletConfigurator
{
private static readonly List<Entry> UsersCmdletConfigurations =
[
// Users.md directive 1 matches these three legacy operations, not the nested
// /todo/lists routes or user_GetOutlook (the original regex uses lowercase outlook).
new(OverrideKind.SuppressOperation, HttpMethod.Get, "/users/{}/todo", PathMatch.Exact, null,
"Users.md directive 1: user_GetTodo is aligned in both compatible profiles"),
new(OverrideKind.SuppressOperation, HttpMethod.Patch, "/users/{}/todo", PathMatch.Exact, null,
"Users.md directive 1: user_UpdateTodo is aligned in both compatible profiles"),
new(OverrideKind.SuppressOperation, HttpMethod.Delete, "/users/{}/todo", PathMatch.Exact, null,
"Users.md directive 1: user_DeleteTodo is aligned in both compatible profiles"),
new(OverrideKind.SuppressOperation, HttpMethod.Post, "/users/{}/licensedetails", PathMatch.Exact, null,
"Users.md directive 2: remove New UserLicenseDetail; retain license-detail reads and item operations"),
new(OverrideKind.SuppressOperation, HttpMethod.Patch, "/users/{}/photo", PathMatch.Exact, null,
"Users.md directive 4: remove Update UserPhoto; retain photo reads and content operations"),

new(OverrideKind.ReplaceNoun, HttpMethod.Delete, "/users/{}/sponsors/{}/$ref", PathMatch.Exact,
"UserSponsorDirectoryObjectByRef",
"Published beta metadata and Learn: item SponsorDirectoryObjectByRef is distinct from collection SponsorByRef"),

// Media variants cannot use the natural-ID entity dispatcher. Distinguish the
// source's Get/Set/DeletePhotosContent by its required ProfilePhotoId instead.
new(OverrideKind.ReplaceNoun, Method: null, "/users/{}/photos/{}/$value", PathMatch.Exact,
"UserPhotoContentById",
"Source user_*PhotosContent selects a specific ProfilePhotoId; retain the singleton PhotoContent default and both URLs"),

// Get-MgUserPhoto serves both /photo and /photos; the /photos routes ship no distinct
// cmdlet, and generating them would collide with the singleton's noun.
new(OverrideKind.SuppressOperation, Method: null, "/users/{}/photos", Match: PathMatch.Exact, Value: null,
Expand Down
164 changes: 164 additions & 0 deletions src/Users/wrapper/Users_directiveMigrationMap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"audit": {
"source": "src/Users/Users.md",
"baseline": "6475f3f5beb4908d39ea356db32bf1e0fd3273cb",
"requiredProfiles": ["v1.0", "beta"],
"excludedProfiles": [],
"ignored": ["src/Users/v1.0/readme.md", "src/Users/beta/readme.md", "src/readme.graph.md"],
"deferred": "Parameter aliases/transforms and schema/response directives; none occur in the shared source.",
"compatibleSpecBlobs": {
"v1.0": "7cb83e0f6f59232ce7e7fd585001d3836c3938d2",
"beta": "71a3ce7e835abfecb84bad4776a22e5a6814531c"
},
"legacySpecBlobs": {
"v1.0": "6eab7f412e4e1fd88e1156b4daa0e68a7a1c5edb",
"beta": "639e0bee6e68c4a9550dcdc2cd071c3f9ab1adbc"
},
"lineage": "The original case-sensitive regex selects exactly root todo GET/PATCH/DELETE in each actual same-profile legacy spec. All three survive at identical exact method/path with aligned user_GetTodo/user_UpdateTodo/user_DeleteTodo IDs in the current compatible specs. The complete original-survivor and literal-current selected sets are equal (3/3 in each profile). user_GetOutlook does not match lowercase outlook. No removals, namespace translations or reserved legacy-ledger fields are needed.",
"coverage": "Exact module entries preserve v1.0 derived suppressions while supplying the missing beta coverage. Existing curated /photos suppressions remain unchanged. The unreachable UserTodo List rename is subsumed, not implemented as a new public noun.",
"patchContract": "Normally merged #3886 makes Update User perform only its PATCH. A 204 succeeds with no returned object and no implicit GET; a 200 returns the actual typed model in one request. Caller-explicit Get User retains independent headers, queries and error behavior. No readback flag or GET-only query requirement is added.",
"photoMediaContract": {
"defaultPath": "/users/{user-id}/photo/$value",
"additionalPath": "/users/{user-id}/photos/{profilePhoto-id}/$value",
"methods": ["GET", "DELETE"],
"publishedHelpCommit": "07b0cf8f6305213f3c3830c301fca69a3e82ed17",
"getHelp": "https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.beta.users/get-mgbetauserphotocontent?view=graph-powershell-beta",
"deleteHelp": "https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.beta.users/remove-mgbetauserphotocontent?view=graph-powershell-beta",
"defaultEvidence": "Published Get (Default) requires UserId and OutFile; Get1 additionally requires ProfilePhotoId. Delete (Default) requires UserId; Delete1 additionally requires ProfilePhotoId. Thus the singleton is independently verified as the published default, not guessed from the metadata oracle's first URI.",
"routeFidelity": "Media is incompatible with the merged natural-ID entity dispatcher. An exact shared noun repair names the explicit ProfilePhotoId route UserPhotoContentById, justified by source user_GetPhotosContent/user_SetPhotosContent/user_DeletePhotosContent and its distinct mandatory ID. Singleton UserPhotoContent and its URL remain unchanged. No endpoints are pruned and no grouping, selectors, profile authoring or capability flags are introduced.",
"wrapperSemantics": "Keep existing optional OutFile behavior (bytes when omitted). Frozen v1.0 derived suppressions of the additional GET/DELETE media route remain unchanged; beta exposes the distinct ById commands. PUT media with only a 2XX response remains an unsuppressed baseline client-only operation, not a compiled neighbor pass."
},
"betaCollisionRepair": {
"method": "DELETE",
"path": "/users/{user-id}/sponsors/{directoryObject-id}/$ref",
"operationId": "user.sponsor_DeleteDirectoryObjectGraphBPreRef",
"noun": "UserSponsorDirectoryObjectByRef",
"evidence": "The repository's beta MgCommandMetadata row independently publishes Remove-MgBetaUserSponsorDirectoryObjectByRef for this exact item URI. It is not the root Remove-MgBetaUserSponsorByRef command. No route is suppressed or renamed speculatively.",
"publishedHelp": "https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.beta.users/remove-mgbetausersponsordirectoryobjectbyref?view=graph-powershell-beta",
"publishedHelpCommit": "07b0cf8f6305213f3c3830c301fca69a3e82ed17",
"requiredParameters": ["UserId", "DirectoryObjectId"],
"rootNeighbor": "DELETE /users/{user-id}/sponsors/$ref remains separately named SponsorByRef. This is the only effective required query operation in each current module spec: @id:string. Normally merged #3882 supplies mandatory QueryId (no legacy Id alias), assigning the typed Kiota Id member and preserving the native @id wire name. The separately published item route still uses only UserId/DirectoryObjectId. No module authoring flags, copied repair or one-member group.",
"rootPublishedHelp": "https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.beta.users/remove-mgbetausersponsorbyref?view=graph-powershell-beta"
}
},
"mappings": [
{
"module": "Users",
"directiveIndex": 1,
"classification": "OperationIdSuppression",
"sourceContains": "remove-path-by-operation: user_(Get|Create|Update|Delete|Set)(Todo|outlook)",
"implementation": "CmdletConfigurator",
"notes": "Suppress exactly root todo GET/PATCH/DELETE, preserving nested todo/lists. The complete original legacy match set has three surviving operations in each profile; uppercase user_GetOutlook is not selected.",
"profiles": {
"v1.0": {
"notes": "All three original matches survive at exact method/path with aligned IDs. Complete source-survivor and current literal selector sets are equal.",
"absenceExpected": false,
"operations": [
{
"method": "GET",
"path": "/users/{user-id}/todo",
"operationId": "user_GetTodo"
},
{
"method": "PATCH",
"path": "/users/{user-id}/todo",
"operationId": "user_UpdateTodo"
},
{
"method": "DELETE",
"path": "/users/{user-id}/todo",
"operationId": "user_DeleteTodo"
}
]
},
"beta": {
"notes": "All three original matches survive at exact method/path with aligned IDs. Complete source-survivor and current literal selector sets are equal.",
"absenceExpected": false,
"operations": [
{
"method": "GET",
"path": "/users/{user-id}/todo",
"operationId": "user_GetTodo"
},
{
"method": "PATCH",
"path": "/users/{user-id}/todo",
"operationId": "user_UpdateTodo"
},
{
"method": "DELETE",
"path": "/users/{user-id}/todo",
"operationId": "user_DeleteTodo"
}
]
}
}
},
{
"module": "Users",
"directiveIndex": 2,
"classification": "CmdletSuppression",
"sourceContains": "subject: ^UserLicenseDetail$",
"implementation": "CmdletConfigurator",
"notes": "New UserLicenseDetail selects only POST /users/{user-id}/licenseDetails: user_CreateLicenseDetail in both legacy and current compatible profiles. Retain collection/item reads and item mutations.",
"profiles": {
"v1.0": {
"absenceExpected": false,
"operations": [
{ "method": "POST", "path": "/users/{user-id}/licenseDetails", "operationId": "user_CreateLicenseDetail" }
]
},
"beta": {
"absenceExpected": false,
"operations": [
{ "method": "POST", "path": "/users/{user-id}/licenseDetails", "operationId": "user_CreateLicenseDetail" }
]
}
}
},
{
"module": "Users",
"directiveIndex": 3,
"classification": "SubjectRename",
"sourceContains": "variant: List",
"implementation": "SupersededBySuppression",
"notes": "The earlier operation-ID directive removes the root todo path before this Get UserTodo List rename can act. Actual legacy user_GetTodo returns singleton microsoft.graph.todo (not a List collection), and its exact GET successor survives in both compatible specs but is suppressed by directive 1. Evidence records this route's lineage, not API absence or an invented List variant. Nested GET /todo/lists already structurally produces UserTodoList; no redundant rename.",
"profiles": {
"v1.0": {
"absenceExpected": false,
"operations": [
{ "method": "GET", "path": "/users/{user-id}/todo", "operationId": "user_GetTodo" }
]
},
"beta": {
"absenceExpected": false,
"operations": [
{ "method": "GET", "path": "/users/{user-id}/todo", "operationId": "user_GetTodo" }
]
}
}
},
{
"module": "Users",
"directiveIndex": 4,
"classification": "CmdletSuppression",
"sourceContains": "subject: ^UserPhoto$",
"implementation": "CmdletConfigurator",
"notes": "Update UserPhoto selects only PATCH /users/{user-id}/photo: user_UpdatePhoto in both legacy and current compatible profiles. Preserve singleton GET and unsuppressed GET/PUT photo/$value selection, plus the pre-existing curated /photos behavior.",
"profiles": {
"v1.0": {
"absenceExpected": false,
"operations": [
{ "method": "PATCH", "path": "/users/{user-id}/photo", "operationId": "user_UpdatePhoto" }
]
},
"beta": {
"absenceExpected": false,
"operations": [
{ "method": "PATCH", "path": "/users/{user-id}/photo", "operationId": "user_UpdatePhoto" }
]
}
}
}
]
}
57 changes: 57 additions & 0 deletions src/Users/wrapper/beta/Client/ApiClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// <auto-generated/>
#pragma warning disable CS0618
using Microsoft.Graph.PowerShell.Users.Client.Users;
using Microsoft.Graph.PowerShell.Users.Client.UsersWithUserPrincipalName;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions;
using Microsoft.Kiota.Serialization.Form;
using Microsoft.Kiota.Serialization.Json;
using Microsoft.Kiota.Serialization.Multipart;
using Microsoft.Kiota.Serialization.Text;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System;
namespace Microsoft.Graph.PowerShell.Users.Client
{
/// <summary>
/// The main entry point of the SDK, exposes the configuration and the fluent API.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")]
public partial class ApiClient : BaseRequestBuilder
{
/// <summary>The users property</summary>
public global::Microsoft.Graph.PowerShell.Users.Client.Users.UsersRequestBuilder Users
{
get => new global::Microsoft.Graph.PowerShell.Users.Client.Users.UsersRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>
/// Instantiates a new <see cref="global::Microsoft.Graph.PowerShell.Users.Client.ApiClient"/> and sets the default values.
/// </summary>
/// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
public ApiClient(IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}", new Dictionary<string, object>())
{
ApiClientBuilder.RegisterDefaultSerializer<JsonSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultSerializer<TextSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultSerializer<FormSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultSerializer<MultipartSerializationWriterFactory>();
ApiClientBuilder.RegisterDefaultDeserializer<JsonParseNodeFactory>();
ApiClientBuilder.RegisterDefaultDeserializer<TextParseNodeFactory>();
ApiClientBuilder.RegisterDefaultDeserializer<FormParseNodeFactory>();
if (string.IsNullOrEmpty(RequestAdapter.BaseUrl))
{
RequestAdapter.BaseUrl = "https://graph.microsoft.com/beta";
}
PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl);
}
/// <summary>
/// Builds and executes requests for operations under \users(userPrincipalName=&apos;{userPrincipalName}&apos;)
/// </summary>
/// <returns>A <see cref="global::Microsoft.Graph.PowerShell.Users.Client.UsersWithUserPrincipalName.UsersWithUserPrincipalNameRequestBuilder"/></returns>
public global::Microsoft.Graph.PowerShell.Users.Client.UsersWithUserPrincipalName.UsersWithUserPrincipalNameRequestBuilder UsersWithUserPrincipalName()
{
return new global::Microsoft.Graph.PowerShell.Users.Client.UsersWithUserPrincipalName.UsersWithUserPrincipalNameRequestBuilder(PathParameters, RequestAdapter);
}
}
}
#pragma warning restore CS0618
28 changes: 28 additions & 0 deletions src/Users/wrapper/beta/Client/Client.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Generated by tools/Build-WrapperModule.ps1. Regenerate rather than edit by hand. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- netstandard2.0 because this assembly has to load in both PowerShell editions. The
compatibility contract is declared by the module every wrapper references,
src/Authentication/Authentication/Microsoft.Graph.Authentication.psd1: PowerShellVersion
'5.1' and CompatiblePSEditions 'Core','Desktop'. A module manifest binds one
un-conditioned dll path, so a single framework has to satisfy both editions: net472
covers Desktop only, net6.0/net8.0/net10.0 cover Core only, netstandard2.0 covers both.
Microsoft.Kiota.Bundle 2.0.0 ships a netstandard2.0 asset, and the generated client
compiles against it. -->
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Microsoft.Graph.Wrapper.Users.Client</AssemblyName>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Kiota.Bundle" Version="2.0.0" />
<!-- Pinned above the version Microsoft.Kiota.Bundle pulls in transitively (8.0.0), which
carries CVE-2024-30105 and CVE-2024-43485. Same version Authentication.Core pins. -->
<PackageReference Include="System.Text.Json" Version="10.0.3" />
</ItemGroup>

</Project>
Loading
Loading