| | 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; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.ResourceManager.Resources.Models |
| | 13 | | { |
| | 14 | | public partial class SystemData : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (CreatedBy != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("createdBy"); |
| 0 | 22 | | writer.WriteStringValue(CreatedBy); |
| | 23 | | } |
| 0 | 24 | | if (CreatedByType != null) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("createdByType"); |
| 0 | 27 | | writer.WriteStringValue(CreatedByType.Value.ToString()); |
| | 28 | | } |
| 0 | 29 | | if (CreatedAt != null) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("createdAt"); |
| 0 | 32 | | writer.WriteStringValue(CreatedAt.Value, "O"); |
| | 33 | | } |
| 0 | 34 | | if (LastModifiedBy != null) |
| | 35 | | { |
| 0 | 36 | | writer.WritePropertyName("lastModifiedBy"); |
| 0 | 37 | | writer.WriteStringValue(LastModifiedBy); |
| | 38 | | } |
| 0 | 39 | | if (LastModifiedByType != null) |
| | 40 | | { |
| 0 | 41 | | writer.WritePropertyName("lastModifiedByType"); |
| 0 | 42 | | writer.WriteStringValue(LastModifiedByType.Value.ToString()); |
| | 43 | | } |
| 0 | 44 | | if (LastModifiedAt != null) |
| | 45 | | { |
| 0 | 46 | | writer.WritePropertyName("lastModifiedAt"); |
| 0 | 47 | | writer.WriteStringValue(LastModifiedAt.Value, "O"); |
| | 48 | | } |
| 0 | 49 | | writer.WriteEndObject(); |
| 0 | 50 | | } |
| | 51 | |
|
| | 52 | | internal static SystemData DeserializeSystemData(JsonElement element) |
| | 53 | | { |
| 74 | 54 | | string createdBy = default; |
| 74 | 55 | | CreatedByType? createdByType = default; |
| 74 | 56 | | DateTimeOffset? createdAt = default; |
| 74 | 57 | | string lastModifiedBy = default; |
| 74 | 58 | | CreatedByType? lastModifiedByType = default; |
| 74 | 59 | | DateTimeOffset? lastModifiedAt = default; |
| 1036 | 60 | | foreach (var property in element.EnumerateObject()) |
| | 61 | | { |
| 444 | 62 | | if (property.NameEquals("createdBy")) |
| | 63 | | { |
| 74 | 64 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 65 | | { |
| | 66 | | continue; |
| | 67 | | } |
| 74 | 68 | | createdBy = property.Value.GetString(); |
| 74 | 69 | | continue; |
| | 70 | | } |
| 370 | 71 | | if (property.NameEquals("createdByType")) |
| | 72 | | { |
| 74 | 73 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 74 | | { |
| | 75 | | continue; |
| | 76 | | } |
| 74 | 77 | | createdByType = new CreatedByType(property.Value.GetString()); |
| 74 | 78 | | continue; |
| | 79 | | } |
| 296 | 80 | | if (property.NameEquals("createdAt")) |
| | 81 | | { |
| 74 | 82 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 83 | | { |
| | 84 | | continue; |
| | 85 | | } |
| 74 | 86 | | createdAt = property.Value.GetDateTimeOffset("O"); |
| 74 | 87 | | continue; |
| | 88 | | } |
| 222 | 89 | | if (property.NameEquals("lastModifiedBy")) |
| | 90 | | { |
| 74 | 91 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 92 | | { |
| | 93 | | continue; |
| | 94 | | } |
| 74 | 95 | | lastModifiedBy = property.Value.GetString(); |
| 74 | 96 | | continue; |
| | 97 | | } |
| 148 | 98 | | if (property.NameEquals("lastModifiedByType")) |
| | 99 | | { |
| 74 | 100 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 101 | | { |
| | 102 | | continue; |
| | 103 | | } |
| 74 | 104 | | lastModifiedByType = new CreatedByType(property.Value.GetString()); |
| 74 | 105 | | continue; |
| | 106 | | } |
| 74 | 107 | | if (property.NameEquals("lastModifiedAt")) |
| | 108 | | { |
| 74 | 109 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 110 | | { |
| | 111 | | continue; |
| | 112 | | } |
| 74 | 113 | | lastModifiedAt = property.Value.GetDateTimeOffset("O"); |
| | 114 | | continue; |
| | 115 | | } |
| | 116 | | } |
| 74 | 117 | | return new SystemData(createdBy, createdByType, createdAt, lastModifiedBy, lastModifiedByType, lastModifiedA |
| | 118 | | } |
| | 119 | | } |
| | 120 | | } |