| | | 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 DeploymentScriptUpdateParameter : IUtf8JsonSerializable |
| | | 15 | | { |
| | | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | | 17 | | { |
| | 0 | 18 | | writer.WriteStartObject(); |
| | 0 | 19 | | if (Tags != null) |
| | | 20 | | { |
| | 0 | 21 | | writer.WritePropertyName("tags"); |
| | 0 | 22 | | writer.WriteStartObject(); |
| | 0 | 23 | | foreach (var item in Tags) |
| | | 24 | | { |
| | 0 | 25 | | writer.WritePropertyName(item.Key); |
| | 0 | 26 | | writer.WriteStringValue(item.Value); |
| | | 27 | | } |
| | 0 | 28 | | writer.WriteEndObject(); |
| | | 29 | | } |
| | 0 | 30 | | if (Id != null) |
| | | 31 | | { |
| | 0 | 32 | | writer.WritePropertyName("id"); |
| | 0 | 33 | | writer.WriteStringValue(Id); |
| | | 34 | | } |
| | 0 | 35 | | if (Name != null) |
| | | 36 | | { |
| | 0 | 37 | | writer.WritePropertyName("name"); |
| | 0 | 38 | | writer.WriteStringValue(Name); |
| | | 39 | | } |
| | 0 | 40 | | if (Type != null) |
| | | 41 | | { |
| | 0 | 42 | | writer.WritePropertyName("type"); |
| | 0 | 43 | | writer.WriteStringValue(Type); |
| | | 44 | | } |
| | 0 | 45 | | writer.WriteEndObject(); |
| | 0 | 46 | | } |
| | | 47 | | |
| | | 48 | | internal static DeploymentScriptUpdateParameter DeserializeDeploymentScriptUpdateParameter(JsonElement element) |
| | | 49 | | { |
| | 0 | 50 | | IDictionary<string, string> tags = default; |
| | 0 | 51 | | string id = default; |
| | 0 | 52 | | string name = default; |
| | 0 | 53 | | string type = default; |
| | 0 | 54 | | foreach (var property in element.EnumerateObject()) |
| | | 55 | | { |
| | 0 | 56 | | if (property.NameEquals("tags")) |
| | | 57 | | { |
| | 0 | 58 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 59 | | { |
| | | 60 | | continue; |
| | | 61 | | } |
| | 0 | 62 | | Dictionary<string, string> dictionary = new Dictionary<string, string>(); |
| | 0 | 63 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | | 64 | | { |
| | 0 | 65 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 66 | | { |
| | 0 | 67 | | dictionary.Add(property0.Name, null); |
| | | 68 | | } |
| | | 69 | | else |
| | | 70 | | { |
| | 0 | 71 | | dictionary.Add(property0.Name, property0.Value.GetString()); |
| | | 72 | | } |
| | | 73 | | } |
| | 0 | 74 | | tags = dictionary; |
| | 0 | 75 | | continue; |
| | | 76 | | } |
| | 0 | 77 | | if (property.NameEquals("id")) |
| | | 78 | | { |
| | 0 | 79 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 80 | | { |
| | | 81 | | continue; |
| | | 82 | | } |
| | 0 | 83 | | id = property.Value.GetString(); |
| | 0 | 84 | | continue; |
| | | 85 | | } |
| | 0 | 86 | | if (property.NameEquals("name")) |
| | | 87 | | { |
| | 0 | 88 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 89 | | { |
| | | 90 | | continue; |
| | | 91 | | } |
| | 0 | 92 | | name = property.Value.GetString(); |
| | 0 | 93 | | continue; |
| | | 94 | | } |
| | 0 | 95 | | if (property.NameEquals("type")) |
| | | 96 | | { |
| | 0 | 97 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 98 | | { |
| | | 99 | | continue; |
| | | 100 | | } |
| | 0 | 101 | | type = property.Value.GetString(); |
| | | 102 | | continue; |
| | | 103 | | } |
| | | 104 | | } |
| | 0 | 105 | | return new DeploymentScriptUpdateParameter(id, name, type, tags); |
| | | 106 | | } |
| | | 107 | | } |
| | | 108 | | } |