| | 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 ConnectionMonitorIcmpConfiguration : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (DisableTraceRoute != null) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("disableTraceRoute"); |
| 0 | 21 | | writer.WriteBooleanValue(DisableTraceRoute.Value); |
| | 22 | | } |
| 0 | 23 | | writer.WriteEndObject(); |
| 0 | 24 | | } |
| | 25 | |
|
| | 26 | | internal static ConnectionMonitorIcmpConfiguration DeserializeConnectionMonitorIcmpConfiguration(JsonElement ele |
| | 27 | | { |
| 0 | 28 | | bool? disableTraceRoute = default; |
| 0 | 29 | | foreach (var property in element.EnumerateObject()) |
| | 30 | | { |
| 0 | 31 | | if (property.NameEquals("disableTraceRoute")) |
| | 32 | | { |
| 0 | 33 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 34 | | { |
| | 35 | | continue; |
| | 36 | | } |
| 0 | 37 | | disableTraceRoute = property.Value.GetBoolean(); |
| | 38 | | continue; |
| | 39 | | } |
| | 40 | | } |
| 0 | 41 | | return new ConnectionMonitorIcmpConfiguration(disableTraceRoute); |
| | 42 | | } |
| | 43 | | } |
| | 44 | | } |