Skip to content

Commit 837e1ed

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
chore(internal): codegen related update (#56)
1 parent 73ed069 commit 837e1ed

File tree

455 files changed

+128760
-128417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

455 files changed

+128760
-128417
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@ import com.google.common.collect.ListMultimap
44
import com.google.common.collect.MultimapBuilder
55
import com.withorb.api.core.RequestOptions
66
import com.withorb.api.core.http.HttpClient
7+
import com.withorb.api.core.http.HttpMethod
78
import com.withorb.api.core.http.HttpRequest
89
import com.withorb.api.core.http.HttpRequestBody
910
import com.withorb.api.core.http.HttpResponse
10-
import com.withorb.api.core.http.HttpMethod
1111
import com.withorb.api.errors.OrbIoException
1212
import java.io.IOException
1313
import java.io.InputStream
1414
import java.net.Proxy
1515
import java.time.Duration
1616
import java.util.concurrent.CompletableFuture
17-
import java.util.concurrent.TimeUnit
1817
import okhttp3.Call
1918
import okhttp3.Callback
20-
import okhttp3.HttpUrl
21-
import okhttp3.Response
22-
import okhttp3.Request
23-
import okhttp3.RequestBody
24-
import okhttp3.MediaType
2519
import okhttp3.Headers
20+
import okhttp3.HttpUrl
2621
import okhttp3.HttpUrl.Companion.toHttpUrl
22+
import okhttp3.MediaType
2723
import okhttp3.MediaType.Companion.toMediaType
24+
import okhttp3.Request
25+
import okhttp3.RequestBody
2826
import okhttp3.RequestBody.Companion.toRequestBody
27+
import okhttp3.Response
2928
import okio.BufferedSink
3029

3130
class OkHttpClient
@@ -34,7 +33,8 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
3433

3534
private fun getClient(requestOptions: RequestOptions): okhttp3.OkHttpClient {
3635
val timeout = requestOptions.timeout ?: return okHttpClient
37-
return okHttpClient.newBuilder()
36+
return okHttpClient
37+
.newBuilder()
3838
.connectTimeout(timeout)
3939
.readTimeout(timeout)
4040
.writeTimeout(timeout)
@@ -76,7 +76,8 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
7676
override fun onFailure(call: Call, e: IOException) {
7777
future.completeExceptionally(OrbIoException("Request failed", e))
7878
}
79-
})
79+
}
80+
)
8081

8182
return future
8283
}

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

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,20 @@
33
package com.withorb.api.client.okhttp
44

55
import com.fasterxml.jackson.databind.json.JsonMapper
6-
import com.google.common.collect.Multimap
6+
import com.withorb.api.client.OrbClient
7+
import com.withorb.api.client.OrbClientImpl
8+
import com.withorb.api.core.ClientOptions
79
import java.net.Proxy
810
import java.time.Clock
911
import java.time.Duration
10-
import java.util.Optional
11-
import com.withorb.api.core.ClientOptions
12-
import com.withorb.api.core.http.HttpClient
13-
import com.withorb.api.client.OrbClient
14-
import com.withorb.api.client.OrbClientImpl
1512

1613
class OrbOkHttpClient private constructor() {
1714

1815
companion object {
1916

20-
@JvmStatic
21-
fun builder() = Builder()
17+
@JvmStatic fun builder() = Builder()
2218

23-
@JvmStatic
24-
fun fromEnv(): OrbClient = builder().fromEnv().build()
19+
@JvmStatic fun fromEnv(): OrbClient = builder().fromEnv().build()
2520
}
2621

2722
class Builder {
@@ -37,21 +32,15 @@ class OrbOkHttpClient private constructor() {
3732
this.baseUrl = baseUrl
3833
}
3934

40-
fun jsonMapper(jsonMapper: JsonMapper) = apply {
41-
clientOptions.jsonMapper(jsonMapper)
42-
}
35+
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }
4336

44-
fun clock(clock: Clock) = apply {
45-
clientOptions.clock(clock)
46-
}
37+
fun clock(clock: Clock) = apply { clientOptions.clock(clock) }
4738

4839
fun headers(headers: Map<String, Iterable<String>>) = apply {
4940
clientOptions.headers(headers)
5041
}
5142

52-
fun putHeader(name: String, value: String) = apply {
53-
clientOptions.putHeader(name, value)
54-
}
43+
fun putHeader(name: String, value: String) = apply { clientOptions.putHeader(name, value) }
5544

5645
fun putHeaders(name: String, values: Iterable<String>) = apply {
5746
clientOptions.putHeaders(name, values)
@@ -61,46 +50,38 @@ class OrbOkHttpClient private constructor() {
6150
clientOptions.putAllHeaders(headers)
6251
}
6352

64-
fun removeHeader(name: String) = apply {
65-
clientOptions.removeHeader(name)
66-
}
53+
fun removeHeader(name: String) = apply { clientOptions.removeHeader(name) }
6754

68-
fun timeout(timeout: Duration) = apply {
69-
this.timeout = timeout
70-
}
55+
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
7156

72-
fun maxRetries(maxRetries: Int) = apply {
73-
clientOptions.maxRetries(maxRetries)
74-
}
57+
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
7558

76-
fun proxy(proxy: Proxy) = apply {
77-
this.proxy = proxy
78-
}
59+
fun proxy(proxy: Proxy) = apply { this.proxy = proxy }
7960

8061
fun responseValidation(responseValidation: Boolean) = apply {
8162
clientOptions.responseValidation(responseValidation)
8263
}
8364

84-
fun apiKey(apiKey: String) = apply {
85-
clientOptions.apiKey(apiKey)
86-
}
65+
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
8766

8867
fun webhookSecret(webhookSecret: String?) = apply {
8968
clientOptions.webhookSecret(webhookSecret)
9069
}
9170

92-
fun fromEnv() = apply {
93-
clientOptions.fromEnv()
94-
}
71+
fun fromEnv() = apply { clientOptions.fromEnv() }
9572

9673
fun build(): OrbClient {
97-
return OrbClientImpl(clientOptions
98-
.httpClient(OkHttpClient.builder()
99-
.baseUrl(baseUrl)
100-
.timeout(timeout)
101-
.proxy(proxy)
102-
.build())
103-
.build())
74+
return OrbClientImpl(
75+
clientOptions
76+
.httpClient(
77+
OkHttpClient.builder()
78+
.baseUrl(baseUrl)
79+
.timeout(timeout)
80+
.proxy(proxy)
81+
.build()
82+
)
83+
.build()
84+
)
10485
}
10586
}
10687
}

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

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,20 @@
33
package com.withorb.api.client.okhttp
44

55
import com.fasterxml.jackson.databind.json.JsonMapper
6-
import com.google.common.collect.Multimap
6+
import com.withorb.api.client.OrbClientAsync
7+
import com.withorb.api.client.OrbClientAsyncImpl
8+
import com.withorb.api.core.ClientOptions
79
import java.net.Proxy
810
import java.time.Clock
911
import java.time.Duration
10-
import java.util.Optional
11-
import com.withorb.api.core.ClientOptions
12-
import com.withorb.api.core.http.HttpClient
13-
import com.withorb.api.client.OrbClientAsync
14-
import com.withorb.api.client.OrbClientAsyncImpl
1512

