| | 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.EventHubs.Models |
| | 13 | | { |
| | 14 | | public partial class ClusterQuotaConfigurationProperties : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Settings != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("settings"); |
| 0 | 22 | | writer.WriteStartObject(); |
| 0 | 23 | | foreach (var item in Settings) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName(item.Key); |
| 0 | 26 | | writer.WriteStringValue(item.Value); |
| | 27 | | } |
| 0 | 28 | | writer.WriteEndObject(); |
| | 29 | | } |
| 0 | 30 | | writer.WriteEndObject(); |
| 0 | 31 | | } |
| | 32 | |
|
| | 33 | | internal static ClusterQuotaConfigurationProperties DeserializeClusterQuotaConfigurationProperties(JsonElement e |
| | 34 | | { |
| 0 | 35 | | IDictionary<string, string> settings = default; |
| 0 | 36 | | foreach (var property in element.EnumerateObject()) |
| | 37 | | { |
| 0 | 38 | | if (property.NameEquals("settings")) |
| | 39 | | { |
| 0 | 40 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 41 | | { |
| | 42 | | continue; |
| | 43 | | } |
| 0 | 44 | | Dictionary<string, string> dictionary = new Dictionary<string, string>(); |
| 0 | 45 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 46 | | { |
| 0 | 47 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 48 | | { |
| 0 | 49 | | dictionary.Add(property0.Name, null); |
| | 50 | | } |
| | 51 | | else |
| | 52 | | { |
| 0 | 53 | | dictionary.Add(property0.Name, property0.Value.GetString()); |
| | 54 | | } |
| | 55 | | } |
| 0 | 56 | | settings = dictionary; |
| | 57 | | continue; |
| | 58 | | } |
| | 59 | | } |
| 0 | 60 | | return new ClusterQuotaConfigurationProperties(settings); |
| | 61 | | } |
| | 62 | | } |
| | 63 | | } |