Skip to content

Commit 2862aa6

Browse files
committed
Explicitely expose the enums added in the SDK update.
1 parent f800db6 commit 2862aa6

11 files changed

+78
-69
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% if user %}
2+
Hello, {{ user.firstname }}
3+
{% else %}
4+
Hello World!
5+
{% endif %}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<xsl:stylesheet
2+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
version="2.0">
4+
<xsl:template match="@*|node()">
5+
<xsl:copy>
6+
<xsl:apply-templates select="@*|node()"/>
7+
</xsl:copy>
8+
</xsl:template>
9+
</xsl:stylesheet>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2+
xmlns:xs="http://www.w3.org/2001/XMLSchema">
3+
<xsl:output method="text"/>
4+
<xsl:template match="/">
5+
<xsl:value-of select="company/employee/name"/>
6+
<xsl:variable name="test">
7+
<xsl:text>company/employee/name</xsl:text>
8+
</xsl:variable>
9+
<xsl:evaluate xpath="$test"/>
10+
</xsl:template>
11+
</xsl:stylesheet>

src/LogicApp/LogicApp.Test/ScenarioTests/IntegrationAccountMapTests.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,24 @@ Test New-AzIntegrationAccountMap command
1919
function Test-CreateIntegrationAccountMap
2020
{
2121
$xslt1FilePath = Join-Path $TestOutputRoot "Resources" "SampleXslt1Map.xslt"
22+
$xslt2FilePath = Join-Path $TestOutputRoot "Resources" "SampleXslt2Map.xslt"
23+
$xslt3FilePath = Join-Path $TestOutputRoot "Resources" "SampleXslt3Map.xslt"
24+
$liquidFilePath = Join-Path $TestOutputRoot "Resources" "SampleLiquidMap.liquid"
2225
$xslt1MapContent = [IO.File]::ReadAllText($xslt1FilePath)
26+
$xslt2MapContent = [IO.File]::ReadAllText($xslt2FilePath)
27+
$xslt3MapContent = [IO.File]::ReadAllText($xslt3FilePath)
28+
$liquidMapContent = [IO.File]::ReadAllText($liquidFilePath)
2329

2430
$resourceGroup = TestSetup-CreateResourceGroup
2531
$integrationAccountName = "IA-" + (getAssetname)
2632

2733
$integrationAccountMapName1 = "XSLT-" + (getAssetname)
2834
$integrationAccountMapName2 = "XSLT-" + (getAssetname)
2935
$integrationAccountMapName3 = "XSLT-" + (getAssetname)
36+
$integrationAccountXslt2MapName = "XSLT2-" + (getAssetname)
37+
$integrationAccountXslt3MapName = "XSLT3-" + (getAssetname)
38+
$integrationAccountLiquidMapName = "Liquid-" + (getAssetname)
39+
$integrationAccountLiquidMapName2 = "Liquid2-" + (getAssetname)
3040

3141
$integrationAccount = TestSetup-CreateIntegrationAccount $resourceGroup.ResourceGroupName $integrationAccountName
3242

@@ -38,6 +48,15 @@ function Test-CreateIntegrationAccountMap
3848

3949
$integrationAccountMap3 = New-AzIntegrationAccountMap -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -MapName $integrationAccountMapName3 -MapFilePath $xslt1FilePath -MapType "Xslt" -ContentType "application/xml"
4050
Assert-AreEqual $integrationAccountMapName3 $integrationAccountMap3.Name
51+
52+
$integrationAccountXslt2Map = New-AzIntegrationAccountMap -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -MapName $integrationAccountXslt2MapName -MapDefinition $xslt2MapContent -MapType "Xslt20"
53+
Assert-AreEqual $integrationAccountXslt2MapName $integrationAccountXslt2Map.Name
54+
$integrationAccountXslt3Map = New-AzIntegrationAccountMap -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -MapName $integrationAccountXslt3MapName -MapDefinition $xslt3MapContent -MapType "Xslt30"
55+
Assert-AreEqual $integrationAccountXslt3MapName $integrationAccountXslt3Map.Name
56+
$integrationAccountLiquidMap = New-AzIntegrationAccountMap -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -MapName $integrationAccountLiquidMapName -MapDefinition $liquidMapContent -MapType "Liquid"
57+
Assert-AreEqual $integrationAccountLiquidMapName $integrationAccountLiquidMap.Name
58+
$integrationAccountLiquidMap2 = New-AzIntegrationAccountMap -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -MapName $integrationAccountLiquidMapName2 -MapDefinition $liquidMapContent -MapType "liquid"
59+
Assert-AreEqual $integrationAccountLiquidMapName2 $integrationAccountLiquidMap2.Name
4160

4261
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Force
4362
}

