/
BatchUserAccount.cs
66 lines (59 loc) · 4.14 KB
/
BatchUserAccount.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using Azure.Core;
namespace Azure.ResourceManager.Batch.Models
{
/// <summary> Properties used to create a user on an Azure Batch node. </summary>
public partial class BatchUserAccount
{
/// <summary> Initializes a new instance of <see cref="BatchUserAccount"/>. </summary>
/// <param name="name"> The name of the user account. Names can contain any Unicode characters up to a maximum length of 20. </param>
/// <param name="password"> The password for the user account. </param>
/// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="password"/> is null. </exception>
public BatchUserAccount(string name, string password)
{
Argument.AssertNotNull(name, nameof(name));
Argument.AssertNotNull(password, nameof(password));
Name = name;
Password = password;
}
/// <summary> Initializes a new instance of <see cref="BatchUserAccount"/>. </summary>
/// <param name="name"> The name of the user account. Names can contain any Unicode characters up to a maximum length of 20. </param>
/// <param name="password"> The password for the user account. </param>
/// <param name="elevationLevel"> nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. </param>
/// <param name="linuxUserConfiguration"> This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. </param>
/// <param name="windowsUserConfiguration"> This property can only be specified if the user is on a Windows pool. If not specified and on a Windows pool, the user is created with the default options. </param>
internal BatchUserAccount(string name, string password, BatchUserAccountElevationLevel? elevationLevel, BatchLinuxUserConfiguration linuxUserConfiguration, BatchWindowsUserConfiguration windowsUserConfiguration)
{
Name = name;
Password = password;
ElevationLevel = elevationLevel;
LinuxUserConfiguration = linuxUserConfiguration;
WindowsUserConfiguration = windowsUserConfiguration;
}
/// <summary> The name of the user account. Names can contain any Unicode characters up to a maximum length of 20. </summary>
public string Name { get; set; }
/// <summary> The password for the user account. </summary>
public string Password { get; set; }
/// <summary> nonAdmin - The auto user is a standard user without elevated access. admin - The auto user is a user with elevated access and operates with full Administrator permissions. The default value is nonAdmin. </summary>
public BatchUserAccountElevationLevel? ElevationLevel { get; set; }
/// <summary> This property is ignored if specified on a Windows pool. If not specified, the user is created with the default options. </summary>
public BatchLinuxUserConfiguration LinuxUserConfiguration { get; set; }
/// <summary> This property can only be specified if the user is on a Windows pool. If not specified and on a Windows pool, the user is created with the default options. </summary>
internal BatchWindowsUserConfiguration WindowsUserConfiguration { get; set; }
/// <summary> Specifies login mode for the user. The default value for VirtualMachineConfiguration pools is interactive mode and for CloudServiceConfiguration pools is batch mode. </summary>
public BatchWindowsLoginMode? WindowsUserLoginMode
{
get => WindowsUserConfiguration is null ? default : WindowsUserConfiguration.LoginMode;
set
{
if (WindowsUserConfiguration is null)
WindowsUserConfiguration = new BatchWindowsUserConfiguration();
WindowsUserConfiguration.LoginMode = value;
}
}
}
}