| | 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 Application : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Plan != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("plan"); |
| 0 | 22 | | writer.WriteObjectValue(Plan); |
| | 23 | | } |
| 0 | 24 | | writer.WritePropertyName("kind"); |
| 0 | 25 | | writer.WriteStringValue(Kind); |
| 0 | 26 | | if (ManagedBy != null) |
| | 27 | | { |
| 0 | 28 | | writer.WritePropertyName("managedBy"); |
| 0 | 29 | | writer.WriteStringValue(ManagedBy); |
| | 30 | | } |
| 0 | 31 | | if (Sku != null) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("sku"); |
| 0 | 34 | | writer.WriteObjectValue(Sku); |
| | 35 | | } |
| 0 | 36 | | if (Identity != null) |
| | 37 | | { |
| 0 | 38 | | writer.WritePropertyName("identity"); |
| 0 | 39 | | writer.WriteObjectValue(Identity); |
| | 40 | | } |
| 0 | 41 | | if (Id != null) |
| | 42 | | { |
| 0 | 43 | | writer.WritePropertyName("id"); |
| 0 | 44 | | writer.WriteStringValue(Id); |
| | 45 | | } |
| 0 | 46 | | if (Name != null) |
| | 47 | | { |
| 0 | 48 | | writer.WritePropertyName("name"); |
| 0 | 49 | | writer.WriteStringValue(Name); |
| | 50 | | } |
| 0 | 51 | | if (Type != null) |
| | 52 | | { |
| 0 | 53 | | writer.WritePropertyName("type"); |
| 0 | 54 | | writer.WriteStringValue(Type); |
| | 55 | | } |
| 0 | 56 | | if (Location != null) |
| | 57 | | { |
| 0 | 58 | | writer.WritePropertyName("location"); |
| 0 | 59 | | writer.WriteStringValue(Location); |
| | 60 | | } |
| 0 | 61 | | if (Tags != null) |
| | 62 | | { |
| 0 | 63 | | writer.WritePropertyName("tags"); |
| 0 | 64 | | writer.WriteStartObject(); |
| 0 | 65 | | foreach (var item in Tags) |
| | 66 | | { |
| 0 | 67 | | writer.WritePropertyName(item.Key); |
| 0 | 68 | | writer.WriteStringValue(item.Value); |
| | 69 | | } |
| 0 | 70 | | writer.WriteEndObject(); |
| | 71 | | } |
| 0 | 72 | | writer.WritePropertyName("properties"); |
| 0 | 73 | | writer.WriteStartObject(); |
| 0 | 74 | | writer.WritePropertyName("managedResourceGroupId"); |
| 0 | 75 | | writer.WriteStringValue(ManagedResourceGroupId); |
| 0 | 76 | | if (ApplicationDefinitionId != null) |
| | 77 | | { |
| 0 | 78 | | writer.WritePropertyName("applicationDefinitionId"); |
| 0 | 79 | | writer.WriteStringValue(ApplicationDefinitionId); |
| | 80 | | } |
| 0 | 81 | | if (Parameters != null) |
| | 82 | | { |
| 0 | 83 | | writer.WritePropertyName("parameters"); |
| 0 | 84 | | writer.WriteObjectValue(Parameters); |
| | 85 | | } |
| 0 | 86 | | if (Outputs != null) |
| | 87 | | { |
| 0 | 88 | | writer.WritePropertyName("outputs"); |
| 0 | 89 | | writer.WriteObjectValue(Outputs); |
| | 90 | | } |
| 0 | 91 | | if (ProvisioningState != null) |
| | 92 | | { |
| 0 | 93 | | writer.WritePropertyName("provisioningState"); |
| 0 | 94 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 95 | | } |
| 0 | 96 | | writer.WriteEndObject(); |
| 0 | 97 | | writer.WriteEndObject(); |
| 0 | 98 | | } |
| | 99 | |
|
| | 100 | | internal static Application DeserializeApplication(JsonElement element) |
| | 101 | | { |
| 0 | 102 | | PlanAutoGenerated plan = default; |
| 0 | 103 | | string kind = default; |
| 0 | 104 | | string managedBy = default; |
| 0 | 105 | | SkuAutoGenerated sku = default; |
| 0 | 106 | | IdentityAutoGenerated2 identity = default; |
| 0 | 107 | | string id = default; |
| 0 | 108 | | string name = default; |
| 0 | 109 | | string type = default; |
| 0 | 110 | | string location = default; |
| 0 | 111 | | IDictionary<string, string> tags = default; |
| 0 | 112 | | string managedResourceGroupId = default; |
| 0 | 113 | | string applicationDefinitionId = default; |
| 0 | 114 | | object parameters = default; |
| 0 | 115 | | object outputs = default; |
| 0 | 116 | | ProvisioningState? provisioningState = default; |
| 0 | 117 | | foreach (var property in element.EnumerateObject()) |
| | 118 | | { |
| 0 | 119 | | if (property.NameEquals("plan")) |
| | 120 | | { |
| 0 | 121 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 122 | | { |
| | 123 | | continue; |
| | 124 | | } |
| 0 | 125 | | plan = PlanAutoGenerated.DeserializePlanAutoGenerated(property.Value); |
| 0 | 126 | | continue; |
| | 127 | | } |
| 0 | 128 | | if (property.NameEquals("kind")) |
| | 129 | | { |
| 0 | 130 | | kind = property.Value.GetString(); |
| 0 | 131 | | continue; |
| | 132 | | } |
| 0 | 133 | | if (property.NameEquals("managedBy")) |
| | 134 | | { |
| 0 | 135 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 136 | | { |
| | 137 | | continue; |
| | 138 | | } |
| 0 | 139 | | managedBy = property.Value.GetString(); |
| 0 | 140 | | continue; |
| | 141 | | } |
| 0 | 142 | | if (property.NameEquals("sku")) |
| | 143 | | { |
| 0 | 144 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 145 | | { |
| | 146 | | continue; |
| | 147 | | } |
| 0 | 148 | | sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value); |
| 0 | 149 | | continue; |
| | 150 | | } |
| 0 | 151 | | if (property.NameEquals("identity")) |
| | 152 | | { |
| 0 | 153 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 154 | | { |
| | 155 | | continue; |
| | 156 | | } |
| 0 | 157 | | identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value); |
| 0 | 158 | | continue; |
| | 159 | | } |
| 0 | 160 | | if (property.NameEquals("id")) |
| | 161 | | { |
| 0 | 162 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 163 | | { |
| | 164 | | continue; |
| | 165 | | } |
| 0 | 166 | | id = property.Value.GetString(); |
| 0 | 167 | | continue; |
| | 168 | | } |
| 0 | 169 | | if (property.NameEquals("name")) |
| | 170 | | { |
| 0 | 171 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 172 | | { |
| | 173 | | continue; |
| | 174 | | } |
| 0 | 175 | | name = property.Value.GetString(); |
| 0 | 176 | | continue; |
| | 177 | | } |
| 0 | 178 | | if (property.NameEquals("type")) |
| | 179 | | { |
| 0 | 180 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 181 | | { |
| | 182 | | continue; |
| | 183 | | } |
| 0 | 184 | | type = property.Value.GetString(); |
| 0 | 185 | | continue; |
| | 186 | | } |
| 0 | 187 | | if (property.NameEquals("location")) |
| | 188 | | { |
| 0 | 189 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 190 | | { |
| | 191 | | continue; |
| | 192 | | } |
| 0 | 193 | | location = property.Value.GetString(); |
| 0 | 194 | | continue; |
| | 195 | | } |
| 0 | 196 | | if (property.NameEquals("tags")) |
| | 197 | | { |
| 0 | 198 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 199 | | { |
| | 200 | | continue; |
| | 201 | | } |
| 0 | 202 | | Dictionary<string, string> dictionary = new Dictionary<string, string>(); |
| 0 | 203 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 204 | | { |
| 0 | 205 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 206 | | { |
| 0 | 207 | | dictionary.Add(property0.Name, null); |
| | 208 | | } |
| | 209 | | else |
| | 210 | | { |
| 0 | 211 | | dictionary.Add(property0.Name, property0.Value.GetString()); |
| | 212 | | } |
| | 213 | | } |
| 0 | 214 | | tags = dictionary; |
| 0 | 215 | | continue; |
| | 216 | | } |
| 0 | 217 | | if (property.NameEquals("properties")) |
| | 218 | | { |
| 0 | 219 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 220 | | { |
| 0 | 221 | | if (property0.NameEquals("managedResourceGroupId")) |
| | 222 | | { |
| 0 | 223 | | managedResourceGroupId = property0.Value.GetString(); |
| 0 | 224 | | continue; |
| | 225 | | } |
| 0 | 226 | | if (property0.NameEquals("applicationDefinitionId")) |
| | 227 | | { |
| 0 | 228 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 229 | | { |
| | 230 | | continue; |
| | 231 | | } |
| 0 | 232 | | applicationDefinitionId = property0.Value.GetString(); |
| 0 | 233 | | continue; |
| | 234 | | } |
| 0 | 235 | | if (property0.NameEquals("parameters")) |
| | 236 | | { |
| 0 | 237 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 238 | | { |
| | 239 | | continue; |
| | 240 | | } |
| 0 | 241 | | parameters = property0.Value.GetObject(); |
| 0 | 242 | | continue; |
| | 243 | | } |
| 0 | 244 | | if (property0.NameEquals("outputs")) |
| | 245 | | { |
| 0 | 246 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 247 | | { |
| | 248 | | continue; |
| | 249 | | } |
| 0 | 250 | | outputs = property0.Value.GetObject(); |
| 0 | 251 | | continue; |
| | 252 | | } |
| 0 | 253 | | if (property0.NameEquals("provisioningState")) |
| | 254 | | { |
| 0 | 255 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 256 | | { |
| | 257 | | continue; |
| | 258 | | } |
| 0 | 259 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| | 260 | | continue; |
| | 261 | | } |
| | 262 | | } |
| | 263 | | continue; |
| | 264 | | } |
| | 265 | | } |
| 0 | 266 | | return new Application(id, name, type, location, tags, managedBy, sku, identity, plan, kind, managedResource |
| | 267 | | } |
| | 268 | | } |
| | 269 | | } |