Skip to content

Commit

Permalink
Merge branch 'master' into jobCleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
iamigo committed Aug 1, 2017
2 parents 2452014 + 9f2517b commit 369da33
Show file tree
Hide file tree
Showing 4 changed files with 415 additions and 0 deletions.
28 changes: 28 additions & 0 deletions api/v1/controllers/botData.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
'use strict';

const helper = require('../helpers/nouns/botData');
const doFind = require('../helpers/verbs/doFind');
const doGet = require('../helpers/verbs/doGet');
const doPatch = require('../helpers/verbs/doPatch');
const doDelete = require('../helpers/verbs/doDelete');

Expand Down Expand Up @@ -43,4 +45,30 @@ module.exports = {
doPatch(req, res, next, helper);
},

/**
* GET /botData/, /room/{roomID}/bot/{botID}/data, /room/{roomID}/data
*
* Finds zero or more botData and sends them back in the response.
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
findBotData(req, res, next) {
doFind(req, res, next, helper);
},

/**
* GET /botData/{key}
*
* Retrieves the botData and sends it back in the response.
*
* @param {IncomingMessage} req - The request object
* @param {ServerResponse} res - The response object
* @param {Function} next - The next middleware function in the stack
*/
getBotData(req, res, next) {
doGet(req, res, next, helper);
},

}; // exports
1 change: 1 addition & 0 deletions api/v1/helpers/nouns/botData.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const m = 'BotData';

module.exports = {
apiLinks: {
GET: `Retrieve ${m}`,
PATCH: `Update selected attributes of ${m}`,
DELETE: `Delete ${m}`,
},
Expand Down
147 changes: 147 additions & 0 deletions api/v1/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7536,8 +7536,76 @@ paths:
default:
$ref: "#/responses/genericError"
# =============================================================================
/botData:
x-swagger-router-controller: botData
get:
tags: [ botData ]
operationId: findBotData
parameters:
-
name: name
description: Filter botData by name
in: query
required: false
type: string
-
$ref: "#/parameters/limitParam"
-
$ref: "#/parameters/offsetParam"
responses:
200:
description: >-
Success, returns all botData
schema:
type: array
items:
$ref: "#/definitions/BotDataResponse"
400:
$ref: "#/responses/400"
401:
$ref: "#/responses/401"
404:
$ref: "#/responses/404"
default:
$ref: "#/responses/genericError"

# ---------------------------------------------------------------------------
/botData/{key}:
x-swagger-router-controller: botData
get:
summary: Retrieve a botData
tags: [ botData ]
operationId: getBotData
parameters:
-
name: key
in: path
description: >-
The id or name of the botData to retrieve
required: true
type: string
-
$ref: "#/parameters/limitParam"
-
$ref: "#/parameters/offsetParam"
responses:
200:
description: >-
Success, returns specified botData
schema:
type: array
items:
$ref: "#/definitions/BotDataResponse"
400:
$ref: "#/responses/400"
401:
$ref: "#/responses/401"
404:
$ref: "#/responses/404"
default:
$ref: "#/responses/genericError"


patch:
security:
- jwt: []
Expand Down Expand Up @@ -7623,6 +7691,85 @@ paths:
default:
$ref: "#/responses/genericError"

# ---------------------------------------------------------------------------
/rooms/{roomId}/data:
x-swagger-router-controller: botData
get:
summary: Retrieve bot data from a room
tags: [ rooms ]
operationId: findBotData
parameters:
-
name: roomId
in: path
description: >-
The id of the room to retrieve bot data from
required: true
type: integer
-
$ref: "#/parameters/limitParam"
-
$ref: "#/parameters/offsetParam"
responses:
200:
description: >-
Success, returns specified bot data
schema:
type: array
items:
$ref: "#/definitions/BotDataResponse"
400:
$ref: "#/responses/400"
401:
$ref: "#/responses/401"
404:
$ref: "#/responses/404"
default:
$ref: "#/responses/genericError"

# ---------------------------------------------------------------------------
/rooms/{roomId}/bots/{botId}/data:
x-swagger-router-controller: botData
get:
summary: Retrieve bot data from a room from a specific bot
tags: [ rooms ]
operationId: findBotData
parameters:
-
name: roomId
in: path
description: >-
The id of the room to retrieve bot data from
required: true
type: integer
-
name: botId
in: path
description: >-
The id of the bot which people want to reference
required: true
type: string
-
$ref: "#/parameters/limitParam"
-
$ref: "#/parameters/offsetParam"
responses:
200:
description: >-
Success, returns specified bot data
schema:
type: array
items:
$ref: "#/definitions/BotDataResponse"
400:
$ref: "#/responses/400"
401:
$ref: "#/responses/401"
404:
$ref: "#/responses/404"
default:
$ref: "#/responses/genericError"

# =============================================================================
/roomTypes:
x-swagger-router-controller: roomTypes
Expand Down
Loading

0 comments on commit 369da33

Please sign in to comment.