< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.EventHubCaptureFileCreatedEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\EventHubCaptureFileCreatedEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\EventHubCaptureFileCreatedEventData.Serialization.cs
Covered lines:47
Uncovered lines:12
Coverable lines:59
Total lines:140
Line coverage:79.6% (47 of 59)
Covered branches:19
Total branches:20
Branch coverage:95% (19 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Fileurl()-0%100%
get_FileType()-100%100%
get_PartitionId()-0%100%
get_SizeInBytes()-0%100%
get_EventCount()-0%100%
get_FirstSequenceNumber()-0%100%
get_LastSequenceNumber()-0%100%
get_FirstEnqueueTime()-0%100%
get_LastEnqueueTime()-0%100%
DeserializeEventHubCaptureFileCreatedEventData(...)-94.59%95%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\EventHubCaptureFileCreatedEventData.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;
 9
 10namespace Azure.Messaging.EventGrid.SystemEvents
 11{
 12    /// <summary> Schema of the Data property of an EventGridEvent for an Microsoft.EventHub.CaptureFileCreated event. <
 13    public partial class EventHubCaptureFileCreatedEventData
 14    {
 15        /// <summary> Initializes a new instance of EventHubCaptureFileCreatedEventData. </summary>
 016        internal EventHubCaptureFileCreatedEventData()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of EventHubCaptureFileCreatedEventData. </summary>
 21        /// <param name="fileurl"> The path to the capture file. </param>
 22        /// <param name="fileType"> The file type of the capture file. </param>
 23        /// <param name="partitionId"> The shard ID. </param>
 24        /// <param name="sizeInBytes"> The file size. </param>
 25        /// <param name="eventCount"> The number of events in the file. </param>
 26        /// <param name="firstSequenceNumber"> The smallest sequence number from the queue. </param>
 27        /// <param name="lastSequenceNumber"> The last sequence number from the queue. </param>
 28        /// <param name="firstEnqueueTime"> The first time from the queue. </param>
 29        /// <param name="lastEnqueueTime"> The last time from the queue. </param>
 230        internal EventHubCaptureFileCreatedEventData(string fileurl, string fileType, string partitionId, int? sizeInByt
 31        {
 232            Fileurl = fileurl;
 233            FileType = fileType;
 234            PartitionId = partitionId;
 235            SizeInBytes = sizeInBytes;
 236            EventCount = eventCount;
 237            FirstSequenceNumber = firstSequenceNumber;
 238            LastSequenceNumber = lastSequenceNumber;
 239            FirstEnqueueTime = firstEnqueueTime;
 240            LastEnqueueTime = lastEnqueueTime;
 241        }
 42
 43        /// <summary> The path to the capture file. </summary>
 044        public string Fileurl { get; }
 45        /// <summary> The file type of the capture file. </summary>
 246        public string FileType { get; }
 47        /// <summary> The shard ID. </summary>
 048        public string PartitionId { get; }
 49        /// <summary> The file size. </summary>
 050        public int? SizeInBytes { get; }
 51        /// <summary> The number of events in the file. </summary>
 052        public int? EventCount { get; }
 53        /// <summary> The smallest sequence number from the queue. </summary>
 054        public int? FirstSequenceNumber { get; }
 55        /// <summary> The last sequence number from the queue. </summary>
 056        public int? LastSequenceNumber { get; }
 57        /// <summary> The first time from the queue. </summary>
 058        public DateTimeOffset? FirstEnqueueTime { get; }
 59        /// <summary> The last time from the queue. </summary>
 060        public DateTimeOffset? LastEnqueueTime { get; }
 61    }
 62}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\EventHubCaptureFileCreatedEventData.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Messaging.EventGrid.SystemEvents
 13{
 14    public partial class EventHubCaptureFileCreatedEventData
 15    {
 16        internal static EventHubCaptureFileCreatedEventData DeserializeEventHubCaptureFileCreatedEventData(JsonElement e
 17        {
 218            Optional<string> fileurl = default;
 219            Optional<string> fileType = default;
 220            Optional<string> partitionId = default;
 221            Optional<int> sizeInBytes = default;
 222            Optional<int> eventCount = default;
 223            Optional<int> firstSequenceNumber = default;
 224            Optional<int> lastSequenceNumber = default;
 225            Optional<DateTimeOffset> firstEnqueueTime = default;
 226            Optional<DateTimeOffset> lastEnqueueTime = default;
 4027            foreach (var property in element.EnumerateObject())
 28            {
 1829                if (property.NameEquals("fileurl"))
 30                {
 031                    fileurl = property.Value.GetString();
 032                    continue;
 33                }
 1834                if (property.NameEquals("fileType"))
 35                {
 236                    fileType = property.Value.GetString();
 237                    continue;
 38                }
 1639                if (property.NameEquals("partitionId"))
 40                {
 241                    partitionId = property.Value.GetString();
 242                    continue;
 43                }
 1444                if (property.NameEquals("sizeInBytes"))
 45                {
 246                    sizeInBytes = property.Value.GetInt32();
 247                    continue;
 48                }
 1249                if (property.NameEquals("eventCount"))
 50                {
 251                    eventCount = property.Value.GetInt32();
 252                    continue;
 53                }
 1054                if (property.NameEquals("firstSequenceNumber"))
 55                {
 256                    firstSequenceNumber = property.Value.GetInt32();
 257                    continue;
 58                }
 859                if (property.NameEquals("lastSequenceNumber"))
 60                {
 261                    lastSequenceNumber = property.Value.GetInt32();
 262                    continue;
 63                }
 664                if (property.NameEquals("firstEnqueueTime"))
 65                {
 266                    firstEnqueueTime = property.Value.GetDateTimeOffset("O");
 267                    continue;
 68                }
 469                if (property.NameEquals("lastEnqueueTime"))
 70                {
 271                    lastEnqueueTime = property.Value.GetDateTimeOffset("O");
 72                    continue;
 73                }
 74            }
 275            return new EventHubCaptureFileCreatedEventData(fileurl.Value, fileType.Value, partitionId.Value, Optional.To
 76        }
 77    }
 78}