| | 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 the execution constraints for a job. |
| | 22 | | /// </summary> |
| | 23 | | public partial class JobConstraints : ITransportObjectProvider<Models.JobConstraints>, IPropertyMetadata |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<int?> MaxTaskRetryCountProperty; |
| | 28 | | public readonly PropertyAccessor<TimeSpan?> MaxWallClockTimeProperty; |
| | 29 | |
|
| 218 | 30 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 31 | | { |
| 218 | 32 | | this.MaxTaskRetryCountProperty = this.CreatePropertyAccessor<int?>(nameof(MaxTaskRetryCount), BindingAcc |
| 218 | 33 | | this.MaxWallClockTimeProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(MaxWallClockTime), Binding |
| 218 | 34 | | } |
| | 35 | |
|
| 750 | 36 | | public PropertyContainer(Models.JobConstraints protocolObject) : base(BindingState.Bound) |
| | 37 | | { |
| 750 | 38 | | this.MaxTaskRetryCountProperty = this.CreatePropertyAccessor( |
| 750 | 39 | | protocolObject.MaxTaskRetryCount, |
| 750 | 40 | | nameof(MaxTaskRetryCount), |
| 750 | 41 | | BindingAccess.Read | BindingAccess.Write); |
| 750 | 42 | | this.MaxWallClockTimeProperty = this.CreatePropertyAccessor( |
| 750 | 43 | | protocolObject.MaxWallClockTime, |
| 750 | 44 | | nameof(MaxWallClockTime), |
| 750 | 45 | | BindingAccess.Read | BindingAccess.Write); |
| 750 | 46 | | } |
| | 47 | | } |
| | 48 | |
|
| | 49 | | private readonly PropertyContainer propertyContainer; |
| | 50 | |
|
| | 51 | | #region Constructors |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// Initializes a new instance of the <see cref="JobConstraints"/> class. |
| | 55 | | /// </summary> |
| | 56 | | /// <param name='maxWallClockTime'>The maximum elapsed time that the job may run, measured from the time the job |
| | 57 | | /// <param name='maxTaskRetryCount'>The maximum number of times each task may be retried.</param> |
| 218 | 58 | | public JobConstraints( |
| 218 | 59 | | TimeSpan? maxWallClockTime = default(TimeSpan?), |
| 218 | 60 | | int? maxTaskRetryCount = default(int?)) |
| | 61 | | { |
| 218 | 62 | | this.propertyContainer = new PropertyContainer(); |
| 218 | 63 | | this.MaxWallClockTime = maxWallClockTime; |
| 218 | 64 | | this.MaxTaskRetryCount = maxTaskRetryCount; |
| 218 | 65 | | } |
| | 66 | |
|
| 750 | 67 | | internal JobConstraints(Models.JobConstraints protocolObject) |
| | 68 | | { |
| 750 | 69 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 750 | 70 | | } |
| | 71 | |
|
| | 72 | | #endregion Constructors |
| | 73 | |
|
| | 74 | | #region JobConstraints |
| | 75 | |
|
| | 76 | | /// <summary> |
| | 77 | | /// Gets or sets the maximum number of times each task may be retried. |
| | 78 | | /// </summary> |
| | 79 | | public int? MaxTaskRetryCount |
| | 80 | | { |
| 1183 | 81 | | get { return this.propertyContainer.MaxTaskRetryCountProperty.Value; } |
| 639 | 82 | | set { this.propertyContainer.MaxTaskRetryCountProperty.Value = value; } |
| | 83 | | } |
| | 84 | |
|
| | 85 | | /// <summary> |
| | 86 | | /// Gets or sets the maximum elapsed time that the job may run, measured from the time the job is created. |
| | 87 | | /// </summary> |
| | 88 | | public TimeSpan? MaxWallClockTime |
| | 89 | | { |
| 1183 | 90 | | get { return this.propertyContainer.MaxWallClockTimeProperty.Value; } |
| 637 | 91 | | set { this.propertyContainer.MaxWallClockTimeProperty.Value = value; } |
| | 92 | | } |
| | 93 | |
|
| | 94 | | #endregion // JobConstraints |
| | 95 | |
|
| | 96 | | #region IPropertyMetadata |
| | 97 | |
|
| | 98 | | bool IModifiable.HasBeenModified |
| | 99 | | { |
| 2 | 100 | | get { return this.propertyContainer.HasBeenModified; } |
| | 101 | | } |
| | 102 | |
|
| | 103 | | bool IReadOnly.IsReadOnly |
| | 104 | | { |
| 0 | 105 | | get { return this.propertyContainer.IsReadOnly; } |
| 6 | 106 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 107 | | } |
| | 108 | |
|
| | 109 | | #endregion //IPropertyMetadata |
| | 110 | |
|
| | 111 | | #region Internal/private methods |
| | 112 | | /// <summary> |
| | 113 | | /// Return a protocol object of the requested type. |
| | 114 | | /// </summary> |
| | 115 | | /// <returns>The protocol object of the requested type.</returns> |
| | 116 | | Models.JobConstraints ITransportObjectProvider<Models.JobConstraints>.GetTransportObject() |
| | 117 | | { |
| 217 | 118 | | Models.JobConstraints result = new Models.JobConstraints() |
| 217 | 119 | | { |
| 217 | 120 | | MaxTaskRetryCount = this.MaxTaskRetryCount, |
| 217 | 121 | | MaxWallClockTime = this.MaxWallClockTime, |
| 217 | 122 | | }; |
| | 123 | |
|
| 217 | 124 | | return result; |
| | 125 | | } |
| | 126 | |
|
| | 127 | |
|
| | 128 | | #endregion // Internal/private methods |
| | 129 | | } |
| | 130 | | } |