|
@@ -0,0 +1,30 @@
|
|
|
+package com.livelike.flickersearchlibrary.api
|
|
|
+
|
|
|
+import com.livelike.flickersearchlibrary.api.model.response.FlickrResponse
|
|
|
+import com.livelike.flickersearchlibrary.api.utils.*
|
|
|
+import retrofit2.Response
|
|
|
+import retrofit2.http.GET
|
|
|
+import retrofit2.http.Query
|
|
|
+
|
|
|
+/**
|
|
|
+ * API interface for Flickr services.
|
|
|
+ */
|
|
|
+internal interface FlickrApi {
|
|
|
+
|
|
|
+ @GET(".")
|
|
|
+ suspend fun search(
|
|
|
+ @Query(QUERY_TEXT) searchQuery: String,
|
|
|
+ @Query(QUERY_METHOD) method: String = SEARCH_METHOD,
|
|
|
+ @Query(QUERY_API_KEY) apiKey: String = DEFAULT_API_KEY,
|
|
|
+ @Query(QUERY_FORMAT) format: String = JSON_FORMAT,
|
|
|
+ @Query(QUERY_NO_JSON_CALLBACK) noJsonCallback: Boolean = NO_JSON_CALLBACK,
|
|
|
+ ): Response<FlickrResponse>
|
|
|
+
|
|
|
+ @GET(".")
|
|
|
+ suspend fun getRecent(
|
|
|
+ @Query(QUERY_METHOD) method: String = RECENT_IMAGES_METHOD,
|
|
|
+ @Query(QUERY_API_KEY) apiKey: String = DEFAULT_API_KEY,
|
|
|
+ @Query(QUERY_FORMAT) format: String = JSON_FORMAT,
|
|
|
+ @Query(QUERY_NO_JSON_CALLBACK) noJsonCallback: Boolean = NO_JSON_CALLBACK,
|
|
|
+ ): Response<FlickrResponse>
|
|
|
+}
|