| | 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.Messaging.EventGrid.SystemEvents |
| | 13 | | { |
| | 14 | | public partial class ContainerRegistryChartPushedEventData |
| | 15 | | { |
| | 16 | | internal static ContainerRegistryChartPushedEventData DeserializeContainerRegistryChartPushedEventData(JsonEleme |
| | 17 | | { |
| 2 | 18 | | Optional<string> id = default; |
| 2 | 19 | | Optional<DateTimeOffset> timestamp = default; |
| 2 | 20 | | Optional<string> action = default; |
| 2 | 21 | | Optional<ContainerRegistryArtifactEventTarget> target = default; |
| 20 | 22 | | foreach (var property in element.EnumerateObject()) |
| | 23 | | { |
| 8 | 24 | | if (property.NameEquals("id")) |
| | 25 | | { |
| 2 | 26 | | id = property.Value.GetString(); |
| 2 | 27 | | continue; |
| | 28 | | } |
| 6 | 29 | | if (property.NameEquals("timestamp")) |
| | 30 | | { |
| 2 | 31 | | timestamp = property.Value.GetDateTimeOffset("O"); |
| 2 | 32 | | continue; |
| | 33 | | } |
| 4 | 34 | | if (property.NameEquals("action")) |
| | 35 | | { |
| 2 | 36 | | action = property.Value.GetString(); |
| 2 | 37 | | continue; |
| | 38 | | } |
| 2 | 39 | | if (property.NameEquals("target")) |
| | 40 | | { |
| 2 | 41 | | target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(proper |
| | 42 | | continue; |
| | 43 | | } |
| | 44 | | } |
| 2 | 45 | | return new ContainerRegistryChartPushedEventData(id.Value, Optional.ToNullable(timestamp), action.Value, tar |
| | 46 | | } |
| | 47 | | } |
| | 48 | | } |