|
2 | 2 |
|
3 | 3 | namespace JsonApiDotNetCore.Controllers; |
4 | 4 |
|
5 | | -// IMPORTANT: An internal copy of this type exists in the SourceGenerators project. Keep these in sync when making changes. |
| 5 | +/// <summary> |
| 6 | +/// Lists the built-in JSON:API endpoints, described at https://jsonapi.org/format. |
| 7 | +/// </summary> |
6 | 8 | [PublicAPI] |
7 | 9 | [Flags] |
8 | 10 | public enum JsonApiEndpoints |
9 | 11 | { |
| 12 | + // IMPORTANT: An internal copy of this type exists in the JsonApiDotNetCore.SourceGenerators project. |
| 13 | + // Keep them in sync when making changes. |
| 14 | + |
| 15 | + /// <summary> |
| 16 | + /// Represents none of the JSON:API endpoints. |
| 17 | + /// </summary> |
10 | 18 | None = 0, |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// Represents the endpoint to get a collection of primary resources. |
| 22 | + /// <para> |
| 23 | + /// Example endpoint: <code language="http"><![CDATA[ |
| 24 | + /// GET /articles HTTP/1.1 |
| 25 | + /// ]]></code> |
| 26 | + /// </para> |
| 27 | + /// </summary> |
11 | 28 | GetCollection = 1, |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// Represents the endpoint to get a single primary resource by ID. |
| 32 | + /// <para> |
| 33 | + /// Example endpoint: <code language="http"><![CDATA[ |
| 34 | + /// GET /articles/1 HTTP/1.1 |
| 35 | + /// ]]></code> |
| 36 | + /// </para> |
| 37 | + /// </summary> |
12 | 38 | GetSingle = 1 << 1, |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Represents the endpoint to get a secondary resource or collection of secondary resources. |
| 42 | + /// <para> |
| 43 | + /// Example endpoints: <code language="http"><![CDATA[ |
| 44 | + /// GET /articles/1/author HTTP/1.1 |
| 45 | + /// ]]></code> |
| 46 | + /// <code language="http"><![CDATA[ |
| 47 | + /// GET /articles/1/revisions HTTP/1.1 |
| 48 | + /// ]]></code> |
| 49 | + /// </para> |
| 50 | + /// </summary> |
13 | 51 | GetSecondary = 1 << 2, |
| 52 | + |
| 53 | + /// <summary> |
| 54 | + /// Represents the endpoint to get a relationship value. |
| 55 | + /// <para> |
| 56 | + /// Example endpoints: <code language="http"><![CDATA[ |
| 57 | + /// GET /articles/1/relationships/author HTTP/1.1 |
| 58 | + /// ]]></code> |
| 59 | + /// <code language="http"><![CDATA[ |
| 60 | + /// GET /articles/1/relationships/revisions HTTP/1.1 |
| 61 | + /// ]]></code> |
| 62 | + /// </para> |
| 63 | + /// </summary> |
14 | 64 | GetRelationship = 1 << 3, |
| 65 | + |
| 66 | + /// <summary> |
| 67 | + /// Represents the endpoint to create a new resource with attributes, relationships, or both. |
| 68 | + /// <para> |
| 69 | + /// Example endpoint: <code language="http"><![CDATA[ |
| 70 | + /// POST /articles HTTP/1.1 |
| 71 | + /// ]]></code> |
| 72 | + /// </para> |
| 73 | + /// </summary> |
15 | 74 | Post = 1 << 4, |
| 75 | + |
| 76 | + /// <summary> |
| 77 | + /// Represents the endpoint to add resources to a to-many relationship. |
| 78 | + /// <para> |
| 79 | + /// Example endpoint: <code language="http"><![CDATA[ |
| 80 | + /// POST /articles/1/revisions HTTP/1.1 |
| 81 | + /// ]]></code> |
| 82 | + /// </para> |
| 83 | + /// </summary> |
16 | 84 | PostRelationship = 1 << 5, |
| 85 | + |
| 86 | + /// <summary> |
| 87 | + /// Represents the endpoint to update the attributes and/or relationships of an existing resource. |
| 88 | + /// <para> |
| 89 | + /// Example endpoint: <code language="http"><![CDATA[ |
| 90 | + /// PATCH /articles/1 HTTP/1.1 |
| 91 | + /// ]]></code> |
| 92 | + /// </para> |
| 93 | + /// </summary> |
17 | 94 | Patch = 1 << 6, |
| 95 | + |
| 96 | + /// <summary> |
| 97 | + /// Represents the endpoint to perform a complete replacement of a relationship on an existing resource. |
| 98 | + /// <para> |
| 99 | + /// Example endpoints: <code language="http"><![CDATA[ |
| 100 | + /// PATCH /articles/1/relationships/author HTTP/1.1 |
| 101 | + /// ]]></code> |
| 102 | + /// <code language="http"><![CDATA[ |
| 103 | + /// PATCH /articles/1/relationships/revisions HTTP/1.1 |
| 104 | + /// ]]></code> |
| 105 | + /// </para> |
| 106 | + /// </summary> |
18 | 107 | PatchRelationship = 1 << 7, |
| 108 | + |
| 109 | + /// <summary> |
| 110 | + /// Represents the endpoint to delete an existing resource. |
| 111 | + /// <para> |
| 112 | + /// Example endpoint: <code language="http"><![CDATA[ |
| 113 | + /// DELETE /articles/1 HTTP/1.1 |
| 114 | + /// ]]></code> |
| 115 | + /// </para> |
| 116 | + /// </summary> |
19 | 117 | Delete = 1 << 8, |
| 118 | + |
| 119 | + /// <summary> |
| 120 | + /// Represents the endpoint to remove resources from a to-many relationship. |
| 121 | + /// <para> |
| 122 | + /// Example endpoint: <code language="http"><![CDATA[ |
| 123 | + /// DELETE /articles/1/relationships/revisions HTTP/1.1 |
| 124 | + /// ]]></code> |
| 125 | + /// </para> |
| 126 | + /// </summary> |
20 | 127 | DeleteRelationship = 1 << 9, |
21 | 128 |
|
| 129 | + /// <summary> |
| 130 | + /// Represents the set of JSON:API endpoints to query resources and relationships. |
| 131 | + /// </summary> |
22 | 132 | Query = GetCollection | GetSingle | GetSecondary | GetRelationship, |
| 133 | + |
| 134 | + /// <summary> |
| 135 | + /// Represents the set of JSON:API endpoints to change resources and relationships. |
| 136 | + /// </summary> |
23 | 137 | Command = Post | PostRelationship | Patch | PatchRelationship | Delete | DeleteRelationship, |
24 | 138 |
|
| 139 | + /// <summary> |
| 140 | + /// Represents all JSON:API endpoints. |
| 141 | + /// </summary> |
25 | 142 | All = Query | Command |
26 | 143 | } |
0 commit comments