forked from moul/node-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProjectVariables.coffee
More file actions
25 lines (19 loc) · 1.06 KB
/
Copy pathProjectVariables.coffee
File metadata and controls
25 lines (19 loc) · 1.06 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
BaseModel = require '../BaseModel'
Utils = require '../Utils'
class ProjectVariables extends BaseModel
list: (projectId, fn = null) =>
@debug "Projects::variables()"
@get "projects/#{Utils.parseProjectId projectId}/variables", (data) => fn data if fn
show: (projectId, variableKey, fn = null) =>
@debug "Projects::variable()"
@get "projects/#{Utils.parseProjectId projectId}/variables/#{variableKey}", (data) => fn data if fn
add: (projectId, params={}, fn = null) =>
@debug "Projects::addVariable()"
@post "projects/#{Utils.parseProjectId projectId}/variables", params, (data) => fn data if fn
update: (projectId, variableKey, fn = null) =>
@debug "Projects::saveVariable()"
@put "projects/#{Utils.parseProjectId projectId}/variables/#{variableKey}", params, (data) => fn data if fn
remove: (projectId, variableKey, fn = null) =>
@debug "Projects::removeVariable()"
@delete "projects/#{Utils.parseProjectId projectId}/variables/#{variableKey}", (data) => fn data if fn
module.exports = (client) -> new ProjectVariables client