< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobStateChangeEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobStateChangeEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobStateChangeEventData.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_State()-100%100%
get_CorrelationData()-0%100%
DeserializeMediaJobStateChangeEventData(...)-87.5%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobStateChangeEventData.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.JobStateChange event. </summary
 14    public partial class MediaJobStateChangeEventData
 15    {
 16        /// <summary> Initializes a new instance of MediaJobStateChangeEventData. </summary>
 017        internal MediaJobStateChangeEventData()
 18        {
 019            CorrelationData = new ChangeTrackingDictionary<string, string>();
 020        }
 21
 22        /// <summary> Initializes a new instance of MediaJobStateChangeEventData. </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>
 1426        internal MediaJobStateChangeEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary<st
 27        {
 1428            PreviousState = previousState;
 1429            State = state;
 1430            CorrelationData = correlationData;
 1431        }
 32
 33        /// <summary> The previous state of the Job. </summary>
 1434        public MediaJobState? PreviousState { get; }
 35        /// <summary> The new state of the Job. </summary>
 1436        public MediaJobState? State { get; }
 37        /// <summary> Gets the Job correlation data. </summary>
 038        public IReadOnlyDictionary<string, string> CorrelationData { get; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobStateChangeEventData.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 MediaJobStateChangeEventData
 15    {
 16        internal static MediaJobStateChangeEventData DeserializeMediaJobStateChangeEventData(JsonElement element)
 17        {
 218            Optional<MediaJobState> previousState = default;
 219            Optional<MediaJobState> state = default;
 220            Optional<IReadOnlyDictionary<string, string>> correlationData = 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("state"))
 29                {
 230                    state = property.Value.GetString().ToMediaJobState();
 231                    continue;
 32                }
 233                if (property.NameEquals("correlationData"))
 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                    correlationData = dictionary;
 41                    continue;
 42                }
 43            }
 244            return new MediaJobStateChangeEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Opti
 45        }
 46    }
 47}