Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-AzApiManagementProduct: Change SubscriptionsLimit parameter default value to None #13457

Merged
merged 4 commits into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class NewAzureApiManagementProduct : AzureApiManagementCmdletBase
ValueFromPipelineByPropertyName = true,
Mandatory = false,
HelpMessage = "Maximum number of simultaneous subscriptions. This parameter is optional." +
" Default value is 1.")]
" Default value is None.")]
public Int32? SubscriptionsLimit { get; set; }

[Parameter(
Expand All @@ -89,11 +89,9 @@ public override void ExecuteApiManagementCmdlet()
string productId = ProductId ?? Guid.NewGuid().ToString("N");

bool? approvalRequired = null;
Int32? subscriptionsLimit = null;
if (SubscriptionRequired.HasValue && SubscriptionRequired.Value)
{
approvalRequired = ApprovalRequired ?? false;
subscriptionsLimit = SubscriptionsLimit ?? 1;
}

var product = Client.ProductCreate(
Expand All @@ -104,7 +102,7 @@ public override void ExecuteApiManagementCmdlet()
LegalTerms,
SubscriptionRequired ?? true,
approvalRequired,
subscriptionsLimit,
SubscriptionsLimit,
State);

WriteObject(product);
Expand Down
1 change: 1 addition & 0 deletions src/ApiManagement/ApiManagement/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* [Breaking change] `New-AzApiManagementProduct` by default has no subscription limit.

## Version 2.1.0
* Added new `Add-AzApiManagementApiToGateway` cmdlet.
Expand Down