Skip to content

Commit cf0b0df

Browse files
KacieKKisra-fel
andauthored
[API Management] breaking change warning to make Sku property from Enum to String (#19126)
* impl * changelog Co-authored-by: Kacie Kang <[email protected]> Co-authored-by: Yeming Liu <[email protected]>
1 parent aebe222 commit cf0b0df

File tree

7 files changed

+21
-6
lines changed

7 files changed

+21
-6
lines changed

src/ApiManagement/ApiManagement/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added warning message for upcoming breaking change: changed the type of parameter Sku from Enum to String
2122
* Supported GraphQL Specification Format
2223

2324
## Version 3.0.0
@@ -26,7 +27,7 @@
2627
* Updated APIM .Net SDK version to 8.0.0 / Api Version 2021-08-01
2728

2829
## Version 2.3.2
29-
Added warning message for upcoming breaking change.
30+
* Added warning message for upcoming breaking change.
3031

3132
## Version 2.3.1
3233
* Fixed a bug in `Get-AzApiManagementTenantGitAccess` cmdlet.

src/ApiManagement/ApiManagement/Commands/AddAzureApiManagementRegion.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
namespace Microsoft.Azure.Commands.ApiManagement.Commands
1717
{
18+
using System;
19+
using System.Management.Automation;
1820
using Microsoft.Azure.Commands.ApiManagement.Models;
21+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1922
using ResourceManager.Common.ArgumentCompleters;
20-
using System.Management.Automation;
2123

2224
[Cmdlet("Add", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementRegion"), OutputType(typeof(PsApiManagement))]
2325
public class AddAzureApiManagementRegion : AzureApiManagementCmdletBase
@@ -37,6 +39,7 @@ public class AddAzureApiManagementRegion : AzureApiManagementCmdletBase
3739
[ValidateNotNullOrEmpty]
3840
public string Location { get; set; }
3941

42+
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
4043
[Parameter(
4144
ValueFromPipelineByPropertyName = false,
4245
Mandatory = false,

src/ApiManagement/ApiManagement/Commands/NewAzureApiManagement.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace Microsoft.Azure.Commands.ApiManagement.Commands
1818
using ResourceManager.Common.ArgumentCompleters;
1919
using System.Collections.Generic;
2020
using System.Management.Automation;
21+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
22+
using System;
2123

2224
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagement"), OutputType(typeof(PsApiManagement))]
2325
public class NewAzureApiManagement : AzureApiManagementCmdletBase
@@ -58,6 +60,7 @@ public class NewAzureApiManagement : AzureApiManagementCmdletBase
5860
[ValidatePattern(@"^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*@([a-zA-Z0-9_]+[a-zA-Z0-9_-]*\.)+[a-zA-Z]{2,63}$")]
5961
public string AdminEmail { get; set; }
6062

63+
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
6164
[Parameter(
6265
ValueFromPipelineByPropertyName = true,
6366
Mandatory = false,

src/ApiManagement/ApiManagement/Commands/UpdateAzureApiManagementRegion.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515

1616
namespace Microsoft.Azure.Commands.ApiManagement.Commands
1717
{
18+
using System;
19+
using System.Management.Automation;
1820
using Microsoft.Azure.Commands.ApiManagement.Models;
21+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
1922
using ResourceManager.Common.ArgumentCompleters;
20-
using System.Management.Automation;
2123

2224
[Cmdlet("Update", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ApiManagementRegion"), OutputType(typeof(PsApiManagement))]
2325
public class UpdateAzureApiManagementRegion : AzureApiManagementCmdletBase
@@ -37,6 +39,7 @@ public class UpdateAzureApiManagementRegion : AzureApiManagementCmdletBase
3739
[ValidateNotNullOrEmpty]
3840
public string Location { get; set; }
3941

42+
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
4043
[Parameter(
4144
ValueFromPipelineByPropertyName = true,
4245
Mandatory = true,

src/ApiManagement/ApiManagement/Models/PsApiManagement.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.Models
2020
using System.Text.RegularExpressions;
2121
using Microsoft.Azure.Commands.ApiManagement.Properties;
2222
using Microsoft.Azure.Management.ApiManagement.Models;
23+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2324

2425
public class PsApiManagement
2526
{
@@ -160,6 +161,7 @@ public PsApiManagement(ApiManagementServiceResource apiServiceResource)
160161

161162
public string Location { get; private set; }
162163

164+
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
163165
public PsApiManagementSku Sku { get; set; }
164166

165167
public int Capacity { get; set; }

src/ApiManagement/ApiManagement/Models/PsApiManagementRegion.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Microsoft.Azure.Commands.ApiManagement.Models
1818
using Helpers;
1919
using System;
2020
using System.Linq;
21+
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
2122

2223
public class PsApiManagementRegion
2324
{
@@ -57,6 +58,7 @@ internal PsApiManagementRegion(AdditionalLocation additionalLocation)
5758

5859
public int Capacity { get; set; }
5960

61+
[CmdletParameterBreakingChange("Sku", OldParamaterType = typeof(PsApiManagementSku), NewParameterTypeName = nameof(String))]
6062
public PsApiManagementSku Sku { get; set; }
6163

6264
public string Location { get; set; }

src/ApiManagement/documentation/upcoming-breaking-changes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929

3030
The following cmdlets were affected this release:
3131

32-
**Set-AzApiManagementOperation**
33-
**New-AzApiManagementOperation**
32+
**Add-AzApiManagementRegion**
33+
**New-AzApiManagement**
34+
**Update-AzApiManagementRegion**
3435

35-
BreakingChangeAttributeParameterReplaced: Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Models.PsApiManagementRepresentation.Samlple
36+
BreakingChangeAttributeParameterReplaced: Microsoft.Azure.Commands.ApiManagement.Models.PsApiManagementSku

0 commit comments

Comments
 (0)