< Summary

Class:Microsoft.Azure.Batch.AutoPoolSpecification
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\AutoPoolSpecification.cs
Covered lines:48
Uncovered lines:1
Coverable lines:49
Total lines:168
Line coverage:97.9% (48 of 49)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
get_AutoPoolIdPrefix()-100%100%
set_AutoPoolIdPrefix(...)-100%100%
get_KeepAlive()-100%100%
set_KeepAlive(...)-100%100%
get_PoolLifetimeOption()-100%100%
set_PoolLifetimeOption(...)-100%100%
get_PoolSpecification()-100%100%
set_PoolSpecification(...)-100%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-100%100%
Microsoft.Azure.Batch.IReadOnly.get_IsReadOnly()-0%100%
Microsoft.Azure.Batch.IReadOnly.set_IsReadOnly(...)-100%100%
Microsoft.Azure.Batch.ITransportObjectProvider<Microsoft.Azure.Batch.Protocol.Models.AutoPoolSpecification>.GetTransportObject()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\AutoPoolSpecification.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for license information.
 3//
 4// Code generated by Microsoft (R) AutoRest Code Generator.
 5// Changes may cause incorrect behavior and will be lost if the code is
 6// regenerated.
 7
 8//
 9// This file was autogenerated by a tool.
 10// Do not modify it.
 11//
 12
 13namespace Microsoft.Azure.Batch
 14{
 15    using Models = Microsoft.Azure.Batch.Protocol.Models;
 16    using System;
 17    using System.Collections.Generic;
 18    using System.Linq;
 19
 20    /// <summary>
 21    /// Specifies characteristics for a temporary 'auto pool'. The Batch service will create this auto pool, run all the
 22    /// tasks for the job on it, and by default delete the pool once the job has completed.
 23    /// </summary>
 24    public partial class AutoPoolSpecification : ITransportObjectProvider<Models.AutoPoolSpecification>, IPropertyMetada
 25    {
 26        private class PropertyContainer : PropertyCollection
 27        {
 28            public readonly PropertyAccessor<string> AutoPoolIdPrefixProperty;
 29            public readonly PropertyAccessor<bool?> KeepAliveProperty;
 30            public readonly PropertyAccessor<Common.PoolLifetimeOption> PoolLifetimeOptionProperty;
 31            public readonly PropertyAccessor<PoolSpecification> PoolSpecificationProperty;
 32
 21833            public PropertyContainer() : base(BindingState.Unbound)
 34            {
 21835                this.AutoPoolIdPrefixProperty = this.CreatePropertyAccessor<string>(nameof(AutoPoolIdPrefix), BindingAcc
 21836                this.KeepAliveProperty = this.CreatePropertyAccessor<bool?>(nameof(KeepAlive), BindingAccess.Read | Bind
 21837                this.PoolLifetimeOptionProperty = this.CreatePropertyAccessor<Common.PoolLifetimeOption>(nameof(PoolLife
 21838                this.PoolSpecificationProperty = this.CreatePropertyAccessor<PoolSpecification>(nameof(PoolSpecification
 21839            }
 40
 38741            public PropertyContainer(Models.AutoPoolSpecification protocolObject) : base(BindingState.Bound)
 42            {
 38743                this.AutoPoolIdPrefixProperty = this.CreatePropertyAccessor(
 38744                    protocolObject.AutoPoolIdPrefix,
 38745                    nameof(AutoPoolIdPrefix),
 38746                    BindingAccess.Read | BindingAccess.Write);
 38747                this.KeepAliveProperty = this.CreatePropertyAccessor(
 38748                    protocolObject.KeepAlive,
 38749                    nameof(KeepAlive),
 38750                    BindingAccess.Read | BindingAccess.Write);
 38751                this.PoolLifetimeOptionProperty = this.CreatePropertyAccessor(
 38752                    UtilitiesInternal.MapEnum<Models.PoolLifetimeOption, Common.PoolLifetimeOption>(protocolObject.PoolL
 38753                    nameof(PoolLifetimeOption),
 38754                    BindingAccess.Read | BindingAccess.Write);
 38755                this.PoolSpecificationProperty = this.CreatePropertyAccessor(
 58556                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Pool, o => new PoolSpecification(o)),
 38757                    nameof(PoolSpecification),
 38758                    BindingAccess.Read | BindingAccess.Write);
 38759            }
 60        }
 61
 62        private readonly PropertyContainer propertyContainer;
 63
 64        #region Constructors
 65
 66        /// <summary>
 67        /// Initializes a new instance of the <see cref="AutoPoolSpecification"/> class.
 68        /// </summary>
 21869        public AutoPoolSpecification()
 70        {
 21871            this.propertyContainer = new PropertyContainer();
 21872        }
 73
 38774        internal AutoPoolSpecification(Models.AutoPoolSpecification protocolObject)
 75        {
 38776            this.propertyContainer = new PropertyContainer(protocolObject);
 38777        }
 78
 79        #endregion Constructors
 80
 81        #region AutoPoolSpecification
 82
 83        /// <summary>
 84        /// Gets or sets a prefix to be added to the unique identifier when a pool is automatically created.
 85        /// </summary>
 86        /// <remarks>
 87        /// The prefix is optional. If present, it can be up to 20 characters long and must adhere to the usual rules fo
 88        /// ids (alphanumeric characters, hyphens and underscores only).
 89        /// </remarks>
 90        public string AutoPoolIdPrefix
 91        {
 81392            get { return this.propertyContainer.AutoPoolIdPrefixProperty.Value; }
 20693            set { this.propertyContainer.AutoPoolIdPrefixProperty.Value = value; }
 94        }
 95
 96        /// <summary>
 97        /// Gets or sets whether to keep the auto pool alive after its <see cref="PoolLifetimeOption"/> expires.
 98        /// </summary>
 99        /// <remarks>
 100        /// The default value is false.
 101        /// </remarks>
 102        public bool? KeepAlive
 103        {
 814104            get { return this.propertyContainer.KeepAliveProperty.Value; }
 218105            set { this.propertyContainer.KeepAliveProperty.Value = value; }
 106        }
 107
 108        /// <summary>
 109        /// Gets or sets the minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to
 110        /// pools.
 111        /// </summary>
 112        /// <remarks>
 113        /// An auto pool may live longer than its PoolLifetimeOption if <see cref="KeepAlive"/> is set.
 114        /// </remarks>
 115        public Common.PoolLifetimeOption PoolLifetimeOption
 116        {
 813117            get { return this.propertyContainer.PoolLifetimeOptionProperty.Value; }
 212118            set { this.propertyContainer.PoolLifetimeOptionProperty.Value = value; }
 119        }
 120
 121        /// <summary>
 122        /// Gets or sets the pool specification for the auto pool.
 123        /// </summary>
 124        public PoolSpecification PoolSpecification
 125        {
 826126            get { return this.propertyContainer.PoolSpecificationProperty.Value; }
 218127            set { this.propertyContainer.PoolSpecificationProperty.Value = value; }
 128        }
 129
 130        #endregion // AutoPoolSpecification
 131
 132        #region IPropertyMetadata
 133
 134        bool IModifiable.HasBeenModified
 135        {
 6136            get { return this.propertyContainer.HasBeenModified; }
 137        }
 138
 139        bool IReadOnly.IsReadOnly
 140        {
 0141            get { return this.propertyContainer.IsReadOnly; }
 10142            set { this.propertyContainer.IsReadOnly = value; }
 143        }
 144
 145        #endregion //IPropertyMetadata
 146
 147        #region Internal/private methods
 148        /// <summary>
 149        /// Return a protocol object of the requested type.
 150        /// </summary>
 151        /// <returns>The protocol object of the requested type.</returns>
 152        Models.AutoPoolSpecification ITransportObjectProvider<Models.AutoPoolSpecification>.GetTransportObject()
 153        {
 215154            Models.AutoPoolSpecification result = new Models.AutoPoolSpecification()
 215155            {
 215156                AutoPoolIdPrefix = this.AutoPoolIdPrefix,
 215157                KeepAlive = this.KeepAlive,
 215158                PoolLifetimeOption = UtilitiesInternal.MapEnum<Common.PoolLifetimeOption, Models.PoolLifetimeOption>(thi
 321159                Pool = UtilitiesInternal.CreateObjectWithNullCheck(this.PoolSpecification, (o) => o.GetTransportObject()
 215160            };
 161
 215162            return result;
 163        }
 164
 165
 166        #endregion // Internal/private methods
 167    }
 168}