< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.ComputeNodeReimageOptionEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\ComputeNodeReimageOption.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:94
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%
ParseComputeNodeReimageOption(...)-0%0%

File(s)

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