< Summary

Class:Microsoft.Azure.Batch.AuthenticationTokenSettings
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\AuthenticationTokenSettings.cs
Covered lines:23
Uncovered lines:2
Coverable lines:25
Total lines:113
Line coverage:92% (23 of 25)
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_Access()-100%100%
set_Access(...)-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.AuthenticationTokenSettings>.GetTransportObject()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\AuthenticationTokenSettings.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 settings for an authentication token that the task can use to perform Batch service operations.
 22    /// </summary>
 23    public partial class AuthenticationTokenSettings : ITransportObjectProvider<Models.AuthenticationTokenSettings>, IPr
 24    {
 25        private class PropertyContainer : PropertyCollection
 26        {
 27            public readonly PropertyAccessor<Common.AccessScope> AccessProperty;
 28
 25129            public PropertyContainer() : base(BindingState.Unbound)
 30            {
 25131                this.AccessProperty = this.CreatePropertyAccessor<Common.AccessScope>(nameof(Access), BindingAccess.Read
 25132            }
 33
 86934            public PropertyContainer(Models.AuthenticationTokenSettings protocolObject) : base(BindingState.Bound)
 35            {
 86936                this.AccessProperty = this.CreatePropertyAccessor(
 86937                    UtilitiesInternal.ParseAccessScope(protocolObject.Access),
 86938                    nameof(Access),
 86939                    BindingAccess.Read | BindingAccess.Write);
 86940            }
 41        }
 42
 43        private readonly PropertyContainer propertyContainer;
 44
 45        #region Constructors
 46
 47        /// <summary>
 48        /// Initializes a new instance of the <see cref="AuthenticationTokenSettings"/> class.
 49        /// </summary>
 25150        public AuthenticationTokenSettings()
 51        {
 25152            this.propertyContainer = new PropertyContainer();
 25153        }
 54
 86955        internal AuthenticationTokenSettings(Models.AuthenticationTokenSettings protocolObject)
 56        {
 86957            this.propertyContainer = new PropertyContainer(protocolObject);
 86958        }
 59
 60        #endregion Constructors
 61
 62        #region AuthenticationTokenSettings
 63
 64        /// <summary>
 65        /// Gets or sets the Batch resources to which the token grants access.
 66        /// </summary>
 67        /// <remarks>
 68        /// The authentication token grants access only to a limited set of Batch service operations. Currently the only
 69        /// supported value for the Access property is <see cref="Common.AccessScope.Job"/>, which grants access to all 
 70        /// related to the job which contains the task.
 71        /// </remarks>
 72        public Common.AccessScope Access
 73        {
 136774            get { return this.propertyContainer.AccessProperty.Value; }
 26175            set { this.propertyContainer.AccessProperty.Value = value; }
 76        }
 77
 78        #endregion // AuthenticationTokenSettings
 79
 80        #region IPropertyMetadata
 81
 82        bool IModifiable.HasBeenModified
 83        {
 084            get { return this.propertyContainer.HasBeenModified; }
 85        }
 86
 87        bool IReadOnly.IsReadOnly
 88        {
 089            get { return this.propertyContainer.IsReadOnly; }
 150290            set { this.propertyContainer.IsReadOnly = value; }
 91        }
 92
 93        #endregion //IPropertyMetadata
 94
 95        #region Internal/private methods
 96        /// <summary>
 97        /// Return a protocol object of the requested type.
 98        /// </summary>
 99        /// <returns>The protocol object of the requested type.</returns>
 100        Models.AuthenticationTokenSettings ITransportObjectProvider<Models.AuthenticationTokenSettings>.GetTransportObje
 101        {
 249102            Models.AuthenticationTokenSettings result = new Models.AuthenticationTokenSettings()
 249103            {
 249104                Access = UtilitiesInternal.AccessScopeToList(this.Access),
 249105            };
 106
 249107            return result;
 108        }
 109
 110
 111        #endregion // Internal/private methods
 112    }
 113}