|  |  | 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 service principal. | 
|  |  | 21 |  |     /// </summary> | 
|  |  | 22 |  |     public partial class ServicePrincipalCreateParameters : ServicePrincipalBase | 
|  |  | 23 |  |     { | 
|  |  | 24 |  |         /// <summary> | 
|  |  | 25 |  |         /// Initializes a new instance of the ServicePrincipalCreateParameters | 
|  |  | 26 |  |         /// class. | 
|  |  | 27 |  |         /// </summary> | 
|  | 0 | 28 |  |         public ServicePrincipalCreateParameters() | 
|  |  | 29 |  |         { | 
|  |  | 30 |  |             CustomInit(); | 
|  | 0 | 31 |  |         } | 
|  |  | 32 |  |  | 
|  |  | 33 |  |         /// <summary> | 
|  |  | 34 |  |         /// Initializes a new instance of the ServicePrincipalCreateParameters | 
|  |  | 35 |  |         /// class. | 
|  |  | 36 |  |         /// </summary> | 
|  |  | 37 |  |         /// <param name="appId">The application ID.</param> | 
|  |  | 38 |  |         /// <param name="accountEnabled">whether or not the service principal | 
|  |  | 39 |  |         /// account is enabled</param> | 
|  |  | 40 |  |         /// <param name="appRoleAssignmentRequired">Specifies whether an | 
|  |  | 41 |  |         /// AppRoleAssignment to a user or group is required before Azure AD | 
|  |  | 42 |  |         /// will issue a user or access token to the application.</param> | 
|  |  | 43 |  |         /// <param name="keyCredentials">The collection of key credentials | 
|  |  | 44 |  |         /// associated with the service principal.</param> | 
|  |  | 45 |  |         /// <param name="passwordCredentials">The collection of password | 
|  |  | 46 |  |         /// credentials associated with the service principal.</param> | 
|  |  | 47 |  |         /// <param name="servicePrincipalType">the type of the service | 
|  |  | 48 |  |         /// principal</param> | 
|  |  | 49 |  |         /// <param name="tags">Optional list of tags that you can apply to your | 
|  |  | 50 |  |         /// service principals. Not nullable.</param> | 
|  |  | 51 |  |         public ServicePrincipalCreateParameters(string appId, bool? accountEnabled = default(bool?), bool? appRoleAssign | 
|  | 0 | 52 |  |             : base(accountEnabled, appRoleAssignmentRequired, keyCredentials, passwordCredentials, servicePrincipalType, | 
|  |  | 53 |  |         { | 
|  | 0 | 54 |  |             AppId = appId; | 
|  |  | 55 |  |             CustomInit(); | 
|  | 0 | 56 |  |         } | 
|  |  | 57 |  |  | 
|  |  | 58 |  |         /// <summary> | 
|  |  | 59 |  |         /// An initialization method that performs custom operations like setting defaults | 
|  |  | 60 |  |         /// </summary> | 
|  |  | 61 |  |         partial void CustomInit(); | 
|  |  | 62 |  |  | 
|  |  | 63 |  |         /// <summary> | 
|  |  | 64 |  |         /// Gets or sets the application ID. | 
|  |  | 65 |  |         /// </summary> | 
|  |  | 66 |  |         [JsonProperty(PropertyName = "appId")] | 
|  | 0 | 67 |  |         public string AppId { get; set; } | 
|  |  | 68 |  |  | 
|  |  | 69 |  |         /// <summary> | 
|  |  | 70 |  |         /// Validate the object. | 
|  |  | 71 |  |         /// </summary> | 
|  |  | 72 |  |         /// <exception cref="ValidationException"> | 
|  |  | 73 |  |         /// Thrown if validation fails | 
|  |  | 74 |  |         /// </exception> | 
|  |  | 75 |  |         public virtual void Validate() | 
|  |  | 76 |  |         { | 
|  | 0 | 77 |  |             if (AppId == null) | 
|  |  | 78 |  |             { | 
|  | 0 | 79 |  |                 throw new ValidationException(ValidationRules.CannotBeNull, "AppId"); | 
|  |  | 80 |  |             } | 
|  | 0 | 81 |  |         } | 
|  |  | 82 |  |     } | 
|  |  | 83 |  | } |