| | 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 | | /// The configuration for container-enabled pools. |
| | 22 | | /// </summary> |
| | 23 | | public partial class ContainerConfiguration : ITransportObjectProvider<Models.ContainerConfiguration>, IPropertyMeta |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<IList<string>> ContainerImageNamesProperty; |
| | 28 | | public readonly PropertyAccessor<IList<ContainerRegistry>> ContainerRegistriesProperty; |
| | 29 | |
|
| 234 | 30 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 31 | | { |
| 234 | 32 | | this.ContainerImageNamesProperty = this.CreatePropertyAccessor<IList<string>>(nameof(ContainerImageNames |
| 234 | 33 | | this.ContainerRegistriesProperty = this.CreatePropertyAccessor<IList<ContainerRegistry>>(nameof(Containe |
| 234 | 34 | | } |
| | 35 | |
|
| 284 | 36 | | public PropertyContainer(Models.ContainerConfiguration protocolObject) : base(BindingState.Bound) |
| | 37 | | { |
| 284 | 38 | | this.ContainerImageNamesProperty = this.CreatePropertyAccessor( |
| 979 | 39 | | UtilitiesInternal.CollectionToThreadSafeCollection(protocolObject.ContainerImageNames, o => o), |
| 284 | 40 | | nameof(ContainerImageNames), |
| 284 | 41 | | BindingAccess.Read); |
| 284 | 42 | | this.ContainerRegistriesProperty = this.CreatePropertyAccessor( |
| 284 | 43 | | ContainerRegistry.ConvertFromProtocolCollectionAndFreeze(protocolObject.ContainerRegistries), |
| 284 | 44 | | nameof(ContainerRegistries), |
| 284 | 45 | | BindingAccess.Read); |
| 284 | 46 | | } |
| | 47 | | } |
| | 48 | |
|
| | 49 | | private readonly PropertyContainer propertyContainer; |
| | 50 | |
|
| | 51 | | #region Constructors |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// Initializes a new instance of the <see cref="ContainerConfiguration"/> class. |
| | 55 | | /// </summary> |
| 234 | 56 | | public ContainerConfiguration() |
| | 57 | | { |
| 234 | 58 | | this.propertyContainer = new PropertyContainer(); |
| 234 | 59 | | } |
| | 60 | |
|
| 284 | 61 | | internal ContainerConfiguration(Models.ContainerConfiguration protocolObject) |
| | 62 | | { |
| 284 | 63 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 284 | 64 | | } |
| | 65 | |
|
| | 66 | | #endregion Constructors |
| | 67 | |
|
| | 68 | | #region ContainerConfiguration |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Gets or sets the collection of container images. |
| | 72 | | /// </summary> |
| | 73 | | /// <remarks> |
| | 74 | | /// This is the full image reference, as would be specified to "docker pull". An image will be sourced from the |
| | 75 | | /// Docker registry unless the image is fully qualified with an alternative registry. |
| | 76 | | /// </remarks> |
| | 77 | | public IList<string> ContainerImageNames |
| | 78 | | { |
| 751 | 79 | | get { return this.propertyContainer.ContainerImageNamesProperty.Value; } |
| | 80 | | set |
| | 81 | | { |
| 106 | 82 | | this.propertyContainer.ContainerImageNamesProperty.Value = ConcurrentChangeTrackedList<string>.Transform |
| 105 | 83 | | } |
| | 84 | | } |
| | 85 | |
|
| | 86 | | /// <summary> |
| | 87 | | /// Gets or sets additional private registries which containers can be pulled from. |
| | 88 | | /// </summary> |
| | 89 | | /// <remarks> |
| | 90 | | /// If any images must be downloaded from a private registry which requires credentials, then those credentials |
| | 91 | | /// be provided here. |
| | 92 | | /// </remarks> |
| | 93 | | public IList<ContainerRegistry> ContainerRegistries |
| | 94 | | { |
| 751 | 95 | | get { return this.propertyContainer.ContainerRegistriesProperty.Value; } |
| | 96 | | set |
| | 97 | | { |
| 111 | 98 | | this.propertyContainer.ContainerRegistriesProperty.Value = ConcurrentChangeTrackedModifiableList<Contain |
| 110 | 99 | | } |
| | 100 | | } |
| | 101 | |
|
| | 102 | | #endregion // ContainerConfiguration |
| | 103 | |
|
| | 104 | | #region IPropertyMetadata |
| | 105 | |
|
| | 106 | | bool IModifiable.HasBeenModified |
| | 107 | | { |
| 0 | 108 | | get { return this.propertyContainer.HasBeenModified; } |
| | 109 | | } |
| | 110 | |
|
| | 111 | | bool IReadOnly.IsReadOnly |
| | 112 | | { |
| 0 | 113 | | get { return this.propertyContainer.IsReadOnly; } |
| 462 | 114 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 115 | | } |
| | 116 | |
|
| | 117 | | #endregion //IPropertyMetadata |
| | 118 | |
|
| | 119 | | #region Internal/private methods |
| | 120 | | /// <summary> |
| | 121 | | /// Return a protocol object of the requested type. |
| | 122 | | /// </summary> |
| | 123 | | /// <returns>The protocol object of the requested type.</returns> |
| | 124 | | Models.ContainerConfiguration ITransportObjectProvider<Models.ContainerConfiguration>.GetTransportObject() |
| | 125 | | { |
| 233 | 126 | | Models.ContainerConfiguration result = new Models.ContainerConfiguration() |
| 233 | 127 | | { |
| 233 | 128 | | ContainerImageNames = this.ContainerImageNames, |
| 233 | 129 | | ContainerRegistries = UtilitiesInternal.ConvertToProtocolCollection(this.ContainerRegistries), |
| 233 | 130 | | }; |
| | 131 | |
|
| 233 | 132 | | return result; |
| | 133 | | } |
| | 134 | |
|
| | 135 | |
|
| | 136 | | #endregion // Internal/private methods |
| | 137 | | } |
| | 138 | | } |