diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index caf5ca3f..59acac47 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.26.0"
+ ".": "0.27.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 0c16dd10..ae59be0a 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 103
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-8663e8fc543041d9694eddcd2f7e9784611369606700f99340e6dc80607b2dfa.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0dbb8ba730f755468357ebda41332664e8396faf29a6a6a64ad37cf35cf70d0c.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 42d16fdd..06678905 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,24 @@
# Changelog
+## 0.27.0 (2025-02-04)
+
+Full Changelog: [v0.26.0...v0.27.0](https://github.com/orbcorp/orb-java/compare/v0.26.0...v0.27.0)
+
+### Features
+
+* **api:** api update ([#229](https://github.com/orbcorp/orb-java/issues/229)) ([a0b4d91](https://github.com/orbcorp/orb-java/commit/a0b4d9178723acb177202d88d4355ae8d4dd3196))
+* **client:** send client-side timeout headers ([#228](https://github.com/orbcorp/orb-java/issues/228)) ([720ac83](https://github.com/orbcorp/orb-java/commit/720ac83e1167d1c24dd71e2d2b7b98b0390c0f17))
+
+
+### Chores
+
+* **internal:** codegen related update ([#224](https://github.com/orbcorp/orb-java/issues/224)) ([ba91826](https://github.com/orbcorp/orb-java/commit/ba91826dde6c642771682ce5b56f61638bcab7a5))
+
+
+### Documentation
+
+* fix incorrect additional properties info ([#227](https://github.com/orbcorp/orb-java/issues/227)) ([8fe2133](https://github.com/orbcorp/orb-java/commit/8fe2133556f1cd283180a045f47a084b40664502))
+
## 0.26.0 (2025-01-30)
Full Changelog: [v0.25.0...v0.26.0](https://github.com/orbcorp/orb-java/compare/v0.25.0...v0.26.0)
diff --git a/README.md b/README.md
index a5549cf6..ba590f44 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.26.0)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.27.0)
@@ -19,7 +19,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho
### Gradle
```kotlin
-implementation("com.withorb.api:orb-java:0.26.0")
+implementation("com.withorb.api:orb-java:0.27.0")
```
### Maven
@@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:0.26.0")
com.withorb.api
orb-java
- 0.26.0
+ 0.27.0
```
@@ -140,19 +140,7 @@ See [Pagination](#pagination) below for more information on transparently workin
To make a request to the Orb API, you generally build an instance of the appropriate `Params` class.
-In [Example: creating a resource](#example-creating-a-resource) above, we used the `CustomerCreateParams.builder()` to pass to the `create` method of the `customers` service.
-
-Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using the `putAdditionalProperty` method.
-
-```java
-import com.withorb.api.core.JsonValue;
-import com.withorb.api.models.CustomerCreateParams;
-
-CustomerCreateParams params = CustomerCreateParams.builder()
- // ... normal properties
- .putAdditionalProperty("secret_param", JsonValue.from("4242"))
- .build();
-```
+See [Undocumented request params](#undocumented-request-params) for how to send arbitrary parameters.
## Responses
@@ -344,18 +332,26 @@ This library is typed for convenient access to the documented API. If you need t
### Undocumented request params
-To make requests using undocumented parameters, you can provide or override parameters on the params object while building it.
+In [Example: creating a resource](#example-creating-a-resource) above, we used the `CustomerCreateParams.builder()` to pass to the `create` method of the `customers` service.
+
+Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using raw setters:
```java
-FooCreateParams address = FooCreateParams.builder()
- .id("my_id")
- .putAdditionalProperty("secret_prop", JsonValue.from("hello"))
+import com.withorb.api.core.JsonValue;
+import com.withorb.api.models.CustomerCreateParams;
+
+CustomerCreateParams params = CustomerCreateParams.builder()
+ .putAdditionalHeader("Secret-Header", "42")
+ .putAdditionalQueryParam("secret_query_param", "42")
+ .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))
.build();
```
+You can also use the `putAdditionalProperty` method on nested headers, query params, or body objects.
+
### Undocumented response properties
-To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type.
+To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `res._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type.
## Logging
diff --git a/build.gradle.kts b/build.gradle.kts
index 25877df7..bdcbace5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,4 @@
allprojects {
group = "com.withorb.api"
- version = "0.26.0" // x-release-please-version
+ version = "0.27.0" // x-release-please-version
}
diff --git a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt
index 3484d4e1..74283f2f 100644
--- a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt
+++ b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt
@@ -31,38 +31,11 @@ class OkHttpClient
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
HttpClient {
- private fun getClient(requestOptions: RequestOptions): okhttp3.OkHttpClient {
- val clientBuilder = okHttpClient.newBuilder()
-
- val logLevel =
- when (System.getenv("ORB_LOG")?.lowercase()) {
- "info" -> HttpLoggingInterceptor.Level.BASIC
- "debug" -> HttpLoggingInterceptor.Level.BODY
- else -> null
- }
- if (logLevel != null) {
- clientBuilder.addNetworkInterceptor(
- HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") }
- )
- }
-
- val timeout = requestOptions.timeout
- if (timeout != null) {
- clientBuilder
- .connectTimeout(timeout)
- .readTimeout(timeout)
- .writeTimeout(timeout)
- .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
- }
-
- return clientBuilder.build()
- }
-
override fun execute(
request: HttpRequest,
requestOptions: RequestOptions,
): HttpResponse {
- val call = getClient(requestOptions).newCall(request.toRequest())
+ val call = newCall(request, requestOptions)
return try {
call.execute().toResponse()
@@ -81,18 +54,18 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
request.body?.run { future.whenComplete { _, _ -> close() } }
- val call = getClient(requestOptions).newCall(request.toRequest())
- call.enqueue(
- object : Callback {
- override fun onResponse(call: Call, response: Response) {
- future.complete(response.toResponse())
- }
+ newCall(request, requestOptions)
+ .enqueue(
+ object : Callback {
+ override fun onResponse(call: Call, response: Response) {
+ future.complete(response.toResponse())
+ }
- override fun onFailure(call: Call, e: IOException) {
- future.completeExceptionally(OrbIoException("Request failed", e))
+ override fun onFailure(call: Call, e: IOException) {
+ future.completeExceptionally(OrbIoException("Request failed", e))
+ }
}
- }
- )
+ )
return future
}
@@ -103,7 +76,35 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
okHttpClient.cache?.close()
}
- private fun HttpRequest.toRequest(): Request {
+ private fun newCall(request: HttpRequest, requestOptions: RequestOptions): Call {
+ val clientBuilder = okHttpClient.newBuilder()
+
+ val logLevel =
+ when (System.getenv("ORB_LOG")?.lowercase()) {
+ "info" -> HttpLoggingInterceptor.Level.BASIC
+ "debug" -> HttpLoggingInterceptor.Level.BODY
+ else -> null
+ }
+ if (logLevel != null) {
+ clientBuilder.addNetworkInterceptor(
+ HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") }
+ )
+ }
+
+ val timeout = requestOptions.timeout
+ if (timeout != null) {
+ clientBuilder
+ .connectTimeout(timeout)
+ .readTimeout(timeout)
+ .writeTimeout(timeout)
+ .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
+ }
+
+ val client = clientBuilder.build()
+ return client.newCall(request.toRequest(client))
+ }
+
+ private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request {
var body: RequestBody? = body?.toRequestBody()
// OkHttpClient always requires a request body for PUT and POST methods.
if (body == null && (method == HttpMethod.PUT || method == HttpMethod.POST)) {
@@ -115,6 +116,21 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
headers.values(name).forEach { builder.header(name, it) }
}
+ if (
+ !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0
+ ) {
+ builder.header(
+ "X-Stainless-Read-Timeout",
+ Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString()
+ )
+ }
+ if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) {
+ builder.header(
+ "X-Stainless-Timeout",
+ Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString()
+ )
+ }
+
return builder.build()
}
@@ -171,7 +187,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ class Builder internal constructor() {
private var baseUrl: HttpUrl? = null
// The default timeout is 1 minute.
diff --git a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt
index 70382242..442c5824 100644
--- a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt
+++ b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt
@@ -22,7 +22,8 @@ class OrbOkHttpClient private constructor() {
@JvmStatic fun fromEnv(): OrbClient = builder().fromEnv().build()
}
- class Builder {
+ /** A builder for [OrbOkHttpClient]. */
+ class Builder internal constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var baseUrl: String = ClientOptions.PRODUCTION_URL
diff --git a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt
index 36e46218..3c9e6f22 100644
--- a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt
+++ b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt
@@ -22,7 +22,8 @@ class OrbOkHttpClientAsync private constructor() {
@JvmStatic fun fromEnv(): OrbClientAsync = builder().fromEnv().build()
}
- class Builder {
+ /** A builder for [OrbOkHttpClientAsync]. */
+ class Builder internal constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var baseUrl: String = ClientOptions.PRODUCTION_URL
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt
index 8f4221f3..b256deff 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt
@@ -18,8 +18,28 @@ import com.withorb.api.services.blocking.SubscriptionService
import com.withorb.api.services.blocking.TopLevelService
import com.withorb.api.services.blocking.WebhookService
+/**
+ * A client for interacting with the Orb REST API synchronously. You can also switch to asynchronous
+ * execution via the [async] method.
+ *
+ * This client performs best when you create a single instance and reuse it for all interactions
+ * with the REST API. This is because each client holds its own connection pool and thread pools.
+ * Reusing connections and threads reduces latency and saves memory. The client also handles rate
+ * limiting per client. This means that creating and using multiple instances at the same time will
+ * not respect rate limits.
+ *
+ * The threads and connections that are held will be released automatically if they remain idle. But
+ * if you are writing an application that needs to aggressively release unused resources, then you
+ * may call [close].
+ */
interface OrbClient {
+ /**
+ * Returns a version of this client that uses asynchronous execution.
+ *
+ * The returned client shares its resources, like its connection pool and thread pools, with
+ * this client.
+ */
fun async(): OrbClientAsync
fun topLevel(): TopLevelService
@@ -46,9 +66,22 @@ interface OrbClient {
fun subscriptions(): SubscriptionService
+ fun webhooks(): WebhookService
+
fun alerts(): AlertService
fun dimensionalPriceGroups(): DimensionalPriceGroupService
- fun webhooks(): WebhookService
+ /**
+ * Closes this client, relinquishing any underlying resources.
+ *
+ * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and
+ * usually should not be synchronously closed via try-with-resources.
+ *
+ * It's also usually not necessary to call this method at all. the default HTTP client
+ * automatically releases threads and connections if they remain idle, but if you are writing an
+ * application that needs to aggressively release unused resources, then you may call this
+ * method.
+ */
+ fun close()
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt
index 161df6c8..61f2d9d7 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt
@@ -17,8 +17,28 @@ import com.withorb.api.services.async.PriceServiceAsync
import com.withorb.api.services.async.SubscriptionServiceAsync
import com.withorb.api.services.async.TopLevelServiceAsync
+/**
+ * A client for interacting with the Orb REST API asynchronously. You can also switch to synchronous
+ * execution via the [sync] method.
+ *
+ * This client performs best when you create a single instance and reuse it for all interactions
+ * with the REST API. This is because each client holds its own connection pool and thread pools.
+ * Reusing connections and threads reduces latency and saves memory. The client also handles rate
+ * limiting per client. This means that creating and using multiple instances at the same time will
+ * not respect rate limits.
+ *
+ * The threads and connections that are held will be released automatically if they remain idle. But
+ * if you are writing an application that needs to aggressively release unused resources, then you
+ * may call [close].
+ */
interface OrbClientAsync {
+ /**
+ * Returns a version of this client that uses synchronous execution.
+ *
+ * The returned client shares its resources, like its connection pool and thread pools, with
+ * this client.
+ */
fun sync(): OrbClient
fun topLevel(): TopLevelServiceAsync
@@ -48,4 +68,17 @@ interface OrbClientAsync {
fun alerts(): AlertServiceAsync
fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync
+
+ /**
+ * Closes this client, relinquishing any underlying resources.
+ *
+ * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and
+ * usually should not be synchronously closed via try-with-resources.
+ *
+ * It's also usually not necessary to call this method at all. the default HTTP client
+ * automatically releases threads and connections if they remain idle, but if you are writing an
+ * application that needs to aggressively release unused resources, then you may call this
+ * method.
+ */
+ fun close()
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt
index ba6efc41..71cadda5 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt
@@ -33,8 +33,7 @@ import com.withorb.api.services.async.SubscriptionServiceAsyncImpl
import com.withorb.api.services.async.TopLevelServiceAsync
import com.withorb.api.services.async.TopLevelServiceAsyncImpl
-class OrbClientAsyncImpl
-constructor(
+class OrbClientAsyncImpl(
private val clientOptions: ClientOptions,
) : OrbClientAsync {
@@ -131,4 +130,6 @@ constructor(
override fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync =
dimensionalPriceGroups
+
+ override fun close() = clientOptions.httpClient.close()
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt
index 6f0bec20..adf67509 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt
@@ -35,8 +35,7 @@ import com.withorb.api.services.blocking.TopLevelServiceImpl
import com.withorb.api.services.blocking.WebhookService
import com.withorb.api.services.blocking.WebhookServiceImpl
-class OrbClientImpl
-constructor(
+class OrbClientImpl(
private val clientOptions: ClientOptions,
) : OrbClient {
@@ -119,9 +118,11 @@ constructor(
override fun subscriptions(): SubscriptionService = subscriptions
+ override fun webhooks(): WebhookService = webhooks
+
override fun alerts(): AlertService = alerts
override fun dimensionalPriceGroups(): DimensionalPriceGroupService = dimensionalPriceGroups
- override fun webhooks(): WebhookService = webhooks
+ override fun close() = clientOptions.httpClient.close()
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt
index 7eea461c..796f695d 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt
@@ -37,7 +37,8 @@ private constructor(
@JvmStatic fun fromEnv(): ClientOptions = builder().fromEnv().build()
}
- class Builder {
+ /** A builder for [ClientOptions]. */
+ class Builder internal constructor() {
private var httpClient: HttpClient? = null
private var jsonMapper: JsonMapper = jsonMapper()
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/Params.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/Params.kt
new file mode 100644
index 00000000..e9c719da
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/Params.kt
@@ -0,0 +1,16 @@
+package com.withorb.api.core
+
+import com.withorb.api.core.http.Headers
+import com.withorb.api.core.http.QueryParams
+
+/** An interface representing parameters passed to a service method. */
+interface Params {
+ /** The full set of headers in the parameters, including both fixed and additional headers. */
+ fun _headers(): Headers
+
+ /**
+ * The full set of query params in the parameters, including both fixed and additional query
+ * params.
+ */
+ fun _queryParams(): QueryParams
+}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/PrepareRequest.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/PrepareRequest.kt
new file mode 100644
index 00000000..1a4592ad
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/PrepareRequest.kt
@@ -0,0 +1,24 @@
+@file:JvmName("PrepareRequest")
+
+package com.withorb.api.core
+
+import com.withorb.api.core.http.HttpRequest
+import java.util.concurrent.CompletableFuture
+
+@JvmSynthetic
+internal fun HttpRequest.prepare(clientOptions: ClientOptions, params: Params): HttpRequest =
+ toBuilder()
+ .putAllQueryParams(clientOptions.queryParams)
+ .replaceAllQueryParams(params._queryParams())
+ .putAllHeaders(clientOptions.headers)
+ .replaceAllHeaders(params._headers())
+ .build()
+
+@JvmSynthetic
+internal fun HttpRequest.prepareAsync(
+ clientOptions: ClientOptions,
+ params: Params
+): CompletableFuture =
+ // This async version exists to make it easier to add async specific preparation logic in the
+ // future.
+ CompletableFuture.completedFuture(prepare(clientOptions, params))
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt
index 8aeae2a9..5d9b4401 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt
@@ -23,7 +23,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ class Builder internal constructor() {
+
private var responseValidation: Boolean? = null
private var timeout: Duration? = null
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt
index 25aa7f71..8bec2dde 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt
@@ -22,7 +22,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ class Builder internal constructor() {
private val map: MutableMap> =
TreeMap(String.CASE_INSENSITIVE_ORDER)
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt
index 5aed352c..a5a3aaab 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt
@@ -22,7 +22,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ class Builder internal constructor() {
private var method: HttpMethod? = null
private var url: String? = null
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt
index 53c19d9f..b09686de 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt
@@ -21,7 +21,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ class Builder internal constructor() {
private val map: MutableMap> = mutableMapOf()
private var size: Int = 0
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt
index a31f46fa..ba6f4dda 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt
@@ -57,15 +57,17 @@ private constructor(
}
response
- } catch (t: Throwable) {
- if (++retries > maxRetries || !shouldRetry(t)) {
- throw t
+ } catch (throwable: Throwable) {
+ if (++retries > maxRetries || !shouldRetry(throwable)) {
+ throw throwable
}
null
}
val backoffMillis = getRetryBackoffMillis(retries, response)
+ // All responses must be closed, so close the failed one before retrying.
+ response?.close()
Thread.sleep(backoffMillis.toMillis())
}
}
@@ -113,6 +115,8 @@ private constructor(
}
val backoffMillis = getRetryBackoffMillis(retries, response)
+ // All responses must be closed, so close the failed one before retrying.
+ response?.close()
return sleepAsync(backoffMillis.toMillis()).thenCompose {
executeWithRetries(requestWithRetryCount, requestOptions)
}
@@ -223,27 +227,27 @@ private constructor(
return Duration.ofNanos((TimeUnit.SECONDS.toNanos(1) * backoffSeconds * jitter).toLong())
}
- private fun sleepAsync(millis: Long): CompletableFuture {
- val future = CompletableFuture()
- TIMER.schedule(
- object : TimerTask() {
- override fun run() {
- future.complete(null)
- }
- },
- millis
- )
- return future
- }
-
companion object {
private val TIMER = Timer("RetryingHttpClient", true)
+ private fun sleepAsync(millis: Long): CompletableFuture {
+ val future = CompletableFuture()
+ TIMER.schedule(
+ object : TimerTask() {
+ override fun run() {
+ future.complete(null)
+ }
+ },
+ millis
+ )
+ return future
+ }
+
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ class Builder internal constructor() {
private var httpClient: HttpClient? = null
private var clock: Clock = Clock.systemUTC()
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt
index 50c17f36..172a304f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt
@@ -30,7 +30,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [OrbError]. */
+ class Builder internal constructor() {
private var additionalProperties: MutableMap = mutableMapOf()
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt
index 7a1b4a84..321ab11e 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt
@@ -156,7 +156,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Alert]. */
+ class Builder internal constructor() {
private var id: JsonField? = null
private var createdAt: JsonField? = null
@@ -365,7 +366,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Customer]. */
+ class Builder internal constructor() {
private var id: JsonField? = null
private var externalCustomerId: JsonField? = null
@@ -473,7 +475,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Metric]. */
+ class Builder internal constructor() {
private var id: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@@ -603,7 +606,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Plan]. */
+ class Builder internal constructor() {
private var id: JsonField? = null
private var externalPlanId: JsonField? = null
@@ -746,7 +750,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Subscription]. */
+ class Builder internal constructor() {
private var id: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@@ -849,7 +854,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Threshold]. */
+ class Builder internal constructor() {
private var value: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@@ -922,6 +928,14 @@ private constructor(
private val value: JsonField,
) : Enum {
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
companion object {
@@ -939,6 +953,7 @@ private constructor(
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
+ /** An enum containing [Type]'s known values. */
enum class Known {
USAGE_EXCEEDED,
COST_EXCEEDED,
@@ -947,15 +962,32 @@ private constructor(
CREDIT_BALANCE_RECOVERED,
}
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
enum class Value {
USAGE_EXCEEDED,
COST_EXCEEDED,
CREDIT_BALANCE_DEPLETED,
CREDIT_BALANCE_DROPPED,
CREDIT_BALANCE_RECOVERED,
+ /** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
fun value(): Value =
when (this) {
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
@@ -966,6 +998,14 @@ private constructor(
else -> Value._UNKNOWN
}
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws OrbInvalidDataException if this class instance's value is a not a known member.
+ */
fun known(): Known =
when (this) {
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
index aa1a4cd2..17954d4a 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
@@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField
import com.withorb.api.core.JsonMissing
import com.withorb.api.core.JsonValue
import com.withorb.api.core.NoAutoDetect
+import com.withorb.api.core.Params
import com.withorb.api.core.checkRequired
import com.withorb.api.core.http.Headers
import com.withorb.api.core.http.QueryParams
@@ -30,12 +31,12 @@ import java.util.Optional
* `credit_balance_recovered` alerts do not require thresholds.
*/
class AlertCreateForCustomerParams
-constructor(
+private constructor(
private val customerId: String,
private val body: AlertCreateForCustomerBody,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
-) {
+) : Params {
fun customerId(): String = customerId
@@ -63,11 +64,11 @@ constructor(
fun _additionalQueryParams(): QueryParams = additionalQueryParams
- @JvmSynthetic internal fun getBody(): AlertCreateForCustomerBody = body
+ @JvmSynthetic internal fun _body(): AlertCreateForCustomerBody = body
- @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders
+ override fun _headers(): Headers = additionalHeaders
- @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams
+ override fun _queryParams(): QueryParams = additionalQueryParams
fun getPathParam(index: Int): String {
return when (index) {
@@ -136,7 +137,8 @@ constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [AlertCreateForCustomerBody]. */
+ class Builder internal constructor() {
private var currency: JsonField? = null
private var type: JsonField? = null
@@ -244,8 +246,9 @@ constructor(
@JvmStatic fun builder() = Builder()
}
+ /** A builder for [AlertCreateForCustomerParams]. */
@NoAutoDetect
- class Builder {
+ class Builder internal constructor() {
private var customerId: String? = null
private var body: AlertCreateForCustomerBody.Builder = AlertCreateForCustomerBody.builder()
@@ -421,6 +424,14 @@ constructor(
private val value: JsonField,
) : Enum {
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
companion object {
@@ -438,6 +449,7 @@ constructor(
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
+ /** An enum containing [Type]'s known values. */
enum class Known {
USAGE_EXCEEDED,
COST_EXCEEDED,
@@ -446,15 +458,32 @@ constructor(
CREDIT_BALANCE_RECOVERED,
}
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
enum class Value {
USAGE_EXCEEDED,
COST_EXCEEDED,
CREDIT_BALANCE_DEPLETED,
CREDIT_BALANCE_DROPPED,
CREDIT_BALANCE_RECOVERED,
+ /** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
fun value(): Value =
when (this) {
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
@@ -465,6 +494,14 @@ constructor(
else -> Value._UNKNOWN
}
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws OrbInvalidDataException if this class instance's value is a not a known member.
+ */
fun known(): Known =
when (this) {
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
@@ -538,7 +575,8 @@ constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Threshold]. */
+ class Builder internal constructor() {
private var value: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
index 0475ed90..a5cd29b0 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
@@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField
import com.withorb.api.core.JsonMissing
import com.withorb.api.core.JsonValue
import com.withorb.api.core.NoAutoDetect
+import com.withorb.api.core.Params
import com.withorb.api.core.checkRequired
import com.withorb.api.core.http.Headers
import com.withorb.api.core.http.QueryParams
@@ -30,12 +31,12 @@ import java.util.Optional
* `credit_balance_recovered` alerts do not require thresholds.
*/
class AlertCreateForExternalCustomerParams
-constructor(
+private constructor(
private val externalCustomerId: String,
private val body: AlertCreateForExternalCustomerBody,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
-) {
+) : Params {
fun externalCustomerId(): String = externalCustomerId
@@ -63,11 +64,11 @@ constructor(
fun _additionalQueryParams(): QueryParams = additionalQueryParams
- @JvmSynthetic internal fun getBody(): AlertCreateForExternalCustomerBody = body
+ @JvmSynthetic internal fun _body(): AlertCreateForExternalCustomerBody = body
- @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders
+ override fun _headers(): Headers = additionalHeaders
- @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams
+ override fun _queryParams(): QueryParams = additionalQueryParams
fun getPathParam(index: Int): String {
return when (index) {
@@ -136,7 +137,8 @@ constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [AlertCreateForExternalCustomerBody]. */
+ class Builder internal constructor() {
private var currency: JsonField? = null
private var type: JsonField? = null
@@ -247,8 +249,9 @@ constructor(
@JvmStatic fun builder() = Builder()
}
+ /** A builder for [AlertCreateForExternalCustomerParams]. */
@NoAutoDetect
- class Builder {
+ class Builder internal constructor() {
private var externalCustomerId: String? = null
private var body: AlertCreateForExternalCustomerBody.Builder =
@@ -430,6 +433,14 @@ constructor(
private val value: JsonField,
) : Enum {
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
companion object {
@@ -447,6 +458,7 @@ constructor(
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
+ /** An enum containing [Type]'s known values. */
enum class Known {
USAGE_EXCEEDED,
COST_EXCEEDED,
@@ -455,15 +467,32 @@ constructor(
CREDIT_BALANCE_RECOVERED,
}
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
enum class Value {
USAGE_EXCEEDED,
COST_EXCEEDED,
CREDIT_BALANCE_DEPLETED,
CREDIT_BALANCE_DROPPED,
CREDIT_BALANCE_RECOVERED,
+ /** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
fun value(): Value =
when (this) {
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
@@ -474,6 +503,14 @@ constructor(
else -> Value._UNKNOWN
}
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws OrbInvalidDataException if this class instance's value is a not a known member.
+ */
fun known(): Known =
when (this) {
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
@@ -547,7 +584,8 @@ constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Threshold]. */
+ class Builder internal constructor() {
private var value: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt
index a02901f1..fc8eb74d 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt
@@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField
import com.withorb.api.core.JsonMissing
import com.withorb.api.core.JsonValue
import com.withorb.api.core.NoAutoDetect
+import com.withorb.api.core.Params
import com.withorb.api.core.checkRequired
import com.withorb.api.core.http.Headers
import com.withorb.api.core.http.QueryParams
@@ -34,12 +35,12 @@ import java.util.Optional
* current billing cycle.
*/
class AlertCreateForSubscriptionParams
-constructor(
+private constructor(
private val subscriptionId: String,
private val body: AlertCreateForSubscriptionBody,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
-) {
+) : Params {
fun subscriptionId(): String = subscriptionId
@@ -67,11 +68,11 @@ constructor(
fun _additionalQueryParams(): QueryParams = additionalQueryParams
- @JvmSynthetic internal fun getBody(): AlertCreateForSubscriptionBody = body
+ @JvmSynthetic internal fun _body(): AlertCreateForSubscriptionBody = body
- @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders
+ override fun _headers(): Headers = additionalHeaders
- @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams
+ override fun _queryParams(): QueryParams = additionalQueryParams
fun getPathParam(index: Int): String {
return when (index) {
@@ -139,7 +140,8 @@ constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [AlertCreateForSubscriptionBody]. */
+ class Builder internal constructor() {
private var thresholds: JsonField>? = null
private var type: JsonField? = null
@@ -247,8 +249,9 @@ constructor(
@JvmStatic fun builder() = Builder()
}
+ /** A builder for [AlertCreateForSubscriptionParams]. */
@NoAutoDetect
- class Builder {
+ class Builder internal constructor() {
private var subscriptionId: String? = null
private var body: AlertCreateForSubscriptionBody.Builder =
@@ -468,7 +471,8 @@ constructor(
@JvmStatic fun builder() = Builder()
}
- class Builder {
+ /** A builder for [Threshold]. */
+ class Builder internal constructor() {
private var value: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@@ -541,6 +545,14 @@ constructor(
private val value: JsonField,
) : Enum {
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
companion object {
@@ -558,6 +570,7 @@ constructor(
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
+ /** An enum containing [Type]'s known values. */
enum class Known {
USAGE_EXCEEDED,
COST_EXCEEDED,
@@ -566,15 +579,32 @@ constructor(
CREDIT_BALANCE_RECOVERED,
}
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
enum class Value {
USAGE_EXCEEDED,
COST_EXCEEDED,
CREDIT_BALANCE_DEPLETED,
CREDIT_BALANCE_DROPPED,
CREDIT_BALANCE_RECOVERED,
+ /** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
fun value(): Value =
when (this) {
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
@@ -585,6 +615,14 @@ constructor(
else -> Value._UNKNOWN
}
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws OrbInvalidDataException if this class instance's value is a not a known member.
+ */
fun known(): Known =
when (this) {
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
index fa1f0f6a..a96e969e 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
@@ -4,6 +4,7 @@ package com.withorb.api.models
import com.withorb.api.core.JsonValue
import com.withorb.api.core.NoAutoDetect
+import com.withorb.api.core.Params
import com.withorb.api.core.checkRequired
import com.withorb.api.core.http.Headers
import com.withorb.api.core.http.QueryParams
@@ -17,13 +18,13 @@ import java.util.Optional
* customer or subscription level alerts.
*/
class AlertDisableParams
-constructor(
+private constructor(
private val alertConfigurationId: String,
private val subscriptionId: String?,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
private val additionalBodyProperties: Map,
-) {
+) : Params {
fun alertConfigurationId(): String = alertConfigurationId
@@ -37,13 +38,12 @@ constructor(
fun _additionalBodyProperties(): Map = additionalBodyProperties
@JvmSynthetic
- internal fun getBody(): Optional