< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobOutputAsset
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputAsset.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputAsset.Serialization.cs
Covered lines:30
Uncovered lines:3
Coverable lines:33
Total lines:96
Line coverage:90.9% (30 of 33)
Covered branches:15
Total branches:16
Branch coverage:93.7% (15 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%50%
get_AssetName()-100%100%
DeserializeMediaJobOutputAsset(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputAsset.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 asset. </summary>
 11    public partial class MediaJobOutputAsset : MediaJobOutput
 12    {
 13        /// <summary> Initializes a new instance of MediaJobOutputAsset. </summary>
 14        /// <param name="progress"> Gets the Job output progress. </param>
 15        /// <param name="state"> Gets the Job output state. </param>
 016        internal MediaJobOutputAsset(long progress, MediaJobState state) : base(progress, state)
 17        {
 018            OdataType = "#Microsoft.Media.JobOutputAsset";
 019        }
 20
 21        /// <summary> Initializes a new instance of MediaJobOutputAsset. </summary>
 22        /// <param name="odataType"> The discriminator for derived types. </param>
 23        /// <param name="error"> Gets the Job output error. </param>
 24        /// <param name="label"> Gets the Job output label. </param>
 25        /// <param name="progress"> Gets the Job output progress. </param>
 26        /// <param name="state"> Gets the Job output state. </param>
 27        /// <param name="assetName"> Gets the Job output asset name. </param>
 2028        internal MediaJobOutputAsset(string odataType, MediaJobError error, string label, long progress, MediaJobState s
 29        {
 2030            AssetName = assetName;
 2031            OdataType = odataType ?? "#Microsoft.Media.JobOutputAsset";
 2032        }
 33
 34        /// <summary> Gets the Job output asset name. </summary>
 835        public string AssetName { get; }
 36    }
 37}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobOutputAsset.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 MediaJobOutputAsset
 14    {
 15        internal static MediaJobOutputAsset DeserializeMediaJobOutputAsset(JsonElement element)
 16        {
 2017            Optional<string> assetName = default;
 2018            Optional<string> odataType = default;
 2019            Optional<MediaJobError> error = default;
 2020            Optional<string> label = default;
 2021            long progress = default;
 2022            MediaJobState state = default;
 27223            foreach (var property in element.EnumerateObject())
 24            {
 11625                if (property.NameEquals("assetName"))
 26                {
 2027                    assetName = property.Value.GetString();
 2028                    continue;
 29                }
 9630                if (property.NameEquals("@odata.type"))
 31                {
 2032                    odataType = property.Value.GetString();
 2033                    continue;
 34                }
 7635                if (property.NameEquals("error"))
 36                {
 1637                    error = MediaJobError.DeserializeMediaJobError(property.Value);
 1638                    continue;
 39                }
 6040                if (property.NameEquals("label"))
 41                {
 2042                    label = property.Value.GetString();
 2043                    continue;
 44                }
 4045                if (property.NameEquals("progress"))
 46                {
 2047                    progress = property.Value.GetInt64();
 2048                    continue;
 49                }
 2050                if (property.NameEquals("state"))
 51                {
 2052                    state = property.Value.GetString().ToMediaJobState();
 53                    continue;
 54                }
 55            }
 2056            return new MediaJobOutputAsset(odataType.Value, error.Value, label.Value, progress, state, assetName.Value);
 57        }
 58    }
 59}