| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Network.Models |
| | 12 | | { |
| | 13 | | public partial class LoadBalancerSku : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 16 | 17 | | writer.WriteStartObject(); |
| 16 | 18 | | if (Name != null) |
| | 19 | | { |
| 16 | 20 | | writer.WritePropertyName("name"); |
| 16 | 21 | | writer.WriteStringValue(Name.Value.ToString()); |
| | 22 | | } |
| 16 | 23 | | writer.WriteEndObject(); |
| 16 | 24 | | } |
| | 25 | |
|
| | 26 | | internal static LoadBalancerSku DeserializeLoadBalancerSku(JsonElement element) |
| | 27 | | { |
| 120 | 28 | | LoadBalancerSkuName? name = default; |
| 480 | 29 | | foreach (var property in element.EnumerateObject()) |
| | 30 | | { |
| 120 | 31 | | if (property.NameEquals("name")) |
| | 32 | | { |
| 120 | 33 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 34 | | { |
| | 35 | | continue; |
| | 36 | | } |
| 120 | 37 | | name = new LoadBalancerSkuName(property.Value.GetString()); |
| | 38 | | continue; |
| | 39 | | } |
| | 40 | | } |
| 120 | 41 | | return new LoadBalancerSku(name); |
| | 42 | | } |
| | 43 | | } |
| | 44 | | } |