< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.JobStateEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobState.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:121
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%
ParseJobState(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobState.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.Batch.Protocol.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 JobState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum JobState
 23    {
 24        /// <summary>
 25        /// The Job is available to have Tasks scheduled.
 26        /// </summary>
 27        [EnumMember(Value = "active")]
 28        Active,
 29        /// <summary>
 30        /// A user has requested that the Job be disabled, but the disable
 31        /// operation is still in progress (for example, waiting for Tasks to
 32        /// terminate).
 33        /// </summary>
 34        [EnumMember(Value = "disabling")]
 35        Disabling,
 36        /// <summary>
 37        /// A user has disabled the Job. No Tasks are running, and no new Tasks
 38        /// will be scheduled.
 39        /// </summary>
 40        [EnumMember(Value = "disabled")]
 41        Disabled,
 42        /// <summary>
 43        /// A user has requested that the Job be enabled, but the enable
 44        /// operation is still in progress.
 45        /// </summary>
 46        [EnumMember(Value = "enabling")]
 47        Enabling,
 48        /// <summary>
 49        /// The Job is about to complete, either because a Job Manager Task has
 50        /// completed or because the user has terminated the Job, but the
 51        /// terminate operation is still in progress (for example, because Job
 52        /// Release Tasks are running).
 53        /// </summary>
 54        [EnumMember(Value = "terminating")]
 55        Terminating,
 56        /// <summary>
 57        /// All Tasks have terminated, and the system will not accept any more
 58        /// Tasks or any further changes to the Job.
 59        /// </summary>
 60        [EnumMember(Value = "completed")]
 61        Completed,
 62        /// <summary>
 63        /// A user has requested that the Job be deleted, but the delete
 64        /// operation is still in progress (for example, because the system is
 65        /// still terminating running Tasks).
 66        /// </summary>
 67        [EnumMember(Value = "deleting")]
 68        Deleting
 69    }
 70    internal static class JobStateEnumExtension
 71    {
 72        internal static string ToSerializedValue(this JobState? value)
 73        {
 074            return value == null ? null : ((JobState)value).ToSerializedValue();
 75        }
 76
 77        internal static string ToSerializedValue(this JobState value)
 78        {
 79            switch( value )
 80            {
 81                case JobState.Active:
 082                    return "active";
 83                case JobState.Disabling:
 084                    return "disabling";
 85                case JobState.Disabled:
 086                    return "disabled";
 87                case JobState.Enabling:
 088                    return "enabling";
 89                case JobState.Terminating:
 090                    return "terminating";
 91                case JobState.Completed:
 092                    return "completed";
 93                case JobState.Deleting:
 094                    return "deleting";
 95            }
 096            return null;
 97        }
 98
 99        internal static JobState? ParseJobState(this string value)
 100        {
 101            switch( value )
 102            {
 103                case "active":
 0104                    return JobState.Active;
 105                case "disabling":
 0106                    return JobState.Disabling;
 107                case "disabled":
 0108                    return JobState.Disabled;
 109                case "enabling":
 0110                    return JobState.Enabling;
 111                case "terminating":
 0112                    return JobState.Terminating;
 113                case "completed":
 0114                    return JobState.Completed;
 115                case "deleting":
 0116                    return JobState.Deleting;
 117            }
 0118            return null;
 119        }
 120    }
 121}