From f326e9d1c3f8db38952aef1583188d092d429a61 Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Wed, 21 Oct 2026 17:32:09 -0700 Subject: [PATCH 01/11] Audit ChangeNotifications shared directive migration Record an empty reviewed mapping ledger with exact v1.0 and beta compatible operation evidence, and pin unaffected structural and data-aware naming without adding overrides. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../ChangeNotifications.md | 29 +++++ ...geNotifications_directiveMigrationMap.json | 99 +++++++++++++++ ...ngeNotificationsDirectiveMigrationTests.cs | 117 ++++++++++++++++++ 3 files changed, 245 insertions(+) create mode 100644 src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json create mode 100644 tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs diff --git a/src/ChangeNotifications/ChangeNotifications.md b/src/ChangeNotifications/ChangeNotifications.md index 34af78e17dd..22672a8e938 100644 --- a/src/ChangeNotifications/ChangeNotifications.md +++ b/src/ChangeNotifications/ChangeNotifications.md @@ -18,3 +18,32 @@ require: ``` yaml # Directives go here! ``` + +### Wrapper migration audit + +The shared file contains no cmdlet suppressions or renames and no parameter +aliases/transforms or schema/response directives to defer. The AutoRest require +and placeholder above remain unchanged. This audit excludes `src/readme.graph.md` +and both profile-local `readme.md` files; their directives are not migrated. + +`wrapper/ChangeNotifications_directiveMigrationMap.json` therefore has an empty +`mappings` array, not invented directive-to-operation mappings. Its separate audit +records exact HTTP method/path/operation-ID evidence from both required +`openApiDocs_KiotaCompat` specifications: six operations in v1.0 and seven in beta. +Neither profile is excluded. The absence of `getVapidPublicKey()` in v1.0 is an +operation-level difference, not an unsupported profile. + +`ChangeNotifications_cmdletConfigurations.cs` intentionally remains empty. +Structural naming supplies subscription CRUD names and the action/function +names. Existing v1.0 parity data renames the structural +`Invoke-MgSubscriptionReauthorize` to `Invoke-MgReauthorizeSubscription`; beta +currently retains the structural name. Beta's structural +`Get-MgSubscriptionGetVapidPublicKey` also differs from the legacy published noun +`Get-MgBetaSubscriptionVapidPublicKey`. These baseline naming differences are not +shared directives and do not justify new overrides in this audit. + +`tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs` +checks the empty audit and pins every compatible operation's identity, +classification, unsuppressed status, structural name, and data-aware name in both +profiles. Full generation/build evidence is a separate gate; existing tracked +output directories are `wrapper/v1.0` and `wrapper/Beta`. diff --git a/src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json b/src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json new file mode 100644 index 00000000000..b80198c32eb --- /dev/null +++ b/src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json @@ -0,0 +1,99 @@ +{ + "mappings": [], + "audit": { + "module": "ChangeNotifications", + "source": "src/ChangeNotifications/ChangeNotifications.md", + "disposition": "NoSharedDirectives", + "sharedCmdletDirectiveCount": 0, + "deferredParameterDirectiveCount": 0, + "deferredSchemaDirectiveCount": 0, + "excludedProfiles": [], + "ignoredSources": [ + "src/readme.graph.md", + "src/ChangeNotifications/v1.0/readme.md", + "src/ChangeNotifications/beta/readme.md" + ], + "notes": "These are unaffected-operation audit evidence, not directive mappings. No curated overrides are needed. Existing v1.0 parity data renames reauthorize; beta action/function naming differences from the legacy SDK remain unrelated baseline behavior.", + "profiles": { + "v1.0": { + "spec": "openApiDocs_KiotaCompat/v1.0/ChangeNotifications.yml", + "specGitBlob": "d3140e0793172da10a093fed10c524bfba571e7c", + "trackedOutputDirectory": "src/ChangeNotifications/wrapper/v1.0", + "operations": [ + { + "method": "GET", + "path": "/subscriptions", + "operationId": "subscriptions.subscription.ListSubscription" + }, + { + "method": "POST", + "path": "/subscriptions", + "operationId": "subscriptions.subscription.CreateSubscription" + }, + { + "method": "GET", + "path": "/subscriptions/{subscription-id}", + "operationId": "subscriptions.subscription.GetSubscription" + }, + { + "method": "PATCH", + "path": "/subscriptions/{subscription-id}", + "operationId": "subscriptions.subscription.UpdateSubscription" + }, + { + "method": "DELETE", + "path": "/subscriptions/{subscription-id}", + "operationId": "subscriptions.subscription.DeleteSubscription" + }, + { + "method": "POST", + "path": "/subscriptions/{subscription-id}/reauthorize", + "operationId": "subscriptions.subscription.reauthorize" + } + ] + }, + "beta": { + "spec": "openApiDocs_KiotaCompat/beta/ChangeNotifications.yml", + "specGitBlob": "e9e9b752fe03e0809a2fe3e7f448b9878688d604", + "trackedOutputDirectory": "src/ChangeNotifications/wrapper/Beta", + "operations": [ + { + "method": "GET", + "path": "/subscriptions", + "operationId": "subscriptions.subscription.ListSubscription" + }, + { + "method": "POST", + "path": "/subscriptions", + "operationId": "subscriptions.subscription.CreateSubscription" + }, + { + "method": "GET", + "path": "/subscriptions/{subscription-id}", + "operationId": "subscriptions.subscription.GetSubscription" + }, + { + "method": "PATCH", + "path": "/subscriptions/{subscription-id}", + "operationId": "subscriptions.subscription.UpdateSubscription" + }, + { + "method": "DELETE", + "path": "/subscriptions/{subscription-id}", + "operationId": "subscriptions.subscription.DeleteSubscription" + }, + { + "method": "POST", + "path": "/subscriptions/{subscription-id}/reauthorize", + "operationId": "subscriptions.subscription.reauthorize" + }, + { + "method": "GET", + "path": "/subscriptions/getVapidPublicKey()", + "operationId": "subscriptions.getVapidPublicKey" + } + ] + } + } + } +} diff --git a/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs b/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs new file mode 100644 index 00000000000..7b3a9ad51de --- /dev/null +++ b/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.OpenApi; +using Microsoft.OpenApi.Reader; +using WrapperGenerator; +using Xunit; + +namespace WrapperGenerator.Tests; + +public sealed class ChangeNotificationsDirectiveMigrationTests +{ + private static string FindRepoRoot() + { + var directory = AppContext.BaseDirectory; + while (directory is not null && + !File.Exists(Path.Combine(directory, "src", "ChangeNotifications", "ChangeNotifications.md"))) + directory = Path.GetDirectoryName(directory); + return directory ?? throw new InvalidOperationException("Repository root not found."); + } + + private static JsonDocument ReadAudit(string root) => + JsonDocument.Parse(File.ReadAllText(Path.Combine(root, "src", "ChangeNotifications", "wrapper", + "ChangeNotifications_directiveMigrationMap.json"))); + + [Fact] + public void EmptySharedSourceHasAnHonestAuditWithoutOverrides() + { + var root = FindRepoRoot(); + using var ledger = ReadAudit(root); + Assert.Empty(ledger.RootElement.GetProperty("mappings").EnumerateArray()); + var audit = ledger.RootElement.GetProperty("audit"); + Assert.Equal("ChangeNotifications", audit.GetProperty("module").GetString()); + Assert.Equal("NoSharedDirectives", audit.GetProperty("disposition").GetString()); + Assert.Equal(0, audit.GetProperty("sharedCmdletDirectiveCount").GetInt32()); + Assert.Equal(0, audit.GetProperty("deferredParameterDirectiveCount").GetInt32()); + Assert.Equal(0, audit.GetProperty("deferredSchemaDirectiveCount").GetInt32()); + Assert.Empty(audit.GetProperty("excludedProfiles").EnumerateArray()); + Assert.DoesNotMatch(@"(?m)^\s*directive:", File.ReadAllText( + Path.Combine(root, "src", "ChangeNotifications", "ChangeNotifications.md"))); + Assert.Matches(@"ChangeNotificationsCmdletConfigurations\s*=\s*\[\s*\]", File.ReadAllText( + Path.Combine(root, "src", "ChangeNotifications", "wrapper", + "ChangeNotifications_cmdletConfigurations.cs"))); + } + + [Theory] + [InlineData("v1.0", 6)] + [InlineData("beta", 7)] + public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, int expectedCount) + { + var root = FindRepoRoot(); + using var ledger = ReadAudit(root); + var evidence = ledger.RootElement.GetProperty("audit").GetProperty("profiles").GetProperty(profile); + Assert.Equal($"openApiDocs_KiotaCompat/{profile}/ChangeNotifications.yml", + evidence.GetProperty("spec").GetString()); + var settings = new OpenApiReaderSettings(); + settings.AddYamlReader(); + using var stream = File.OpenRead(Path.Combine(root, "openApiDocs_KiotaCompat", profile, + "ChangeNotifications.yml")); + var result = await OpenApiDocument.LoadAsync(stream, settings: settings, + cancellationToken: CancellationToken.None); + var document = Assert.IsType(result.Document); + Assert.Equal(expectedCount, document.Paths.Sum(path => path.Value.Operations!.Count)); + var operations = evidence.GetProperty("operations").EnumerateArray().ToArray(); + Assert.Equal(expectedCount, operations.Length); + Assert.Equal(expectedCount, operations.Select(operation => + $"{operation.GetProperty("method").GetString()} {operation.GetProperty("path").GetString()}") + .Distinct(StringComparer.Ordinal).Count()); + + var structuralNames = new Dictionary(StringComparer.Ordinal) + { + ["subscriptions.subscription.ListSubscription"] = ("Get-MgSubscription", OperationKind.Resource), + ["subscriptions.subscription.CreateSubscription"] = ("New-MgSubscription", OperationKind.Resource), + ["subscriptions.subscription.GetSubscription"] = ("Get-MgSubscription", OperationKind.Resource), + ["subscriptions.subscription.UpdateSubscription"] = ("Update-MgSubscription", OperationKind.Resource), + ["subscriptions.subscription.DeleteSubscription"] = ("Remove-MgSubscription", OperationKind.Resource), + ["subscriptions.subscription.reauthorize"] = ("Invoke-MgSubscriptionReauthorize", OperationKind.Action), + ["subscriptions.getVapidPublicKey"] = ("Get-MgSubscriptionGetVapidPublicKey", OperationKind.Function), + }; + var config = new GeneratorConfig("Microsoft.Graph.PowerShell.Test.Client", Path.GetTempPath(), profile); + foreach (var operation in operations) + { + var method = new HttpMethod(operation.GetProperty("method").GetString()!); + var path = operation.GetProperty("path").GetString()!; + var operationId = operation.GetProperty("operationId").GetString()!; + Assert.True(document.Paths.ContainsKey(path), $"Missing {profile} {method} {path}."); + var actual = Assert.Single(document.Paths[path].Operations!, + candidate => candidate.Key == method).Value; + Assert.Equal(operationId, actual.OperationId); + var expected = structuralNames[operationId]; + var extension = Assert.IsType( + actual.Extensions!["x-ms-docs-operation-type"]); + Assert.Equal(expected.Kind switch + { + OperationKind.Action => "action", + OperationKind.Function => "function", + _ => "operation", + }, extension.Node!.ToString().Trim('"')); + + Assert.False(CmdletConfigurator.IsSuppressed(method, path)); + Assert.False(CmdletConfigurator.IsSuppressed(method, path, config)); + var operationInfo = new OperationInfo(method, path, Kind: expected.Kind); + var structural = Naming.Resolve(operationInfo); + Assert.Equal(expected.Command, $"{structural.VerbName}-{structural.Noun}"); + var configured = Naming.Resolve(operationInfo, config); + var configuredName = profile == "v1.0" && expected.Kind == OperationKind.Action + ? "Invoke-MgReauthorizeSubscription" + : expected.Command; + Assert.Equal(configuredName, $"{configured.VerbName}-{configured.Noun}"); + } + } +} From 711c94f7c43cbbd3980e4491c5ea9d63265c64b8 Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Wed, 21 Oct 2026 17:38:15 -0700 Subject: [PATCH 02/11] Regenerate ChangeNotifications v1.0 client and cmdlets Run full compatible-spec Kiota 1.36.1 and wrapper Release generation/build. Client sources, cmdlets and projects are byte-identical; the client lock records the new Kiota version. Build and compiled discovery succeed with 7 exports, and all 6 operations match the published names. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json b/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json index 48b2f902944..adacdae65e0 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json +++ b/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json @@ -2,7 +2,7 @@ "descriptionHash": "148FDD3EA330C3467A8E26CDB67CFD21E3C6FC320F73C74B6F9FBF105D273D4046C2176BCF07EAA4C5203E6C4308F6C0E4C329ABAAFC0222772BBE3B15F911D3", "descriptionLocation": "../../../../../openApiDocs_KiotaCompat/v1.0/ChangeNotifications.yml", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.34.1", + "kiotaVersion": "1.36.1", "clientClassName": "ApiClient", "typeAccessModifier": "Public", "clientNamespaceName": "Microsoft.Graph.PowerShell.ChangeNotifications.Client", From 461a87d83df5455d7c05153075523c21d2edce9f Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Wed, 21 Oct 2026 17:40:58 -0700 Subject: [PATCH 03/11] Regenerate ChangeNotifications beta client and cmdlets Run full compatible-spec Kiota 1.36.1 and wrapper Release generation/build. Generated sources and projects remain byte-identical; locks record the current Kiota version and exact lowercase beta spec path while preserving tracked wrapper/Beta casing. Compiled discovery succeeds with 8 exports and the operation inventory remains unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json | 4 ++-- src/ChangeNotifications/wrapper/Beta/Cmdlets/kiota-lock.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json b/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json index 14c65e1ef48..9f354122376 100644 --- a/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json +++ b/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json @@ -1,8 +1,8 @@ { "descriptionHash": "E53648C740810AA50C7438897FBB143D286760102F13C6B81BCE8FE0251DBB3FC0248686673119F586579444A35A9615A9643D4D1055AFA243FEF8FEC43E0689", - "descriptionLocation": "../../../../../openApiDocs_KiotaCompat/Beta/ChangeNotifications.yml", + "descriptionLocation": "../../../../../openApiDocs_KiotaCompat/beta/ChangeNotifications.yml", "lockFileVersion": "1.0.0", - "kiotaVersion": "1.34.1", + "kiotaVersion": "1.36.1", "clientClassName": "ApiClient", "typeAccessModifier": "Public", "clientNamespaceName": "Microsoft.Graph.PowerShell.ChangeNotifications.Client", diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/kiota-lock.json b/src/ChangeNotifications/wrapper/Beta/Cmdlets/kiota-lock.json index a32225e9723..b658a7a351b 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/kiota-lock.json +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/kiota-lock.json @@ -1,3 +1,3 @@ { - "descriptionLocation": "../../../../../openApiDocs_KiotaCompat/Beta/ChangeNotifications.yml" + "descriptionLocation": "../../../../../openApiDocs_KiotaCompat/beta/ChangeNotifications.yml" } \ No newline at end of file From 3a180fc95017823f4217996d71d381ac414e0c02 Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Thu, 29 Oct 2026 18:17:27 -0700 Subject: [PATCH 04/11] Revalidate ChangeNotifications audit against current generator API Keep runtime profiles separate from shared GeneratorConfig in naming and suppression regressions, with derived data enabled and disabled. Refresh exact compatible operation IDs/spec hashes and cover the current v1.0 VAPID route. Combined module, configurator and naming tests: 89 passed; strict zero-directive inventory passed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../ChangeNotifications.md | 14 ++++--- ...geNotifications_directiveMigrationMap.json | 37 +++++++++++-------- ...ngeNotificationsDirectiveMigrationTests.cs | 36 ++++++++++-------- 3 files changed, 50 insertions(+), 37 deletions(-) diff --git a/src/ChangeNotifications/ChangeNotifications.md b/src/ChangeNotifications/ChangeNotifications.md index 22672a8e938..0fbf64faaec 100644 --- a/src/ChangeNotifications/ChangeNotifications.md +++ b/src/ChangeNotifications/ChangeNotifications.md @@ -29,21 +29,25 @@ and both profile-local `readme.md` files; their directives are not migrated. `wrapper/ChangeNotifications_directiveMigrationMap.json` therefore has an empty `mappings` array, not invented directive-to-operation mappings. Its separate audit records exact HTTP method/path/operation-ID evidence from both required -`openApiDocs_KiotaCompat` specifications: six operations in v1.0 and seven in beta. -Neither profile is excluded. The absence of `getVapidPublicKey()` in v1.0 is an -operation-level difference, not an unsupported profile. +`openApiDocs_KiotaCompat` specifications: seven operations in each profile. +Neither profile is excluded. Revalidation against the merged #3849 target also +refreshes the aligned `subscription_*` operation IDs and spec hashes. The current +compatible v1.0 spec now includes `getVapidPublicKey()`, unlike the original +six-operation audit; that spec refresh is not a shared-directive change. `ChangeNotifications_cmdletConfigurations.cs` intentionally remains empty. Structural naming supplies subscription CRUD names and the action/function names. Existing v1.0 parity data renames the structural `Invoke-MgSubscriptionReauthorize` to `Invoke-MgReauthorizeSubscription`; beta currently retains the structural name. Beta's structural -`Get-MgSubscriptionGetVapidPublicKey` also differs from the legacy published noun +`Get-MgSubscriptionGetVapidPublicKey` also differs from the legacy beta published noun `Get-MgBetaSubscriptionVapidPublicKey`. These baseline naming differences are not shared directives and do not justify new overrides in this audit. `tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs` checks the empty audit and pins every compatible operation's identity, classification, unsuppressed status, structural name, and data-aware name in both -profiles. Full generation/build evidence is a separate gate; existing tracked +profiles with derived data enabled and disabled. The profile is separate runtime +context on naming/suppression calls, not authored `GeneratorConfig` state. +Full generation/build evidence is a separate gate; existing tracked output directories are `wrapper/v1.0` and `wrapper/Beta`. diff --git a/src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json b/src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json index b80198c32eb..dd419979cfd 100644 --- a/src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json +++ b/src/ChangeNotifications/wrapper/ChangeNotifications_directiveMigrationMap.json @@ -13,84 +13,89 @@ "src/ChangeNotifications/v1.0/readme.md", "src/ChangeNotifications/beta/readme.md" ], - "notes": "These are unaffected-operation audit evidence, not directive mappings. No curated overrides are needed. Existing v1.0 parity data renames reauthorize; beta action/function naming differences from the legacy SDK remain unrelated baseline behavior.", + "notes": "These are unaffected-operation audit evidence, not directive mappings. No curated overrides are needed. Revalidated after #3849 against target 08e409a6aa8fd48736b8f9a9199559f46fc0d1ad: compatible operation IDs now align with the original subscription_* IDs; compatible v1.0 now also includes getVapidPublicKey(). Existing v1.0 parity data renames reauthorize; action/function naming differences from the legacy SDK remain baseline behavior. Runtime profile context is passed separately from shared GeneratorConfig, with derived data both enabled and disabled.", "profiles": { "v1.0": { "spec": "openApiDocs_KiotaCompat/v1.0/ChangeNotifications.yml", - "specGitBlob": "d3140e0793172da10a093fed10c524bfba571e7c", + "specGitBlob": "e53bd7d80255a87fe5c11b94c5d1f09e15adc854", "trackedOutputDirectory": "src/ChangeNotifications/wrapper/v1.0", "operations": [ { "method": "GET", "path": "/subscriptions", - "operationId": "subscriptions.subscription.ListSubscription" + "operationId": "subscription_ListSubscription" }, { "method": "POST", "path": "/subscriptions", - "operationId": "subscriptions.subscription.CreateSubscription" + "operationId": "subscription_CreateSubscription" }, { "method": "GET", "path": "/subscriptions/{subscription-id}", - "operationId": "subscriptions.subscription.GetSubscription" + "operationId": "subscription_GetSubscription" }, { "method": "PATCH", "path": "/subscriptions/{subscription-id}", - "operationId": "subscriptions.subscription.UpdateSubscription" + "operationId": "subscription_UpdateSubscription" }, { "method": "DELETE", "path": "/subscriptions/{subscription-id}", - "operationId": "subscriptions.subscription.DeleteSubscription" + "operationId": "subscription_DeleteSubscription" }, { "method": "POST", "path": "/subscriptions/{subscription-id}/reauthorize", - "operationId": "subscriptions.subscription.reauthorize" + "operationId": "subscription_reauthorize" + }, + { + "method": "GET", + "path": "/subscriptions/getVapidPublicKey()", + "operationId": "subscription_getVapidPublicKey" } ] }, "beta": { "spec": "openApiDocs_KiotaCompat/beta/ChangeNotifications.yml", - "specGitBlob": "e9e9b752fe03e0809a2fe3e7f448b9878688d604", + "specGitBlob": "14bf6c727c87c5433274bfec78a4a681169e5390", "trackedOutputDirectory": "src/ChangeNotifications/wrapper/Beta", "operations": [ { "method": "GET", "path": "/subscriptions", - "operationId": "subscriptions.subscription.ListSubscription" + "operationId": "subscription_ListSubscription" }, { "method": "POST", "path": "/subscriptions", - "operationId": "subscriptions.subscription.CreateSubscription" + "operationId": "subscription_CreateSubscription" }, { "method": "GET", "path": "/subscriptions/{subscription-id}", - "operationId": "subscriptions.subscription.GetSubscription" + "operationId": "subscription_GetSubscription" }, { "method": "PATCH", "path": "/subscriptions/{subscription-id}", - "operationId": "subscriptions.subscription.UpdateSubscription" + "operationId": "subscription_UpdateSubscription" }, { "method": "DELETE", "path": "/subscriptions/{subscription-id}", - "operationId": "subscriptions.subscription.DeleteSubscription" + "operationId": "subscription_DeleteSubscription" }, { "method": "POST", "path": "/subscriptions/{subscription-id}/reauthorize", - "operationId": "subscriptions.subscription.reauthorize" + "operationId": "subscription_reauthorize" }, { "method": "GET", "path": "/subscriptions/getVapidPublicKey()", - "operationId": "subscriptions.getVapidPublicKey" + "operationId": "subscription_getVapidPublicKey" } ] } diff --git a/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs b/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs index 7b3a9ad51de..cf4d4db975f 100644 --- a/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs +++ b/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs @@ -49,9 +49,11 @@ public void EmptySharedSourceHasAnHonestAuditWithoutOverrides() } [Theory] - [InlineData("v1.0", 6)] - [InlineData("beta", 7)] - public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, int expectedCount) + [InlineData("v1.0", true)] + [InlineData("v1.0", false)] + [InlineData("beta", true)] + [InlineData("beta", false)] + public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, bool useCollisionData) { var root = FindRepoRoot(); using var ledger = ReadAudit(root); @@ -65,6 +67,7 @@ public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, var result = await OpenApiDocument.LoadAsync(stream, settings: settings, cancellationToken: CancellationToken.None); var document = Assert.IsType(result.Document); + const int expectedCount = 7; Assert.Equal(expectedCount, document.Paths.Sum(path => path.Value.Operations!.Count)); var operations = evidence.GetProperty("operations").EnumerateArray().ToArray(); Assert.Equal(expectedCount, operations.Length); @@ -74,15 +77,16 @@ public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, var structuralNames = new Dictionary(StringComparer.Ordinal) { - ["subscriptions.subscription.ListSubscription"] = ("Get-MgSubscription", OperationKind.Resource), - ["subscriptions.subscription.CreateSubscription"] = ("New-MgSubscription", OperationKind.Resource), - ["subscriptions.subscription.GetSubscription"] = ("Get-MgSubscription", OperationKind.Resource), - ["subscriptions.subscription.UpdateSubscription"] = ("Update-MgSubscription", OperationKind.Resource), - ["subscriptions.subscription.DeleteSubscription"] = ("Remove-MgSubscription", OperationKind.Resource), - ["subscriptions.subscription.reauthorize"] = ("Invoke-MgSubscriptionReauthorize", OperationKind.Action), - ["subscriptions.getVapidPublicKey"] = ("Get-MgSubscriptionGetVapidPublicKey", OperationKind.Function), + ["subscription_ListSubscription"] = ("Get-MgSubscription", OperationKind.Resource), + ["subscription_CreateSubscription"] = ("New-MgSubscription", OperationKind.Resource), + ["subscription_GetSubscription"] = ("Get-MgSubscription", OperationKind.Resource), + ["subscription_UpdateSubscription"] = ("Update-MgSubscription", OperationKind.Resource), + ["subscription_DeleteSubscription"] = ("Remove-MgSubscription", OperationKind.Resource), + ["subscription_reauthorize"] = ("Invoke-MgSubscriptionReauthorize", OperationKind.Action), + ["subscription_getVapidPublicKey"] = ("Get-MgSubscriptionGetVapidPublicKey", OperationKind.Function), }; - var config = new GeneratorConfig("Microsoft.Graph.PowerShell.Test.Client", Path.GetTempPath(), profile); + var config = new GeneratorConfig("Microsoft.Graph.PowerShell.Test.Client", Path.GetTempPath(), + UseCollisionData: useCollisionData); foreach (var operation in operations) { var method = new HttpMethod(operation.GetProperty("method").GetString()!); @@ -102,13 +106,13 @@ public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, _ => "operation", }, extension.Node!.ToString().Trim('"')); - Assert.False(CmdletConfigurator.IsSuppressed(method, path)); - Assert.False(CmdletConfigurator.IsSuppressed(method, path, config)); + Assert.False(CmdletConfigurator.IsSuppressed(method, path, apiVersion: profile)); + Assert.False(CmdletConfigurator.IsSuppressed(method, path, config, apiVersion: profile)); var operationInfo = new OperationInfo(method, path, Kind: expected.Kind); - var structural = Naming.Resolve(operationInfo); + var structural = Naming.Resolve(operationInfo, apiVersion: profile); Assert.Equal(expected.Command, $"{structural.VerbName}-{structural.Noun}"); - var configured = Naming.Resolve(operationInfo, config); - var configuredName = profile == "v1.0" && expected.Kind == OperationKind.Action + var configured = Naming.Resolve(operationInfo, config, apiVersion: profile); + var configuredName = useCollisionData && profile == "v1.0" && expected.Kind == OperationKind.Action ? "Invoke-MgReauthorizeSubscription" : expected.Command; Assert.Equal(configuredName, $"{configured.VerbName}-{configured.Noun}"); From c21ae8f333a3a83122b5caf8df746656d674c8bf Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Thu, 29 Oct 2026 18:22:44 -0700 Subject: [PATCH 05/11] Regenerate ChangeNotifications v1.0 after framework integration Run the shared queued full Kiota and wrapper Release pipeline on target 08e409a6aa: exit 0, Status OK, 78.5 seconds, eight fresh compiled exports. Capture current-spec VAPID client and cmdlet plus three Web Push model/expanded-body fields; retain every existing route. Fresh exact GraphRoute, List/Get default, credential-free reads and mutation WhatIf/Confirm checks pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../v1.0/Client/Models/Subscription.cs | 30 +++++ .../GetVapidPublicKeyGetResponse.cs | 65 +++++++++ .../GetVapidPublicKeyRequestBuilder.cs | 123 ++++++++++++++++++ .../GetVapidPublicKeyResponse.cs | 28 ++++ .../SubscriptionsRequestBuilder.cs | 6 + .../wrapper/v1.0/Client/kiota-lock.json | 2 +- .../GetMgSubscriptionGetVapidPublicKey.g.cs | 56 ++++++++ .../v1.0/Cmdlets/NewMgSubscription.g.cs | 18 +++ .../v1.0/Cmdlets/UpdateMgSubscription.g.cs | 18 +++ 9 files changed, 345 insertions(+), 1 deletion(-) create mode 100644 src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyGetResponse.cs create mode 100644 src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyRequestBuilder.cs create mode 100644 src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyResponse.cs create mode 100644 src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs diff --git a/src/ChangeNotifications/wrapper/v1.0/Client/Models/Subscription.cs b/src/ChangeNotifications/wrapper/v1.0/Client/Models/Subscription.cs index 67960aafb59..da9f47d4338 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Client/Models/Subscription.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Client/Models/Subscription.cs @@ -111,6 +111,30 @@ public partial class Subscription : global::Microsoft.Graph.PowerShell.ChangeNot #nullable restore #else public string Resource { get; set; } +#endif + /// Optional. The application server's VAPID public key, base64url-encoded (P-256 uncompressed point, 65 bytes pre-encoding). Obtained by calling the getVapidPublicKey function on the subscription collection. The browser passes this value to PushManager.subscribe({ applicationServerKey: vapidPublicKey }) to bind the push subscription to this server identity. Required when notificationUrl targets a known Web Push service origin (for example, *.push.apple.com, fcm.googleapis.com, updates.push.services.mozilla.com); rejected with 400 Bad Request if supplied on a standard webhook subscription. For more information, see RFC 8292. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? VapidPublicKey { get; set; } +#nullable restore +#else + public string VapidPublicKey { get; set; } +#endif + /// Optional. The subscriber's ECDH public key, base64url-encoded (P-256 uncompressed point, 65 bytes pre-encoding). Obtained from the browser via PushSubscription.getKey('p256dh'). Used as the peer public key during ECDH key agreement to derive the per-message content encryption key for RFC 8291 payload encryption. Required when notificationUrl targets a known Web Push service origin; rejected with 400 Bad Request if supplied on a standard webhook subscription. For more information, see RFC 8291 Section 3. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? WebPushEncryptionP256dhPublicKey { get; set; } +#nullable restore +#else + public string WebPushEncryptionP256dhPublicKey { get; set; } +#endif + /// Optional. The subscriber's auth secret, base64url-encoded (16 bytes pre-encoding). Obtained from the browser via PushSubscription.getKey('auth'). Used as the HMAC-SHA-256 salt for the HKDF combine step that derives key material for RFC 8291 payload encryption. Write-only: this value is never returned in GET responses (returned as null). Treat as a secret. Required when notificationUrl targets a known Web Push service origin; rejected with 400 Bad Request if supplied on a standard webhook subscription. For more information, see RFC 8291 Section 3. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? WebPushEncryptionSecret { get; set; } +#nullable restore +#else + public string WebPushEncryptionSecret { get; set; } #endif /// /// Creates a new instance of the appropriate class based on discriminator value @@ -144,6 +168,9 @@ public override IDictionary> GetFieldDeserializers() { "notificationUrl", n => { NotificationUrl = n.GetStringValue(); } }, { "notificationUrlAppId", n => { NotificationUrlAppId = n.GetStringValue(); } }, { "resource", n => { Resource = n.GetStringValue(); } }, + { "vapidPublicKey", n => { VapidPublicKey = n.GetStringValue(); } }, + { "webPushEncryptionP256dhPublicKey", n => { WebPushEncryptionP256dhPublicKey = n.GetStringValue(); } }, + { "webPushEncryptionSecret", n => { WebPushEncryptionSecret = n.GetStringValue(); } }, }; } /// @@ -168,6 +195,9 @@ public override void Serialize(ISerializationWriter writer) writer.WriteStringValue("notificationUrl", NotificationUrl); writer.WriteStringValue("notificationUrlAppId", NotificationUrlAppId); writer.WriteStringValue("resource", Resource); + writer.WriteStringValue("vapidPublicKey", VapidPublicKey); + writer.WriteStringValue("webPushEncryptionP256dhPublicKey", WebPushEncryptionP256dhPublicKey); + writer.WriteStringValue("webPushEncryptionSecret", WebPushEncryptionSecret); } } } diff --git a/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyGetResponse.cs b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyGetResponse.cs new file mode 100644 index 00000000000..0400f4e2ba3 --- /dev/null +++ b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyGetResponse.cs @@ -0,0 +1,65 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class GetVapidPublicKeyGetResponse : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The value property +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Value { get; set; } +#nullable restore +#else + public string Value { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public GetVapidPublicKeyGetResponse() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyGetResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyGetResponse(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "value", n => { Value = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("value", Value); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyRequestBuilder.cs b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyRequestBuilder.cs new file mode 100644 index 00000000000..5304394268e --- /dev/null +++ b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyRequestBuilder.cs @@ -0,0 +1,123 @@ +// +#pragma warning disable CS0618 +using Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.ODataErrors; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey +{ + /// + /// Builds and executes requests for operations under \subscriptions\getVapidPublicKey() + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GetVapidPublicKeyRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public GetVapidPublicKeyRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/subscriptions/getVapidPublicKey()", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public GetVapidPublicKeyRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/subscriptions/getVapidPublicKey()", rawUrl) + { + } + /// + /// Get the public key information required to validate push notifications according to RFC 8292 specifications. + /// Find more info here + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 4XX or 5XX status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsGetVapidPublicKeyGetResponseAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsGetVapidPublicKeyGetResponseAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "XXX", global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyGetResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get the public key information required to validate push notifications according to RFC 8292 specifications. + /// Find more info here + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 4XX or 5XX status code + [Obsolete("This method is obsolete. Use GetAsGetVapidPublicKeyGetResponseAsync instead.")] +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + var errorMapping = new Dictionary> + { + { "XXX", global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.ODataErrors.ODataError.CreateFromDiscriminatorValue }, + }; + return await RequestAdapter.SendAsync(requestInfo, global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyResponse.CreateFromDiscriminatorValue, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Get the public key information required to validate push notifications according to RFC 8292 specifications. + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyRequestBuilder WithUrl(string rawUrl) + { + return new global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Configuration for the request such as headers, query parameters, and middleware options. + /// + [Obsolete("This class is deprecated. Please use the generic RequestConfiguration class generated by the generator.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class GetVapidPublicKeyRequestBuilderGetRequestConfiguration : RequestConfiguration + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyResponse.cs b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyResponse.cs new file mode 100644 index 00000000000..fbafd5fee7e --- /dev/null +++ b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/GetVapidPublicKey/GetVapidPublicKeyResponse.cs @@ -0,0 +1,28 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey +{ + [Obsolete("This class is obsolete. Use GetVapidPublicKeyGetResponse instead.")] + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class GetVapidPublicKeyResponse : global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyGetResponse, IParsable + #pragma warning restore CS1591 + { + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static new global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyResponse CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyResponse(); + } + } +} +#pragma warning restore CS0618 diff --git a/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/SubscriptionsRequestBuilder.cs b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/SubscriptionsRequestBuilder.cs index cd2ea8b2639..c4fd5c71c58 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/SubscriptionsRequestBuilder.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Client/Subscriptions/SubscriptionsRequestBuilder.cs @@ -2,6 +2,7 @@ #pragma warning disable CS0618 using Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.ODataErrors; using Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models; +using Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey; using Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.Item; using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.Kiota.Abstractions.Serialization; @@ -19,6 +20,11 @@ namespace Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] public partial class SubscriptionsRequestBuilder : BaseRequestBuilder { + /// The getVapidPublicKey property + public global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyRequestBuilder GetVapidPublicKey + { + get => new global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyRequestBuilder(PathParameters, RequestAdapter); + } /// Gets an item from the Microsoft.Graph.PowerShell.ChangeNotifications.Client.subscriptions.item collection /// Unique identifier of the item /// A diff --git a/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json b/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json index adacdae65e0..15fa5bc898f 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json +++ b/src/ChangeNotifications/wrapper/v1.0/Client/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "148FDD3EA330C3467A8E26CDB67CFD21E3C6FC320F73C74B6F9FBF105D273D4046C2176BCF07EAA4C5203E6C4308F6C0E4C329ABAAFC0222772BBE3B15F911D3", + "descriptionHash": "39794BC788C8223ACA97639F858477509AEB337A27A4F18E34A0C87BE61947F763903CBFFC439EF32A37541547E45B4A0625C8779BD38DB691645F984529076F", "descriptionLocation": "../../../../../openApiDocs_KiotaCompat/v1.0/ChangeNotifications.yml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.36.1", diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs new file mode 100644 index 00000000000..cd18273819f --- /dev/null +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +using System; +using System.Collections.Generic; +using System.Management.Automation; +using System.Net.Http; +using Microsoft.Graph.Wrapper.Runtime; +using Microsoft.Graph.PowerShell.ChangeNotifications.Client; +using Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models; +using Microsoft.Kiota.Abstractions; +using Microsoft.Kiota.Abstractions.Authentication; +using Microsoft.Kiota.Http.HttpClientLibrary; + +namespace Microsoft.Graph.PowerShell.ChangeNotifications +{ + [GraphRoute("GET", "/subscriptions/getVapidPublicKey()")] + [Cmdlet(VerbsCommon.Get, "MgSubscriptionGetVapidPublicKey")] + [OutputType(typeof(global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyGetResponse))] + public class GetMgSubscriptionGetVapidPublicKeyCommand : GraphClientCmdlet + { + + + + + + + + + + + protected override void ProcessRecord() + { + + var requestAdapter = GetRequestAdapter(); + var client = new ApiClient(requestAdapter); + + + global::Microsoft.Graph.PowerShell.ChangeNotifications.Client.Subscriptions.GetVapidPublicKey.GetVapidPublicKeyGetResponse? result; + try + { + result = client.Subscriptions.GetVapidPublicKey.GetAsGetVapidPublicKeyGetResponseAsync(requestConfiguration => + { + + AddRequestHeaders(requestConfiguration.Headers); + }).GetAwaiter().GetResult(); + } + catch (Exception ex) when (ex is not PipelineStoppedException && ex is not OperationCanceledException) + { + ThrowGraphRequestFailed(ex, null); + return; + } + + WriteObject(result); + } + } +} diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs index 48195d84886..cddce1af878 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs @@ -61,6 +61,15 @@ public class NewMgSubscriptionCommand : GraphClientCmdlet [Parameter(Mandatory = false)] public string? Resource { get; set; } + [Parameter(Mandatory = false)] + public string? VapidPublicKey { get; set; } + + [Parameter(Mandatory = false)] + public string? WebPushEncryptionP256dhPublicKey { get; set; } + + [Parameter(Mandatory = false)] + public string? WebPushEncryptionSecret { get; set; } + @@ -116,6 +125,15 @@ protected override void ProcessRecord() if (this.IsParameterBound(nameof(Resource))) body.Resource = Resource; + if (this.IsParameterBound(nameof(VapidPublicKey))) + body.VapidPublicKey = VapidPublicKey; + + if (this.IsParameterBound(nameof(WebPushEncryptionP256dhPublicKey))) + body.WebPushEncryptionP256dhPublicKey = WebPushEncryptionP256dhPublicKey; + + if (this.IsParameterBound(nameof(WebPushEncryptionSecret))) + body.WebPushEncryptionSecret = WebPushEncryptionSecret; + var requestAdapter = GetRequestAdapter(); diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs index cc4a2c3e39a..a1efa46e0c9 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs @@ -62,6 +62,15 @@ public class UpdateMgSubscriptionCommand : GraphClientCmdlet [Parameter(Mandatory = false)] public string? Resource { get; set; } + [Parameter(Mandatory = false)] + public string? VapidPublicKey { get; set; } + + [Parameter(Mandatory = false)] + public string? WebPushEncryptionP256dhPublicKey { get; set; } + + [Parameter(Mandatory = false)] + public string? WebPushEncryptionSecret { get; set; } + @@ -117,6 +126,15 @@ protected override void ProcessRecord() if (this.IsParameterBound(nameof(Resource))) body.Resource = Resource; + if (this.IsParameterBound(nameof(VapidPublicKey))) + body.VapidPublicKey = VapidPublicKey; + + if (this.IsParameterBound(nameof(WebPushEncryptionP256dhPublicKey))) + body.WebPushEncryptionP256dhPublicKey = WebPushEncryptionP256dhPublicKey; + + if (this.IsParameterBound(nameof(WebPushEncryptionSecret))) + body.WebPushEncryptionSecret = WebPushEncryptionSecret; + var requestAdapter = GetRequestAdapter(); From 6c783aea2e0b31f1f383429248b23dc06813ef6a Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Thu, 29 Oct 2026 18:32:02 -0700 Subject: [PATCH 06/11] Regenerate ChangeNotifications beta after framework integration Run the shared queued full Kiota and wrapper Release pipeline on target 08e409a6aa: exit 0, Status OK, 111.6 seconds, eight fresh compiled exports. Client/cmdlet source and projects are byte-identical; the client lock records the current compatible description hash. Exact GraphRoute coverage of all seven operations, unchanged inventory, dispatcher defaults, credential-free reads and mutation WhatIf/Confirm checks pass. Preserve wrapper/Beta casing and existing beta naming. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json b/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json index 9f354122376..01c15cac4a6 100644 --- a/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json +++ b/src/ChangeNotifications/wrapper/Beta/Client/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "E53648C740810AA50C7438897FBB143D286760102F13C6B81BCE8FE0251DBB3FC0248686673119F586579444A35A9615A9643D4D1055AFA243FEF8FEC43E0689", + "descriptionHash": "F5354FDC96BF1B98800BD52F1C40992665344C16C4ADFA4A9E38F492E8BED3F3F5E34B188E147C0FFB6280DF9465451089021B234CDAA5502689F0761A8F4B53", "descriptionLocation": "../../../../../openApiDocs_KiotaCompat/beta/ChangeNotifications.yml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.36.1", From 099125347de25dbaee2b9eb1246fb95f07c5fcd1 Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Mon, 2 Nov 2026 17:07:19 -0800 Subject: [PATCH 07/11] Regenerate ChangeNotifications v1.0 with merged Authentication 2.41.2 Full shared-queue Release generation on target844672: exit0/OK, 19.5s, eight normal-manifest exports. Regenerate client, cmdlets, project and manifest; generated callers now use explicit v1.0 transport and module bin retains only three owned DLLs. Real Authentication factory typed CRUD/default/query/context and safety probes pass in Global/USGov. Preserve the observed shared PATCH204 generic-header-refetch limitation; no overlay or global fix. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs | 2 +- .../wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs | 2 +- .../wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs | 2 +- .../Cmdlets/InvokeMgReauthorizeSubscription.g.cs | 2 +- .../wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs | 2 +- .../wrapper/v1.0/Cmdlets/RemoveMgSubscription.g.cs | 2 +- .../wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs | 2 +- ...icrosoft.Graph.Wrapper.ChangeNotifications.csproj | 12 +++++------- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs index cd18273819f..681483a92cd 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs @@ -31,7 +31,7 @@ public class GetMgSubscriptionGetVapidPublicKeyCommand : GraphClientCmdlet protected override void ProcessRecord() { - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("v1.0"); var client = new ApiClient(requestAdapter); diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs index df07c580723..e92f324decd 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs @@ -31,7 +31,7 @@ public class GetMgSubscription_GetCommand : GraphClientCmdlet protected override void ProcessRecord() { - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("v1.0"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result; diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs index 4369ba17af5..9b8cf710bce 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs @@ -59,7 +59,7 @@ public class GetMgSubscription_ListCommand : GraphClientCmdlet protected override void ProcessRecord() { - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("v1.0"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.SubscriptionCollectionResponse? result; diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/InvokeMgReauthorizeSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/InvokeMgReauthorizeSubscription.g.cs index e4f1af24421..867010eb564 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/InvokeMgReauthorizeSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/InvokeMgReauthorizeSubscription.g.cs @@ -35,7 +35,7 @@ protected override void ProcessRecord() return; - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("v1.0"); var client = new ApiClient(requestAdapter); diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs index cddce1af878..7c9a2b9ccc2 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/NewMgSubscription.g.cs @@ -136,7 +136,7 @@ protected override void ProcessRecord() - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("v1.0"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result; diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/RemoveMgSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/RemoveMgSubscription.g.cs index 73f2c98e96f..ec3478f0dd4 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/RemoveMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/RemoveMgSubscription.g.cs @@ -30,7 +30,7 @@ protected override void ProcessRecord() if (!ShouldProcess(SubscriptionId, "Remove")) return; - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("v1.0"); var client = new ApiClient(requestAdapter); // DeleteAsync returns a plain Task: a standard delete response has no body. diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs index a1efa46e0c9..1a09e034b59 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("v1.0"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result; diff --git a/src/ChangeNotifications/wrapper/v1.0/Microsoft.Graph.Wrapper.ChangeNotifications.csproj b/src/ChangeNotifications/wrapper/v1.0/Microsoft.Graph.Wrapper.ChangeNotifications.csproj index 28c3005ae73..a175dc92e1c 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Microsoft.Graph.Wrapper.ChangeNotifications.csproj +++ b/src/ChangeNotifications/wrapper/v1.0/Microsoft.Graph.Wrapper.ChangeNotifications.csproj @@ -48,18 +48,16 @@ - + Removal is by package identity, not filename. --> + Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != ''" /> From 9ed2a18c6a1f5c856b7c20718ebc030626fa5be6 Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Mon, 2 Nov 2026 17:10:01 -0800 Subject: [PATCH 08/11] Regenerate ChangeNotifications beta with merged Authentication 2.41.2 Full shared-queue Release generation on target844672: exit0/OK, 27s, eight normal-manifest exports. Regenerate client, cmdlets, project and manifest; emitted calls explicitly retain beta service root, three-own-DLL packaging and full accepted Authentication ownership. Normal real-factory compiled/package typed CRUD/default/query/context and safety probes pass in Global/USGov; preserve failed shared PATCH204 generic-header-refetch replay without overlays. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs | 2 +- .../wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs | 2 +- .../wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs | 2 +- .../Cmdlets/InvokeMgSubscriptionReauthorize.g.cs | 2 +- .../wrapper/Beta/Cmdlets/NewMgSubscription.g.cs | 2 +- .../wrapper/Beta/Cmdlets/RemoveMgSubscription.g.cs | 2 +- .../wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs | 2 +- ...icrosoft.Graph.Wrapper.ChangeNotifications.csproj | 12 +++++------- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs index cd18273819f..4ac548acd94 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscriptionGetVapidPublicKey.g.cs @@ -31,7 +31,7 @@ public class GetMgSubscriptionGetVapidPublicKeyCommand : GraphClientCmdlet protected override void ProcessRecord() { - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("beta"); var client = new ApiClient(requestAdapter); diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs index df07c580723..cb94376122a 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs @@ -31,7 +31,7 @@ public class GetMgSubscription_GetCommand : GraphClientCmdlet protected override void ProcessRecord() { - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("beta"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result; diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs index 4369ba17af5..0790f3ba0b0 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs @@ -59,7 +59,7 @@ public class GetMgSubscription_ListCommand : GraphClientCmdlet protected override void ProcessRecord() { - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("beta"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.SubscriptionCollectionResponse? result; diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/InvokeMgSubscriptionReauthorize.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/InvokeMgSubscriptionReauthorize.g.cs index b86c12e20e6..296629a1b16 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/InvokeMgSubscriptionReauthorize.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/InvokeMgSubscriptionReauthorize.g.cs @@ -35,7 +35,7 @@ protected override void ProcessRecord() return; - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("beta"); var client = new ApiClient(requestAdapter); diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/NewMgSubscription.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/NewMgSubscription.g.cs index d27dc36d3b8..c9ba91483a1 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/NewMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/NewMgSubscription.g.cs @@ -142,7 +142,7 @@ protected override void ProcessRecord() - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("beta"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result; diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/RemoveMgSubscription.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/RemoveMgSubscription.g.cs index 73f2c98e96f..4ab38f1b515 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/RemoveMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/RemoveMgSubscription.g.cs @@ -30,7 +30,7 @@ protected override void ProcessRecord() if (!ShouldProcess(SubscriptionId, "Remove")) return; - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("beta"); var client = new ApiClient(requestAdapter); // DeleteAsync returns a plain Task: a standard delete response has no body. diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs index dd82254a677..fc73e7b4f39 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs @@ -143,7 +143,7 @@ protected override void ProcessRecord() - var requestAdapter = GetRequestAdapter(); + var requestAdapter = GetRequestAdapter("beta"); var client = new ApiClient(requestAdapter); Microsoft.Graph.PowerShell.ChangeNotifications.Client.Models.Subscription? result; diff --git a/src/ChangeNotifications/wrapper/Beta/Microsoft.Graph.Wrapper.ChangeNotifications.csproj b/src/ChangeNotifications/wrapper/Beta/Microsoft.Graph.Wrapper.ChangeNotifications.csproj index 28c3005ae73..a175dc92e1c 100644 --- a/src/ChangeNotifications/wrapper/Beta/Microsoft.Graph.Wrapper.ChangeNotifications.csproj +++ b/src/ChangeNotifications/wrapper/Beta/Microsoft.Graph.Wrapper.ChangeNotifications.csproj @@ -48,18 +48,16 @@ - + Removal is by package identity, not filename. --> + Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != ''" /> From ed3208464347214feb8a2d63fc96dca077114e13 Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Thu, 5 Nov 2026 17:46:54 -0800 Subject: [PATCH 09/11] Pin ChangeNotifications PATCH single-operation contract Add module-specific generation regressions for both profiles with derived data on/off: PATCH emits one mutation, no readback, only native inputs, and returns only a non-null response model. Document caller-explicit GET semantics. Combined module/configurator/naming/required-query tests: 161 passed; shared strict audit remains empty. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../ChangeNotifications.md | 7 ++ ...ngeNotificationsDirectiveMigrationTests.cs | 72 +++++++++++++++++-- 2 files changed, 72 insertions(+), 7 deletions(-) diff --git a/src/ChangeNotifications/ChangeNotifications.md b/src/ChangeNotifications/ChangeNotifications.md index 0fbf64faaec..1ef1f1449b1 100644 --- a/src/ChangeNotifications/ChangeNotifications.md +++ b/src/ChangeNotifications/ChangeNotifications.md @@ -51,3 +51,10 @@ profiles with derived data enabled and disabled. The profile is separate runtime context on naming/suppression calls, not authored `GeneratorConfig` state. Full generation/build evidence is a separate gate; existing tracked output directories are `wrapper/v1.0` and `wrapper/Beta`. + +The module-specific mutation regression also pins the merged #3886 contract: +`Update-MgSubscription` sends one PATCH and does not read the subscription back. +A 204 response produces no object; a model-bearing 200 returns that model. +Callers may explicitly use `Get-MgSubscription` for an independent read. The +PATCH operation has no native query inputs, so GET-only parameters are not +added to Update and no readback switch or selector is introduced. diff --git a/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs b/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs index cf4d4db975f..0c6d12c2b9c 100644 --- a/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs +++ b/tools/WrapperGenerator.Tests/ChangeNotificationsDirectiveMigrationTests.cs @@ -4,8 +4,10 @@ using System.Linq; using System.Net.Http; using System.Text.Json; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; +using Microsoft.Extensions.Logging.Abstractions; using Microsoft.OpenApi; using Microsoft.OpenApi.Reader; using WrapperGenerator; @@ -28,6 +30,17 @@ private static JsonDocument ReadAudit(string root) => JsonDocument.Parse(File.ReadAllText(Path.Combine(root, "src", "ChangeNotifications", "wrapper", "ChangeNotifications_directiveMigrationMap.json"))); + private static async Task ReadCompatibleSpecAsync(string root, string profile) + { + var settings = new OpenApiReaderSettings(); + settings.AddYamlReader(); + using var stream = File.OpenRead(Path.Combine(root, "openApiDocs_KiotaCompat", profile, + "ChangeNotifications.yml")); + var result = await OpenApiDocument.LoadAsync(stream, settings: settings, + cancellationToken: CancellationToken.None); + return Assert.IsType(result.Document); + } + [Fact] public void EmptySharedSourceHasAnHonestAuditWithoutOverrides() { @@ -60,13 +73,7 @@ public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, var evidence = ledger.RootElement.GetProperty("audit").GetProperty("profiles").GetProperty(profile); Assert.Equal($"openApiDocs_KiotaCompat/{profile}/ChangeNotifications.yml", evidence.GetProperty("spec").GetString()); - var settings = new OpenApiReaderSettings(); - settings.AddYamlReader(); - using var stream = File.OpenRead(Path.Combine(root, "openApiDocs_KiotaCompat", profile, - "ChangeNotifications.yml")); - var result = await OpenApiDocument.LoadAsync(stream, settings: settings, - cancellationToken: CancellationToken.None); - var document = Assert.IsType(result.Document); + var document = await ReadCompatibleSpecAsync(root, profile); const int expectedCount = 7; Assert.Equal(expectedCount, document.Paths.Sum(path => path.Value.Operations!.Count)); var operations = evidence.GetProperty("operations").EnumerateArray().ToArray(); @@ -118,4 +125,55 @@ public async Task CompatibleOperationsKeepTheirIdentityAndNaming(string profile, Assert.Equal(configuredName, $"{configured.VerbName}-{configured.Noun}"); } } + + [Theory] + [InlineData("v1.0", true)] + [InlineData("v1.0", false)] + [InlineData("beta", true)] + [InlineData("beta", false)] + public async Task SubscriptionPatchEmitsOneMutationAndOnlyItsOwnInputs(string profile, bool useCollisionData) + { + var document = await ReadCompatibleSpecAsync(FindRepoRoot(), profile); + const string itemPath = "/subscriptions/{subscription-id}"; + var item = document.Paths[itemPath]; + Assert.Contains(HttpMethod.Get, item.Operations!.Keys); + Assert.Contains(HttpMethod.Patch, item.Operations.Keys); + Assert.DoesNotContain(item.Operations[HttpMethod.Patch].Parameters ?? [], + parameter => parameter.In == ParameterLocation.Query); + + var output = Path.Combine(Path.GetTempPath(), $"changenotifications-patch-{Guid.NewGuid():N}"); + try + { + var config = new GeneratorConfig("Microsoft.Graph.PowerShell.Test.Client", output, + UseCollisionData: useCollisionData); + await new PowerShellWrapperGenerationService(document, config, NullLogger.Instance, + apiVersion: profile).GenerateAsync(TestContext.Current.CancellationToken); + + var source = await File.ReadAllTextAsync(Path.Combine(output, "UpdateMgSubscription.g.cs"), + TestContext.Current.CancellationToken); + Assert.Single(Regex.Matches(source, @"\.PatchAsync\(")); + Assert.DoesNotContain(".GetAsync(", source); + Assert.DoesNotContain("re-fetch", source, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("if (result is null)", source); + Assert.Contains("if (result is not null)", source); + Assert.Contains("WriteObject(result)", source); + Assert.Contains($"GetRequestAdapter(\"{profile}\")", source); + Assert.Contains("AddRequestHeaders(requestConfiguration.Headers)", source); + Assert.Contains("SupportsShouldProcess = true", source); + Assert.Contains("ShouldProcess(SubscriptionId, \"Update\")", source); + Assert.Contains("body.ClientState = ClientState", source); + Assert.Contains("Models.Subscription", source); + Assert.DoesNotContain("public string[]? Property", source); + Assert.DoesNotContain("public int Top", source); + Assert.DoesNotContain("QueryId", source); + Assert.DoesNotContain("PassThru", source); + Assert.DoesNotContain("ReadBack", source); + Assert.DoesNotContain("Refetch", source); + } + finally + { + if (Directory.Exists(output)) + Directory.Delete(output, recursive: true); + } + } } From 87c491d84bfd47fa90e6810f0b80af27f682562c Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Thu, 5 Nov 2026 18:28:43 -0800 Subject: [PATCH 10/11] Regenerate ChangeNotifications v1.0 after PATCH no-readback merge Full queued Kiota/client/cmdlet/project/manifest Release run on6475: exit0/OK,82.5s,8exports; no-incremental compile passed. Typed real-factory Global/USGov offline gates positively assert PATCH204 onePATCH/noobject/noGET even withGET403, PATCH200 actualmodel onePATCH, independent callerGET, binder/ShouldProcess/query/profile/Auth contexts. Actual MockDataStore reapplied after all runspace imports and guarded before transport/lifecycle. Clients/projects/locks reproduce unchanged; generated PATCH readback removed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../wrapper/v1.0/Cmdlets/GetMgSubscription.g.cs | 1 + .../v1.0/Cmdlets/GetMgSubscription_Get.g.cs | 1 + .../v1.0/Cmdlets/GetMgSubscription_List.g.cs | 1 + .../wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs | 14 -------------- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription.g.cs index 24c99700b02..e44d3a6b50d 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription.g.cs @@ -19,6 +19,7 @@ public class GetMgSubscriptionCommand : GraphClientCmdlet + [Parameter(Mandatory = false)] [Alias("Select")] public string[]? Property { get; set; } diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs index e92f324decd..b5213938a24 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_Get.g.cs @@ -44,6 +44,7 @@ protected override void ProcessRecord() + AddRequestHeaders(requestConfiguration.Headers); }).GetAwaiter().GetResult(); } diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs index 9b8cf710bce..66bcd42df95 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/GetMgSubscription_List.g.cs @@ -93,6 +93,7 @@ protected override void ProcessRecord() + AddRequestHeaders(requestConfiguration.Headers); }).GetAwaiter().GetResult(); diff --git a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs index 1a09e034b59..e651b8953d0 100644 --- a/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/v1.0/Cmdlets/UpdateMgSubscription.g.cs @@ -155,20 +155,6 @@ protected override void ProcessRecord() return; } - - if (result is null) - { - WriteVerbose("PATCH succeeded with no response body, re-fetching the updated resource."); - try - { - result = client.Subscriptions[SubscriptionId].GetAsync().GetAwaiter().GetResult(); - } - catch (Exception ex) when (ex is not PipelineStoppedException && ex is not OperationCanceledException) - { - ThrowGraphRequestFailed(ex, SubscriptionId); - return; - } - } if (result is not null) WriteObject(result); } From 8100cbd6450ef3fd967e5d790d489281bdbf2335 Mon Sep 17 00:00:00 2001 From: Ramses Sanchez Hernandez Date: Thu, 5 Nov 2026 18:46:14 -0800 Subject: [PATCH 11/11] Regenerate ChangeNotifications beta after PATCH no-readback merge Full queued Kiota/client/cmdlet/project/manifest Release run on6475: exit0/OK,135.2s,8exports; no-incremental compile passed. Typed real-factory Global/USGov gates assert PATCH204 onePATCH/noobject/noGET even withGET403, PATCH200 actualmodel onePATCH, independent callerGET, binder/ShouldProcess/query/beta-profile/Auth contexts. Actual MockDataStore guarded after all imports beforeConnect/everyHTTP/lifecycle. Clients/projects/locks unchanged; generated PATCH readback removed; preserve Beta casing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .../wrapper/Beta/Cmdlets/GetMgSubscription.g.cs | 1 + .../Beta/Cmdlets/GetMgSubscription_Get.g.cs | 1 + .../Beta/Cmdlets/GetMgSubscription_List.g.cs | 1 + .../wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs | 14 -------------- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription.g.cs index 24c99700b02..e44d3a6b50d 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription.g.cs @@ -19,6 +19,7 @@ public class GetMgSubscriptionCommand : GraphClientCmdlet + [Parameter(Mandatory = false)] [Alias("Select")] public string[]? Property { get; set; } diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs index cb94376122a..9cbf48b3235 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_Get.g.cs @@ -44,6 +44,7 @@ protected override void ProcessRecord() + AddRequestHeaders(requestConfiguration.Headers); }).GetAwaiter().GetResult(); } diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs index 0790f3ba0b0..a2db07660c0 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/GetMgSubscription_List.g.cs @@ -93,6 +93,7 @@ protected override void ProcessRecord() + AddRequestHeaders(requestConfiguration.Headers); }).GetAwaiter().GetResult(); diff --git a/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs b/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs index fc73e7b4f39..773a9d8e4af 100644 --- a/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs +++ b/src/ChangeNotifications/wrapper/Beta/Cmdlets/UpdateMgSubscription.g.cs @@ -161,20 +161,6 @@ protected override void ProcessRecord() return; } - - if (result is null) - { - WriteVerbose("PATCH succeeded with no response body, re-fetching the updated resource."); - try - { - result = client.Subscriptions[SubscriptionId].GetAsync().GetAwaiter().GetResult(); - } - catch (Exception ex) when (ex is not PipelineStoppedException && ex is not OperationCanceledException) - { - ThrowGraphRequestFailed(ex, SubscriptionId); - return; - } - } if (result is not null) WriteObject(result); }