< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MapsGeofenceEventProperties
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MapsGeofenceEventProperties.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MapsGeofenceEventProperties.Serialization.cs
Covered lines:7
Uncovered lines:34
Coverable lines:41
Total lines:109
Line coverage:17% (7 of 41)
Covered branches:0
Total branches:16
Branch coverage:0% (0 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ExpiredGeofenceGeometryId()-0%100%
get_Geometries()-100%100%
get_InvalidPeriodGeofenceGeometryId()-0%100%
get_IsEventPublished()-0%100%
DeserializeMapsGeofenceEventProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MapsGeofenceEventProperties.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using Azure.Core;
 10
 11namespace Azure.Messaging.EventGrid.SystemEvents
 12{
 13    /// <summary> Schema of the Data property of an EventGridEvent for a Geofence event (GeofenceEntered, GeofenceExited
 14    public partial class MapsGeofenceEventProperties
 15    {
 16        /// <summary> Initializes a new instance of MapsGeofenceEventProperties. </summary>
 017        internal MapsGeofenceEventProperties()
 18        {
 019            ExpiredGeofenceGeometryId = new ChangeTrackingList<string>();
 020            Geometries = new ChangeTrackingList<MapsGeofenceGeometry>();
 021            InvalidPeriodGeofenceGeometryId = new ChangeTrackingList<string>();
 022        }
 23
 24        /// <summary> Initializes a new instance of MapsGeofenceEventProperties. </summary>
 25        /// <param name="expiredGeofenceGeometryId"> Lists of the geometry ID of the geofence which is expired relative 
 26        /// <param name="geometries"> Lists the fence geometries that either fully contain the coordinate position or ha
 27        /// <param name="invalidPeriodGeofenceGeometryId"> Lists of the geometry ID of the geofence which is in invalid 
 28        /// <param name="isEventPublished"> True if at least one event is published to the Azure Maps event subscriber, 
 629        internal MapsGeofenceEventProperties(IReadOnlyList<string> expiredGeofenceGeometryId, IReadOnlyList<MapsGeofence
 30        {
 631            ExpiredGeofenceGeometryId = expiredGeofenceGeometryId;
 632            Geometries = geometries;
 633            InvalidPeriodGeofenceGeometryId = invalidPeriodGeofenceGeometryId;
 634            IsEventPublished = isEventPublished;
 635        }
 36
 37        /// <summary> Lists of the geometry ID of the geofence which is expired relative to the user time in the request
 038        public IReadOnlyList<string> ExpiredGeofenceGeometryId { get; }
 39        /// <summary> Lists the fence geometries that either fully contain the coordinate position or have an overlap wi
 640        public IReadOnlyList<MapsGeofenceGeometry> Geometries { get; }
 41        /// <summary> Lists of the geometry ID of the geofence which is in invalid period relative to the user time in t
 042        public IReadOnlyList<string> InvalidPeriodGeofenceGeometryId { get; }
 43        /// <summary> True if at least one event is published to the Azure Maps event subscriber, false if no event is p
 044        public bool? IsEventPublished { get; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MapsGeofenceEventProperties.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Messaging.EventGrid.SystemEvents
 13{
 14    public partial class MapsGeofenceEventProperties
 15    {
 16        internal static MapsGeofenceEventProperties DeserializeMapsGeofenceEventProperties(JsonElement element)
 17        {
 018            Optional<IReadOnlyList<string>> expiredGeofenceGeometryId = default;
 019            Optional<IReadOnlyList<MapsGeofenceGeometry>> geometries = default;
 020            Optional<IReadOnlyList<string>> invalidPeriodGeofenceGeometryId = default;
 021            Optional<bool> isEventPublished = default;
 022            foreach (var property in element.EnumerateObject())
 23            {
 024                if (property.NameEquals("expiredGeofenceGeometryId"))
 25                {
 026                    List<string> array = new List<string>();
 027                    foreach (var item in property.Value.EnumerateArray())
 28                    {
 029                        array.Add(item.GetString());
 30                    }
 031                    expiredGeofenceGeometryId = array;
 032                    continue;
 33                }
 034                if (property.NameEquals("geometries"))
 35                {
 036                    List<MapsGeofenceGeometry> array = new List<MapsGeofenceGeometry>();
 037                    foreach (var item in property.Value.EnumerateArray())
 38                    {
 039                        array.Add(MapsGeofenceGeometry.DeserializeMapsGeofenceGeometry(item));
 40                    }
 041                    geometries = array;
 042                    continue;
 43                }
 044                if (property.NameEquals("invalidPeriodGeofenceGeometryId"))
 45                {
 046                    List<string> array = new List<string>();
 047                    foreach (var item in property.Value.EnumerateArray())
 48                    {
 049                        array.Add(item.GetString());
 50                    }
 051                    invalidPeriodGeofenceGeometryId = array;
 052                    continue;
 53                }
 054                if (property.NameEquals("isEventPublished"))
 55                {
 056                    isEventPublished = property.Value.GetBoolean();
 57                    continue;
 58                }
 59            }
 060            return new MapsGeofenceEventProperties(Optional.ToList(expiredGeofenceGeometryId), Optional.ToList(geometrie
 61        }
 62    }
 63}