src/LogicApp/LogicApp.Test/ScenarioTests/IntegrationAccountTests.ps1

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ function Test-CreateIntegrationAccount
2121
$resourceGroup = TestSetup-CreateResourceGroup
2222
$integrationAccountName = "IA-" + (getAssetname)
2323
$location = Get-Location "Microsoft.Logic" "integrationAccounts"
24-
24+
2525
$integrationAccountNameBasic = "IA-Basic-" + (getAssetname)
26-
$integrationAccount = New-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameBasic -Location $location -Sku "Basic"
26+
$integrationAccount = New-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameBasic -Location $location -Sku "Basic"
2727
Assert-AreEqual $integrationAccountNameBasic $integrationAccount.Name
28-
28+
2929
$integrationAccountNameStandard = "IA-Standard-" + (getAssetname)
30-
$integrationAccount = New-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameStandard -Location $location -Sku "Standard"
30+
$integrationAccount = New-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameStandard -Location $location -Sku "Standard"
3131
Assert-AreEqual $integrationAccountNameStandard $integrationAccount.Name
32-
32+
33+
$integrationAccountNameStandard2 = "IA-Standard2-" + (getAssetname)
34+
$integrationAccount = New-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameStandard2 -Location $location -Sku "standard"
35+
Assert-AreEqual $integrationAccountNameStandard2 $integrationAccount.Name
36+
3337
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameBasic -Force
3438
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameStandard -Force
39+
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountNameStandard2 -Force
3540
}
3641

3742
<#
@@ -53,7 +58,7 @@ function Test-GetIntegrationAccount
5358
$integrationAccounts = Get-AzIntegrationAccount
5459
Assert-True { $integrationAccounts.Count -gt 0 }
5560

56-
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Force
61+
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Force
5762
}
5863

5964
<#
@@ -68,7 +73,7 @@ function Test-RemoveIntegrationAccount
6873

6974
$integrationAccount = New-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Location $location -Sku "Standard"
7075
Assert-AreEqual $integrationAccountName $integrationAccount.Name
71-
76+
7277
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Force
7378
}
7479

@@ -97,7 +102,7 @@ function Test-UpdateIntegrationAccount
97102

98103
$updatedIntegrationAccount = Set-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Location $location -Force
99104
Assert-AreEqual $updatedIntegrationAccount.Name $integrationAccount.Name
100-
105+
101106
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Force
102107
}
103108

@@ -122,6 +127,6 @@ function Test-GetIntegrationAccountCallbackUrl
122127

123128
$callbackUrl1 = Get-AzIntegrationAccountCallbackUrl -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName
124129
Assert-NotNull $callbackUrl1
125-
130+
126131
Remove-AzIntegrationAccount -ResourceGroupName $resourceGroup.ResourceGroupName -IntegrationAccountName $integrationAccountName -Force
127132
}

src/LogicApp/LogicApp.Test/ScenarioTests/WorkflowTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ function Test-CreateAndRemoveLogicApp
4040
$parameterFilePath = Join-Path $TestOutputRoot "Resources" "TestSimpleWorkflowParameter.json"
4141
$definition = [IO.File]::ReadAllText((Join-Path $TestOutputRoot "Resources" "TestSimpleWorkflowDefinition.json"))
4242

