mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
Adding variables to groups and projects
This commit is contained in:
parent
bc9c081d0e
commit
d78e194bcc
@ -32,6 +32,37 @@ export class Groups extends BaseService {
|
||||
search: nameOrPath,
|
||||
});
|
||||
}
|
||||
|
||||
// Variables
|
||||
createVariable(groupId, options) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.post(this, `groups/${gId}/variables`, options);
|
||||
}
|
||||
|
||||
editVariable(groupId, keyId, options) {
|
||||
const [gId, kId] = [groupId, keyId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.put(this, `groups/${gId}/variables/${kId}`, options);
|
||||
}
|
||||
|
||||
variables(groupId) {
|
||||
const gId = encodeURIComponent(groupId);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/variables`);
|
||||
}
|
||||
|
||||
showVariable(groupId, keyId) {
|
||||
const [gId, kId] = [groupId, keyId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.get(this, `groups/${gId}/variables/${kId}`);
|
||||
}
|
||||
|
||||
removeVariable(groupId, keyId) {
|
||||
const [gId, kId] = [groupId, keyId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `groups/${gId}/variables/${kId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Groups;
|
||||
|
||||
@ -18,7 +18,7 @@ export class Projects extends BaseService {
|
||||
return RequestHelper.post(this, 'projects', options);
|
||||
}
|
||||
|
||||
edit(projectId, options = {}) {
|
||||
edit(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.put(this, `projects/${pId}`, options);
|
||||
@ -32,7 +32,7 @@ export class Projects extends BaseService {
|
||||
return RequestHelper.get(this, `projects/${pId}/events`, options);
|
||||
}
|
||||
|
||||
fork(projectId, options = {}) {
|
||||
fork(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/fork`, options);
|
||||
@ -112,6 +112,37 @@ export class Projects extends BaseService {
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
// Variables
|
||||
createVariable(projectId, options) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.post(this, `projects/${pId}/variables`, options);
|
||||
}
|
||||
|
||||
editVariable(projectId, keyId, options) {
|
||||
const [pId, kId] = [projectId, keyId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.put(this, `projects/${pId}/variables/${kId}`, options);
|
||||
}
|
||||
|
||||
variables(projectId) {
|
||||
const pId = encodeURIComponent(projectId);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/variables`);
|
||||
}
|
||||
|
||||
showVariable(projectId, keyId) {
|
||||
const [pId, kId] = [projectId, keyId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.get(this, `projects/${pId}/variables/${kId}`);
|
||||
}
|
||||
|
||||
removeVariable(projectId, keyId) {
|
||||
const [pId, kId] = [projectId, keyId].map(encodeURIComponent);
|
||||
|
||||
return RequestHelper.delete(this, `projects/${pId}/variables/${kId}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default Projects;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user