| | 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 | | /// Represents a name-value pair. |
| | 22 | | /// </summary> |
| | 23 | | public partial class NameValuePair : IPropertyMetadata |
| | 24 | | { |
| | 25 | | #region Constructors |
| | 26 | |
|
| 16159 | 27 | | internal NameValuePair(Models.NameValuePair protocolObject) |
| | 28 | | { |
| 16159 | 29 | | this.Name = protocolObject.Name; |
| 16159 | 30 | | this.Value = protocolObject.Value; |
| 16159 | 31 | | } |
| | 32 | |
|
| | 33 | | #endregion Constructors |
| | 34 | |
|
| | 35 | | #region NameValuePair |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Gets the name in the name-value pair. |
| | 39 | | /// </summary> |
| 16121 | 40 | | public string Name { get; } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Gets the value in the name-value pair. |
| | 44 | | /// </summary> |
| 16121 | 45 | | public string Value { get; } |
| | 46 | |
|
| | 47 | | #endregion // NameValuePair |
| | 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 |
| 16159 | 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<NameValuePair> ConvertFromProtocolCollection(IEnumerable<Models.NameValuePair> protoCollec |
| | 75 | | { |
| 0 | 76 | | ConcurrentChangeTrackedModifiableList<NameValuePair> converted = UtilitiesInternal.CollectionToThreadSafeCol |
| 0 | 77 | | items: protoCollection, |
| 0 | 78 | | objectCreationFunc: o => new NameValuePair(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<NameValuePair> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.NameValuePair> pr |
| | 87 | | { |
| 0 | 88 | | ConcurrentChangeTrackedModifiableList<NameValuePair> converted = UtilitiesInternal.CollectionToThreadSafeCol |
| 0 | 89 | | items: protoCollection, |
| 0 | 90 | | objectCreationFunc: o => new NameValuePair(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<NameValuePair> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.NameValueP |
| | 102 | | { |
| 7195 | 103 | | IReadOnlyList<NameValuePair> converted = |
| 7195 | 104 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 7195 | 105 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 7195 | 106 | | items: protoCollection, |
| 26919 | 107 | | objectCreationFunc: o => new NameValuePair(o).Freeze()), o => o.AsReadOnly()); |
| | 108 | |
|
| 7195 | 109 | | return converted; |
| | 110 | | } |
| | 111 | |
|
| | 112 | | #endregion // Internal/private methods |
| | 113 | | } |
| | 114 | | } |