Skip to content

Commit 4a84a16

Browse files
committed
Add renewSecret
1 parent e53951b commit 4a84a16

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

gitlab4j-api/src/main/java/org/gitlab4j/api/ApplicationsApi.java

+15
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.stream.Collectors;
66
import java.util.stream.Stream;
77

8+
import jakarta.ws.rs.core.Form;
89
import jakarta.ws.rs.core.GenericType;
910
import jakarta.ws.rs.core.Response;
1011

@@ -155,4 +156,18 @@ public Application createApplication(
155156
public void deleteApplication(Long applicationId) throws GitLabApiException {
156157
delete(Response.Status.NO_CONTENT, null, "applications", applicationId);
157158
}
159+
160+
/**
161+
* Renews an application secret.
162+
*
163+
* <pre><code>GitLab Endpoint: POST /applications/:id/renew-secret</code></pre>
164+
*
165+
* @param applicationId the ID of the OUAUTH Application to renew
166+
* @return the updated Application instance
167+
* @throws GitLabApiException if any exception occurs
168+
*/
169+
public Application renewSecret(Long applicationId) throws GitLabApiException {
170+
Response response = post(Response.Status.CREATED, (Form) null, "applications", applicationId, "renew-secret");
171+
return (response.readEntity(Application.class));
172+
}
158173
}

0 commit comments

Comments
 (0)