< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.ComputeNodeDeallocationOptionEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\ComputeNodeDeallocationOption.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:92
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:15
Branch coverage:0% (0 of 15)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\ComputeNodeDeallocationOption.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 ComputeNodeDeallocationOption.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum ComputeNodeDeallocationOption
 23    {
 24        /// <summary>
 25        /// Terminate running Task processes and requeue the Tasks. The Tasks
 26        /// will run again when a Compute Node is available. Remove Compute
 27        /// Nodes as soon as Tasks have been terminated.
 28        /// </summary>
 29        [EnumMember(Value = "requeue")]
 30        Requeue,
 31        /// <summary>
 32        /// Terminate running Tasks. The Tasks will be completed with
 33        /// failureInfo indicating that they were terminated, and will not run
 34        /// again. Remove Compute Nodes as soon as Tasks have been terminated.
 35        /// </summary>
 36        [EnumMember(Value = "terminate")]
 37        Terminate,
 38        /// <summary>
 39        /// Allow currently running Tasks to complete. Schedule no new Tasks
 40        /// while waiting. Remove Compute Nodes when all Tasks have completed.
 41        /// </summary>
 42        [EnumMember(Value = "taskcompletion")]
 43        TaskCompletion,
 44        /// <summary>
 45        /// Allow currently running Tasks to complete, then wait for all Task
 46        /// data retention periods to expire. Schedule no new Tasks while
 47        /// waiting. Remove Compute Nodes when all Task retention periods have
 48        /// expired.
 49        /// </summary>
 50        [EnumMember(Value = "retaineddata")]
 51        RetainedData
 52    }
 53    internal static class ComputeNodeDeallocationOptionEnumExtension
 54    {
 55        internal static string ToSerializedValue(this ComputeNodeDeallocationOption? value)
 56        {
 057            return value == null ? null : ((ComputeNodeDeallocationOption)value).ToSerializedValue();
 58        }
 59
 60        internal static string ToSerializedValue(this ComputeNodeDeallocationOption value)
 61        {
 62            switch( value )
 63            {
 64                case ComputeNodeDeallocationOption.Requeue:
 065                    return "requeue";
 66                case ComputeNodeDeallocationOption.Terminate:
 067                    return "terminate";
 68                case ComputeNodeDeallocationOption.TaskCompletion:
 069                    return "taskcompletion";
 70                case ComputeNodeDeallocationOption.RetainedData:
 071                    return "retaineddata";
 72            }
 073            return null;
 74        }
 75
 76        internal static ComputeNodeDeallocationOption? ParseComputeNodeDeallocationOption(this string value)
 77        {
 78            switch( value )
 79            {
 80                case "requeue":
 081                    return ComputeNodeDeallocationOption.Requeue;
 82                case "terminate":
 083                    return ComputeNodeDeallocationOption.Terminate;
 84                case "taskcompletion":
 085                    return ComputeNodeDeallocationOption.TaskCompletion;
 86                case "retaineddata":
 087                    return ComputeNodeDeallocationOption.RetainedData;
 88            }
 089            return null;
 90        }
 91    }
 92}