|
6 | 6 | import javax.ws.rs.core.Form; |
7 | 7 | import javax.ws.rs.core.MultivaluedHashMap; |
8 | 8 |
|
| 9 | +import org.gitlab4j.api.models.AccessLevel; |
9 | 10 | import org.gitlab4j.api.utils.ISO8601; |
10 | 11 |
|
11 | 12 | /** |
@@ -68,6 +69,30 @@ public GitLabApiForm withParam(String name, Date date, boolean required) throws |
68 | 69 | return (withParam(name, (date == null ? null : ISO8601.toString(date)), required)); |
69 | 70 | } |
70 | 71 |
|
| 72 | + /** |
| 73 | + * Fluent method for adding AccessLevel query and form parameters to a get() or post() call. |
| 74 | + * |
| 75 | + * @param name the name of the field/attribute to add |
| 76 | + * @param date the value of the field/attribute to add |
| 77 | + * @return this GitLabAPiForm instance |
| 78 | + */ |
| 79 | + public GitLabApiForm withParam(String name, AccessLevel level) throws IllegalArgumentException { |
| 80 | + return (withParam(name, level, false)); |
| 81 | + } |
| 82 | + |
| 83 | + /** |
| 84 | + * Fluent method for adding AccessLevel query and form parameters to a get() or post() call. |
| 85 | + * |
| 86 | + * @param name the name of the field/attribute to add |
| 87 | + * @param level the value of the field/attribute to add |
| 88 | + * @param required the field is required flag |
| 89 | + * @return this GitLabAPiForm instance |
| 90 | + * @throws IllegalArgumentException if a required parameter is null or empty |
| 91 | + */ |
| 92 | + public GitLabApiForm withParam(String name, AccessLevel level, boolean required) throws IllegalArgumentException { |
| 93 | + return (withParam(name, (level == null ? null : level.toValue()), required)); |
| 94 | + } |
| 95 | + |
71 | 96 | /** |
72 | 97 | * Fluent method for adding a List type query and form parameters to a get() or post() call. |
73 | 98 | * |
|
0 commit comments