| | 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 | | /// Properties used to create a user account on a Linux node. |
| | 22 | | /// </summary> |
| | 23 | | public partial class LinuxUserConfiguration : ITransportObjectProvider<Models.LinuxUserConfiguration>, IPropertyMeta |
| | 24 | | { |
| | 25 | | private class PropertyContainer : PropertyCollection |
| | 26 | | { |
| | 27 | | public readonly PropertyAccessor<int?> GidProperty; |
| | 28 | | public readonly PropertyAccessor<string> SshPrivateKeyProperty; |
| | 29 | | public readonly PropertyAccessor<int?> UidProperty; |
| | 30 | |
|
| 1346 | 31 | | public PropertyContainer() : base(BindingState.Unbound) |
| | 32 | | { |
| 1346 | 33 | | this.GidProperty = this.CreatePropertyAccessor<int?>(nameof(Gid), BindingAccess.Read | BindingAccess.Wri |
| 1346 | 34 | | this.SshPrivateKeyProperty = this.CreatePropertyAccessor<string>(nameof(SshPrivateKey), BindingAccess.Re |
| 1346 | 35 | | this.UidProperty = this.CreatePropertyAccessor<int?>(nameof(Uid), BindingAccess.Read | BindingAccess.Wri |
| 1346 | 36 | | } |
| | 37 | |
|
| 1413 | 38 | | public PropertyContainer(Models.LinuxUserConfiguration protocolObject) : base(BindingState.Bound) |
| | 39 | | { |
| 1413 | 40 | | this.GidProperty = this.CreatePropertyAccessor( |
| 1413 | 41 | | protocolObject.Gid, |
| 1413 | 42 | | nameof(Gid), |
| 1413 | 43 | | BindingAccess.Read); |
| 1413 | 44 | | this.SshPrivateKeyProperty = this.CreatePropertyAccessor( |
| 1413 | 45 | | protocolObject.SshPrivateKey, |
| 1413 | 46 | | nameof(SshPrivateKey), |
| 1413 | 47 | | BindingAccess.Read); |
| 1413 | 48 | | this.UidProperty = this.CreatePropertyAccessor( |
| 1413 | 49 | | protocolObject.Uid, |
| 1413 | 50 | | nameof(Uid), |
| 1413 | 51 | | BindingAccess.Read); |
| 1413 | 52 | | } |
| | 53 | | } |
| | 54 | |
|
| | 55 | | private readonly PropertyContainer propertyContainer; |
| | 56 | |
|
| | 57 | | #region Constructors |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// Initializes a new instance of the <see cref="LinuxUserConfiguration"/> class. |
| | 61 | | /// </summary> |
| | 62 | | /// <param name='uid'>The user ID of the user account.</param> |
| | 63 | | /// <param name='gid'>The group ID of the user account.</param> |
| | 64 | | /// <param name='sshPrivateKey'>The SSH private key for the user account.</param> |
| 1346 | 65 | | public LinuxUserConfiguration( |
| 1346 | 66 | | int? uid = default(int?), |
| 1346 | 67 | | int? gid = default(int?), |
| 1346 | 68 | | string sshPrivateKey = default(string)) |
| | 69 | | { |
| 1346 | 70 | | this.propertyContainer = new PropertyContainer(); |
| 1346 | 71 | | this.Uid = uid; |
| 1346 | 72 | | this.Gid = gid; |
| 1346 | 73 | | this.SshPrivateKey = sshPrivateKey; |
| 1346 | 74 | | } |
| | 75 | |
|
| 1413 | 76 | | internal LinuxUserConfiguration(Models.LinuxUserConfiguration protocolObject) |
| | 77 | | { |
| 1413 | 78 | | this.propertyContainer = new PropertyContainer(protocolObject); |
| 1413 | 79 | | } |
| | 80 | |
|
| | 81 | | #endregion Constructors |
| | 82 | |
|
| | 83 | | #region LinuxUserConfiguration |
| | 84 | |
|
| | 85 | | /// <summary> |
| | 86 | | /// Gets or sets the group ID of the user account. |
| | 87 | | /// </summary> |
| | 88 | | /// <remarks> |
| | 89 | | /// The <see cref="Uid" /> and <see cref="Gid" /> properties must be specified together or not at all. If not sp |
| | 90 | | /// the underlying operating system picks the gid. |
| | 91 | | /// </remarks> |
| | 92 | | public int? Gid |
| | 93 | | { |
| 3264 | 94 | | get { return this.propertyContainer.GidProperty.Value; } |
| 3953 | 95 | | set { this.propertyContainer.GidProperty.Value = value; } |
| | 96 | | } |
| | 97 | |
|
| | 98 | | /// <summary> |
| | 99 | | /// Gets or sets the SSH private key for the user account. |
| | 100 | | /// </summary> |
| | 101 | | /// <remarks> |
| | 102 | | /// The private key must not be password protected. The private key is used to automatically configure asymmetri |
| | 103 | | /// based authentication for SSH between nodes in a Linux pool when the pool's <see cref="CloudPool.InterCompute |
| | 104 | | /// property is true (it is ignored if <see cref="CloudPool.InterComputeNodeCommunicationEnabled"/> is false). I |
| | 105 | | /// does this by placing the key pair into the user's .ssh directory. If not specified, password-less SSH is not |
| | 106 | | /// configured between nodes (no modification of the user's .ssh directory is done) |
| | 107 | | /// </remarks> |
| | 108 | | public string SshPrivateKey |
| | 109 | | { |
| 3264 | 110 | | get { return this.propertyContainer.SshPrivateKeyProperty.Value; } |
| 3989 | 111 | | set { this.propertyContainer.SshPrivateKeyProperty.Value = value; } |
| | 112 | | } |
| | 113 | |
|
| | 114 | | /// <summary> |
| | 115 | | /// Gets or sets the user ID of the user account. |
| | 116 | | /// </summary> |
| | 117 | | /// <remarks> |
| | 118 | | /// The <see cref="Uid" /> and <see cref="Gid" /> properties must be specified together or not at all. If not sp |
| | 119 | | /// the underlying operating system picks the uid. |
| | 120 | | /// </remarks> |
| | 121 | | public int? Uid |
| | 122 | | { |
| 3264 | 123 | | get { return this.propertyContainer.UidProperty.Value; } |
| 4015 | 124 | | set { this.propertyContainer.UidProperty.Value = value; } |
| | 125 | | } |
| | 126 | |
|
| | 127 | | #endregion // LinuxUserConfiguration |
| | 128 | |
|
| | 129 | | #region IPropertyMetadata |
| | 130 | |
|
| | 131 | | bool IModifiable.HasBeenModified |
| | 132 | | { |
| 0 | 133 | | get { return this.propertyContainer.HasBeenModified; } |
| | 134 | | } |
| | 135 | |
|
| | 136 | | bool IReadOnly.IsReadOnly |
| | 137 | | { |
| 0 | 138 | | get { return this.propertyContainer.IsReadOnly; } |
| 11822 | 139 | | set { this.propertyContainer.IsReadOnly = value; } |
| | 140 | | } |
| | 141 | |
|
| | 142 | | #endregion //IPropertyMetadata |
| | 143 | |
|
| | 144 | | #region Internal/private methods |
| | 145 | | /// <summary> |
| | 146 | | /// Return a protocol object of the requested type. |
| | 147 | | /// </summary> |
| | 148 | | /// <returns>The protocol object of the requested type.</returns> |
| | 149 | | Models.LinuxUserConfiguration ITransportObjectProvider<Models.LinuxUserConfiguration>.GetTransportObject() |
| | 150 | | { |
| 925 | 151 | | Models.LinuxUserConfiguration result = new Models.LinuxUserConfiguration() |
| 925 | 152 | | { |
| 925 | 153 | | Gid = this.Gid, |
| 925 | 154 | | SshPrivateKey = this.SshPrivateKey, |
| 925 | 155 | | Uid = this.Uid, |
| 925 | 156 | | }; |
| | 157 | |
|
| 925 | 158 | | return result; |
| | 159 | | } |
| | 160 | |
|
| | 161 | |
|
| | 162 | | #endregion // Internal/private methods |
| | 163 | | } |
| | 164 | | } |