< Summary

Class:Microsoft.Azure.Batch.ContainerConfiguration
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ContainerConfiguration.cs
Covered lines:33
Uncovered lines:2
Coverable lines:35
Total lines:138
Line coverage:94.2% (33 of 35)
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_ContainerImageNames()-100%100%
set_ContainerImageNames(...)-100%100%
get_ContainerRegistries()-100%100%
set_ContainerRegistries(...)-100%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-0%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.ContainerConfiguration>.GetTransportObject()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\ContainerConfiguration.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    /// The configuration for container-enabled pools.
 22    /// </summary>
 23    public partial class ContainerConfiguration : ITransportObjectProvider<Models.ContainerConfiguration>, IPropertyMeta
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<IList<string>> ContainerImageNamesProperty;
 28            public readonly PropertyAccessor<IList<ContainerRegistry>> ContainerRegistriesProperty;
 29
 23430            public PropertyContainer() : base(BindingState.Unbound)
 31            {
 23432                this.ContainerImageNamesProperty = this.CreatePropertyAccessor<IList<string>>(nameof(ContainerImageNames
 23433                this.ContainerRegistriesProperty = this.CreatePropertyAccessor<IList<ContainerRegistry>>(nameof(Containe
 23434            }
 35
 28436            public PropertyContainer(Models.ContainerConfiguration protocolObject) : base(BindingState.Bound)
 37            {
 28438                this.ContainerImageNamesProperty = this.CreatePropertyAccessor(
 97939                    UtilitiesInternal.CollectionToThreadSafeCollection(protocolObject.ContainerImageNames, o => o),
 28440                    nameof(ContainerImageNames),
 28441                    BindingAccess.Read);
 28442                this.ContainerRegistriesProperty = this.CreatePropertyAccessor(
 28443                    ContainerRegistry.ConvertFromProtocolCollectionAndFreeze(protocolObject.ContainerRegistries),
 28444                    nameof(ContainerRegistries),
 28445                    BindingAccess.Read);
 28446            }
 47        }
 48
 49        private readonly PropertyContainer propertyContainer;
 50
 51        #region Constructors
 52
 53        /// <summary>
 54        /// Initializes a new instance of the <see cref="ContainerConfiguration"/> class.
 55        /// </summary>
 23456        public ContainerConfiguration()
 57        {
 23458            this.propertyContainer = new PropertyContainer();
 23459        }
 60
 28461        internal ContainerConfiguration(Models.ContainerConfiguration protocolObject)
 62        {
 28463            this.propertyContainer = new PropertyContainer(protocolObject);
 28464        }
 65
 66        #endregion Constructors
 67
 68        #region ContainerConfiguration
 69
 70        /// <summary>
 71        /// Gets or sets the collection of container images.
 72        /// </summary>
 73        /// <remarks>
 74        /// This is the full image reference, as would be specified to "docker pull". An image will be sourced from the 
 75        /// Docker registry unless the image is fully qualified with an alternative registry.
 76        /// </remarks>
 77        public IList<string> ContainerImageNames
 78        {
 75179            get { return this.propertyContainer.ContainerImageNamesProperty.Value; }
 80            set
 81            {
 10682                this.propertyContainer.ContainerImageNamesProperty.Value = ConcurrentChangeTrackedList<string>.Transform
 10583            }
 84        }
 85
 86        /// <summary>
 87        /// Gets or sets additional private registries which containers can be pulled from.
 88        /// </summary>
 89        /// <remarks>
 90        /// If any images must be downloaded from a private registry which requires credentials, then those credentials 
 91        /// be provided here.
 92        /// </remarks>
 93        public IList<ContainerRegistry> ContainerRegistries
 94        {
 75195            get { return this.propertyContainer.ContainerRegistriesProperty.Value; }
 96            set
 97            {
 11198                this.propertyContainer.ContainerRegistriesProperty.Value = ConcurrentChangeTrackedModifiableList<Contain
 11099            }
 100        }
 101
 102        #endregion // ContainerConfiguration
 103
 104        #region IPropertyMetadata
 105
 106        bool IModifiable.HasBeenModified
 107        {
 0108            get { return this.propertyContainer.HasBeenModified; }
 109        }
 110
 111        bool IReadOnly.IsReadOnly
 112        {
 0113            get { return this.propertyContainer.IsReadOnly; }
 462114            set { this.propertyContainer.IsReadOnly = value; }
 115        }
 116
 117        #endregion //IPropertyMetadata
 118
 119        #region Internal/private methods
 120        /// <summary>
 121        /// Return a protocol object of the requested type.
 122        /// </summary>
 123        /// <returns>The protocol object of the requested type.</returns>
 124        Models.ContainerConfiguration ITransportObjectProvider<Models.ContainerConfiguration>.GetTransportObject()
 125        {
 233126            Models.ContainerConfiguration result = new Models.ContainerConfiguration()
 233127            {
 233128                ContainerImageNames = this.ContainerImageNames,
 233129                ContainerRegistries = UtilitiesInternal.ConvertToProtocolCollection(this.ContainerRegistries),
 233130            };
 131
 233132            return result;
 133        }
 134
 135
 136        #endregion // Internal/private methods
 137    }
 138}