-
-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathJsonApiEndpoints.shared.cs
More file actions
115 lines (99 loc) · 3.25 KB
/
JsonApiEndpoints.shared.cs
File metadata and controls
115 lines (99 loc) · 3.25 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using JetBrains.Annotations;
// ReSharper disable CheckNamespace
#pragma warning disable AV1505 // Namespace should match with assembly name
namespace JsonApiDotNetCore.Controllers;
// IMPORTANT: An internal copy of this type exists in the SourceGenerators project. Keep these in sync when making changes.
[PublicAPI]
[Flags]
public enum JsonApiEndpoints
{
None = 0,
/// <summary>
/// Endpoint to get a collection of primary resources.
/// </summary>
/// <example>
/// <code><![CDATA[GET /articles]]></code>
/// </example>
GetCollection = 1,
/// <summary>
/// Endpoint to get a single primary resource by ID.
/// </summary>
/// <example>
/// <code><![CDATA[GET /articles/1]]></code>
/// </example>
GetSingle = 1 << 1,
/// <summary>
/// Endpoint to get a secondary resource or collection of secondary resources.
/// </summary>
/// <example>
/// <code><![CDATA[GET /articles/1/author]]></code>
/// </example>
GetSecondary = 1 << 2,
/// <summary>
/// Endpoint to get a relationship value, which can be a <c>null</c>, a single object or a collection.
/// </summary>
/// <example>
/// <code><![CDATA[GET /articles/1/relationships/author]]></code>
/// </example>
/// <example>
/// <code><![CDATA[GET /articles/1/relationships/revisions]]></code>
/// </example>
GetRelationship = 1 << 3,
/// <summary>
/// Endpoint to creates a new resource with attributes, relationships or both.
/// </summary>
/// <example>
/// <code><![CDATA[POST /articles]]></code>
/// </example>
Post = 1 << 4,
/// <summary>
/// Endpoint to add resources to a to-many relationship.
/// </summary>
/// <example>
/// <code><![CDATA[POST /articles/1/revisions]]></code>
/// </example>
PostRelationship = 1 << 5,
/// <summary>
/// Endpoint to update the attributes and/or relationships of an existing resource.
/// </summary>
/// <example>
/// <code><![CDATA[PATCH /articles/1]]></code>
/// </example>
Patch = 1 << 6,
/// <summary>
/// Endpoint to perform a complete replacement of a relationship on an existing resource.
/// </summary>
/// <example>
/// <code><![CDATA[PATCH /articles/1/relationships/author]]></code>
/// </example>
/// <example>
/// <code><![CDATA[PATCH /articles/1/relationships/revisions]]></code>
/// </example>
PatchRelationship = 1 << 7,
/// <summary>
/// Endpoint to delete an existing resource.
/// </summary>
/// <example>
/// <code><![CDATA[DELETE /articles/1]]></code>
/// </example>
Delete = 1 << 8,
/// <summary>
/// Endpoint to remove resources from a to-many relationship.
/// </summary>
/// <example>
/// <code><![CDATA[DELETE /articles/1/relationships/revisions]]></code>
/// </example>
DeleteRelationship = 1 << 9,
/// <summary>
/// All read-only endpoints.
/// </summary>
Query = GetCollection | GetSingle | GetSecondary | GetRelationship,
/// <summary>
/// All write endpoints.
/// </summary>
Command = Post | PostRelationship | Patch | PatchRelationship | Delete | DeleteRelationship,
/// <summary>
/// All endpoints.
/// </summary>
All = Query | Command
}