1613
class OrbOkHttpClientAsync private constructor() {
1714

1815
companion object {
1916

20-
@JvmStatic
21-
fun builder() = Builder()
17+
@JvmStatic fun builder() = Builder()
2218

23-
@JvmStatic
24-
fun fromEnv(): OrbClientAsync = builder().fromEnv().build()
19+
@JvmStatic fun fromEnv(): OrbClientAsync = builder().fromEnv().build()
2520
}
2621

2722
class Builder {
@@ -37,21 +32,15 @@ class OrbOkHttpClientAsync private constructor() {
3732
this.baseUrl = baseUrl
3833
}
3934

40-
fun jsonMapper(jsonMapper: JsonMapper) = apply {
41-
clientOptions.jsonMapper(jsonMapper)
42-
}
35+
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }
4336

44-
fun clock(clock: Clock) = apply {
45-
clientOptions.clock(clock)
46-
}
37+
fun clock(clock: Clock) = apply { clientOptions.clock(clock) }
4738

4839
fun headers(headers: Map<String, Iterable<String>>) = apply {
4940
clientOptions.headers(headers)
5041
}
5142

52-
fun putHeader(name: String, value: String) = apply {
53-
clientOptions.putHeader(name, value)
54-
}
43+
fun putHeader(name: String, value: String) = apply { clientOptions.putHeader(name, value) }
5544

5645
fun putHeaders(name: String, values: Iterable<String>) = apply {
5746
clientOptions.putHeaders(name, values)
@@ -61,46 +50,38 @@ class OrbOkHttpClientAsync private constructor() {
6150
clientOptions.putAllHeaders(headers)
6251
}
6352

64-
fun removeHeader(name: String) = apply {
65-
clientOptions.removeHeader(name)
66-
}
53+
fun removeHeader(name: String) = apply { clientOptions.removeHeader(name) }
6754

68-
fun timeout(timeout: Duration) = apply {
69-
this.timeout = timeout
70-
}
55+
fun timeout(timeout: Duration) = apply { this.timeout = timeout }
7156

72-
fun maxRetries(maxRetries: Int) = apply {
73-
clientOptions.maxRetries(maxRetries)
74-
}
57+
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }
7558

76-
fun proxy(proxy: Proxy) = apply {
77-
this.proxy = proxy
78-
}
59+
fun proxy(proxy: Proxy) = apply { this.proxy = proxy }
7960

8061
fun responseValidation(responseValidation: Boolean) = apply {
8162
clientOptions.responseValidation(responseValidation)
8263
}
8364

84-
fun apiKey(apiKey: String) = apply {
85-
clientOptions.apiKey(apiKey)
86-
}
65+
fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
8766

8867
fun webhookSecret(webhookSecret: String?) = apply {
8968
clientOptions.webhookSecret(webhookSecret)
9069
}
9170

92-
fun fromEnv() = apply {
93-
clientOptions.fromEnv()
94-
}
71+
fun fromEnv() = apply { clientOptions.fromEnv() }
9572

9673
fun build(): OrbClientAsync {
97-
return OrbClientAsyncImpl(clientOptions
98-
.httpClient(OkHttpClient.builder()
99-
.baseUrl(baseUrl)
100-
.timeout(timeout)
101-
.proxy(proxy)
102-
.build())
103-
.build())
74+
return OrbClientAsyncImpl(
75+
clientOptions
76+
.httpClient(
77+
OkHttpClient.builder()
78+
.baseUrl(baseUrl)
79+
.timeout(timeout)
80+
.proxy(proxy)
81+
.build()
82+
)
83+
.build()
84+
)
10485
}
10586
}
10687
}

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,8 @@
44

55
package com.withorb.api.client
66

7-
import java.time.Duration
8-
import java.util.Base64
9-
import java.util.Optional
10-
import java.util.concurrent.CompletableFuture
11-
import com.withorb.api.core.ClientOptions
12-
import com.withorb.api.core.http.HttpMethod
13-
import com.withorb.api.core.http.HttpRequest
14-
import com.withorb.api.core.http.HttpResponse.Handler
15-
import com.withorb.api.core.JsonField
16-
import com.withorb.api.core.RequestOptions
17-
import com.withorb.api.errors.OrbError
18-
import com.withorb.api.errors.OrbInvalidDataException
197
import com.withorb.api.models.*
208
import com.withorb.api.services.blocking.*
21-
import com.withorb.api.services.emptyHandler
22-
import com.withorb.api.services.errorHandler
23-
import com.withorb.api.services.json
24-
import com.withorb.api.services.jsonHandler
25-
import com.withorb.api.services.stringHandler
26-
import com.withorb.api.services.binaryHandler
27-
import com.withorb.api.services.withErrorHandler
289

2910
interface OrbClient {
3011

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,8 @@
44

55
package com.withorb.api.client
66

7-
import java.time.Duration
8-
import java.util.Base64
9-
import java.util.Optional
10-
import java.util.concurrent.CompletableFuture
11-
import com.withorb.api.core.ClientOptions
12-
import com.withorb.api.core.http.HttpMethod
13-
import com.withorb.api.core.http.HttpRequest
14-
import com.withorb.api.core.http.HttpResponse.Handler
15-
import com.withorb.api.core.JsonField
16-
import com.withorb.api.core.RequestOptions
17-
import com.withorb.api.errors.OrbError
18-
import com.withorb.api.errors.OrbInvalidDataException
197
import com.withorb.api.models.*
208
import com.withorb.api.services.async.*
21-
import com.withorb.api.services.emptyHandler
22-
import com.withorb.api.services.errorHandler
23-
import com.withorb.api.services.json
24-
import com.withorb.api.services.jsonHandler
25-
import com.withorb.api.services.stringHandler
26-
import com.withorb.api.services.binaryHandler
27-
import com.withorb.api.services.withErrorHandler
289

2910
interface OrbClientAsync {
3011

0 commit comments

Comments
 (0)