| | 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 PacketCaptureStorageLocation : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 16 | 17 | | writer.WriteStartObject(); |
| 16 | 18 | | if (StorageId != null) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("storageId"); |
| 0 | 21 | | writer.WriteStringValue(StorageId); |
| | 22 | | } |
| 16 | 23 | | if (StoragePath != null) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("storagePath"); |
| 0 | 26 | | writer.WriteStringValue(StoragePath); |
| | 27 | | } |
| 16 | 28 | | if (FilePath != null) |
| | 29 | | { |
| 16 | 30 | | writer.WritePropertyName("filePath"); |
| 16 | 31 | | writer.WriteStringValue(FilePath); |
| | 32 | | } |
| 16 | 33 | | writer.WriteEndObject(); |
| 16 | 34 | | } |
| | 35 | |
|
| | 36 | | internal static PacketCaptureStorageLocation DeserializePacketCaptureStorageLocation(JsonElement element) |
| | 37 | | { |
| 20 | 38 | | string storageId = default; |
| 20 | 39 | | string storagePath = default; |
| 20 | 40 | | string filePath = default; |
| 120 | 41 | | foreach (var property in element.EnumerateObject()) |
| | 42 | | { |
| 40 | 43 | | if (property.NameEquals("storageId")) |
| | 44 | | { |
| 0 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 0 | 49 | | storageId = property.Value.GetString(); |
| 0 | 50 | | continue; |
| | 51 | | } |
| 40 | 52 | | if (property.NameEquals("storagePath")) |
| | 53 | | { |
| 20 | 54 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 55 | | { |
| | 56 | | continue; |
| | 57 | | } |
| 20 | 58 | | storagePath = property.Value.GetString(); |
| 20 | 59 | | continue; |
| | 60 | | } |
| 20 | 61 | | if (property.NameEquals("filePath")) |
| | 62 | | { |
| 20 | 63 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 64 | | { |
| | 65 | | continue; |
| | 66 | | } |
| 20 | 67 | | filePath = property.Value.GetString(); |
| | 68 | | continue; |
| | 69 | | } |
| | 70 | | } |
| 20 | 71 | | return new PacketCaptureStorageLocation(storageId, storagePath, filePath); |
| | 72 | | } |
| | 73 | | } |
| | 74 | | } |