-
-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathResourceLinksAttribute.shared.cs
30 lines (26 loc) · 1.33 KB
/
ResourceLinksAttribute.shared.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
using JetBrains.Annotations;
namespace JsonApiDotNetCore.Resources.Annotations;
/// <summary>
/// When put on a resource class, overrides global configuration for which links to render.
/// </summary>
[PublicAPI]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public sealed class ResourceLinksAttribute : Attribute
{
/// <summary>
/// Configures which links to write in the top-level links object for this resource type. Defaults to <see cref="LinkTypes.NotConfigured" />, which falls
/// back to TopLevelLinks in global options.
/// </summary>
public LinkTypes TopLevelLinks { get; set; }
/// <summary>
/// Configures which links to write in the resource-level links object for this resource type. Defaults to <see cref="LinkTypes.NotConfigured" />, which
/// falls back to ResourceLinks in global options.
/// </summary>
public LinkTypes ResourceLinks { get; set; }
/// <summary>
/// Configures which links to write in the relationship-level links object for all relationships of this resource type. Defaults to
/// <see cref="LinkTypes.NotConfigured" />, which falls back to RelationshipLinks in global options. This can be overruled per relationship by setting
/// <see cref="RelationshipAttribute.Links" />.
/// </summary>
public LinkTypes RelationshipLinks { get; set; }
}