| | 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 private container registry. |
| | 22 | | /// </summary> |
| | 23 | | public partial class ContainerRegistry : ITransportObjectProvider<Models.ContainerRegistry>, IPropertyMetadata |
| | 24 | | { |
| | 25 | | #region Constructors |
| | 26 | | /// <summary> |
| | 27 | | /// Initializes a new instance of the <see cref="ContainerRegistry"/> class. |
| | 28 | | /// </summary> |
| | 29 | | /// <param name='userName'>The user name to log into the registry server.</param> |
| | 30 | | /// <param name='registryServer'>The registry URL.</param> |
| | 31 | | /// <param name='password'>The password to log into the registry server.</param> |
| 1143 | 32 | | public ContainerRegistry( |
| 1143 | 33 | | string userName, |
| 1143 | 34 | | string registryServer = default(string), |
| 1143 | 35 | | string password = default(string)) |
| | 36 | | { |
| 1143 | 37 | | this.UserName = userName; |
| 1143 | 38 | | this.RegistryServer = registryServer; |
| 1143 | 39 | | this.Password = password; |
| 1143 | 40 | | } |
| | 41 | |
|
| 1634 | 42 | | internal ContainerRegistry(Models.ContainerRegistry protocolObject) |
| | 43 | | { |
| 1634 | 44 | | this.Password = protocolObject.Password; |
| 1634 | 45 | | this.RegistryServer = protocolObject.RegistryServer; |
| 1634 | 46 | | this.UserName = protocolObject.UserName; |
| 1634 | 47 | | } |
| | 48 | |
|
| | 49 | | #endregion Constructors |
| | 50 | |
|
| | 51 | | #region ContainerRegistry |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// Gets the password to log into the registry server. |
| | 55 | | /// </summary> |
| 3915 | 56 | | public string Password { get; } |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// Gets the registry URL. |
| | 60 | | /// </summary> |
| | 61 | | /// <remarks> |
| | 62 | | /// If omitted, the default is "docker.io". |
| | 63 | | /// </remarks> |
| 3915 | 64 | | public string RegistryServer { get; } |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// Gets the user name to log into the registry server. |
| | 68 | | /// </summary> |
| 3915 | 69 | | public string UserName { get; } |
| | 70 | |
|
| | 71 | | #endregion // ContainerRegistry |
| | 72 | |
|
| | 73 | | #region IPropertyMetadata |
| | 74 | |
|
| | 75 | | bool IModifiable.HasBeenModified |
| | 76 | | { |
| | 77 | | //This class is compile time readonly so it cannot have been modified |
| 0 | 78 | | get { return false; } |
| | 79 | | } |
| | 80 | |
|
| | 81 | | bool IReadOnly.IsReadOnly |
| | 82 | | { |
| 0 | 83 | | get { return true; } |
| | 84 | | set |
| | 85 | | { |
| | 86 | | // This class is compile time readonly already |
| 3692 | 87 | | } |
| | 88 | | } |
| | 89 | |
|
| | 90 | | #endregion // IPropertyMetadata |
| | 91 | |
|
| | 92 | | #region Internal/private methods |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Return a protocol object of the requested type. |
| | 96 | | /// </summary> |
| | 97 | | /// <returns>The protocol object of the requested type.</returns> |
| | 98 | | Models.ContainerRegistry ITransportObjectProvider<Models.ContainerRegistry>.GetTransportObject() |
| | 99 | | { |
| 1140 | 100 | | Models.ContainerRegistry result = new Models.ContainerRegistry() |
| 1140 | 101 | | { |
| 1140 | 102 | | Password = this.Password, |
| 1140 | 103 | | RegistryServer = this.RegistryServer, |
| 1140 | 104 | | UserName = this.UserName, |
| 1140 | 105 | | }; |
| | 106 | |
|
| 1140 | 107 | | return result; |
| | 108 | | } |
| | 109 | |
|
| | 110 | | /// <summary> |
| | 111 | | /// Converts a collection of protocol layer objects to object layer collection objects. |
| | 112 | | /// </summary> |
| | 113 | | internal static IList<ContainerRegistry> ConvertFromProtocolCollection(IEnumerable<Models.ContainerRegistry> pro |
| | 114 | | { |
| 0 | 115 | | ConcurrentChangeTrackedModifiableList<ContainerRegistry> converted = UtilitiesInternal.CollectionToThreadSaf |
| 0 | 116 | | items: protoCollection, |
| 0 | 117 | | objectCreationFunc: o => new ContainerRegistry(o)); |
| | 118 | |
|
| 0 | 119 | | return converted; |
| | 120 | | } |
| | 121 | |
|
| | 122 | | /// <summary> |
| | 123 | | /// Converts a collection of protocol layer objects to object layer collection objects, in a frozen state. |
| | 124 | | /// </summary> |
| | 125 | | internal static IList<ContainerRegistry> ConvertFromProtocolCollectionAndFreeze(IEnumerable<Models.ContainerRegi |
| | 126 | | { |
| 284 | 127 | | ConcurrentChangeTrackedModifiableList<ContainerRegistry> converted = UtilitiesInternal.CollectionToThreadSaf |
| 284 | 128 | | items: protoCollection, |
| 852 | 129 | | objectCreationFunc: o => new ContainerRegistry(o).Freeze()); |
| | 130 | |
|
| 419 | 131 | | converted = UtilitiesInternal.CreateObjectWithNullCheck(converted, o => o.Freeze()); |
| | 132 | |
|
| 284 | 133 | | return converted; |
| | 134 | | } |
| | 135 | |
|
| | 136 | | /// <summary> |
| | 137 | | /// Converts a collection of protocol layer objects to object layer collection objects, with each object marked |
| | 138 | | /// and returned as a readonly collection. |
| | 139 | | /// </summary> |
| | 140 | | internal static IReadOnlyList<ContainerRegistry> ConvertFromProtocolCollectionReadOnly(IEnumerable<Models.Contai |
| | 141 | | { |
| 0 | 142 | | IReadOnlyList<ContainerRegistry> converted = |
| 0 | 143 | | UtilitiesInternal.CreateObjectWithNullCheck( |
| 0 | 144 | | UtilitiesInternal.CollectionToNonThreadSafeCollection( |
| 0 | 145 | | items: protoCollection, |
| 0 | 146 | | objectCreationFunc: o => new ContainerRegistry(o).Freeze()), o => o.AsReadOnly()); |
| | 147 | |
|
| 0 | 148 | | return converted; |
| | 149 | | } |
| | 150 | |
|
| | 151 | | #endregion // Internal/private methods |
| | 152 | | } |
| | 153 | | } |