Skip to content

Commit 70cb4a5

Browse files
change the outputs in AzureXXXScript from Dictionary to BinaryData (Azure#27985)
1 parent c33ac73 commit 70cb4a5

File tree

8 files changed

+24
-32
lines changed

8 files changed

+24
-32
lines changed

sdk/resources/Azure.ResourceManager.Resources/api/Azure.ResourceManager.Resources.netstandard2.0.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ public AzureCliScript(Azure.Core.AzureLocation location, System.TimeSpan retenti
745745
public string ContainerGroupName { get { throw null; } set { } }
746746
public System.Collections.Generic.IList<Azure.ResourceManager.Resources.Models.ScriptEnvironmentVariable> EnvironmentVariables { get { throw null; } }
747747
public string ForceUpdateTag { get { throw null; } set { } }
748-
public System.Collections.Generic.IReadOnlyDictionary<string, System.BinaryData> Outputs { get { throw null; } }
748+
public System.BinaryData Outputs { get { throw null; } }
749749
public System.Uri PrimaryScriptUri { get { throw null; } set { } }
750750
public Azure.ResourceManager.Resources.Models.ScriptProvisioningState? ProvisioningState { get { throw null; } }
751751
public System.TimeSpan RetentionInterval { get { throw null; } set { } }
@@ -764,7 +764,7 @@ public AzurePowerShellScript(Azure.Core.AzureLocation location, System.TimeSpan
764764
public string ContainerGroupName { get { throw null; } set { } }
765765
public System.Collections.Generic.IList<Azure.ResourceManager.Resources.Models.ScriptEnvironmentVariable> EnvironmentVariables { get { throw null; } }
766766
public string ForceUpdateTag { get { throw null; } set { } }
767-
public System.Collections.Generic.IReadOnlyDictionary<string, System.BinaryData> Outputs { get { throw null; } }
767+
public System.BinaryData Outputs { get { throw null; } }
768768
public System.Uri PrimaryScriptUri { get { throw null; } set { } }
769769
public Azure.ResourceManager.Resources.Models.ScriptProvisioningState? ProvisioningState { get { throw null; } }
770770
public System.TimeSpan RetentionInterval { get { throw null; } set { } }

sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/ArmDeploymentScriptPropertiesBase.cs

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/AzureCliScript.Serialization.cs

Lines changed: 3 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/AzureCliScript.cs

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/AzurePowerShellScript.Serialization.cs

Lines changed: 3 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resources/Azure.ResourceManager.Resources/src/Generated/Models/AzurePowerShellScript.cs

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/resources/Azure.ResourceManager.Resources/src/autorest.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ directive:
324324
where: $.definitions.DeploymentProperties.properties.onErrorDeployment
325325
transform: >
326326
$["x-ms-client-name"] = "ErrorDeployment"
327+
- from: deploymentScripts.json
328+
where: $.definitions.DeploymentScriptPropertiesBase.properties.outputs
329+
transform: >
330+
$.additionalProperties = undefined
327331
```
328332
329333
### Tag: package-track2-preview

sdk/resources/Azure.ResourceManager.Resources/tests/Scenario/DeploymentScriptCollectionTests.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using System;
5+
using System.Collections.Generic;
56
using System.Threading.Tasks;
67
using Azure.Core;
78
using Azure.Core.TestFramework;
@@ -126,11 +127,13 @@ private static void AssertValidDeploymentScript(AzurePowerShellScript model, Azu
126127
Assert.AreEqual(model.Status.ExpirationOn, getResult.Status.ExpirationOn);
127128
//Assert.AreEqual(model.Status.Error, getResult.Status.Error);
128129
}
129-
Assert.AreEqual(model.Outputs.Count, getResult.Outputs.Count);
130-
foreach (var kv in model.Outputs)
130+
var modelOutputs = model.Outputs.ToObjectFromJson<Dictionary<string, object>>();
131+
var getOutputs = getResult.Outputs.ToObjectFromJson<Dictionary<string, object>>();
132+
Assert.AreEqual(modelOutputs.Count, getOutputs.Count);
133+
foreach (var kv in modelOutputs)
131134
{
132-
Assert.IsTrue(getResult.Outputs.ContainsKey(kv.Key));
133-
Assert.AreEqual(kv.Value.ToArray(), getResult.Outputs[kv.Key].ToArray());
135+
Assert.IsTrue(getOutputs.ContainsKey(kv.Key));
136+
Assert.AreEqual(kv.Value.ToString(), getOutputs[kv.Key].ToString());
134137
}
135138
Assert.AreEqual(model.PrimaryScriptUri, getResult.PrimaryScriptUri);
136139
Assert.AreEqual(model.SupportingScriptUris, getResult.SupportingScriptUris);

0 commit comments

Comments
 (0)