| | 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.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.Messaging.EventGrid.SystemEvents |
| | 13 | | { |
| | 14 | | public partial class MapsGeofenceExitedEventData |
| | 15 | | { |
| | 16 | | internal static MapsGeofenceExitedEventData DeserializeMapsGeofenceExitedEventData(JsonElement element) |
| | 17 | | { |
| 2 | 18 | | Optional<IReadOnlyList<string>> expiredGeofenceGeometryId = default; |
| 2 | 19 | | Optional<IReadOnlyList<MapsGeofenceGeometry>> geometries = default; |
| 2 | 20 | | Optional<IReadOnlyList<string>> invalidPeriodGeofenceGeometryId = default; |
| 2 | 21 | | Optional<bool> isEventPublished = default; |
| 20 | 22 | | foreach (var property in element.EnumerateObject()) |
| | 23 | | { |
| 8 | 24 | | if (property.NameEquals("expiredGeofenceGeometryId")) |
| | 25 | | { |
| 2 | 26 | | List<string> array = new List<string>(); |
| 12 | 27 | | foreach (var item in property.Value.EnumerateArray()) |
| | 28 | | { |
| 4 | 29 | | array.Add(item.GetString()); |
| | 30 | | } |
| 2 | 31 | | expiredGeofenceGeometryId = array; |
| 2 | 32 | | continue; |
| | 33 | | } |
| 6 | 34 | | if (property.NameEquals("geometries")) |
| | 35 | | { |
| 2 | 36 | | List<MapsGeofenceGeometry> array = new List<MapsGeofenceGeometry>(); |
| 8 | 37 | | foreach (var item in property.Value.EnumerateArray()) |
| | 38 | | { |
| 2 | 39 | | array.Add(MapsGeofenceGeometry.DeserializeMapsGeofenceGeometry(item)); |
| | 40 | | } |
| 2 | 41 | | geometries = array; |
| 2 | 42 | | continue; |
| | 43 | | } |
| 4 | 44 | | if (property.NameEquals("invalidPeriodGeofenceGeometryId")) |
| | 45 | | { |
| 2 | 46 | | List<string> array = new List<string>(); |
| 12 | 47 | | foreach (var item in property.Value.EnumerateArray()) |
| | 48 | | { |
| 4 | 49 | | array.Add(item.GetString()); |
| | 50 | | } |
| 2 | 51 | | invalidPeriodGeofenceGeometryId = array; |
| 2 | 52 | | continue; |
| | 53 | | } |
| 2 | 54 | | if (property.NameEquals("isEventPublished")) |
| | 55 | | { |
| 2 | 56 | | isEventPublished = property.Value.GetBoolean(); |
| | 57 | | continue; |
| | 58 | | } |
| | 59 | | } |
| 2 | 60 | | return new MapsGeofenceExitedEventData(Optional.ToList(expiredGeofenceGeometryId), Optional.ToList(geometrie |
| | 61 | | } |
| | 62 | | } |
| | 63 | | } |