| | 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 item of additional information included in a <see cref="BatchError"/>. |
| | 22 | | /// </summary> |
| | 23 | | public partial class BatchErrorDetail : IPropertyMetadata |
| | 24 | | { |
| | 25 | | #region Constructors |
| | 26 | |
|
| 2 | 27 | | internal BatchErrorDetail(Models.BatchErrorDetail protocolObject) |
| | 28 | | { |
| 2 | 29 | | this.Key = protocolObject.Key; |
| 2 | 30 | | this.Value = protocolObject.Value; |
| 2 | 31 | | } |
| | 32 | |
|
| | 33 | | #endregion Constructors |
| | 34 | |
|
| | 35 | | #region BatchErrorDetail |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Gets an identifier specifying the meaning of the <see cref="Value"/> property. |
| | 39 | | /// </summary> |
| 2 | 40 | | public string Key { get; } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Gets the additional information included with the <see cref="BatchError"/>. |
| | 44 | | /// </summary> |
| 2 | 45 | | public string Value { get; } |
| | 46 | |
|
| | 47 | | #endregion // BatchErrorDetail |
| | 48 | |
|
| | 49 | | #region IPropertyMetadata |
| | 50 | |
|
| | 51 | | bool IModifiable.HasBeenModified |
| | 52 | | { |
| | 53 | | //This class is compile time readonly so it cannot have been modified |
| 0 | 54 | | get { return false; } |
| | 55 | | } |
| | 56 | |
|
| | 57 | | bool IReadOnly.IsReadOnly |
| | 58 | | { |
| 0 | 59 | | get { return true; } |
| | 60 | | set |
| | 61 | | { |
| | 62 | | // This class is compile time readonly already |
| 2 | 63 | | } |
| | 64 | | } |
| | 65 | |
|
| | 66 | | #endregion // IPropertyMetadata |
| | 67 | |
|
| | 68 | | #region Internal/private methods |
| | 69 | |
|
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// Converts a collection of protocol layer objects to object layer collection objects. |
| | 73 | | /// </summary> |
| | 74 | | internal static IList<BatchErrorDetail> ConvertFromProtocolCollection(IEnumerable<Models.BatchErrorDetail> proto |
| | 75 | | { |
| 0 | 76 | | ConcurrentChangeTrackedModifiableList<BatchErrorDetail> converted = UtilitiesInternal.CollectionToThreadSafe |
| 0 | 77 | | items: protoCollection, |
| 0 | 78 | | objectCreationFunc: o => new BatchErrorDetail(o)); |
| | 79 | |
|
| 0 | 80 | | return converted; |
| | 81 | | } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. |
| | 85 | | /// </summary> |
| | 86 | | internal static IList<BatchErrorDetail> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.BatchErrorDeta |
| | 87 | | { |
| 0 | 88 | | ConcurrentChangeTrackedModifiableList<BatchErrorDetail> converted = UtilitiesInternal.CollectionToThreadSafe |
| 0 | 89 | | items: protoCollection, |
| 0 | 90 | | objectCreationFunc: o => new BatchErrorDetail(o).Freeze()); |
| | 91 | |
|
| 0 | 92 | | converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); |
| | 93 | |
|
| 0 | 94 | | return converted; |
| | 95 | | } |
| | 96 | |
|
| | 97 | | /// <summary> |
| | 98 | | /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked |
| | 99 | | /// and returned as a readonly collection. |
| | 100 | | /// </summary> |
| | 101 | | internal static IReadOnlyList<BatchErrorDetail> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.BatchEr |
| | 102 | | { |
| 3 | 103 | | IReadOnlyList<BatchErrorDetail> converted = |
| 3 | 104 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 3 | 105 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 3 | 106 | | items: protoCollection, |
| 5 | 107 | | objectCreationFunc: o => new BatchErrorDetail(o).Freeze()), o => o.AsReadOnly()); |
| | 108 | |
|
| 3 | 109 | | return converted; |
| | 110 | | } |
| | 111 | |
|
| | 112 | | #endregion // Internal/private methods |
| | 113 | | } |
| | 114 | | } |