Skip to content

Commit 4007cfa

Browse files
committed
Address review comments
1 parent d747aa6 commit 4007cfa

File tree

6 files changed

+63
-65
lines changed

6 files changed

+63
-65
lines changed

src/ResourceManager/ApiManagement/AzureRM.ApiManagement.psd1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ CmdletsToExport = 'Add-AzureRmApiManagementRegion',
141141
'Set-AzureRmApiManagementSubscription',
142142
'Set-AzureRmApiManagementUser',
143143
'Set-AzureRmApiManagementTenantAccess',
144-
'Get-AzureRmApiManagementIdentityProvider',
145-
'New-AzureRmApiManagementIdentityProvider',
146-
'Set-AzureRmApiManagementIdentityProvider',
147-
'Remove-AzureRmApiManagementIdentityProvider'
144+
'Get-AzureRmApiManagementIdentityProvider',
145+
'New-AzureRmApiManagementIdentityProvider',
146+
'Set-AzureRmApiManagementIdentityProvider',
147+
'Remove-AzureRmApiManagementIdentityProvider'
148148

149149
# Variables to export from this module
150150
# VariablesToExport = @()

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementIdentityProvider.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ namespace Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Commands
1919
using System.Collections.Generic;
2020
using System.Management.Automation;
2121

22-
[Cmdlet(VerbsCommon.Get, Constants.ApiManagementIdentityProvider, DefaultParameterSetName = GetAll)]
23-
[OutputType(typeof(IList<PsApiManagementIdentityProvider>), ParameterSetName = new[] { GetAll })]
24-
[OutputType(typeof(PsApiManagementIdentityProvider), ParameterSetName = new[] { GetByType })]
22+
[Cmdlet(VerbsCommon.Get, Constants.ApiManagementIdentityProvider, DefaultParameterSetName = AllIdentityProviders)]
23+
[OutputType(typeof(IList<PsApiManagementIdentityProvider>), ParameterSetName = new[] { AllIdentityProviders })]
24+
[OutputType(typeof(PsApiManagementIdentityProvider), ParameterSetName = new[] { IdentityProviderByType })]
2525
public class GetAzureApiManagementIdentityProvider : AzureApiManagementCmdletBase
2626
{
27-
private const string GetAll = "Get all identity Providers";
28-
private const string GetByType = "Get by identity provider type";
27+
private const string AllIdentityProviders = "AllIdentityProviders";
28+
private const string IdentityProviderByType = "IdentityProviderByType";
2929

3030
[Parameter(
3131
ValueFromPipelineByPropertyName = true,
@@ -35,20 +35,20 @@ public class GetAzureApiManagementIdentityProvider : AzureApiManagementCmdletBas
3535
public PsApiManagementContext Context { get; set; }
3636

3737
[Parameter(
38-
ParameterSetName = GetByType,
38+
ParameterSetName = IdentityProviderByType,
3939
ValueFromPipelineByPropertyName = true,
40-
Mandatory = false,
40+
Mandatory = true,
4141
HelpMessage = "Identifier of a Identity Provider. If specified will try to find identity provider configuration by the identifier. This parameter is optional.")]
4242
public PsApiManagementIdentityProviderType Type { get; set; }
4343

4444
public override void ExecuteApiManagementCmdlet()
4545
{
46-
if (ParameterSetName.Equals(GetAll))
46+
if (ParameterSetName.Equals(AllIdentityProviders))
4747
{
4848
var identityProviders = Client.IdentityProviderList(Context);
4949
WriteObject(identityProviders, true);
5050
}
51-
else if (ParameterSetName.Equals(GetByType))
51+
else if (ParameterSetName.Equals(IdentityProviderByType))
5252
{
5353
var identityProvider = Client.IdentityProviderByName(Context, Type.ToString("g"));
5454
WriteObject(identityProvider);

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/GetAzureApiManagementLogger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class GetAzureApiManagementLogger : AzureApiManagementCmdletBase
3737
[Parameter(
3838
ParameterSetName = GetById,
3939
ValueFromPipelineByPropertyName = true,
40-
Mandatory = false,
40+
Mandatory = true,
4141
HelpMessage = "Identifier of a logger. If specified will try to find logger by the identifier. This parameter is optional.")]
4242
public String LoggerId { get; set; }
4343

src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands/RemoveAzureApiManagementIdentityProvider.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,17 @@ public override void ExecuteApiManagementCmdlet()
5050
var actionWarning = string.Format(CultureInfo.CurrentCulture, Resources.IdentityProviderRemoveWarning, Type.ToString("g"));
5151

5252
// Do nothing if force is not specified and user cancelled the operation
53-
if (!ShouldProcess(
53+
if (ShouldProcess(
5454
actionDescription,
5555
actionWarning,
5656
Resources.ShouldProcessCaption))
5757
{
58-
return;
59-
}
60-
61-
Client.IdentityProviderRemove(Context, Type.ToString("g"));
58+
Client.IdentityProviderRemove(Context, Type.ToString("g"));
6259

63-
if (PassThru.IsPresent)
64-
{
65-
WriteObject(true);
60+
if (PassThru.IsPresent)
61+
{
62+
WriteObject(true);
63+
}
6664
}
6765
}
6866
}

src/ResourceManager/ApiManagement/Commands.SMAPI.Test/ScenarioTests/ApiManagementTests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,24 +312,24 @@ Param($resourceGroupName, $serviceName)
312312

313313
$context = New-AzureRmApiManagementContext -ResourceGroupName $resourceGroupName -ServiceName $serviceName
314314

315-
$wsdlUrl = "http://www.webservicex.net/stockquote.asmx?WSDL"
315+
$wsdlPath1 = "./Resources/Weather.wsdl"
316316
$path1 = "soapToRestApi"
317317
$wsdlApiId1 = getAssetName
318-
$wsdlServiceName2 = "StockQuote" # from Url StockQuote
319-
$wsdlEndpointName2 = "StockQuoteSoap" # from Url StockQuote
318+
$wsdlServiceName1 = "Weather" # from file Weather.wsdl
319+
$wsdlEndpointName1 = "WeatherSoap" # from file Weather.wsdl
320320

321321
try
322322
{
323323
# import api from Url
324-
$api = Import-AzureRmApiManagementApi -Context $context -ApiId $wsdlApiId1 -SpecificationUrl $wsdlUrl -SpecificationFormat Wsdl -Path $path1 -WsdlServiceName $wsdlServiceName2 -WsdlEndpointName $wsdlEndpointName2 -ApiType Soap
324+
$api = Import-AzureRmApiManagementApi -Context $context -ApiId $wsdlApiId1 -SpecificationPath $wsdlPath1 -SpecificationFormat Wsdl -Path $path1 -WsdlServiceName $wsdlServiceName1 -WsdlEndpointName $wsdlEndpointName1 -ApiType Soap
325325

326326
Assert-AreEqual $wsdlApiId1 $api.ApiId
327327
Assert-AreEqual $path1 $api.Path
328328

329329
# export api to pipeline
330330
$result = Export-AzureRmApiManagementApi -Context $context -ApiId $wsdlApiId1 -SpecificationFormat Wsdl
331331
Assert-NotNull $result
332-
Assert-True {$result -like '*<wsdl:service name="StockQuote"*'}
332+
Assert-True {$result -like '*<wsdl:service name="Weather"*'}
333333
}
334334
finally
335335
{

src/ResourceManager/ApiManagement/Commands.SMAPI.Test/SessionRecords/Microsoft.Azure.Commands.ApiManagement.ServiceManagement.Test.ScenarioTests.ApiManagementTests/ApiImportWsdlToCreateSoapToRest.json

Lines changed: 38 additions & 38 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)