Skip to content

Commit

Permalink
change the outputs in AzureXXXScript from Dictionary to BinaryData (A…
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcturusZhang authored Apr 5, 2022
1 parent c33ac73 commit 70cb4a5
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public AzureCliScript(Azure.Core.AzureLocation location, System.TimeSpan retenti
public string ContainerGroupName { get { throw null; } set { } }
public System.Collections.Generic.IList<Azure.ResourceManager.Resources.Models.ScriptEnvironmentVariable> EnvironmentVariables { get { throw null; } }
public string ForceUpdateTag { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyDictionary<string, System.BinaryData> Outputs { get { throw null; } }
public System.BinaryData Outputs { get { throw null; } }
public System.Uri PrimaryScriptUri { get { throw null; } set { } }
public Azure.ResourceManager.Resources.Models.ScriptProvisioningState? ProvisioningState { get { throw null; } }
public System.TimeSpan RetentionInterval { get { throw null; } set { } }
Expand All @@ -764,7 +764,7 @@ public AzurePowerShellScript(Azure.Core.AzureLocation location, System.TimeSpan
public string ContainerGroupName { get { throw null; } set { } }
public System.Collections.Generic.IList<Azure.ResourceManager.Resources.Models.ScriptEnvironmentVariable> EnvironmentVariables { get { throw null; } }
public string ForceUpdateTag { get { throw null; } set { } }
public System.Collections.Generic.IReadOnlyDictionary<string, System.BinaryData> Outputs { get { throw null; } }
public System.BinaryData Outputs { get { throw null; } }
public System.Uri PrimaryScriptUri { get { throw null; } set { } }
public Azure.ResourceManager.Resources.Models.ScriptProvisioningState? ProvisioningState { get { throw null; } }
public System.TimeSpan RetentionInterval { get { throw null; } set { } }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions sdk/resources/Azure.ResourceManager.Resources/src/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ directive:
where: $.definitions.DeploymentProperties.properties.onErrorDeployment
transform: >
$["x-ms-client-name"] = "ErrorDeployment"
- from: deploymentScripts.json
where: $.definitions.DeploymentScriptPropertiesBase.properties.outputs
transform: >
$.additionalProperties = undefined
```
### Tag: package-track2-preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Core.TestFramework;
Expand Down Expand Up @@ -126,11 +127,13 @@ private static void AssertValidDeploymentScript(AzurePowerShellScript model, Azu
Assert.AreEqual(model.Status.ExpirationOn, getResult.Status.ExpirationOn);
//Assert.AreEqual(model.Status.Error, getResult.Status.Error);
}
Assert.AreEqual(model.Outputs.Count, getResult.Outputs.Count);
foreach (var kv in model.Outputs)
var modelOutputs = model.Outputs.ToObjectFromJson<Dictionary<string, object>>();
var getOutputs = getResult.Outputs.ToObjectFromJson<Dictionary<string, object>>();
Assert.AreEqual(modelOutputs.Count, getOutputs.Count);
foreach (var kv in modelOutputs)
{
Assert.IsTrue(getResult.Outputs.ContainsKey(kv.Key));
Assert.AreEqual(kv.Value.ToArray(), getResult.Outputs[kv.Key].ToArray());
Assert.IsTrue(getOutputs.ContainsKey(kv.Key));
Assert.AreEqual(kv.Value.ToString(), getOutputs[kv.Key].ToString());
}
Assert.AreEqual(model.PrimaryScriptUri, getResult.PrimaryScriptUri);
Assert.AreEqual(model.SupportingScriptUris, getResult.SupportingScriptUris);
Expand Down

0 comments on commit 70cb4a5

Please sign in to comment.