| | 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 | | /// An error encountered by an Azure Batch compute node. |
| | 22 | | /// </summary> |
| | 23 | | public partial class ComputeNodeError : IPropertyMetadata |
| | 24 | | { |
| | 25 | | #region Constructors |
| | 26 | |
|
| 2226 | 27 | | internal ComputeNodeError(Models.ComputeNodeError protocolObject) |
| | 28 | | { |
| 2226 | 29 | | this.Code = protocolObject.Code; |
| 2226 | 30 | | this.ErrorDetails = NameValuePair.ConvertFromProtocolCollectionReadOnly(protocolObject.ErrorDetails); |
| 2226 | 31 | | this.Message = protocolObject.Message; |
| 2226 | 32 | | } |
| | 33 | |
|
| | 34 | | #endregion Constructors |
| | 35 | |
|
| | 36 | | #region ComputeNodeError |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Gets a code for the compute node error. See <see cref="Common.BatchErrorCodeStrings"/> for possible values. |
| | 40 | | /// </summary> |
| 2226 | 41 | | public string Code { get; } |
| | 42 | |
|
| | 43 | | /// <summary> |
| | 44 | | /// Gets a list of additional error details related to the compute node error. |
| | 45 | | /// </summary> |
| 2226 | 46 | | public IReadOnlyList<NameValuePair> ErrorDetails { get; } |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Gets a message describing the compute node error, intended to be suitable for display in a user interface. |
| | 50 | | /// </summary> |
| 2226 | 51 | | public string Message { get; } |
| | 52 | |
|
| | 53 | | #endregion // ComputeNodeError |
| | 54 | |
|
| | 55 | | #region IPropertyMetadata |
| | 56 | |
|
| | 57 | | bool IModifiable.HasBeenModified |
| | 58 | | { |
| | 59 | | //This class is compile time readonly so it cannot have been modified |
| 0 | 60 | | get { return false; } |
| | 61 | | } |
| | 62 | |
|
| | 63 | | bool IReadOnly.IsReadOnly |
| | 64 | | { |
| 0 | 65 | | get { return true; } |
| | 66 | | set |
| | 67 | | { |
| | 68 | | // This class is compile time readonly already |
| 2226 | 69 | | } |
| | 70 | | } |
| | 71 | |
|
| | 72 | | #endregion // IPropertyMetadata |
| | 73 | |
|
| | 74 | | #region Internal/private methods |
| | 75 | |
|
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Converts a collection of protocol layer objects to object layer collection objects. |
| | 79 | | /// </summary> |
| | 80 | | internal static IList<ComputeNodeError> ConvertFromProtocolCollection(IEnumerable<Models.ComputeNodeError> proto |
| | 81 | | { |
| 0 | 82 | | ConcurrentChangeTrackedModifiableList<ComputeNodeError> converted = UtilitiesInternal.CollectionToThreadSafe |
| 0 | 83 | | items: protoCollection, |
| 0 | 84 | | objectCreationFunc: o => new ComputeNodeError(o)); |
| | 85 | |
|
| 0 | 86 | | return converted; |
| | 87 | | } |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. |
| | 91 | | /// </summary> |
| | 92 | | internal static IList<ComputeNodeError> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ComputeNodeErr |
| | 93 | | { |
| 0 | 94 | | ConcurrentChangeTrackedModifiableList<ComputeNodeError> converted = UtilitiesInternal.CollectionToThreadSafe |
| 0 | 95 | | items: protoCollection, |
| 0 | 96 | | objectCreationFunc: o => new ComputeNodeError(o).Freeze()); |
| | 97 | |
|
| 0 | 98 | | converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); |
| | 99 | |
|
| 0 | 100 | | return converted; |
| | 101 | | } |
| | 102 | |
|
| | 103 | | /// <summary> |
| | 104 | | /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked |
| | 105 | | /// and returned as a readonly collection. |
| | 106 | | /// </summary> |
| | 107 | | internal static IReadOnlyList<ComputeNodeError> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.Compute |
| | 108 | | { |
| 1003 | 109 | | IReadOnlyList<ComputeNodeError> converted = |
| 1003 | 110 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 1003 | 111 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 1003 | 112 | | items: protoCollection, |
| 3723 | 113 | | objectCreationFunc: o => new ComputeNodeError(o).Freeze()), o => o.AsReadOnly()); |
| | 114 | |
|
| 1003 | 115 | | return converted; |
| | 116 | | } |
| | 117 | |
|
| | 118 | | #endregion // Internal/private methods |
| | 119 | | } |
| | 120 | | } |