| | 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 | | /// Specifies the set of OAuth 2.0 permission scopes and app roles under |
| | 21 | | /// the specified resource that an application requires access to. The |
| | 22 | | /// specified OAuth 2.0 permission scopes may be requested by client |
| | 23 | | /// applications (through the requiredResourceAccess collection) when |
| | 24 | | /// calling a resource application. The requiredResourceAccess property of |
| | 25 | | /// the Application entity is a collection of RequiredResourceAccess. |
| | 26 | | /// </summary> |
| | 27 | | public partial class RequiredResourceAccess |
| | 28 | | { |
| | 29 | | /// <summary> |
| | 30 | | /// Initializes a new instance of the RequiredResourceAccess class. |
| | 31 | | /// </summary> |
| 0 | 32 | | public RequiredResourceAccess() |
| | 33 | | { |
| | 34 | | CustomInit(); |
| 0 | 35 | | } |
| | 36 | |
|
| | 37 | | /// <summary> |
| | 38 | | /// Initializes a new instance of the RequiredResourceAccess class. |
| | 39 | | /// </summary> |
| | 40 | | /// <param name="resourceAccess">The list of OAuth2.0 permission scopes |
| | 41 | | /// and app roles that the application requires from the specified |
| | 42 | | /// resource.</param> |
| | 43 | | /// <param name="additionalProperties">Unmatched properties from the |
| | 44 | | /// message are deserialized this collection</param> |
| | 45 | | /// <param name="resourceAppId">The unique identifier for the resource |
| | 46 | | /// that the application requires access to. This should be equal to |
| | 47 | | /// the appId declared on the target resource application.</param> |
| 0 | 48 | | public RequiredResourceAccess(IList<ResourceAccess> resourceAccess, IDictionary<string, object> additionalProper |
| | 49 | | { |
| 0 | 50 | | AdditionalProperties = additionalProperties; |
| 0 | 51 | | ResourceAccess = resourceAccess; |
| 0 | 52 | | ResourceAppId = resourceAppId; |
| | 53 | | CustomInit(); |
| 0 | 54 | | } |
| | 55 | |
|
| | 56 | | /// <summary> |
| | 57 | | /// An initialization method that performs custom operations like setting defaults |
| | 58 | | /// </summary> |
| | 59 | | partial void CustomInit(); |
| | 60 | |
|
| | 61 | | /// <summary> |
| | 62 | | /// Gets or sets unmatched properties from the message are deserialized |
| | 63 | | /// this collection |
| | 64 | | /// </summary> |
| | 65 | | [JsonExtensionData] |
| 0 | 66 | | public IDictionary<string, object> AdditionalProperties { get; set; } |
| | 67 | |
|
| | 68 | | /// <summary> |
| | 69 | | /// Gets or sets the list of OAuth2.0 permission scopes and app roles |
| | 70 | | /// that the application requires from the specified resource. |
| | 71 | | /// </summary> |
| | 72 | | [JsonProperty(PropertyName = "resourceAccess")] |
| 0 | 73 | | public IList<ResourceAccess> ResourceAccess { get; set; } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// Gets or sets the unique identifier for the resource that the |
| | 77 | | /// application requires access to. This should be equal to the appId |
| | 78 | | /// declared on the target resource application. |
| | 79 | | /// </summary> |
| | 80 | | [JsonProperty(PropertyName = "resourceAppId")] |
| 0 | 81 | | public string ResourceAppId { get; set; } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Validate the object. |
| | 85 | | /// </summary> |
| | 86 | | /// <exception cref="ValidationException"> |
| | 87 | | /// Thrown if validation fails |
| | 88 | | /// </exception> |
| | 89 | | public virtual void Validate() |
| | 90 | | { |
| 0 | 91 | | if (ResourceAccess == null) |
| | 92 | | { |
| 0 | 93 | | throw new ValidationException(ValidationRules.CannotBeNull, "ResourceAccess"); |
| | 94 | | } |
| 0 | 95 | | if (ResourceAccess != null) |
| | 96 | | { |
| 0 | 97 | | foreach (var element in ResourceAccess) |
| | 98 | | { |
| 0 | 99 | | if (element != null) |
| | 100 | | { |
| 0 | 101 | | element.Validate(); |
| | 102 | | } |
| | 103 | | } |
| | 104 | | } |
| 0 | 105 | | } |
| | 106 | | } |
| | 107 | | } |