From 9dfdf80af08cee3b2f0297843084fe14e3af31e7 Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Thu, 7 Feb 2019 03:57:25 +0100 Subject: Expose issue stopwatch toggling via API (#5970) --- templates/swagger/v1_json.tmpl | 106 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'templates/swagger') diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index c2ed1d75b8..d45a3d6d1b 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -2942,6 +2942,112 @@ } } }, + "/repos/{owner}/{repo}/issues/{index}/stopwatch/start": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Start stopwatch on an issue.", + "operationId": "issueStartStopWatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to create the stopwatch on", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/empty" + }, + "403": { + "description": "Not repo writer, user does not have rights to toggle stopwatch" + }, + "404": { + "description": "Issue not found" + }, + "409": { + "description": "Cannot start a stopwatch again if it already exists" + } + } + } + }, + "/repos/{owner}/{repo}/issues/{index}/stopwatch/stop": { + "post": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "issue" + ], + "summary": "Stop an issue's existing stopwatch.", + "operationId": "issueStopWatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "integer", + "format": "int64", + "description": "index of the issue to stop the stopwatch on", + "name": "index", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "$ref": "#/responses/empty" + }, + "403": { + "description": "Not repo writer, user does not have rights to toggle stopwatch" + }, + "404": { + "description": "Issue not found" + }, + "409": { + "description": "Cannot stop a non existent stopwatch" + } + } + } + }, "/repos/{owner}/{repo}/keys": { "get": { "produces": [ -- cgit v1.2.3