| | 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 | | /// A schedule. |
| | 22 | | /// </summary> |
| | 23 | | public partial class Schedule : ITransportObjectProvider<Models.Schedule>, IPropertyMetadata |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<DateTime?> DoNotRunAfterProperty; |
| | 28 | | public readonly PropertyAccessor<DateTime?> DoNotRunUntilProperty; |
| | 29 | | public readonly PropertyAccessor<TimeSpan?> RecurrenceIntervalProperty; |
| | 30 | | public readonly PropertyAccessor<TimeSpan?> StartWindowProperty; |
| | 31 | |
|
| 147 | 32 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 33 | | { |
| 147 | 34 | | this.DoNotRunAfterProperty = this.CreatePropertyAccessor<DateTime?>(nameof(DoNotRunAfter), BindingAccess |
| 147 | 35 | | this.DoNotRunUntilProperty = this.CreatePropertyAccessor<DateTime?>(nameof(DoNotRunUntil), BindingAccess |
| 147 | 36 | | this.RecurrenceIntervalProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(RecurrenceInterval), Bin |
| 147 | 37 | | this.StartWindowProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(StartWindow), BindingAccess.Rea |
| 147 | 38 | | } |
| | 39 | |
|
| 517 | 40 | | public PropertyContainer(Models.Schedule protocolObject) : base(BindingState.Bound) |
| | 41 | | { |
| 517 | 42 | | this.DoNotRunAfterProperty = this.CreatePropertyAccessor( |
| 517 | 43 | | protocolObject.DoNotRunAfter, |
| 517 | 44 | | nameof(DoNotRunAfter), |
| 517 | 45 | | BindingAccess.Read | BindingAccess.Write); |
| 517 | 46 | | this.DoNotRunUntilProperty = this.CreatePropertyAccessor( |
| 517 | 47 | | protocolObject.DoNotRunUntil, |
| 517 | 48 | | nameof(DoNotRunUntil), |
| 517 | 49 | | BindingAccess.Read | BindingAccess.Write); |
| 517 | 50 | | this.RecurrenceIntervalProperty = this.CreatePropertyAccessor( |
| 517 | 51 | | protocolObject.RecurrenceInterval, |
| 517 | 52 | | nameof(RecurrenceInterval), |
| 517 | 53 | | BindingAccess.Read | BindingAccess.Write); |
| 517 | 54 | | this.StartWindowProperty = this.CreatePropertyAccessor( |
| 517 | 55 | | protocolObject.StartWindow, |
| 517 | 56 | | nameof(StartWindow), |
| 517 | 57 | | BindingAccess.Read | BindingAccess.Write); |
| 517 | 58 | | } |
| | 59 | | } |
| | 60 | |
|
| | 61 | | private readonly PropertyContainer propertyContainer; |
| | 62 | |
|
| | 63 | | #region Constructors |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Initializes a new instance of the <see cref="Schedule"/> class. |
| | 67 | | /// </summary> |
| 147 | 68 | | public Schedule() |
| | 69 | | { |
| 147 | 70 | | this.propertyContainer = new PropertyContainer(); |
| 147 | 71 | | } |
| | 72 | |
|
| 517 | 73 | | internal Schedule(Models.Schedule protocolObject) |
| | 74 | | { |
| 517 | 75 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 517 | 76 | | } |
| | 77 | |
|
| | 78 | | #endregion Constructors |
| | 79 | |
|
| | 80 | | #region Schedule |
| | 81 | |
|
| | 82 | | /// <summary> |
| | 83 | | /// Gets or sets the wall clock time after which no job will be scheduled under this job schedule. |
| | 84 | | /// </summary> |
| | 85 | | public DateTime? DoNotRunAfter |
| | 86 | | { |
| 807 | 87 | | get { return this.propertyContainer.DoNotRunAfterProperty.Value; } |
| 143 | 88 | | set { this.propertyContainer.DoNotRunAfterProperty.Value = value; } |
| | 89 | | } |
| | 90 | |
|
| | 91 | | /// <summary> |
| | 92 | | /// Gets or sets the earliest wall clock time at which to schedule the first job under this job schedule |
| | 93 | | /// </summary> |
| | 94 | | public DateTime? DoNotRunUntil |
| | 95 | | { |
| 807 | 96 | | get { return this.propertyContainer.DoNotRunUntilProperty.Value; } |
| 147 | 97 | | set { this.propertyContainer.DoNotRunUntilProperty.Value = value; } |
| | 98 | | } |
| | 99 | |
|
| | 100 | | /// <summary> |
| | 101 | | /// Gets or sets the time interval between the start times of two successive jobs under the job schedule. |
| | 102 | | /// </summary> |
| | 103 | | public TimeSpan? RecurrenceInterval |
| | 104 | | { |
| 807 | 105 | | get { return this.propertyContainer.RecurrenceIntervalProperty.Value; } |
| 137 | 106 | | set { this.propertyContainer.RecurrenceIntervalProperty.Value = value; } |
| | 107 | | } |
| | 108 | |
|
| | 109 | | /// <summary> |
| | 110 | | /// Gets or sets the window of time within which a job must be started from the time the job schedule is ready t |
| | 111 | | /// be scheduled. |
| | 112 | | /// </summary> |
| | 113 | | public TimeSpan? StartWindow |
| | 114 | | { |
| 807 | 115 | | get { return this.propertyContainer.StartWindowProperty.Value; } |
| 125 | 116 | | set { this.propertyContainer.StartWindowProperty.Value = value; } |
| | 117 | | } |
| | 118 | |
|
| | 119 | | #endregion // Schedule |
| | 120 | |
|
| | 121 | | #region IPropertyMetadata |
| | 122 | |
|
| | 123 | | bool IModifiable.HasBeenModified |
| | 124 | | { |
| 2 | 125 | | get { return this.propertyContainer.HasBeenModified; } |
| | 126 | | } |
| | 127 | |
|
| | 128 | | bool IReadOnly.IsReadOnly |
| | 129 | | { |
| 0 | 130 | | get { return this.propertyContainer.IsReadOnly; } |
| 8 | 131 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 132 | | } |
| | 133 | |
|
| | 134 | | #endregion //IPropertyMetadata |
| | 135 | |
|
| | 136 | | #region Internal/private methods |
| | 137 | | /// <summary> |
| | 138 | | /// Return a protocol object of the requested type. |
| | 139 | | /// </summary> |
| | 140 | | /// <returns>The protocol object of the requested type.</returns> |
| | 141 | | Models.Schedule ITransportObjectProvider<Models.Schedule>.GetTransportObject() |
| | 142 | | { |
| 147 | 143 | | Models.Schedule result = new Models.Schedule() |
| 147 | 144 | | { |
| 147 | 145 | | DoNotRunAfter = this.DoNotRunAfter, |
| 147 | 146 | | DoNotRunUntil = this.DoNotRunUntil, |
| 147 | 147 | | RecurrenceInterval = this.RecurrenceInterval, |
| 147 | 148 | | StartWindow = this.StartWindow, |
| 147 | 149 | | }; |
| | 150 | |
|
| 147 | 151 | | return result; |
| | 152 | | } |
| | 153 | |
|
| | 154 | |
|
| | 155 | | #endregion // Internal/private methods |
| | 156 | | } |
| | 157 | | } |