43-
$workflowName = getAssetname
43+
$workflowName = getAssetname
4444
$workflow = New-AzLogicApp -ResourceGroupName $resourceGroup.ResourceGroupName -Name $workflowName -Definition $definition -ParameterFilePath $parameterFilePath -Location $location
4545

46-
Assert-NotNull $workflow
46+
Assert-NotNull $workflow
4747
Assert-NotNull $workflow.Definition
4848
Assert-NotNull $workflow.Parameters
4949
Assert-AreEqual $workflowName $workflow.Name
5050
Remove-AzLogicApp -ResourceGroupName $resourceGroup.ResourceGroupName -Name $WorkflowName -Force
5151

5252
#Case3 : Create using Piped input
53-
$workflowName = getAssetname
53+
$workflowName = getAssetname
5454
$workflow = $resourceGroup | New-AzLogicApp -Name $workflowName -Location $location -DefinitionFilePath $definitionFilePath -ParameterFilePath $parameterFilePath
5555

5656
Assert-NotNull $workflow

src/LogicApp/LogicApp/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Add in Basic sku for Integration Accounts
22+
* Add in XSLT 2.0, XSLT 3.0 and Liquid Map Types
2123
* Update Logic App SDK to version 4.1.0
2224

2325
## Version 1.1.0

src/LogicApp/LogicApp/Cmdlets/IntegrationAccount/NewAzureIntegrationAccountCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class NewAzureIntegrationAccountCommand : LogicAppBaseCmdlet
5151

5252
[Parameter(Mandatory = false, HelpMessage = "The integration account SKU.",
5353
ValueFromPipelineByPropertyName = true)]
54+
[ValidateSet("Free", "Basic", "Standard", IgnoreCase = true)]
5455
[ValidateNotNullOrEmpty]
5556
public string Sku { get; set; }
5657

