diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0837041f..fd41c586 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,7 +14,7 @@ on:
jobs:
lint:
- timeout-minutes: 10
+ timeout-minutes: 15
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/orb-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
@@ -36,8 +36,33 @@ jobs:
- name: Run lints
run: ./scripts/lint
+
+ build:
+ timeout-minutes: 15
+ name: build
+ runs-on: ${{ github.repository == 'stainless-sdks/orb-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Java
+ uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: |
+ 8
+ 21
+ cache: gradle
+
+ - name: Set up Gradle
+ uses: gradle/actions/setup-gradle@v4
+
+ - name: Build SDK
+ run: ./scripts/build
+
test:
- timeout-minutes: 10
+ timeout-minutes: 15
name: test
runs-on: ${{ github.repository == 'stainless-sdks/orb-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
index 9875f43e..eab3bf49 100644
--- a/.github/workflows/publish-sonatype.yml
+++ b/.github/workflows/publish-sonatype.yml
@@ -22,7 +22,7 @@ jobs:
distribution: temurin
java-version: |
8
- 17
+ 21
cache: gradle
- name: Set up Gradle
@@ -33,7 +33,7 @@ jobs:
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
- ./gradlew publishAndReleaseToMavenCentral -Dorg.gradle.jvmargs="-Xmx8g" --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
+ ./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
env:
SONATYPE_USERNAME: ${{ secrets.ORB_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.ORB_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
diff --git a/.gitignore b/.gitignore
index 4e81838d..b1346e6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,6 @@
.gradle
.idea
.kotlin
-build
+build/
codegen.log
kls_database.db
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index c3c95522..eb4e0dba 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "1.9.0"
+ ".": "1.10.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index c03739d1..3407ffd1 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 118
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4f31d46f5ba187fc4d702c9f9f1573dacb891edbd086f935707578d7c4f5fed8.yml
-openapi_spec_hash: 25b1019f20a47b8af665aae5f8fd0025
-config_hash: 5135e9237207028f293049a77428c775
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-b070c1d97a6e3b400f43d2bce36c22ed89d432345b26374728c55dd0a20f0afa.yml
+openapi_spec_hash: dba4ff52c381cda6159fc56d8b77eb32
+config_hash: 1f73a949b649ecfe6ec68ba1bb459dc2
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a326cfbd..ec0b9223 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,56 @@
# Changelog
+## 1.10.0 (2025-10-07)
+
+Full Changelog: [v1.9.0...v1.10.0](https://github.com/orbcorp/orb-java/compare/v1.9.0...v1.10.0)
+
+### ⚠ BREAKING CHANGES
+
+* **api:** define shared model ConversionRateConfig
+
+### Features
+
+* add retryable exception ([cf6742e](https://github.com/orbcorp/orb-java/commit/cf6742e0ace7ef26c53fdf1c6ead9f742a326094))
+* **api:** api update ([ab79480](https://github.com/orbcorp/orb-java/commit/ab794808febc46a53d5baf1e41f0ad7b1ab8d1df))
+* **api:** api update ([0f4e585](https://github.com/orbcorp/orb-java/commit/0f4e5853aab9546952e9d80b4c2e50688a8caf6d))
+* **api:** api update ([617892e](https://github.com/orbcorp/orb-java/commit/617892e6526e1717415bfa630529ffce50a70b96))
+* **api:** api update ([bf412bc](https://github.com/orbcorp/orb-java/commit/bf412bca3a157a0e41fef19a5d915c095b09eda1))
+* **api:** api update ([6aa1d53](https://github.com/orbcorp/orb-java/commit/6aa1d5370247b08c937ca7faa9fcacf5b21ed081))
+* **api:** api update ([321aa41](https://github.com/orbcorp/orb-java/commit/321aa4197ce9dbc8601ec7578d0f70017e37c2f6))
+* **api:** api update ([cf6fd19](https://github.com/orbcorp/orb-java/commit/cf6fd1990dc2781ebc0ab860b135ce4b90a58fa2))
+* **api:** api update ([9c8977c](https://github.com/orbcorp/orb-java/commit/9c8977c14697c4907f13e29189a62c2aea441924))
+* **api:** api update ([247937e](https://github.com/orbcorp/orb-java/commit/247937ebe3dba64b53c180a9a58460e10cde4a8c))
+* **api:** api update ([5d00bf2](https://github.com/orbcorp/orb-java/commit/5d00bf2a8be3610043bbd620eb724d13788fc89a))
+* **api:** api update ([05b6a4e](https://github.com/orbcorp/orb-java/commit/05b6a4e2d2e551b8b09168d2a8d6e34851fcd784))
+* **api:** api update ([3b2489b](https://github.com/orbcorp/orb-java/commit/3b2489bdb730033a389ec76cc824df8eb351c678))
+* **api:** api update ([e90f837](https://github.com/orbcorp/orb-java/commit/e90f837c716a2fe6955df54c844b4320a1a26d8b))
+* **api:** define shared model ConversionRateConfig ([13fc2ef](https://github.com/orbcorp/orb-java/commit/13fc2efb464953fc534dbd09ed34b003c17a3d0d))
+* **client:** ensure compat with proguard ([83ddd55](https://github.com/orbcorp/orb-java/commit/83ddd55a2e265b3f2426f47868bc5a596509e3a8))
+* **client:** expose sleeper option ([427df35](https://github.com/orbcorp/orb-java/commit/427df355df00bafcdb972fbfb758f7cb0646aab6))
+* extract minimum composite to type ([3e25650](https://github.com/orbcorp/orb-java/commit/3e256505b03e771aef66c8a435f27a6ec3b9e237))
+
+
+### Bug Fixes
+
+* **ci:** use java-version 21 for publish step ([b290b3a](https://github.com/orbcorp/orb-java/commit/b290b3a558d6f1b4419975855a22c0f0b8b055e2))
+* **client:** deserialization of empty objects ([1764089](https://github.com/orbcorp/orb-java/commit/1764089476594bd942efe77f15d4744e6c0a01dd))
+* **client:** ensure single timer is created per client ([427df35](https://github.com/orbcorp/orb-java/commit/427df355df00bafcdb972fbfb758f7cb0646aab6))
+* **client:** incorrect `getPackageVersion` impl ([9bc6ac9](https://github.com/orbcorp/orb-java/commit/9bc6ac99cc3a432ddc30f43dda41d076f4197883))
+* **client:** r8 support ([27da721](https://github.com/orbcorp/orb-java/commit/27da7219bb085292eba8cf247a8574689f922300))
+
+
+### Chores
+
+* fix formatting ([a6e527f](https://github.com/orbcorp/orb-java/commit/a6e527f946e40ebbfebc97c4eaeec1900845197a))
+* improve formatter performance ([5d37bc1](https://github.com/orbcorp/orb-java/commit/5d37bc171ae17fbfb70c63743afde6b04e29ff1c))
+* **internal:** bump ci test timeout ([0e68dd4](https://github.com/orbcorp/orb-java/commit/0e68dd443b79c48810c94749f88cfc2d9286a725))
+* **internal:** change some comment formatting ([7e80bfe](https://github.com/orbcorp/orb-java/commit/7e80bfeb93b40dc060dd5947e8e37d4fb68a4955))
+* **internal:** codegen related update ([97bd293](https://github.com/orbcorp/orb-java/commit/97bd293da263a5259bac93d2f9d9aeb0f10d5c65))
+* **internal:** codegen related update ([3a4300a](https://github.com/orbcorp/orb-java/commit/3a4300ae19b4ad4c9f82056658d88013a35c992e))
+* **internal:** codegen related update ([185acb8](https://github.com/orbcorp/orb-java/commit/185acb801fe845d8b33f741e1e1f1e07550fd92f))
+* **internal:** codegen related update ([76d269d](https://github.com/orbcorp/orb-java/commit/76d269d0cba09f1150af878d603292b92e003241))
+* **internal:** reduce proguard ci logging ([9b4d208](https://github.com/orbcorp/orb-java/commit/9b4d20849c0af2b5945f155aad5a91c338020f56))
+
## 1.9.0 (2025-07-26)
Full Changelog: [v1.8.0...v1.9.0](https://github.com/orbcorp/orb-java/compare/v1.8.0...v1.9.0)
diff --git a/README.md b/README.md
index b0b339ee..195b519a 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/1.9.0)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/1.10.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.9.0")
+implementation("com.withorb.api:orb-java:1.10.0")
```
### Maven
@@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:1.9.0")
com.withorb.api
orb-java
- 1.9.0
+ 1.10.0
```
@@ -231,6 +231,8 @@ The SDK throws custom unchecked exception types:
- [`OrbIoException`](orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbIoException.kt): I/O networking errors.
+- [`OrbRetryableException`](orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbRetryableException.kt): Generic error indicating a failure that could be retried by the client.
+
- [`OrbInvalidDataException`](orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response.
- [`OrbException`](orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.
@@ -361,6 +363,12 @@ both of which will raise an error if the signature is invalid.
Note that the `body` parameter must be the raw JSON string sent from the server (do not parse it first).
The `.unwrap()` method can parse this JSON for you.
+## ProGuard and R8
+
+Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `orb-java-core` is published with a [configuration file](orb-java-core/src/main/resources/META-INF/proguard/orb-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).
+
+ProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.
+
## Jackson
The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.
diff --git a/build.gradle.kts b/build.gradle.kts
index 961c7eab..8e1585b2 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,16 @@
allprojects {
group = "com.withorb.api"
- version = "1.9.0" // x-release-please-version
+ version = "1.10.0" // x-release-please-version
+}
+
+subprojects {
+ // These are populated with dependencies by `buildSrc` scripts.
+ tasks.register("format") {
+ group = "Verification"
+ description = "Formats all source files."
+ }
+ tasks.register("lint") {
+ group = "Verification"
+ description = "Verifies all source files are formatted."
+ }
}
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index 778c89de..c6dc92ec 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -10,7 +10,6 @@ repositories {
}
dependencies {
- implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
diff --git a/buildSrc/src/main/kotlin/orb.java.gradle.kts b/buildSrc/src/main/kotlin/orb.java.gradle.kts
index dfbacb86..70fc33f4 100644
--- a/buildSrc/src/main/kotlin/orb.java.gradle.kts
+++ b/buildSrc/src/main/kotlin/orb.java.gradle.kts
@@ -1,24 +1,13 @@
-import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
`java-library`
- id("com.diffplug.spotless")
}
repositories {
mavenCentral()
}
-configure {
- java {
- importOrder()
- removeUnusedImports()
- palantirJavaFormat()
- toggleOffOn()
- }
-}
-
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
@@ -53,3 +42,86 @@ tasks.withType().configureEach {
exceptionFormat = TestExceptionFormat.FULL
}
}
+
+val palantir by configurations.creating
+dependencies {
+ palantir("com.palantir.javaformat:palantir-java-format:2.73.0")
+}
+
+fun registerPalantir(
+ name: String,
+ description: String,
+) {
+ val javaName = "${name}Java"
+ tasks.register(javaName) {
+ group = "Verification"
+ this.description = description
+
+ classpath = palantir
+ mainClass = "com.palantir.javaformat.java.Main"
+
+ // Avoid an `IllegalAccessError` on Java 9+.
+ jvmArgs(
+ "--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
+ "--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED",
+ "--add-exports", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED",
+ "--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
+ "--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
+ )
+
+ // Use paths relative to the current module.
+ val argumentFile =
+ project.layout.buildDirectory.file("palantir-$name-args.txt").get().asFile
+ val lastRunTimeFile =
+ project.layout.buildDirectory.file("palantir-$name-last-run.txt").get().asFile
+
+ // Read the time when this task was last executed for this module (if ever).
+ val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L
+
+ // Use a `fileTree` relative to the module's source directory.
+ val javaFiles = project.fileTree("src") { include("**/*.java") }
+
+ // Determine if any files need to be formatted or linted and continue only if there is at least
+ // one file.
+ onlyIf { javaFiles.any { it.lastModified() > lastRunTime } }
+
+ inputs.files(javaFiles)
+
+ doFirst {
+ // Create the argument file and set the preferred formatting style.
+ argumentFile.parentFile.mkdirs()
+ argumentFile.writeText("--palantir\n")
+
+ if (name == "lint") {
+ // For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of
+ // the default 0) if any files need to be formatted, indicating that linting has failed.
+ argumentFile.appendText("--dry-run\n")
+ argumentFile.appendText("--set-exit-if-changed\n")
+ } else {
+ // `--dry-run` and `--replace` (for in-place formatting) are mutually exclusive.
+ argumentFile.appendText("--replace\n")
+ }
+
+ // Write the modified files to the argument file.
+ javaFiles.filter { it.lastModified() > lastRunTime }
+ .forEach { argumentFile.appendText("${it.absolutePath}\n") }
+ }
+
+ doLast {
+ // Record the last execution time for later up-to-date checking.
+ lastRunTimeFile.writeText(System.currentTimeMillis().toString())
+ }
+
+ // Pass the argument file using the @ symbol
+ args = listOf("@${argumentFile.absolutePath}")
+
+ outputs.upToDateWhen { javaFiles.none { it.lastModified() > lastRunTime } }
+ }
+
+ tasks.named(name) {
+ dependsOn(tasks.named(javaName))
+ }
+}
+
+registerPalantir(name = "format", description = "Formats all Java source files.")
+registerPalantir(name = "lint", description = "Verifies all Java source files are formatted.")
diff --git a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
index 2d4a5c55..b908b3be 100644
--- a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
+++ b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
@@ -1,4 +1,3 @@
-import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
@@ -7,6 +6,10 @@ plugins {
kotlin("jvm")
}
+repositories {
+ mavenCentral()
+}
+
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
@@ -27,14 +30,77 @@ kotlin {
}
}
-configure {
- kotlin {
- ktfmt().kotlinlangStyle()
- toggleOffOn()
- }
-}
-
tasks.withType().configureEach {
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
}
+
+val ktfmt by configurations.creating
+dependencies {
+ ktfmt("com.facebook:ktfmt:0.56")
+}
+
+fun registerKtfmt(
+ name: String,
+ description: String,
+) {
+ val kotlinName = "${name}Kotlin"
+ tasks.register(kotlinName) {
+ group = "Verification"
+ this.description = description
+
+ classpath = ktfmt
+ mainClass = "com.facebook.ktfmt.cli.Main"
+
+ // Use paths relative to the current module.
+ val argumentFile = project.layout.buildDirectory.file("ktfmt-$name-args.txt").get().asFile
+ val lastRunTimeFile =
+ project.layout.buildDirectory.file("ktfmt-$name-last-run.txt").get().asFile
+
+ // Read the time when this task was last executed for this module (if ever).
+ val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L
+
+ // Use a `fileTree` relative to the module's source directory.
+ val kotlinFiles = project.fileTree("src") { include("**/*.kt") }
+
+ // Determine if any files need to be formatted or linted and continue only if there is at least
+ // one file (otherwise Ktfmt will fail).
+ onlyIf { kotlinFiles.any { it.lastModified() > lastRunTime } }
+
+ inputs.files(kotlinFiles)
+
+ doFirst {
+ // Create the argument file and set the preferred formatting style.
+ argumentFile.parentFile.mkdirs()
+ argumentFile.writeText("--kotlinlang-style\n")
+
+ if (name == "lint") {
+ // For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of
+ // the default 0) if any files need to be formatted, indicating that linting has failed.
+ argumentFile.appendText("--dry-run\n")
+ argumentFile.appendText("--set-exit-if-changed\n")
+ }
+
+ // Write the modified files to the argument file.
+ kotlinFiles.filter { it.lastModified() > lastRunTime }
+ .forEach { argumentFile.appendText("${it.absolutePath}\n") }
+ }
+
+ doLast {
+ // Record the last execution time for later up-to-date checking.
+ lastRunTimeFile.writeText(System.currentTimeMillis().toString())
+ }
+
+ // Pass the argument file using the @ symbol
+ args = listOf("@${argumentFile.absolutePath}")
+
+ outputs.upToDateWhen { kotlinFiles.none { it.lastModified() > lastRunTime } }
+ }
+
+ tasks.named(name) {
+ dependsOn(tasks.named(kotlinName))
+ }
+}
+
+registerKtfmt(name = "format", description = "Formats all Kotlin source files.")
+registerKtfmt(name = "lint", description = "Verifies all Kotlin source files are formatted.")
diff --git a/gradle.properties b/gradle.properties
index ff76593f..6680f9ce 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,12 +4,13 @@ org.gradle.parallel=true
org.gradle.daemon=false
# These options improve our compilation and test performance. They are inherited by the Kotlin daemon.
org.gradle.jvmargs=\
- -Xms1g \
- -Xmx4g \
+ -Xms2g \
+ -Xmx8g \
-XX:+UseParallelGC \
-XX:InitialCodeCacheSize=256m \
-XX:ReservedCodeCacheSize=1G \
- -XX:MetaspaceSize=256m \
+ -XX:MetaspaceSize=512m \
+ -XX:MaxMetaspaceSize=2G \
-XX:TieredStopAtLevel=1 \
-XX:GCTimeRatio=4 \
-XX:CICompilerCount=4 \
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 931e530c..a3fd603e 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
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.withorb.api.client.OrbClient
import com.withorb.api.client.OrbClientImpl
import com.withorb.api.core.ClientOptions
+import com.withorb.api.core.Sleeper
import com.withorb.api.core.Timeout
import com.withorb.api.core.http.AsyncStreamResponse
import com.withorb.api.core.http.Headers
@@ -126,11 +127,24 @@ class OrbOkHttpClient private constructor() {
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
+ *
+ * This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
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 7c2423c7..88bdd9fe 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
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.withorb.api.client.OrbClientAsync
import com.withorb.api.client.OrbClientAsyncImpl
import com.withorb.api.core.ClientOptions
+import com.withorb.api.core.Sleeper
import com.withorb.api.core.Timeout
import com.withorb.api.core.http.AsyncStreamResponse
import com.withorb.api.core.http.Headers
@@ -126,11 +127,24 @@ class OrbOkHttpClientAsync private constructor() {
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
+ *
+ * This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
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 fa0e22b0..4023c67f 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
@@ -153,7 +153,7 @@ class OrbClientAsyncImpl(private val clientOptions: ClientOptions) : OrbClientAs
override fun subscriptionChanges(): SubscriptionChangeServiceAsync = subscriptionChanges
- override fun close() = clientOptions.httpClient.close()
+ override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
OrbClientAsync.WithRawResponse {
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 e3671e40..d086412a 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
@@ -146,7 +146,7 @@ class OrbClientImpl(private val clientOptions: ClientOptions) : OrbClient {
override fun subscriptionChanges(): SubscriptionChangeService = subscriptionChanges
- override fun close() = clientOptions.httpClient.close()
+ override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
OrbClient.WithRawResponse {
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 b2464f27..cd66b87c 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
@@ -13,6 +13,7 @@ import java.time.Clock
import java.time.Duration
import java.util.Optional
import java.util.concurrent.Executor
+import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.ThreadFactory
import java.util.concurrent.atomic.AtomicLong
@@ -26,6 +27,8 @@ private constructor(
* The HTTP client to use in the SDK.
*
* Use the one published in `orb-java-client-okhttp` or implement your own.
+ *
+ * This class takes ownership of the client and closes it when closed.
*/
@get:JvmName("httpClient") val httpClient: HttpClient,
/**
@@ -47,8 +50,20 @@ private constructor(
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
+ *
+ * This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
@get:JvmName("streamHandlerExecutor") val streamHandlerExecutor: Executor,
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ @get:JvmName("sleeper") val sleeper: Sleeper,
/**
* The clock to use for operations that require timing, like retries.
*
@@ -143,6 +158,7 @@ private constructor(
private var checkJacksonVersionCompatibility: Boolean = true
private var jsonMapper: JsonMapper = jsonMapper()
private var streamHandlerExecutor: Executor? = null
+ private var sleeper: Sleeper? = null
private var clock: Clock = Clock.systemUTC()
private var baseUrl: String? = null
private var headers: Headers.Builder = Headers.builder()
@@ -159,6 +175,7 @@ private constructor(
checkJacksonVersionCompatibility = clientOptions.checkJacksonVersionCompatibility
jsonMapper = clientOptions.jsonMapper
streamHandlerExecutor = clientOptions.streamHandlerExecutor
+ sleeper = clientOptions.sleeper
clock = clientOptions.clock
baseUrl = clientOptions.baseUrl
headers = clientOptions.headers.toBuilder()
@@ -174,6 +191,8 @@ private constructor(
* The HTTP client to use in the SDK.
*
* Use the one published in `orb-java-client-okhttp` or implement your own.
+ *
+ * This class takes ownership of the client and closes it when closed.
*/
fun httpClient(httpClient: HttpClient) = apply {
this.httpClient = PhantomReachableClosingHttpClient(httpClient)
@@ -202,11 +221,27 @@ private constructor(
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
+ *
+ * This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
- this.streamHandlerExecutor = streamHandlerExecutor
+ this.streamHandlerExecutor =
+ if (streamHandlerExecutor is ExecutorService)
+ PhantomReachableExecutorService(streamHandlerExecutor)
+ else streamHandlerExecutor
}
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { this.sleeper = PhantomReachableSleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
@@ -398,6 +433,25 @@ private constructor(
*/
fun build(): ClientOptions {
val httpClient = checkRequired("httpClient", httpClient)
+ val streamHandlerExecutor =
+ streamHandlerExecutor
+ ?: PhantomReachableExecutorService(
+ Executors.newCachedThreadPool(
+ object : ThreadFactory {
+
+ private val threadFactory: ThreadFactory =
+ Executors.defaultThreadFactory()
+ private val count = AtomicLong(0)
+
+ override fun newThread(runnable: Runnable): Thread =
+ threadFactory.newThread(runnable).also {
+ it.name =
+ "orb-stream-handler-thread-${count.getAndIncrement()}"
+ }
+ }
+ )
+ )
+ val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper())
val apiKey = checkRequired("apiKey", apiKey)
val headers = Headers.builder()
@@ -421,26 +475,15 @@ private constructor(
httpClient,
RetryingHttpClient.builder()
.httpClient(httpClient)
+ .sleeper(sleeper)
.clock(clock)
.maxRetries(maxRetries)
.idempotencyHeader("Idempotency-Key")
.build(),
checkJacksonVersionCompatibility,
jsonMapper,
- streamHandlerExecutor
- ?: Executors.newCachedThreadPool(
- object : ThreadFactory {
-
- private val threadFactory: ThreadFactory =
- Executors.defaultThreadFactory()
- private val count = AtomicLong(0)
-
- override fun newThread(runnable: Runnable): Thread =
- threadFactory.newThread(runnable).also {
- it.name = "orb-stream-handler-thread-${count.getAndIncrement()}"
- }
- }
- ),
+ streamHandlerExecutor,
+ sleeper,
clock,
baseUrl,
headers.build(),
@@ -453,4 +496,20 @@ private constructor(
)
}
}
+
+ /**
+ * Closes these client options, relinquishing any underlying resources.
+ *
+ * This is purposefully not inherited from [AutoCloseable] because the client options are
+ * long-lived and usually should not be synchronously closed via try-with-resources.
+ *
+ * It's also usually not necessary to call this method at all. the default client automatically
+ * releases threads and connections if they remain idle, but if you are writing an application
+ * that needs to aggressively release unused resources, then you may call this method.
+ */
+ fun close() {
+ httpClient.close()
+ (streamHandlerExecutor as? ExecutorService)?.shutdown()
+ sleeper.close()
+ }
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/DefaultSleeper.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/DefaultSleeper.kt
new file mode 100644
index 00000000..f80d7686
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/DefaultSleeper.kt
@@ -0,0 +1,28 @@
+package com.withorb.api.core
+
+import java.time.Duration
+import java.util.Timer
+import java.util.TimerTask
+import java.util.concurrent.CompletableFuture
+
+class DefaultSleeper : Sleeper {
+
+ private val timer = Timer("DefaultSleeper", true)
+
+ override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis())
+
+ override fun sleepAsync(duration: Duration): CompletableFuture {
+ val future = CompletableFuture()
+ timer.schedule(
+ object : TimerTask() {
+ override fun run() {
+ future.complete(null)
+ }
+ },
+ duration.toMillis(),
+ )
+ return future
+ }
+
+ override fun close() = timer.cancel()
+}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/PhantomReachableExecutorService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/PhantomReachableExecutorService.kt
new file mode 100644
index 00000000..b4617be2
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/PhantomReachableExecutorService.kt
@@ -0,0 +1,58 @@
+package com.withorb.api.core
+
+import java.util.concurrent.Callable
+import java.util.concurrent.ExecutorService
+import java.util.concurrent.Future
+import java.util.concurrent.TimeUnit
+
+/**
+ * A delegating wrapper around an [ExecutorService] that shuts it down once it's only phantom
+ * reachable.
+ *
+ * This class ensures the [ExecutorService] is shut down even if the user forgets to do it.
+ */
+internal class PhantomReachableExecutorService(private val executorService: ExecutorService) :
+ ExecutorService {
+ init {
+ closeWhenPhantomReachable(this) { executorService.shutdown() }
+ }
+
+ override fun execute(command: Runnable) = executorService.execute(command)
+
+ override fun shutdown() = executorService.shutdown()
+
+ override fun shutdownNow(): MutableList = executorService.shutdownNow()
+
+ override fun isShutdown(): Boolean = executorService.isShutdown
+
+ override fun isTerminated(): Boolean = executorService.isTerminated
+
+ override fun awaitTermination(timeout: Long, unit: TimeUnit): Boolean =
+ executorService.awaitTermination(timeout, unit)
+
+ override fun submit(task: Callable): Future = executorService.submit(task)
+
+ override fun submit(task: Runnable, result: T): Future =
+ executorService.submit(task, result)
+
+ override fun submit(task: Runnable): Future<*> = executorService.submit(task)
+
+ override fun invokeAll(
+ tasks: MutableCollection>
+ ): MutableList> = executorService.invokeAll(tasks)
+
+ override fun invokeAll(
+ tasks: MutableCollection>,
+ timeout: Long,
+ unit: TimeUnit,
+ ): MutableList> = executorService.invokeAll(tasks, timeout, unit)
+
+ override fun invokeAny(tasks: MutableCollection>): T =
+ executorService.invokeAny(tasks)
+
+ override fun invokeAny(
+ tasks: MutableCollection>,
+ timeout: Long,
+ unit: TimeUnit,
+ ): T = executorService.invokeAny(tasks, timeout, unit)
+}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/PhantomReachableSleeper.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/PhantomReachableSleeper.kt
new file mode 100644
index 00000000..32a73ac1
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/PhantomReachableSleeper.kt
@@ -0,0 +1,23 @@
+package com.withorb.api.core
+
+import java.time.Duration
+import java.util.concurrent.CompletableFuture
+
+/**
+ * A delegating wrapper around a [Sleeper] that closes it once it's only phantom reachable.
+ *
+ * This class ensures the [Sleeper] is closed even if the user forgets to do it.
+ */
+internal class PhantomReachableSleeper(private val sleeper: Sleeper) : Sleeper {
+
+ init {
+ closeWhenPhantomReachable(this, sleeper)
+ }
+
+ override fun sleep(duration: Duration) = sleeper.sleep(duration)
+
+ override fun sleepAsync(duration: Duration): CompletableFuture =
+ sleeper.sleepAsync(duration)
+
+ override fun close() = sleeper.close()
+}
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 9045e4db..f0f63ba4 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
@@ -2,7 +2,7 @@
package com.withorb.api.core
-import java.util.Properties
+import com.withorb.api.client.OrbClient
fun getOsArch(): String {
val osArch = System.getProperty("os.arch")
@@ -16,7 +16,7 @@ fun getOsArch(): String {
"x86_64" -> "x64"
"arm" -> "arm"
"aarch64" -> "arm64"
- else -> "other:${osArch}"
+ else -> "other:$osArch"
}
}
@@ -30,13 +30,12 @@ fun getOsName(): String {
osName.startsWith("Linux") -> "Linux"
osName.startsWith("Mac OS") -> "MacOS"
osName.startsWith("Windows") -> "Windows"
- else -> "Other:${osName}"
+ else -> "Other:$osName"
}
}
fun getOsVersion(): String = System.getProperty("os.version", "unknown")
-fun getPackageVersion(): String =
- Properties::class.java.`package`.implementationVersion ?: "unknown"
+fun getPackageVersion(): String = OrbClient::class.java.`package`.implementationVersion ?: "unknown"
fun getJavaVersion(): String = System.getProperty("java.version", "unknown")
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/Sleeper.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/Sleeper.kt
new file mode 100644
index 00000000..a10a12ea
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/Sleeper.kt
@@ -0,0 +1,21 @@
+package com.withorb.api.core
+
+import java.time.Duration
+import java.util.concurrent.CompletableFuture
+
+/**
+ * An interface for delaying execution for a specified amount of time.
+ *
+ * Useful for testing and cleaning up resources.
+ */
+interface Sleeper : AutoCloseable {
+
+ /** Synchronously pauses execution for the given [duration]. */
+ fun sleep(duration: Duration)
+
+ /** Asynchronously pauses execution for the given [duration]. */
+ fun sleepAsync(duration: Duration): CompletableFuture
+
+ /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
+ override fun close()
+}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/Timeout.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/Timeout.kt
index 182de0a9..0da3dbe9 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/Timeout.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/Timeout.kt
@@ -157,10 +157,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is Timeout && connect == other.connect && read == other.read && write == other.write && request == other.request /* spotless:on */
+ return other is Timeout &&
+ connect == other.connect &&
+ read == other.read &&
+ write == other.write &&
+ request == other.request
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(connect, read, write, request) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(connect, read, write, request)
override fun toString() =
"Timeout{connect=$connect, read=$read, write=$write, request=$request}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/Utils.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/Utils.kt
index e0ad480d..c392401d 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/core/Utils.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/Utils.kt
@@ -6,6 +6,8 @@ import com.withorb.api.core.http.Headers
import com.withorb.api.errors.OrbInvalidDataException
import java.util.Collections
import java.util.SortedMap
+import java.util.concurrent.CompletableFuture
+import java.util.concurrent.locks.Lock
@JvmSynthetic
internal fun T?.getOrThrow(name: String): T =
@@ -95,3 +97,24 @@ internal fun Headers.getRequiredHeader(name: String): String =
values(name).firstOrNull() ?: throw OrbInvalidDataException("Could not find $name header")
internal interface Enum
+
+/**
+ * Executes the given [action] while holding the lock, returning a [CompletableFuture] with the
+ * result.
+ *
+ * @param action The asynchronous action to execute while holding the lock
+ * @return A [CompletableFuture] that completes with the result of the action
+ */
+@JvmSynthetic
+internal fun Lock.withLockAsync(action: () -> CompletableFuture): CompletableFuture {
+ lock()
+ val future =
+ try {
+ action()
+ } catch (e: Throwable) {
+ unlock()
+ throw e
+ }
+ future.whenComplete { _, _ -> unlock() }
+ return future
+}
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 cba6f15b..e53177d2 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,8 +1,11 @@
package com.withorb.api.core.http
+import com.withorb.api.core.DefaultSleeper
import com.withorb.api.core.RequestOptions
+import com.withorb.api.core.Sleeper
import com.withorb.api.core.checkRequired
import com.withorb.api.errors.OrbIoException
+import com.withorb.api.errors.OrbRetryableException
import java.io.IOException
import java.time.Clock
import java.time.Duration
@@ -10,8 +13,6 @@ import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeParseException
import java.time.temporal.ChronoUnit
-import java.util.Timer
-import java.util.TimerTask
import java.util.UUID
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ThreadLocalRandom
@@ -129,7 +130,10 @@ private constructor(
return executeWithRetries(modifiedRequest, requestOptions)
}
- override fun close() = httpClient.close()
+ override fun close() {
+ httpClient.close()
+ sleeper.close()
+ }
private fun isRetryable(request: HttpRequest): Boolean =
// Some requests, such as when a request body is being streamed, cannot be retried because
@@ -176,9 +180,10 @@ private constructor(
}
private fun shouldRetry(throwable: Throwable): Boolean =
- // Only retry IOException and OrbIoException, other exceptions are not intended to be
- // retried.
- throwable is IOException || throwable is OrbIoException
+ // Only retry known retryable exceptions, other exceptions are not intended to be retried.
+ throwable is IOException ||
+ throwable is OrbIoException ||
+ throwable is OrbRetryableException
private fun getRetryBackoffDuration(retries: Int, response: HttpResponse?): Duration {
// About the Retry-After header:
@@ -233,33 +238,14 @@ private constructor(
class Builder internal constructor() {
private var httpClient: HttpClient? = null
- private var sleeper: Sleeper =
- object : Sleeper {
-
- private val timer = Timer("RetryingHttpClient", true)
-
- override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis())
-
- override fun sleepAsync(duration: Duration): CompletableFuture {
- val future = CompletableFuture()
- timer.schedule(
- object : TimerTask() {
- override fun run() {
- future.complete(null)
- }
- },
- duration.toMillis(),
- )
- return future
- }
- }
+ private var sleeper: Sleeper? = null
private var clock: Clock = Clock.systemUTC()
private var maxRetries: Int = 2
private var idempotencyHeader: String? = null
fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient }
- @JvmSynthetic internal fun sleeper(sleeper: Sleeper) = apply { this.sleeper = sleeper }
+ fun sleeper(sleeper: Sleeper) = apply { this.sleeper = sleeper }
fun clock(clock: Clock) = apply { this.clock = clock }
@@ -270,17 +256,10 @@ private constructor(
fun build(): HttpClient =
RetryingHttpClient(
checkRequired("httpClient", httpClient),
- sleeper,
+ sleeper ?: DefaultSleeper(),
clock,
maxRetries,
idempotencyHeader,
)
}
-
- internal interface Sleeper {
-
- fun sleep(duration: Duration)
-
- fun sleepAsync(duration: Duration): CompletableFuture
- }
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbRetryableException.kt b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbRetryableException.kt
new file mode 100644
index 00000000..61061c4e
--- /dev/null
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbRetryableException.kt
@@ -0,0 +1,14 @@
+package com.withorb.api.errors
+
+/**
+ * Exception that indicates a transient error that can be retried.
+ *
+ * When this exception is thrown during an HTTP request, the SDK will automatically retry the
+ * request up to the maximum number of retries.
+ *
+ * @param message A descriptive error message
+ * @param cause The underlying cause of this exception, if any
+ */
+class OrbRetryableException
+@JvmOverloads
+constructor(message: String? = null, cause: Throwable? = null) : OrbException(message, cause)
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AccountingProviderConfig.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AccountingProviderConfig.kt
index 9b5fa1d3..bfbf6c22 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AccountingProviderConfig.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AccountingProviderConfig.kt
@@ -16,6 +16,7 @@ import java.util.Collections
import java.util.Objects
class AccountingProviderConfig
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val externalProviderId: JsonField,
private val providerType: JsonField,
@@ -205,12 +206,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is AccountingProviderConfig && externalProviderId == other.externalProviderId && providerType == other.providerType && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AccountingProviderConfig &&
+ externalProviderId == other.externalProviderId &&
+ providerType == other.providerType &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(externalProviderId, providerType, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(externalProviderId, providerType, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Address.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Address.kt
index 9ddf4805..de9c14ae 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Address.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Address.kt
@@ -18,6 +18,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class Address
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val city: JsonField,
private val country: JsonField,
@@ -340,12 +341,19 @@ private constructor(
return true
}
- return /* spotless:off */ other is Address && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Address &&
+ city == other.city &&
+ country == other.country &&
+ line1 == other.line1 &&
+ line2 == other.line2 &&
+ postalCode == other.postalCode &&
+ state == other.state &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AddressInput.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AddressInput.kt
index 25b700c0..9dbc4e7f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AddressInput.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AddressInput.kt
@@ -17,6 +17,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AddressInput
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val city: JsonField,
private val country: JsonField,
@@ -315,12 +316,19 @@ private constructor(
return true
}
- return /* spotless:off */ other is AddressInput && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AddressInput &&
+ city == other.city &&
+ country == other.country &&
+ line1 == other.line1 &&
+ line2 == other.line2 &&
+ postalCode == other.postalCode &&
+ state == other.state &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AdjustmentInterval.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AdjustmentInterval.kt
index 7fe9f69e..17115a57 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AdjustmentInterval.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AdjustmentInterval.kt
@@ -31,6 +31,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AdjustmentInterval
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val adjustment: JsonField,
@@ -512,10 +513,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Adjustment && usageDiscount == other.usageDiscount && amountDiscount == other.amountDiscount && percentageDiscount == other.percentageDiscount && minimum == other.minimum && maximum == other.maximum /* spotless:on */
+ return other is Adjustment &&
+ usageDiscount == other.usageDiscount &&
+ amountDiscount == other.amountDiscount &&
+ percentageDiscount == other.percentageDiscount &&
+ minimum == other.minimum &&
+ maximum == other.maximum
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(usageDiscount, amountDiscount, percentageDiscount, minimum, maximum) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(usageDiscount, amountDiscount, percentageDiscount, minimum, maximum)
override fun toString(): String =
when {
@@ -655,12 +662,25 @@ private constructor(
return true
}
- return /* spotless:off */ other is AdjustmentInterval && id == other.id && adjustment == other.adjustment && appliesToPriceIntervalIds == other.appliesToPriceIntervalIds && endDate == other.endDate && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AdjustmentInterval &&
+ id == other.id &&
+ adjustment == other.adjustment &&
+ appliesToPriceIntervalIds == other.appliesToPriceIntervalIds &&
+ endDate == other.endDate &&
+ startDate == other.startDate &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, adjustment, appliesToPriceIntervalIds, endDate, startDate, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ id,
+ adjustment,
+ appliesToPriceIntervalIds,
+ endDate,
+ startDate,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AffectedBlock.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AffectedBlock.kt
index ab3de315..28826e15 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AffectedBlock.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AffectedBlock.kt
@@ -19,6 +19,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AffectedBlock
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val expiryDate: JsonField,
@@ -247,12 +248,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is AffectedBlock && id == other.id && expiryDate == other.expiryDate && perUnitCostBasis == other.perUnitCostBasis && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AffectedBlock &&
+ id == other.id &&
+ expiryDate == other.expiryDate &&
+ perUnitCostBasis == other.perUnitCostBasis &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, expiryDate, perUnitCostBasis, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(id, expiryDate, perUnitCostBasis, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AggregatedCost.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AggregatedCost.kt
index 06198fab..132a3db8 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AggregatedCost.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AggregatedCost.kt
@@ -20,6 +20,7 @@ import java.util.Objects
import kotlin.jvm.optionals.getOrNull
class AggregatedCost
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val perPriceCosts: JsonField>,
private val subtotal: JsonField,
@@ -330,12 +331,25 @@ private constructor(
return true
}
- return /* spotless:off */ other is AggregatedCost && perPriceCosts == other.perPriceCosts && subtotal == other.subtotal && timeframeEnd == other.timeframeEnd && timeframeStart == other.timeframeStart && total == other.total && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AggregatedCost &&
+ perPriceCosts == other.perPriceCosts &&
+ subtotal == other.subtotal &&
+ timeframeEnd == other.timeframeEnd &&
+ timeframeStart == other.timeframeStart &&
+ total == other.total &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(perPriceCosts, subtotal, timeframeEnd, timeframeStart, total, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ perPriceCosts,
+ subtotal,
+ timeframeEnd,
+ timeframeStart,
+ total,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
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 3d7bc937..f35084b4 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
@@ -28,6 +28,7 @@ import kotlin.jvm.optionals.getOrNull
* Alerts created through the API can be scoped to either customers or subscriptions.
*/
class Alert
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val createdAt: JsonField,
@@ -616,6 +617,7 @@ private constructor(
/** The metric the alert applies to. */
class Metric
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val additionalProperties: MutableMap,
@@ -754,12 +756,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is Metric && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Metric &&
+ id == other.id &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -768,6 +770,7 @@ private constructor(
/** The plan the alert applies to. */
class Plan
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val externalPlanId: JsonField,
@@ -1043,12 +1046,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is Plan && id == other.id && externalPlanId == other.externalPlanId && name == other.name && planVersion == other.planVersion && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Plan &&
+ id == other.id &&
+ externalPlanId == other.externalPlanId &&
+ name == other.name &&
+ planVersion == other.planVersion &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, externalPlanId, name, planVersion, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(id, externalPlanId, name, planVersion, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -1191,7 +1199,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Type && value == other.value /* spotless:on */
+ return other is Type && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -1201,6 +1209,7 @@ private constructor(
/** Alert status is used to determine if an alert is currently in-alert or not. */
class BalanceAlertStatus
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val inAlert: JsonField,
private val thresholdValue: JsonField,
@@ -1393,12 +1402,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is BalanceAlertStatus && inAlert == other.inAlert && thresholdValue == other.thresholdValue && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is BalanceAlertStatus &&
+ inAlert == other.inAlert &&
+ thresholdValue == other.thresholdValue &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(inAlert, thresholdValue, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(inAlert, thresholdValue, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -1411,12 +1423,37 @@ private constructor(
return true
}
- return /* spotless:off */ other is Alert && id == other.id && createdAt == other.createdAt && currency == other.currency && customer == other.customer && enabled == other.enabled && metric == other.metric && plan == other.plan && subscription == other.subscription && thresholds == other.thresholds && type == other.type && balanceAlertStatus == other.balanceAlertStatus && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Alert &&
+ id == other.id &&
+ createdAt == other.createdAt &&
+ currency == other.currency &&
+ customer == other.customer &&
+ enabled == other.enabled &&
+ metric == other.metric &&
+ plan == other.plan &&
+ subscription == other.subscription &&
+ thresholds == other.thresholds &&
+ type == other.type &&
+ balanceAlertStatus == other.balanceAlertStatus &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, createdAt, currency, customer, enabled, metric, plan, subscription, thresholds, type, balanceAlertStatus, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ id,
+ createdAt,
+ currency,
+ customer,
+ enabled,
+ metric,
+ plan,
+ subscription,
+ thresholds,
+ type,
+ balanceAlertStatus,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
index 01c06640..23046502 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
@@ -340,6 +340,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val currency: JsonField,
private val type: JsonField,
@@ -581,12 +582,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && currency == other.currency && type == other.type && thresholds == other.thresholds && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ currency == other.currency &&
+ type == other.type &&
+ thresholds == other.thresholds &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(currency, type, thresholds, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(currency, type, thresholds, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -717,7 +722,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Type && value == other.value /* spotless:on */
+ return other is Type && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -730,10 +735,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertCreateForCustomerParams && customerId == other.customerId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is AlertCreateForCustomerParams &&
+ customerId == other.customerId &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(customerId, body, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(customerId, body, additionalHeaders, additionalQueryParams)
override fun toString() =
"AlertCreateForCustomerParams{customerId=$customerId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
index 6852ecd0..e3332964 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
@@ -349,6 +349,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val currency: JsonField,
private val type: JsonField,
@@ -590,12 +591,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && currency == other.currency && type == other.type && thresholds == other.thresholds && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ currency == other.currency &&
+ type == other.type &&
+ thresholds == other.thresholds &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(currency, type, thresholds, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(currency, type, thresholds, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -726,7 +731,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Type && value == other.value /* spotless:on */
+ return other is Type && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -739,10 +744,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertCreateForExternalCustomerParams && externalCustomerId == other.externalCustomerId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is AlertCreateForExternalCustomerParams &&
+ externalCustomerId == other.externalCustomerId &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(externalCustomerId, body, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(externalCustomerId, body, additionalHeaders, additionalQueryParams)
override fun toString() =
"AlertCreateForExternalCustomerParams{externalCustomerId=$externalCustomerId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
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 0f3748d6..7329b98c 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
@@ -348,6 +348,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val thresholds: JsonField>,
private val type: JsonField,
@@ -587,12 +588,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && thresholds == other.thresholds && type == other.type && metricId == other.metricId && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ thresholds == other.thresholds &&
+ type == other.type &&
+ metricId == other.metricId &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(thresholds, type, metricId, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(thresholds, type, metricId, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -717,7 +722,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Type && value == other.value /* spotless:on */
+ return other is Type && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -730,10 +735,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertCreateForSubscriptionParams && subscriptionId == other.subscriptionId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is AlertCreateForSubscriptionParams &&
+ subscriptionId == other.subscriptionId &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(subscriptionId, body, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(subscriptionId, body, additionalHeaders, additionalQueryParams)
override fun toString() =
"AlertCreateForSubscriptionParams{subscriptionId=$subscriptionId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
index 5ad3565f..009f1233 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
@@ -244,10 +244,22 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertDisableParams && alertConfigurationId == other.alertConfigurationId && subscriptionId == other.subscriptionId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
+ return other is AlertDisableParams &&
+ alertConfigurationId == other.alertConfigurationId &&
+ subscriptionId == other.subscriptionId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams &&
+ additionalBodyProperties == other.additionalBodyProperties
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(alertConfigurationId, subscriptionId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(
+ alertConfigurationId,
+ subscriptionId,
+ additionalHeaders,
+ additionalQueryParams,
+ additionalBodyProperties,
+ )
override fun toString() =
"AlertDisableParams{alertConfigurationId=$alertConfigurationId, subscriptionId=$subscriptionId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt
index d7dc775f..65cfb8a8 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt
@@ -244,10 +244,22 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertEnableParams && alertConfigurationId == other.alertConfigurationId && subscriptionId == other.subscriptionId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
+ return other is AlertEnableParams &&
+ alertConfigurationId == other.alertConfigurationId &&
+ subscriptionId == other.subscriptionId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams &&
+ additionalBodyProperties == other.additionalBodyProperties
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(alertConfigurationId, subscriptionId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(
+ alertConfigurationId,
+ subscriptionId,
+ additionalHeaders,
+ additionalQueryParams,
+ additionalBodyProperties,
+ )
override fun toString() =
"AlertEnableParams{alertConfigurationId=$alertConfigurationId, subscriptionId=$subscriptionId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPage.kt
index 04cab053..c1a378da 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPage.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPage.kt
@@ -122,10 +122,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertListPage && service == other.service && params == other.params && response == other.response /* spotless:on */
+ return other is AlertListPage &&
+ service == other.service &&
+ params == other.params &&
+ response == other.response
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(service, params, response) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(service, params, response)
override fun toString() = "AlertListPage{service=$service, params=$params, response=$response}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt
index aee23ad7..579d4353 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt
@@ -134,10 +134,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertListPageAsync && service == other.service && streamHandlerExecutor == other.streamHandlerExecutor && params == other.params && response == other.response /* spotless:on */
+ return other is AlertListPageAsync &&
+ service == other.service &&
+ streamHandlerExecutor == other.streamHandlerExecutor &&
+ params == other.params &&
+ response == other.response
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(service, streamHandlerExecutor, params, response) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response)
override fun toString() =
"AlertListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageResponse.kt
index 76540e99..bfa4b279 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageResponse.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageResponse.kt
@@ -19,6 +19,7 @@ import java.util.Objects
import kotlin.jvm.optionals.getOrNull
class AlertListPageResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val data: JsonField>,
private val paginationMetadata: JsonField,
@@ -217,12 +218,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertListPageResponse && data == other.data && paginationMetadata == other.paginationMetadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AlertListPageResponse &&
+ data == other.data &&
+ paginationMetadata == other.paginationMetadata &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(data, paginationMetadata, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(data, paginationMetadata, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListParams.kt
index 9e9689ef..a95f34f5 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListParams.kt
@@ -16,7 +16,7 @@ import kotlin.jvm.optionals.getOrNull
*
* The request must specify one of `customer_id`, `external_customer_id`, or `subscription_id`.
*
- * If querying by subscripion_id, the endpoint will return the subscription level alerts as well as
+ * If querying by subscription_id, the endpoint will return the subscription level alerts as well as
* the plan level alerts associated with the subscription.
*
* The list of alerts is ordered starting from the most recently created alert. This endpoint
@@ -329,10 +329,34 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertListParams && createdAtGt == other.createdAtGt && createdAtGte == other.createdAtGte && createdAtLt == other.createdAtLt && createdAtLte == other.createdAtLte && cursor == other.cursor && customerId == other.customerId && externalCustomerId == other.externalCustomerId && limit == other.limit && subscriptionId == other.subscriptionId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is AlertListParams &&
+ createdAtGt == other.createdAtGt &&
+ createdAtGte == other.createdAtGte &&
+ createdAtLt == other.createdAtLt &&
+ createdAtLte == other.createdAtLte &&
+ cursor == other.cursor &&
+ customerId == other.customerId &&
+ externalCustomerId == other.externalCustomerId &&
+ limit == other.limit &&
+ subscriptionId == other.subscriptionId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(createdAtGt, createdAtGte, createdAtLt, createdAtLte, cursor, customerId, externalCustomerId, limit, subscriptionId, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(
+ createdAtGt,
+ createdAtGte,
+ createdAtLt,
+ createdAtLte,
+ cursor,
+ customerId,
+ externalCustomerId,
+ limit,
+ subscriptionId,
+ additionalHeaders,
+ additionalQueryParams,
+ )
override fun toString() =
"AlertListParams{createdAtGt=$createdAtGt, createdAtGte=$createdAtGte, createdAtLt=$createdAtLt, createdAtLte=$createdAtLte, cursor=$cursor, customerId=$customerId, externalCustomerId=$externalCustomerId, limit=$limit, subscriptionId=$subscriptionId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt
index 23daf4dd..293640ff 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt
@@ -176,10 +176,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertRetrieveParams && alertId == other.alertId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is AlertRetrieveParams &&
+ alertId == other.alertId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(alertId, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(alertId, additionalHeaders, additionalQueryParams)
override fun toString() =
"AlertRetrieveParams{alertId=$alertId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt
index 6a2e123e..96f3f152 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt
@@ -279,6 +279,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val thresholds: JsonField>,
private val additionalProperties: MutableMap,
@@ -443,12 +444,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && thresholds == other.thresholds && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ thresholds == other.thresholds &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(thresholds, additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -461,10 +462,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is AlertUpdateParams && alertConfigurationId == other.alertConfigurationId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is AlertUpdateParams &&
+ alertConfigurationId == other.alertConfigurationId &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(alertConfigurationId, body, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(alertConfigurationId, body, additionalHeaders, additionalQueryParams)
override fun toString() =
"AlertUpdateParams{alertConfigurationId=$alertConfigurationId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
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 440e9c08..0b36b3c5 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
@@ -18,6 +18,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class Allocation
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val allowsRollover: JsonField,
private val currency: JsonField,
@@ -244,12 +245,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Allocation && allowsRollover == other.allowsRollover && currency == other.currency && customExpiration == other.customExpiration && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Allocation &&
+ allowsRollover == other.allowsRollover &&
+ currency == other.currency &&
+ customExpiration == other.customExpiration &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(allowsRollover, currency, customExpiration, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(allowsRollover, currency, customExpiration, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmendmentLedgerEntry.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmendmentLedgerEntry.kt
index 2c0f3e57..9e161e9e 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmendmentLedgerEntry.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmendmentLedgerEntry.kt
@@ -21,6 +21,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AmendmentLedgerEntry
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val amount: JsonField,
@@ -742,7 +743,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is EntryStatus && value == other.value /* spotless:on */
+ return other is EntryStatus && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -862,7 +863,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is EntryType && value == other.value /* spotless:on */
+ return other is EntryType && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -964,12 +965,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Metadata && additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -981,12 +980,41 @@ private constructor(
return true
}
- return /* spotless:off */ other is AmendmentLedgerEntry && id == other.id && amount == other.amount && createdAt == other.createdAt && creditBlock == other.creditBlock && currency == other.currency && customer == other.customer && description == other.description && endingBalance == other.endingBalance && entryStatus == other.entryStatus && entryType == other.entryType && ledgerSequenceNumber == other.ledgerSequenceNumber && metadata == other.metadata && startingBalance == other.startingBalance && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AmendmentLedgerEntry &&
+ id == other.id &&
+ amount == other.amount &&
+ createdAt == other.createdAt &&
+ creditBlock == other.creditBlock &&
+ currency == other.currency &&
+ customer == other.customer &&
+ description == other.description &&
+ endingBalance == other.endingBalance &&
+ entryStatus == other.entryStatus &&
+ entryType == other.entryType &&
+ ledgerSequenceNumber == other.ledgerSequenceNumber &&
+ metadata == other.metadata &&
+ startingBalance == other.startingBalance &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, amount, createdAt, creditBlock, currency, customer, description, endingBalance, entryStatus, entryType, ledgerSequenceNumber, metadata, startingBalance, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ id,
+ amount,
+ createdAt,
+ creditBlock,
+ currency,
+ customer,
+ description,
+ endingBalance,
+ entryStatus,
+ entryType,
+ ledgerSequenceNumber,
+ metadata,
+ startingBalance,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt
index b88a2c7f..9473def7 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt
@@ -21,6 +21,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AmountDiscount
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amountDiscount: JsonField,
private val discountType: JsonField,
@@ -470,7 +471,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is DiscountType && value == other.value /* spotless:on */
+ return other is DiscountType && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -483,12 +484,25 @@ private constructor(
return true
}
- return /* spotless:off */ other is AmountDiscount && amountDiscount == other.amountDiscount && discountType == other.discountType && appliesToPriceIds == other.appliesToPriceIds && filters == other.filters && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AmountDiscount &&
+ amountDiscount == other.amountDiscount &&
+ discountType == other.discountType &&
+ appliesToPriceIds == other.appliesToPriceIds &&
+ filters == other.filters &&
+ reason == other.reason &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(amountDiscount, discountType, appliesToPriceIds, filters, reason, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ amountDiscount,
+ discountType,
+ appliesToPriceIds,
+ filters,
+ reason,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscountInterval.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscountInterval.kt
index 630e5848..e37fa4d7 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscountInterval.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscountInterval.kt
@@ -22,6 +22,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AmountDiscountInterval
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amountDiscount: JsonField,
private val appliesToPriceIntervalIds: JsonField>,
@@ -523,7 +524,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is DiscountType && value == other.value /* spotless:on */
+ return other is DiscountType && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -536,12 +537,27 @@ private constructor(
return true
}
- return /* spotless:off */ other is AmountDiscountInterval && amountDiscount == other.amountDiscount && appliesToPriceIntervalIds == other.appliesToPriceIntervalIds && discountType == other.discountType && endDate == other.endDate && filters == other.filters && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AmountDiscountInterval &&
+ amountDiscount == other.amountDiscount &&
+ appliesToPriceIntervalIds == other.appliesToPriceIntervalIds &&
+ discountType == other.discountType &&
+ endDate == other.endDate &&
+ filters == other.filters &&
+ startDate == other.startDate &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(amountDiscount, appliesToPriceIntervalIds, discountType, endDate, filters, startDate, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ amountDiscount,
+ appliesToPriceIntervalIds,
+ discountType,
+ endDate,
+ filters,
+ startDate,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
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 83ba798e..a901b084 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
@@ -15,6 +15,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
import com.withorb.api.core.BaseDeserializer
import com.withorb.api.core.BaseSerializer
+import com.withorb.api.core.Enum
import com.withorb.api.core.ExcludeMissing
import com.withorb.api.core.JsonField
import com.withorb.api.core.JsonMissing
@@ -32,12 +33,7 @@ import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
-/**
- * This API endpoint is in beta and its interface may change. It is recommended for use only in test
- * mode.
- *
- * This endpoint allows the creation of a new plan version for an existing plan.
- */
+/** This endpoint allows the creation of a new plan version for an existing plan. */
class BetaCreatePlanVersionParams
private constructor(
private val planId: String?,
@@ -581,6 +577,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val version: JsonField,
private val addAdjustments: JsonField>,
@@ -1144,12 +1141,31 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && version == other.version && addAdjustments == other.addAdjustments && addPrices == other.addPrices && removeAdjustments == other.removeAdjustments && removePrices == other.removePrices && replaceAdjustments == other.replaceAdjustments && replacePrices == other.replacePrices && setAsDefault == other.setAsDefault && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ version == other.version &&
+ addAdjustments == other.addAdjustments &&
+ addPrices == other.addPrices &&
+ removeAdjustments == other.removeAdjustments &&
+ removePrices == other.removePrices &&
+ replaceAdjustments == other.replaceAdjustments &&
+ replacePrices == other.replacePrices &&
+ setAsDefault == other.setAsDefault &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(version, addAdjustments, addPrices, removeAdjustments, removePrices, replaceAdjustments, replacePrices, setAsDefault, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ version,
+ addAdjustments,
+ addPrices,
+ removeAdjustments,
+ removePrices,
+ replaceAdjustments,
+ replacePrices,
+ setAsDefault,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
@@ -1158,6 +1174,7 @@ private constructor(
}
class AddAdjustment
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val adjustment: JsonField,
private val planPhaseOrder: JsonField,
@@ -1583,10 +1600,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Adjustment && percentageDiscount == other.percentageDiscount && usageDiscount == other.usageDiscount && amountDiscount == other.amountDiscount && minimum == other.minimum && maximum == other.maximum /* spotless:on */
+ return other is Adjustment &&
+ percentageDiscount == other.percentageDiscount &&
+ usageDiscount == other.usageDiscount &&
+ amountDiscount == other.amountDiscount &&
+ minimum == other.minimum &&
+ maximum == other.maximum
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(percentageDiscount, usageDiscount, amountDiscount, minimum, maximum) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(percentageDiscount, usageDiscount, amountDiscount, minimum, maximum)
override fun toString(): String =
when {
@@ -1715,12 +1738,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is AddAdjustment && adjustment == other.adjustment && planPhaseOrder == other.planPhaseOrder && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is AddAdjustment &&
+ adjustment == other.adjustment &&
+ planPhaseOrder == other.planPhaseOrder &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(adjustment, planPhaseOrder, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(adjustment, planPhaseOrder, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -1729,6 +1755,7 @@ private constructor(
}
class AddPrice
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val allocationPrice: JsonField,
private val planPhaseOrder: JsonField,
@@ -1765,7 +1792,7 @@ private constructor(
fun planPhaseOrder(): Optional = planPhaseOrder.getOptional("plan_phase_order")
/**
- * The price to add to the plan
+ * New plan price request body params.
*
* @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -1878,7 +1905,7 @@ private constructor(
this.planPhaseOrder = planPhaseOrder
}
- /** The price to add to the plan */
+ /** New plan price request body params. */
fun price(price: Price?) = price(JsonField.ofNullable(price))
/** Alias for calling [Builder.price] with `price.orElse(null)`. */
@@ -1896,27 +1923,18 @@ private constructor(
/** Alias for calling [price] with `Price.ofUnit(unit)`. */
fun price(unit: NewPlanUnitPrice) = price(Price.ofUnit(unit))
- /** Alias for calling [price] with `Price.ofPackage(package_)`. */
- fun price(package_: NewPlanPackagePrice) = price(Price.ofPackage(package_))
-
- /** Alias for calling [price] with `Price.ofMatrix(matrix)`. */
- fun price(matrix: NewPlanMatrixPrice) = price(Price.ofMatrix(matrix))
-
/** Alias for calling [price] with `Price.ofTiered(tiered)`. */
fun price(tiered: NewPlanTieredPrice) = price(Price.ofTiered(tiered))
- /** Alias for calling [price] with `Price.ofTieredBps(tieredBps)`. */
- fun price(tieredBps: NewPlanTieredBpsPrice) = price(Price.ofTieredBps(tieredBps))
-
- /** Alias for calling [price] with `Price.ofBps(bps)`. */
- fun price(bps: NewPlanBpsPrice) = price(Price.ofBps(bps))
-
- /** Alias for calling [price] with `Price.ofBulkBps(bulkBps)`. */
- fun price(bulkBps: NewPlanBulkBpsPrice) = price(Price.ofBulkBps(bulkBps))
-
/** Alias for calling [price] with `Price.ofBulk(bulk)`. */
fun price(bulk: NewPlanBulkPrice) = price(Price.ofBulk(bulk))
+ /** Alias for calling [price] with `Price.ofPackage(package_)`. */
+ fun price(package_: NewPlanPackagePrice) = price(Price.ofPackage(package_))
+
+ /** Alias for calling [price] with `Price.ofMatrix(matrix)`. */
+ fun price(matrix: NewPlanMatrixPrice) = price(Price.ofMatrix(matrix))
+
/**
* Alias for calling [price] with `Price.ofThresholdTotalAmount(thresholdTotalAmount)`.
*/
@@ -1931,9 +1949,16 @@ private constructor(
fun price(tieredWithMinimum: NewPlanTieredWithMinimumPrice) =
price(Price.ofTieredWithMinimum(tieredWithMinimum))
- /** Alias for calling [price] with `Price.ofUnitWithPercent(unitWithPercent)`. */
- fun price(unitWithPercent: NewPlanUnitWithPercentPrice) =
- price(Price.ofUnitWithPercent(unitWithPercent))
+ /** Alias for calling [price] with `Price.ofGroupedTiered(groupedTiered)`. */
+ fun price(groupedTiered: NewPlanGroupedTieredPrice) =
+ price(Price.ofGroupedTiered(groupedTiered))
+
+ /**
+ * Alias for calling [price] with
+ * `Price.ofTieredPackageWithMinimum(tieredPackageWithMinimum)`.
+ */
+ fun price(tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice) =
+ price(Price.ofTieredPackageWithMinimum(tieredPackageWithMinimum))
/**
* Alias for calling [price] with
@@ -1942,10 +1967,20 @@ private constructor(
fun price(packageWithAllocation: NewPlanPackageWithAllocationPrice) =
price(Price.ofPackageWithAllocation(packageWithAllocation))
+ /** Alias for calling [price] with `Price.ofUnitWithPercent(unitWithPercent)`. */
+ fun price(unitWithPercent: NewPlanUnitWithPercentPrice) =
+ price(Price.ofUnitWithPercent(unitWithPercent))
+
+ /**
+ * Alias for calling [price] with `Price.ofMatrixWithAllocation(matrixWithAllocation)`.
+ */
+ fun price(matrixWithAllocation: NewPlanMatrixWithAllocationPrice) =
+ price(Price.ofMatrixWithAllocation(matrixWithAllocation))
+
/**
* Alias for calling [price] with `Price.ofTieredWithProration(tieredWithProration)`.
*/
- fun price(tieredWithProration: NewPlanTierWithProrationPrice) =
+ fun price(tieredWithProration: Price.TieredWithProration) =
price(Price.ofTieredWithProration(tieredWithProration))
/** Alias for calling [price] with `Price.ofUnitWithProration(unitWithProration)`. */
@@ -1956,6 +1991,10 @@ private constructor(
fun price(groupedAllocation: NewPlanGroupedAllocationPrice) =
price(Price.ofGroupedAllocation(groupedAllocation))
+ /** Alias for calling [price] with `Price.ofBulkWithProration(bulkWithProration)`. */
+ fun price(bulkWithProration: NewPlanBulkWithProrationPrice) =
+ price(Price.ofBulkWithProration(bulkWithProration))
+
/**
* Alias for calling [price] with
* `Price.ofGroupedWithProratedMinimum(groupedWithProratedMinimum)`.
@@ -1970,6 +2009,13 @@ private constructor(
fun price(groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice) =
price(Price.ofGroupedWithMeteredMinimum(groupedWithMeteredMinimum))
+ /**
+ * Alias for calling [price] with
+ * `Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)`.
+ */
+ fun price(groupedWithMinMaxThresholds: Price.GroupedWithMinMaxThresholds) =
+ price(Price.ofGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds))
+
/**
* Alias for calling [price] with
* `Price.ofMatrixWithDisplayName(matrixWithDisplayName)`.
@@ -1977,10 +2023,6 @@ private constructor(
fun price(matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice) =
price(Price.ofMatrixWithDisplayName(matrixWithDisplayName))
- /** Alias for calling [price] with `Price.ofBulkWithProration(bulkWithProration)`. */
- fun price(bulkWithProration: NewPlanBulkWithProrationPrice) =
- price(Price.ofBulkWithProration(bulkWithProration))
-
/**
* Alias for calling [price] with `Price.ofGroupedTieredPackage(groupedTieredPackage)`.
*/
@@ -2016,22 +2058,14 @@ private constructor(
fun price(cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice) =
price(Price.ofCumulativeGroupedBulk(cumulativeGroupedBulk))
- /**
- * Alias for calling [price] with
- * `Price.ofTieredPackageWithMinimum(tieredPackageWithMinimum)`.
- */
- fun price(tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice) =
- price(Price.ofTieredPackageWithMinimum(tieredPackageWithMinimum))
+ /** Alias for calling [price] with `Price.ofMinimum(minimum)`. */
+ fun price(minimum: NewPlanMinimumCompositePrice) = price(Price.ofMinimum(minimum))
- /**
- * Alias for calling [price] with `Price.ofMatrixWithAllocation(matrixWithAllocation)`.
- */
- fun price(matrixWithAllocation: NewPlanMatrixWithAllocationPrice) =
- price(Price.ofMatrixWithAllocation(matrixWithAllocation))
+ /** Alias for calling [price] with `Price.ofPercent(percent)`. */
+ fun price(percent: Price.Percent) = price(Price.ofPercent(percent))
- /** Alias for calling [price] with `Price.ofGroupedTiered(groupedTiered)`. */
- fun price(groupedTiered: NewPlanGroupedTieredPrice) =
- price(Price.ofGroupedTiered(groupedTiered))
+ /** Alias for calling [price] with `Price.ofEventOutput(eventOutput)`. */
+ fun price(eventOutput: Price.EventOutput) = price(Price.ofEventOutput(eventOutput))
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -2099,31 +2133,32 @@ private constructor(
(if (planPhaseOrder.asKnown().isPresent) 1 else 0) +
(price.asKnown().getOrNull()?.validity() ?: 0)
- /** The price to add to the plan */
+ /** New plan price request body params. */
@JsonDeserialize(using = Price.Deserializer::class)
@JsonSerialize(using = Price.Serializer::class)
class Price
private constructor(
private val unit: NewPlanUnitPrice? = null,
- private val package_: NewPlanPackagePrice? = null,
- private val matrix: NewPlanMatrixPrice? = null,
private val tiered: NewPlanTieredPrice? = null,
- private val tieredBps: NewPlanTieredBpsPrice? = null,
- private val bps: NewPlanBpsPrice? = null,
- private val bulkBps: NewPlanBulkBpsPrice? = null,
private val bulk: NewPlanBulkPrice? = 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 unitWithPercent: NewPlanUnitWithPercentPrice? = null,
+ private val groupedTiered: NewPlanGroupedTieredPrice? = null,
+ private val tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice? = null,
private val packageWithAllocation: NewPlanPackageWithAllocationPrice? = null,
- private val tieredWithProration: NewPlanTierWithProrationPrice? = null,
+ private val unitWithPercent: NewPlanUnitWithPercentPrice? = null,
+ private val matrixWithAllocation: NewPlanMatrixWithAllocationPrice? = 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 groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds? = null,
private val matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice? = null,
- private val bulkWithProration: NewPlanBulkWithProrationPrice? = null,
private val groupedTieredPackage: NewPlanGroupedTieredPackagePrice? = null,
private val maxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice? = null,
private val scalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice? =
@@ -2132,27 +2167,21 @@ private constructor(
NewPlanScalableMatrixWithTieredPricingPrice? =
null,
private val cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice? = null,
- private val tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice? = null,
- private val matrixWithAllocation: NewPlanMatrixWithAllocationPrice? = null,
- private val groupedTiered: NewPlanGroupedTieredPrice? = null,
+ private val minimum: NewPlanMinimumCompositePrice? = null,
+ private val percent: Percent? = null,
+ private val eventOutput: EventOutput? = null,
private val _json: JsonValue? = null,
) {
fun unit(): Optional = Optional.ofNullable(unit)
- fun package_(): Optional = Optional.ofNullable(package_)
-
- fun matrix(): Optional = Optional.ofNullable(matrix)
-
fun tiered(): Optional = Optional.ofNullable(tiered)
- fun tieredBps(): Optional = Optional.ofNullable(tieredBps)
-
- fun bps(): Optional = Optional.ofNullable(bps)
+ fun bulk(): Optional = Optional.ofNullable(bulk)
- fun bulkBps(): Optional = Optional.ofNullable(bulkBps)
+ fun package_(): Optional = Optional.ofNullable(package_)
- fun bulk(): Optional = Optional.ofNullable(bulk)
+ fun matrix(): Optional = Optional.ofNullable(matrix)
fun thresholdTotalAmount(): Optional =
Optional.ofNullable(thresholdTotalAmount)
@@ -2163,13 +2192,22 @@ private constructor(
fun tieredWithMinimum(): Optional =
Optional.ofNullable(tieredWithMinimum)
- fun unitWithPercent(): Optional =
- Optional.ofNullable(unitWithPercent)
+ fun groupedTiered(): Optional =
+ Optional.ofNullable(groupedTiered)
+
+ fun tieredPackageWithMinimum(): Optional =
+ Optional.ofNullable(tieredPackageWithMinimum)
fun packageWithAllocation(): Optional =
Optional.ofNullable(packageWithAllocation)
- fun tieredWithProration(): Optional =
+ fun unitWithPercent(): Optional =
+ Optional.ofNullable(unitWithPercent)
+
+ fun matrixWithAllocation(): Optional =
+ Optional.ofNullable(matrixWithAllocation)
+
+ fun tieredWithProration(): Optional =
Optional.ofNullable(tieredWithProration)
fun unitWithProration(): Optional =
@@ -2178,18 +2216,21 @@ private constructor(
fun groupedAllocation(): Optional =
Optional.ofNullable(groupedAllocation)
+ fun bulkWithProration(): Optional =
+ Optional.ofNullable(bulkWithProration)
+
fun groupedWithProratedMinimum(): Optional =
Optional.ofNullable(groupedWithProratedMinimum)
fun groupedWithMeteredMinimum(): Optional =
Optional.ofNullable(groupedWithMeteredMinimum)
+ fun groupedWithMinMaxThresholds(): Optional =
+ Optional.ofNullable(groupedWithMinMaxThresholds)
+
fun matrixWithDisplayName(): Optional =
Optional.ofNullable(matrixWithDisplayName)
- fun bulkWithProration(): Optional =
- Optional.ofNullable(bulkWithProration)
-
fun groupedTieredPackage(): Optional =
Optional.ofNullable(groupedTieredPackage)
@@ -2207,30 +2248,21 @@ private constructor(
fun cumulativeGroupedBulk(): Optional =
Optional.ofNullable(cumulativeGroupedBulk)
- fun tieredPackageWithMinimum(): Optional =
- Optional.ofNullable(tieredPackageWithMinimum)
+ fun minimum(): Optional = Optional.ofNullable(minimum)
- fun matrixWithAllocation(): Optional =
- Optional.ofNullable(matrixWithAllocation)
+ fun percent(): Optional = Optional.ofNullable(percent)
- fun groupedTiered(): Optional =
- Optional.ofNullable(groupedTiered)
+ fun eventOutput(): Optional = Optional.ofNullable(eventOutput)
fun isUnit(): Boolean = unit != null
- fun isPackage(): Boolean = package_ != null
-
- fun isMatrix(): Boolean = matrix != null
-
fun isTiered(): Boolean = tiered != null
- fun isTieredBps(): Boolean = tieredBps != null
-
- fun isBps(): Boolean = bps != null
+ fun isBulk(): Boolean = bulk != null
- fun isBulkBps(): Boolean = bulkBps != null
+ fun isPackage(): Boolean = package_ != null
- fun isBulk(): Boolean = bulk != null
+ fun isMatrix(): Boolean = matrix != null
fun isThresholdTotalAmount(): Boolean = thresholdTotalAmount != null
@@ -2238,23 +2270,31 @@ private constructor(
fun isTieredWithMinimum(): Boolean = tieredWithMinimum != null
- fun isUnitWithPercent(): Boolean = unitWithPercent != null
+ fun isGroupedTiered(): Boolean = groupedTiered != null
+
+ fun isTieredPackageWithMinimum(): Boolean = tieredPackageWithMinimum != null
fun isPackageWithAllocation(): Boolean = packageWithAllocation != null
+ fun isUnitWithPercent(): Boolean = unitWithPercent != null
+
+ fun isMatrixWithAllocation(): Boolean = matrixWithAllocation != null
+
fun isTieredWithProration(): Boolean = tieredWithProration != null
fun isUnitWithProration(): Boolean = unitWithProration != null
fun isGroupedAllocation(): Boolean = groupedAllocation != null
+ fun isBulkWithProration(): Boolean = bulkWithProration != null
+
fun isGroupedWithProratedMinimum(): Boolean = groupedWithProratedMinimum != null
fun isGroupedWithMeteredMinimum(): Boolean = groupedWithMeteredMinimum != null
- fun isMatrixWithDisplayName(): Boolean = matrixWithDisplayName != null
+ fun isGroupedWithMinMaxThresholds(): Boolean = groupedWithMinMaxThresholds != null
- fun isBulkWithProration(): Boolean = bulkWithProration != null
+ fun isMatrixWithDisplayName(): Boolean = matrixWithDisplayName != null
fun isGroupedTieredPackage(): Boolean = groupedTieredPackage != null
@@ -2267,27 +2307,21 @@ private constructor(
fun isCumulativeGroupedBulk(): Boolean = cumulativeGroupedBulk != null
- fun isTieredPackageWithMinimum(): Boolean = tieredPackageWithMinimum != null
+ fun isMinimum(): Boolean = minimum != null
- fun isMatrixWithAllocation(): Boolean = matrixWithAllocation != null
+ fun isPercent(): Boolean = percent != null
- fun isGroupedTiered(): Boolean = groupedTiered != null
+ fun isEventOutput(): Boolean = eventOutput != null
fun asUnit(): NewPlanUnitPrice = unit.getOrThrow("unit")
- fun asPackage(): NewPlanPackagePrice = package_.getOrThrow("package_")
-
- fun asMatrix(): NewPlanMatrixPrice = matrix.getOrThrow("matrix")
-
fun asTiered(): NewPlanTieredPrice = tiered.getOrThrow("tiered")
- fun asTieredBps(): NewPlanTieredBpsPrice = tieredBps.getOrThrow("tieredBps")
-
- fun asBps(): NewPlanBpsPrice = bps.getOrThrow("bps")
+ fun asBulk(): NewPlanBulkPrice = bulk.getOrThrow("bulk")
- fun asBulkBps(): NewPlanBulkBpsPrice = bulkBps.getOrThrow("bulkBps")
+ fun asPackage(): NewPlanPackagePrice = package_.getOrThrow("package_")
- fun asBulk(): NewPlanBulkPrice = bulk.getOrThrow("bulk")
+ fun asMatrix(): NewPlanMatrixPrice = matrix.getOrThrow("matrix")
fun asThresholdTotalAmount(): NewPlanThresholdTotalAmountPrice =
thresholdTotalAmount.getOrThrow("thresholdTotalAmount")
@@ -2298,13 +2332,22 @@ private constructor(
fun asTieredWithMinimum(): NewPlanTieredWithMinimumPrice =
tieredWithMinimum.getOrThrow("tieredWithMinimum")
- fun asUnitWithPercent(): NewPlanUnitWithPercentPrice =
- unitWithPercent.getOrThrow("unitWithPercent")
+ fun asGroupedTiered(): NewPlanGroupedTieredPrice =
+ groupedTiered.getOrThrow("groupedTiered")
+
+ fun asTieredPackageWithMinimum(): NewPlanTieredPackageWithMinimumPrice =
+ tieredPackageWithMinimum.getOrThrow("tieredPackageWithMinimum")
fun asPackageWithAllocation(): NewPlanPackageWithAllocationPrice =
packageWithAllocation.getOrThrow("packageWithAllocation")
- fun asTieredWithProration(): NewPlanTierWithProrationPrice =
+ fun asUnitWithPercent(): NewPlanUnitWithPercentPrice =
+ unitWithPercent.getOrThrow("unitWithPercent")
+
+ fun asMatrixWithAllocation(): NewPlanMatrixWithAllocationPrice =
+ matrixWithAllocation.getOrThrow("matrixWithAllocation")
+
+ fun asTieredWithProration(): TieredWithProration =
tieredWithProration.getOrThrow("tieredWithProration")
fun asUnitWithProration(): NewPlanUnitWithProrationPrice =
@@ -2313,18 +2356,21 @@ private constructor(
fun asGroupedAllocation(): NewPlanGroupedAllocationPrice =
groupedAllocation.getOrThrow("groupedAllocation")
+ fun asBulkWithProration(): NewPlanBulkWithProrationPrice =
+ bulkWithProration.getOrThrow("bulkWithProration")
+
fun asGroupedWithProratedMinimum(): NewPlanGroupedWithProratedMinimumPrice =
groupedWithProratedMinimum.getOrThrow("groupedWithProratedMinimum")
fun asGroupedWithMeteredMinimum(): NewPlanGroupedWithMeteredMinimumPrice =
groupedWithMeteredMinimum.getOrThrow("groupedWithMeteredMinimum")
+ fun asGroupedWithMinMaxThresholds(): GroupedWithMinMaxThresholds =
+ groupedWithMinMaxThresholds.getOrThrow("groupedWithMinMaxThresholds")
+
fun asMatrixWithDisplayName(): NewPlanMatrixWithDisplayNamePrice =
matrixWithDisplayName.getOrThrow("matrixWithDisplayName")
- fun asBulkWithProration(): NewPlanBulkWithProrationPrice =
- bulkWithProration.getOrThrow("bulkWithProration")
-
fun asGroupedTieredPackage(): NewPlanGroupedTieredPackagePrice =
groupedTieredPackage.getOrThrow("groupedTieredPackage")
@@ -2340,45 +2386,46 @@ private constructor(
fun asCumulativeGroupedBulk(): NewPlanCumulativeGroupedBulkPrice =
cumulativeGroupedBulk.getOrThrow("cumulativeGroupedBulk")
- fun asTieredPackageWithMinimum(): NewPlanTieredPackageWithMinimumPrice =
- tieredPackageWithMinimum.getOrThrow("tieredPackageWithMinimum")
+ fun asMinimum(): NewPlanMinimumCompositePrice = minimum.getOrThrow("minimum")
- fun asMatrixWithAllocation(): NewPlanMatrixWithAllocationPrice =
- matrixWithAllocation.getOrThrow("matrixWithAllocation")
+ fun asPercent(): Percent = percent.getOrThrow("percent")
- fun asGroupedTiered(): NewPlanGroupedTieredPrice =
- groupedTiered.getOrThrow("groupedTiered")
+ fun asEventOutput(): EventOutput = eventOutput.getOrThrow("eventOutput")
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
when {
unit != null -> visitor.visitUnit(unit)
- package_ != null -> visitor.visitPackage(package_)
- matrix != null -> visitor.visitMatrix(matrix)
tiered != null -> visitor.visitTiered(tiered)
- tieredBps != null -> visitor.visitTieredBps(tieredBps)
- bps != null -> visitor.visitBps(bps)
- bulkBps != null -> visitor.visitBulkBps(bulkBps)
bulk != null -> visitor.visitBulk(bulk)
+ package_ != null -> visitor.visitPackage(package_)
+ matrix != null -> visitor.visitMatrix(matrix)
thresholdTotalAmount != null ->
visitor.visitThresholdTotalAmount(thresholdTotalAmount)
tieredPackage != null -> visitor.visitTieredPackage(tieredPackage)
tieredWithMinimum != null -> visitor.visitTieredWithMinimum(tieredWithMinimum)
- unitWithPercent != null -> visitor.visitUnitWithPercent(unitWithPercent)
+ groupedTiered != null -> visitor.visitGroupedTiered(groupedTiered)
+ tieredPackageWithMinimum != null ->
+ visitor.visitTieredPackageWithMinimum(tieredPackageWithMinimum)
packageWithAllocation != null ->
visitor.visitPackageWithAllocation(packageWithAllocation)
+ unitWithPercent != null -> visitor.visitUnitWithPercent(unitWithPercent)
+ matrixWithAllocation != null ->
+ visitor.visitMatrixWithAllocation(matrixWithAllocation)
tieredWithProration != null ->
visitor.visitTieredWithProration(tieredWithProration)
unitWithProration != null -> visitor.visitUnitWithProration(unitWithProration)
groupedAllocation != null -> visitor.visitGroupedAllocation(groupedAllocation)
+ bulkWithProration != null -> visitor.visitBulkWithProration(bulkWithProration)
groupedWithProratedMinimum != null ->
visitor.visitGroupedWithProratedMinimum(groupedWithProratedMinimum)
groupedWithMeteredMinimum != null ->
visitor.visitGroupedWithMeteredMinimum(groupedWithMeteredMinimum)
+ groupedWithMinMaxThresholds != null ->
+ visitor.visitGroupedWithMinMaxThresholds(groupedWithMinMaxThresholds)
matrixWithDisplayName != null ->
visitor.visitMatrixWithDisplayName(matrixWithDisplayName)
- bulkWithProration != null -> visitor.visitBulkWithProration(bulkWithProration)
groupedTieredPackage != null ->
visitor.visitGroupedTieredPackage(groupedTieredPackage)
maxGroupTieredPackage != null ->
@@ -2391,11 +2438,9 @@ private constructor(
)
cumulativeGroupedBulk != null ->
visitor.visitCumulativeGroupedBulk(cumulativeGroupedBulk)
- tieredPackageWithMinimum != null ->
- visitor.visitTieredPackageWithMinimum(tieredPackageWithMinimum)
- matrixWithAllocation != null ->
- visitor.visitMatrixWithAllocation(matrixWithAllocation)
- groupedTiered != null -> visitor.visitGroupedTiered(groupedTiered)
+ minimum != null -> visitor.visitMinimum(minimum)
+ percent != null -> visitor.visitPercent(percent)
+ eventOutput != null -> visitor.visitEventOutput(eventOutput)
else -> visitor.unknown(_json)
}
@@ -2412,32 +2457,20 @@ private constructor(
unit.validate()
}
- override fun visitPackage(package_: NewPlanPackagePrice) {
- package_.validate()
- }
-
- override fun visitMatrix(matrix: NewPlanMatrixPrice) {
- matrix.validate()
- }
-
override fun visitTiered(tiered: NewPlanTieredPrice) {
tiered.validate()
}
- override fun visitTieredBps(tieredBps: NewPlanTieredBpsPrice) {
- tieredBps.validate()
- }
-
- override fun visitBps(bps: NewPlanBpsPrice) {
- bps.validate()
+ override fun visitBulk(bulk: NewPlanBulkPrice) {
+ bulk.validate()
}
- override fun visitBulkBps(bulkBps: NewPlanBulkBpsPrice) {
- bulkBps.validate()
+ override fun visitPackage(package_: NewPlanPackagePrice) {
+ package_.validate()
}
- override fun visitBulk(bulk: NewPlanBulkPrice) {
- bulk.validate()
+ override fun visitMatrix(matrix: NewPlanMatrixPrice) {
+ matrix.validate()
}
override fun visitThresholdTotalAmount(
@@ -2456,10 +2489,14 @@ private constructor(
tieredWithMinimum.validate()
}
- override fun visitUnitWithPercent(
- unitWithPercent: NewPlanUnitWithPercentPrice
+ override fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) {
+ groupedTiered.validate()
+ }
+
+ override fun visitTieredPackageWithMinimum(
+ tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
) {
- unitWithPercent.validate()
+ tieredPackageWithMinimum.validate()
}
override fun visitPackageWithAllocation(
@@ -2468,8 +2505,20 @@ private constructor(
packageWithAllocation.validate()
}
+ override fun visitUnitWithPercent(
+ unitWithPercent: NewPlanUnitWithPercentPrice
+ ) {
+ unitWithPercent.validate()
+ }
+
+ override fun visitMatrixWithAllocation(
+ matrixWithAllocation: NewPlanMatrixWithAllocationPrice
+ ) {
+ matrixWithAllocation.validate()
+ }
+
override fun visitTieredWithProration(
- tieredWithProration: NewPlanTierWithProrationPrice
+ tieredWithProration: TieredWithProration
) {
tieredWithProration.validate()
}
@@ -2486,6 +2535,12 @@ private constructor(
groupedAllocation.validate()
}
+ override fun visitBulkWithProration(
+ bulkWithProration: NewPlanBulkWithProrationPrice
+ ) {
+ bulkWithProration.validate()
+ }
+
override fun visitGroupedWithProratedMinimum(
groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
) {
@@ -2498,16 +2553,16 @@ private constructor(
groupedWithMeteredMinimum.validate()
}
- override fun visitMatrixWithDisplayName(
- matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
+ override fun visitGroupedWithMinMaxThresholds(
+ groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds
) {
- matrixWithDisplayName.validate()
+ groupedWithMinMaxThresholds.validate()
}
- override fun visitBulkWithProration(
- bulkWithProration: NewPlanBulkWithProrationPrice
+ override fun visitMatrixWithDisplayName(
+ matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
) {
- bulkWithProration.validate()
+ matrixWithDisplayName.validate()
}
override fun visitGroupedTieredPackage(
@@ -2541,20 +2596,16 @@ private constructor(
cumulativeGroupedBulk.validate()
}
- override fun visitTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
- ) {
- tieredPackageWithMinimum.validate()
+ override fun visitMinimum(minimum: NewPlanMinimumCompositePrice) {
+ minimum.validate()
}
- override fun visitMatrixWithAllocation(
- matrixWithAllocation: NewPlanMatrixWithAllocationPrice
- ) {
- matrixWithAllocation.validate()
+ override fun visitPercent(percent: Percent) {
+ percent.validate()
}
- override fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) {
- groupedTiered.validate()
+ override fun visitEventOutput(eventOutput: EventOutput) {
+ eventOutput.validate()
}
}
)
@@ -2581,21 +2632,14 @@ private constructor(
object : Visitor {
override fun visitUnit(unit: NewPlanUnitPrice) = unit.validity()
- override fun visitPackage(package_: NewPlanPackagePrice) =
- package_.validity()
-
- override fun visitMatrix(matrix: NewPlanMatrixPrice) = matrix.validity()
-
override fun visitTiered(tiered: NewPlanTieredPrice) = tiered.validity()
- override fun visitTieredBps(tieredBps: NewPlanTieredBpsPrice) =
- tieredBps.validity()
-
- override fun visitBps(bps: NewPlanBpsPrice) = bps.validity()
+ override fun visitBulk(bulk: NewPlanBulkPrice) = bulk.validity()
- override fun visitBulkBps(bulkBps: NewPlanBulkBpsPrice) = bulkBps.validity()
+ override fun visitPackage(package_: NewPlanPackagePrice) =
+ package_.validity()
- override fun visitBulk(bulk: NewPlanBulkPrice) = bulk.validity()
+ override fun visitMatrix(matrix: NewPlanMatrixPrice) = matrix.validity()
override fun visitThresholdTotalAmount(
thresholdTotalAmount: NewPlanThresholdTotalAmountPrice
@@ -2608,16 +2652,27 @@ private constructor(
tieredWithMinimum: NewPlanTieredWithMinimumPrice
) = tieredWithMinimum.validity()
- override fun visitUnitWithPercent(
- unitWithPercent: NewPlanUnitWithPercentPrice
- ) = unitWithPercent.validity()
+ override fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) =
+ groupedTiered.validity()
+
+ override fun visitTieredPackageWithMinimum(
+ tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
+ ) = tieredPackageWithMinimum.validity()
override fun visitPackageWithAllocation(
packageWithAllocation: NewPlanPackageWithAllocationPrice
) = packageWithAllocation.validity()
+ override fun visitUnitWithPercent(
+ unitWithPercent: NewPlanUnitWithPercentPrice
+ ) = unitWithPercent.validity()
+
+ override fun visitMatrixWithAllocation(
+ matrixWithAllocation: NewPlanMatrixWithAllocationPrice
+ ) = matrixWithAllocation.validity()
+
override fun visitTieredWithProration(
- tieredWithProration: NewPlanTierWithProrationPrice
+ tieredWithProration: TieredWithProration
) = tieredWithProration.validity()
override fun visitUnitWithProration(
@@ -2628,6 +2683,10 @@ private constructor(
groupedAllocation: NewPlanGroupedAllocationPrice
) = groupedAllocation.validity()
+ override fun visitBulkWithProration(
+ bulkWithProration: NewPlanBulkWithProrationPrice
+ ) = bulkWithProration.validity()
+
override fun visitGroupedWithProratedMinimum(
groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
) = groupedWithProratedMinimum.validity()
@@ -2636,14 +2695,14 @@ private constructor(
groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice
) = groupedWithMeteredMinimum.validity()
+ override fun visitGroupedWithMinMaxThresholds(
+ groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds
+ ) = groupedWithMinMaxThresholds.validity()
+
override fun visitMatrixWithDisplayName(
matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
) = matrixWithDisplayName.validity()
- override fun visitBulkWithProration(
- bulkWithProration: NewPlanBulkWithProrationPrice
- ) = bulkWithProration.validity()
-
override fun visitGroupedTieredPackage(
groupedTieredPackage: NewPlanGroupedTieredPackagePrice
) = groupedTieredPackage.validity()
@@ -2665,16 +2724,13 @@ private constructor(
cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice
) = cumulativeGroupedBulk.validity()
- override fun visitTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
- ) = tieredPackageWithMinimum.validity()
+ override fun visitMinimum(minimum: NewPlanMinimumCompositePrice) =
+ minimum.validity()
- override fun visitMatrixWithAllocation(
- matrixWithAllocation: NewPlanMatrixWithAllocationPrice
- ) = matrixWithAllocation.validity()
+ override fun visitPercent(percent: Percent) = percent.validity()
- override fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) =
- groupedTiered.validity()
+ override fun visitEventOutput(eventOutput: EventOutput) =
+ eventOutput.validity()
override fun unknown(json: JsonValue?) = 0
}
@@ -2685,38 +2741,102 @@ private constructor(
return true
}
- return /* spotless:off */ other is Price && unit == other.unit && package_ == other.package_ && matrix == other.matrix && tiered == other.tiered && tieredBps == other.tieredBps && bps == other.bps && bulkBps == other.bulkBps && bulk == other.bulk && thresholdTotalAmount == other.thresholdTotalAmount && tieredPackage == other.tieredPackage && tieredWithMinimum == other.tieredWithMinimum && unitWithPercent == other.unitWithPercent && packageWithAllocation == other.packageWithAllocation && tieredWithProration == other.tieredWithProration && unitWithProration == other.unitWithProration && groupedAllocation == other.groupedAllocation && groupedWithProratedMinimum == other.groupedWithProratedMinimum && groupedWithMeteredMinimum == other.groupedWithMeteredMinimum && matrixWithDisplayName == other.matrixWithDisplayName && bulkWithProration == other.bulkWithProration && groupedTieredPackage == other.groupedTieredPackage && maxGroupTieredPackage == other.maxGroupTieredPackage && scalableMatrixWithUnitPricing == other.scalableMatrixWithUnitPricing && scalableMatrixWithTieredPricing == other.scalableMatrixWithTieredPricing && cumulativeGroupedBulk == other.cumulativeGroupedBulk && tieredPackageWithMinimum == other.tieredPackageWithMinimum && matrixWithAllocation == other.matrixWithAllocation && groupedTiered == other.groupedTiered /* spotless:on */
+ return other is Price &&
+ unit == other.unit &&
+ tiered == other.tiered &&
+ bulk == other.bulk &&
+ package_ == other.package_ &&
+ matrix == other.matrix &&
+ thresholdTotalAmount == other.thresholdTotalAmount &&
+ tieredPackage == other.tieredPackage &&
+ tieredWithMinimum == other.tieredWithMinimum &&
+ groupedTiered == other.groupedTiered &&
+ tieredPackageWithMinimum == other.tieredPackageWithMinimum &&
+ packageWithAllocation == other.packageWithAllocation &&
+ unitWithPercent == other.unitWithPercent &&
+ matrixWithAllocation == other.matrixWithAllocation &&
+ tieredWithProration == other.tieredWithProration &&
+ unitWithProration == other.unitWithProration &&
+ groupedAllocation == other.groupedAllocation &&
+ bulkWithProration == other.bulkWithProration &&
+ groupedWithProratedMinimum == other.groupedWithProratedMinimum &&
+ groupedWithMeteredMinimum == other.groupedWithMeteredMinimum &&
+ groupedWithMinMaxThresholds == other.groupedWithMinMaxThresholds &&
+ matrixWithDisplayName == other.matrixWithDisplayName &&
+ groupedTieredPackage == other.groupedTieredPackage &&
+ maxGroupTieredPackage == other.maxGroupTieredPackage &&
+ scalableMatrixWithUnitPricing == other.scalableMatrixWithUnitPricing &&
+ scalableMatrixWithTieredPricing == other.scalableMatrixWithTieredPricing &&
+ cumulativeGroupedBulk == other.cumulativeGroupedBulk &&
+ minimum == other.minimum &&
+ percent == other.percent &&
+ eventOutput == other.eventOutput
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(unit, package_, matrix, tiered, tieredBps, bps, bulkBps, bulk, thresholdTotalAmount, tieredPackage, tieredWithMinimum, unitWithPercent, packageWithAllocation, tieredWithProration, unitWithProration, groupedAllocation, groupedWithProratedMinimum, groupedWithMeteredMinimum, matrixWithDisplayName, bulkWithProration, groupedTieredPackage, maxGroupTieredPackage, scalableMatrixWithUnitPricing, scalableMatrixWithTieredPricing, cumulativeGroupedBulk, tieredPackageWithMinimum, matrixWithAllocation, groupedTiered) /* spotless:on */
+ override fun hashCode(): Int =
+ Objects.hash(
+ unit,
+ tiered,
+ bulk,
+ package_,
+ matrix,
+ thresholdTotalAmount,
+ tieredPackage,
+ tieredWithMinimum,
+ groupedTiered,
+ tieredPackageWithMinimum,
+ packageWithAllocation,
+ unitWithPercent,
+ matrixWithAllocation,
+ tieredWithProration,
+ unitWithProration,
+ groupedAllocation,
+ bulkWithProration,
+ groupedWithProratedMinimum,
+ groupedWithMeteredMinimum,
+ groupedWithMinMaxThresholds,
+ matrixWithDisplayName,
+ groupedTieredPackage,
+ maxGroupTieredPackage,
+ scalableMatrixWithUnitPricing,
+ scalableMatrixWithTieredPricing,
+ cumulativeGroupedBulk,
+ minimum,
+ percent,
+ eventOutput,
+ )
override fun toString(): String =
when {
unit != null -> "Price{unit=$unit}"
- package_ != null -> "Price{package_=$package_}"
- matrix != null -> "Price{matrix=$matrix}"
tiered != null -> "Price{tiered=$tiered}"
- tieredBps != null -> "Price{tieredBps=$tieredBps}"
- bps != null -> "Price{bps=$bps}"
- bulkBps != null -> "Price{bulkBps=$bulkBps}"
bulk != null -> "Price{bulk=$bulk}"
+ package_ != null -> "Price{package_=$package_}"
+ matrix != null -> "Price{matrix=$matrix}"
thresholdTotalAmount != null ->
"Price{thresholdTotalAmount=$thresholdTotalAmount}"
tieredPackage != null -> "Price{tieredPackage=$tieredPackage}"
tieredWithMinimum != null -> "Price{tieredWithMinimum=$tieredWithMinimum}"
- unitWithPercent != null -> "Price{unitWithPercent=$unitWithPercent}"
+ groupedTiered != null -> "Price{groupedTiered=$groupedTiered}"
+ tieredPackageWithMinimum != null ->
+ "Price{tieredPackageWithMinimum=$tieredPackageWithMinimum}"
packageWithAllocation != null ->
"Price{packageWithAllocation=$packageWithAllocation}"
+ unitWithPercent != null -> "Price{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}"
groupedWithProratedMinimum != null ->
"Price{groupedWithProratedMinimum=$groupedWithProratedMinimum}"
groupedWithMeteredMinimum != null ->
"Price{groupedWithMeteredMinimum=$groupedWithMeteredMinimum}"
+ groupedWithMinMaxThresholds != null ->
+ "Price{groupedWithMinMaxThresholds=$groupedWithMinMaxThresholds}"
matrixWithDisplayName != null ->
"Price{matrixWithDisplayName=$matrixWithDisplayName}"
- bulkWithProration != null -> "Price{bulkWithProration=$bulkWithProration}"
groupedTieredPackage != null ->
"Price{groupedTieredPackage=$groupedTieredPackage}"
maxGroupTieredPackage != null ->
@@ -2727,11 +2847,9 @@ private constructor(
"Price{scalableMatrixWithTieredPricing=$scalableMatrixWithTieredPricing}"
cumulativeGroupedBulk != null ->
"Price{cumulativeGroupedBulk=$cumulativeGroupedBulk}"
- tieredPackageWithMinimum != null ->
- "Price{tieredPackageWithMinimum=$tieredPackageWithMinimum}"
- matrixWithAllocation != null ->
- "Price{matrixWithAllocation=$matrixWithAllocation}"
- groupedTiered != null -> "Price{groupedTiered=$groupedTiered}"
+ minimum != null -> "Price{minimum=$minimum}"
+ percent != null -> "Price{percent=$percent}"
+ eventOutput != null -> "Price{eventOutput=$eventOutput}"
_json != null -> "Price{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Price")
}
@@ -2740,20 +2858,13 @@ private constructor(
@JvmStatic fun ofUnit(unit: NewPlanUnitPrice) = Price(unit = unit)
- @JvmStatic fun ofPackage(package_: NewPlanPackagePrice) = Price(package_ = package_)
-
- @JvmStatic fun ofMatrix(matrix: NewPlanMatrixPrice) = Price(matrix = matrix)
-
@JvmStatic fun ofTiered(tiered: NewPlanTieredPrice) = Price(tiered = tiered)
- @JvmStatic
- fun ofTieredBps(tieredBps: NewPlanTieredBpsPrice) = Price(tieredBps = tieredBps)
-
- @JvmStatic fun ofBps(bps: NewPlanBpsPrice) = Price(bps = bps)
+ @JvmStatic fun ofBulk(bulk: NewPlanBulkPrice) = Price(bulk = bulk)
- @JvmStatic fun ofBulkBps(bulkBps: NewPlanBulkBpsPrice) = Price(bulkBps = bulkBps)
+ @JvmStatic fun ofPackage(package_: NewPlanPackagePrice) = Price(package_ = package_)
- @JvmStatic fun ofBulk(bulk: NewPlanBulkPrice) = Price(bulk = bulk)
+ @JvmStatic fun ofMatrix(matrix: NewPlanMatrixPrice) = Price(matrix = matrix)
@JvmStatic
fun ofThresholdTotalAmount(thresholdTotalAmount: NewPlanThresholdTotalAmountPrice) =
@@ -2768,8 +2879,13 @@ private constructor(
Price(tieredWithMinimum = tieredWithMinimum)
@JvmStatic
- fun ofUnitWithPercent(unitWithPercent: NewPlanUnitWithPercentPrice) =
- Price(unitWithPercent = unitWithPercent)
+ fun ofGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) =
+ Price(groupedTiered = groupedTiered)
+
+ @JvmStatic
+ fun ofTieredPackageWithMinimum(
+ tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
+ ) = Price(tieredPackageWithMinimum = tieredPackageWithMinimum)
@JvmStatic
fun ofPackageWithAllocation(
@@ -2777,7 +2893,15 @@ private constructor(
) = Price(packageWithAllocation = packageWithAllocation)
@JvmStatic
- fun ofTieredWithProration(tieredWithProration: NewPlanTierWithProrationPrice) =
+ fun ofUnitWithPercent(unitWithPercent: NewPlanUnitWithPercentPrice) =
+ Price(unitWithPercent = unitWithPercent)
+
+ @JvmStatic
+ fun ofMatrixWithAllocation(matrixWithAllocation: NewPlanMatrixWithAllocationPrice) =
+ Price(matrixWithAllocation = matrixWithAllocation)
+
+ @JvmStatic
+ fun ofTieredWithProration(tieredWithProration: TieredWithProration) =
Price(tieredWithProration = tieredWithProration)
@JvmStatic
@@ -2788,6 +2912,10 @@ private constructor(
fun ofGroupedAllocation(groupedAllocation: NewPlanGroupedAllocationPrice) =
Price(groupedAllocation = groupedAllocation)
+ @JvmStatic
+ fun ofBulkWithProration(bulkWithProration: NewPlanBulkWithProrationPrice) =
+ Price(bulkWithProration = bulkWithProration)
+
@JvmStatic
fun ofGroupedWithProratedMinimum(
groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
@@ -2798,15 +2926,16 @@ private constructor(
groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice
) = Price(groupedWithMeteredMinimum = groupedWithMeteredMinimum)
+ @JvmStatic
+ fun ofGroupedWithMinMaxThresholds(
+ groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds
+ ) = Price(groupedWithMinMaxThresholds = groupedWithMinMaxThresholds)
+
@JvmStatic
fun ofMatrixWithDisplayName(
matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
) = Price(matrixWithDisplayName = matrixWithDisplayName)
- @JvmStatic
- fun ofBulkWithProration(bulkWithProration: NewPlanBulkWithProrationPrice) =
- Price(bulkWithProration = bulkWithProration)
-
@JvmStatic
fun ofGroupedTieredPackage(groupedTieredPackage: NewPlanGroupedTieredPackagePrice) =
Price(groupedTieredPackage = groupedTieredPackage)
@@ -2832,17 +2961,12 @@ private constructor(
) = Price(cumulativeGroupedBulk = cumulativeGroupedBulk)
@JvmStatic
- fun ofTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
- ) = Price(tieredPackageWithMinimum = tieredPackageWithMinimum)
+ fun ofMinimum(minimum: NewPlanMinimumCompositePrice) = Price(minimum = minimum)
- @JvmStatic
- fun ofMatrixWithAllocation(matrixWithAllocation: NewPlanMatrixWithAllocationPrice) =
- Price(matrixWithAllocation = matrixWithAllocation)
+ @JvmStatic fun ofPercent(percent: Percent) = Price(percent = percent)
@JvmStatic
- fun ofGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice) =
- Price(groupedTiered = groupedTiered)
+ fun ofEventOutput(eventOutput: EventOutput) = Price(eventOutput = eventOutput)
}
/**
@@ -2852,19 +2976,13 @@ private constructor(
fun visitUnit(unit: NewPlanUnitPrice): T
- fun visitPackage(package_: NewPlanPackagePrice): T
-
- fun visitMatrix(matrix: NewPlanMatrixPrice): T
-
fun visitTiered(tiered: NewPlanTieredPrice): T
- fun visitTieredBps(tieredBps: NewPlanTieredBpsPrice): T
-
- fun visitBps(bps: NewPlanBpsPrice): T
+ fun visitBulk(bulk: NewPlanBulkPrice): T
- fun visitBulkBps(bulkBps: NewPlanBulkBpsPrice): T
+ fun visitPackage(package_: NewPlanPackagePrice): T
- fun visitBulk(bulk: NewPlanBulkPrice): T
+ fun visitMatrix(matrix: NewPlanMatrixPrice): T
fun visitThresholdTotalAmount(
thresholdTotalAmount: NewPlanThresholdTotalAmountPrice
@@ -2874,18 +2992,30 @@ private constructor(
fun visitTieredWithMinimum(tieredWithMinimum: NewPlanTieredWithMinimumPrice): T
- fun visitUnitWithPercent(unitWithPercent: NewPlanUnitWithPercentPrice): T
+ fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice): T
+
+ fun visitTieredPackageWithMinimum(
+ tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
+ ): T
fun visitPackageWithAllocation(
packageWithAllocation: NewPlanPackageWithAllocationPrice
): T
- fun visitTieredWithProration(tieredWithProration: NewPlanTierWithProrationPrice): T
+ fun visitUnitWithPercent(unitWithPercent: NewPlanUnitWithPercentPrice): T
+
+ fun visitMatrixWithAllocation(
+ matrixWithAllocation: NewPlanMatrixWithAllocationPrice
+ ): T
+
+ fun visitTieredWithProration(tieredWithProration: TieredWithProration): T
fun visitUnitWithProration(unitWithProration: NewPlanUnitWithProrationPrice): T
fun visitGroupedAllocation(groupedAllocation: NewPlanGroupedAllocationPrice): T
+ fun visitBulkWithProration(bulkWithProration: NewPlanBulkWithProrationPrice): T
+
fun visitGroupedWithProratedMinimum(
groupedWithProratedMinimum: NewPlanGroupedWithProratedMinimumPrice
): T
@@ -2894,12 +3024,14 @@ private constructor(
groupedWithMeteredMinimum: NewPlanGroupedWithMeteredMinimumPrice
): T
+ fun visitGroupedWithMinMaxThresholds(
+ groupedWithMinMaxThresholds: GroupedWithMinMaxThresholds
+ ): T
+
fun visitMatrixWithDisplayName(
matrixWithDisplayName: NewPlanMatrixWithDisplayNamePrice
): T
- fun visitBulkWithProration(bulkWithProration: NewPlanBulkWithProrationPrice): T
-
fun visitGroupedTieredPackage(
groupedTieredPackage: NewPlanGroupedTieredPackagePrice
): T
@@ -2920,15 +3052,11 @@ private constructor(
cumulativeGroupedBulk: NewPlanCumulativeGroupedBulkPrice
): T
- fun visitTieredPackageWithMinimum(
- tieredPackageWithMinimum: NewPlanTieredPackageWithMinimumPrice
- ): T
+ fun visitMinimum(minimum: NewPlanMinimumCompositePrice): T
- fun visitMatrixWithAllocation(
- matrixWithAllocation: NewPlanMatrixWithAllocationPrice
- ): T
+ fun visitPercent(percent: Percent): T
- fun visitGroupedTiered(groupedTiered: NewPlanGroupedTieredPrice): T
+ fun visitEventOutput(eventOutput: EventOutput): T
/**
* Maps an unknown variant of [Price] to a value of type [T].
@@ -2958,38 +3086,25 @@ private constructor(
Price(unit = it, _json = json)
} ?: Price(_json = json)
}
- "package" -> {
- return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(package_ = it, _json = json) } ?: Price(_json = json)
- }
- "matrix" -> {
- return tryDeserialize(node, jacksonTypeRef())?.let {
- Price(matrix = it, _json = json)
- } ?: Price(_json = json)
- }
"tiered" -> {
return tryDeserialize(node, jacksonTypeRef())?.let {
Price(tiered = it, _json = json)
} ?: Price(_json = json)
}
- "tiered_bps" -> {
- return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(tieredBps = it, _json = json) } ?: Price(_json = json)
- }
- "bps" -> {
- return tryDeserialize(node, jacksonTypeRef())?.let {
- Price(bps = it, _json = json)
- } ?: Price(_json = json)
- }
- "bulk_bps" -> {
- return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(bulkBps = it, _json = json) } ?: Price(_json = json)
- }
"bulk" -> {
return tryDeserialize(node, jacksonTypeRef())?.let {
Price(bulk = it, _json = json)
} ?: Price(_json = json)
}
+ "package" -> {
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let { Price(package_ = it, _json = json) } ?: Price(_json = json)
+ }
+ "matrix" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ Price(matrix = it, _json = json)
+ } ?: Price(_json = json)
+ }
"threshold_total_amount" -> {
return tryDeserialize(
node,
@@ -3011,12 +3126,17 @@ private constructor(
?.let { Price(tieredWithMinimum = it, _json = json) }
?: Price(_json = json)
}
- "unit_with_percent" -> {
+ "grouped_tiered" -> {
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let { Price(groupedTiered = it, _json = json) }
+ ?: Price(_json = json)
+ }
+ "tiered_package_with_minimum" -> {
return tryDeserialize(
node,
- jacksonTypeRef(),
+ jacksonTypeRef(),
)
- ?.let { Price(unitWithPercent = it, _json = json) }
+ ?.let { Price(tieredPackageWithMinimum = it, _json = json) }
?: Price(_json = json)
}
"package_with_allocation" -> {
@@ -3027,11 +3147,24 @@ private constructor(
?.let { Price(packageWithAllocation = it, _json = json) }
?: Price(_json = json)
}
- "tiered_with_proration" -> {
+ "unit_with_percent" -> {
+ return tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let { Price(unitWithPercent = it, _json = json) }
+ ?: Price(_json = json)
+ }
+ "matrix_with_allocation" -> {
return tryDeserialize(
node,
- jacksonTypeRef(),
+ jacksonTypeRef(),
)
+ ?.let { Price(matrixWithAllocation = it, _json = json) }
+ ?: Price(_json = json)
+ }
+ "tiered_with_proration" -> {
+ return tryDeserialize(node, jacksonTypeRef())
?.let { Price(tieredWithProration = it, _json = json) }
?: Price(_json = json)
}
@@ -3051,6 +3184,14 @@ private constructor(
?.let { Price(groupedAllocation = it, _json = json) }
?: Price(_json = json)
}
+ "bulk_with_proration" -> {
+ return tryDeserialize(
+ node,
+ jacksonTypeRef(),
+ )
+ ?.let { Price(bulkWithProration = it, _json = json) }
+ ?: Price(_json = json)
+ }
"grouped_with_prorated_minimum" -> {
return tryDeserialize(
node,
@@ -3067,20 +3208,20 @@ private constructor(
?.let { Price(groupedWithMeteredMinimum = it, _json = json) }
?: Price(_json = json)
}
- "matrix_with_display_name" -> {
+ "grouped_with_min_max_thresholds" -> {
return tryDeserialize(
node,
- jacksonTypeRef(),
+ jacksonTypeRef(),
)
- ?.let { Price(matrixWithDisplayName = it, _json = json) }
+ ?.let { Price(groupedWithMinMaxThresholds = it, _json = json) }
?: Price(_json = json)
}
- "bulk_with_proration" -> {
+ "matrix_with_display_name" -> {
return tryDeserialize(
node,
- jacksonTypeRef(),
+ jacksonTypeRef(),
)
- ?.let { Price(bulkWithProration = it, _json = json) }
+ ?.let { Price(matrixWithDisplayName = it, _json = json) }
?: Price(_json = json)
}
"grouped_tiered_package" -> {
@@ -3123,26 +3264,22 @@ private constructor(
?.let { Price(cumulativeGroupedBulk = it, _json = json) }
?: Price(_json = json)
}
- "tiered_package_with_minimum" -> {
+ "minimum" -> {
return tryDeserialize(
node,
- jacksonTypeRef(),
+ jacksonTypeRef(),
)
- ?.let { Price(tieredPackageWithMinimum = it, _json = json) }
- ?: Price(_json = json)
+ ?.let { Price(minimum = it, _json = json) } ?: Price(_json = json)
}
- "matrix_with_allocation" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { Price(matrixWithAllocation = it, _json = json) }
- ?: Price(_json = json)
+ "percent" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ Price(percent = it, _json = json)
+ } ?: Price(_json = json)
}
- "grouped_tiered" -> {
- return tryDeserialize(node, jacksonTypeRef())
- ?.let { Price(groupedTiered = it, _json = json) }
- ?: Price(_json = json)
+ "event_output" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ Price(eventOutput = it, _json = json)
+ } ?: Price(_json = json)
}
}
@@ -3159,36 +3296,40 @@ private constructor(
) {
when {
value.unit != null -> generator.writeObject(value.unit)
- value.package_ != null -> generator.writeObject(value.package_)
- value.matrix != null -> generator.writeObject(value.matrix)
value.tiered != null -> generator.writeObject(value.tiered)
- value.tieredBps != null -> generator.writeObject(value.tieredBps)
- value.bps != null -> generator.writeObject(value.bps)
- value.bulkBps != null -> generator.writeObject(value.bulkBps)
value.bulk != null -> generator.writeObject(value.bulk)
+ value.package_ != null -> generator.writeObject(value.package_)
+ value.matrix != null -> generator.writeObject(value.matrix)
value.thresholdTotalAmount != null ->
generator.writeObject(value.thresholdTotalAmount)
value.tieredPackage != null -> generator.writeObject(value.tieredPackage)
value.tieredWithMinimum != null ->
generator.writeObject(value.tieredWithMinimum)
- value.unitWithPercent != null ->
- generator.writeObject(value.unitWithPercent)
+ value.groupedTiered != null -> generator.writeObject(value.groupedTiered)
+ value.tieredPackageWithMinimum != null ->
+ generator.writeObject(value.tieredPackageWithMinimum)
value.packageWithAllocation != null ->
generator.writeObject(value.packageWithAllocation)
+ value.unitWithPercent != null ->
+ generator.writeObject(value.unitWithPercent)
+ value.matrixWithAllocation != null ->
+ generator.writeObject(value.matrixWithAllocation)
value.tieredWithProration != null ->
generator.writeObject(value.tieredWithProration)
value.unitWithProration != null ->
generator.writeObject(value.unitWithProration)
value.groupedAllocation != null ->
generator.writeObject(value.groupedAllocation)
+ value.bulkWithProration != null ->
+ generator.writeObject(value.bulkWithProration)
value.groupedWithProratedMinimum != null ->
generator.writeObject(value.groupedWithProratedMinimum)
value.groupedWithMeteredMinimum != null ->
generator.writeObject(value.groupedWithMeteredMinimum)
+ value.groupedWithMinMaxThresholds != null ->
+ generator.writeObject(value.groupedWithMinMaxThresholds)
value.matrixWithDisplayName != null ->
generator.writeObject(value.matrixWithDisplayName)
- value.bulkWithProration != null ->
- generator.writeObject(value.bulkWithProration)
value.groupedTieredPackage != null ->
generator.writeObject(value.groupedTieredPackage)
value.maxGroupTieredPackage != null ->
@@ -3199,2621 +3340,16631 @@ private constructor(
generator.writeObject(value.scalableMatrixWithTieredPricing)
value.cumulativeGroupedBulk != null ->
generator.writeObject(value.cumulativeGroupedBulk)
- value.tieredPackageWithMinimum != null ->
- generator.writeObject(value.tieredPackageWithMinimum)
- value.matrixWithAllocation != null ->
- generator.writeObject(value.matrixWithAllocation)
- value.groupedTiered != null -> generator.writeObject(value.groupedTiered)
+ value.minimum != null -> generator.writeObject(value.minimum)
+ value.percent != null -> generator.writeObject(value.percent)
+ value.eventOutput != null -> generator.writeObject(value.eventOutput)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Price")
}
}
}
- }
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is AddPrice && allocationPrice == other.allocationPrice && planPhaseOrder == other.planPhaseOrder && price == other.price && additionalProperties == other.additionalProperties /* spotless:on */
- }
+ class TieredWithProration
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val cadence: JsonField,
+ private val itemId: JsonField,
+ private val modelType: JsonValue,
+ private val name: JsonField,
+ private val tieredWithProrationConfig: JsonField,
+ private val billableMetricId: JsonField,
+ private val billedInAdvance: JsonField,
+ private val billingCycleConfiguration: JsonField,
+ private val conversionRate: JsonField,
+ private val conversionRateConfig: JsonField,
+ private val currency: JsonField,
+ private val dimensionalPriceConfiguration:
+ JsonField,
+ private val externalPriceId: JsonField,
+ private val fixedPriceQuantity: JsonField,
+ private val invoiceGroupingKey: JsonField,
+ private val invoicingCycleConfiguration: JsonField,
+ private val metadata: JsonField,
+ private val referenceId: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("cadence")
+ @ExcludeMissing
+ cadence: JsonField = JsonMissing.of(),
+ @JsonProperty("item_id")
+ @ExcludeMissing
+ itemId: JsonField = JsonMissing.of(),
+ @JsonProperty("model_type")
+ @ExcludeMissing
+ modelType: JsonValue = JsonMissing.of(),
+ @JsonProperty("name")
+ @ExcludeMissing
+ name: JsonField = JsonMissing.of(),
+ @JsonProperty("tiered_with_proration_config")
+ @ExcludeMissing
+ tieredWithProrationConfig: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("billable_metric_id")
+ @ExcludeMissing
+ billableMetricId: JsonField = JsonMissing.of(),
+ @JsonProperty("billed_in_advance")
+ @ExcludeMissing
+ billedInAdvance: JsonField = JsonMissing.of(),
+ @JsonProperty("billing_cycle_configuration")
+ @ExcludeMissing
+ billingCycleConfiguration: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("conversion_rate")
+ @ExcludeMissing
+ conversionRate: JsonField = JsonMissing.of(),
+ @JsonProperty("conversion_rate_config")
+ @ExcludeMissing
+ conversionRateConfig: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ @JsonProperty("dimensional_price_configuration")
+ @ExcludeMissing
+ dimensionalPriceConfiguration: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("external_price_id")
+ @ExcludeMissing
+ externalPriceId: JsonField = JsonMissing.of(),
+ @JsonProperty("fixed_price_quantity")
+ @ExcludeMissing
+ fixedPriceQuantity: JsonField = JsonMissing.of(),
+ @JsonProperty("invoice_grouping_key")
+ @ExcludeMissing
+ invoiceGroupingKey: JsonField = JsonMissing.of(),
+ @JsonProperty("invoicing_cycle_configuration")
+ @ExcludeMissing
+ invoicingCycleConfiguration: JsonField =
+ JsonMissing.of(),
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ metadata: JsonField = JsonMissing.of(),
+ @JsonProperty("reference_id")
+ @ExcludeMissing
+ referenceId: JsonField = JsonMissing.of(),
+ ) : this(
+ cadence,
+ itemId,
+ modelType,
+ name,
+ tieredWithProrationConfig,
+ billableMetricId,
+ billedInAdvance,
+ billingCycleConfiguration,
+ conversionRate,
+ conversionRateConfig,
+ currency,
+ dimensionalPriceConfiguration,
+ externalPriceId,
+ fixedPriceQuantity,
+ invoiceGroupingKey,
+ invoicingCycleConfiguration,
+ metadata,
+ referenceId,
+ mutableMapOf(),
+ )
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(allocationPrice, planPhaseOrder, price, additionalProperties) }
- /* spotless:on */
+ /**
+ * The cadence to bill for this price on.
+ *
+ * @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 cadence(): Cadence = cadence.getRequired("cadence")
- override fun hashCode(): Int = hashCode
+ /**
+ * The id of the item the price will be associated with.
+ *
+ * @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 itemId(): String = itemId.getRequired("item_id")
- override fun toString() =
- "AddPrice{allocationPrice=$allocationPrice, planPhaseOrder=$planPhaseOrder, price=$price, additionalProperties=$additionalProperties}"
- }
+ /**
+ * The pricing model type
+ *
+ * Expected to always return the following:
+ * ```java
+ * JsonValue.from("tiered_with_proration")
+ * ```
+ *
+ * However, this method can be useful for debugging and logging (e.g. if the server
+ * responded with an unexpected value).
+ */
+ @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonValue = modelType
- class RemoveAdjustment
- private constructor(
- private val adjustmentId: JsonField,
- private val planPhaseOrder: JsonField,
- private val additionalProperties: MutableMap,
- ) {
+ /**
+ * The name of the price.
+ *
+ * @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 name(): String = name.getRequired("name")
- @JsonCreator
- private constructor(
- @JsonProperty("adjustment_id")
- @ExcludeMissing
- adjustmentId: JsonField = JsonMissing.of(),
- @JsonProperty("plan_phase_order")
- @ExcludeMissing
- planPhaseOrder: JsonField = JsonMissing.of(),
- ) : this(adjustmentId, planPhaseOrder, mutableMapOf())
+ /**
+ * Configuration for tiered_with_proration pricing
+ *
+ * @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 tieredWithProrationConfig(): TieredWithProrationConfig =
+ tieredWithProrationConfig.getRequired("tiered_with_proration_config")
- /**
- * The id of the adjustment to remove from on the plan.
- *
- * @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 adjustmentId(): String = adjustmentId.getRequired("adjustment_id")
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun billableMetricId(): Optional =
+ billableMetricId.getOptional("billable_metric_id")
- /**
- * The phase to remove this adjustment from.
- *
- * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun planPhaseOrder(): Optional = planPhaseOrder.getOptional("plan_phase_order")
+ /**
+ * If the Price represents a fixed cost, the price will be billed in-advance if this
+ * is true, and in-arrears if this is false.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun billedInAdvance(): Optional =
+ billedInAdvance.getOptional("billed_in_advance")
- /**
- * Returns the raw JSON value of [adjustmentId].
- *
- * Unlike [adjustmentId], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("adjustment_id")
- @ExcludeMissing
- fun _adjustmentId(): JsonField = adjustmentId
+ /**
+ * For custom cadence: specifies the duration of the billing period in days or
+ * months.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun billingCycleConfiguration(): Optional =
+ billingCycleConfiguration.getOptional("billing_cycle_configuration")
- /**
- * Returns the raw JSON value of [planPhaseOrder].
- *
- * Unlike [planPhaseOrder], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("plan_phase_order")
- @ExcludeMissing
- fun _planPhaseOrder(): JsonField = planPhaseOrder
+ /**
+ * The per unit conversion rate of the price currency to the invoicing currency.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun conversionRate(): Optional =
+ conversionRate.getOptional("conversion_rate")
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
+ /**
+ * The configuration for the rate of the price currency to the invoicing currency.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun conversionRateConfig(): Optional =
+ conversionRateConfig.getOptional("conversion_rate_config")
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
+ /**
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
+ * price is billed.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun currency(): Optional = currency.getOptional("currency")
- fun toBuilder() = Builder().from(this)
+ /**
+ * For dimensional price: specifies a price group and dimension values
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun dimensionalPriceConfiguration(): Optional =
+ dimensionalPriceConfiguration.getOptional("dimensional_price_configuration")
- companion object {
+ /**
+ * An alias for the price.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun externalPriceId(): Optional =
+ externalPriceId.getOptional("external_price_id")
- /**
- * Returns a mutable builder for constructing an instance of [RemoveAdjustment].
- *
- * The following fields are required:
- * ```java
- * .adjustmentId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
+ /**
+ * If the Price represents a fixed cost, this represents the quantity of units
+ * applied.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun fixedPriceQuantity(): Optional =
+ fixedPriceQuantity.getOptional("fixed_price_quantity")
- /** A builder for [RemoveAdjustment]. */
- class Builder internal constructor() {
+ /**
+ * The property used to group this price on an invoice
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun invoiceGroupingKey(): Optional =
+ invoiceGroupingKey.getOptional("invoice_grouping_key")
- private var adjustmentId: JsonField? = null
- private var planPhaseOrder: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
+ /**
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
+ * If unspecified, a single invoice is produced per billing cycle.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun invoicingCycleConfiguration(): Optional =
+ invoicingCycleConfiguration.getOptional("invoicing_cycle_configuration")
- @JvmSynthetic
- internal fun from(removeAdjustment: RemoveAdjustment) = apply {
- adjustmentId = removeAdjustment.adjustmentId
- planPhaseOrder = removeAdjustment.planPhaseOrder
- additionalProperties = removeAdjustment.additionalProperties.toMutableMap()
- }
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed
+ * by setting the value to `null`, and the entire metadata mapping can be cleared by
+ * setting `metadata` to `null`.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun metadata(): Optional = metadata.getOptional("metadata")
- /** The id of the adjustment to remove from on the plan. */
- fun adjustmentId(adjustmentId: String) = adjustmentId(JsonField.of(adjustmentId))
+ /**
+ * A transient ID that can be used to reference this price when adding adjustments
+ * in the same API call.
+ *
+ * @throws OrbInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun referenceId(): Optional = referenceId.getOptional("reference_id")
- /**
- * Sets [Builder.adjustmentId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.adjustmentId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun adjustmentId(adjustmentId: JsonField) = apply {
- this.adjustmentId = adjustmentId
- }
+ /**
+ * Returns the raw JSON value of [cadence].
+ *
+ * Unlike [cadence], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("cadence")
+ @ExcludeMissing
+ fun _cadence(): JsonField = cadence
- /** The phase to remove this adjustment from. */
- fun planPhaseOrder(planPhaseOrder: Long?) =
- planPhaseOrder(JsonField.ofNullable(planPhaseOrder))
+ /**
+ * Returns the raw JSON value of [itemId].
+ *
+ * Unlike [itemId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId
- /**
- * Alias for [Builder.planPhaseOrder].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?)
+ /**
+ * Returns the raw JSON value of [name].
+ *
+ * Unlike [name], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
- /** Alias for calling [Builder.planPhaseOrder] with `planPhaseOrder.orElse(null)`. */
- fun planPhaseOrder(planPhaseOrder: Optional) =
- planPhaseOrder(planPhaseOrder.getOrNull())
+ /**
+ * Returns the raw JSON value of [tieredWithProrationConfig].
+ *
+ * Unlike [tieredWithProrationConfig], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("tiered_with_proration_config")
+ @ExcludeMissing
+ fun _tieredWithProrationConfig(): JsonField =
+ tieredWithProrationConfig
- /**
- * Sets [Builder.planPhaseOrder] to an arbitrary JSON value.
- *
- * You should usually call [Builder.planPhaseOrder] with a well-typed [Long] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun planPhaseOrder(planPhaseOrder: JsonField) = apply {
- this.planPhaseOrder = planPhaseOrder
- }
+ /**
+ * Returns the raw JSON value of [billableMetricId].
+ *
+ * Unlike [billableMetricId], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("billable_metric_id")
+ @ExcludeMissing
+ fun _billableMetricId(): JsonField = billableMetricId
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
+ /**
+ * Returns the raw JSON value of [billedInAdvance].
+ *
+ * Unlike [billedInAdvance], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("billed_in_advance")
+ @ExcludeMissing
+ fun _billedInAdvance(): JsonField = billedInAdvance
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
+ /**
+ * Returns the raw JSON value of [billingCycleConfiguration].
+ *
+ * Unlike [billingCycleConfiguration], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("billing_cycle_configuration")
+ @ExcludeMissing
+ fun _billingCycleConfiguration(): JsonField =
+ billingCycleConfiguration
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
+ /**
+ * Returns the raw JSON value of [conversionRate].
+ *
+ * Unlike [conversionRate], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("conversion_rate")
+ @ExcludeMissing
+ fun _conversionRate(): JsonField = conversionRate
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+ /**
+ * Returns the raw JSON value of [conversionRateConfig].
+ *
+ * Unlike [conversionRateConfig], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("conversion_rate_config")
+ @ExcludeMissing
+ fun _conversionRateConfig(): JsonField = conversionRateConfig
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
+ /**
+ * Returns the raw JSON value of [currency].
+ *
+ * Unlike [currency], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("currency")
+ @ExcludeMissing
+ fun _currency(): JsonField = currency
- /**
- * Returns an immutable instance of [RemoveAdjustment].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .adjustmentId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): RemoveAdjustment =
- RemoveAdjustment(
- checkRequired("adjustmentId", adjustmentId),
- planPhaseOrder,
- additionalProperties.toMutableMap(),
- )
- }
+ /**
+ * Returns the raw JSON value of [dimensionalPriceConfiguration].
+ *
+ * Unlike [dimensionalPriceConfiguration], this method doesn't throw if the JSON
+ * field has an unexpected type.
+ */
+ @JsonProperty("dimensional_price_configuration")
+ @ExcludeMissing
+ fun _dimensionalPriceConfiguration(): JsonField =
+ dimensionalPriceConfiguration
- private var validated: Boolean = false
+ /**
+ * Returns the raw JSON value of [externalPriceId].
+ *
+ * Unlike [externalPriceId], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("external_price_id")
+ @ExcludeMissing
+ fun _externalPriceId(): JsonField = externalPriceId
- fun validate(): RemoveAdjustment = apply {
- if (validated) {
- return@apply
- }
+ /**
+ * Returns the raw JSON value of [fixedPriceQuantity].
+ *
+ * Unlike [fixedPriceQuantity], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("fixed_price_quantity")
+ @ExcludeMissing
+ fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity
- adjustmentId()
+ /**
+ * Returns the raw JSON value of [invoiceGroupingKey].
+ *
+ * Unlike [invoiceGroupingKey], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("invoice_grouping_key")
+ @ExcludeMissing
+ fun _invoiceGroupingKey(): JsonField = invoiceGroupingKey
+
+ /**
+ * Returns the raw JSON value of [invoicingCycleConfiguration].
+ *
+ * Unlike [invoicingCycleConfiguration], this method doesn't throw if the JSON field
+ * has an unexpected type.
+ */
+ @JsonProperty("invoicing_cycle_configuration")
+ @ExcludeMissing
+ fun _invoicingCycleConfiguration(): JsonField =
+ invoicingCycleConfiguration
+
+ /**
+ * Returns the raw JSON value of [metadata].
+ *
+ * Unlike [metadata], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("metadata")
+ @ExcludeMissing
+ fun _metadata(): JsonField = metadata
+
+ /**
+ * Returns the raw JSON value of [referenceId].
+ *
+ * Unlike [referenceId], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("reference_id")
+ @ExcludeMissing
+ fun _referenceId(): JsonField = referenceId
+
+ @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
+ * [TieredWithProration].
+ *
+ * The following fields are required:
+ * ```java
+ * .cadence()
+ * .itemId()
+ * .name()
+ * .tieredWithProrationConfig()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [TieredWithProration]. */
+ class Builder internal constructor() {
+
+ private var cadence: JsonField? = null
+ private var itemId: JsonField? = null
+ private var modelType: JsonValue = JsonValue.from("tiered_with_proration")
+ private var name: JsonField? = null
+ private var tieredWithProrationConfig: JsonField? =
+ null
+ private var billableMetricId: JsonField = JsonMissing.of()
+ private var billedInAdvance: JsonField = JsonMissing.of()
+ private var billingCycleConfiguration: JsonField =
+ JsonMissing.of()
+ private var conversionRate: JsonField = JsonMissing.of()
+ private var conversionRateConfig: JsonField =
+ JsonMissing.of()
+ private var currency: JsonField = JsonMissing.of()
+ private var dimensionalPriceConfiguration:
+ JsonField =
+ JsonMissing.of()
+ private var externalPriceId: JsonField = JsonMissing.of()
+ private var fixedPriceQuantity: JsonField = JsonMissing.of()
+ private var invoiceGroupingKey: JsonField = JsonMissing.of()
+ private var invoicingCycleConfiguration:
+ JsonField =
+ JsonMissing.of()
+ private var metadata: JsonField = JsonMissing.of()
+ private var referenceId: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(tieredWithProration: TieredWithProration) = apply {
+ cadence = tieredWithProration.cadence
+ itemId = tieredWithProration.itemId
+ modelType = tieredWithProration.modelType
+ name = tieredWithProration.name
+ tieredWithProrationConfig = tieredWithProration.tieredWithProrationConfig
+ billableMetricId = tieredWithProration.billableMetricId
+ billedInAdvance = tieredWithProration.billedInAdvance
+ billingCycleConfiguration = tieredWithProration.billingCycleConfiguration
+ conversionRate = tieredWithProration.conversionRate
+ conversionRateConfig = tieredWithProration.conversionRateConfig
+ currency = tieredWithProration.currency
+ dimensionalPriceConfiguration =
+ tieredWithProration.dimensionalPriceConfiguration
+ externalPriceId = tieredWithProration.externalPriceId
+ fixedPriceQuantity = tieredWithProration.fixedPriceQuantity
+ invoiceGroupingKey = tieredWithProration.invoiceGroupingKey
+ invoicingCycleConfiguration =
+ tieredWithProration.invoicingCycleConfiguration
+ metadata = tieredWithProration.metadata
+ referenceId = tieredWithProration.referenceId
+ additionalProperties =
+ tieredWithProration.additionalProperties.toMutableMap()
+ }
+
+ /** The cadence to bill for this price on. */
+ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence))
+
+ /**
+ * Sets [Builder.cadence] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cadence] with a well-typed [Cadence] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun cadence(cadence: JsonField) = apply { this.cadence = cadence }
+
+ /** The id of the item the price will be associated with. */
+ fun itemId(itemId: String) = itemId(JsonField.of(itemId))
+
+ /**
+ * Sets [Builder.itemId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.itemId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun itemId(itemId: JsonField) = apply { this.itemId = itemId }
+
+ /**
+ * Sets the field to an arbitrary JSON value.
+ *
+ * It is usually unnecessary to call this method because the field defaults to
+ * the following:
+ * ```java
+ * JsonValue.from("tiered_with_proration")
+ * ```
+ *
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun modelType(modelType: JsonValue) = apply { this.modelType = modelType }
+
+ /** The name of the price. */
+ fun name(name: String) = name(JsonField.of(name))
+
+ /**
+ * Sets [Builder.name] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.name] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun name(name: JsonField) = apply { this.name = name }
+
+ /** Configuration for tiered_with_proration pricing */
+ fun tieredWithProrationConfig(
+ tieredWithProrationConfig: TieredWithProrationConfig
+ ) = tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig))
+
+ /**
+ * Sets [Builder.tieredWithProrationConfig] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tieredWithProrationConfig] with a well-typed
+ * [TieredWithProrationConfig] value instead. This method is primarily for
+ * setting the field to an undocumented or not yet supported value.
+ */
+ fun tieredWithProrationConfig(
+ tieredWithProrationConfig: JsonField
+ ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig }
+
+ /**
+ * The id of the billable metric for the price. Only needed if the price is
+ * usage-based.
+ */
+ fun billableMetricId(billableMetricId: String?) =
+ billableMetricId(JsonField.ofNullable(billableMetricId))
+
+ /**
+ * Alias for calling [Builder.billableMetricId] with
+ * `billableMetricId.orElse(null)`.
+ */
+ fun billableMetricId(billableMetricId: Optional) =
+ billableMetricId(billableMetricId.getOrNull())
+
+ /**
+ * Sets [Builder.billableMetricId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.billableMetricId] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun billableMetricId(billableMetricId: JsonField