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
d839d8ec
Commit
d839d8ec
authored
Jul 11, 2018
by
Greg Messner
Browse files
Added withParam() method that takes AccessLevel as the value (#223).
parent
8c7ac21f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GitLabApiForm.java
View file @
d839d8ec
...
@@ -6,6 +6,7 @@ import java.util.List;
...
@@ -6,6 +6,7 @@ import java.util.List;
import
javax.ws.rs.core.Form
;
import
javax.ws.rs.core.Form
;
import
javax.ws.rs.core.MultivaluedHashMap
;
import
javax.ws.rs.core.MultivaluedHashMap
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.utils.ISO8601
;
import
org.gitlab4j.api.utils.ISO8601
;
/**
/**
...
@@ -68,6 +69,30 @@ public class GitLabApiForm extends Form {
...
@@ -68,6 +69,30 @@ public class GitLabApiForm extends Form {
return
(
withParam
(
name
,
(
date
==
null
?
null
:
ISO8601
.
toString
(
date
)),
required
));
return
(
withParam
(
name
,
(
date
==
null
?
null
:
ISO8601
.
toString
(
date
)),
required
));
}
}
/**
* Fluent method for adding AccessLevel query and form parameters to a get() or post() call.
*
* @param name the name of the field/attribute to add
* @param date the value of the field/attribute to add
* @return this GitLabAPiForm instance
*/
public
GitLabApiForm
withParam
(
String
name
,
AccessLevel
level
)
throws
IllegalArgumentException
{
return
(
withParam
(
name
,
level
,
false
));
}
/**
* Fluent method for adding AccessLevel query and form parameters to a get() or post() call.
*
* @param name the name of the field/attribute to add
* @param level the value of the field/attribute to add
* @param required the field is required flag
* @return this GitLabAPiForm instance
* @throws IllegalArgumentException if a required parameter is null or empty
*/
public
GitLabApiForm
withParam
(
String
name
,
AccessLevel
level
,
boolean
required
)
throws
IllegalArgumentException
{
return
(
withParam
(
name
,
(
level
==
null
?
null
:
level
.
toValue
()),
required
));
}
/**
/**
* Fluent method for adding a List type query and form parameters to a get() or post() call.
* Fluent method for adding a List type query and form parameters to a get() or post() call.
*
*
...
...
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