diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 93f2c0fea..a5c6e2b79 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -65,14 +65,18 @@ jobs:
run: ./scripts/build
- name: Get GitHub OIDC Token
- if: github.repository == 'stainless-sdks/orb-java'
+ if: |-
+ github.repository == 'stainless-sdks/orb-java' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
- uses: actions/github-script@v6
+ uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());
- name: Build and upload Maven artifacts
- if: github.repository == 'stainless-sdks/orb-java'
+ if: |-
+ github.repository == 'stainless-sdks/orb-java' &&
+ !startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index eb4e0dba7..caf148712 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "1.10.0"
+ ".": "1.11.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 666bff36b..438843fd3 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 126
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c131de17773b450eb1ec03ca001f94d3777e35347234869a7efee083003e1513.yml
-openapi_spec_hash: 5d2d4a3a9ada1c381efb318b6897994d
-config_hash: bcf82bddb691f6be773ac6cae8c03b9a
+configured_endpoints: 139
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d6a851f21804170f796637f1911c3382f1c57f5ed6b9b77cd7d0c6f74c06e174.yml
+openapi_spec_hash: 82df33badf54d0c7087a61145d379f58
+config_hash: 3279841440b02d4e8303c961d6983492
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2985ce5a0..f487c6bf6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,61 @@
# Changelog
+## 1.11.0 (2026-03-07)
+
+Full Changelog: [v1.10.0...v1.11.0](https://github.com/orbcorp/orb-java/compare/v1.10.0...v1.11.0)
+
+### Features
+
+* **api:** api update ([037dbcd](https://github.com/orbcorp/orb-java/commit/037dbcde5fbff819b3a65b43bdc92332a88d96e5))
+* **api:** api update ([014ce03](https://github.com/orbcorp/orb-java/commit/014ce038155006c8874869d82da451b427b5a177))
+* **api:** api update ([4ed5e39](https://github.com/orbcorp/orb-java/commit/4ed5e399e2aeb4ba507314f37ebe510a7f4dcecf))
+* **api:** api update ([522cf9b](https://github.com/orbcorp/orb-java/commit/522cf9bee689650a217f54f12d93f1c548994fa0))
+* **api:** api update ([7661c8c](https://github.com/orbcorp/orb-java/commit/7661c8c5892a01032cf4b24a74b309a2eac77f0c))
+* **api:** api update ([ededc4d](https://github.com/orbcorp/orb-java/commit/ededc4dcf7a0dcbe132f60e4e06b7c0b3c538caa))
+* **api:** api update ([3b82472](https://github.com/orbcorp/orb-java/commit/3b8247255097a5250b47059ca568429a26e0f285))
+* **api:** api update ([c310e36](https://github.com/orbcorp/orb-java/commit/c310e36ffe22fafdd5ba9a00728e7816a8d0e1e6))
+* **api:** api update ([a80ec0b](https://github.com/orbcorp/orb-java/commit/a80ec0b34dabf9595dbae9dfc4b4ed6c914cf5d2))
+* **api:** api update ([69429b9](https://github.com/orbcorp/orb-java/commit/69429b99a2aa15ce52ebd45f7a2a531395f3dc94))
+* **api:** api update ([49d56e2](https://github.com/orbcorp/orb-java/commit/49d56e2d1ef966ebf6ad4508c81b43a19e7cf9c5))
+* **api:** api update ([1e5f897](https://github.com/orbcorp/orb-java/commit/1e5f8972d4dd8c4c955e8980b0c83901a2594bd6))
+* **api:** api update ([eaca79d](https://github.com/orbcorp/orb-java/commit/eaca79da23a8cad0430abcb0319c8a37a5bbfc2a))
+* **api:** manual updates ([5ba9c33](https://github.com/orbcorp/orb-java/commit/5ba9c33bba4f76344046e7cd93946fe96befaf34))
+* **client:** add connection pooling option ([21b4047](https://github.com/orbcorp/orb-java/commit/21b4047e592f1d92782f6aacba9ba0f4d8d893d2))
+* **client:** add more convenience service method overloads ([f56884d](https://github.com/orbcorp/orb-java/commit/f56884dcd6437584dabd311bf0583c6145515e60))
+* **client:** send `X-Stainless-Kotlin-Version` header ([10357a9](https://github.com/orbcorp/orb-java/commit/10357a946d98ffd0cb26409f81af477b4c4638b2))
+
+
+### Bug Fixes
+
+* **client:** preserve time zone in lenient date-time parsing ([928bfae](https://github.com/orbcorp/orb-java/commit/928bfae14d9e8353f052404bf80873f1bd60d167))
+* fix request delays for retrying to be more respectful of high requested delays ([185d18d](https://github.com/orbcorp/orb-java/commit/185d18dd791129bdbcf9c7c0fe12cdeb34474045))
+
+
+### Chores
+
+* **ci:** skip uploading artifacts on stainless-internal branches ([2b236e9](https://github.com/orbcorp/orb-java/commit/2b236e90a64e621b2f772208c4048ccb1f26c066))
+* **ci:** upgrade `actions/github-script` ([7850067](https://github.com/orbcorp/orb-java/commit/7850067ac12719de79ff00ada02962f035782791))
+* **docs:** add missing descriptions ([d101825](https://github.com/orbcorp/orb-java/commit/d101825fc5db427bb9d36c6b82154919eea85103))
+* drop apache dependency ([edcdb51](https://github.com/orbcorp/orb-java/commit/edcdb514ff66cba287aab7ec5dec282078abb45f))
+* **internal:** allow passing args to `./scripts/test` ([ffbc747](https://github.com/orbcorp/orb-java/commit/ffbc7473823b4ea0ccd27b9cfb85f8a5c165bb47))
+* **internal:** bump palantir-java-format ([82f17f8](https://github.com/orbcorp/orb-java/commit/82f17f8f9081527292cc9ca2bc150d10b2b9dfc1))
+* **internal:** codegen related update ([489bdd6](https://github.com/orbcorp/orb-java/commit/489bdd632da69ee3bafce9d5364861821f235c2b))
+* **internal:** codegen related update ([b8b2251](https://github.com/orbcorp/orb-java/commit/b8b2251ef940a4d3a5276a9287bfc628fcc7fa2b))
+* **internal:** codegen related update ([46abca4](https://github.com/orbcorp/orb-java/commit/46abca478b99884a07ac874f56f5ab7f615d9162))
+* **internal:** correct cache invalidation for `SKIP_MOCK_TESTS` ([4a49c05](https://github.com/orbcorp/orb-java/commit/4a49c05fd112adb44adebff7481d4076ede46058))
+* **internal:** expand imports ([c1195af](https://github.com/orbcorp/orb-java/commit/c1195afe5fc1798dbfd9c8c183501d1e4f33db75))
+* **internal:** make `OkHttp` constructor internal ([05a1acc](https://github.com/orbcorp/orb-java/commit/05a1acc5dd4128fe698db34626ebaaed97ad17f6))
+* **internal:** update `TestServerExtension` comment ([3447469](https://github.com/orbcorp/orb-java/commit/34474693bac76cf4855636d09bac7001108f2ccc))
+* **internal:** update maven repo doc to include authentication ([9aa3e27](https://github.com/orbcorp/orb-java/commit/9aa3e2745cf3794784ee229af579142c6d560182))
+* **internal:** upgrade AssertJ ([719f036](https://github.com/orbcorp/orb-java/commit/719f036e81d72bf5c80a3e53de1e6fcdee49f15e))
+* make `Properties` more resilient to `null` ([39c553f](https://github.com/orbcorp/orb-java/commit/39c553f7b878162f7affd567e9c0450d1411e653))
+* **test:** do not count install time for mock server timeout ([efdd6eb](https://github.com/orbcorp/orb-java/commit/efdd6ebf4a150e21f6edc283f5cd8f91ed049b12))
+
+
+### Documentation
+
+* add comment for arbitrary value fields ([e2f42d1](https://github.com/orbcorp/orb-java/commit/e2f42d1f5d5b951c50798e943a64e14ff134b4f2))
+
## 1.10.0 (2026-01-17)
Full Changelog: [v1.9.0...v1.10.0](https://github.com/orbcorp/orb-java/compare/v1.9.0...v1.10.0)
diff --git a/README.md b/README.md
index be99484ce..3a3cba045 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/1.10.0)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/1.11.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:1.10.0")
+implementation("com.withorb.api:orb-java:1.11.0")
```
### Maven
@@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:1.10.0")
com.withorb.api
orb-java
- 1.10.0
+ 1.11.0
```
@@ -457,6 +457,25 @@ OrbClient client = OrbOkHttpClient.builder()
.build();
```
+### Connection pooling
+
+To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
+
+```java
+import com.withorb.api.client.OrbClient;
+import com.withorb.api.client.okhttp.OrbOkHttpClient;
+import java.time.Duration;
+
+OrbClient client = OrbOkHttpClient.builder()
+ .fromEnv()
+ // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.
+ .maxIdleConnections(10)
+ .keepAliveDuration(Duration.ofMinutes(2))
+ .build();
+```
+
+If both options are unset, OkHttp's default connection pool settings are used.
+
### HTTPS
> [!NOTE]
diff --git a/build.gradle.kts b/build.gradle.kts
index 8e1585b2b..81989492b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,6 @@
allprojects {
group = "com.withorb.api"
- version = "1.10.0" // x-release-please-version
+ version = "1.11.0" // x-release-please-version
}
subprojects {
diff --git a/buildSrc/src/main/kotlin/orb.java.gradle.kts b/buildSrc/src/main/kotlin/orb.java.gradle.kts
index 70fc33f41..8f4f902a6 100644
--- a/buildSrc/src/main/kotlin/orb.java.gradle.kts
+++ b/buildSrc/src/main/kotlin/orb.java.gradle.kts
@@ -45,7 +45,7 @@ tasks.withType().configureEach {
val palantir by configurations.creating
dependencies {
- palantir("com.palantir.javaformat:palantir-java-format:2.73.0")
+ palantir("com.palantir.javaformat:palantir-java-format:2.89.0")
}
fun registerPalantir(
diff --git a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
index b908b3bed..78bb0bbc3 100644
--- a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
+++ b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
@@ -33,6 +33,9 @@ kotlin {
tasks.withType().configureEach {
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
+
+ // `SKIP_MOCK_TESTS` affects which tests run so it must be added as input for proper cache invalidation.
+ inputs.property("skipMockTests", System.getenv("SKIP_MOCK_TESTS")).optional(true)
}
val ktfmt by configurations.creating
diff --git a/examples/.keep b/examples/.keep
deleted file mode 100644
index d8c73e937..000000000
--- a/examples/.keep
+++ /dev/null
@@ -1,4 +0,0 @@
-File generated from our OpenAPI spec by Stainless.
-
-This directory can be used to store example files demonstrating usage of this SDK.
-It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
\ No newline at end of file
diff --git a/orb-java-client-okhttp/build.gradle.kts b/orb-java-client-okhttp/build.gradle.kts
index 856cade40..e2241172b 100644
--- a/orb-java-client-okhttp/build.gradle.kts
+++ b/orb-java-client-okhttp/build.gradle.kts
@@ -10,6 +10,6 @@ dependencies {
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
testImplementation(kotlin("test"))
- testImplementation("org.assertj:assertj-core:3.25.3")
+ testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2")
}
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 4d54698c3..ebfa6f879 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
@@ -16,11 +16,13 @@ import java.time.Duration
import java.util.concurrent.CancellationException
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ExecutorService
+import java.util.concurrent.TimeUnit
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import okhttp3.Call
import okhttp3.Callback
+import okhttp3.ConnectionPool
import okhttp3.Dispatcher
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
@@ -33,7 +35,7 @@ import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
class OkHttpClient
-private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
+internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
val call = newCall(request, requestOptions)
@@ -200,6 +202,8 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var dispatcherExecutorService: ExecutorService? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
@@ -211,6 +215,28 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }
+ /**
+ * Sets the maximum number of idle connections kept by the underlying [ConnectionPool].
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Sets the keep-alive duration for idle connections in the underlying [ConnectionPool].
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
this.dispatcherExecutorService = dispatcherExecutorService
}
@@ -240,6 +266,22 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
.apply {
dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }
+ val maxIdleConnections = maxIdleConnections
+ val keepAliveDuration = keepAliveDuration
+ if (maxIdleConnections != null && keepAliveDuration != null) {
+ connectionPool(
+ ConnectionPool(
+ maxIdleConnections,
+ keepAliveDuration.toNanos(),
+ TimeUnit.NANOSECONDS,
+ )
+ )
+ } else {
+ check((maxIdleConnections != null) == (keepAliveDuration != null)) {
+ "Both or none of `maxIdleConnections` and `keepAliveDuration` must be set, but only one was set"
+ }
+ }
+
val sslSocketFactory = sslSocketFactory
val trustManager = trustManager
if (sslSocketFactory != null && trustManager != null) {
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 efc83cf9b..edc82fe25 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
@@ -49,6 +49,8 @@ class OrbOkHttpClient private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
@@ -77,6 +79,46 @@ class OrbOkHttpClient private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * The maximum number of idle connections kept by the underlying OkHttp connection pool.
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Alias for [Builder.maxIdleConnections].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int) =
+ maxIdleConnections(maxIdleConnections as Int?)
+
+ /**
+ * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
+ */
+ fun maxIdleConnections(maxIdleConnections: Optional) =
+ maxIdleConnections(maxIdleConnections.getOrNull())
+
+ /**
+ * The keep-alive duration for idle connections in the underlying OkHttp connection pool.
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
+ /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
+ fun keepAliveDuration(keepAliveDuration: Optional) =
+ keepAliveDuration(keepAliveDuration.getOrNull())
+
/**
* The socket factory used to secure HTTPS connections.
*
@@ -338,6 +380,8 @@ class OrbOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .maxIdleConnections(maxIdleConnections)
+ .keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
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 0a71facec..1ae611773 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
@@ -49,6 +49,8 @@ class OrbOkHttpClientAsync private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
+ private var maxIdleConnections: Int? = null
+ private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
@@ -77,6 +79,46 @@ class OrbOkHttpClientAsync private constructor() {
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
fun proxy(proxy: Optional) = proxy(proxy.getOrNull())
+ /**
+ * The maximum number of idle connections kept by the underlying OkHttp connection pool.
+ *
+ * If this is set, then [keepAliveDuration] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int?) = apply {
+ this.maxIdleConnections = maxIdleConnections
+ }
+
+ /**
+ * Alias for [Builder.maxIdleConnections].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun maxIdleConnections(maxIdleConnections: Int) =
+ maxIdleConnections(maxIdleConnections as Int?)
+
+ /**
+ * Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
+ */
+ fun maxIdleConnections(maxIdleConnections: Optional) =
+ maxIdleConnections(maxIdleConnections.getOrNull())
+
+ /**
+ * The keep-alive duration for idle connections in the underlying OkHttp connection pool.
+ *
+ * If this is set, then [maxIdleConnections] must also be set.
+ *
+ * If unset, then OkHttp's default is used.
+ */
+ fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
+ this.keepAliveDuration = keepAliveDuration
+ }
+
+ /** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
+ fun keepAliveDuration(keepAliveDuration: Optional) =
+ keepAliveDuration(keepAliveDuration.getOrNull())
+
/**
* The socket factory used to secure HTTPS connections.
*
@@ -338,6 +380,8 @@ class OrbOkHttpClientAsync private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
+ .maxIdleConnections(maxIdleConnections)
+ .keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
diff --git a/orb-java-core/build.gradle.kts b/orb-java-core/build.gradle.kts
index 086a58f55..72660d18e 100644
--- a/orb-java-core/build.gradle.kts
+++ b/orb-java-core/build.gradle.kts
@@ -27,13 +27,11 @@ dependencies {
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2")
- implementation("org.apache.httpcomponents.core5:httpcore5:5.2.4")
- implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1")
testImplementation(kotlin("test"))
testImplementation(project(":orb-java-client-okhttp"))
testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2")
- testImplementation("org.assertj:assertj-core:3.25.3")
+ testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3")
testImplementation("org.junit-pioneer:junit-pioneer:1.9.1")
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 b3cc3efcc..6a41f268b 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
@@ -14,6 +14,8 @@ import com.withorb.api.services.blocking.EventService
import com.withorb.api.services.blocking.InvoiceLineItemService
import com.withorb.api.services.blocking.InvoiceService
import com.withorb.api.services.blocking.ItemService
+import com.withorb.api.services.blocking.LicenseService
+import com.withorb.api.services.blocking.LicenseTypeService
import com.withorb.api.services.blocking.MetricService
import com.withorb.api.services.blocking.PlanService
import com.withorb.api.services.blocking.PriceService
@@ -61,40 +63,137 @@ interface OrbClient {
fun topLevel(): TopLevelService
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
fun beta(): BetaService
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a fixed
+ * or percentage amount to an invoice or subscription. Coupons are activated using a redemption
+ * code, which applies the discount to a subscription or invoice. The duration of a coupon
+ * determines how long it remains available for use by end users.
+ */
fun coupons(): CouponService
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied
+ * to a particular invoice.
+ */
fun creditNotes(): CreditNoteService
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum
+ * field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your account's
+ * timezone. See [Timezone localization](/essentials/timezones) for information on what this
+ * timezone parameter influences within Orb.
+ */
fun customers(): CustomerService
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created for
+ * a customer. Events are the core of Orb's usage-based billing model, and are used to calculate
+ * the usage charges for a given billing period.
+ */
fun events(): EventService
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
fun invoiceLineItems(): InvoiceLineItemService
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
fun invoices(): InvoiceService
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all line
+ * items, billable metrics, and prices and are used for defining external sync behavior for
+ * invoices and tax calculation purposes.
+ */
fun items(): ItemService
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
fun metrics(): MetricService
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
fun plans(): PlanService
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in a
+ * charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key for
+ * the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
fun prices(): PriceService
fun subscriptions(): SubscriptionService
fun webhooks(): WebhookService
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or credit
+ * balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
fun alerts(): AlertService
fun dimensionalPriceGroups(): DimensionalPriceGroupService
fun subscriptionChanges(): SubscriptionChangeService
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
fun creditBlocks(): CreditBlockService
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users. License
+ * types are used during billing by grouping metrics on the configured grouping key.
+ */
+ fun licenseTypes(): LicenseTypeService
+
+ fun licenses(): LicenseService
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -120,36 +219,133 @@ interface OrbClient {
fun topLevel(): TopLevelService.WithRawResponse
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
fun beta(): BetaService.WithRawResponse
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a
+ * fixed or percentage amount to an invoice or subscription. Coupons are activated using a
+ * redemption code, which applies the discount to a subscription or invoice. The duration of
+ * a coupon determines how long it remains available for use by end users.
+ */
fun coupons(): CouponService.WithRawResponse
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been
+ * applied to a particular invoice.
+ */
fun creditNotes(): CreditNoteService.WithRawResponse
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider`
+ * enum field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your
+ * account's timezone. See [Timezone localization](/essentials/timezones) for information on
+ * what this timezone parameter influences within Orb.
+ */
fun customers(): CustomerService.WithRawResponse
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created
+ * for a customer. Events are the core of Orb's usage-based billing model, and are used to
+ * calculate the usage charges for a given billing period.
+ */
fun events(): EventService.WithRawResponse
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
fun invoiceLineItems(): InvoiceLineItemService.WithRawResponse
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
fun invoices(): InvoiceService.WithRawResponse
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all
+ * line items, billable metrics, and prices and are used for defining external sync behavior
+ * for invoices and tax calculation purposes.
+ */
fun items(): ItemService.WithRawResponse
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
fun metrics(): MetricService.WithRawResponse
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
fun plans(): PlanService.WithRawResponse
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
fun prices(): PriceService.WithRawResponse
fun subscriptions(): SubscriptionService.WithRawResponse
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or
+ * credit balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
fun alerts(): AlertService.WithRawResponse
fun dimensionalPriceGroups(): DimensionalPriceGroupService.WithRawResponse
fun subscriptionChanges(): SubscriptionChangeService.WithRawResponse
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
fun creditBlocks(): CreditBlockService.WithRawResponse
+
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users.
+ * License types are used during billing by grouping metrics on the configured grouping key.
+ */
+ fun licenseTypes(): LicenseTypeService.WithRawResponse
+
+ fun licenses(): LicenseService.WithRawResponse
}
}
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 a8b535120..3857f7297 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
@@ -14,6 +14,8 @@ import com.withorb.api.services.async.EventServiceAsync
import com.withorb.api.services.async.InvoiceLineItemServiceAsync
import com.withorb.api.services.async.InvoiceServiceAsync
import com.withorb.api.services.async.ItemServiceAsync
+import com.withorb.api.services.async.LicenseServiceAsync
+import com.withorb.api.services.async.LicenseTypeServiceAsync
import com.withorb.api.services.async.MetricServiceAsync
import com.withorb.api.services.async.PlanServiceAsync
import com.withorb.api.services.async.PriceServiceAsync
@@ -60,38 +62,135 @@ interface OrbClientAsync {
fun topLevel(): TopLevelServiceAsync
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
fun beta(): BetaServiceAsync
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a fixed
+ * or percentage amount to an invoice or subscription. Coupons are activated using a redemption
+ * code, which applies the discount to a subscription or invoice. The duration of a coupon
+ * determines how long it remains available for use by end users.
+ */
fun coupons(): CouponServiceAsync
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied
+ * to a particular invoice.
+ */
fun creditNotes(): CreditNoteServiceAsync
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum
+ * field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your account's
+ * timezone. See [Timezone localization](/essentials/timezones) for information on what this
+ * timezone parameter influences within Orb.
+ */
fun customers(): CustomerServiceAsync
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created for
+ * a customer. Events are the core of Orb's usage-based billing model, and are used to calculate
+ * the usage charges for a given billing period.
+ */
fun events(): EventServiceAsync
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
fun invoiceLineItems(): InvoiceLineItemServiceAsync
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
fun invoices(): InvoiceServiceAsync
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all line
+ * items, billable metrics, and prices and are used for defining external sync behavior for
+ * invoices and tax calculation purposes.
+ */
fun items(): ItemServiceAsync
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
fun metrics(): MetricServiceAsync
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
fun plans(): PlanServiceAsync
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in a
+ * charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key for
+ * the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
fun prices(): PriceServiceAsync
fun subscriptions(): SubscriptionServiceAsync
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or credit
+ * balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
fun alerts(): AlertServiceAsync
fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync
fun subscriptionChanges(): SubscriptionChangeServiceAsync
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
fun creditBlocks(): CreditBlockServiceAsync
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users. License
+ * types are used during billing by grouping metrics on the configured grouping key.
+ */
+ fun licenseTypes(): LicenseTypeServiceAsync
+
+ fun licenses(): LicenseServiceAsync
+
/**
* Closes this client, relinquishing any underlying resources.
*
@@ -117,36 +216,133 @@ interface OrbClientAsync {
fun topLevel(): TopLevelServiceAsync.WithRawResponse
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
fun beta(): BetaServiceAsync.WithRawResponse
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a
+ * fixed or percentage amount to an invoice or subscription. Coupons are activated using a
+ * redemption code, which applies the discount to a subscription or invoice. The duration of
+ * a coupon determines how long it remains available for use by end users.
+ */
fun coupons(): CouponServiceAsync.WithRawResponse
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been
+ * applied to a particular invoice.
+ */
fun creditNotes(): CreditNoteServiceAsync.WithRawResponse
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider`
+ * enum field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your
+ * account's timezone. See [Timezone localization](/essentials/timezones) for information on
+ * what this timezone parameter influences within Orb.
+ */
fun customers(): CustomerServiceAsync.WithRawResponse
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created
+ * for a customer. Events are the core of Orb's usage-based billing model, and are used to
+ * calculate the usage charges for a given billing period.
+ */
fun events(): EventServiceAsync.WithRawResponse
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
fun invoiceLineItems(): InvoiceLineItemServiceAsync.WithRawResponse
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
fun invoices(): InvoiceServiceAsync.WithRawResponse
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all
+ * line items, billable metrics, and prices and are used for defining external sync behavior
+ * for invoices and tax calculation purposes.
+ */
fun items(): ItemServiceAsync.WithRawResponse
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
fun metrics(): MetricServiceAsync.WithRawResponse
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
fun plans(): PlanServiceAsync.WithRawResponse
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
fun prices(): PriceServiceAsync.WithRawResponse
fun subscriptions(): SubscriptionServiceAsync.WithRawResponse
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or
+ * credit balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
fun alerts(): AlertServiceAsync.WithRawResponse
fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync.WithRawResponse
fun subscriptionChanges(): SubscriptionChangeServiceAsync.WithRawResponse
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
fun creditBlocks(): CreditBlockServiceAsync.WithRawResponse
+
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users.
+ * License types are used during billing by grouping metrics on the configured grouping key.
+ */
+ fun licenseTypes(): LicenseTypeServiceAsync.WithRawResponse
+
+ fun licenses(): LicenseServiceAsync.WithRawResponse
}
}
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 ba4b5c44a..d20aa3a60 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
@@ -26,6 +26,10 @@ import com.withorb.api.services.async.InvoiceServiceAsync
import com.withorb.api.services.async.InvoiceServiceAsyncImpl
import com.withorb.api.services.async.ItemServiceAsync
import com.withorb.api.services.async.ItemServiceAsyncImpl
+import com.withorb.api.services.async.LicenseServiceAsync
+import com.withorb.api.services.async.LicenseServiceAsyncImpl
+import com.withorb.api.services.async.LicenseTypeServiceAsync
+import com.withorb.api.services.async.LicenseTypeServiceAsyncImpl
import com.withorb.api.services.async.MetricServiceAsync
import com.withorb.api.services.async.MetricServiceAsyncImpl
import com.withorb.api.services.async.PlanServiceAsync
@@ -119,6 +123,14 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
CreditBlockServiceAsyncImpl(clientOptionsWithUserAgent)
}
+ private val licenseTypes: LicenseTypeServiceAsync by lazy {
+ LicenseTypeServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val licenses: LicenseServiceAsync by lazy {
+ LicenseServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
override fun sync(): OrbClient = sync
override fun withRawResponse(): OrbClientAsync.WithRawResponse = withRawResponse
@@ -128,30 +140,115 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
override fun topLevel(): TopLevelServiceAsync = topLevel
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
override fun beta(): BetaServiceAsync = beta
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a fixed
+ * or percentage amount to an invoice or subscription. Coupons are activated using a redemption
+ * code, which applies the discount to a subscription or invoice. The duration of a coupon
+ * determines how long it remains available for use by end users.
+ */
override fun coupons(): CouponServiceAsync = coupons
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied
+ * to a particular invoice.
+ */
override fun creditNotes(): CreditNoteServiceAsync = creditNotes
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum
+ * field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your account's
+ * timezone. See [Timezone localization](/essentials/timezones) for information on what this
+ * timezone parameter influences within Orb.
+ */
override fun customers(): CustomerServiceAsync = customers
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created for
+ * a customer. Events are the core of Orb's usage-based billing model, and are used to calculate
+ * the usage charges for a given billing period.
+ */
override fun events(): EventServiceAsync = events
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
override fun invoiceLineItems(): InvoiceLineItemServiceAsync = invoiceLineItems
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
override fun invoices(): InvoiceServiceAsync = invoices
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all line
+ * items, billable metrics, and prices and are used for defining external sync behavior for
+ * invoices and tax calculation purposes.
+ */
override fun items(): ItemServiceAsync = items
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
override fun metrics(): MetricServiceAsync = metrics
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
override fun plans(): PlanServiceAsync = plans
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in a
+ * charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key for
+ * the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
override fun prices(): PriceServiceAsync = prices
override fun subscriptions(): SubscriptionServiceAsync = subscriptions
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or credit
+ * balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
override fun alerts(): AlertServiceAsync = alerts
override fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync =
@@ -159,8 +256,20 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
override fun subscriptionChanges(): SubscriptionChangeServiceAsync = subscriptionChanges
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
override fun creditBlocks(): CreditBlockServiceAsync = creditBlocks
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users. License
+ * types are used during billing by grouping metrics on the configured grouping key.
+ */
+ override fun licenseTypes(): LicenseTypeServiceAsync = licenseTypes
+
+ override fun licenses(): LicenseServiceAsync = licenses
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -235,6 +344,14 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
CreditBlockServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ private val licenseTypes: LicenseTypeServiceAsync.WithRawResponse by lazy {
+ LicenseTypeServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val licenses: LicenseServiceAsync.WithRawResponse by lazy {
+ LicenseServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): OrbClientAsync.WithRawResponse =
@@ -244,31 +361,116 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
override fun topLevel(): TopLevelServiceAsync.WithRawResponse = topLevel
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
override fun beta(): BetaServiceAsync.WithRawResponse = beta
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a
+ * fixed or percentage amount to an invoice or subscription. Coupons are activated using a
+ * redemption code, which applies the discount to a subscription or invoice. The duration of
+ * a coupon determines how long it remains available for use by end users.
+ */
override fun coupons(): CouponServiceAsync.WithRawResponse = coupons
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been
+ * applied to a particular invoice.
+ */
override fun creditNotes(): CreditNoteServiceAsync.WithRawResponse = creditNotes
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider`
+ * enum field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your
+ * account's timezone. See [Timezone localization](/essentials/timezones) for information on
+ * what this timezone parameter influences within Orb.
+ */
override fun customers(): CustomerServiceAsync.WithRawResponse = customers
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created
+ * for a customer. Events are the core of Orb's usage-based billing model, and are used to
+ * calculate the usage charges for a given billing period.
+ */
override fun events(): EventServiceAsync.WithRawResponse = events
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
override fun invoiceLineItems(): InvoiceLineItemServiceAsync.WithRawResponse =
invoiceLineItems
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
override fun invoices(): InvoiceServiceAsync.WithRawResponse = invoices
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all
+ * line items, billable metrics, and prices and are used for defining external sync behavior
+ * for invoices and tax calculation purposes.
+ */
override fun items(): ItemServiceAsync.WithRawResponse = items
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
override fun metrics(): MetricServiceAsync.WithRawResponse = metrics
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
override fun plans(): PlanServiceAsync.WithRawResponse = plans
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
override fun prices(): PriceServiceAsync.WithRawResponse = prices
override fun subscriptions(): SubscriptionServiceAsync.WithRawResponse = subscriptions
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or
+ * credit balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
override fun alerts(): AlertServiceAsync.WithRawResponse = alerts
override fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync.WithRawResponse =
@@ -277,6 +479,18 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
override fun subscriptionChanges(): SubscriptionChangeServiceAsync.WithRawResponse =
subscriptionChanges
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
override fun creditBlocks(): CreditBlockServiceAsync.WithRawResponse = creditBlocks
+
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users.
+ * License types are used during billing by grouping metrics on the configured grouping key.
+ */
+ override fun licenseTypes(): LicenseTypeServiceAsync.WithRawResponse = licenseTypes
+
+ override fun licenses(): LicenseServiceAsync.WithRawResponse = licenses
}
}
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 4fa187d47..a39b97ca1 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
@@ -26,6 +26,10 @@ import com.withorb.api.services.blocking.InvoiceService
import com.withorb.api.services.blocking.InvoiceServiceImpl
import com.withorb.api.services.blocking.ItemService
import com.withorb.api.services.blocking.ItemServiceImpl
+import com.withorb.api.services.blocking.LicenseService
+import com.withorb.api.services.blocking.LicenseServiceImpl
+import com.withorb.api.services.blocking.LicenseTypeService
+import com.withorb.api.services.blocking.LicenseTypeServiceImpl
import com.withorb.api.services.blocking.MetricService
import com.withorb.api.services.blocking.MetricServiceImpl
import com.withorb.api.services.blocking.PlanService
@@ -111,6 +115,12 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
CreditBlockServiceImpl(clientOptionsWithUserAgent)
}
+ private val licenseTypes: LicenseTypeService by lazy {
+ LicenseTypeServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val licenses: LicenseService by lazy { LicenseServiceImpl(clientOptionsWithUserAgent) }
+
override fun async(): OrbClientAsync = async
override fun withRawResponse(): OrbClient.WithRawResponse = withRawResponse
@@ -120,40 +130,137 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
override fun topLevel(): TopLevelService = topLevel
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
override fun beta(): BetaService = beta
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a fixed
+ * or percentage amount to an invoice or subscription. Coupons are activated using a redemption
+ * code, which applies the discount to a subscription or invoice. The duration of a coupon
+ * determines how long it remains available for use by end users.
+ */
override fun coupons(): CouponService = coupons
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied
+ * to a particular invoice.
+ */
override fun creditNotes(): CreditNoteService = creditNotes
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum
+ * field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your account's
+ * timezone. See [Timezone localization](/essentials/timezones) for information on what this
+ * timezone parameter influences within Orb.
+ */
override fun customers(): CustomerService = customers
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created for
+ * a customer. Events are the core of Orb's usage-based billing model, and are used to calculate
+ * the usage charges for a given billing period.
+ */
override fun events(): EventService = events
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
override fun invoiceLineItems(): InvoiceLineItemService = invoiceLineItems
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of an
+ * action, such as a cancellation.
+ */
override fun invoices(): InvoiceService = invoices
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all line
+ * items, billable metrics, and prices and are used for defining external sync behavior for
+ * invoices and tax calculation purposes.
+ */
override fun items(): ItemService = items
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
override fun metrics(): MetricService = metrics
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed
+ * to by a customer. Plans define the billing behavior of the subscription. You can see more
+ * about how to configure prices in the [Price resource](/reference/price).
+ */
override fun plans(): PlanService = plans
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in a
+ * charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key for
+ * the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
override fun prices(): PriceService = prices
override fun subscriptions(): SubscriptionService = subscriptions
override fun webhooks(): WebhookService = webhooks
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or credit
+ * balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
override fun alerts(): AlertService = alerts
override fun dimensionalPriceGroups(): DimensionalPriceGroupService = dimensionalPriceGroups
override fun subscriptionChanges(): SubscriptionChangeService = subscriptionChanges
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
override fun creditBlocks(): CreditBlockService = creditBlocks
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users. License
+ * types are used during billing by grouping metrics on the configured grouping key.
+ */
+ override fun licenseTypes(): LicenseTypeService = licenseTypes
+
+ override fun licenses(): LicenseService = licenses
+
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -227,6 +334,14 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
CreditBlockServiceImpl.WithRawResponseImpl(clientOptions)
}
+ private val licenseTypes: LicenseTypeService.WithRawResponse by lazy {
+ LicenseTypeServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val licenses: LicenseService.WithRawResponse by lazy {
+ LicenseServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
override fun withOptions(
modifier: Consumer
): OrbClient.WithRawResponse =
@@ -236,30 +351,115 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
override fun topLevel(): TopLevelService.WithRawResponse = topLevel
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
override fun beta(): BetaService.WithRawResponse = beta
+ /**
+ * A coupon represents a reusable discount configuration that can be applied either as a
+ * fixed or percentage amount to an invoice or subscription. Coupons are activated using a
+ * redemption code, which applies the discount to a subscription or invoice. The duration of
+ * a coupon determines how long it remains available for use by end users.
+ */
override fun coupons(): CouponService.WithRawResponse = coupons
+ /**
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been
+ * applied to a particular invoice.
+ */
override fun creditNotes(): CreditNoteService.WithRawResponse = creditNotes
+ /**
+ * A customer is a buyer of your products, and the other party to the billing relationship.
+ *
+ * In Orb, customers are assigned system generated identifiers automatically, but it's often
+ * desirable to have these match existing identifiers in your system. To avoid having to
+ * denormalize Orb ID information, you can pass in an `external_customer_id` with your own
+ * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further
+ * information about how these aliases work in Orb.
+ *
+ * In addition to having an identifier in your system, a customer may exist in a payment
+ * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider`
+ * enum field to express this mapping.
+ *
+ * A customer also has a timezone (from the standard
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your
+ * account's timezone. See [Timezone localization](/essentials/timezones) for information on
+ * what this timezone parameter influences within Orb.
+ */
override fun customers(): CustomerService.WithRawResponse = customers
+ /**
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created
+ * for a customer. Events are the core of Orb's usage-based billing model, and are used to
+ * calculate the usage charges for a given billing period.
+ */
override fun events(): EventService.WithRawResponse = events
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
override fun invoiceLineItems(): InvoiceLineItemService.WithRawResponse = invoiceLineItems
+ /**
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the
+ * request for payment for a single subscription. This includes a set of line items, which
+ * correspond to prices in the subscription's plan and can represent fixed recurring fees or
+ * usage-based fees. They are generated at the end of a billing period, or as the result of
+ * an action, such as a cancellation.
+ */
override fun invoices(): InvoiceService.WithRawResponse = invoices
+ /**
+ * The Item resource represents a sellable product or good. Items are associated with all
+ * line items, billable metrics, and prices and are used for defining external sync behavior
+ * for invoices and tax calculation purposes.
+ */
override fun items(): ItemService.WithRawResponse = items
+ /**
+ * The Metric resource represents a calculation of a quantity based on events. Metrics are
+ * defined by the query that transforms raw usage events into meaningful values for your
+ * customers.
+ */
override fun metrics(): MetricService.WithRawResponse = metrics
+ /**
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
+ * subscribed to by a customer. Plans define the billing behavior of the subscription. You
+ * can see more about how to configure prices in the [Price resource](/reference/price).
+ */
override fun plans(): PlanService.WithRawResponse = plans
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
+ *
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
+ *
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
override fun prices(): PriceService.WithRawResponse = prices
override fun subscriptions(): SubscriptionService.WithRawResponse = subscriptions
+ /**
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or
+ * credit balance and trigger webhooks when a threshold is exceeded.
+ *
+ * Alerts created through the API can be scoped to either customers or subscriptions.
+ */
override fun alerts(): AlertService.WithRawResponse = alerts
override fun dimensionalPriceGroups(): DimensionalPriceGroupService.WithRawResponse =
@@ -268,6 +468,18 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
override fun subscriptionChanges(): SubscriptionChangeService.WithRawResponse =
subscriptionChanges
+ /**
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits
+ * within Orb.
+ */
override fun creditBlocks(): CreditBlockService.WithRawResponse = creditBlocks
+
+ /**
+ * The LicenseType resource represents a type of license that can be assigned to users.
+ * License types are used during billing by grouping metrics on the configured grouping key.
+ */
+ override fun licenseTypes(): LicenseTypeService.WithRawResponse = licenseTypes
+
+ override fun licenses(): LicenseService.WithRawResponse = licenses
}
}
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 cd66b87cb..1de772314 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
@@ -463,6 +463,7 @@ private constructor(
headers.put("X-Stainless-Package-Version", getPackageVersion())
headers.put("X-Stainless-Runtime", "JRE")
headers.put("X-Stainless-Runtime-Version", getJavaVersion())
+ headers.put("X-Stainless-Kotlin-Version", KotlinVersion.CURRENT.toString())
apiKey.let {
if (!it.isEmpty()) {
headers.put("Authorization", "Bearer $it")
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt
index 1373ca6ce..575d791e3 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/ObjectMappers.kt
@@ -25,7 +25,7 @@ import java.time.DateTimeException
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.OffsetDateTime
-import java.time.ZonedDateTime
+import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.time.temporal.ChronoField
@@ -157,14 +157,15 @@ private class LenientOffsetDateTimeDeserializer :
val temporal = formatter.parse(p.text)
return when {
- !temporal.isSupported(ChronoField.HOUR_OF_DAY) ->
- LocalDate.from(temporal).atStartOfDay()
- !temporal.isSupported(ChronoField.OFFSET_SECONDS) ->
- LocalDateTime.from(temporal)
- else -> ZonedDateTime.from(temporal).toLocalDateTime()
- }
- .atZone(context.timeZone.toZoneId())
- .toOffsetDateTime()
+ !temporal.isSupported(ChronoField.HOUR_OF_DAY) ->
+ LocalDate.from(temporal)
+ .atStartOfDay()
+ .atZone(ZoneId.of("UTC"))
+ .toOffsetDateTime()
+ !temporal.isSupported(ChronoField.OFFSET_SECONDS) ->
+ LocalDateTime.from(temporal).atZone(ZoneId.of("UTC")).toOffsetDateTime()
+ else -> OffsetDateTime.from(temporal)
+ }
} catch (e: DateTimeException) {
exceptions.add(e)
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/Properties.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/Properties.kt
index f0f63ba44..e21bb1e93 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/Properties.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/Properties.kt
@@ -34,8 +34,9 @@ fun getOsName(): String {
}
}
-fun getOsVersion(): String = System.getProperty("os.version", "unknown")
+fun getOsVersion(): String = System.getProperty("os.version", "unknown") ?: "unknown"
-fun getPackageVersion(): String = OrbClient::class.java.`package`.implementationVersion ?: "unknown"
+fun getPackageVersion(): String =
+ OrbClient::class.java.`package`?.implementationVersion ?: "unknown"
-fun getJavaVersion(): String = System.getProperty("java.version", "unknown")
+fun getJavaVersion(): String = System.getProperty("java.version", "unknown") ?: "unknown"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequestBodies.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequestBodies.kt
index 3463de9ea..4b7b62d15 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequestBodies.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequestBodies.kt
@@ -8,13 +8,13 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.json.JsonMapper
import com.fasterxml.jackson.databind.node.JsonNodeType
import com.withorb.api.core.MultipartField
+import com.withorb.api.core.toImmutable
import com.withorb.api.errors.OrbInvalidDataException
+import java.io.ByteArrayInputStream
import java.io.InputStream
import java.io.OutputStream
+import java.util.UUID
import kotlin.jvm.optionals.getOrNull
-import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder
-import org.apache.hc.core5.http.ContentType
-import org.apache.hc.core5.http.HttpEntity
@JvmSynthetic
internal inline fun json(jsonMapper: JsonMapper, value: T): HttpRequestBody =
@@ -37,69 +37,207 @@ internal fun multipartFormData(
jsonMapper: JsonMapper,
fields: Map>,
): HttpRequestBody =
- object : HttpRequestBody {
- private val entity: HttpEntity by lazy {
- MultipartEntityBuilder.create()
- .apply {
- fields.forEach { (name, field) ->
- val knownValue = field.value.asKnown().getOrNull()
- val parts =
- if (knownValue is InputStream) {
- // Read directly from the `InputStream` instead of reading it all
- // into memory due to the `jsonMapper` serialization below.
- sequenceOf(name to knownValue)
- } else {
- val node = jsonMapper.valueToTree(field.value)
- serializePart(name, node)
+ MultipartBody.Builder()
+ .apply {
+ fields.forEach { (name, field) ->
+ val knownValue = field.value.asKnown().getOrNull()
+ val parts =
+ if (knownValue is InputStream) {
+ // Read directly from the `InputStream` instead of reading it all
+ // into memory due to the `jsonMapper` serialization below.
+ sequenceOf(name to knownValue)
+ } else {
+ val node = jsonMapper.valueToTree(field.value)
+ serializePart(name, node)
+ }
+
+ parts.forEach { (name, bytes) ->
+ val partBody =
+ if (bytes is ByteArrayInputStream) {
+ val byteArray = bytes.readBytes()
+
+ object : HttpRequestBody {
+
+ override fun writeTo(outputStream: OutputStream) {
+ outputStream.write(byteArray)
+ }
+
+ override fun contentType(): String = field.contentType
+
+ override fun contentLength(): Long = byteArray.size.toLong()
+
+ override fun repeatable(): Boolean = true
+
+ override fun close() {}
}
+ } else {
+ object : HttpRequestBody {
+
+ override fun writeTo(outputStream: OutputStream) {
+ bytes.copyTo(outputStream)
+ }
+
+ override fun contentType(): String = field.contentType
- parts.forEach { (name, bytes) ->
- addBinaryBody(
- name,
- bytes,
- ContentType.parseLenient(field.contentType),
- field.filename().getOrNull(),
- )
+ override fun contentLength(): Long = -1L
+
+ override fun repeatable(): Boolean = false
+
+ override fun close() = bytes.close()
+ }
}
- }
+
+ addPart(
+ MultipartBody.Part.create(
+ name,
+ field.filename().getOrNull(),
+ field.contentType,
+ partBody,
+ )
+ )
}
- .build()
+ }
}
+ .build()
+
+private fun serializePart(name: String, node: JsonNode): Sequence> =
+ when (node.nodeType) {
+ JsonNodeType.MISSING,
+ JsonNodeType.NULL -> emptySequence()
+ JsonNodeType.BINARY -> sequenceOf(name to node.binaryValue().inputStream())
+ JsonNodeType.STRING -> sequenceOf(name to node.textValue().byteInputStream())
+ JsonNodeType.BOOLEAN -> sequenceOf(name to node.booleanValue().toString().byteInputStream())
+ JsonNodeType.NUMBER -> sequenceOf(name to node.numberValue().toString().byteInputStream())
+ JsonNodeType.ARRAY ->
+ node.elements().asSequence().flatMap { element -> serializePart("$name[]", element) }
+ JsonNodeType.OBJECT ->
+ node.fields().asSequence().flatMap { (key, value) ->
+ serializePart("$name[$key]", value)
+ }
+ JsonNodeType.POJO,
+ null -> throw OrbInvalidDataException("Unexpected JsonNode type: ${node.nodeType}")
+ }
- private fun serializePart(
- name: String,
- node: JsonNode,
- ): Sequence> =
- when (node.nodeType) {
- JsonNodeType.MISSING,
- JsonNodeType.NULL -> emptySequence()
- JsonNodeType.BINARY -> sequenceOf(name to node.binaryValue().inputStream())
- JsonNodeType.STRING -> sequenceOf(name to node.textValue().inputStream())
- JsonNodeType.BOOLEAN ->
- sequenceOf(name to node.booleanValue().toString().inputStream())
- JsonNodeType.NUMBER ->
- sequenceOf(name to node.numberValue().toString().inputStream())
- JsonNodeType.ARRAY ->
- node.elements().asSequence().flatMap { element ->
- serializePart("$name[]", element)
- }
- JsonNodeType.OBJECT ->
- node.fields().asSequence().flatMap { (key, value) ->
- serializePart("$name[$key]", value)
- }
- JsonNodeType.POJO,
- null -> throw OrbInvalidDataException("Unexpected JsonNode type: ${node.nodeType}")
+private class MultipartBody
+private constructor(private val boundary: String, private val parts: List) : HttpRequestBody {
+ private val boundaryBytes: ByteArray = boundary.toByteArray()
+ private val contentType = "multipart/form-data; boundary=$boundary"
+
+ // This must remain in sync with `contentLength`.
+ override fun writeTo(outputStream: OutputStream) {
+ parts.forEach { part ->
+ outputStream.write(DASHDASH)
+ outputStream.write(boundaryBytes)
+ outputStream.write(CRLF)
+
+ outputStream.write(CONTENT_DISPOSITION)
+ outputStream.write(part.contentDisposition.toByteArray())
+ outputStream.write(CRLF)
+
+ outputStream.write(CONTENT_TYPE)
+ outputStream.write(part.contentType.toByteArray())
+ outputStream.write(CRLF)
+
+ outputStream.write(CRLF)
+ part.body.writeTo(outputStream)
+ outputStream.write(CRLF)
+ }
+
+ outputStream.write(DASHDASH)
+ outputStream.write(boundaryBytes)
+ outputStream.write(DASHDASH)
+ outputStream.write(CRLF)
+ }
+
+ override fun contentType(): String = contentType
+
+ // This must remain in sync with `writeTo`.
+ override fun contentLength(): Long {
+ var byteCount = 0L
+
+ parts.forEach { part ->
+ val contentLength = part.body.contentLength()
+ if (contentLength == -1L) {
+ return -1L
}
- private fun String.inputStream(): InputStream = toByteArray().inputStream()
+ byteCount +=
+ DASHDASH.size +
+ boundaryBytes.size +
+ CRLF.size +
+ CONTENT_DISPOSITION.size +
+ part.contentDisposition.toByteArray().size +
+ CRLF.size +
+ CONTENT_TYPE.size +
+ part.contentType.toByteArray().size +
+ CRLF.size +
+ CRLF.size +
+ contentLength +
+ CRLF.size
+ }
- override fun writeTo(outputStream: OutputStream) = entity.writeTo(outputStream)
+ byteCount += DASHDASH.size + boundaryBytes.size + DASHDASH.size + CRLF.size
+ return byteCount
+ }
- override fun contentType(): String = entity.contentType
+ override fun repeatable(): Boolean = parts.all { it.body.repeatable() }
- override fun contentLength(): Long = entity.contentLength
+ override fun close() {
+ parts.forEach { it.body.close() }
+ }
- override fun repeatable(): Boolean = entity.isRepeatable
+ class Builder {
+ private val boundary = UUID.randomUUID().toString()
+ private val parts: MutableList = mutableListOf()
- override fun close() = entity.close()
+ fun addPart(part: Part) = apply { parts.add(part) }
+
+ fun build() = MultipartBody(boundary, parts.toImmutable())
+ }
+
+ class Part
+ private constructor(
+ val contentDisposition: String,
+ val contentType: String,
+ val body: HttpRequestBody,
+ ) {
+ companion object {
+ fun create(
+ name: String,
+ filename: String?,
+ contentType: String,
+ body: HttpRequestBody,
+ ): Part {
+ val disposition = buildString {
+ append("form-data; name=")
+ appendQuotedString(name)
+ if (filename != null) {
+ append("; filename=")
+ appendQuotedString(filename)
+ }
+ }
+ return Part(disposition, contentType, body)
+ }
+ }
+ }
+
+ companion object {
+ private val CRLF = byteArrayOf('\r'.code.toByte(), '\n'.code.toByte())
+ private val DASHDASH = byteArrayOf('-'.code.toByte(), '-'.code.toByte())
+ private val CONTENT_DISPOSITION = "Content-Disposition: ".toByteArray()
+ private val CONTENT_TYPE = "Content-Type: ".toByteArray()
+
+ private fun StringBuilder.appendQuotedString(key: String) {
+ append('"')
+ for (ch in key) {
+ when (ch) {
+ '\n' -> append("%0A")
+ '\r' -> append("%0D")
+ '"' -> append("%22")
+ else -> append(ch)
+ }
+ }
+ append('"')
+ }
}
+}
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 6bd384bc4..6e0e2fec8 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
@@ -1,3 +1,5 @@
+// File generated from our OpenAPI spec by Stainless.
+
package com.withorb.api.core.http
import com.withorb.api.core.DefaultSleeper
@@ -212,13 +214,8 @@ private constructor(
}
}
?.let { retryAfterNanos ->
- // If the API asks us to wait a certain amount of time (and it's a reasonable
- // amount), just
- // do what it says.
- val retryAfter = Duration.ofNanos(retryAfterNanos.toLong())
- if (retryAfter in Duration.ofNanos(0)..Duration.ofMinutes(1)) {
- return retryAfter
- }
+ // If the API asks us to wait a certain amount of time, do what it says.
+ return Duration.ofNanos(retryAfterNanos.toLong())
}
// Apply exponential backoff, but not more than the max.
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 f35084b4a..89f9955d4 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
@@ -41,6 +41,8 @@ private constructor(
private val thresholds: JsonField>,
private val type: JsonField,
private val balanceAlertStatus: JsonField>,
+ private val groupingKeys: JsonField>,
+ private val licenseType: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -67,6 +69,12 @@ private constructor(
@JsonProperty("balance_alert_status")
@ExcludeMissing
balanceAlertStatus: JsonField> = JsonMissing.of(),
+ @JsonProperty("grouping_keys")
+ @ExcludeMissing
+ groupingKeys: JsonField> = JsonMissing.of(),
+ @JsonProperty("license_type")
+ @ExcludeMissing
+ licenseType: JsonField = JsonMissing.of(),
) : this(
id,
createdAt,
@@ -79,6 +87,8 @@ private constructor(
thresholds,
type,
balanceAlertStatus,
+ groupingKeys,
+ licenseType,
mutableMapOf(),
)
@@ -171,6 +181,23 @@ private constructor(
fun balanceAlertStatus(): Optional> =
balanceAlertStatus.getOptional("balance_alert_status")
+ /**
+ * The property keys to group cost alerts by. Only present for cost alerts with grouping
+ * enabled.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun groupingKeys(): Optional> = groupingKeys.getOptional("grouping_keys")
+
+ /**
+ * Minified license type for alert serialization.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun licenseType(): Optional = licenseType.getOptional("license_type")
+
/**
* Returns the raw JSON value of [id].
*
@@ -259,6 +286,24 @@ private constructor(
@ExcludeMissing
fun _balanceAlertStatus(): JsonField> = balanceAlertStatus
+ /**
+ * Returns the raw JSON value of [groupingKeys].
+ *
+ * Unlike [groupingKeys], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("grouping_keys")
+ @ExcludeMissing
+ fun _groupingKeys(): JsonField> = groupingKeys
+
+ /**
+ * Returns the raw JSON value of [licenseType].
+ *
+ * Unlike [licenseType], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("license_type")
+ @ExcludeMissing
+ fun _licenseType(): JsonField = licenseType
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -307,6 +352,8 @@ private constructor(
private var thresholds: JsonField>? = null
private var type: JsonField? = null
private var balanceAlertStatus: JsonField>? = null
+ private var groupingKeys: JsonField>? = null
+ private var licenseType: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -322,6 +369,8 @@ private constructor(
thresholds = alert.thresholds.map { it.toMutableList() }
type = alert.type
balanceAlertStatus = alert.balanceAlertStatus.map { it.toMutableList() }
+ groupingKeys = alert.groupingKeys.map { it.toMutableList() }
+ licenseType = alert.licenseType
additionalProperties = alert.additionalProperties.toMutableMap()
}
@@ -510,6 +559,57 @@ private constructor(
}
}
+ /**
+ * The property keys to group cost alerts by. Only present for cost alerts with grouping
+ * enabled.
+ */
+ fun groupingKeys(groupingKeys: List?) =
+ groupingKeys(JsonField.ofNullable(groupingKeys))
+
+ /** Alias for calling [Builder.groupingKeys] with `groupingKeys.orElse(null)`. */
+ fun groupingKeys(groupingKeys: Optional>) =
+ groupingKeys(groupingKeys.getOrNull())
+
+ /**
+ * Sets [Builder.groupingKeys] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.groupingKeys] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun groupingKeys(groupingKeys: JsonField>) = apply {
+ this.groupingKeys = groupingKeys.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [groupingKeys].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addGroupingKey(groupingKey: String) = apply {
+ groupingKeys =
+ (groupingKeys ?: JsonField.of(mutableListOf())).also {
+ checkKnown("groupingKeys", it).add(groupingKey)
+ }
+ }
+
+ /** Minified license type for alert serialization. */
+ fun licenseType(licenseType: LicenseType?) = licenseType(JsonField.ofNullable(licenseType))
+
+ /** Alias for calling [Builder.licenseType] with `licenseType.orElse(null)`. */
+ fun licenseType(licenseType: Optional) = licenseType(licenseType.getOrNull())
+
+ /**
+ * Sets [Builder.licenseType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.licenseType] with a well-typed [LicenseType] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun licenseType(licenseType: JsonField) = apply {
+ this.licenseType = licenseType
+ }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -563,6 +663,8 @@ private constructor(
checkRequired("thresholds", thresholds).map { it.toImmutable() },
checkRequired("type", type),
(balanceAlertStatus ?: JsonMissing.of()).map { it.toImmutable() },
+ (groupingKeys ?: JsonMissing.of()).map { it.toImmutable() },
+ licenseType,
additionalProperties.toMutableMap(),
)
}
@@ -585,6 +687,8 @@ private constructor(
thresholds().ifPresent { it.forEach { it.validate() } }
type().validate()
balanceAlertStatus().ifPresent { it.forEach { it.validate() } }
+ groupingKeys()
+ licenseType().ifPresent { it.validate() }
validated = true
}
@@ -613,7 +717,9 @@ private constructor(
(subscription.asKnown().getOrNull()?.validity() ?: 0) +
(thresholds.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(type.asKnown().getOrNull()?.validity() ?: 0) +
- (balanceAlertStatus.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ (balanceAlertStatus.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (groupingKeys.asKnown().getOrNull()?.size ?: 0) +
+ (licenseType.asKnown().getOrNull()?.validity() ?: 0)
/** The metric the alert applies to. */
class Metric
@@ -1089,6 +1195,9 @@ private constructor(
@JvmField val COST_EXCEEDED = of("cost_exceeded")
+ @JvmField
+ val LICENSE_BALANCE_THRESHOLD_REACHED = of("license_balance_threshold_reached")
+
@JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
@@ -1099,6 +1208,7 @@ private constructor(
CREDIT_BALANCE_RECOVERED,
USAGE_EXCEEDED,
COST_EXCEEDED,
+ LICENSE_BALANCE_THRESHOLD_REACHED,
}
/**
@@ -1116,6 +1226,7 @@ private constructor(
CREDIT_BALANCE_RECOVERED,
USAGE_EXCEEDED,
COST_EXCEEDED,
+ LICENSE_BALANCE_THRESHOLD_REACHED,
/** An enum member indicating that [Type] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -1134,6 +1245,7 @@ private constructor(
CREDIT_BALANCE_RECOVERED -> Value.CREDIT_BALANCE_RECOVERED
USAGE_EXCEEDED -> Value.USAGE_EXCEEDED
COST_EXCEEDED -> Value.COST_EXCEEDED
+ LICENSE_BALANCE_THRESHOLD_REACHED -> Value.LICENSE_BALANCE_THRESHOLD_REACHED
else -> Value._UNKNOWN
}
@@ -1152,6 +1264,7 @@ private constructor(
CREDIT_BALANCE_RECOVERED -> Known.CREDIT_BALANCE_RECOVERED
USAGE_EXCEEDED -> Known.USAGE_EXCEEDED
COST_EXCEEDED -> Known.COST_EXCEEDED
+ LICENSE_BALANCE_THRESHOLD_REACHED -> Known.LICENSE_BALANCE_THRESHOLD_REACHED
else -> throw OrbInvalidDataException("Unknown Type: $value")
}
@@ -1418,6 +1531,159 @@ private constructor(
"BalanceAlertStatus{inAlert=$inAlert, thresholdValue=$thresholdValue, additionalProperties=$additionalProperties}"
}
+ /** Minified license type for alert serialization. */
+ class LicenseType
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val id: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of()
+ ) : this(id, mutableMapOf())
+
+ /**
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun id(): String = id.getRequired("id")
+
+ /**
+ * Returns the raw JSON value of [id].
+ *
+ * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [LicenseType].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [LicenseType]. */
+ class Builder internal constructor() {
+
+ private var id: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(licenseType: LicenseType) = apply {
+ id = licenseType.id
+ additionalProperties = licenseType.additionalProperties.toMutableMap()
+ }
+
+ fun id(id: String) = id(JsonField.of(id))
+
+ /**
+ * Sets [Builder.id] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.id] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun id(id: JsonField) = apply { this.id = id }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [LicenseType].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): LicenseType =
+ LicenseType(checkRequired("id", id), additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): LicenseType = apply {
+ if (validated) {
+ return@apply
+ }
+
+ id()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: OrbInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is LicenseType &&
+ id == other.id &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "LicenseType{id=$id, additionalProperties=$additionalProperties}"
+ }
+
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
@@ -1435,6 +1701,8 @@ private constructor(
thresholds == other.thresholds &&
type == other.type &&
balanceAlertStatus == other.balanceAlertStatus &&
+ groupingKeys == other.groupingKeys &&
+ licenseType == other.licenseType &&
additionalProperties == other.additionalProperties
}
@@ -1451,6 +1719,8 @@ private constructor(
thresholds,
type,
balanceAlertStatus,
+ groupingKeys,
+ licenseType,
additionalProperties,
)
}
@@ -1458,5 +1728,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Alert{id=$id, createdAt=$createdAt, currency=$currency, customer=$customer, enabled=$enabled, metric=$metric, plan=$plan, subscription=$subscription, thresholds=$thresholds, type=$type, balanceAlertStatus=$balanceAlertStatus, additionalProperties=$additionalProperties}"
+ "Alert{id=$id, createdAt=$createdAt, currency=$currency, customer=$customer, enabled=$enabled, metric=$metric, plan=$plan, subscription=$subscription, thresholds=$thresholds, type=$type, balanceAlertStatus=$balanceAlertStatus, groupingKeys=$groupingKeys, licenseType=$licenseType, additionalProperties=$additionalProperties}"
}
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 7329b98c4..295995640 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
@@ -61,6 +61,14 @@ private constructor(
*/
fun type(): Type = body.type()
+ /**
+ * The property keys to group cost alerts by. Only applicable for cost_exceeded alerts.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun groupingKeys(): Optional> = body.groupingKeys()
+
/**
* The metric to track usage for.
*
@@ -69,6 +77,14 @@ private constructor(
*/
fun metricId(): Optional = body.metricId()
+ /**
+ * The pricing unit to use for grouped cost alerts. Required when grouping_keys is set.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun pricingUnitId(): Optional = body.pricingUnitId()
+
/**
* Returns the raw JSON value of [thresholds].
*
@@ -83,6 +99,13 @@ private constructor(
*/
fun _type(): JsonField = body._type()
+ /**
+ * Returns the raw JSON value of [groupingKeys].
+ *
+ * Unlike [groupingKeys], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _groupingKeys(): JsonField> = body._groupingKeys()
+
/**
* Returns the raw JSON value of [metricId].
*
@@ -90,6 +113,13 @@ private constructor(
*/
fun _metricId(): JsonField = body._metricId()
+ /**
+ * Returns the raw JSON value of [pricingUnitId].
+ *
+ * Unlike [pricingUnitId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _pricingUnitId(): JsonField = body._pricingUnitId()
+
fun _additionalBodyProperties(): Map = body._additionalProperties()
/** Additional headers to send with the request. */
@@ -146,7 +176,10 @@ private constructor(
* Otherwise, it's more convenient to use the top-level setters instead:
* - [thresholds]
* - [type]
+ * - [groupingKeys]
* - [metricId]
+ * - [pricingUnitId]
+ * - etc.
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
@@ -182,6 +215,31 @@ private constructor(
*/
fun type(type: JsonField) = apply { body.type(type) }
+ /** The property keys to group cost alerts by. Only applicable for cost_exceeded alerts. */
+ fun groupingKeys(groupingKeys: List?) = apply { body.groupingKeys(groupingKeys) }
+
+ /** Alias for calling [Builder.groupingKeys] with `groupingKeys.orElse(null)`. */
+ fun groupingKeys(groupingKeys: Optional>) =
+ groupingKeys(groupingKeys.getOrNull())
+
+ /**
+ * Sets [Builder.groupingKeys] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.groupingKeys] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun groupingKeys(groupingKeys: JsonField>) = apply {
+ body.groupingKeys(groupingKeys)
+ }
+
+ /**
+ * Adds a single [String] to [groupingKeys].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addGroupingKey(groupingKey: String) = apply { body.addGroupingKey(groupingKey) }
+
/** The metric to track usage for. */
fun metricId(metricId: String?) = apply { body.metricId(metricId) }
@@ -196,6 +254,24 @@ private constructor(
*/
fun metricId(metricId: JsonField) = apply { body.metricId(metricId) }
+ /** The pricing unit to use for grouped cost alerts. Required when grouping_keys is set. */
+ fun pricingUnitId(pricingUnitId: String?) = apply { body.pricingUnitId(pricingUnitId) }
+
+ /** Alias for calling [Builder.pricingUnitId] with `pricingUnitId.orElse(null)`. */
+ fun pricingUnitId(pricingUnitId: Optional) =
+ pricingUnitId(pricingUnitId.getOrNull())
+
+ /**
+ * Sets [Builder.pricingUnitId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.pricingUnitId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun pricingUnitId(pricingUnitId: JsonField) = apply {
+ body.pricingUnitId(pricingUnitId)
+ }
+
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
body.additionalProperties(additionalBodyProperties)
}
@@ -352,7 +428,9 @@ private constructor(
private constructor(
private val thresholds: JsonField>,
private val type: JsonField,
+ private val groupingKeys: JsonField>,
private val metricId: JsonField,
+ private val pricingUnitId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -362,10 +440,16 @@ private constructor(
@ExcludeMissing
thresholds: JsonField> = JsonMissing.of(),
@JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ @JsonProperty("grouping_keys")
+ @ExcludeMissing
+ groupingKeys: JsonField> = JsonMissing.of(),
@JsonProperty("metric_id")
@ExcludeMissing
metricId: JsonField = JsonMissing.of(),
- ) : this(thresholds, type, metricId, mutableMapOf())
+ @JsonProperty("pricing_unit_id")
+ @ExcludeMissing
+ pricingUnitId: JsonField = JsonMissing.of(),
+ ) : this(thresholds, type, groupingKeys, metricId, pricingUnitId, mutableMapOf())
/**
* The thresholds that define the values at which the alert will be triggered.
@@ -383,6 +467,14 @@ private constructor(
*/
fun type(): Type = type.getRequired("type")
+ /**
+ * The property keys to group cost alerts by. Only applicable for cost_exceeded alerts.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun groupingKeys(): Optional> = groupingKeys.getOptional("grouping_keys")
+
/**
* The metric to track usage for.
*
@@ -391,6 +483,14 @@ private constructor(
*/
fun metricId(): Optional = metricId.getOptional("metric_id")
+ /**
+ * The pricing unit to use for grouped cost alerts. Required when grouping_keys is set.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun pricingUnitId(): Optional = pricingUnitId.getOptional("pricing_unit_id")
+
/**
* Returns the raw JSON value of [thresholds].
*
@@ -407,6 +507,16 @@ private constructor(
*/
@JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+ /**
+ * Returns the raw JSON value of [groupingKeys].
+ *
+ * Unlike [groupingKeys], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("grouping_keys")
+ @ExcludeMissing
+ fun _groupingKeys(): JsonField> = groupingKeys
+
/**
* Returns the raw JSON value of [metricId].
*
@@ -414,6 +524,16 @@ private constructor(
*/
@JsonProperty("metric_id") @ExcludeMissing fun _metricId(): JsonField = metricId
+ /**
+ * Returns the raw JSON value of [pricingUnitId].
+ *
+ * Unlike [pricingUnitId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("pricing_unit_id")
+ @ExcludeMissing
+ fun _pricingUnitId(): JsonField = pricingUnitId
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -445,14 +565,18 @@ private constructor(
private var thresholds: JsonField>? = null
private var type: JsonField? = null
+ private var groupingKeys: JsonField>? = null
private var metricId: JsonField = JsonMissing.of()
+ private var pricingUnitId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(body: Body) = apply {
thresholds = body.thresholds.map { it.toMutableList() }
type = body.type
+ groupingKeys = body.groupingKeys.map { it.toMutableList() }
metricId = body.metricId
+ pricingUnitId = body.pricingUnitId
additionalProperties = body.additionalProperties.toMutableMap()
}
@@ -494,6 +618,39 @@ private constructor(
*/
fun type(type: JsonField) = apply { this.type = type }
+ /**
+ * The property keys to group cost alerts by. Only applicable for cost_exceeded alerts.
+ */
+ fun groupingKeys(groupingKeys: List?) =
+ groupingKeys(JsonField.ofNullable(groupingKeys))
+
+ /** Alias for calling [Builder.groupingKeys] with `groupingKeys.orElse(null)`. */
+ fun groupingKeys(groupingKeys: Optional>) =
+ groupingKeys(groupingKeys.getOrNull())
+
+ /**
+ * Sets [Builder.groupingKeys] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.groupingKeys] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun groupingKeys(groupingKeys: JsonField>) = apply {
+ this.groupingKeys = groupingKeys.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [groupingKeys].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addGroupingKey(groupingKey: String) = apply {
+ groupingKeys =
+ (groupingKeys ?: JsonField.of(mutableListOf())).also {
+ checkKnown("groupingKeys", it).add(groupingKey)
+ }
+ }
+
/** The metric to track usage for. */
fun metricId(metricId: String?) = metricId(JsonField.ofNullable(metricId))
@@ -509,6 +666,27 @@ private constructor(
*/
fun metricId(metricId: JsonField) = apply { this.metricId = metricId }
+ /**
+ * The pricing unit to use for grouped cost alerts. Required when grouping_keys is set.
+ */
+ fun pricingUnitId(pricingUnitId: String?) =
+ pricingUnitId(JsonField.ofNullable(pricingUnitId))
+
+ /** Alias for calling [Builder.pricingUnitId] with `pricingUnitId.orElse(null)`. */
+ fun pricingUnitId(pricingUnitId: Optional) =
+ pricingUnitId(pricingUnitId.getOrNull())
+
+ /**
+ * Sets [Builder.pricingUnitId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.pricingUnitId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun pricingUnitId(pricingUnitId: JsonField) = apply {
+ this.pricingUnitId = pricingUnitId
+ }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -545,7 +723,9 @@ private constructor(
Body(
checkRequired("thresholds", thresholds).map { it.toImmutable() },
checkRequired("type", type),
+ (groupingKeys ?: JsonMissing.of()).map { it.toImmutable() },
metricId,
+ pricingUnitId,
additionalProperties.toMutableMap(),
)
}
@@ -559,7 +739,9 @@ private constructor(
thresholds().forEach { it.validate() }
type().validate()
+ groupingKeys()
metricId()
+ pricingUnitId()
validated = true
}
@@ -581,7 +763,9 @@ private constructor(
internal fun validity(): Int =
(thresholds.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(type.asKnown().getOrNull()?.validity() ?: 0) +
- (if (metricId.asKnown().isPresent) 1 else 0)
+ (groupingKeys.asKnown().getOrNull()?.size ?: 0) +
+ (if (metricId.asKnown().isPresent) 1 else 0) +
+ (if (pricingUnitId.asKnown().isPresent) 1 else 0)
override fun equals(other: Any?): Boolean {
if (this === other) {
@@ -591,18 +775,27 @@ private constructor(
return other is Body &&
thresholds == other.thresholds &&
type == other.type &&
+ groupingKeys == other.groupingKeys &&
metricId == other.metricId &&
+ pricingUnitId == other.pricingUnitId &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
- Objects.hash(thresholds, type, metricId, additionalProperties)
+ Objects.hash(
+ thresholds,
+ type,
+ groupingKeys,
+ metricId,
+ pricingUnitId,
+ additionalProperties,
+ )
}
override fun hashCode(): Int = hashCode
override fun toString() =
- "Body{thresholds=$thresholds, type=$type, metricId=$metricId, additionalProperties=$additionalProperties}"
+ "Body{thresholds=$thresholds, type=$type, groupingKeys=$groupingKeys, metricId=$metricId, pricingUnitId=$pricingUnitId, additionalProperties=$additionalProperties}"
}
/** The type of alert to create. This must be a valid alert type. */
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt
index ab6fd5234..88898a4d7 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Allocation.kt
@@ -27,6 +27,7 @@ private constructor(
private val currency: JsonField,
private val customExpiration: JsonField,
private val filters: JsonField>,
+ private val licenseTypeId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -39,8 +40,13 @@ private constructor(
@JsonProperty("custom_expiration")
@ExcludeMissing
customExpiration: JsonField = JsonMissing.of(),
- @JsonProperty("filters") @ExcludeMissing filters: JsonField> = JsonMissing.of(),
- ) : this(allowsRollover, currency, customExpiration, filters, mutableMapOf())
+ @JsonProperty("filters")
+ @ExcludeMissing
+ filters: JsonField> = JsonMissing.of(),
+ @JsonProperty("license_type_id")
+ @ExcludeMissing
+ licenseTypeId: JsonField = JsonMissing.of(),
+ ) : this(allowsRollover, currency, customExpiration, filters, licenseTypeId, mutableMapOf())
/**
* @throws OrbInvalidDataException if the JSON field has an unexpected type or is unexpectedly
@@ -67,6 +73,12 @@ private constructor(
*/
fun filters(): Optional> = filters.getOptional("filters")
+ /**
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the server
+ * responded with an unexpected value).
+ */
+ fun licenseTypeId(): Optional = licenseTypeId.getOptional("license_type_id")
+
/**
* Returns the raw JSON value of [allowsRollover].
*
@@ -100,6 +112,15 @@ private constructor(
*/
@JsonProperty("filters") @ExcludeMissing fun _filters(): JsonField> = filters
+ /**
+ * Returns the raw JSON value of [licenseTypeId].
+ *
+ * Unlike [licenseTypeId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("license_type_id")
+ @ExcludeMissing
+ fun _licenseTypeId(): JsonField = licenseTypeId
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -134,6 +155,7 @@ private constructor(
private var currency: JsonField? = null
private var customExpiration: JsonField? = null
private var filters: JsonField>? = null
+ private var licenseTypeId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -142,6 +164,7 @@ private constructor(
currency = allocation.currency
customExpiration = allocation.customExpiration
filters = allocation.filters.map { it.toMutableList() }
+ licenseTypeId = allocation.licenseTypeId
additionalProperties = allocation.additionalProperties.toMutableMap()
}
@@ -211,6 +234,24 @@ private constructor(
}
}
+ fun licenseTypeId(licenseTypeId: String?) =
+ licenseTypeId(JsonField.ofNullable(licenseTypeId))
+
+ /** Alias for calling [Builder.licenseTypeId] with `licenseTypeId.orElse(null)`. */
+ fun licenseTypeId(licenseTypeId: Optional) =
+ licenseTypeId(licenseTypeId.getOrNull())
+
+ /**
+ * Sets [Builder.licenseTypeId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.licenseTypeId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun licenseTypeId(licenseTypeId: JsonField) = apply {
+ this.licenseTypeId = licenseTypeId
+ }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -250,6 +291,7 @@ private constructor(
checkRequired("currency", currency),
checkRequired("customExpiration", customExpiration),
(filters ?: JsonMissing.of()).map { it.toImmutable() },
+ licenseTypeId,
additionalProperties.toMutableMap(),
)
}
@@ -265,6 +307,7 @@ private constructor(
currency()
customExpiration().ifPresent { it.validate() }
filters().ifPresent { it.forEach { it.validate() } }
+ licenseTypeId()
validated = true
}
@@ -286,7 +329,8 @@ private constructor(
(if (allowsRollover.asKnown().isPresent) 1 else 0) +
(if (currency.asKnown().isPresent) 1 else 0) +
(customExpiration.asKnown().getOrNull()?.validity() ?: 0) +
- (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+ (filters.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
+ (if (licenseTypeId.asKnown().isPresent) 1 else 0)
class Filter
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
@@ -828,15 +872,23 @@ private constructor(
currency == other.currency &&
customExpiration == other.customExpiration &&
filters == other.filters &&
+ licenseTypeId == other.licenseTypeId &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
- Objects.hash(allowsRollover, currency, customExpiration, filters, additionalProperties)
+ Objects.hash(
+ allowsRollover,
+ currency,
+ customExpiration,
+ filters,
+ licenseTypeId,
+ additionalProperties,
+ )
}
override fun hashCode(): Int = hashCode
override fun toString() =
- "Allocation{allowsRollover=$allowsRollover, currency=$currency, customExpiration=$customExpiration, filters=$filters, additionalProperties=$additionalProperties}"
+ "Allocation{allowsRollover=$allowsRollover, currency=$currency, customExpiration=$customExpiration, filters=$filters, licenseTypeId=$licenseTypeId, additionalProperties=$additionalProperties}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt
index c52a84d0c..ec1de92be 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/BetaCreatePlanVersionParams.kt
@@ -1758,6 +1758,7 @@ private constructor(
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val allocationPrice: JsonField,
+ private val licenseAllocationPrice: JsonField,
private val planPhaseOrder: JsonField,
private val price: JsonField,
private val additionalProperties: MutableMap,
@@ -1768,11 +1769,14 @@ private constructor(
@JsonProperty("allocation_price")
@ExcludeMissing
allocationPrice: JsonField = JsonMissing.of(),
+ @JsonProperty("license_allocation_price")
+ @ExcludeMissing
+ licenseAllocationPrice: JsonField = JsonMissing.of(),
@JsonProperty("plan_phase_order")
@ExcludeMissing
planPhaseOrder: JsonField = JsonMissing.of(),
@JsonProperty("price") @ExcludeMissing price: JsonField = JsonMissing.of(),
- ) : this(allocationPrice, planPhaseOrder, price, mutableMapOf())
+ ) : this(allocationPrice, licenseAllocationPrice, planPhaseOrder, price, mutableMapOf())
/**
* The allocation price to add to the plan.
@@ -1783,6 +1787,15 @@ private constructor(
fun allocationPrice(): Optional =
allocationPrice.getOptional("allocation_price")
+ /**
+ * The license allocation price to add to the plan.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun licenseAllocationPrice(): Optional =
+ licenseAllocationPrice.getOptional("license_allocation_price")
+
/**
* The phase to add this price to.
*
@@ -1809,6 +1822,16 @@ private constructor(
@ExcludeMissing
fun _allocationPrice(): JsonField = allocationPrice
+ /**
+ * Returns the raw JSON value of [licenseAllocationPrice].
+ *
+ * Unlike [licenseAllocationPrice], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("license_allocation_price")
+ @ExcludeMissing
+ fun _licenseAllocationPrice(): JsonField = licenseAllocationPrice
+
/**
* Returns the raw JSON value of [planPhaseOrder].
*
@@ -1848,6 +1871,7 @@ private constructor(
class Builder internal constructor() {
private var allocationPrice: JsonField = JsonMissing.of()
+ private var licenseAllocationPrice: JsonField = JsonMissing.of()
private var planPhaseOrder: JsonField = JsonMissing.of()
private var price: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -1855,6 +1879,7 @@ private constructor(
@JvmSynthetic
internal fun from(addPrice: AddPrice) = apply {
allocationPrice = addPrice.allocationPrice
+ licenseAllocationPrice = addPrice.licenseAllocationPrice
planPhaseOrder = addPrice.planPhaseOrder
price = addPrice.price
additionalProperties = addPrice.additionalProperties.toMutableMap()
@@ -1879,6 +1904,331 @@ private constructor(
this.allocationPrice = allocationPrice
}
+ /** The license allocation price to add to the plan. */
+ fun licenseAllocationPrice(licenseAllocationPrice: LicenseAllocationPrice?) =
+ licenseAllocationPrice(JsonField.ofNullable(licenseAllocationPrice))
+
+ /**
+ * Alias for calling [Builder.licenseAllocationPrice] with
+ * `licenseAllocationPrice.orElse(null)`.
+ */
+ fun licenseAllocationPrice(licenseAllocationPrice: Optional) =
+ licenseAllocationPrice(licenseAllocationPrice.getOrNull())
+
+ /**
+ * Sets [Builder.licenseAllocationPrice] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.licenseAllocationPrice] with a well-typed
+ * [LicenseAllocationPrice] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun licenseAllocationPrice(licenseAllocationPrice: JsonField) =
+ apply {
+ this.licenseAllocationPrice = licenseAllocationPrice
+ }
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofUnit(unit)`.
+ */
+ fun licenseAllocationPrice(unit: LicenseAllocationPrice.Unit) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofUnit(unit))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofTiered(tiered)`.
+ */
+ fun licenseAllocationPrice(tiered: LicenseAllocationPrice.Tiered) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofTiered(tiered))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofBulk(bulk)`.
+ */
+ fun licenseAllocationPrice(bulk: LicenseAllocationPrice.Bulk) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofBulk(bulk))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofBulkWithFilters(bulkWithFilters)`.
+ */
+ fun licenseAllocationPrice(bulkWithFilters: LicenseAllocationPrice.BulkWithFilters) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofBulkWithFilters(bulkWithFilters))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofPackage(package_)`.
+ */
+ fun licenseAllocationPrice(package_: LicenseAllocationPrice.Package) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofPackage(package_))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofMatrix(matrix)`.
+ */
+ fun licenseAllocationPrice(matrix: LicenseAllocationPrice.Matrix) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofMatrix(matrix))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofThresholdTotalAmount(thresholdTotalAmount)`.
+ */
+ fun licenseAllocationPrice(
+ thresholdTotalAmount: LicenseAllocationPrice.ThresholdTotalAmount
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofThresholdTotalAmount(thresholdTotalAmount)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofTieredPackage(tieredPackage)`.
+ */
+ fun licenseAllocationPrice(tieredPackage: LicenseAllocationPrice.TieredPackage) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofTieredPackage(tieredPackage))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofTieredWithMinimum(tieredWithMinimum)`.
+ */
+ fun licenseAllocationPrice(
+ tieredWithMinimum: LicenseAllocationPrice.TieredWithMinimum
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofTieredWithMinimum(tieredWithMinimum)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofGroupedTiered(groupedTiered)`.
+ */
+ fun licenseAllocationPrice(groupedTiered: LicenseAllocationPrice.GroupedTiered) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofGroupedTiered(groupedTiered))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofTieredPackageWithMinimum(tieredPackageWithMinimum)`.
+ */
+ fun licenseAllocationPrice(
+ tieredPackageWithMinimum: LicenseAllocationPrice.TieredPackageWithMinimum
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofTieredPackageWithMinimum(tieredPackageWithMinimum)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofPackageWithAllocation(packageWithAllocation)`.
+ */
+ fun licenseAllocationPrice(
+ packageWithAllocation: LicenseAllocationPrice.PackageWithAllocation
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofPackageWithAllocation(packageWithAllocation)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofUnitWithPercent(unitWithPercent)`.
+ */
+ fun licenseAllocationPrice(unitWithPercent: LicenseAllocationPrice.UnitWithPercent) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofUnitWithPercent(unitWithPercent))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofMatrixWithAllocation(matrixWithAllocation)`.
+ */
+ fun licenseAllocationPrice(
+ matrixWithAllocation: LicenseAllocationPrice.MatrixWithAllocation
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofMatrixWithAllocation(matrixWithAllocation)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofTieredWithProration(tieredWithProration)`.
+ */
+ fun licenseAllocationPrice(
+ tieredWithProration: LicenseAllocationPrice.TieredWithProration
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofTieredWithProration(tieredWithProration)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofUnitWithProration(unitWithProration)`.
+ */
+ fun licenseAllocationPrice(
+ unitWithProration: LicenseAllocationPrice.UnitWithProration
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofUnitWithProration(unitWithProration)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofGroupedAllocation(groupedAllocation)`.
+ */
+ fun licenseAllocationPrice(
+ groupedAllocation: LicenseAllocationPrice.GroupedAllocation
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofGroupedAllocation(groupedAllocation)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofBulkWithProration(bulkWithProration)`.
+ */
+ fun licenseAllocationPrice(
+ bulkWithProration: LicenseAllocationPrice.BulkWithProration
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofBulkWithProration(bulkWithProration)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofGroupedWithProratedMinimum(groupedWithProratedMinimum)`.
+ */
+ fun licenseAllocationPrice(
+ groupedWithProratedMinimum: LicenseAllocationPrice.GroupedWithProratedMinimum
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofGroupedWithProratedMinimum(groupedWithProratedMinimum)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofGroupedWithMeteredMinimum(groupedWithMeteredMinimum)`.
+ */
+ fun licenseAllocationPrice(
+ groupedWithMeteredMinimum: LicenseAllocationPrice.GroupedWithMeteredMinimum
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofGroupedWithMeteredMinimum(groupedWithMeteredMinimum)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`.
+ */
+ fun licenseAllocationPrice(
+ groupedWithMinMaxThresholds: LicenseAllocationPrice.GroupedWithMinMaxThresholds
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofGroupedWithMinMaxThresholds(
+ groupedWithMinMaxThresholds
+ )
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofMatrixWithDisplayName(matrixWithDisplayName)`.
+ */
+ fun licenseAllocationPrice(
+ matrixWithDisplayName: LicenseAllocationPrice.MatrixWithDisplayName
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofMatrixWithDisplayName(matrixWithDisplayName)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofGroupedTieredPackage(groupedTieredPackage)`.
+ */
+ fun licenseAllocationPrice(
+ groupedTieredPackage: LicenseAllocationPrice.GroupedTieredPackage
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofGroupedTieredPackage(groupedTieredPackage)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofMaxGroupTieredPackage(maxGroupTieredPackage)`.
+ */
+ fun licenseAllocationPrice(
+ maxGroupTieredPackage: LicenseAllocationPrice.MaxGroupTieredPackage
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofMaxGroupTieredPackage(maxGroupTieredPackage)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)`.
+ */
+ fun licenseAllocationPrice(
+ scalableMatrixWithUnitPricing: LicenseAllocationPrice.ScalableMatrixWithUnitPricing
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofScalableMatrixWithUnitPricing(
+ scalableMatrixWithUnitPricing
+ )
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)`.
+ */
+ fun licenseAllocationPrice(
+ scalableMatrixWithTieredPricing:
+ LicenseAllocationPrice.ScalableMatrixWithTieredPricing
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofScalableMatrixWithTieredPricing(
+ scalableMatrixWithTieredPricing
+ )
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofCumulativeGroupedBulk(cumulativeGroupedBulk)`.
+ */
+ fun licenseAllocationPrice(
+ cumulativeGroupedBulk: LicenseAllocationPrice.CumulativeGroupedBulk
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofCumulativeGroupedBulk(cumulativeGroupedBulk)
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofCumulativeGroupedAllocation(cumulativeGroupedAllocation)`.
+ */
+ fun licenseAllocationPrice(
+ cumulativeGroupedAllocation: LicenseAllocationPrice.CumulativeGroupedAllocation
+ ) =
+ licenseAllocationPrice(
+ LicenseAllocationPrice.ofCumulativeGroupedAllocation(
+ cumulativeGroupedAllocation
+ )
+ )
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofMinimumComposite(minimumComposite)`.
+ */
+ fun licenseAllocationPrice(minimumComposite: LicenseAllocationPrice.MinimumComposite) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofMinimumComposite(minimumComposite))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofPercent(percent)`.
+ */
+ fun licenseAllocationPrice(percent: LicenseAllocationPrice.Percent) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofPercent(percent))
+
+ /**
+ * Alias for calling [licenseAllocationPrice] with
+ * `LicenseAllocationPrice.ofEventOutput(eventOutput)`.
+ */
+ fun licenseAllocationPrice(eventOutput: LicenseAllocationPrice.EventOutput) =
+ licenseAllocationPrice(LicenseAllocationPrice.ofEventOutput(eventOutput))
+
/** The phase to add this price to. */
fun planPhaseOrder(planPhaseOrder: Long?) =
planPhaseOrder(JsonField.ofNullable(planPhaseOrder))
@@ -2106,6 +2456,7 @@ private constructor(
fun build(): AddPrice =
AddPrice(
allocationPrice,
+ licenseAllocationPrice,
planPhaseOrder,
price,
additionalProperties.toMutableMap(),
@@ -2120,6 +2471,7 @@ private constructor(
}
allocationPrice().ifPresent { it.validate() }
+ licenseAllocationPrice().ifPresent { it.validate() }
planPhaseOrder()
price().ifPresent { it.validate() }
validated = true
@@ -2142,132 +2494,125 @@ private constructor(
@JvmSynthetic
internal fun validity(): Int =
(allocationPrice.asKnown().getOrNull()?.validity() ?: 0) +
+ (licenseAllocationPrice.asKnown().getOrNull()?.validity() ?: 0) +
(if (planPhaseOrder.asKnown().isPresent) 1 else 0) +
(price.asKnown().getOrNull()?.validity() ?: 0)
- /** New plan price request body params. */
- @JsonDeserialize(using = Price.Deserializer::class)
- @JsonSerialize(using = Price.Serializer::class)
- class Price
+ /** The license allocation price to add to the plan. */
+ @JsonDeserialize(using = LicenseAllocationPrice.Deserializer::class)
+ @JsonSerialize(using = LicenseAllocationPrice.Serializer::class)
+ class LicenseAllocationPrice
private constructor(
- private val unit: NewPlanUnitPrice? = null,
- private val tiered: NewPlanTieredPrice? = null,
- private val bulk: NewPlanBulkPrice? = null,
+ private val unit: Unit? = null,
+ private val tiered: Tiered? = null,
+ private val bulk: Bulk? = null,
private val bulkWithFilters: BulkWithFilters? = null,
- private val package_: NewPlanPackagePrice? = null,
- private val matrix: NewPlanMatrixPrice? = null,
- private val thresholdTotalAmount: NewPlanThresholdTotalAmountPrice? = null,
- private val tieredPackage: NewPlanTieredPackagePrice? = null,
- private val tieredWithMinimum: NewPlanTieredWithMinimumPrice? = null,
- private val groupedTiered: NewPlanGroupedTieredPrice? = null,
- private val tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice? = null,
- private val packageWithAllocation: NewPlanPackageWithAllocationPrice? = null,
- private val unitWithPercent: NewPlanUnitWithPercentPrice? = null,
- private val matrixWithAllocation: NewPlanMatrixWithAllocationPrice? = null,
+ private val package_: Package? = null,
+ private val matrix: Matrix? = null,
+ private val thresholdTotalAmount: ThresholdTotalAmount? = null,
+ private val tieredPackage: TieredPackage? = null,
+ private val tieredWithMinimum: TieredWithMinimum? = null,
+ private val groupedTiered: GroupedTiered? = null,
+ private val tieredPackageWithMinimum: TieredPackageWithMinimum? = null,
+ private val packageWithAllocation: PackageWithAllocation? = null,
+ private val unitWithPercent: UnitWithPercent? = null,
+ private val matrixWithAllocation: MatrixWithAllocation? = null,
private val tieredWithProration: TieredWithProration? = null,
- private val unitWithProration: NewPlanUnitWithProrationPrice? = null,
- private val groupedAllocation: NewPlanGroupedAllocationPrice? = null,
- private val bulkWithProration: NewPlanBulkWithProrationPrice? = null,
- private val groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice? = null,
- private val groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice? = null,
+ private val unitWithProration: UnitWithProration? = null,
+ private val groupedAllocation: GroupedAllocation? = null,
+ private val bulkWithProration: BulkWithProration? = null,
+ private val groupedWithProratedMinimum: GroupedWithProratedMinimum? = null,
+ private val groupedWithMeteredMinimum: GroupedWithMeteredMinimum? = null,
private val groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds? = null,
- private val matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice? = null,
- private val groupedTieredPackage: NewPlanGroupedTieredPackagePrice? = null,
- private val maxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice? = null,
- private val scalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice? =
- null,
- private val scalableMatrixWithTieredPricing:
- NewPlanScalableMatrixWithTieredPricingPrice? =
- null,
- private val cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice? = null,
+ private val matrixWithDisplayName: MatrixWithDisplayName? = null,
+ private val groupedTieredPackage: GroupedTieredPackage? = null,
+ private val maxGroupTieredPackage: MaxGroupTieredPackage? = null,
+ private val scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing? = null,
+ private val scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing? = null,
+ private val cumulativeGroupedBulk: CumulativeGroupedBulk? = null,
private val cumulativeGroupedAllocation: CumulativeGroupedAllocation? = null,
- private val minimumComposite: NewPlanMinimumCompositePrice? = null,
+ private val minimumComposite: MinimumComposite? = null,
private val percent: Percent? = null,
private val eventOutput: EventOutput? = null,
private val _json: JsonValue? = null,
) {
- fun unit(): Optional = Optional.ofNullable(unit)
+ fun unit(): Optional = Optional.ofNullable(unit)
- fun tiered(): Optional = Optional.ofNullable(tiered)
+ fun tiered(): Optional = Optional.ofNullable(tiered)
- fun bulk(): Optional = Optional.ofNullable(bulk)
+ fun bulk(): Optional = Optional.ofNullable(bulk)
fun bulkWithFilters(): Optional = Optional.ofNullable(bulkWithFilters)
- fun package_(): Optional = Optional.ofNullable(package_)
+ fun package_(): Optional = Optional.ofNullable(package_)
- fun matrix(): Optional = Optional.ofNullable(matrix)
+ fun matrix(): Optional = Optional.ofNullable(matrix)
- fun thresholdTotalAmount(): Optional =
+ fun thresholdTotalAmount(): Optional =
Optional.ofNullable(thresholdTotalAmount)
- fun tieredPackage(): Optional =
- Optional.ofNullable(tieredPackage)
+ fun tieredPackage(): Optional = Optional.ofNullable(tieredPackage)
- fun tieredWithMinimum(): Optional =
+ fun tieredWithMinimum(): Optional =
Optional.ofNullable(tieredWithMinimum)
- fun groupedTiered(): Optional =
- Optional.ofNullable(groupedTiered)
+ fun groupedTiered(): Optional = Optional.ofNullable(groupedTiered)
- fun tieredPackageWithMinimum(): Optional =
+ fun tieredPackageWithMinimum(): Optional =
Optional.ofNullable(tieredPackageWithMinimum)
- fun packageWithAllocation(): Optional =
+ fun packageWithAllocation(): Optional =
Optional.ofNullable(packageWithAllocation)
- fun unitWithPercent(): Optional =
- Optional.ofNullable(unitWithPercent)
+ fun unitWithPercent(): Optional = Optional.ofNullable(unitWithPercent)
- fun matrixWithAllocation(): Optional =
+ fun matrixWithAllocation(): Optional =
Optional.ofNullable(matrixWithAllocation)
fun tieredWithProration(): Optional =
Optional.ofNullable(tieredWithProration)
- fun unitWithProration(): Optional =
+ fun unitWithProration(): Optional =
Optional.ofNullable(unitWithProration)
- fun groupedAllocation(): Optional =
+ fun groupedAllocation(): Optional =
Optional.ofNullable(groupedAllocation)
- fun bulkWithProration(): Optional =
+ fun bulkWithProration(): Optional =
Optional.ofNullable(bulkWithProration)
- fun groupedWithProratedMinimum(): Optional =
+ fun groupedWithProratedMinimum(): Optional =
Optional.ofNullable(groupedWithProratedMinimum)
- fun groupedWithMeteredMinimum(): Optional =
+ fun groupedWithMeteredMinimum(): Optional =
Optional.ofNullable(groupedWithMeteredMinimum)
fun groupedWithMinMaxThresholds(): Optional =
Optional.ofNullable(groupedWithMinMaxThresholds)
- fun matrixWithDisplayName(): Optional =
+ fun matrixWithDisplayName(): Optional =
Optional.ofNullable(matrixWithDisplayName)
- fun groupedTieredPackage(): Optional =
+ fun groupedTieredPackage(): Optional =
Optional.ofNullable(groupedTieredPackage)
- fun maxGroupTieredPackage(): Optional =
+ fun maxGroupTieredPackage(): Optional =
Optional.ofNullable(maxGroupTieredPackage)
- fun scalableMatrixWithUnitPricing():
- Optional =
+ fun scalableMatrixWithUnitPricing(): Optional =
Optional.ofNullable(scalableMatrixWithUnitPricing)
- fun scalableMatrixWithTieredPricing():
- Optional =
+ fun scalableMatrixWithTieredPricing(): Optional =
Optional.ofNullable(scalableMatrixWithTieredPricing)
- fun cumulativeGroupedBulk(): Optional =
+ fun cumulativeGroupedBulk(): Optional =
Optional.ofNullable(cumulativeGroupedBulk)
fun cumulativeGroupedAllocation(): Optional =
Optional.ofNullable(cumulativeGroupedAllocation)
- fun minimumComposite(): Optional =
+ fun minimumComposite(): Optional =
Optional.ofNullable(minimumComposite)
fun percent(): Optional = Optional.ofNullable(percent)
@@ -2337,85 +2682,82 @@ private constructor(
fun isEventOutput(): Boolean = eventOutput != null
- fun asUnit(): NewPlanUnitPrice = unit.getOrThrow("unit")
+ fun asUnit(): Unit = unit.getOrThrow("unit")
- fun asTiered(): NewPlanTieredPrice = tiered.getOrThrow("tiered")
+ fun asTiered(): Tiered = tiered.getOrThrow("tiered")
- fun asBulk(): NewPlanBulkPrice = bulk.getOrThrow("bulk")
+ fun asBulk(): Bulk = bulk.getOrThrow("bulk")
fun asBulkWithFilters(): BulkWithFilters = bulkWithFilters.getOrThrow("bulkWithFilters")
- fun asPackage(): NewPlanPackagePrice = package_.getOrThrow("package_")
+ fun asPackage(): Package = package_.getOrThrow("package_")
- fun asMatrix(): NewPlanMatrixPrice = matrix.getOrThrow("matrix")
+ fun asMatrix(): Matrix = matrix.getOrThrow("matrix")
- fun asThresholdTotalAmount(): NewPlanThresholdTotalAmountPrice =
+ fun asThresholdTotalAmount(): ThresholdTotalAmount =
thresholdTotalAmount.getOrThrow("thresholdTotalAmount")
- fun asTieredPackage(): NewPlanTieredPackagePrice =
- tieredPackage.getOrThrow("tieredPackage")
+ fun asTieredPackage(): TieredPackage = tieredPackage.getOrThrow("tieredPackage")
- fun asTieredWithMinimum(): NewPlanTieredWithMinimumPrice =
+ fun asTieredWithMinimum(): TieredWithMinimum =
tieredWithMinimum.getOrThrow("tieredWithMinimum")
- fun asGroupedTiered(): NewPlanGroupedTieredPrice =
- groupedTiered.getOrThrow("groupedTiered")
+ fun asGroupedTiered(): GroupedTiered = groupedTiered.getOrThrow("groupedTiered")
- fun asTieredPackageWithMinimum(): NewPlanTieredPackageWithMinimumPrice =
+ fun asTieredPackageWithMinimum(): TieredPackageWithMinimum =
tieredPackageWithMinimum.getOrThrow("tieredPackageWithMinimum")
- fun asPackageWithAllocation(): NewPlanPackageWithAllocationPrice =
+ fun asPackageWithAllocation(): PackageWithAllocation =
packageWithAllocation.getOrThrow("packageWithAllocation")
- fun asUnitWithPercent(): NewPlanUnitWithPercentPrice =
- unitWithPercent.getOrThrow("unitWithPercent")
+ fun asUnitWithPercent(): UnitWithPercent = unitWithPercent.getOrThrow("unitWithPercent")
- fun asMatrixWithAllocation(): NewPlanMatrixWithAllocationPrice =
+ fun asMatrixWithAllocation(): MatrixWithAllocation =
matrixWithAllocation.getOrThrow("matrixWithAllocation")
fun asTieredWithProration(): TieredWithProration =
tieredWithProration.getOrThrow("tieredWithProration")
- fun asUnitWithProration(): NewPlanUnitWithProrationPrice =
+ fun asUnitWithProration(): UnitWithProration =
unitWithProration.getOrThrow("unitWithProration")
- fun asGroupedAllocation(): NewPlanGroupedAllocationPrice =
+ fun asGroupedAllocation(): GroupedAllocation =
groupedAllocation.getOrThrow("groupedAllocation")
- fun asBulkWithProration(): NewPlanBulkWithProrationPrice =
+ fun asBulkWithProration(): BulkWithProration =
bulkWithProration.getOrThrow("bulkWithProration")
- fun asGroupedWithProratedMinimum(): NewPlanGroupedWithProratedMinimumPrice =
+ fun asGroupedWithProratedMinimum(): GroupedWithProratedMinimum =
groupedWithProratedMinimum.getOrThrow("groupedWithProratedMinimum")
- fun asGroupedWithMeteredMinimum(): NewPlanGroupedWithMeteredMinimumPrice =
+ fun asGroupedWithMeteredMinimum(): GroupedWithMeteredMinimum =
groupedWithMeteredMinimum.getOrThrow("groupedWithMeteredMinimum")
fun asGroupedWithMinMaxThresholds(): GroupedWithMinMaxThresholds =
groupedWithMinMaxThresholds.getOrThrow("groupedWithMinMaxThresholds")
- fun asMatrixWithDisplayName(): NewPlanMatrixWithDisplayNamePrice =
+ fun asMatrixWithDisplayName(): MatrixWithDisplayName =
matrixWithDisplayName.getOrThrow("matrixWithDisplayName")
- fun asGroupedTieredPackage(): NewPlanGroupedTieredPackagePrice =
+ fun asGroupedTieredPackage(): GroupedTieredPackage =
groupedTieredPackage.getOrThrow("groupedTieredPackage")
- fun asMaxGroupTieredPackage(): NewPlanMaxGroupTieredPackagePrice =
+ fun asMaxGroupTieredPackage(): MaxGroupTieredPackage =
maxGroupTieredPackage.getOrThrow("maxGroupTieredPackage")
- fun asScalableMatrixWithUnitPricing(): NewPlanScalableMatrixWithUnitPricingPrice =
+ fun asScalableMatrixWithUnitPricing(): ScalableMatrixWithUnitPricing =
scalableMatrixWithUnitPricing.getOrThrow("scalableMatrixWithUnitPricing")
- fun asScalableMatrixWithTieredPricing(): NewPlanScalableMatrixWithTieredPricingPrice =
+ fun asScalableMatrixWithTieredPricing(): ScalableMatrixWithTieredPricing =
scalableMatrixWithTieredPricing.getOrThrow("scalableMatrixWithTieredPricing")
- fun asCumulativeGroupedBulk(): NewPlanCumulativeGroupedBulkPrice =
+ fun asCumulativeGroupedBulk(): CumulativeGroupedBulk =
cumulativeGroupedBulk.getOrThrow("cumulativeGroupedBulk")
fun asCumulativeGroupedAllocation(): CumulativeGroupedAllocation =
cumulativeGroupedAllocation.getOrThrow("cumulativeGroupedAllocation")
- fun asMinimumComposite(): NewPlanMinimumCompositePrice =
+ fun asMinimumComposite(): MinimumComposite =
minimumComposite.getOrThrow("minimumComposite")
fun asPercent(): Percent = percent.getOrThrow("percent")
@@ -2479,22 +2821,22 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Price = apply {
+ fun validate(): LicenseAllocationPrice = apply {
if (validated) {
return@apply
}
accept(
object : Visitor {
- override fun visitUnit(unit: NewPlanUnitPrice) {
+ override fun visitUnit(unit: Unit) {
unit.validate()
}
- override fun visitTiered(tiered: NewPlanTieredPrice) {
+ override fun visitTiered(tiered: Tiered) {
tiered.validate()
}
- override fun visitBulk(bulk: NewPlanBulkPrice) {
+ override fun visitBulk(bulk: Bulk) {
bulk.validate()
}
@@ -2502,54 +2844,50 @@ private constructor(
bulkWithFilters.validate()
}
- override fun visitPackage(package_: NewPlanPackagePrice) {
+ override fun visitPackage(package_: Package) {
package_.validate()
}
- override fun visitMatrix(matrix: NewPlanMatrixPrice) {
+ override fun visitMatrix(matrix: Matrix) {
matrix.validate()
}
override fun visitThresholdTotalAmount(
- thresholdTotalAmount: NewPlanThresholdTotalAmountPrice
+ thresholdTotalAmount: ThresholdTotalAmount
) {
thresholdTotalAmount.validate()
}
- override fun visitTieredPackage(tieredPackage: NewPlanTieredPackagePrice) {
+ override fun visitTieredPackage(tieredPackage: TieredPackage) {
tieredPackage.validate()
}
- override fun visitTieredWithMinimum(
- tieredWithMinimum: NewPlanTieredWithMinimumPrice
- ) {
+ override fun visitTieredWithMinimum(tieredWithMinimum: TieredWithMinimum) {
tieredWithMinimum.validate()
}
- override fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) {
+ override fun visitGroupedTiered(groupedTiered: GroupedTiered) {
groupedTiered.validate()
}
override fun visitTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
+ tieredPackageWithMinimum: TieredPackageWithMinimum
) {
tieredPackageWithMinimum.validate()
}
override fun visitPackageWithAllocation(
- packageWithAllocation: NewPlanPackageWithAllocationPrice
+ packageWithAllocation: PackageWithAllocation
) {
packageWithAllocation.validate()
}
- override fun visitUnitWithPercent(
- unitWithPercent: NewPlanUnitWithPercentPrice
- ) {
+ override fun visitUnitWithPercent(unitWithPercent: UnitWithPercent) {
unitWithPercent.validate()
}
override fun visitMatrixWithAllocation(
- matrixWithAllocation: NewPlanMatrixWithAllocationPrice
+ matrixWithAllocation: MatrixWithAllocation
) {
matrixWithAllocation.validate()
}
@@ -2560,32 +2898,26 @@ private constructor(
tieredWithProration.validate()
}
- override fun visitUnitWithProration(
- unitWithProration: NewPlanUnitWithProrationPrice
- ) {
+ override fun visitUnitWithProration(unitWithProration: UnitWithProration) {
unitWithProration.validate()
}
- override fun visitGroupedAllocation(
- groupedAllocation: NewPlanGroupedAllocationPrice
- ) {
+ override fun visitGroupedAllocation(groupedAllocation: GroupedAllocation) {
groupedAllocation.validate()
}
- override fun visitBulkWithProration(
- bulkWithProration: NewPlanBulkWithProrationPrice
- ) {
+ override fun visitBulkWithProration(bulkWithProration: BulkWithProration) {
bulkWithProration.validate()
}
override fun visitGroupedWithProratedMinimum(
- groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
+ groupedWithProratedMinimum: GroupedWithProratedMinimum
) {
groupedWithProratedMinimum.validate()
}
override fun visitGroupedWithMeteredMinimum(
- groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice
+ groupedWithMeteredMinimum: GroupedWithMeteredMinimum
) {
groupedWithMeteredMinimum.validate()
}
@@ -2597,38 +2929,37 @@ private constructor(
}
override fun visitMatrixWithDisplayName(
- matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
+ matrixWithDisplayName: MatrixWithDisplayName
) {
matrixWithDisplayName.validate()
}
override fun visitGroupedTieredPackage(
- groupedTieredPackage: NewPlanGroupedTieredPackagePrice
+ groupedTieredPackage: GroupedTieredPackage
) {
groupedTieredPackage.validate()
}
override fun visitMaxGroupTieredPackage(
- maxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice
+ maxGroupTieredPackage: MaxGroupTieredPackage
) {
maxGroupTieredPackage.validate()
}
override fun visitScalableMatrixWithUnitPricing(
- scalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice
+ scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing
) {
scalableMatrixWithUnitPricing.validate()
}
override fun visitScalableMatrixWithTieredPricing(
- scalableMatrixWithTieredPricing:
- NewPlanScalableMatrixWithTieredPricingPrice
+ scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing
) {
scalableMatrixWithTieredPricing.validate()
}
override fun visitCumulativeGroupedBulk(
- cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice
+ cumulativeGroupedBulk: CumulativeGroupedBulk
) {
cumulativeGroupedBulk.validate()
}
@@ -2639,9 +2970,7 @@ private constructor(
cumulativeGroupedAllocation.validate()
}
- override fun visitMinimumComposite(
- minimumComposite: NewPlanMinimumCompositePrice
- ) {
+ override fun visitMinimumComposite(minimumComposite: MinimumComposite) {
minimumComposite.validate()
}
@@ -2675,72 +3004,66 @@ private constructor(
internal fun validity(): Int =
accept(
object : Visitor {
- override fun visitUnit(unit: NewPlanUnitPrice) = unit.validity()
+ override fun visitUnit(unit: Unit) = unit.validity()
- override fun visitTiered(tiered: NewPlanTieredPrice) = tiered.validity()
+ override fun visitTiered(tiered: Tiered) = tiered.validity()
- override fun visitBulk(bulk: NewPlanBulkPrice) = bulk.validity()
+ override fun visitBulk(bulk: Bulk) = bulk.validity()
override fun visitBulkWithFilters(bulkWithFilters: BulkWithFilters) =
bulkWithFilters.validity()
- override fun visitPackage(package_: NewPlanPackagePrice) =
- package_.validity()
+ override fun visitPackage(package_: Package) = package_.validity()
- override fun visitMatrix(matrix: NewPlanMatrixPrice) = matrix.validity()
+ override fun visitMatrix(matrix: Matrix) = matrix.validity()
override fun visitThresholdTotalAmount(
- thresholdTotalAmount: NewPlanThresholdTotalAmountPrice
+ thresholdTotalAmount: ThresholdTotalAmount
) = thresholdTotalAmount.validity()
- override fun visitTieredPackage(tieredPackage: NewPlanTieredPackagePrice) =
+ override fun visitTieredPackage(tieredPackage: TieredPackage) =
tieredPackage.validity()
- override fun visitTieredWithMinimum(
- tieredWithMinimum: NewPlanTieredWithMinimumPrice
- ) = tieredWithMinimum.validity()
+ override fun visitTieredWithMinimum(tieredWithMinimum: TieredWithMinimum) =
+ tieredWithMinimum.validity()
- override fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) =
+ override fun visitGroupedTiered(groupedTiered: GroupedTiered) =
groupedTiered.validity()
override fun visitTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
+ tieredPackageWithMinimum: TieredPackageWithMinimum
) = tieredPackageWithMinimum.validity()
override fun visitPackageWithAllocation(
- packageWithAllocation: NewPlanPackageWithAllocationPrice
+ packageWithAllocation: PackageWithAllocation
) = packageWithAllocation.validity()
- override fun visitUnitWithPercent(
- unitWithPercent: NewPlanUnitWithPercentPrice
- ) = unitWithPercent.validity()
+ override fun visitUnitWithPercent(unitWithPercent: UnitWithPercent) =
+ unitWithPercent.validity()
override fun visitMatrixWithAllocation(
- matrixWithAllocation: NewPlanMatrixWithAllocationPrice
+ matrixWithAllocation: MatrixWithAllocation
) = matrixWithAllocation.validity()
override fun visitTieredWithProration(
tieredWithProration: TieredWithProration
) = tieredWithProration.validity()
- override fun visitUnitWithProration(
- unitWithProration: NewPlanUnitWithProrationPrice
- ) = unitWithProration.validity()
+ override fun visitUnitWithProration(unitWithProration: UnitWithProration) =
+ unitWithProration.validity()
- override fun visitGroupedAllocation(
- groupedAllocation: NewPlanGroupedAllocationPrice
- ) = groupedAllocation.validity()
+ override fun visitGroupedAllocation(groupedAllocation: GroupedAllocation) =
+ groupedAllocation.validity()
- override fun visitBulkWithProration(
- bulkWithProration: NewPlanBulkWithProrationPrice
- ) = bulkWithProration.validity()
+ override fun visitBulkWithProration(bulkWithProration: BulkWithProration) =
+ bulkWithProration.validity()
override fun visitGroupedWithProratedMinimum(
- groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
+ groupedWithProratedMinimum: GroupedWithProratedMinimum
) = groupedWithProratedMinimum.validity()
override fun visitGroupedWithMeteredMinimum(
- groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice
+ groupedWithMeteredMinimum: GroupedWithMeteredMinimum
) = groupedWithMeteredMinimum.validity()
override fun visitGroupedWithMinMaxThresholds(
@@ -2748,37 +3071,35 @@ private constructor(
) = groupedWithMinMaxThresholds.validity()
override fun visitMatrixWithDisplayName(
- matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
+ matrixWithDisplayName: MatrixWithDisplayName
) = matrixWithDisplayName.validity()
override fun visitGroupedTieredPackage(
- groupedTieredPackage: NewPlanGroupedTieredPackagePrice
+ groupedTieredPackage: GroupedTieredPackage
) = groupedTieredPackage.validity()
override fun visitMaxGroupTieredPackage(
- maxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice
+ maxGroupTieredPackage: MaxGroupTieredPackage
) = maxGroupTieredPackage.validity()
override fun visitScalableMatrixWithUnitPricing(
- scalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice
+ scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing
) = scalableMatrixWithUnitPricing.validity()
override fun visitScalableMatrixWithTieredPricing(
- scalableMatrixWithTieredPricing:
- NewPlanScalableMatrixWithTieredPricingPrice
+ scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing
) = scalableMatrixWithTieredPricing.validity()
override fun visitCumulativeGroupedBulk(
- cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice
+ cumulativeGroupedBulk: CumulativeGroupedBulk
) = cumulativeGroupedBulk.validity()
override fun visitCumulativeGroupedAllocation(
cumulativeGroupedAllocation: CumulativeGroupedAllocation
) = cumulativeGroupedAllocation.validity()
- override fun visitMinimumComposite(
- minimumComposite: NewPlanMinimumCompositePrice
- ) = minimumComposite.validity()
+ override fun visitMinimumComposite(minimumComposite: MinimumComposite) =
+ minimumComposite.validity()
override fun visitPercent(percent: Percent) = percent.validity()
@@ -2794,7 +3115,7 @@ private constructor(
return true
}
- return other is Price &&
+ return other is LicenseAllocationPrice &&
unit == other.unit &&
tiered == other.tiered &&
bulk == other.bulk &&
@@ -2865,522 +3186,521 @@ private constructor(
override fun toString(): String =
when {
- unit != null -> "Price{unit=$unit}"
- tiered != null -> "Price{tiered=$tiered}"
- bulk != null -> "Price{bulk=$bulk}"
- bulkWithFilters != null -> "Price{bulkWithFilters=$bulkWithFilters}"
- package_ != null -> "Price{package_=$package_}"
- matrix != null -> "Price{matrix=$matrix}"
+ unit != null -> "LicenseAllocationPrice{unit=$unit}"
+ tiered != null -> "LicenseAllocationPrice{tiered=$tiered}"
+ bulk != null -> "LicenseAllocationPrice{bulk=$bulk}"
+ bulkWithFilters != null ->
+ "LicenseAllocationPrice{bulkWithFilters=$bulkWithFilters}"
+ package_ != null -> "LicenseAllocationPrice{package_=$package_}"
+ matrix != null -> "LicenseAllocationPrice{matrix=$matrix}"
thresholdTotalAmount != null ->
- "Price{thresholdTotalAmount=$thresholdTotalAmount}"
- tieredPackage != null -> "Price{tieredPackage=$tieredPackage}"
- tieredWithMinimum != null -> "Price{tieredWithMinimum=$tieredWithMinimum}"
- groupedTiered != null -> "Price{groupedTiered=$groupedTiered}"
+ "LicenseAllocationPrice{thresholdTotalAmount=$thresholdTotalAmount}"
+ tieredPackage != null -> "LicenseAllocationPrice{tieredPackage=$tieredPackage}"
+ tieredWithMinimum != null ->
+ "LicenseAllocationPrice{tieredWithMinimum=$tieredWithMinimum}"
+ groupedTiered != null -> "LicenseAllocationPrice{groupedTiered=$groupedTiered}"
tieredPackageWithMinimum != null ->
- "Price{tieredPackageWithMinimum=$tieredPackageWithMinimum}"
+ "LicenseAllocationPrice{tieredPackageWithMinimum=$tieredPackageWithMinimum}"
packageWithAllocation != null ->
- "Price{packageWithAllocation=$packageWithAllocation}"
- unitWithPercent != null -> "Price{unitWithPercent=$unitWithPercent}"
+ "LicenseAllocationPrice{packageWithAllocation=$packageWithAllocation}"
+ unitWithPercent != null ->
+ "LicenseAllocationPrice{unitWithPercent=$unitWithPercent}"
matrixWithAllocation != null ->
- "Price{matrixWithAllocation=$matrixWithAllocation}"
- tieredWithProration != null -> "Price{tieredWithProration=$tieredWithProration}"
- unitWithProration != null -> "Price{unitWithProration=$unitWithProration}"
- groupedAllocation != null -> "Price{groupedAllocation=$groupedAllocation}"
- bulkWithProration != null -> "Price{bulkWithProration=$bulkWithProration}"
+ "LicenseAllocationPrice{matrixWithAllocation=$matrixWithAllocation}"
+ tieredWithProration != null ->
+ "LicenseAllocationPrice{tieredWithProration=$tieredWithProration}"
+ unitWithProration != null ->
+ "LicenseAllocationPrice{unitWithProration=$unitWithProration}"
+ groupedAllocation != null ->
+ "LicenseAllocationPrice{groupedAllocation=$groupedAllocation}"
+ bulkWithProration != null ->
+ "LicenseAllocationPrice{bulkWithProration=$bulkWithProration}"
groupedWithProratedMinimum != null ->
- "Price{groupedWithProratedMinimum=$groupedWithProratedMinimum}"
+ "LicenseAllocationPrice{groupedWithProratedMinimum=$groupedWithProratedMinimum}"
groupedWithMeteredMinimum != null ->
- "Price{groupedWithMeteredMinimum=$groupedWithMeteredMinimum}"
+ "LicenseAllocationPrice{groupedWithMeteredMinimum=$groupedWithMeteredMinimum}"
groupedWithMinMaxThresholds != null ->
- "Price{groupedWithMinMaxThresholds=$groupedWithMinMaxThresholds}"
+ "LicenseAllocationPrice{groupedWithMinMaxThresholds=$groupedWithMinMaxThresholds}"
matrixWithDisplayName != null ->
- "Price{matrixWithDisplayName=$matrixWithDisplayName}"
+ "LicenseAllocationPrice{matrixWithDisplayName=$matrixWithDisplayName}"
groupedTieredPackage != null ->
- "Price{groupedTieredPackage=$groupedTieredPackage}"
+ "LicenseAllocationPrice{groupedTieredPackage=$groupedTieredPackage}"
maxGroupTieredPackage != null ->
- "Price{maxGroupTieredPackage=$maxGroupTieredPackage}"
+ "LicenseAllocationPrice{maxGroupTieredPackage=$maxGroupTieredPackage}"
scalableMatrixWithUnitPricing != null ->
- "Price{scalableMatrixWithUnitPricing=$scalableMatrixWithUnitPricing}"
+ "LicenseAllocationPrice{scalableMatrixWithUnitPricing=$scalableMatrixWithUnitPricing}"
scalableMatrixWithTieredPricing != null ->
- "Price{scalableMatrixWithTieredPricing=$scalableMatrixWithTieredPricing}"
+ "LicenseAllocationPrice{scalableMatrixWithTieredPricing=$scalableMatrixWithTieredPricing}"
cumulativeGroupedBulk != null ->
- "Price{cumulativeGroupedBulk=$cumulativeGroupedBulk}"
+ "LicenseAllocationPrice{cumulativeGroupedBulk=$cumulativeGroupedBulk}"
cumulativeGroupedAllocation != null ->
- "Price{cumulativeGroupedAllocation=$cumulativeGroupedAllocation}"
- minimumComposite != null -> "Price{minimumComposite=$minimumComposite}"
- percent != null -> "Price{percent=$percent}"
- eventOutput != null -> "Price{eventOutput=$eventOutput}"
- _json != null -> "Price{_unknown=$_json}"
- else -> throw IllegalStateException("Invalid Price")
+ "LicenseAllocationPrice{cumulativeGroupedAllocation=$cumulativeGroupedAllocation}"
+ minimumComposite != null ->
+ "LicenseAllocationPrice{minimumComposite=$minimumComposite}"
+ percent != null -> "LicenseAllocationPrice{percent=$percent}"
+ eventOutput != null -> "LicenseAllocationPrice{eventOutput=$eventOutput}"
+ _json != null -> "LicenseAllocationPrice{_unknown=$_json}"
+ else -> throw IllegalStateException("Invalid LicenseAllocationPrice")
}
companion object {
- @JvmStatic fun ofUnit(unit: NewPlanUnitPrice) = Price(unit = unit)
+ @JvmStatic fun ofUnit(unit: Unit) = LicenseAllocationPrice(unit = unit)
- @JvmStatic fun ofTiered(tiered: NewPlanTieredPrice) = Price(tiered = tiered)
+ @JvmStatic fun ofTiered(tiered: Tiered) = LicenseAllocationPrice(tiered = tiered)
- @JvmStatic fun ofBulk(bulk: NewPlanBulkPrice) = Price(bulk = bulk)
+ @JvmStatic fun ofBulk(bulk: Bulk) = LicenseAllocationPrice(bulk = bulk)
@JvmStatic
fun ofBulkWithFilters(bulkWithFilters: BulkWithFilters) =
- Price(bulkWithFilters = bulkWithFilters)
+ LicenseAllocationPrice(bulkWithFilters = bulkWithFilters)
- @JvmStatic fun ofPackage(package_: NewPlanPackagePrice) = Price(package_ = package_)
+ @JvmStatic
+ fun ofPackage(package_: Package) = LicenseAllocationPrice(package_ = package_)
- @JvmStatic fun ofMatrix(matrix: NewPlanMatrixPrice) = Price(matrix = matrix)
+ @JvmStatic fun ofMatrix(matrix: Matrix) = LicenseAllocationPrice(matrix = matrix)
@JvmStatic
- fun ofThresholdTotalAmount(thresholdTotalAmount: NewPlanThresholdTotalAmountPrice) =
- Price(thresholdTotalAmount = thresholdTotalAmount)
+ fun ofThresholdTotalAmount(thresholdTotalAmount: ThresholdTotalAmount) =
+ LicenseAllocationPrice(thresholdTotalAmount = thresholdTotalAmount)
@JvmStatic
- fun ofTieredPackage(tieredPackage: NewPlanTieredPackagePrice) =
- Price(tieredPackage = tieredPackage)
+ fun ofTieredPackage(tieredPackage: TieredPackage) =
+ LicenseAllocationPrice(tieredPackage = tieredPackage)
@JvmStatic
- fun ofTieredWithMinimum(tieredWithMinimum: NewPlanTieredWithMinimumPrice) =
- Price(tieredWithMinimum = tieredWithMinimum)
+ fun ofTieredWithMinimum(tieredWithMinimum: TieredWithMinimum) =
+ LicenseAllocationPrice(tieredWithMinimum = tieredWithMinimum)
@JvmStatic
- fun ofGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) =
- Price(groupedTiered = groupedTiered)
+ fun ofGroupedTiered(groupedTiered: GroupedTiered) =
+ LicenseAllocationPrice(groupedTiered = groupedTiered)
@JvmStatic
- fun ofTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
- ) = Price(tieredPackageWithMinimum = tieredPackageWithMinimum)
+ fun ofTieredPackageWithMinimum(tieredPackageWithMinimum: TieredPackageWithMinimum) =
+ LicenseAllocationPrice(tieredPackageWithMinimum = tieredPackageWithMinimum)
@JvmStatic
- fun ofPackageWithAllocation(
- packageWithAllocation: NewPlanPackageWithAllocationPrice
- ) = Price(packageWithAllocation = packageWithAllocation)
+ fun ofPackageWithAllocation(packageWithAllocation: PackageWithAllocation) =
+ LicenseAllocationPrice(packageWithAllocation = packageWithAllocation)
@JvmStatic
- fun ofUnitWithPercent(unitWithPercent: NewPlanUnitWithPercentPrice) =
- Price(unitWithPercent = unitWithPercent)
+ fun ofUnitWithPercent(unitWithPercent: UnitWithPercent) =
+ LicenseAllocationPrice(unitWithPercent = unitWithPercent)
@JvmStatic
- fun ofMatrixWithAllocation(matrixWithAllocation: NewPlanMatrixWithAllocationPrice) =
- Price(matrixWithAllocation = matrixWithAllocation)
+ fun ofMatrixWithAllocation(matrixWithAllocation: MatrixWithAllocation) =
+ LicenseAllocationPrice(matrixWithAllocation = matrixWithAllocation)
@JvmStatic
fun ofTieredWithProration(tieredWithProration: TieredWithProration) =
- Price(tieredWithProration = tieredWithProration)
+ LicenseAllocationPrice(tieredWithProration = tieredWithProration)
@JvmStatic
- fun ofUnitWithProration(unitWithProration: NewPlanUnitWithProrationPrice) =
- Price(unitWithProration = unitWithProration)
+ fun ofUnitWithProration(unitWithProration: UnitWithProration) =
+ LicenseAllocationPrice(unitWithProration = unitWithProration)
@JvmStatic
- fun ofGroupedAllocation(groupedAllocation: NewPlanGroupedAllocationPrice) =
- Price(groupedAllocation = groupedAllocation)
+ fun ofGroupedAllocation(groupedAllocation: GroupedAllocation) =
+ LicenseAllocationPrice(groupedAllocation = groupedAllocation)
@JvmStatic
- fun ofBulkWithProration(bulkWithProration: NewPlanBulkWithProrationPrice) =
- Price(bulkWithProration = bulkWithProration)
+ fun ofBulkWithProration(bulkWithProration: BulkWithProration) =
+ LicenseAllocationPrice(bulkWithProration = bulkWithProration)
@JvmStatic
fun ofGroupedWithProratedMinimum(
- groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
- ) = Price(groupedWithProratedMinimum = groupedWithProratedMinimum)
+ groupedWithProratedMinimum: GroupedWithProratedMinimum
+ ) = LicenseAllocationPrice(groupedWithProratedMinimum = groupedWithProratedMinimum)
@JvmStatic
fun ofGroupedWithMeteredMinimum(
- groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice
- ) = Price(groupedWithMeteredMinimum = groupedWithMeteredMinimum)
+ groupedWithMeteredMinimum: GroupedWithMeteredMinimum
+ ) = LicenseAllocationPrice(groupedWithMeteredMinimum = groupedWithMeteredMinimum)
@JvmStatic
fun ofGroupedWithMinMaxThresholds(
groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds
- ) = Price(groupedWithMinMaxThresholds = groupedWithMinMaxThresholds)
+ ) =
+ LicenseAllocationPrice(
+ groupedWithMinMaxThresholds = groupedWithMinMaxThresholds
+ )
@JvmStatic
- fun ofMatrixWithDisplayName(
- matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
- ) = Price(matrixWithDisplayName = matrixWithDisplayName)
+ fun ofMatrixWithDisplayName(matrixWithDisplayName: MatrixWithDisplayName) =
+ LicenseAllocationPrice(matrixWithDisplayName = matrixWithDisplayName)
@JvmStatic
- fun ofGroupedTieredPackage(groupedTieredPackage: NewPlanGroupedTieredPackagePrice) =
- Price(groupedTieredPackage = groupedTieredPackage)
+ fun ofGroupedTieredPackage(groupedTieredPackage: GroupedTieredPackage) =
+ LicenseAllocationPrice(groupedTieredPackage = groupedTieredPackage)
@JvmStatic
- fun ofMaxGroupTieredPackage(
- maxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice
- ) = Price(maxGroupTieredPackage = maxGroupTieredPackage)
+ fun ofMaxGroupTieredPackage(maxGroupTieredPackage: MaxGroupTieredPackage) =
+ LicenseAllocationPrice(maxGroupTieredPackage = maxGroupTieredPackage)
@JvmStatic
fun ofScalableMatrixWithUnitPricing(
- scalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice
- ) = Price(scalableMatrixWithUnitPricing = scalableMatrixWithUnitPricing)
+ scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing
+ ) =
+ LicenseAllocationPrice(
+ scalableMatrixWithUnitPricing = scalableMatrixWithUnitPricing
+ )
@JvmStatic
fun ofScalableMatrixWithTieredPricing(
- scalableMatrixWithTieredPricing: NewPlanScalableMatrixWithTieredPricingPrice
- ) = Price(scalableMatrixWithTieredPricing = scalableMatrixWithTieredPricing)
+ scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing
+ ) =
+ LicenseAllocationPrice(
+ scalableMatrixWithTieredPricing = scalableMatrixWithTieredPricing
+ )
@JvmStatic
- fun ofCumulativeGroupedBulk(
- cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice
- ) = Price(cumulativeGroupedBulk = cumulativeGroupedBulk)
+ fun ofCumulativeGroupedBulk(cumulativeGroupedBulk: CumulativeGroupedBulk) =
+ LicenseAllocationPrice(cumulativeGroupedBulk = cumulativeGroupedBulk)
@JvmStatic
fun ofCumulativeGroupedAllocation(
cumulativeGroupedAllocation: CumulativeGroupedAllocation
- ) = Price(cumulativeGroupedAllocation = cumulativeGroupedAllocation)
+ ) =
+ LicenseAllocationPrice(
+ cumulativeGroupedAllocation = cumulativeGroupedAllocation
+ )
@JvmStatic
- fun ofMinimumComposite(minimumComposite: NewPlanMinimumCompositePrice) =
- Price(minimumComposite = minimumComposite)
+ fun ofMinimumComposite(minimumComposite: MinimumComposite) =
+ LicenseAllocationPrice(minimumComposite = minimumComposite)
- @JvmStatic fun ofPercent(percent: Percent) = Price(percent = percent)
+ @JvmStatic
+ fun ofPercent(percent: Percent) = LicenseAllocationPrice(percent = percent)
@JvmStatic
- fun ofEventOutput(eventOutput: EventOutput) = Price(eventOutput = eventOutput)
+ fun ofEventOutput(eventOutput: EventOutput) =
+ LicenseAllocationPrice(eventOutput = eventOutput)
}
/**
- * An interface that defines how to map each variant of [Price] to a value of type [T].
+ * An interface that defines how to map each variant of [LicenseAllocationPrice] to a
+ * value of type [T].
*/
interface Visitor {
- fun visitUnit(unit: NewPlanUnitPrice): T
+ fun visitUnit(unit: Unit): T
- fun visitTiered(tiered: NewPlanTieredPrice): T
+ fun visitTiered(tiered: Tiered): T
- fun visitBulk(bulk: NewPlanBulkPrice): T
+ fun visitBulk(bulk: Bulk): T
fun visitBulkWithFilters(bulkWithFilters: BulkWithFilters): T
- fun visitPackage(package_: NewPlanPackagePrice): T
+ fun visitPackage(package_: Package): T
- fun visitMatrix(matrix: NewPlanMatrixPrice): T
+ fun visitMatrix(matrix: Matrix): T
- fun visitThresholdTotalAmount(
- thresholdTotalAmount: NewPlanThresholdTotalAmountPrice
- ): T
+ fun visitThresholdTotalAmount(thresholdTotalAmount: ThresholdTotalAmount): T
- fun visitTieredPackage(tieredPackage: NewPlanTieredPackagePrice): T
+ fun visitTieredPackage(tieredPackage: TieredPackage): T
- fun visitTieredWithMinimum(tieredWithMinimum: NewPlanTieredWithMinimumPrice): T
+ fun visitTieredWithMinimum(tieredWithMinimum: TieredWithMinimum): T
- fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice): T
+ fun visitGroupedTiered(groupedTiered: GroupedTiered): T
fun visitTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
+ tieredPackageWithMinimum: TieredPackageWithMinimum
): T
- fun visitPackageWithAllocation(
- packageWithAllocation: NewPlanPackageWithAllocationPrice
- ): T
+ fun visitPackageWithAllocation(packageWithAllocation: PackageWithAllocation): T
- fun visitUnitWithPercent(unitWithPercent: NewPlanUnitWithPercentPrice): T
+ fun visitUnitWithPercent(unitWithPercent: UnitWithPercent): T
- fun visitMatrixWithAllocation(
- matrixWithAllocation: NewPlanMatrixWithAllocationPrice
- ): T
+ fun visitMatrixWithAllocation(matrixWithAllocation: MatrixWithAllocation): T
fun visitTieredWithProration(tieredWithProration: TieredWithProration): T
- fun visitUnitWithProration(unitWithProration: NewPlanUnitWithProrationPrice): T
+ fun visitUnitWithProration(unitWithProration: UnitWithProration): T
- fun visitGroupedAllocation(groupedAllocation: NewPlanGroupedAllocationPrice): T
+ fun visitGroupedAllocation(groupedAllocation: GroupedAllocation): T
- fun visitBulkWithProration(bulkWithProration: NewPlanBulkWithProrationPrice): T
+ fun visitBulkWithProration(bulkWithProration: BulkWithProration): T
fun visitGroupedWithProratedMinimum(
- groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
+ groupedWithProratedMinimum: GroupedWithProratedMinimum
): T
fun visitGroupedWithMeteredMinimum(
- groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice
+ groupedWithMeteredMinimum: GroupedWithMeteredMinimum
): T
fun visitGroupedWithMinMaxThresholds(
groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds
): T
- fun visitMatrixWithDisplayName(
- matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
- ): T
+ fun visitMatrixWithDisplayName(matrixWithDisplayName: MatrixWithDisplayName): T
- fun visitGroupedTieredPackage(
- groupedTieredPackage: NewPlanGroupedTieredPackagePrice
- ): T
+ fun visitGroupedTieredPackage(groupedTieredPackage: GroupedTieredPackage): T
- fun visitMaxGroupTieredPackage(
- maxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice
- ): T
+ fun visitMaxGroupTieredPackage(maxGroupTieredPackage: MaxGroupTieredPackage): T
fun visitScalableMatrixWithUnitPricing(
- scalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice
+ scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricing
): T
fun visitScalableMatrixWithTieredPricing(
- scalableMatrixWithTieredPricing: NewPlanScalableMatrixWithTieredPricingPrice
+ scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricing
): T
- fun visitCumulativeGroupedBulk(
- cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice
- ): T
+ fun visitCumulativeGroupedBulk(cumulativeGroupedBulk: CumulativeGroupedBulk): T
fun visitCumulativeGroupedAllocation(
cumulativeGroupedAllocation: CumulativeGroupedAllocation
): T
- fun visitMinimumComposite(minimumComposite: NewPlanMinimumCompositePrice): T
+ fun visitMinimumComposite(minimumComposite: MinimumComposite): T
fun visitPercent(percent: Percent): T
fun visitEventOutput(eventOutput: EventOutput): T
/**
- * Maps an unknown variant of [Price] to a value of type [T].
+ * Maps an unknown variant of [LicenseAllocationPrice] to a value of type [T].
*
- * An instance of [Price] can contain an unknown variant if it was deserialized from
- * data that doesn't match any known variant. For example, if the SDK is on an older
- * version than the API, then the API may respond with new variants that the SDK is
- * unaware of.
+ * An instance of [LicenseAllocationPrice] can contain an unknown variant if it was
+ * deserialized from data that doesn't match any known variant. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new
+ * variants that the SDK is unaware of.
*
* @throws OrbInvalidDataException in the default implementation.
*/
fun unknown(json: JsonValue?): T {
- throw OrbInvalidDataException("Unknown Price: $json")
+ throw OrbInvalidDataException("Unknown LicenseAllocationPrice: $json")
}
}
- internal class Deserializer : BaseDeserializer(Price::class) {
+ internal class Deserializer :
+ BaseDeserializer(LicenseAllocationPrice::class) {
- override fun ObjectCodec.deserialize(node: JsonNode): Price {
+ override fun ObjectCodec.deserialize(node: JsonNode): LicenseAllocationPrice {
val json = JsonValue.fromJsonNode(node)
val modelType =
json.asObject().getOrNull()?.get("model_type")?.asString()?.getOrNull()
when (modelType) {
"unit" -> {
- return tryDeserialize(node, jacksonTypeRef())?.let {
- Price(unit = it, _json = json)
- } ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(unit = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"tiered" -> {
- return tryDeserialize(node, jacksonTypeRef())?.let {
- Price(tiered = it, _json = json)
- } ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(tiered = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"bulk" -> {
- return tryDeserialize(node, jacksonTypeRef())?.let {
- Price(bulk = it, _json = json)
- } ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(bulk = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"bulk_with_filters" -> {
return tryDeserialize(node, jacksonTypeRef())?.let {
- Price(bulkWithFilters = it, _json = json)
- } ?: Price(_json = json)
+ LicenseAllocationPrice(bulkWithFilters = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"package" -> {
- return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(package_ = it, _json = json) } ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(package_ = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"matrix" -> {
- return tryDeserialize(node, jacksonTypeRef())?.let {
- Price(matrix = it, _json = json)
- } ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(matrix = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"threshold_total_amount" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(thresholdTotalAmount = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(thresholdTotalAmount = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"tiered_package" -> {
- return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(tieredPackage = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(tieredPackage = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"tiered_with_minimum" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(tieredWithMinimum = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(tieredWithMinimum = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"grouped_tiered" -> {
- return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(groupedTiered = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(groupedTiered = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"tiered_package_with_minimum" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(tieredPackageWithMinimum = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(
+ tieredPackageWithMinimum = it,
+ _json = json,
+ )
+ } ?: LicenseAllocationPrice(_json = json)
}
"package_with_allocation" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(packageWithAllocation = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(packageWithAllocation = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"unit_with_percent" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(unitWithPercent = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(unitWithPercent = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"matrix_with_allocation" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(matrixWithAllocation = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(matrixWithAllocation = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"tiered_with_proration" -> {
return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(tieredWithProration = it, _json = json) }
- ?: Price(_json = json)
+ ?.let {
+ LicenseAllocationPrice(tieredWithProration = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"unit_with_proration" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(unitWithProration = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(unitWithProration = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"grouped_allocation" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(groupedAllocation = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(groupedAllocation = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"bulk_with_proration" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(bulkWithProration = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ LicenseAllocationPrice(bulkWithProration = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"grouped_with_prorated_minimum" -> {
return tryDeserialize(
node,
- jacksonTypeRef(),
+ jacksonTypeRef(),
)
- ?.let { Price(groupedWithProratedMinimum = it, _json = json) }
- ?: Price(_json = json)
+ ?.let {
+ LicenseAllocationPrice(
+ groupedWithProratedMinimum = it,
+ _json = json,
+ )
+ } ?: LicenseAllocationPrice(_json = json)
}
"grouped_with_metered_minimum" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(groupedWithMeteredMinimum = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(
+ groupedWithMeteredMinimum = it,
+ _json = json,
+ )
+ } ?: LicenseAllocationPrice(_json = json)
}
"grouped_with_min_max_thresholds" -> {
return tryDeserialize(
node,
jacksonTypeRef(),
)
- ?.let { Price(groupedWithMinMaxThresholds = it, _json = json) }
- ?: Price(_json = json)
+ ?.let {
+ LicenseAllocationPrice(
+ groupedWithMinMaxThresholds = it,
+ _json = json,
+ )
+ } ?: LicenseAllocationPrice(_json = json)
}
"matrix_with_display_name" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(matrixWithDisplayName = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(matrixWithDisplayName = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"grouped_tiered_package" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(groupedTieredPackage = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(groupedTieredPackage = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"max_group_tiered_package" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(maxGroupTieredPackage = it, _json = json) }
- ?: Price(_json = json)
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ LicenseAllocationPrice(maxGroupTieredPackage = it, _json = json)
+ } ?: LicenseAllocationPrice(_json = json)
}
"scalable_matrix_with_unit_pricing" -> {
return tryDeserialize(
node,
- jacksonTypeRef(),
+ jacksonTypeRef