| | | 1 | | // <auto-generated> |
| | | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | | 4 | | // license information. |
| | | 5 | | // |
| | | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 8 | | // regenerated. |
| | | 9 | | // </auto-generated> |
| | | 10 | | |
| | | 11 | | namespace Microsoft.Azure.Graph.RBAC.Models |
| | | 12 | | { |
| | | 13 | | using Microsoft.Rest; |
| | | 14 | | using Newtonsoft.Json; |
| | | 15 | | using System.Collections; |
| | | 16 | | using System.Collections.Generic; |
| | | 17 | | using System.Linq; |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// Request parameters for creating a new work or school account user. |
| | | 21 | | /// </summary> |
| | | 22 | | public partial class UserCreateParameters : UserBase |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// Initializes a new instance of the UserCreateParameters class. |
| | | 26 | | /// </summary> |
| | 4 | 27 | | public UserCreateParameters() |
| | | 28 | | { |
| | | 29 | | CustomInit(); |
| | 4 | 30 | | } |
| | | 31 | | |
| | | 32 | | /// <summary> |
| | | 33 | | /// Initializes a new instance of the UserCreateParameters class. |
| | | 34 | | /// </summary> |
| | | 35 | | /// <param name="accountEnabled">Whether the account is |
| | | 36 | | /// enabled.</param> |
| | | 37 | | /// <param name="displayName">The display name of the user.</param> |
| | | 38 | | /// <param name="passwordProfile">Password Profile</param> |
| | | 39 | | /// <param name="userPrincipalName">The user principal name |
| | | 40 | | /// (someuser@contoso.com). It must contain one of the verified domains |
| | | 41 | | /// for the tenant.</param> |
| | | 42 | | /// <param name="mailNickname">The mail alias for the user.</param> |
| | | 43 | | /// <param name="additionalProperties">Unmatched properties from the |
| | | 44 | | /// message are deserialized this collection</param> |
| | | 45 | | /// <param name="immutableId">This must be specified if you are using a |
| | | 46 | | /// federated domain for the user's userPrincipalName (UPN) property |
| | | 47 | | /// when creating a new user account. It is used to associate an |
| | | 48 | | /// on-premises Active Directory user account with their Azure AD user |
| | | 49 | | /// object.</param> |
| | | 50 | | /// <param name="usageLocation">A two letter country code (ISO standard |
| | | 51 | | /// 3166). Required for users that will be assigned licenses due to |
| | | 52 | | /// legal requirement to check for availability of services in |
| | | 53 | | /// countries. Examples include: "US", "JP", and "GB".</param> |
| | | 54 | | /// <param name="givenName">The given name for the user.</param> |
| | | 55 | | /// <param name="surname">The user's surname (family name or last |
| | | 56 | | /// name).</param> |
| | | 57 | | /// <param name="userType">A string value that can be used to classify |
| | | 58 | | /// user types in your directory, such as 'Member' and 'Guest'. |
| | | 59 | | /// Possible values include: 'Member', 'Guest'</param> |
| | | 60 | | /// <param name="mail">The primary email address of the user.</param> |
| | | 61 | | public UserCreateParameters(bool accountEnabled, string displayName, PasswordProfile passwordProfile, string use |
| | 0 | 62 | | : base(additionalProperties, immutableId, usageLocation, givenName, surname, userType) |
| | | 63 | | { |
| | 0 | 64 | | AccountEnabled = accountEnabled; |
| | 0 | 65 | | DisplayName = displayName; |
| | 0 | 66 | | PasswordProfile = passwordProfile; |
| | 0 | 67 | | UserPrincipalName = userPrincipalName; |
| | 0 | 68 | | MailNickname = mailNickname; |
| | 0 | 69 | | Mail = mail; |
| | | 70 | | CustomInit(); |
| | 0 | 71 | | } |
| | | 72 | | |
| | | 73 | | /// <summary> |
| | | 74 | | /// An initialization method that performs custom operations like setting defaults |
| | | 75 | | /// </summary> |
| | | 76 | | partial void CustomInit(); |
| | | 77 | | |
| | | 78 | | /// <summary> |
| | | 79 | | /// Gets or sets whether the account is enabled. |
| | | 80 | | /// </summary> |
| | | 81 | | [JsonProperty(PropertyName = "accountEnabled")] |
| | 8 | 82 | | public bool AccountEnabled { get; set; } |
| | | 83 | | |
| | | 84 | | /// <summary> |
| | | 85 | | /// Gets or sets the display name of the user. |
| | | 86 | | /// </summary> |
| | | 87 | | [JsonProperty(PropertyName = "displayName")] |
| | 12 | 88 | | public string DisplayName { get; set; } |
| | | 89 | | |
| | | 90 | | /// <summary> |
| | | 91 | | /// Gets or sets password Profile |
| | | 92 | | /// </summary> |
| | | 93 | | [JsonProperty(PropertyName = "passwordProfile")] |
| | 28 | 94 | | public PasswordProfile PasswordProfile { get; set; } |
| | | 95 | | |
| | | 96 | | /// <summary> |
| | | 97 | | /// Gets or sets the user principal name (someuser@contoso.com). It |
| | | 98 | | /// must contain one of the verified domains for the tenant. |
| | | 99 | | /// </summary> |
| | | 100 | | [JsonProperty(PropertyName = "userPrincipalName")] |
| | 12 | 101 | | public string UserPrincipalName { get; set; } |
| | | 102 | | |
| | | 103 | | /// <summary> |
| | | 104 | | /// Gets or sets the mail alias for the user. |
| | | 105 | | /// </summary> |
| | | 106 | | [JsonProperty(PropertyName = "mailNickname")] |
| | 12 | 107 | | public string MailNickname { get; set; } |
| | | 108 | | |
| | | 109 | | /// <summary> |
| | | 110 | | /// Gets or sets the primary email address of the user. |
| | | 111 | | /// </summary> |
| | | 112 | | [JsonProperty(PropertyName = "mail")] |
| | 0 | 113 | | public string Mail { get; set; } |
| | | 114 | | |
| | | 115 | | /// <summary> |
| | | 116 | | /// Validate the object. |
| | | 117 | | /// </summary> |
| | | 118 | | /// <exception cref="ValidationException"> |
| | | 119 | | /// Thrown if validation fails |
| | | 120 | | /// </exception> |
| | | 121 | | public virtual void Validate() |
| | | 122 | | { |
| | 4 | 123 | | if (DisplayName == null) |
| | | 124 | | { |
| | 0 | 125 | | throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); |
| | | 126 | | } |
| | 4 | 127 | | if (PasswordProfile == null) |
| | | 128 | | { |
| | 0 | 129 | | throw new ValidationException(ValidationRules.CannotBeNull, "PasswordProfile"); |
| | | 130 | | } |
| | 4 | 131 | | if (UserPrincipalName == null) |
| | | 132 | | { |
| | 0 | 133 | | throw new ValidationException(ValidationRules.CannotBeNull, "UserPrincipalName"); |
| | | 134 | | } |
| | 4 | 135 | | if (MailNickname == null) |
| | | 136 | | { |
| | 0 | 137 | | throw new ValidationException(ValidationRules.CannotBeNull, "MailNickname"); |
| | | 138 | | } |
| | 4 | 139 | | if (PasswordProfile != null) |
| | | 140 | | { |
| | 4 | 141 | | PasswordProfile.Validate(); |
| | | 142 | | } |
| | 4 | 143 | | } |
| | | 144 | | } |
| | | 145 | | } |