-
-
Notifications
You must be signed in to change notification settings - Fork 163
Expand file tree
/
Copy pathJsonApiEndpointsCopy.cs
More file actions
143 lines (127 loc) · 4.23 KB
/
JsonApiEndpointsCopy.cs
File metadata and controls
143 lines (127 loc) · 4.23 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
using JetBrains.Annotations;
namespace JsonApiDotNetCore.SourceGenerators;
/// <summary>
/// Lists the built-in JSON:API endpoints, described at https://jsonapi.org/format.
/// </summary>
[PublicAPI]
[Flags]
public enum JsonApiEndpointsCopy
{
// IMPORTANT: A copy of this type exists in the JsonApiDotNetCore.Annotations project.
// Keep them in sync when making changes.
/// <summary>
/// Represents none of the JSON:API endpoints.
/// </summary>
None = 0,
/// <summary>
/// Represents the endpoint to get a collection of primary resources.
/// <para>
/// Example endpoint: <code language="http"><![CDATA[
/// GET /articles HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
GetCollection = 1,
/// <summary>
/// Represents the endpoint to get a single primary resource by ID.
/// <para>
/// Example endpoint: <code language="http"><![CDATA[
/// GET /articles/1 HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
GetSingle = 1 << 1,
/// <summary>
/// Represents the endpoint to get a secondary resource or collection of secondary resources.
/// <para>
/// Example endpoints: <code language="http"><![CDATA[
/// GET /articles/1/author HTTP/1.1
/// ]]></code>
/// <code language="http"><![CDATA[
/// GET /articles/1/revisions HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
GetSecondary = 1 << 2,
/// <summary>
/// Represents the endpoint to get a relationship value.
/// <para>
/// Example endpoints: <code language="http"><![CDATA[
/// GET /articles/1/relationships/author HTTP/1.1
/// ]]></code>
/// <code language="http"><![CDATA[
/// GET /articles/1/relationships/revisions HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
GetRelationship = 1 << 3,
/// <summary>
/// Represents the endpoint to create a new resource with attributes, relationships, or both.
/// <para>
/// Example endpoint: <code language="http"><![CDATA[
/// POST /articles HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
Post = 1 << 4,
/// <summary>
/// Represents the endpoint to add resources to a to-many relationship.
/// <para>
/// Example endpoint: <code language="http"><![CDATA[
/// POST /articles/1/revisions HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
PostRelationship = 1 << 5,
/// <summary>
/// Represents the endpoint to update the attributes and/or relationships of an existing resource.
/// <para>
/// Example endpoint: <code language="http"><![CDATA[
/// PATCH /articles/1 HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
Patch = 1 << 6,
/// <summary>
/// Represents the endpoint to perform a complete replacement of a relationship on an existing resource.
/// <para>
/// Example endpoints: <code language="http"><![CDATA[
/// PATCH /articles/1/relationships/author HTTP/1.1
/// ]]></code>
/// <code language="http"><![CDATA[
/// PATCH /articles/1/relationships/revisions HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
PatchRelationship = 1 << 7,
/// <summary>
/// Represents the endpoint to delete an existing resource.
/// <para>
/// Example endpoint: <code language="http"><![CDATA[
/// DELETE /articles/1 HTTP/1.1
/// ]]></code>
/// </para>
/// </summary>
Delete = 1 << 8,
/// <summary>
/// Represents the endpoint to remove resources from a to-many relationship.
/// <para>
/// Example endpoint: <code language="http"><![CDATA[
/// DELETE /articles/1/relationships/revisions HTTP/1.1
/// ]]></code>
/// </para>
/// </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 JSON:API endpoints.
/// </summary>
All = Query | Command
}