-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathResources.cs
More file actions
72 lines (61 loc) · 2.31 KB
/
Resources.cs
File metadata and controls
72 lines (61 loc) · 2.31 KB
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
67
68
69
70
71
72
// Copyright (c) Duende Software. All rights reserved.
// See LICENSE in the project root for license information.
#nullable enable
using System.Collections.Generic;
using System.Linq;
namespace Duende.IdentityServer.Models;
/// <summary>
/// Models a collection of identity and API resources.
/// </summary>
public class Resources
{
/// <summary>
/// Initializes a new instance of the <see cref="Resources"/> class.
/// </summary>
public Resources()
{
IdentityResources = new HashSet<IdentityResource>();
ApiResources = new HashSet<ApiResource>();
ApiScopes = new HashSet<ApiScope>();
}
/// <summary>
/// Initializes a new instance of the <see cref="Resources"/> class.
/// </summary>
/// <param name="other">The other.</param>
public Resources(Resources other)
: this(other.IdentityResources, other.ApiResources, other.ApiScopes)
{
OfflineAccess = other.OfflineAccess;
}
/// <summary>
/// Initializes a new instance of the <see cref="Resources"/> class.
/// </summary>
/// <param name="identityResources">The identity resources.</param>
/// <param name="apiResources">The API resources.</param>
/// <param name="apiScopes">The API scopes.</param>
public Resources(IEnumerable<IdentityResource>? identityResources, IEnumerable<ApiResource>? apiResources, IEnumerable<ApiScope>? apiScopes)
{
IdentityResources = identityResources?.ToHashSet() ?? new HashSet<IdentityResource>();
ApiResources = apiResources?.ToHashSet() ?? new HashSet<ApiResource>();
ApiScopes = apiScopes?.ToHashSet() ?? new HashSet<ApiScope>();
}
/// <summary>
/// Gets or sets a value indicating whether [offline access].
/// </summary>
/// <value>
/// <c>true</c> if [offline access]; otherwise, <c>false</c>.
/// </value>
public bool OfflineAccess { get; set; }
/// <summary>
/// Gets or sets the identity resources.
/// </summary>
public ICollection<IdentityResource> IdentityResources { get; set; }
/// <summary>
/// Gets or sets the API resources.
/// </summary>
public ICollection<ApiResource> ApiResources { get; set; }
/// <summary>
/// Gets or sets the API scopes.
/// </summary>
public ICollection<ApiScope> ApiScopes { get; set; }
}