@@ -6,6 +6,8 @@ import com.fasterxml.jackson.databind.json.JsonMapper
6
6
import com.openlayer.api.client.OpenlayerClientAsync
7
7
import com.openlayer.api.client.OpenlayerClientAsyncImpl
8
8
import com.openlayer.api.core.ClientOptions
9
+ import com.openlayer.api.core.http.Headers
10
+ import com.openlayer.api.core.http.QueryParams
9
11
import java.net.Proxy
10
12
import java.time.Clock
11
13
import java.time.Duration
@@ -36,6 +38,8 @@ class OpenlayerOkHttpClientAsync private constructor() {
36
38
37
39
fun clock (clock : Clock ) = apply { clientOptions.clock(clock) }
38
40
41
+ fun headers (headers : Headers ) = apply { clientOptions.headers(headers) }
42
+
39
43
fun headers (headers : Map <String , Iterable <String >>) = apply {
40
44
clientOptions.headers(headers)
41
45
}
@@ -46,11 +50,73 @@ class OpenlayerOkHttpClientAsync private constructor() {
46
50
clientOptions.putHeaders(name, values)
47
51
}
48
52
53
+ fun putAllHeaders (headers : Headers ) = apply { clientOptions.putAllHeaders(headers) }
54
+
49
55
fun putAllHeaders (headers : Map <String , Iterable <String >>) = apply {
50
56
clientOptions.putAllHeaders(headers)
51
57
}
52
58
53
- fun removeHeader (name : String ) = apply { clientOptions.removeHeader(name) }
59
+ fun replaceHeaders (name : String , value : String ) = apply {
60
+ clientOptions.replaceHeaders(name, value)
61
+ }
62
+
63
+ fun replaceHeaders (name : String , values : Iterable <String >) = apply {
64
+ clientOptions.replaceHeaders(name, values)
65
+ }
66
+
67
+ fun replaceAllHeaders (headers : Headers ) = apply { clientOptions.replaceAllHeaders(headers) }
68
+
69
+ fun replaceAllHeaders (headers : Map <String , Iterable <String >>) = apply {
70
+ clientOptions.replaceAllHeaders(headers)
71
+ }
72
+
73
+ fun removeHeaders (name : String ) = apply { clientOptions.removeHeaders(name) }
74
+
75
+ fun removeAllHeaders (names : Set <String >) = apply { clientOptions.removeAllHeaders(names) }
76
+
77
+ fun queryParams (queryParams : QueryParams ) = apply { clientOptions.queryParams(queryParams) }
78
+
79
+ fun queryParams (queryParams : Map <String , Iterable <String >>) = apply {
80
+ clientOptions.queryParams(queryParams)
81
+ }
82
+
83
+ fun putQueryParam (key : String , value : String ) = apply {
84
+ clientOptions.putQueryParam(key, value)
85
+ }
86
+
87
+ fun putQueryParams (key : String , values : Iterable <String >) = apply {
88
+ clientOptions.putQueryParams(key, values)
89
+ }
90
+
91
+ fun putAllQueryParams (queryParams : QueryParams ) = apply {
92
+ clientOptions.putAllQueryParams(queryParams)
93
+ }
94
+
95
+ fun putAllQueryParams (queryParams : Map <String , Iterable <String >>) = apply {
96
+ clientOptions.putAllQueryParams(queryParams)
97
+ }
98
+
99
+ fun replaceQueryParams (key : String , value : String ) = apply {
100
+ clientOptions.replaceQueryParams(key, value)
101
+ }
102
+
103
+ fun replaceQueryParams (key : String , values : Iterable <String >) = apply {
104
+ clientOptions.replaceQueryParams(key, values)
105
+ }
106
+
107
+ fun replaceAllQueryParams (queryParams : QueryParams ) = apply {
108
+ clientOptions.replaceAllQueryParams(queryParams)
109
+ }
110
+
111
+ fun replaceAllQueryParams (queryParams : Map <String , Iterable <String >>) = apply {
112
+ clientOptions.replaceAllQueryParams(queryParams)
113
+ }
114
+
115
+ fun removeQueryParams (key : String ) = apply { clientOptions.removeQueryParams(key) }
116
+
117
+ fun removeAllQueryParams (keys : Set <String >) = apply {
118
+ clientOptions.removeAllQueryParams(keys)
119
+ }
54
120
55
121
fun timeout (timeout : Duration ) = apply { this .timeout = timeout }
56
122
0 commit comments