< Summary

Class:Microsoft.Azure.EventGrid.Models.MediaJobStateEnumExtension
Assembly:Microsoft.Azure.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Microsoft.Azure.EventGrid\src\Generated\Models\MediaJobState.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:115
Line coverage:0% (0 of 17)
Covered branches:0
Total branches:42
Branch coverage:0% (0 of 42)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerializedValue(...)-0%0%
ToSerializedValue(...)-0%0%
ParseMediaJobState(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Microsoft.Azure.EventGrid\src\Generated\Models\MediaJobState.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.EventGrid.Models
 12{
 13    using Newtonsoft.Json;
 14    using Newtonsoft.Json.Converters;
 15    using System.Runtime;
 16    using System.Runtime.Serialization;
 17
 18    /// <summary>
 19    /// Defines values for MediaJobState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum MediaJobState
 23    {
 24        /// <summary>
 25        /// The job was canceled. This is a final state for the job.
 26        /// </summary>
 27        [EnumMember(Value = "Canceled")]
 28        Canceled,
 29        /// <summary>
 30        /// The job is in the process of being canceled. This is a transient
 31        /// state for the job.
 32        /// </summary>
 33        [EnumMember(Value = "Canceling")]
 34        Canceling,
 35        /// <summary>
 36        /// The job has encountered an error. This is a final state for the
 37        /// job.
 38        /// </summary>
 39        [EnumMember(Value = "Error")]
 40        Error,
 41        /// <summary>
 42        /// The job is finished. This is a final state for the job.
 43        /// </summary>
 44        [EnumMember(Value = "Finished")]
 45        Finished,
 46        /// <summary>
 47        /// The job is processing. This is a transient state for the job.
 48        /// </summary>
 49        [EnumMember(Value = "Processing")]
 50        Processing,
 51        /// <summary>
 52        /// The job is in a queued state, waiting for resources to become
 53        /// available. This is a transient state.
 54        /// </summary>
 55        [EnumMember(Value = "Queued")]
 56        Queued,
 57        /// <summary>
 58        /// The job is being scheduled to run on an available resource. This is
 59        /// a transient state, between queued and processing states.
 60        /// </summary>
 61        [EnumMember(Value = "Scheduled")]
 62        Scheduled
 63    }
 64    internal static class MediaJobStateEnumExtension
 65    {
 66        internal static string ToSerializedValue(this MediaJobState? value)
 67        {
 068            return value == null ? null : ((MediaJobState)value).ToSerializedValue();
 69        }
 70
 71        internal static string ToSerializedValue(this MediaJobState value)
 72        {
 73            switch( value )
 74            {
 75                case MediaJobState.Canceled:
 076                    return "Canceled";
 77                case MediaJobState.Canceling:
 078                    return "Canceling";
 79                case MediaJobState.Error:
 080                    return "Error";
 81                case MediaJobState.Finished:
 082                    return "Finished";
 83                case MediaJobState.Processing:
 084                    return "Processing";
 85                case MediaJobState.Queued:
 086                    return "Queued";
 87                case MediaJobState.Scheduled:
 088                    return "Scheduled";
 89            }
 090            return null;
 91        }
 92
 93        internal static MediaJobState? ParseMediaJobState(this string value)
 94        {
 95            switch( value )
 96            {
 97                case "Canceled":
 098                    return MediaJobState.Canceled;
 99                case "Canceling":
 0100                    return MediaJobState.Canceling;
 101                case "Error":
 0102                    return MediaJobState.Error;
 103                case "Finished":
 0104                    return MediaJobState.Finished;
 105                case "Processing":
 0106                    return MediaJobState.Processing;
 107                case "Queued":
 0108                    return MediaJobState.Queued;
 109                case "Scheduled":
 0110                    return MediaJobState.Scheduled;
 111            }
 0112            return null;
 113        }
 114    }
 115}