< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.JobScheduleStateEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobScheduleState.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:105
Line coverage:0% (0 of 13)
Covered branches:0
Total branches:18
Branch coverage:0% (0 of 18)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobScheduleState.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 JobScheduleState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum JobScheduleState
 23    {
 24        /// <summary>
 25        /// The Job Schedule is active and will create Jobs as per its
 26        /// schedule.
 27        /// </summary>
 28        [EnumMember(Value = "active")]
 29        Active,
 30        /// <summary>
 31        /// The Job Schedule has terminated, either by reaching its end time or
 32        /// by the user terminating it explicitly.
 33        /// </summary>
 34        [EnumMember(Value = "completed")]
 35        Completed,
 36        /// <summary>
 37        /// The user has disabled the Job Schedule. The scheduler will not
 38        /// initiate any new Jobs will on this schedule, but any existing
 39        /// active Job will continue to run.
 40        /// </summary>
 41        [EnumMember(Value = "disabled")]
 42        Disabled,
 43        /// <summary>
 44        /// The Job Schedule has no more work to do, or has been explicitly
 45        /// terminated by the user, but the termination operation is still in
 46        /// progress. The scheduler will not initiate any new Jobs for this Job
 47        /// Schedule, nor is any existing Job active.
 48        /// </summary>
 49        [EnumMember(Value = "terminating")]
 50        Terminating,
 51        /// <summary>
 52        /// The user has requested that the Job Schedule be deleted, but the
 53        /// delete operation is still in progress. The scheduler will not
 54        /// initiate any new Jobs for this Job Schedule, and will delete any
 55        /// existing Jobs and Tasks under the Job Schedule, including any
 56        /// active Job. The Job Schedule will be deleted when all Jobs and
 57        /// Tasks under the Job Schedule have been deleted.
 58        /// </summary>
 59        [EnumMember(Value = "deleting")]
 60        Deleting
 61    }
 62    internal static class JobScheduleStateEnumExtension
 63    {
 64        internal static string ToSerializedValue(this JobScheduleState? value)
 65        {
 066            return value == null ? null : ((JobScheduleState)value).ToSerializedValue();
 67        }
 68
 69        internal static string ToSerializedValue(this JobScheduleState value)
 70        {
 71            switch( value )
 72            {
 73                case JobScheduleState.Active:
 074                    return "active";
 75                case JobScheduleState.Completed:
 076                    return "completed";
 77                case JobScheduleState.Disabled:
 078                    return "disabled";
 79                case JobScheduleState.Terminating:
 080                    return "terminating";
 81                case JobScheduleState.Deleting:
 082                    return "deleting";
 83            }
 084            return null;
 85        }
 86
 87        internal static JobScheduleState? ParseJobScheduleState(this string value)
 88        {
 89            switch( value )
 90            {
 91                case "active":
 092                    return JobScheduleState.Active;
 93                case "completed":
 094                    return JobScheduleState.Completed;
 95                case "disabled":
 096                    return JobScheduleState.Disabled;
 97                case "terminating":
 098                    return JobScheduleState.Terminating;
 99                case "deleting":
 0100                    return JobScheduleState.Deleting;
 101            }
 0102            return null;
 103        }
 104    }
 105}