| | 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 | | /// A reference to an application package to be deployed to compute nodes. |
| | 22 | | /// </summary> |
| | 23 | | public partial class ApplicationPackageReference : ITransportObjectProvider<Models.ApplicationPackageReference>, IPr |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<string> ApplicationIdProperty; |
| | 28 | | public readonly PropertyAccessor<string> VersionProperty; |
| | 29 | |
|
| 1491 | 30 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 31 | | { |
| 1491 | 32 | | this.ApplicationIdProperty = this.CreatePropertyAccessor<string>(nameof(ApplicationId), BindingAccess.Re |
| 1491 | 33 | | this.VersionProperty = this.CreatePropertyAccessor<string>(nameof(Version), BindingAccess.Read | Binding |
| 1491 | 34 | | } |
| | 35 | |
|
| 6538 | 36 | | public PropertyContainer(Models.ApplicationPackageReference protocolObject) : base(BindingState.Bound) |
| | 37 | | { |
| 6538 | 38 | | this.ApplicationIdProperty = this.CreatePropertyAccessor( |
| 6538 | 39 | | protocolObject.ApplicationId, |
| 6538 | 40 | | nameof(ApplicationId), |
| 6538 | 41 | | BindingAccess.Read); |
| 6538 | 42 | | this.VersionProperty = this.CreatePropertyAccessor( |
| 6538 | 43 | | protocolObject.Version, |
| 6538 | 44 | | nameof(Version), |
| 6538 | 45 | | BindingAccess.Read); |
| 6538 | 46 | | } |
| | 47 | | } |
| | 48 | |
|
| | 49 | | private readonly PropertyContainer propertyContainer; |
| | 50 | |
|
| | 51 | | #region Constructors |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// Initializes a new instance of the <see cref="ApplicationPackageReference"/> class. |
| | 55 | | /// </summary> |
| 1491 | 56 | | public ApplicationPackageReference() |
| | 57 | | { |
| 1491 | 58 | | this.propertyContainer = new PropertyContainer(); |
| 1491 | 59 | | } |
| | 60 | |
|
| 6538 | 61 | | internal ApplicationPackageReference(Models.ApplicationPackageReference protocolObject) |
| | 62 | | { |
| 6538 | 63 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 6538 | 64 | | } |
| | 65 | |
|
| | 66 | | #endregion Constructors |
| | 67 | |
|
| | 68 | | #region ApplicationPackageReference |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Gets or sets the id of the application to be deployed on compute nodes. |
| | 72 | | /// </summary> |
| | 73 | | public string ApplicationId |
| | 74 | | { |
| 9513 | 75 | | get { return this.propertyContainer.ApplicationIdProperty.Value; } |
| 1502 | 76 | | set { this.propertyContainer.ApplicationIdProperty.Value = value; } |
| | 77 | | } |
| | 78 | |
|
| | 79 | | /// <summary> |
| | 80 | | /// Gets or sets the version of the application to be deployed on compute nodes. |
| | 81 | | /// </summary> |
| | 82 | | /// <remarks> |
| | 83 | | /// If not specified, the default version of the application, as defined in the application settings, is deploye |
| | 84 | | /// If no default version is defined in the application settings, you must specify a version in the <see cref="A |
| | 85 | | /// </remarks> |
| | 86 | | public string Version |
| | 87 | | { |
| 9513 | 88 | | get { return this.propertyContainer.VersionProperty.Value; } |
| 1578 | 89 | | set { this.propertyContainer.VersionProperty.Value = value; } |
| | 90 | | } |
| | 91 | |
|
| | 92 | | #endregion // ApplicationPackageReference |
| | 93 | |
|
| | 94 | | #region IPropertyMetadata |
| | 95 | |
|
| | 96 | | bool IModifiable.HasBeenModified |
| | 97 | | { |
| 2 | 98 | | get { return this.propertyContainer.HasBeenModified; } |
| | 99 | | } |
| | 100 | |
|
| | 101 | | bool IReadOnly.IsReadOnly |
| | 102 | | { |
| 0 | 103 | | get { return this.propertyContainer.IsReadOnly; } |
| 27026 | 104 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 105 | | } |
| | 106 | |
|
| | 107 | | #endregion //IPropertyMetadata |
| | 108 | |
|
| | 109 | | #region Internal/private methods |
| | 110 | | /// <summary> |
| | 111 | | /// Return a protocol object of the requested type. |
| | 112 | | /// </summary> |
| | 113 | | /// <returns>The protocol object of the requested type.</returns> |
| | 114 | | Models.ApplicationPackageReference ITransportObjectProvider<Models.ApplicationPackageReference>.GetTransportObje |
| | 115 | | { |
| 1489 | 116 | | Models.ApplicationPackageReference result = new Models.ApplicationPackageReference() |
| 1489 | 117 | | { |
| 1489 | 118 | | ApplicationId = this.ApplicationId, |
| 1489 | 119 | | Version = this.Version, |
| 1489 | 120 | | }; |
| | 121 | |
|
| 1489 | 122 | | return result; |
| | 123 | | } |
| | 124 | |
|
| | 125 | | /// <summary> |
| | 126 | | /// Converts a collection of protocol layer objects to object layer collection objects. |
| | 127 | | /// </summary> |
| | 128 | | internal static IList<ApplicationPackageReference> ConvertFromProtocolCollection(IEnumerable<Models.ApplicationP |
| | 129 | | { |
| 1938 | 130 | | ConcurrentChangeTrackedModifiableList<ApplicationPackageReference> converted = UtilitiesInternal.CollectionT |
| 1938 | 131 | | items: protoCollection, |
| 6234 | 132 | | objectCreationFunc: o => new ApplicationPackageReference(o)); |
| | 133 | |
|
| 1938 | 134 | | return converted; |
| | 135 | | } |
| | 136 | |
|
| | 137 | | /// <summary> |
| | 138 | | /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. |
| | 139 | | /// </summary> |
| | 140 | | internal static IList<ApplicationPackageReference> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.App |
| | 141 | | { |
| 1021 | 142 | | ConcurrentChangeTrackedModifiableList<ApplicationPackageReference> converted = UtilitiesInternal.CollectionT |
| 1021 | 143 | | items: protoCollection, |
| 3263 | 144 | | objectCreationFunc: o => new ApplicationPackageReference(o).Freeze()); |
| | 145 | |
|
| 1520 | 146 | | converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); |
| | 147 | |
|
| 1021 | 148 | | return converted; |
| | 149 | | } |
| | 150 | |
|
| | 151 | | /// <summary> |
| | 152 | | /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked |
| | 153 | | /// and returned as a readonly collection. |
| | 154 | | /// </summary> |
| | 155 | | internal static IReadOnlyList<ApplicationPackageReference> ConvertFromProtocolCollectionReadOnly(IEnumerable<Mod |
| | 156 | | { |
| 0 | 157 | | IReadOnlyList<ApplicationPackageReference> converted = |
| 0 | 158 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 0 | 159 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 0 | 160 | | items: protoCollection, |
| 0 | 161 | | objectCreationFunc: o => new ApplicationPackageReference(o).Freeze()), o => o.AsReadOnly()); |
| | 162 | |
|
| 0 | 163 | | return converted; |
| | 164 | | } |
| | 165 | |
|
| | 166 | | #endregion // Internal/private methods |
| | 167 | | } |
| | 168 | | } |