Merge pull request 'Add custom APIs to get files' (#3) from qwerty287/tea4j-autodeploy:files into main

Reviewed-on: https://codeberg.org/gitnex/tea4j-autodeploy/pulls/3
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
M M Arif
2022-07-20 20:22:45 +02:00
@@ -1,6 +1,7 @@
package org.gitnex.tea4j.v2.apis.custom;
import org.gitnex.tea4j.v2.models.*;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;
@@ -22,7 +23,7 @@ public interface CustomApi {
* @param repo name of the repo (required)
* @param id id of the comment to edit (required)
* @param body (optional)
* @return Call&lt;Void&gt;
* @return Call<Void>;
*/
@Headers({"Content-Type:application/json"})
@HTTP(
@@ -42,7 +43,7 @@ public interface CustomApi {
* @param repo name of the repo (required)
* @param index index of the issue (required)
* @param body (optional)
* @return Call&lt;Void&gt;
* @return Call<Void>;
*/
@Headers({"Content-Type:application/json"})
@HTTP(method = "DELETE", path = "repos/{owner}/{repo}/issues/{index}/reactions", hasBody = true)
@@ -59,7 +60,7 @@ public interface CustomApi {
* @param repo name of the repo (required)
* @param filepath path of the file to delete (required)
* @param body (required)
* @return Call&lt;FileDeleteResponse&gt;
* @return Call<FileDeleteResponse>;
*/
@Headers({"Content-Type:application/json"})
@HTTP(method = "DELETE", path = "repos/{owner}/{repo}/contents/{filepath}", hasBody = true)
@@ -76,7 +77,7 @@ public interface CustomApi {
* @param repo name of the repo (required)
* @param index index of the pull request (required)
* @param body (required)
* @return Call&lt;Void&gt;
* @return Call<Void>;
*/
@Headers({"Content-Type:application/json"})
@HTTP(
@@ -93,9 +94,43 @@ public interface CustomApi {
* Delete email addresses
*
* @param body (optional)
* @return Call&lt;Void&gt;
* @return Call<Void>;
*/
@Headers({"Content-Type:application/json"})
@HTTP(method = "DELETE", path = "user/emails", hasBody = true)
Call<Void> userDeleteEmailWithBody(@Body DeleteEmailOption body);
/**
* Get a file from a repository
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @param filepath filepath of the file to get (required)
* @param ref The name of the commit/branch/tag. Default the repositorys default branch (usually
* master) (optional)
* @return Call<ResponseBody>;
*/
@GET("repos/{owner}/{repo}/raw/{filepath}")
Call<ResponseBody> repoGetRawFile(
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("filepath") String filepath,
@retrofit2.http.Query("ref") String ref);
/**
* Get a file or it's LFS object from a repository
*
* @param owner owner of the repo (required)
* @param repo name of the repo (required)
* @param filepath filepath of the file to get (required)
* @param ref The name of the commit/branch/tag. Default the repositorys default branch (usually
* master) (optional)
* @return Call<ResponseBody>;
*/
@GET("repos/{owner}/{repo}/media/{filepath}")
Call<ResponseBody> repoGetRawFileOrLFS(
@retrofit2.http.Path("owner") String owner,
@retrofit2.http.Path("repo") String repo,
@retrofit2.http.Path("filepath") String filepath,
@retrofit2.http.Query("ref") String ref);
}