< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobOutput
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutput.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutput.Serialization.cs
Covered lines:13
Uncovered lines:27
Coverable lines:40
Total lines:108
Line coverage:32.5% (13 of 40)
Covered branches:2
Total branches:16
Branch coverage:12.5% (2 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_OdataType()-0%100%
get_Error()-100%100%
get_Label()-0%100%
get_Progress()-100%100%
get_State()-100%100%
DeserializeMediaJobOutput(...)-12.5%12.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutput.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 event data for a Job output. </summary>
 11    public partial class MediaJobOutput
 12    {
 13        /// <summary> Initializes a new instance of MediaJobOutput. </summary>
 14        /// <param name="progress"> Gets the Job output progress. </param>
 15        /// <param name="state"> Gets the Job output state. </param>
 016        internal MediaJobOutput(long progress, MediaJobState state)
 17        {
 018            Progress = progress;
 019            State = state;
 020        }
 21
 22        /// <summary> Initializes a new instance of MediaJobOutput. </summary>
 23        /// <param name="odataType"> The discriminator for derived types. </param>
 24        /// <param name="error"> Gets the Job output error. </param>
 25        /// <param name="label"> Gets the Job output label. </param>
 26        /// <param name="progress"> Gets the Job output progress. </param>
 27        /// <param name="state"> Gets the Job output state. </param>
 2028        internal MediaJobOutput(string odataType, MediaJobError error, string label, long progress, MediaJobState state)
 29        {
 2030            OdataType = odataType;
 2031            Error = error;
 2032            Label = label;
 2033            Progress = progress;
 2034            State = state;
 2035        }
 36
 37        /// <summary> The discriminator for derived types. </summary>
 038        internal string OdataType { get; set; }
 39        /// <summary> Gets the Job output error. </summary>
 1440        public MediaJobError Error { get; }
 41        /// <summary> Gets the Job output label. </summary>
 042        public string Label { get; }
 43        /// <summary> Gets the Job output progress. </summary>
 644        public long Progress { get; }
 45        /// <summary> Gets the Job output state. </summary>
 2046        public MediaJobState State { get; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutput.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 MediaJobOutput
 14    {
 15        internal static MediaJobOutput DeserializeMediaJobOutput(JsonElement element)
 16        {
 2017            if (element.TryGetProperty("@odata.type", out JsonElement discriminator))
 18            {
 2019                switch (discriminator.GetString())
 20                {
 2021                    case "#Microsoft.Media.JobOutputAsset": return MediaJobOutputAsset.DeserializeMediaJobOutputAsset(el
 22                }
 23            }
 024            Optional<string> odataType = default;
 025            Optional<MediaJobError> error = default;
 026            Optional<string> label = default;
 027            long progress = default;
 028            MediaJobState state = default;
 029            foreach (var property in element.EnumerateObject())
 30            {
 031                if (property.NameEquals("@odata.type"))
 32                {
 033                    odataType = property.Value.GetString();
 034                    continue;
 35                }
 036                if (property.NameEquals("error"))
 37                {
 038                    error = MediaJobError.DeserializeMediaJobError(property.Value);
 039                    continue;
 40                }
 041                if (property.NameEquals("label"))
 42                {
 043                    label = property.Value.GetString();
 044                    continue;
 45                }
 046                if (property.NameEquals("progress"))
 47                {
 048                    progress = property.Value.GetInt64();
 049                    continue;
 50                }
 051                if (property.NameEquals("state"))
 52                {
 053                    state = property.Value.GetString().ToMediaJobState();
 54                    continue;
 55                }
 56            }
 057            return new MediaJobOutput(odataType.Value, error.Value, label.Value, progress, state);
 58        }
 59    }
 60}