src/LogicApp/LogicApp/Cmdlets/IntegrationAccount/NewAzureIntegrationAccountMapCommand.cs

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,6 @@ namespace Microsoft.Azure.Commands.LogicApp.Cmdlets
2828
[OutputType(typeof(IntegrationAccountMap))]
2929
public class NewAzureIntegrationAccountMapCommand : LogicAppBaseCmdlet
3030
{
31-
32-
#region Defaults
33-
34-
/// <summary>
35-
/// Default content type for map.
36-
/// </summary>
37-
private string contentType = "application/xml";
38-
39-
/// <summary>
40-
/// Default map type.
41-
/// </summary>
42-
private string mapType = "Xslt";
43-
44-
#endregion Defaults
45-
4631
#region Input Parameters
4732

4833
[Parameter(Mandatory = true, HelpMessage = "The integration account resource group name.",
@@ -71,21 +56,13 @@ public class NewAzureIntegrationAccountMapCommand : LogicAppBaseCmdlet
7156
public string MapDefinition { get; set; }
7257

7358
[Parameter(Mandatory = false, HelpMessage = "The integration account map type.")]
74-
[ValidateSet("Xslt", IgnoreCase = false)]
59+
[ValidateSet("Xslt", "Xslt20", "Xslt30", "Liquid", IgnoreCase = true)]
7560
[ValidateNotNullOrEmpty]
76-
public string MapType
77-
{
78-
get { return this.mapType; }
79-
set { value = this.mapType; }
80-
}
61+
public string MapType { get; set; } = "Xslt";
8162

8263
[Parameter(Mandatory = false, HelpMessage = "The integration account map content type.")]
8364
[ValidateNotNullOrEmpty]
84-
public string ContentType
85-
{
86-
get { return this.contentType; }
87-
set { value = this.contentType; }
88-
}
65+
public string ContentType { get; set; }
8966

9067
[Parameter(Mandatory = false, HelpMessage = "The integration account map metadata.",
9168
ValueFromPipelineByPropertyName = false)]
@@ -113,6 +90,11 @@ public override void ExecuteCmdlet()
11390
this.MapDefinition = CmdletHelper.GetContentFromFile(this.TryResolvePath(this.MapFilePath));
11491
}
11592

93+
if (string.IsNullOrEmpty(this.ContentType))
94+
{
95+
this.ContentType = this.MapType.Equals("liquid", StringComparison.CurrentCultureIgnoreCase) ? "text/plain" : "application/xml";
96+
}
97+
11698
this.WriteObject(IntegrationAccountClient.CreateIntegrationAccountMap(this.ResourceGroupName, integrationAccount.Name, this.MapName,
11799
new IntegrationAccountMap
118100
{

src/LogicApp/LogicApp/Cmdlets/IntegrationAccount/UpdateAzureIntegrationAccountCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class UpdateAzureIntegrationAccountCommand : LogicAppBaseCmdlet
5151

5252
[Parameter(Mandatory = false, HelpMessage = "The integration account SKU.",
5353
ValueFromPipelineByPropertyName = true)]
54+
[ValidateSet("Free", "Basic", "Standard", IgnoreCase = true)]
5455
[ValidateNotNullOrEmpty]
5556
public string Sku { get; set; }
5657

src/LogicApp/LogicApp/Cmdlets/IntegrationAccount/UpdateAzureIntegrationAccountMapCommand.cs

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@ namespace Microsoft.Azure.Commands.LogicApp.Cmdlets
2929
[OutputType(typeof(IntegrationAccountMap))]
3030
public class UpdateAzureIntegrationAccountMapCommand : LogicAppBaseCmdlet
3131
{
32-
33-
#region Defaults
34-
35-
/// <summary>
36-
/// Default content type for map.
37-
/// </summary>
38-
private string contentType = "application/xml";
39-
40-
/// <summary>
41-
/// Default map type.
42-
/// </summary>
43-
private string mapType = "Xslt";
44-
45-
#endregion Defaults
46-
4732
#region Input Paramters
4833

4934
[Parameter(Mandatory = true, HelpMessage = "The integration account resource group name.",
@@ -72,21 +57,13 @@ public class UpdateAzureIntegrationAccountMapCommand : LogicAppBaseCmdlet
7257
public string MapDefinition { get; set; }
7358

7459
[Parameter(Mandatory = false, HelpMessage = "The integration account map type.")]
75-
[ValidateSet("Xslt", IgnoreCase = false)]
60+
[ValidateSet("Xslt", "Xslt20", "Xslt30", "Liquid", IgnoreCase = true)]
7661
[ValidateNotNullOrEmpty]
77-
public string MapType
78-
{
79-
get { return this.mapType; }
80-
set { value = this.mapType; }
81-
}
62+
public string MapType { get; set; } = "Xslt";
8263

8364
[Parameter(Mandatory = false, HelpMessage = "The integration account map content type.")]
8465
[ValidateNotNullOrEmpty]
85-
public string ContentType
86-
{
87-
get { return this.contentType; }
88-
set { value = this.contentType; }
89-
}
66+
public string ContentType { get; set; }
9067

9168
[Parameter(Mandatory = false, HelpMessage = "The integration account map metadata.",
9269
ValueFromPipelineByPropertyName = false)]
@@ -135,16 +112,13 @@ public override void ExecuteCmdlet()
135112
CmdletHelper.GetContentFromFile(this.TryResolvePath(this.MapFilePath));
136113
}
137114

138-
if (!string.IsNullOrEmpty(this.ContentType))
139-
{
140-
integrationAccountMapCopy.ContentType = this.contentType;
141-
}
142-
143115
if (!string.IsNullOrEmpty(this.MapType))
144116
{
145117
integrationAccountMapCopy.MapType = this.MapType;
146118
}
147119

120+
integrationAccountMapCopy.ContentType = this.MapType.Equals("liquid", StringComparison.CurrentCultureIgnoreCase) ? "text/plain" : "application/xml";
121+
148122
if (this.Metadata != null)
149123
{
150124
integrationAccountMapCopy.Metadata = CmdletHelper.ConvertToMetadataJObject(this.Metadata);

0 commit comments

Comments
 (0)