| | 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 that occurred when resizing a pool. |
| | 22 | | /// </summary> |
| | 23 | | public partial class ResizeError : IPropertyMetadata |
| | 24 | | { |
| | 25 | | #region Constructors |
| | 26 | |
|
| 2435 | 27 | | internal ResizeError(Models.ResizeError protocolObject) |
| | 28 | | { |
| 2435 | 29 | | this.Code = protocolObject.Code; |
| 2435 | 30 | | this.Message = protocolObject.Message; |
| 2435 | 31 | | this.Values = NameValuePair.ConvertFromProtocolCollectionReadOnly(protocolObject.Values); |
| 2435 | 32 | | } |
| | 33 | |
|
| | 34 | | #endregion Constructors |
| | 35 | |
|
| | 36 | | #region ResizeError |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Gets a code for the pool resize error. See <see cref="Common.PoolResizeErrorCodes"/> for possible values. |
| | 40 | | /// </summary> |
| 2435 | 41 | | public string Code { get; } |
| | 42 | |
|
| | 43 | | /// <summary> |
| | 44 | | /// Gets a message describing the pool resize error, intended to be suitable for display in a user interface. |
| | 45 | | /// </summary> |
| 2435 | 46 | | public string Message { get; } |
| | 47 | |
|
| | 48 | | /// <summary> |
| | 49 | | /// Gets a list of additional error details related to the pool resize error. |
| | 50 | | /// </summary> |
| 2435 | 51 | | public IReadOnlyList<NameValuePair> Values { get; } |
| | 52 | |
|
| | 53 | | #endregion // ResizeError |
| | 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 |
| 2435 | 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<ResizeError> ConvertFromProtocolCollection(IEnumerable<Models.ResizeError> protoCollection |
| | 81 | | { |
| 0 | 82 | | ConcurrentChangeTrackedModifiableList<ResizeError> converted = UtilitiesInternal.CollectionToThreadSafeColle |
| 0 | 83 | | items: protoCollection, |
| 0 | 84 | | objectCreationFunc: o => new ResizeError(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<ResizeError> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ResizeError> protoC |
| | 93 | | { |
| 0 | 94 | | ConcurrentChangeTrackedModifiableList<ResizeError> converted = UtilitiesInternal.CollectionToThreadSafeColle |
| 0 | 95 | | items: protoCollection, |
| 0 | 96 | | objectCreationFunc: o => new ResizeError(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<ResizeError> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.ResizeError> |
| | 108 | | { |
| 1026 | 109 | | IReadOnlyList<ResizeError> converted = |
| 1026 | 110 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 1026 | 111 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 1026 | 112 | | items: protoCollection, |
| 3974 | 113 | | objectCreationFunc: o => new ResizeError(o).Freeze()), o => o.AsReadOnly()); |
| | 114 | |
|
| 1026 | 115 | | return converted; |
| | 116 | | } |
| | 117 | |
|
| | 118 | | #endregion // Internal/private methods |
| | 119 | | } |
| | 120 | | } |