Skip to content

Commit 3345999

Browse files
committed
chore: cherry picked API service
1 parent ca63af0 commit 3345999

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

contentstack/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,15 @@ android {
139139
}
140140
configurations { archives }
141141
dependencies {
142+
androidTestImplementation 'org.junit.jupiter:junit-jupiter:5.8.1'
142143
def multidex = "2.0.1"
143144
def volley = "1.2.1"
144145
def junit = "4.13.2"
145146
configurations.configureEach { resolutionStrategy.force 'com.android.support:support-annotations:23.1.0' }
146147
implementation fileTree(include: ['*.jar'], dir: 'libs')
147148
implementation "com.android.volley:volley:$volley"
148149
implementation "junit:junit:$junit"
150+
149151
// For AGP 7.4+
150152
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
151153
testImplementation 'junit:junit:4.13.2'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.contentstack.sdk;
2+
3+
import okhttp3.ResponseBody;
4+
import retrofit2.Call;
5+
import retrofit2.http.GET;
6+
import retrofit2.http.HeaderMap;
7+
import retrofit2.http.Query;
8+
import retrofit2.http.Url;
9+
10+
import java.util.LinkedHashMap;
11+
import java.util.Map;
12+
13+
14+
public interface APIService {
15+
@GET
16+
Call<ResponseBody> getRequest(
17+
@Url String url, @HeaderMap LinkedHashMap<String, Object> headers);
18+
19+
@GET("v3/taxonomies/entries")
20+
Call<ResponseBody> getTaxonomy(
21+
@HeaderMap Map<String, Object> headers,
22+
@Query("query") String query);
23+
}

contentstack/src/main/java/com/contentstack/sdk/Stack.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class Stack implements INotifyClass {
5252
protected String limit = null;
5353
protected String localeCode;
5454
private SyncResultCallBack syncCallBack;
55+
protected APIService service;
5556

5657

5758
protected Stack() {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.contentstack.sdk;
2+
3+
4+
import org.json.JSONObject;
5+
6+
public interface TaxonomyCallback {
7+
/**
8+
* This method is called wen API response gets received
9+
* @param response the response of type JSON
10+
* @param error the error of type @{@link Error}
11+
*/
12+
void onResponse(JSONObject response, Error error);
13+
14+
}

0 commit comments

Comments
 (0)