| | | 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 | | |
| | | 13 | | namespace 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 | | |
| | 251 | 29 | | public PropertyContainer() : base(BindingState.Unbound) |
| | | 30 | | { |
| | 251 | 31 | | this.AccessProperty = this.CreatePropertyAccessor<Common.AccessScope>(nameof(Access), BindingAccess.Read |
| | 251 | 32 | | } |
| | | 33 | | |
| | 869 | 34 | | public PropertyContainer(Models.AuthenticationTokenSettings protocolObject) : base(BindingState.Bound) |
| | | 35 | | { |
| | 869 | 36 | | this.AccessProperty = this.CreatePropertyAccessor( |
| | 869 | 37 | | UtilitiesInternal.ParseAccessScope(protocolObject.Access), |
| | 869 | 38 | | nameof(Access), |
| | 869 | 39 | | BindingAccess.Read | BindingAccess.Write); |
| | 869 | 40 | | } |
| | | 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> |
| | 251 | 50 | | public AuthenticationTokenSettings() |
| | | 51 | | { |
| | 251 | 52 | | this.propertyContainer = new PropertyContainer(); |
| | 251 | 53 | | } |
| | | 54 | | |
| | 869 | 55 | | internal AuthenticationTokenSettings(Models.AuthenticationTokenSettings protocolObject) |
| | | 56 | | { |
| | 869 | 57 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| | 869 | 58 | | } |
| | | 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 | | { |
| | 1367 | 74 | | get { return this.propertyContainer.AccessProperty.Value; } |
| | 261 | 75 | | set { this.propertyContainer.AccessProperty.Value = value; } |
| | | 76 | | } |
| | | 77 | | |
| | | 78 | | #endregion // AuthenticationTokenSettings |
| | | 79 | | |
| | | 80 | | #region IPropertyMetadata |
| | | 81 | | |
| | | 82 | | bool IModifiable.HasBeenModified |
| | | 83 | | { |
| | 0 | 84 | | get { return this.propertyContainer.HasBeenModified; } |
| | | 85 | | } |
| | | 86 | | |
| | | 87 | | bool IReadOnly.IsReadOnly |
| | | 88 | | { |
| | 0 | 89 | | get { return this.propertyContainer.IsReadOnly; } |
| | 1502 | 90 | | 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 | | { |
| | 249 | 102 | | Models.AuthenticationTokenSettings result = new Models.AuthenticationTokenSettings() |
| | 249 | 103 | | { |
| | 249 | 104 | | Access = UtilitiesInternal.AccessScopeToList(this.Access), |
| | 249 | 105 | | }; |
| | | 106 | | |
| | 249 | 107 | | return result; |
| | | 108 | | } |
| | | 109 | | |
| | | 110 | | |
| | | 111 | | #endregion // Internal/private methods |
| | | 112 | | } |
| | | 113 | | } |