| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.ResourceManager.Resources.Models |
| | 13 | | { |
| | 14 | | public partial class DeploymentScriptPropertiesBase : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (ContainerSettings != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("containerSettings"); |
| 0 | 22 | | writer.WriteObjectValue(ContainerSettings); |
| | 23 | | } |
| 0 | 24 | | if (StorageAccountSettings != null) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("storageAccountSettings"); |
| 0 | 27 | | writer.WriteObjectValue(StorageAccountSettings); |
| | 28 | | } |
| 0 | 29 | | if (CleanupPreference != null) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("cleanupPreference"); |
| 0 | 32 | | writer.WriteStringValue(CleanupPreference.Value.ToString()); |
| | 33 | | } |
| 0 | 34 | | if (ProvisioningState != null) |
| | 35 | | { |
| 0 | 36 | | writer.WritePropertyName("provisioningState"); |
| 0 | 37 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 38 | | } |
| 0 | 39 | | if (Status != null) |
| | 40 | | { |
| 0 | 41 | | writer.WritePropertyName("status"); |
| 0 | 42 | | writer.WriteObjectValue(Status); |
| | 43 | | } |
| 0 | 44 | | if (Outputs != null) |
| | 45 | | { |
| 0 | 46 | | writer.WritePropertyName("outputs"); |
| 0 | 47 | | writer.WriteStartObject(); |
| 0 | 48 | | foreach (var item in Outputs) |
| | 49 | | { |
| 0 | 50 | | writer.WritePropertyName(item.Key); |
| 0 | 51 | | writer.WriteObjectValue(item.Value); |
| | 52 | | } |
| 0 | 53 | | writer.WriteEndObject(); |
| | 54 | | } |
| 0 | 55 | | writer.WriteEndObject(); |
| 0 | 56 | | } |
| | 57 | |
|
| | 58 | | internal static DeploymentScriptPropertiesBase DeserializeDeploymentScriptPropertiesBase(JsonElement element) |
| | 59 | | { |
| 0 | 60 | | ContainerConfiguration containerSettings = default; |
| 0 | 61 | | StorageAccountConfiguration storageAccountSettings = default; |
| 0 | 62 | | CleanupOptions? cleanupPreference = default; |
| 0 | 63 | | ScriptProvisioningState? provisioningState = default; |
| 0 | 64 | | ScriptStatus status = default; |
| 0 | 65 | | IDictionary<string, object> outputs = default; |
| 0 | 66 | | foreach (var property in element.EnumerateObject()) |
| | 67 | | { |
| 0 | 68 | | if (property.NameEquals("containerSettings")) |
| | 69 | | { |
| 0 | 70 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 71 | | { |
| | 72 | | continue; |
| | 73 | | } |
| 0 | 74 | | containerSettings = ContainerConfiguration.DeserializeContainerConfiguration(property.Value); |
| 0 | 75 | | continue; |
| | 76 | | } |
| 0 | 77 | | if (property.NameEquals("storageAccountSettings")) |
| | 78 | | { |
| 0 | 79 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 80 | | { |
| | 81 | | continue; |
| | 82 | | } |
| 0 | 83 | | storageAccountSettings = StorageAccountConfiguration.DeserializeStorageAccountConfiguration(property |
| 0 | 84 | | continue; |
| | 85 | | } |
| 0 | 86 | | if (property.NameEquals("cleanupPreference")) |
| | 87 | | { |
| 0 | 88 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 89 | | { |
| | 90 | | continue; |
| | 91 | | } |
| 0 | 92 | | cleanupPreference = new CleanupOptions(property.Value.GetString()); |
| 0 | 93 | | continue; |
| | 94 | | } |
| 0 | 95 | | if (property.NameEquals("provisioningState")) |
| | 96 | | { |
| 0 | 97 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 98 | | { |
| | 99 | | continue; |
| | 100 | | } |
| 0 | 101 | | provisioningState = new ScriptProvisioningState(property.Value.GetString()); |
| 0 | 102 | | continue; |
| | 103 | | } |
| 0 | 104 | | if (property.NameEquals("status")) |
| | 105 | | { |
| 0 | 106 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 107 | | { |
| | 108 | | continue; |
| | 109 | | } |
| 0 | 110 | | status = ScriptStatus.DeserializeScriptStatus(property.Value); |
| 0 | 111 | | continue; |
| | 112 | | } |
| 0 | 113 | | if (property.NameEquals("outputs")) |
| | 114 | | { |
| 0 | 115 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 116 | | { |
| | 117 | | continue; |
| | 118 | | } |
| 0 | 119 | | Dictionary<string, object> dictionary = new Dictionary<string, object>(); |
| 0 | 120 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 121 | | { |
| 0 | 122 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 123 | | { |
| 0 | 124 | | dictionary.Add(property0.Name, null); |
| | 125 | | } |
| | 126 | | else |
| | 127 | | { |
| 0 | 128 | | dictionary.Add(property0.Name, property0.Value.GetObject()); |
| | 129 | | } |
| | 130 | | } |
| 0 | 131 | | outputs = dictionary; |
| | 132 | | continue; |
| | 133 | | } |
| | 134 | | } |
| 0 | 135 | | return new DeploymentScriptPropertiesBase(containerSettings, storageAccountSettings, cleanupPreference, prov |
| | 136 | | } |
| | 137 | | } |
| | 138 | | } |