< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobError
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobError.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobError.Serialization.cs
Covered lines:33
Uncovered lines:6
Coverable lines:39
Total lines:107
Line coverage:84.6% (33 of 39)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Code()-100%100%
get_Message()-0%100%
get_Category()-100%100%
get_Retry()-0%100%
get_Details()-0%100%
DeserializeMediaJobError(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobError.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> Details of JobOutput errors. </summary>
 14    public partial class MediaJobError
 15    {
 16        /// <summary> Initializes a new instance of MediaJobError. </summary>
 017        internal MediaJobError()
 18        {
 019            Details = new ChangeTrackingList<MediaJobErrorDetail>();
 020        }
 21
 22        /// <summary> Initializes a new instance of MediaJobError. </summary>
 23        /// <param name="code"> Error code describing the error. </param>
 24        /// <param name="message"> A human-readable language-dependent representation of the error. </param>
 25        /// <param name="category"> Helps with categorization of errors. </param>
 26        /// <param name="retry"> Indicates that it may be possible to retry the Job. If retry is unsuccessful, please co
 27        /// <param name="details"> An array of details about specific errors that led to this reported error. </param>
 1628        internal MediaJobError(MediaJobErrorCode? code, string message, MediaJobErrorCategory? category, MediaJobRetry? 
 29        {
 1630            Code = code;
 1631            Message = message;
 1632            Category = category;
 1633            Retry = retry;
 1634            Details = details;
 1635        }
 36
 37        /// <summary> Error code describing the error. </summary>
 438        public MediaJobErrorCode? Code { get; }
 39        /// <summary> A human-readable language-dependent representation of the error. </summary>
 040        public string Message { get; }
 41        /// <summary> Helps with categorization of errors. </summary>
 442        public MediaJobErrorCategory? Category { get; }
 43        /// <summary> Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact Azure
 044        public MediaJobRetry? Retry { get; }
 45        /// <summary> An array of details about specific errors that led to this reported error. </summary>
 046        public IReadOnlyList<MediaJobErrorDetail> Details { get; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobError.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 MediaJobError
 15    {
 16        internal static MediaJobError DeserializeMediaJobError(JsonElement element)
 17        {
 1618            Optional<MediaJobErrorCode> code = default;
 1619            Optional<string> message = default;
 1620            Optional<MediaJobErrorCategory> category = default;
 1621            Optional<MediaJobRetry> retry = default;
 1622            Optional<IReadOnlyList<MediaJobErrorDetail>> details = default;
 19223            foreach (var property in element.EnumerateObject())
 24            {
 8025                if (property.NameEquals("code"))
 26                {
 1627                    code = property.Value.GetString().ToMediaJobErrorCode();
 1628                    continue;
 29                }
 6430                if (property.NameEquals("message"))
 31                {
 1632                    message = property.Value.GetString();
 1633                    continue;
 34                }
 4835                if (property.NameEquals("category"))
 36                {
 1637                    category = property.Value.GetString().ToMediaJobErrorCategory();
 1638                    continue;
 39                }
 3240                if (property.NameEquals("retry"))
 41                {
 1642                    retry = property.Value.GetString().ToMediaJobRetry();
 1643                    continue;
 44                }
 1645                if (property.NameEquals("details"))
 46                {
 1647                    List<MediaJobErrorDetail> array = new List<MediaJobErrorDetail>();
 6448                    foreach (var item in property.Value.EnumerateArray())
 49                    {
 1650                        array.Add(MediaJobErrorDetail.DeserializeMediaJobErrorDetail(item));
 51                    }
 1652                    details = array;
 53                    continue;
 54                }
 55            }
 1656            return new MediaJobError(Optional.ToNullable(code), message.Value, Optional.ToNullable(category), Optional.T
 57        }
 58    }
 59}