From f2c058b13264fc4041a1072b3c9b98978b0cbb55 Mon Sep 17 00:00:00 2001 From: jonahlytleMSFT <101423586+jonahlytleMSFT@users.noreply.github.com> Date: Fri, 22 Jul 2022 11:55:12 -0700 Subject: [PATCH 1/3] Adding Get All Migrations and Get Migration Events APIs. (#104) * adding changes * adding newline --- .../ValidateAndCreateNewCommerceMigration.cs | 12 +++++++++++- sdk/SdkSamples/SdkSamples.csproj | 16 ++++++++-------- sdk/SdkSamples/packages.config | 2 +- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/sdk/SdkSamples/NewCommerceMigrations/ValidateAndCreateNewCommerceMigration.cs b/sdk/SdkSamples/NewCommerceMigrations/ValidateAndCreateNewCommerceMigration.cs index f36aadb..9cb8e02 100644 --- a/sdk/SdkSamples/NewCommerceMigrations/ValidateAndCreateNewCommerceMigration.cs +++ b/sdk/SdkSamples/NewCommerceMigrations/ValidateAndCreateNewCommerceMigration.cs @@ -53,11 +53,21 @@ namespace Microsoft.Store.PartnerCenter.Samples.NewCommerceMigrations newCommerceMigration = newCommerceMigrationOperations.ById(newCommerceMigration.Id).Get(); this.Context.ConsoleHelper.WriteObject(newCommerceMigration, "Final New-Commerce migration"); this.Context.ConsoleHelper.StopProgress(); + + this.Context.ConsoleHelper.StartProgress("Getting migration events"); + var newCommerceMigrationEvents = newCommerceMigrationOperations.GetEvents(newCommerceMigration.Id, null); + this.Context.ConsoleHelper.WriteObject(newCommerceMigrationEvents, "New-Commerce migration events"); + this.Context.ConsoleHelper.StopProgress(); } else { this.Context.ConsoleHelper.Warning("The specified subscription is not eligibile for migrating to New-Commerce."); } + + this.Context.ConsoleHelper.StartProgress("Getting all New-Commerce migrations"); + var newCommerceMigrations = newCommerceMigrationOperations.Get(customerId, null, null, null); + this.Context.ConsoleHelper.WriteObject(newCommerceMigrations, "New-Commerce migrations"); + this.Context.ConsoleHelper.StopProgress(); } } -} \ No newline at end of file +} diff --git a/sdk/SdkSamples/SdkSamples.csproj b/sdk/SdkSamples/SdkSamples.csproj index 70bfa46..55cbf61 100644 --- a/sdk/SdkSamples/SdkSamples.csproj +++ b/sdk/SdkSamples/SdkSamples.csproj @@ -60,17 +60,17 @@ ..\packages\Microsoft.Identity.Client.4.31.0\lib\net461\Microsoft.Identity.Client.dll - - ..\packages\Microsoft.Store.PartnerCenter.3.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.dll + + ..\packages\Microsoft.Store.PartnerCenter.3.1.0\lib\netstandard2.0\Microsoft.Store.PartnerCenter.dll - - ..\packages\Microsoft.Store.PartnerCenter.3.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Extensions.dll + + ..\packages\Microsoft.Store.PartnerCenter.3.1.0\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Extensions.dll - - ..\packages\Microsoft.Store.PartnerCenter.3.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Models.dll + + ..\packages\Microsoft.Store.PartnerCenter.3.1.0\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Models.dll - - ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/sdk/SdkSamples/packages.config b/sdk/SdkSamples/packages.config index 2ab05e0..91e230d 100644 --- a/sdk/SdkSamples/packages.config +++ b/sdk/SdkSamples/packages.config @@ -1,7 +1,7 @@  - + From ddea111104291d6d10c885f61ca37d2003c76e82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Jul 2022 12:39:36 -0700 Subject: [PATCH 2/3] Bump Newtonsoft.Json in /secure-app-model/keyvault/CPVApplication (#98) Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.2 to 13.0.1. - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/12.0.2...13.0.1) --- updated-dependencies: - dependency-name: Newtonsoft.Json dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- secure-app-model/keyvault/CPVApplication/packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secure-app-model/keyvault/CPVApplication/packages.config b/secure-app-model/keyvault/CPVApplication/packages.config index b132b61..9bb877a 100644 --- a/secure-app-model/keyvault/CPVApplication/packages.config +++ b/secure-app-model/keyvault/CPVApplication/packages.config @@ -6,7 +6,7 @@ - + From 9cf7994a5ce89d8ec8142fbcf76a8ae397205a36 Mon Sep 17 00:00:00 2001 From: jonahlytleMSFT <101423586+jonahlytleMSFT@users.noreply.github.com> Date: Fri, 22 Jul 2022 12:53:54 -0700 Subject: [PATCH 3/3] adding promotion to scheduled change (#106) --- .../Subscriptions/UpdateSubscriptionScheduledChange.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sdk/SdkSamples/Subscriptions/UpdateSubscriptionScheduledChange.cs b/sdk/SdkSamples/Subscriptions/UpdateSubscriptionScheduledChange.cs index 0d37300..1da6a35 100644 --- a/sdk/SdkSamples/Subscriptions/UpdateSubscriptionScheduledChange.cs +++ b/sdk/SdkSamples/Subscriptions/UpdateSubscriptionScheduledChange.cs @@ -83,6 +83,14 @@ namespace Microsoft.Store.PartnerCenter.Samples.Subscriptions // prompt the user to enter the term duration for the scheduled change string changeToTermDuration = this.Context.ConsoleHelper.ReadNonEmptyString("Enter the scheduled change term duration", "Scheduled change term duration can't be empty"); + // prompt the user to enter the promotion id for the scheduled change + string changeToPromotionId = this.Context.ConsoleHelper.ReadOptionalString("Enter the scheduled promotion id or leave blank to automatically check and fill with an available promotion"); + + if (string.IsNullOrWhiteSpace(changeToPromotionId)) + { + changeToPromotionId = null; + } + // prompt the user to enter the quantity for the scheduled change string quantity = this.Context.ConsoleHelper.ReadNonEmptyString("Enter the scheduled change quantity", "Scheduled change term quantity can't be empty"); var changeToQuantity = int.Parse(quantity); @@ -105,6 +113,7 @@ namespace Microsoft.Store.PartnerCenter.Samples.Subscriptions AvailabilityId = changeToAvailabilityId, BillingCycle = changeToBillingCycle, TermDuration = changeToTermDuration, + PromotionId = changeToPromotionId, }, Quantity = changeToQuantity, CustomTermEndDate = changeToCustomTermEndDate