< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_DeviceId()-0%100%
get_Distance()-100%100%
get_GeometryId()-0%100%
get_NearestLat()-0%100%
get_NearestLon()-0%100%
get_UdId()-0%100%
DeserializeMapsGeofenceGeometry(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MapsGeofenceGeometry.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
 8namespace Azure.Messaging.EventGrid.SystemEvents
 9{
 10    /// <summary> The geofence geometry. </summary>
 11    public partial class MapsGeofenceGeometry
 12    {
 13        /// <summary> Initializes a new instance of MapsGeofenceGeometry. </summary>
 014        internal MapsGeofenceGeometry()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of MapsGeofenceGeometry. </summary>
 19        /// <param name="deviceId"> ID of the device. </param>
 20        /// <param name="distance"> Distance from the coordinate to the closest border of the geofence. Positive means t
 21        /// <param name="geometryId"> The unique ID for the geofence geometry. </param>
 22        /// <param name="nearestLat"> Latitude of the nearest point of the geometry. </param>
 23        /// <param name="nearestLon"> Longitude of the nearest point of the geometry. </param>
 24        /// <param name="udId"> The unique id returned from user upload service when uploading a geofence. Will not be i
 625        internal MapsGeofenceGeometry(string deviceId, float? distance, string geometryId, float? nearestLat, float? nea
 26        {
 627            DeviceId = deviceId;
 628            Distance = distance;
 629            GeometryId = geometryId;
 630            NearestLat = nearestLat;
 631            NearestLon = nearestLon;
 632            UdId = udId;
 633        }
 34
 35        /// <summary> ID of the device. </summary>
 036        public string DeviceId { get; }
 37        /// <summary> Distance from the coordinate to the closest border of the geofence. Positive means the coordinate 
 638        public float? Distance { get; }
 39        /// <summary> The unique ID for the geofence geometry. </summary>
 040        public string GeometryId { get; }
 41        /// <summary> Latitude of the nearest point of the geometry. </summary>
 042        public float? NearestLat { get; }
 43        /// <summary> Longitude of the nearest point of the geometry. </summary>
 044        public float? NearestLon { get; }
 45        /// <summary> The unique id returned from user upload service when uploading a geofence. Will not be included in
 046        public string UdId { get; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MapsGeofenceGeometry.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Messaging.EventGrid.SystemEvents
 12{
 13    public partial class MapsGeofenceGeometry
 14    {
 15        internal static MapsGeofenceGeometry DeserializeMapsGeofenceGeometry(JsonElement element)
 16        {
 617            Optional<string> deviceId = default;
 618            Optional<float> distance = default;
 619            Optional<string> geometryId = default;
 620            Optional<float> nearestLat = default;
 621            Optional<float> nearestLon = default;
 622            Optional<string> udId = default;
 8423            foreach (var property in element.EnumerateObject())
 24            {
 3625                if (property.NameEquals("deviceId"))
 26                {
 627                    deviceId = property.Value.GetString();
 628                    continue;
 29                }
 3030                if (property.NameEquals("distance"))
 31                {
 632                    distance = property.Value.GetSingle();
 633                    continue;
 34                }
 2435                if (property.NameEquals("geometryId"))
 36                {
 637                    geometryId = property.Value.GetString();
 638                    continue;
 39                }
 1840                if (property.NameEquals("nearestLat"))
 41                {
 642                    nearestLat = property.Value.GetSingle();
 643                    continue;
 44                }
 1245                if (property.NameEquals("nearestLon"))
 46                {
 647                    nearestLon = property.Value.GetSingle();
 648                    continue;
 49                }
 650                if (property.NameEquals("udId"))
 51                {
 652                    udId = property.Value.GetString();
 53                    continue;
 54                }
 55            }
 656            return new MapsGeofenceGeometry(deviceId.Value, Optional.ToNullable(distance), geometryId.Value, Optional.To
 57        }
 58    }
 59}