aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/pina/Holodex.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/pina/Holodex.java')
-rw-r--r--src/main/java/com/pina/Holodex.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/com/pina/Holodex.java b/src/main/java/com/pina/Holodex.java
index 2b211e0..eca6147 100644
--- a/src/main/java/com/pina/Holodex.java
+++ b/src/main/java/com/pina/Holodex.java
@@ -188,6 +188,15 @@ public class Holodex {
return executeCall(call);
}
+ /**
+ * Sends a POST request to search for videos matching the VideoSearchQueryBuilder attributes
+ * If the query is paginated, the response will be a VideoSearchResult object
+ * If the query is not paginated, the response will be a list of SimpleVideo objects
+ * @param query
+ * @return
+ * @throws HolodexException
+ */
+
public Object searchVideo(VideoSearchQueryBuilder query) throws HolodexException {
Map<String, Object> payload = toMap(query);
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
@@ -201,6 +210,14 @@ public class Holodex {
}
+ /**
+ * Sends a POST request to search for comments matching the CommentSearchQueryBuilder attributes
+ * If the query is paginated, the response will be a CommentSearchResult object
+ * If the query is not paginated, the response will be a list of SimpleCommentVideo objects
+ * @param query
+ * @return
+ * @throws HolodexException
+ */
public Object searchComment(CommentSearchQueryBuilder query) throws HolodexException{
Map<String, Object> payload = toMap(query);
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
@@ -213,7 +230,7 @@ public class Holodex {
return executeCall(call);
}
- public static Map<String, Object> toMap(Object obj) throws HolodexException {
+ private static Map<String, Object> toMap(Object obj) throws HolodexException {
Map<String, Object> map = new HashMap<>();
Field[] fields = obj.getClass().getDeclaredFields();
for (Field field : fields) {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage