Skip to content

Commit 9221a98

Browse files
Added a constructor with custom http client (#86)
1 parent 2a9be82 commit 9221a98

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/main/java/org/typesense/api/Client.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.typesense.api;
22

33

4+
import okhttp3.OkHttpClient;
5+
46
import java.util.HashMap;
57
import java.util.Map;
68

@@ -32,6 +34,26 @@ public class Client {
3234
public Debug debug;
3335
public MultiSearch multiSearch;
3436

37+
public Client(Configuration configuration, OkHttpClient okHttpClient){
38+
this.configuration = configuration;
39+
this.apiCall = new ApiCall(configuration, okHttpClient);
40+
collections = new Collections(apiCall);
41+
this.individualCollections = new HashMap<>();
42+
this.aliases = new Aliases(this.apiCall);
43+
this.individualAliases = new HashMap<>();
44+
this.keys = new Keys(this.apiCall);
45+
this.individualKeys = new HashMap<>();
46+
this.health = new Health(this.apiCall);
47+
this.operations = new Operations(this.apiCall);
48+
this.metrics = new Metrics(this.apiCall);
49+
this.debug = new Debug(this.apiCall);
50+
this.multiSearch = new MultiSearch(this.apiCall);
51+
this.analytics = new Analytics(this.apiCall);
52+
this.stemming = new Stemming(this.apiCall);
53+
this.stopwords = new Stopwords(this.apiCall);
54+
this.individualStopwordsSets = new HashMap<>();
55+
}
56+
3557
public Client(Configuration configuration){
3658
this.configuration = configuration;
3759
this.apiCall = new ApiCall(configuration);

0 commit comments

Comments
 (0)