-
-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathJsonApiEndpointsCopy.cs
109 lines (95 loc) · 3.42 KB
/
JsonApiEndpointsCopy.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
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
namespace JsonApiDotNetCore.SourceGenerators;
// IMPORTANT: A copy of this type exists in the JsonApiDotNetCore project. Keep these in sync when making changes.
[Flags]
public enum JsonApiEndpointsCopy
{
/// <summary>
/// Represents none of the JSON:API endpoints.
/// </summary>
None = 0,
/// <summary>
/// Represents the endpoint to get a collection of primary resources. Example: <code><![CDATA[
/// GET /articles HTTP/1.1
/// ]]></code>
/// </summary>
GetCollection = 1,
/// <summary>
/// Represents the endpoint to get a single primary resource by ID. Example: <code><![CDATA[
/// GET /articles/1 HTTP/1.1
/// ]]></code>
/// </summary>
GetSingle = 1 << 1,
/// <summary>
/// Represents the endpoint to get a secondary resource or collection of secondary resources. Example:
/// <code><![CDATA[
/// GET /articles/1/author HTTP/1.1
/// ]]></code> Example: <code><![CDATA[
/// GET /articles/1/revisions HTTP/1.1
/// ]]></code>
/// </summary>
GetSecondary = 1 << 2,
/// <summary>
/// Represents the endpoint to get a relationship value. Example: <code><![CDATA[
/// GET /articles/1/relationships/author HTTP/1.1
/// ]]></code> Example:
/// <code><![CDATA[
/// GET /articles/1/relationships/revisions HTTP/1.1
/// ]]></code>
/// </summary>
GetRelationship = 1 << 3,
/// <summary>
/// Represents the endpoint to create a new resource with attributes, relationships or both. Example:
/// <code><![CDATA[
/// POST /articles HTTP/1.1
/// ]]></code>
/// </summary>
Post = 1 << 4,
/// <summary>
/// Represents the endpoint to add resources to a to-many relationship. Example: <code><![CDATA[
/// POST /articles/1/revisions HTTP/1.1
/// ]]></code>
/// </summary>
PostRelationship = 1 << 5,
/// <summary>
/// Represents the endpoint to update the attributes and/or relationships of an existing resource. Example:
/// <code><![CDATA[
/// PATCH /articles/1
/// ]]></code>
/// </summary>
Patch = 1 << 6,
/// <summary>
/// Represents the endpoint to perform a complete replacement of a relationship on an existing resource. Example:
/// <code><![CDATA[
/// PATCH /articles/1/relationships/author HTTP/1.1
/// ]]></code> Example:
/// <code><![CDATA[
/// PATCH /articles/1/relationships/revisions HTTP/1.1
/// ]]></code>
/// </summary>
PatchRelationship = 1 << 7,
/// <summary>
/// Represents the endpoint to delete an existing resource. Example: <code><![CDATA[
/// DELETE /articles/1
/// ]]></code>
/// </summary>
Delete = 1 << 8,
/// <summary>
/// Represents the endpoint to remove resources from a to-many relationship. Example:
/// <code><![CDATA[
/// DELETE /articles/1/relationships/revisions
/// ]]></code>
/// </summary>
DeleteRelationship = 1 << 9,
/// <summary>
/// Represents the set of JSON:API endpoints to query resources and relationships.
/// </summary>
Query = GetCollection | GetSingle | GetSecondary | GetRelationship,
/// <summary>
/// Represents the set of JSON:API endpoints to change resources and relationships.
/// </summary>
Command = Post | PostRelationship | Patch | PatchRelationship | Delete | DeleteRelationship,
/// <summary>
/// Represents all of the JSON:API endpoints.
/// </summary>
All = Query | Command
}