| | 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 ContainerRegistryImageDeletedEventData |
| | 15 | | { |
| | 16 | | internal static ContainerRegistryImageDeletedEventData DeserializeContainerRegistryImageDeletedEventData(JsonEle |
| | 17 | | { |
| 2 | 18 | | Optional<string> id = default; |
| 2 | 19 | | Optional<DateTimeOffset> timestamp = default; |
| 2 | 20 | | Optional<string> action = default; |
| 2 | 21 | | Optional<ContainerRegistryEventTarget> target = default; |
| 2 | 22 | | Optional<ContainerRegistryEventRequest> request = default; |
| 2 | 23 | | Optional<ContainerRegistryEventActor> actor = default; |
| 2 | 24 | | Optional<ContainerRegistryEventSource> source = default; |
| 32 | 25 | | foreach (var property in element.EnumerateObject()) |
| | 26 | | { |
| 14 | 27 | | if (property.NameEquals("id")) |
| | 28 | | { |
| 2 | 29 | | id = property.Value.GetString(); |
| 2 | 30 | | continue; |
| | 31 | | } |
| 12 | 32 | | if (property.NameEquals("timestamp")) |
| | 33 | | { |
| 2 | 34 | | timestamp = property.Value.GetDateTimeOffset("O"); |
| 2 | 35 | | continue; |
| | 36 | | } |
| 10 | 37 | | if (property.NameEquals("action")) |
| | 38 | | { |
| 2 | 39 | | action = property.Value.GetString(); |
| 2 | 40 | | continue; |
| | 41 | | } |
| 8 | 42 | | if (property.NameEquals("target")) |
| | 43 | | { |
| 2 | 44 | | target = ContainerRegistryEventTarget.DeserializeContainerRegistryEventTarget(property.Value); |
| 2 | 45 | | continue; |
| | 46 | | } |
| 6 | 47 | | if (property.NameEquals("request")) |
| | 48 | | { |
| 2 | 49 | | request = ContainerRegistryEventRequest.DeserializeContainerRegistryEventRequest(property.Value); |
| 2 | 50 | | continue; |
| | 51 | | } |
| 4 | 52 | | if (property.NameEquals("actor")) |
| | 53 | | { |
| 2 | 54 | | actor = ContainerRegistryEventActor.DeserializeContainerRegistryEventActor(property.Value); |
| 2 | 55 | | continue; |
| | 56 | | } |
| 2 | 57 | | if (property.NameEquals("source")) |
| | 58 | | { |
| 2 | 59 | | source = ContainerRegistryEventSource.DeserializeContainerRegistryEventSource(property.Value); |
| | 60 | | continue; |
| | 61 | | } |
| | 62 | | } |
| 2 | 63 | | return new ContainerRegistryImageDeletedEventData(id.Value, Optional.ToNullable(timestamp), action.Value, ta |
| | 64 | | } |
| | 65 | | } |
| | 66 | | } |