< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.IPAddressProvisioningTypeEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\IPAddressProvisioningType.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:77
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\IPAddressProvisioningType.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 IPAddressProvisioningType.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum IPAddressProvisioningType
 23    {
 24        /// <summary>
 25        /// A public IP will be created and managed by Batch. There may be
 26        /// multiple public IPs depending on the size of the Pool.
 27        /// </summary>
 28        [EnumMember(Value = "batchmanaged")]
 29        BatchManaged,
 30        /// <summary>
 31        /// Public IPs are provided by the user and will be used to provision
 32        /// the Compute Nodes.
 33        /// </summary>
 34        [EnumMember(Value = "usermanaged")]
 35        UserManaged,
 36        /// <summary>
 37        /// No public IP Address will be created.
 38        /// </summary>
 39        [EnumMember(Value = "nopublicipaddresses")]
 40        NoPublicIPAddresses
 41    }
 42    internal static class IPAddressProvisioningTypeEnumExtension
 43    {
 44        internal static string ToSerializedValue(this IPAddressProvisioningType? value)
 45        {
 046            return value == null ? null : ((IPAddressProvisioningType)value).ToSerializedValue();
 47        }
 48
 49        internal static string ToSerializedValue(this IPAddressProvisioningType value)
 50        {
 51            switch( value )
 52            {
 53                case IPAddressProvisioningType.BatchManaged:
 054                    return "batchmanaged";
 55                case IPAddressProvisioningType.UserManaged:
 056                    return "usermanaged";
 57                case IPAddressProvisioningType.NoPublicIPAddresses:
 058                    return "nopublicipaddresses";
 59            }
 060            return null;
 61        }
 62
 63        internal static IPAddressProvisioningType? ParseIPAddressProvisioningType(this string value)
 64        {
 65            switch( value )
 66            {
 67                case "batchmanaged":
 068                    return IPAddressProvisioningType.BatchManaged;
 69                case "usermanaged":
 070                    return IPAddressProvisioningType.UserManaged;
 71                case "nopublicipaddresses":
 072                    return IPAddressProvisioningType.NoPublicIPAddresses;
 73            }
 074            return null;
 75        }
 76    }
 77}