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