network: convert TinyrssApi to kotlin
authorDa Risk <da_risk@geekorum.com>
Wed, 26 Jun 2019 10:42:25 -0700
changeset 309 be086a1180ad
parent 308 d08f1d93a0db
child 310 bd0611482474
network: convert TinyrssApi to kotlin
app/src/main/java/com/geekorum/ttrss/network/impl/TinyRssApi.java
app/src/main/java/com/geekorum/ttrss/network/impl/TinyRssApi.kt
--- a/app/src/main/java/com/geekorum/ttrss/network/impl/TinyRssApi.java	Tue Jun 25 17:50:21 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Geekttrss is a RSS feed reader application on the Android Platform.
- *
- * Copyright (C) 2017-2019 by Frederic-Charles Barthelery.
- *
- * This file is part of Geekttrss.
- *
- * Geekttrss is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Geekttrss is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
- */
-package com.geekorum.ttrss.network.impl;
-
-import androidx.annotation.Keep;
-import kotlinx.coroutines.Deferred;
-import retrofit2.http.Body;
-import retrofit2.http.POST;
-
-/**
- * Interface of the Tiny Tiny Rss api.
- *
- * This describes the different endpoints.
- */
-@Keep
-public interface TinyRssApi {
-
-    @POST("api/")
-    Deferred<LoginResponsePayload> login(@Body LoginRequestPayload loginRequestPayload);
-
-    @POST("api/")
-    Deferred<UpdateArticleResponsePayload> updateArticle(@Body UpdateArticleRequestPayload updateFieldRequestPayload);
-
-    @POST("api/")
-    Deferred<ListResponsePayload<Feed>> getFeeds(@Body GetFeedsRequestPayload getFeedsRequestPayload);
-
-    @POST("api/")
-    Deferred<ListResponsePayload<FeedCategory>> getCategories(@Body GetCategoriesRequestPayload getFeedsRequestPayload);
-
-
-    @POST("api/")
-    Deferred<ListResponsePayload<Headline>> getArticles(@Body GetArticlesRequestPayload getFeedsRequestPayload);
-
-    @POST("api/")
-    Deferred<SubscribeToFeedResponsePayload> subscribeToFeed(@Body SubscribeToFeedRequestPayload subscribeToFeedRequestPayload);
-
-    @POST("api/")
-    Deferred<UnsubscribeFeedResponsePayload> unsubscribeFromFeed(@Body UnsubscribeFeedRequestPayload unsubscribeFeedRequestPayload);
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/src/main/java/com/geekorum/ttrss/network/impl/TinyRssApi.kt	Wed Jun 26 10:42:25 2019 -0700
@@ -0,0 +1,58 @@
+/*
+ * Geekttrss is a RSS feed reader application on the Android Platform.
+ *
+ * Copyright (C) 2017-2019 by Frederic-Charles Barthelery.
+ *
+ * This file is part of Geekttrss.
+ *
+ * Geekttrss is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Geekttrss is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Geekttrss.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.geekorum.ttrss.network.impl
+
+import androidx.annotation.Keep
+import kotlinx.coroutines.Deferred
+import retrofit2.http.Body
+import retrofit2.http.POST
+
+/**
+ * Interface of the Tiny Tiny Rss api.
+ *
+ * This describes the different endpoints.
+ */
+@Keep
+interface TinyRssApi {
+
+    @POST("api/")
+    fun login(@Body loginRequestPayload: LoginRequestPayload): Deferred<LoginResponsePayload>
+
+    @POST("api/")
+    fun updateArticle(@Body updateFieldRequestPayload: UpdateArticleRequestPayload): Deferred<UpdateArticleResponsePayload>
+
+    @POST("api/")
+    fun getFeeds(@Body getFeedsRequestPayload: GetFeedsRequestPayload): Deferred<ListResponsePayload<Feed>>
+
+    @POST("api/")
+    fun getCategories(@Body getFeedsRequestPayload: GetCategoriesRequestPayload): Deferred<ListResponsePayload<FeedCategory>>
+
+
+    @POST("api/")
+    fun getArticles(@Body getFeedsRequestPayload: GetArticlesRequestPayload): Deferred<ListResponsePayload<Headline>>
+
+    @POST("api/")
+    fun subscribeToFeed(@Body subscribeToFeedRequestPayload: SubscribeToFeedRequestPayload): Deferred<SubscribeToFeedResponsePayload>
+
+    @POST("api/")
+    fun unsubscribeFromFeed(@Body unsubscribeFeedRequestPayload: UnsubscribeFeedRequestPayload): Deferred<UnsubscribeFeedResponsePayload>
+
+}