< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobFinishedEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobFinishedEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobFinishedEventData.Serialization.cs
Covered lines:25
Uncovered lines:5
Coverable lines:30
Total lines:93
Line coverage:83.3% (25 of 30)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Outputs()-100%100%
DeserializeMediaJobFinishedEventData(...)-91.3%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobFinishedEventData.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> Job finished event data. </summary>
 14    public partial class MediaJobFinishedEventData : MediaJobStateChangeEventData
 15    {
 16        /// <summary> Initializes a new instance of MediaJobFinishedEventData. </summary>
 017        internal MediaJobFinishedEventData()
 18        {
 019            Outputs = new ChangeTrackingList<MediaJobOutput>();
 020        }
 21
 22        /// <summary> Initializes a new instance of MediaJobFinishedEventData. </summary>
 23        /// <param name="previousState"> The previous state of the Job. </param>
 24        /// <param name="state"> The new state of the Job. </param>
 25        /// <param name="correlationData"> Gets the Job correlation data. </param>
 26        /// <param name="outputs"> Gets the Job outputs. </param>
 227        internal MediaJobFinishedEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary<strin
 28        {
 229            Outputs = outputs;
 230        }
 31
 32        /// <summary> Gets the Job outputs. </summary>
 633        public IReadOnlyList<MediaJobOutput> Outputs { get; }
 34    }
 35}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobFinishedEventData.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 MediaJobFinishedEventData
 15    {
 16        internal static MediaJobFinishedEventData DeserializeMediaJobFinishedEventData(JsonElement element)
 17        {
 218            Optional<IReadOnlyList<MediaJobOutput>> outputs = default;
 219            Optional<MediaJobState> previousState = default;
 220            Optional<MediaJobState> state = default;
 221            Optional<IReadOnlyDictionary<string, string>> correlationData = default;
 2022            foreach (var property in element.EnumerateObject())
 23            {
 824                if (property.NameEquals("outputs"))
 25                {
 226                    List<MediaJobOutput> array = new List<MediaJobOutput>();
 827                    foreach (var item in property.Value.EnumerateArray())
 28                    {
 229                        array.Add(MediaJobOutput.DeserializeMediaJobOutput(item));
 30                    }
 231                    outputs = array;
 232                    continue;
 33                }
 634                if (property.NameEquals("previousState"))
 35                {
 236                    previousState = property.Value.GetString().ToMediaJobState();
 237                    continue;
 38                }
 439                if (property.NameEquals("state"))
 40                {
 241                    state = property.Value.GetString().ToMediaJobState();
 242                    continue;
 43                }
 244                if (property.NameEquals("correlationData"))
 45                {
 246                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 047                    foreach (var property0 in property.Value.EnumerateObject())
 48                    {
 049                        dictionary.Add(property0.Name, property0.Value.GetString());
 50                    }
 251                    correlationData = dictionary;
 52                    continue;
 53                }
 54            }
 255            return new MediaJobFinishedEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optiona
 56        }
 57    }
 58}