< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputStateChangeEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputStateChangeEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputStateChangeEventData.Serialization.cs
Covered lines:21
Uncovered lines:6
Coverable lines:27
Total lines:87
Line coverage:77.7% (21 of 27)
Covered branches:9
Total branches:10
Branch coverage:90% (9 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_PreviousState()-100%100%
get_Output()-100%100%
get_JobCorrelationData()-0%100%
DeserializeMediaJobOutputStateChangeEventData(...)-87.5%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputStateChangeEventData.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 Microsoft.Media.JobOutputStateChange event. </s
 14    public partial class MediaJobOutputStateChangeEventData
 15    {
 16        /// <summary> Initializes a new instance of MediaJobOutputStateChangeEventData. </summary>
 017        internal MediaJobOutputStateChangeEventData()
 18        {
 019            JobCorrelationData = new ChangeTrackingDictionary<string, string>();
 020        }
 21
 22        /// <summary> Initializes a new instance of MediaJobOutputStateChangeEventData. </summary>
 23        /// <param name="previousState"> The previous state of the Job. </param>
 24        /// <param name="output"> Gets the output. </param>
 25        /// <param name="jobCorrelationData"> Gets the Job correlation data. </param>
 1426        internal MediaJobOutputStateChangeEventData(MediaJobState? previousState, MediaJobOutput output, IReadOnlyDictio
 27        {
 1428            PreviousState = previousState;
 1429            Output = output;
 1430            JobCorrelationData = jobCorrelationData;
 1431        }
 32
 33        /// <summary> The previous state of the Job. </summary>
 1434        public MediaJobState? PreviousState { get; }
 35        /// <summary> Gets the output. </summary>
 4036        public MediaJobOutput Output { get; }
 37        /// <summary> Gets the Job correlation data. </summary>
 038        public IReadOnlyDictionary<string, string> JobCorrelationData { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputStateChangeEventData.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 MediaJobOutputStateChangeEventData
 15    {
 16        internal static MediaJobOutputStateChangeEventData DeserializeMediaJobOutputStateChangeEventData(JsonElement ele
 17        {
 218            Optional<MediaJobState> previousState = default;
 219            Optional<MediaJobOutput> output = default;
 220            Optional<IReadOnlyDictionary<string, string>> jobCorrelationData = default;
 1621            foreach (var property in element.EnumerateObject())
 22            {
 623                if (property.NameEquals("previousState"))
 24                {
 225                    previousState = property.Value.GetString().ToMediaJobState();
 226                    continue;
 27                }
 428                if (property.NameEquals("output"))
 29                {
 230                    output = MediaJobOutput.DeserializeMediaJobOutput(property.Value);
 231                    continue;
 32                }
 233                if (property.NameEquals("jobCorrelationData"))
 34                {
 235                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 036                    foreach (var property0 in property.Value.EnumerateObject())
 37                    {
 038                        dictionary.Add(property0.Name, property0.Value.GetString());
 39                    }
 240                    jobCorrelationData = dictionary;
 41                    continue;
 42                }
 43            }
 244            return new MediaJobOutputStateChangeEventData(Optional.ToNullable(previousState), output.Value, Optional.ToD
 45        }
 46    }
 47}