Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Erasmus <jerasmus@gitlab.com>2018-12-18 11:59:50 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2018-12-18 11:59:50 +0300
commit862c5635bc12f6c64f56a517fd1473c3c0acf133 (patch)
treeabb1fd29c1ed5bc6b2aeb11ec16009f79e57d982 /doc/api/suggestions.md
parentaa343d546c529c571e6c156366b62d2f721fe92e (diff)
Suggest diff line change documentation
Diffstat (limited to 'doc/api/suggestions.md')
-rw-r--r--doc/api/suggestions.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/api/suggestions.md b/doc/api/suggestions.md
new file mode 100644
index 00000000000..9d76ef0c4bf
--- /dev/null
+++ b/doc/api/suggestions.md
@@ -0,0 +1,36 @@
+# Suggest Changes API
+
+Every API call to suggestions must be authenticated.
+
+## Applying suggestions
+
+Applies a suggested patch in a merge request. Users must be
+at least [Developer](../user/permissions.md) to perform such action.
+
+```
+PUT /suggestions/:id/apply
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `id` | integer/string | yes | The ID of a suggestion |
+
+```bash
+curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/suggestions/5/apply
+```
+
+Example response:
+
+```json
+ {
+ "id": 36,
+ "from_original_line": 10,
+ "to_original_line": 10,
+ "from_line": 10,
+ "to_line": 10,
+ "appliable": false,
+ "applied": true,
+ "from_content": " \"--talk-name=org.freedesktop.\",\n",
+ "to_content": " \"--talk-name=org.free.\",\n \"--talk-name=org.desktop.\",\n"
+ }
+```