Commit 6defea44 authored by Greg Messner's avatar Greg Messner
Browse files

Added setGroupAvatar() (#533)

parent 08fa8df0
package org.gitlab4j.api;
import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Optional;
......@@ -1471,4 +1472,20 @@ public class GroupApi extends AbstractApi {
Response response = get(Response.Status.OK, formData.asMap(), "groups", getGroupIdOrPath(groupIdOrPath), "badges", "render");
return (response.readEntity(Badge.class));
}
/**
* Uploads and sets the project avatar for the specified group.
*
* <pre><code>GitLab Endpoint: PUT /groups/:id</code></pre>
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
* @param avatarFile the File instance of the avatar file to upload
* @return the updated Group instance
* @throws GitLabApiException if any exception occurs
*/
public Group setGroupAvatar(Object groupIdOrPath, File avatarFile) throws GitLabApiException {
Response response = putUpload(Response.Status.OK,
"avatar", avatarFile, "groups", getGroupIdOrPath(groupIdOrPath));
return (response.readEntity(Group.class));
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment