| | 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 compute node's task info class. |
| | 22 | | /// </summary> |
| | 23 | | public partial class TaskInformation : IPropertyMetadata |
| | 24 | | { |
| | 25 | | #region Constructors |
| | 26 | |
|
| 2182 | 27 | | internal TaskInformation(Models.TaskInformation protocolObject) |
| | 28 | | { |
| 3235 | 29 | | this.ExecutionInformation = UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.ExecutionInfo, o => n |
| 2182 | 30 | | this.JobId = protocolObject.JobId; |
| 2182 | 31 | | this.SubtaskId = protocolObject.SubtaskId; |
| 2182 | 32 | | this.TaskId = protocolObject.TaskId; |
| 2182 | 33 | | this.TaskState = UtilitiesInternal.MapEnum<Models.TaskState, Common.TaskState>(protocolObject.TaskState); |
| 2182 | 34 | | this.TaskUrl = protocolObject.TaskUrl; |
| 2182 | 35 | | } |
| | 36 | |
|
| | 37 | | #endregion Constructors |
| | 38 | |
|
| | 39 | | #region TaskInformation |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Gets the execution information for the task. |
| | 43 | | /// </summary> |
| 2182 | 44 | | public TaskExecutionInformation ExecutionInformation { get; } |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// Gets the job id. |
| | 48 | | /// </summary> |
| 2182 | 49 | | public string JobId { get; } |
| | 50 | |
|
| | 51 | | /// <summary> |
| | 52 | | /// Gets the subtask id. |
| | 53 | | /// </summary> |
| 2182 | 54 | | public int? SubtaskId { get; } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// Gets the task id. |
| | 58 | | /// </summary> |
| 2182 | 59 | | public string TaskId { get; } |
| | 60 | |
|
| | 61 | | /// <summary> |
| | 62 | | /// Gets the task state. |
| | 63 | | /// </summary> |
| 2182 | 64 | | public Common.TaskState TaskState { get; } |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// Gets the task URL. |
| | 68 | | /// </summary> |
| 2182 | 69 | | public string TaskUrl { get; } |
| | 70 | |
|
| | 71 | | #endregion // TaskInformation |
| | 72 | |
|
| | 73 | | #region IPropertyMetadata |
| | 74 | |
|
| | 75 | | bool IModifiable.HasBeenModified |
| | 76 | | { |
| | 77 | | //This class is compile time readonly so it cannot have been modified |
| 0 | 78 | | get { return false; } |
| | 79 | | } |
| | 80 | |
|
| | 81 | | bool IReadOnly.IsReadOnly |
| | 82 | | { |
| 0 | 83 | | get { return true; } |
| | 84 | | set |
| | 85 | | { |
| | 86 | | // This class is compile time readonly already |
| 2182 | 87 | | } |
| | 88 | | } |
| | 89 | |
|
| | 90 | | #endregion // IPropertyMetadata |
| | 91 | |
|
| | 92 | | #region Internal/private methods |
| | 93 | |
|
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Converts a collection of protocol layer objects to object layer collection objects. |
| | 97 | | /// </summary> |
| | 98 | | internal static IList<TaskInformation> ConvertFromProtocolCollection(IEnumerable<Models.TaskInformation> protoCo |
| | 99 | | { |
| 0 | 100 | | ConcurrentChangeTrackedModifiableList<TaskInformation> converted = UtilitiesInternal.CollectionToThreadSafeC |
| 0 | 101 | | items: protoCollection, |
| 0 | 102 | | objectCreationFunc: o => new TaskInformation(o)); |
| | 103 | |
|
| 0 | 104 | | return converted; |
| | 105 | | } |
| | 106 | |
|
| | 107 | | /// <summary> |
| | 108 | | /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. |
| | 109 | | /// </summary> |
| | 110 | | internal static IList<TaskInformation> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.TaskInformation |
| | 111 | | { |
| 0 | 112 | | ConcurrentChangeTrackedModifiableList<TaskInformation> converted = UtilitiesInternal.CollectionToThreadSafeC |
| 0 | 113 | | items: protoCollection, |
| 0 | 114 | | objectCreationFunc: o => new TaskInformation(o).Freeze()); |
| | 115 | |
|
| 0 | 116 | | converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); |
| | 117 | |
|
| 0 | 118 | | return converted; |
| | 119 | | } |
| | 120 | |
|
| | 121 | | /// <summary> |
| | 122 | | /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked |
| | 123 | | /// and returned as a readonly collection. |
| | 124 | | /// </summary> |
| | 125 | | internal static IReadOnlyList<TaskInformation> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.TaskInfo |
| | 126 | | { |
| 1003 | 127 | | IReadOnlyList<TaskInformation> converted = |
| 1003 | 128 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 1003 | 129 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 1003 | 130 | | items: protoCollection, |
| 3678 | 131 | | objectCreationFunc: o => new TaskInformation(o).Freeze()), o => o.AsReadOnly()); |
| | 132 | |
|
| 1003 | 133 | | return converted; |
| | 134 | | } |
| | 135 | |
|
| | 136 | | #endregion // Internal/private methods |
| | 137 | | } |
| | 138 | | } |