Skip to content

Commit d85ab62

Browse files
Stainless Botstainless-app[bot]
authored andcommitted
feat(api): api update (#97)
1 parent 17f2f02 commit d85ab62

File tree

12 files changed

+684
-11
lines changed

12 files changed

+684
-11
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 95
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1d8364dbd0b3b481f2d5fc42f06ad6df6c581a1cdba0940c9b85936957e7a363.yml
1+
configured_endpoints: 96
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5d22d9573f8fe12b31b2433b658b708f7cc379318d124afc74188afdc07e1ccc.yml

orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ class OrbOkHttpClient private constructor() {
5252

5353
fun removeHeader(name: String) = apply { clientOptions.removeHeader(name) }
5454

55+
fun queryParams(queryParams: Map<String, Iterable<String>>) = apply {
56+
clientOptions.queryParams(queryParams)
57+
}
58+
59+
fun putQueryParam(key: String, value: String) = apply {
60+
clientOptions.putQueryParam(key, value)
61+
}
62+
63+
fun putQueryParams(key: String, values: Iterable<String>) = apply {
64+
clientOptions.putQueryParams(key, values)
65+
}
66+
67+
fun putAllQueryParams(queryParams: Map<String, Iterable<String>>) = apply {
68+
clientOptions.putAllQueryParams(queryParams)
69+
}
70+
71+
fun removeQueryParam(key: String) = apply { clientOptions.removeQueryParam(key) }
72+
5573
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
5674

5775
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ class OrbOkHttpClientAsync private constructor() {
5252

5353
fun removeHeader(name: String) = apply { clientOptions.removeHeader(name) }
5454

55+
fun queryParams(queryParams: Map<String, Iterable<String>>) = apply {
56+
clientOptions.queryParams(queryParams)
57+
}
58+
59+
fun putQueryParam(key: String, value: String) = apply {
60+
clientOptions.putQueryParam(key, value)
61+
}
62+
63+
fun putQueryParams(key: String, values: Iterable<String>) = apply {
64+
clientOptions.putQueryParams(key, values)
65+
}
66+
67+
fun putAllQueryParams(queryParams: Map<String, Iterable<String>>) = apply {
68+
clientOptions.putAllQueryParams(queryParams)
69+
}
70+
71+
fun removeQueryParam(key: String) = apply { clientOptions.removeQueryParam(key) }
72+
5573
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
5674

5775
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,17 @@ private constructor(
101101
putAllQueryParams(queryParams)
102102
}
103103

104-
fun putQueryParam(name: String, value: String) = apply {
105-
this.queryParams.getOrPut(name) { mutableListOf() }.add(value)
106-
}
104+
fun putQueryParam(key: String, value: String) = apply { queryParams.put(key, value) }
107105

108-
fun putQueryParams(name: String, values: Iterable<String>) = apply {
109-
this.queryParams.getOrPut(name) { mutableListOf() }.addAll(values)
106+
fun putQueryParams(key: String, values: Iterable<String>) = apply {
107+
queryParams.putAll(key, values)
110108
}
111109

112110
fun putAllQueryParams(queryParams: Map<String, Iterable<String>>) = apply {
113111
queryParams.forEach(this::putQueryParams)
114112
}
115113

116-
fun removeQueryParam(name: String) = apply { this.queryParams.put(name, mutableListOf()) }
114+
fun removeQueryParam(key: String) = apply { queryParams.removeAll(key) }
117115

118116
fun responseValidation(responseValidation: Boolean) = apply {
119117
this.responseValidation = responseValidation

0 commit comments

Comments
 (0)