| | | 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 | | /// 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 | | |
| | 218 | 33 | | public PropertyContainer() : base(BindingState.Unbound) |
| | | 34 | | { |
| | 218 | 35 | | this.AutoPoolIdPrefixProperty = this.CreatePropertyAccessor<string>(nameof(AutoPoolIdPrefix), BindingAcc |
| | 218 | 36 | | this.KeepAliveProperty = this.CreatePropertyAccessor<bool?>(nameof(KeepAlive), BindingAccess.Read | Bind |
| | 218 | 37 | | this.PoolLifetimeOptionProperty = this.CreatePropertyAccessor<Common.PoolLifetimeOption>(nameof(PoolLife |
| | 218 | 38 | | this.PoolSpecificationProperty = this.CreatePropertyAccessor<PoolSpecification>(nameof(PoolSpecification |
| | 218 | 39 | | } |
| | | 40 | | |
| | 387 | 41 | | public PropertyContainer(Models.AutoPoolSpecification protocolObject) : base(BindingState.Bound) |
| | | 42 | | { |
| | 387 | 43 | | this.AutoPoolIdPrefixProperty = this.CreatePropertyAccessor( |
| | 387 | 44 | | protocolObject.AutoPoolIdPrefix, |
| | 387 | 45 | | nameof(AutoPoolIdPrefix), |
| | 387 | 46 | | BindingAccess.Read | BindingAccess.Write); |
| | 387 | 47 | | this.KeepAliveProperty = this.CreatePropertyAccessor( |
| | 387 | 48 | | protocolObject.KeepAlive, |
| | 387 | 49 | | nameof(KeepAlive), |
| | 387 | 50 | | BindingAccess.Read | BindingAccess.Write); |
| | 387 | 51 | | this.PoolLifetimeOptionProperty = this.CreatePropertyAccessor( |
| | 387 | 52 | | UtilitiesInternal.MapEnum<Models.PoolLifetimeOption, Common.PoolLifetimeOption>(protocolObject.PoolL |
| | 387 | 53 | | nameof(PoolLifetimeOption), |
| | 387 | 54 | | BindingAccess.Read | BindingAccess.Write); |
| | 387 | 55 | | this.PoolSpecificationProperty = this.CreatePropertyAccessor( |
| | 585 | 56 | | UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Pool, o => new PoolSpecification(o)), |
| | 387 | 57 | | nameof(PoolSpecification), |
| | 387 | 58 | | BindingAccess.Read | BindingAccess.Write); |
| | 387 | 59 | | } |
| | | 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> |
| | 218 | 69 | | public AutoPoolSpecification() |
| | | 70 | | { |
| | 218 | 71 | | this.propertyContainer = new PropertyContainer(); |
| | 218 | 72 | | } |
| | | 73 | | |
| | 387 | 74 | | internal AutoPoolSpecification(Models.AutoPoolSpecification protocolObject) |
| | | 75 | | { |
| | 387 | 76 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| | 387 | 77 | | } |
| | | 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 | | { |
| | 813 | 92 | | get { return this.propertyContainer.AutoPoolIdPrefixProperty.Value; } |
| | 206 | 93 | | 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 | | { |
| | 814 | 104 | | get { return this.propertyContainer.KeepAliveProperty.Value; } |
| | 218 | 105 | | 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 | | { |
| | 813 | 117 | | get { return this.propertyContainer.PoolLifetimeOptionProperty.Value; } |
| | 212 | 118 | | 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 | | { |
| | 826 | 126 | | get { return this.propertyContainer.PoolSpecificationProperty.Value; } |
| | 218 | 127 | | set { this.propertyContainer.PoolSpecificationProperty.Value = value; } |
| | | 128 | | } |
| | | 129 | | |
| | | 130 | | #endregion // AutoPoolSpecification |
| | | 131 | | |
| | | 132 | | #region IPropertyMetadata |
| | | 133 | | |
| | | 134 | | bool IModifiable.HasBeenModified |
| | | 135 | | { |
| | 6 | 136 | | get { return this.propertyContainer.HasBeenModified; } |
| | | 137 | | } |
| | | 138 | | |
| | | 139 | | bool IReadOnly.IsReadOnly |
| | | 140 | | { |
| | 0 | 141 | | get { return this.propertyContainer.IsReadOnly; } |
| | 10 | 142 | | 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 | | { |
| | 215 | 154 | | Models.AutoPoolSpecification result = new Models.AutoPoolSpecification() |
| | 215 | 155 | | { |
| | 215 | 156 | | AutoPoolIdPrefix = this.AutoPoolIdPrefix, |
| | 215 | 157 | | KeepAlive = this.KeepAlive, |
| | 215 | 158 | | PoolLifetimeOption = UtilitiesInternal.MapEnum<Common.PoolLifetimeOption, Models.PoolLifetimeOption>(thi |
| | 321 | 159 | | Pool = UtilitiesInternal.CreateObjectWithNullCheck(this.PoolSpecification, (o) => o.GetTransportObject() |
| | 215 | 160 | | }; |
| | | 161 | | |
| | 215 | 162 | | return result; |
| | | 163 | | } |
| | | 164 | | |
| | | 165 | | |
| | | 166 | | #endregion // Internal/private methods |
| | | 167 | | } |
| | | 168 | | } |