Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
8deffb3e
Commit
8deffb3e
authored
Apr 10, 2019
by
Greg Messner
Browse files
Added createVariable() and updateVariable() methods without the environmentScope param (#330).
parent
04561b0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
8deffb3e
...
...
@@ -2494,6 +2494,24 @@ public class ProjectApi extends AbstractApi implements Constants {
* @param key the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, required
* @param value the value for the variable, required
* @param isProtected whether the variable is protected, optional
* @return a Variable instance with the newly created variable
* @throws GitLabApiException if any exception occurs during execution
*/
public
Variable
createVariable
(
Object
projectIdOrPath
,
String
key
,
String
value
,
Boolean
isProtected
)
throws
GitLabApiException
{
return
(
createVariable
(
projectIdOrPath
,
key
,
value
,
isProtected
,
null
));
}
/**
* Create a new project variable.
*
* <p>NOTE: Setting the environmentScope is only available on GitLab EE.</p>
*
* <pre><code>GitLab Endpoint: POST /projects/:id/variables</code></pre>
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param key the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, required
* @param value the value for the variable, required
* @param isProtected whether the variable is protected, optional
* @param environmentScope the environment_scope of the variable, optional
* @return a Variable instance with the newly created variable
* @throws GitLabApiException if any exception occurs during execution
...
...
@@ -2518,7 +2536,25 @@ public class ProjectApi extends AbstractApi implements Constants {
* @param key the key of an existing variable, required
* @param value the value for the variable, required
* @param isProtected whether the variable is protected, optional
* @param environmentScope the environment_scope of the variable, optional
* @return a Variable instance with the updated variable
* @throws GitLabApiException if any exception occurs during execution
*/
public
Variable
updateVariable
(
Object
projectIdOrPath
,
String
key
,
String
value
,
Boolean
isProtected
)
throws
GitLabApiException
{
return
(
updateVariable
(
projectIdOrPath
,
key
,
value
,
isProtected
,
null
));
}
/**
* Update a project variable.
*
* <p>NOTE: Updating the environmentScope is only available on GitLab EE.</p>
*
* <pre><code>GitLab Endpoint: PUT /projects/:id/variables/:key</code></pre>
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param key the key of an existing variable, required
* @param value the value for the variable, required
* @param isProtected whether the variable is protected, optional
* @param environmentScope the environment_scope of the variable, optional.
* @return a Variable instance with the updated variable
* @throws GitLabApiException if any exception occurs during execution
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment