@@ -2097,4 +2097,34 @@ public List<Project> getForks(Integer projectId, int page, int perPage) throws G
2097
2097
public Pager <Project > getForks (Integer projectId , int itemsPerPage ) throws GitLabApiException {
2098
2098
return new Pager <Project >(this , Project .class , itemsPerPage , null , "projects" , projectId , "forks" );
2099
2099
}
2100
+
2101
+ /**
2102
+ * Star a project.
2103
+ *
2104
+ * POST /projects/:id/star
2105
+ *
2106
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
2107
+ * @return a Project instance with the new project info
2108
+ * @throws GitLabApiException if any exception occurs
2109
+ */
2110
+ public Project starProject (Object projectIdOrPath ) throws GitLabApiException {
2111
+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .CREATED );
2112
+ Response response = post (expectedStatus , (Form ) null , "projects" , getProjectIdOrPath (projectIdOrPath ), "star" );
2113
+ return (response .readEntity (Project .class ));
2114
+ }
2115
+
2116
+ /**
2117
+ * Unstar a project.
2118
+ *
2119
+ * POST /projects/:id/unstar
2120
+ *
2121
+ * @param projectIdOrPath id, path of the project, or a Project instance holding the project ID or path
2122
+ * @return a Project instance with the new project info
2123
+ * @throws GitLabApiException if any exception occurs
2124
+ */
2125
+ public Project unstarProject (Object projectIdOrPath ) throws GitLabApiException {
2126
+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .CREATED );
2127
+ Response response = post (expectedStatus , (Form ) null , "projects" , getProjectIdOrPath (projectIdOrPath ), "unstar" );
2128
+ return (response .readEntity (Project .class ));
2129
+ }
2100
2130
}
0 commit comments