| | 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 TrafficAnalyticsConfigurationProperties : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Enabled != null) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("enabled"); |
| 0 | 21 | | writer.WriteBooleanValue(Enabled.Value); |
| | 22 | | } |
| 0 | 23 | | if (WorkspaceId != null) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("workspaceId"); |
| 0 | 26 | | writer.WriteStringValue(WorkspaceId); |
| | 27 | | } |
| 0 | 28 | | if (WorkspaceRegion != null) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("workspaceRegion"); |
| 0 | 31 | | writer.WriteStringValue(WorkspaceRegion); |
| | 32 | | } |
| 0 | 33 | | if (WorkspaceResourceId != null) |
| | 34 | | { |
| 0 | 35 | | writer.WritePropertyName("workspaceResourceId"); |
| 0 | 36 | | writer.WriteStringValue(WorkspaceResourceId); |
| | 37 | | } |
| 0 | 38 | | if (TrafficAnalyticsInterval != null) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("trafficAnalyticsInterval"); |
| 0 | 41 | | writer.WriteNumberValue(TrafficAnalyticsInterval.Value); |
| | 42 | | } |
| 0 | 43 | | writer.WriteEndObject(); |
| 0 | 44 | | } |
| | 45 | |
|
| | 46 | | internal static TrafficAnalyticsConfigurationProperties DeserializeTrafficAnalyticsConfigurationProperties(JsonE |
| | 47 | | { |
| 0 | 48 | | bool? enabled = default; |
| 0 | 49 | | string workspaceId = default; |
| 0 | 50 | | string workspaceRegion = default; |
| 0 | 51 | | string workspaceResourceId = default; |
| 0 | 52 | | int? trafficAnalyticsInterval = default; |
| 0 | 53 | | foreach (var property in element.EnumerateObject()) |
| | 54 | | { |
| 0 | 55 | | if (property.NameEquals("enabled")) |
| | 56 | | { |
| 0 | 57 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 58 | | { |
| | 59 | | continue; |
| | 60 | | } |
| 0 | 61 | | enabled = property.Value.GetBoolean(); |
| 0 | 62 | | continue; |
| | 63 | | } |
| 0 | 64 | | if (property.NameEquals("workspaceId")) |
| | 65 | | { |
| 0 | 66 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 67 | | { |
| | 68 | | continue; |
| | 69 | | } |
| 0 | 70 | | workspaceId = property.Value.GetString(); |
| 0 | 71 | | continue; |
| | 72 | | } |
| 0 | 73 | | if (property.NameEquals("workspaceRegion")) |
| | 74 | | { |
| 0 | 75 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 76 | | { |
| | 77 | | continue; |
| | 78 | | } |
| 0 | 79 | | workspaceRegion = property.Value.GetString(); |
| 0 | 80 | | continue; |
| | 81 | | } |
| 0 | 82 | | if (property.NameEquals("workspaceResourceId")) |
| | 83 | | { |
| 0 | 84 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 85 | | { |
| | 86 | | continue; |
| | 87 | | } |
| 0 | 88 | | workspaceResourceId = property.Value.GetString(); |
| 0 | 89 | | continue; |
| | 90 | | } |
| 0 | 91 | | if (property.NameEquals("trafficAnalyticsInterval")) |
| | 92 | | { |
| 0 | 93 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 94 | | { |
| | 95 | | continue; |
| | 96 | | } |
| 0 | 97 | | trafficAnalyticsInterval = property.Value.GetInt32(); |
| | 98 | | continue; |
| | 99 | | } |
| | 100 | | } |
| 0 | 101 | | return new TrafficAnalyticsConfigurationProperties(enabled, workspaceId, workspaceRegion, workspaceResourceI |
| | 102 | | } |
| | 103 | | } |
| | 104 | | } |