| | 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 | | { |
| 0 | 15 | | using Models = Microsoft.Azure.Batch.Protocol.Models; |
| 0 | 16 | | using System; |
| 0 | 17 | | using System.Collections.Generic; |
| 0 | 18 | | using System.Linq; |
| 0 | 19 | |
|
| | 20 | | /// <summary> |
| 0 | 21 | | /// A reference to an Azure Virtual Machines Marketplace Image or a custom Azure Virtual Machine Image. To get the l |
| 0 | 22 | | /// of all Azure Marketplace Image references verified by Azure Batch, see <see cref="PoolOperations.ListSupportedIm |
| 0 | 23 | | /// </summary> |
| 0 | 24 | | public partial class ImageReference : ITransportObjectProvider<Models.ImageReference>, IPropertyMetadata |
| 0 | 25 | | { |
| | 26 | | #region Constructors |
| | 27 | |
|
| 1260 | 28 | | internal ImageReference(Models.ImageReference protocolObject) |
| | 29 | | { |
| 1260 | 30 | | this.Offer = protocolObject.Offer; |
| 1260 | 31 | | this.Publisher = protocolObject.Publisher; |
| 1260 | 32 | | this.Sku = protocolObject.Sku; |
| 1260 | 33 | | this.Version = protocolObject.Version; |
| 1260 | 34 | | this.VirtualMachineImageId = protocolObject.VirtualMachineImageId; |
| 1260 | 35 | | } |
| 0 | 36 | |
|
| | 37 | | #endregion Constructors |
| 0 | 38 | |
|
| 0 | 39 | | #region ImageReference |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Gets the offer type of the Azure Virtual Machines Marketplace Image. |
| | 43 | | /// </summary> |
| | 44 | | /// <remarks> |
| | 45 | | /// For example, UbuntuServer or WindowsServer. |
| | 46 | | /// </remarks> |
| 1505 | 47 | | public string Offer { get; } |
| | 48 | |
|
| | 49 | | /// <summary> |
| | 50 | | /// Gets the publisher of the Azure Virtual Machines Marketplace Image. |
| | 51 | | /// </summary> |
| | 52 | | /// <remarks> |
| | 53 | | /// For example, Canonical or MicrosoftWindowsServer. |
| | 54 | | /// </remarks> |
| 1505 | 55 | | public string Publisher { get; } |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// Gets the SKU of the Azure Virtual Machines Marketplace Image. |
| | 59 | | /// </summary> |
| | 60 | | /// <remarks> |
| | 61 | | /// For example, 18.04-LTS or 2019-Datacenter. |
| | 62 | | /// </remarks> |
| 1505 | 63 | | public string Sku { get; } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Gets the version of the Azure Virtual Machines Marketplace Image. |
| | 67 | | /// </summary> |
| | 68 | | /// <remarks> |
| | 69 | | /// If this property is not specified, it defaults to 'latest', which is the latest version of the image. |
| | 70 | | /// </remarks> |
| 1505 | 71 | | public string Version { get; } |
| | 72 | |
|
| | 73 | | /// <summary> |
| | 74 | | /// Gets the ARM resource identifier of the Virtual Machine Image or Shared Image Gallery Image. Computes Comput |
| | 75 | | /// Nodes of the Pool will be created using this Image Id. This is of the form /subscriptions/{subscriptionId}/r |
| | 76 | | /// </summary> |
| | 77 | | /// <remarks> |
| | 78 | | /// This property is mutually exclusive with other <see cref="ImageReference"/> properties. The Shared Image Gal |
| | 79 | | /// image must have replicas in the same region as the Azure Batch account. For information about the firewall s |
| | 80 | | /// for the Batch Compute Node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/ |
| | 81 | | /// </remarks> |
| 1505 | 82 | | public string VirtualMachineImageId { get; } |
| | 83 | |
|
| | 84 | | #endregion // ImageReference |
| | 85 | |
|
| | 86 | | #region IPropertyMetadata |
| | 87 | |
|
| | 88 | | bool IModifiable.HasBeenModified |
| | 89 | | { |
| | 90 | | //This class is compile time readonly so it cannot have been modified |
| 0 | 91 | | get { return false; } |
| | 92 | | } |
| | 93 | |
|
| | 94 | | bool IReadOnly.IsReadOnly |
| | 95 | | { |
| 0 | 96 | | get { return true; } |
| | 97 | | set |
| | 98 | | { |
| | 99 | | // This class is compile time readonly already |
| 725 | 100 | | } |
| | 101 | | } |
| | 102 | |
|
| | 103 | | #endregion // IPropertyMetadata |
| | 104 | |
|
| | 105 | | #region Internal/private methods |
| | 106 | |
|
| | 107 | | /// <summary> |
| | 108 | | /// Return a protocol object of the requested type. |
| | 109 | | /// </summary> |
| | 110 | | /// <returns>The protocol object of the requested type.</returns> |
| | 111 | | Models.ImageReference ITransportObjectProvider<Models.ImageReference>.GetTransportObject() |
| | 112 | | { |
| 365 | 113 | | Models.ImageReference result = new Models.ImageReference() |
| 365 | 114 | | { |
| 365 | 115 | | Offer = this.Offer, |
| 365 | 116 | | Publisher = this.Publisher, |
| 365 | 117 | | Sku = this.Sku, |
| 365 | 118 | | Version = this.Version, |
| 365 | 119 | | VirtualMachineImageId = this.VirtualMachineImageId, |
| 365 | 120 | | }; |
| | 121 | |
|
| 365 | 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<ImageReference> ConvertFromProtocolCollection(IEnumerable<Models.ImageReference> protoColl |
| | 129 | | { |
| 0 | 130 | | ConcurrentChangeTrackedModifiableList<ImageReference> converted = UtilitiesInternal.CollectionToThreadSafeCo |
| 0 | 131 | | items: protoCollection, |
| 0 | 132 | | objectCreationFunc: o => new ImageReference(o)); |
| | 133 | |
|
| 0 | 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<ImageReference> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ImageReference> |
| | 141 | | { |
| 0 | 142 | | ConcurrentChangeTrackedModifiableList<ImageReference> converted = UtilitiesInternal.CollectionToThreadSafeCo |
| 0 | 143 | | items: protoCollection, |
| 0 | 144 | | objectCreationFunc: o => new ImageReference(o).Freeze()); |
| | 145 | |
|
| 0 | 146 | | converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); |
| | 147 | |
|
| 0 | 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<ImageReference> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.ImageRefe |
| | 156 | | { |
| 0 | 157 | | IReadOnlyList<ImageReference> converted = |
| 0 | 158 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 0 | 159 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 0 | 160 | | items: protoCollection, |
| 0 | 161 | | objectCreationFunc: o => new ImageReference(o).Freeze()), o => o.AsReadOnly()); |
| | 162 | |
|
| 0 | 163 | | return converted; |
| | 164 | | } |
| | 165 | |
|
| | 166 | | #endregion // Internal/private methods |
| | 167 | | } |
| | 168 | | } |